mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Fixed random timeout #11
This commit is contained in:
parent
0ed130e7fd
commit
3e54ceb8a3
5 changed files with 9 additions and 7 deletions
|
|
@ -52,7 +52,10 @@ class Session{
|
|||
$this->counter = array(0, 0);
|
||||
}
|
||||
|
||||
public function onTick($time){
|
||||
public function onTick($time, $event){
|
||||
if($event !== "onTick"){
|
||||
return;
|
||||
}
|
||||
if($time > $this->timeout){
|
||||
$this->close("timeout");
|
||||
}else{
|
||||
|
|
@ -169,7 +172,7 @@ class Session{
|
|||
}
|
||||
}
|
||||
|
||||
public function handle($pid, &$data){
|
||||
public function handle($pid, $data){
|
||||
if($this->connected === true){
|
||||
$this->timeout = microtime(true) + 25;
|
||||
switch($pid){
|
||||
|
|
@ -397,7 +400,7 @@ class Session{
|
|||
$this->buffer[$count] = array($id, $data);
|
||||
}
|
||||
$data["id"] = $id;
|
||||
$this->send(0x84, array(
|
||||
$this->send(0x80, array(
|
||||
$count,
|
||||
0x00,
|
||||
$data,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue