Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class ocpGame {
- public $type;
- public $roomID;
- public $server;
- public function __construct($type, $roomID){
- $this->type = $type;
- $this->roomID = $roomID;
- }
- public function handlePacket($packet, &$user){
- $raw = explode("%", $packet);
- $cmd = $raw[3];
- if($cmd == "zo")
- $coins = round((int) $raw[5] / 10, 0); // 1.96
- $user->setCoins((int)$user->getCoins() + $coins);
- if((int)$this->type == 1){
- //Single User
- if($cmd == "zo")
- $user->setCoins((int)$user->getCoins() + ((int) $raw[5] / 10));
- } else if((int)$this->type == 2){
- if($cmd == ""){ }
- } else {
- //Something's gone horribly wrong
- echo "Somethings gone horribly wrong. Game type: " . $this->type . ", room ID: " . $this->roomID . "\n";
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement