public function serial(MemStream $s) { $s->serial_uint32($nbItems); $s->serial_uint32($this->Bricks, $nbItems); $s->serial_byte($this->Castable); $s->serial_byte($this->ShowInActionProgression); $s->serial_byte($this->ShowInAPOnlyIfLearnt); }
public function serial(MemStream $s) { $s->serial_uint32($nbItems); $s->serial_uint32($this->UsedSkills, $nbItems); $s->serial_uint32($this->BrickFamily); $s->serial_byte($this->IndexInFamily); $s->serial_byte($this->Level); $s->serial_string($this->sTmp); $s->serial_string($this->Icon, 4); $s->serial_sint32($this->IconColor, 4); $s->serial_sint32($this->SabrinaCost); $s->serial_float($this->SabrinaRelativeCost); $s->serial_uint32($nbItems); $s->serial_short($this->MandatoryFamilies, $nbItems); $s->serial_uint32($nbItems); $s->serial_short($this->OptionalFamilies, $nbItems); $s->serial_uint32($nbItems); $s->serial_short($this->ParameterFamilies, $nbItems); $s->serial_uint32($nbItems); $s->serial_short($this->CreditFamilies, $nbItems); $s->serial_string($this->ForbiddenDef); $s->serial_string($this->ForbiddenExclude); $this->FaberPlan = new CFaberPlan(); $this->FaberPlan->serial($s); $this->Properties = array(); $s->serial_uint32($nbItems); for ($nb = 0; $nb < $nbItems; $nb++) { $row = new \stdClass(); $s->serial_string($row->Text); $this->Properties[] = $row; } $s->serial_byte($this->MinCastTime); $s->serial_byte($this->MaxCastTime); $s->serial_byte($this->MinRange); $s->serial_byte($this->MaxRange); $s->serial_uint64($this->BrickRequiredFlags); $s->serial_uint32($this->SPCost); $s->serial_uint32($this->ActionNature); $this->RequiredSkills = array(); $s->serial_uint32($nbItems); for ($nb = 0; $nb < $nbItems; $nb++) { $row = new CRequiredSkill(); $row->serial($s); $this->RequiredSkills[] = $row; } $s->serial_uint32($nbItems); $s->serial_uint32($this->RequiredBricks, $nbItems); $s->serial_byte($this->AvoidCyclic); $s->serial_byte($this->UsableWithEmptyHands); $s->serial_uint32($this->CivRestriction); $s->serial_sint32($this->FactionIndex); $s->serial_sint32($this->MinFameValue); $s->serial_uint32($this->MagicResistType); }
/** * @param MemStream $s */ public function serial(MemStream $s) { $s->serial_uint32($this->Ecosystem); $s->serial_uint32($this->MpCategory); $s->serial_uint32($this->HarvestSkill); $s->serial_uint32($this->Family); $s->serial_uint64($this->ItemPartBF); $s->serial_byte($this->UsedAsCraftRequirement); $s->serial_byte($this->MpColor); $s->serial_short($this->StatEnergy); }
public function serial(MemStream $s) { // CGenderInfo $gi = function (&$var) use($s) { $var = new \stdClass(); $nbItems = 7; $s->serial_string($var->Items, $nbItems); $s->serial_string($var->Skelfilename); $s->serial_string($var->AnimSetBaseName); $s->serial_string($var->LodCharacterName); $s->serial_float($var->LodCharacterDistance); $s->serial_float($var->CharacterScalePos); $var->GroundFX = array(); $s->serial_uint32($nbItems); for ($nb = 0; $nb < $nbItems; $nb++) { $row = new \stdClass(); $s->serial_uint32($row->GroundID); $s->Serial_string($row->FXName); $var->GroundFX[] = $row; } for ($nb = 0; $nb < 8; $nb++) { $s->serial_float($var->BlendShapeMin[$nb]); $s->serial_float($var->BlendShapeMax[$nb]); } $s->serial_float($var->NamePosZLow); $s->serial_float($var->NamePosZNormal); $s->serial_float($var->NamePosZHigh); }; $numCharacteristice = 8; $s->serial_byte($this->CharacStartValue, 8); $gi($this->GenderInfos[0]); $gi($this->GenderInfos[1]); $s->serial_byte($this->People); $s->serial_byte($this->Skin); $s->serial_string($this->Automaton); $this->BodyToBone = new \stdClass(); $s->serial_string($this->BodyToBone->Head); $s->serial_string($this->BodyToBone->Chest); $s->serial_string($this->BodyToBone->LeftArm); $s->serial_string($this->BodyToBone->RightArm); $s->serial_string($this->BodyToBone->LeftHand); $s->serial_string($this->BodyToBone->RightHand); $s->serial_string($this->BodyToBone->LeftLeg); $s->serial_string($this->BodyToBone->RightLeg); $s->serial_string($this->BodyToBone->LeftFoot); $s->serial_string($this->BodyToBone->RightFoot); $s->serial_uint32($nbItems); $s->serial_int_string($this->AttackLists, $nbItems); }
public function serial(MemStream $s) { $s->serial_float($this->X); $s->serial_float($this->Y); $s->serial_float($this->Z); $s->serial_byte($this->Selected); }
public function serial(MemStream $s) { $s->serial_byte($ver); $continents = array(); $s->serial_uint32($nbItems); for ($i = 0; $i < $nbItems; $i++) { $cont = new Client\CContinent(); $cont->serial($s); $name = $cont->Name; $continents[$name] = $cont; } $this->entries['continents'] = $continents; $worldmap = array(); $s->serial_uint32($nbItems); for ($i = 0; $i < $nbItems; $i++) { $map = new Client\CContLandMark(); $map->serial($s); $name = $map->TitleText; $worldmap[$name] = $map; } $this->entries['worldmap'] = $worldmap; $aliasmap = array(); if ($ver >= 1) { $s->serial_uint32($nbItems); for ($i = 0; $i < $nbItems; $i++) { $s->serial_uint32($id); $s->serial_string($key); $aliasmap[$id] = $key; } } $this->entries['aliasmap'] = $aliasmap; }
protected function readHeader(MemStream $s) { // check header $s->serial_buffer($hskp, 4); if ($hskp !== self::HEADER) { throw new \RuntimeException('Wrong packed sheets header, expected "' . self::HEADER . '"'); } $s->serial_uint32($header_version); if ($header_version != self::HEADER_VERSION) { throw new \RuntimeException('Wrong packed sheets version, expected "' . self::HEADER_VERSION . '", got "' . $header_version . '"'); } $s->serial_byte($this->compat); $s->serial_uint32($dependBlockSize); if ($this->skipDependBlock) { // skip dependency block $pos = $s->getPos(); $s->seek($pos + $dependBlockSize); } else { // read dictionary $s->serial_uint32($nb); $s->serial_int_string($this->dictionnary, $nb); // read dependency data $this->dependencies = array(); $s->serial_uint32($depSize); for ($i = 0; $i < $depSize; $i++) { $s->serial_uint32($sheetId); $s->serial_uint32($nb); $s->serial_uint32($this->dependencies[$sheetId], $nb); } } }
public function serial(MemStream $s) { $s->serial_byte($ver); $s->serial_uint32($this->Type); $this->Pos = new CVector2f(); $this->Pos->serial($s); $this->Zone = new CPrimZone(); $this->Zone->serial($s); $s->serial_string($this->TitleText); }
/** * Send message * * @param StreamInterface $message */ public function sendMessage(StreamInterface $message) { // TFormat from <nel/message.h> $messageType = 0; // build packet // <int32> packet length (length itself is not counted) // <int32> packet number // <byte> message type // <.....> message // first pass - to get packet length $hd = new MemStream(); $hd->serial_uint32($this->msgNum); $hd->serial_byte($messageType); // include original message $message->serial($hd); $this->msgNum++; $buf = $hd->getBuffer(); $len = strlen($buf); // second pass - final packet $hd = new MemStream(); $hd->serial_uint32_n($len); $hd->serial_buffer($buf); $this->sock->write($hd->getBuffer()); }
/** * Read macro icons added to taskbar * * @param MemStream $s */ protected function serialMacroMemory(MemStream $s) { $this->Macros = array(); $s->serial_uint32($nb); for ($i = 0; $i < $nb; $i++) { $s->serial_byte($line); $s->serial_byte($slot); $s->serial_uint32($id); $this->Macros[] = array('row' => $line, 'col' => $slot, 'id' => $id); } }
/** * @param MemStream $f */ public function serial(MemStream $f) { $version = 2; $f->serial_byte($version); $f->serial_byte($this->pktFormat); $f->serial_byte($this->race); $f->serial_byte($this->age); $this->vpa->serial($f); $this->vpb->serial($f); $this->vpc->serial($f); $f->serial_uint32($this->direction); $f->serial_uint32($this->angle); $b = $this->FaceShot ? 1 : 0; $f->serial_byte($b); $f->serial_uint32($this->background); $b = $this->useFx ? 1 : 0; $f->serial_byte($b); }
public function serial(MemStream $s) { $s->serial_byte($this->OriginFilter); $s->serial_byte($this->Stats, 34); }
public function serial(MemStream $s) { $s->serial_byte($this->Gender); $s->serial_uint32($this->Race); $s->serial_string($this->SkelFilename); $s->serial_string($this->AnimSetBaseName); $s->serial_string($this->Automaton); $s->serial_float($this->Scale); $s->serial_uint32($this->SoundFamily); $s->serial_uint32($this->SoundVariation); $s->serial_string($this->LodCharacterName); $s->serial_float($this->LodCharacterDistance); $s->serial_byte($this->Selectable); $s->serial_byte($this->Talkable); $s->serial_byte($this->Attackable); $s->serial_byte($this->Givable); $s->serial_byte($this->Mountable); $s->serial_byte($this->Turn); $s->serial_byte($this->SelectableBySpace); $s->serial_uint32($this->HLState); $s->serial_float($this->CharacterScalePos); $s->serial_float($this->NamePosZLow); $s->serial_float($this->NamePosZNormal); $s->serial_float($this->NamePosZHigh); $s->serial_string($this->Fame); // CEquipment::serial() $eq = function (&$row) use($s) { $row = new \stdClass(); $s->serial_string($row->Item); $s->serial_byte($row->Texture); $s->serial_byte($row->Color); $s->serial_string($row->BindPoint); }; $eq($this->Body); $eq($this->Legs); $eq($this->Arms); $eq($this->Hands); $eq($this->Feet); $eq($this->Head); $eq($this->Face); $eq($this->ObjectInRightHand); $eq($this->ObjectInLeftHand); $s->serial_byte($this->HairColor); $s->serial_byte($this->Skin); $s->serial_byte($this->EyesColor); $s->serial_float($this->DistToFront); $s->serial_float($this->DistToBack); $s->serial_float($this->DistToSide); $s->serial_float($this->ColRadius); $s->serial_float($this->ColHeight); $s->serial_float($this->ColLength); $s->serial_float($this->ColWidth); $s->serial_float($this->MaxSpeed); $s->serial_float($this->ClipRadius); $s->serial_float($this->ClipHeight); $s->serial_uint32($nbItems); $s->serial_string($this->AlternativeClothes, $nbItems); $this->HairItemList = array(); $s->serial_uint32($nbItems); for ($nb = 0; $nb < $nbItems; $nb++) { $eq($this->HairItemList[$nb]); } $this->GroundFX = array(); $s->serial_uint32($nbItems); for ($nb = 0; $nb < $nbItems; $nb++) { $row = new \stdClass(); $s->serial_uint32($row->GroundID); $s->Serial_string($row->FXName); $this->GroundFX[] = $row; } $s->serial_byte($this->DisplayOSD); $s->serial_string($this->StaticFX); $this->BodyToBone = new \stdClass(); $s->serial_string($this->BodyToBone->Head); $s->serial_string($this->BodyToBone->Chest); $s->serial_string($this->BodyToBone->LeftArm); $s->serial_string($this->BodyToBone->RightArm); $s->serial_string($this->BodyToBone->LeftHand); $s->serial_string($this->BodyToBone->RightHand); $s->serial_string($this->BodyToBone->LeftLeg); $s->serial_string($this->BodyToBone->RightLeg); $s->serial_string($this->BodyToBone->LeftFoot); $s->serial_string($this->BodyToBone->RightFoot); $s->serial_uint32($nbItems); $s->serial_string($this->AttackLists, $nbItems); // bot object flags $s->serial_byte($this->DisplayInRadar); $s->serial_byte($this->DisplayOSDName); $s->serial_byte($this->DisplayOSDBars); $s->serial_byte($this->DisplayOSDForceOver); $s->serial_byte($this->Traversable); $s->serial_byte($this->RegionForce); $s->serial_byte($this->ForceLevel); $s->serial_short($this->Level); $this->ProjectileCastRay = array(); $s->serial_uint32($nbItems); for ($nb = 0; $nb < $nbItems; $nb++) { $row = new \stdClass(); $s->serial_float($row->Origin, 3); $s->serial_float($row->Pos, 3); $this->ProjectileCastRay[] = $row; } $s->serial_byte($this->R2Npc); }
/** * @param MemStream $s */ public function serial(MemStream $s) { $s->serial_string($this->MaleShape); $s->serial_string($this->FemaleShape); $s->serial_uint64($this->SlotBF); $s->serial_uint32($this->MapVariant); $s->serial_uint32($this->Family); $s->serial_uint32($this->ItemType); $s->serial_string($this->Icon, 4); $s->serial_sint32($this->IconColor, 4); $s->serial_string($this->IconText); $s->serial_string($this->AnimSet); $s->serial_sint8($this->Color); $s->serial_byte($this->HasFx); $s->serial_byte($this->DropOrSell); $s->serial_byte($this->IsItemNoRent); $s->serial_byte($this->NeverHideWhenEquiped); $s->serial_uint32($this->Stackable); $s->serial_byte($this->IsConsumable); $s->serial_float($this->Bulk); $s->serial_uint32($this->EquipTime); $this->FX = new CFX(); $this->FX->serial($s); $s->serial_uint32($nbItems); $this->StaticFXs = array(); for ($fx = 0; $fx < $nbItems; $fx++) { $sfx = new CStaticFX(); $sfx->serial($s); $this->StaticFXs[] = $sfx; } $s->serial_string($this->Effect, 4); $s->serial_uint32($nbItems); $this->MpItemParts = array(); for ($mp = 0; $mp < $nbItems; $mp++) { $row = new CMpItemPart(); $row->serial($s); $this->MpItemParts[] = $row; } $s->serial_uint32($this->CraftPlan); $s->serial_uint32($this->RequiredCharac); $s->serial_short($this->RequiredCharacLevel); $s->serial_uint32($this->RequiredSkill); $s->serial_short($this->RequiredSkillLevel); $s->serial_uint32($this->ItemOrigin); switch ($this->Family) { case EItemFamily::ARMOR: $this->Armor = new CArmor(); $this->Armor->serial($s); break; case EItemFamily::MELEE_WEAPON: $this->MeleeWeapon = new CMeleeWeapon(); $this->MeleeWeapon->serial($s); break; case EItemFamily::RANGE_WEAPON: $this->RangeWeapon = new CRangeWeapon(); $this->RangeWeapon->serial($s); break; case EItemFamily::AMMO: $this->Ammo = new CAmmo(); $this->Ammo->serial($s); break; case EItemFamily::RAW_MATERIAL: $this->Mp = new CMp(); $this->Mp->serial($s); break; case EItemFamily::SHIELD: $this->Shield = new CShield(); $this->Shield->serial($s); break; case EItemFamily::CRAFTING_TOOL: case EItemFamily::HARVEST_TOOL: case EItemFamily::TAMING_TOOL: $this->Tool = new CTool(); $this->Tool->serial($s); break; case EItemFamily::TELEPORT: $this->Teleport = new CTeleport(); $this->Teleport->serial($s); break; case EItemFamily::PET_ANIMAL_TICKET: $this->Pet = new CPet(); $this->Pet->serial($s); break; case EItemFamily::GUILD_OPTION: $this->GuildOption = new CGuildOption(); $this->GuildOption->serial($s); break; case EItemFamily::COSMETIC: $this->Cosmetic = new CCosmetic(); $this->Cosmetic->serial($s); break; case EItemFamily::CONSUMABLE: $this->Consumable = new CConsumable(); $this->Consumable->serial($s); break; case EItemFamily::SCROLL: $this->Scroll = new CScroll(); $this->Scroll->serial($s); break; } }