예제 #1
0
 public function __construct($id, $kind, $x, $y)
 {
     parent::__construct($id, "mob", $kind, $x, $y);
     $this->updateHitPoints();
     $this->spawningX = $x;
     $this->spawningY = $y;
     $this->armorLevel = Properties::getArmorLevel($this->kind);
     $this->weaponLevel = Properties::getWeaponLevel($this->kind);
     $this->hatelist = array();
     $this->respawnTimeout = null;
     $this->returnTimeout = null;
     $this->isDead = false;
 }
예제 #2
0
 public function __construct($connection, $worldServer)
 {
     $this->server = $worldServer;
     $this->connection = $connection;
     parent::__construct($this->connection->id, 'player', TYPES_ENTITIES_WARRIOR, 0, 0, '');
     $this->hasEnteredGame = false;
     $this->isDead = false;
     $this->haters = array();
     $this->lastCheckpoint = null;
     $this->formatChecker = new FormatChecker();
     $this->disconnectTimeout = 0;
     $this->connection->onMessage = array($this, 'onClientMessage');
     $this->connection->onClose = array($this, 'onClientclose');
     $this->connection->onWebSocketConnect = function ($con) {
         $con->send('go');
     };
 }