-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Den här filen är till för att hantera löpande kommunikation mellan server och klient
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
header('Content-Type: text/plain; charset=utf-8'); | ||
|
||
$queue = explode("\n", file_get_contents('status/queue')); //Läs in köfilen | ||
$queue_pos = array_search($_COOKIE['queue'], $queue, true); //2=Aktuell spelare, 3=nästkommande spelare ..., false=Inte i kön | ||
if($queue_pos != 2) { echo 'Ej först i kön!'; exit; } //Hantera inte kommandon från fel spelare! | ||
|
||
$cmd = $_SERVER['PATH_INFO']; | ||
$robot_ip = file_get_contents('server/robot_ip'); | ||
|
||
|
||
switch($cmd) { | ||
//case 'kommandonamn': kod som utför kommandot; echo svar; break; | ||
//case 'kommandonamn': kod som utför kommandot; echo svar; break; | ||
|
||
|
||
default: echo 'okänt_kommando ', $cmd, "\n"; | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|