本文整理匯總了PHP中UserStatus::Decode方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserStatus::Decode方法的具體用法?PHP UserStatus::Decode怎麽用?PHP UserStatus::Decode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UserStatus
的用法示例。
在下文中一共展示了UserStatus::Decode方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Decode
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;
}