Skip to content

Commit

Permalink
Server also echo "response message"
Browse files Browse the repository at this point in the history
  • Loading branch information
chalkpe committed Nov 28, 2014
1 parent 5dac4a2 commit 7ab4d5d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions plugin/src/ifteam/CustomPacket/CustomSocket.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ public function run(){
while(1){
$buffer = $address = $port = NULL;
if($this->recvPacket($buffer, $address, $port) !== false){
echo 'GOTCHA! from: '.$address.':'.$port.', data: '.$buffer.PHP_EOL;
echo 'GOTCHA!! from: '.$address.':'.$port.', data: '.$buffer.PHP_EOL;
$plugin->callEvent('rcv', array('rawstring' => $buffer, 'ip' => $address, 'port' => $port));
$this->sendPacket('You sent '. $buffer .' !!! success! WOW!', $address, $port, true); //Test code. should be remove in official release.

$message = 'You sent "'. $buffer .'" to me! WOW!';
echo 'responding to: '.$address.':'.$port.', data: '.$message.$buffer.PHP_EOL;
$this->sendPacket($message, $address, $port, true); //Test code. should be remove in official release.
}
}
}
Expand Down

0 comments on commit 7ab4d5d

Please sign in to comment.