public function Decode(CodeEngine &$buf) { $len = $buf->DecodeInt16(); $len -= 2; $this->setBitMap($buf->DecodeInt32()); $len -= 4; $this->setMinPoint($buf->DecodeInt32()); $len -= 4; $this->setMaxPointGap($buf->DecodeInt32()); $len -= 4; $this->setMaxOfflineRate($buf->DecodeInt8()); $len -= 1; $this->setIPBit($buf->DecodeInt8()); $len -= 1; $this->setOtherSize($buf->DecodeInt8()); $len -= 1; if ($this->OtherSize > max_game_other_data_count) { $this->OtherSize = max_game_other_data_count; } $t = array(); for ($i = 0; $i < $this->getOtherSize(); $i++) { $t[] = $buf->DecodeInt32(); $len -= 4; } $this->setOthers($t); if ($len < 0) { return 0; } else { $buf->DecodeMemory($len); } return $len; }
public function Decode(CodeEngine &$buf) { $len = $buf->DecodeInt16(); $len -= 2; $this->GameID = $buf->DecodeInt16(); $len -= 2; $this->Level = $buf->DecodeInt8(); $len -= 1; $this->Point = $buf->DecodeInt32(); $len -= 4; $this->WinRound = $buf->DecodeInt32(); $len -= 4; $this->LoseRound = $buf->DecodeInt32(); $len -= 4; $this->DrawRound = $buf->DecodeInt32(); $len -= 4; $this->EscapeRound = $buf->DecodeInt32(); $len -= 4; $this->OrgID = $buf->DecodeInt32(); $len -= 4; $this->Position = $buf->DecodeInt16(); $len -= 2; $this->TotalSecs = $buf->DecodeInt32(); $len -= 4; $this->LastDate = $buf->DecodeString(); $len -= strlen($this->LastDate); $this->ExtGameInfo = new TDBExtGameInfo(); $this->ExtGameInfo->Decode($buf); $this->GameConfig = new PlayerGameConfig(); $this->GameConfig->Decode($buf); return $len; }
public function Decode(CodeEngine &$buf) { $length = $buf->DecodeInt16(); $this->ExtIndex = $buf->DecodeInt16(); $this->UpdateMode = $buf->DecodeInt8(); $this->ExtVal = $buf->DecodeInt32(); return $this; }
public static function decode_EquipmentUpdate(CodeEngine &$buf) { $eu = new EquipmentUpdate(); $eu->setEquipmentUpdateMod($buf->DecodeInt8()); $eu->setEquipmentPosi($buf->DecodeInt32()); $eu->setItemId($buf->DecodeInt32()); return $eu; }
public function Decode(CodeEngine &$buf) { $len = 0; $DataSize = $buf->DecodeInt16(); $len += 2; $this->Class = $buf->DecodeInt8(); $DataSize -= 1; $len += 1; if (StateClass::HALL_SERVER_STATUE_DATA_TYPE == $this->Class) { $temp = new HallServerStateGM(); $temp->State = $buf->DecodeInt32(); $DataSize -= 4; $len += 4; $temp->ServerId = $buf->DecodeInt32(); $DataSize -= 4; $len += 4; $this->hallState = $temp; } elseif (StateClass::LOGIC_SERVER_STATUE_DATA_TYPE == $this->Class) { $temp = new LogicServerState(); $temp->RoomCount = $buf->DecodeInt8(); $DataSize -= 1; $len += 1; if ($temp->RoomCount > MAX_ROOM_SESSION_COUNT) { $temp->RoomCount = MAX_ROOM_SESSION_COUNT; } $temp->Status = array(); for ($i = 0; $i < $temp->RoomCount; $i++) { $temp1 = new UserStatus(); $r = $temp1->Decode($buf); $DataSize -= $r; $len += $r; $temp->Status[] = $temp1; } $this->logicState = $temp; } else { return 0; } if ($DataSize < 0) { return 0; } else { $len += $DataSize; $buf->DecodeMemory($DataSize); } return $len; }
public function Decode(CodeEngine &$buf) { $this->DataType = $buf->DecodeInt8(); switch ($this->DataType) { case PlayerActionDataType::PAD_TYPE_LOGIN: $this->DataValue->LoginCount = $buf->DecodeInt32(); $this->DataValue->HallServerId = $buf->DecodeInt16(); $this->DataValue->HallPlayerId = $buf->DecodeInt32(); break; } }
public function Decode(CodeEngine &$buf) { $len = 0; $StatusSize = $buf->DecodeInt16(); $len += 2; $this->GameID = $buf->DecodeInt16(); $len += 2; $StatusSize -= 2; $this->ServerID = $buf->DecodeInt32(); $len += 4; $StatusSize -= 4; $this->RoomID = $buf->DecodeInt32(); $len += 4; $StatusSize -= 4; $this->TableID = $buf->DecodeInt32(); $len += 4; $StatusSize -= 4; $this->SeatID = $buf->DecodeInt8(); $len += 1; $StatusSize -= 1; $this->State = $buf->DecodeInt8(); $len += 1; $StatusSize -= 1; $this->Path = $buf->DecodeString(); $StatusSize -= 2; $len += 2; $len += strlen($this->Path); $StatusSize -= strlen($this->Path); if ($StatusSize < 0) { return 0; } else { $buf->DecodeMemory($StatusSize); $len += $StatusSize; } return $len; }
public function Decode(CodeEngine &$buf) { $len = 0; $PlayStatusSize = $buf->DecodeInt16(); $len += 2; $this->Uin = $buf->DecodeInt32(); $len += 4; $PlayStatusSize -= 4; $this->Account = $buf->DecodeString(); //lsybegin //字符串前头自带2字节长度前缀,在字符数据之外 $len += 2; $PlayStatusSize -= 2; //lsyend $len += strlen($this->Account); $PlayStatusSize -= strlen($this->Account); $this->ClassCount = $buf->DecodeInt8(); $len += 1; $PlayStatusSize -= 1; if ($this->ClassCount > StateClass::MAX_CLASS_COUNT) { $this->ClassCount = StateClass::MAX_CLASS_COUNT; } $this->StateData = array(); for ($i = 0; $i < $this->ClassCount; $i++) { $temp = new StateData(); $r = $temp->Decode($buf); $len += $r; $PlayStatusSize -= $r; $this->StateData[] = $temp; } if ($PlayStatusSize < 0) { return 0; } else { $len += $PlayStatusSize; $buf->DecodeMemory($PlayStatusSize); } return $len; }
public function Decode(CodeEngine &$buf) { $this->DataType = $buf->DecodeInt8(); switch ($this->DataType) { case QunPlayerDataType::QPD_Type_Charming: $this->Charming->DeltaValue = $buf->DecodeInt32(); $this->Charming->CurrentValue = $buf->DecodeInt32(); break; case QunPlayerDataType::QPD_Type_Achievement: $this->Achievement->DeltaValue = $buf->DecodeInt32(); $this->Achievement->CurrentValue = $buf->DecodeInt32(); break; case QunPlayerDataType::QPD_Type_Money: $this->Money->DeltaValue = $buf->DecodeInt32(); $this->Money->DeltaValue = $buf->DecodeInt32(); break; case QunPlayerDataType::QPD_Type_HappyBean: $this->HappyBean->DeltaValue = $buf->DecodeInt32(); $this->HappyBean->CurrentValue = $buf->DecodeInt32(); break; case QunPlayerDataType::QPD_Type_GameResultChange: $this->GameResultChange->DeltaGamePoint = $buf->DecodeInt32(); $this->GameResultChange->DeltaWinRound = $buf->DecodeInt32(); $this->GameResultChange->DeltaLossRound = $buf->DecodeInt32(); $this->GameResultChange->DeltaDrawRound = $buf->DecodeInt32(); $this->GameResultChange->DeltaEscapeRound = $buf->DecodeInt32(); $this->GameResultChange->DeltaCostTime = $buf->DecodeInt32(); $this->GameResultChange->GamePoint = $buf->DecodeInt32(); $this->GameResultChange->WinRound = $buf->DecodeInt32(); $this->GameResultChange->LossRound = $buf->DecodeInt32(); $this->GameResultChange->DrawRound = $buf->DecodeInt32(); $this->GameResultChange->EscapeRound = $buf->DecodeInt32(); $this->GameResultChange->CostTime = $buf->DecodeInt32(); break; } return $this; }
public function Decode(CodeEngine &$buf) { $this->DataType = $buf->DecodeInt8(); $this->DataValue = new DataValue(); switch ($this->DataType) { case PlayCommandDataType::PCD_Charming: $this->DataValue->Charming = $buf->DecodeInt32(); break; case PlayCommandDataType::PCD_Achievement: $this->DataValue->Achievement = $buf->DecodeInt32(); break; case PlayCommandDataType::PCD_PunishMethod: $this->DataValue->Punish->ValidDate = $buf->DecodeString(); $this->DataValue->Punish->BlackLevel = $buf->DecodeInt8(); $this->DataValue->Punish->PunishMethod = $buf->DecodeInt16(); $this->DataValue->Punish->DescString = $buf->DecodeString(); break; case PlayCommandDataType::PCD_OtherData: $this->DataValue->OtherData->OtherDataIndex = $buf->DecodeInt8(); $this->DataValue->OtherData->UpdateMode = $buf->DecodeInt8(); $this->DataValue->OtherData->OtherDataValue = $buf->DecodeInt8(); break; case PlayCommandDataType::PCD_LoginCount: $this->DataValue->LoginCount = $buf->DecodeInt32(); break; case PlayCommandDataType::PCD_LastLoginTime: $this->DataValue->LastLoginTime = $buf->DecodeInt32(); break; case PlayCommandDataType::PCD_LastLoginIP: $this->DataValue->LastLoginIP = $buf->DecodeInt32(); break; case PlayCommandDataType::PCD_WebQunData: $this->DataValue->WebQunData->DataSize = $buf->DecodeInt32(); $this->DataValue->WebQunData->WebQunInfo = $buf->DecodeMemory($this->DataValue->WebQunData->DataSize); break; case PlayCommandDataType::PCD_VipData: $this->DataValue->VipData = new VipData(); $this->DataValue->VipData = $this->DataValue->VipData->Decode($buf); break; case PlayCommandDataType::PCD_IdCard: $this->DataValue->IDCard = $buf->DecodeString(); break; case PlayCommandDataType::PCD_Sex: $this->DataValue->Sex = $buf->DecodeInt8(); break; case PlayCommandDataType::PCD_Birthday: $this->DataValue->BirThday = new Birthday(); $this->DataValue->BirThday->Year = $buf->DecodeInt16(); $this->DataValue->BirThday->Month = $buf->DecodeInt16(); $this->DataValue->BirThday->Day = $buf->DecodeInt16(); break; default: break; } return $this; }
public static function decode_item_info(CodeEngine &$buf) { $ii = new ItemInfo(); $temp = $buf->DecodeInt16(); $ii->setItemID($buf->DecodeInt32()); $ii->setItemType($buf->DecodeInt16()); $ii->setCount($buf->DecodeInt32()); $ii->setGameID($buf->DecodeInt16()); $ii->setExpiredTime($buf->DecodeInt32()); $ii->setUpdateMode($buf->DecodeInt8()); return $ii; }