/** * @param MemStream $s */ public function serial(MemStream $s) { if ($s->isReading()) { $s->serial_uint64($val); $this->setValue($val); } else { $val = $this->getValue(); $s->serial_uint64($val); } }
/** * @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); }
/** * Read key:value settings like window colors and their state * Data format depends on key * * @param MemStream $s */ protected function serialDatabase(MemStream $s) { if ($this->Version >= 9) { $s->serial_uint32($uiDbSaveVersion); } else { $uiDbSaveVersion = 0; } $s->serial_uint32($nb); for ($i = 0; $i < $nb; $i++) { // serial(leafTmp<SDBLeaf>) $s->serialVersion($v); // $v==1 $s->serial_string($name); $s->serial_uint64($value); if ($v >= 1) { $s->serial_uint64($oldvalue); } } }
/** * @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; } }