<?php
class GameClient extends SocketClient
{
private $characterEID; // Unique ID of character in game engine //
private $lastInput;
private $clientType = GC_TELNET; // Telnet, WebSocket or Flash //
function setCharEID($eid)
{
$this->characterEID = $eid;
}
function getCharEID()
{
return $this->characterEID;
}
function setClientType($type)
{
$this->clientType = $type;
}
function getClientType()
{
return $this->clientType;
}
function getLastTime()
{
return $this->lastInput;
}
function setLastTime()
{
$this->lastInput = microtime(true);
}
function send($buf)
{
if ($buf != "") // New messages to send //
{
if (is_resource($this->socket))
{
if ($this->clientType != GC_WEBSOCKET)
socket_write($this->socket, $buf . "\r\n");
else
socket_write($this->socket, chr(0) . $buf . chr(255));
}
}
}
}
?>