Advertisement
Whistik

Untitled

Mar 21st, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.22 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * @package   TinyIsland-Private
  5.  * @version   1.0
  6.  * @author    Whistik
  7. **/
  8.  
  9. require_once('./res/development/class/utility.class.php');
  10. require_once('./res/development/class/player.class.php');
  11. require_once('./res/development/config.php');
  12.  
  13. if(!isset($_GET['req'])){
  14.     exit("error:message to short b");
  15. }
  16.  
  17. $player = new Player();
  18. $utility = new UTILITY();
  19.  
  20. $sessionID = explode("|", $_GET['req']);
  21. $sessionID = $sessionID[0];
  22.  
  23. $req = substr($_GET['req'], 33);
  24. $req = explode(":", $req);
  25. $action = $req[0];
  26. $args = explode("/", $req[1]);
  27. $action_file = "./res/development/game_actions/$action.php";
  28.  
  29.  
  30. $return = [];
  31. if(file_exists($action_file)){
  32.     require_once('./res/development/game_actions/'.$action.'.php');
  33.     print(execute_action($args));
  34. }else{
  35.     $tempdoc_file = file_get_contents("./res/development/tempdoc.php");
  36.     $tempdoc_file = str_replace("@action", $action, $tempdoc_file);
  37.     $tempaction = implode("|", $args);
  38.     $tempdoc_file = str_replace("@arguments", $tempaction, $tempdoc_file);
  39.     $tempdoc_file = str_replace("@triggered", UTILITY::UTILITY_GETDATE(), $tempdoc_file);
  40.     $actionScript = fopen($action_file, "w");
  41.     fclose($actionScript);
  42.     file_put_contents($action_file, $tempdoc_file);
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement