コード例 #1
0
        public void Pack(ICustomDataWriter writer)
        {
            CustomDataWriter customWriter = new();

            Serialize(customWriter);

            var size = customWriter.Data.Length;

            uint typeLen = ComputeTypeLen((uint)size);

            writer.WriteShort((short)SubComputeStaticHeader(MessageId, typeLen));
            writer.WriteUInt(GLOBAL_INSTANCE++);

            switch (typeLen)
            {
            case 1:
                writer.WriteByte((byte)size);
                break;

            case 2:
                writer.WriteUShort((ushort)size);
                break;

            case 3:
                writer.WriteByte((byte)(size >> 16 & 255));
                writer.WriteUShort((ushort)(size & 65535));
                break;
            }

            writer.WriteBytes(customWriter.Data);
            customWriter.Dispose();
        }
コード例 #2
0
 public override void Serialize(ICustomDataWriter writer)
 {
     writer.WriteVarInt(this.GuildId);
     writer.WriteVarLong(this.LeaderId);
     writer.WriteByte(this.GuildLevel);
     writer.WriteByte(this.NbMembers);
 }
コード例 #3
0
 public override void Serialize(ICustomDataWriter writer)
 {
     writer.WriteByte(this.JobId);
     writer.WriteByte(this.JobLevel);
     writer.WriteBoolean(this.Free);
     writer.WriteByte(this.MinLevel);
 }
コード例 #4
0
 public override void Serialize(ICustomDataWriter writer)
 {
     writer.WriteByte(this.AlignmentSide);
     writer.WriteByte(this.AlignmentValue);
     writer.WriteByte(this.AlignmentGrade);
     writer.WriteDouble(this.CharacterPower);
 }
コード例 #5
0
 public override void Serialize(ICustomDataWriter writer)
 {
     base.Serialize(writer);
     writer.WriteVarShort(this.Days);
     writer.WriteByte(this.Hours);
     writer.WriteByte(this.Minutes);
 }
コード例 #6
0
 public override void Serialize(ICustomDataWriter writer)
 {
     writer.WriteVarShort(this.CellId);
     writer.WriteByte(this.ZoneSize);
     writer.WriteInt(this.CellColor);
     writer.WriteByte(this.CellsType);
 }
コード例 #7
0
 public override void Serialize(ICustomDataWriter writer)
 {
     writer.WriteByte(0);   // Side
     writer.WriteByte(0);   // Value
     writer.WriteByte(0);   // Grade
     writer.WriteDouble(0); // Character power
 }
コード例 #8
0
ファイル: ObjectEffectMount.cs プロジェクト: tuita520/RaidBot
        public override void Serialize(ICustomDataWriter writer)
        {
            base.Serialize(writer);
            byte box = 0;

            box = BooleanByteWrapper.SetFlag(box, 0, Sex);
            box = BooleanByteWrapper.SetFlag(box, 1, IsRideable);
            box = BooleanByteWrapper.SetFlag(box, 2, IsFeconded);
            box = BooleanByteWrapper.SetFlag(box, 3, IsFecondationReady);
            writer.WriteByte(box);
            writer.WriteVarLong(this.Id_);
            writer.WriteVarLong(this.ExpirationDate);
            writer.WriteVarInt(this.Model);
            writer.WriteUTF(this.Name);
            writer.WriteUTF(this.Owner);
            writer.WriteByte(this.Level);
            writer.WriteVarInt(this.ReproductionCount);
            writer.WriteVarInt(this.ReproductionCountMax);
            writer.WriteShort(this.Effects.Length);
            foreach (ObjectEffectInteger item in this.Effects)
            {
                item.Serialize(writer);
            }
            writer.WriteShort(this.Capacities.Length);
            foreach (int item in this.Capacities)
            {
                writer.WriteVarInt(item);
            }
        }
コード例 #9
0
 public override void Serialize(ICustomDataWriter writer)
 {
     writer.WriteVarInt(this.SymbioteUID);
     writer.WriteByte(this.SymbiotePos);
     writer.WriteVarInt(this.HostUID);
     writer.WriteByte(this.HostPos);
 }
コード例 #10
0
        public override void Serialize(ICustomDataWriter writer)
        {
            var box0 = new ByteBox();

            box0[0] = false; // Cant be aggressed
            box0[1] = false; // Cant be challenged
            box0[2] = false; // Cant trade
            box0[3] = false; // Cant be attacked by mutant
            box0[4] = false; // Cant run
            box0[5] = false; // Force slow walk
            box0[6] = false; // Cant minimize
            box0[7] = false; // Cant move
            writer.WriteByte(box0.Value);

            var box1 = new ByteBox();

            box1[0] = false; // Cant aggress
            box1[1] = false; // Cant challenge
            box1[2] = false; // Cant exchange
            box1[3] = false; // Cant attack
            box1[4] = false; // Cant chat
            box1[5] = false; // Cant be merchant
            box1[6] = false; // cant use object
            box1[7] = false; // Cant use tax collector
            writer.WriteByte(box1.Value);

            var box2 = new ByteBox();

            box2[0] = false; // Cant use interactive
            box2[1] = false; // Cant speak to npc
            box2[2] = false; // Cant change zone
            box2[3] = false; // Cant attack monster
            box2[4] = false; // Cant walk 8 direction
            writer.WriteByte(box2.Value);
        }
コード例 #11
0
 public override void Serialize(ICustomDataWriter writer)
 {
     writer.WriteVarShort(this.FightId);
     writer.WriteByte(this.TeamId);
     writer.WriteByte(this.Option);
     writer.WriteBoolean(this.State);
 }
 public override void Serialize(ICustomDataWriter writer)
 {
     base.Serialize(writer);
     this.OwnerInformations.Serialize(writer);
     writer.WriteByte(this.Theme);
     writer.WriteByte(this.RoomId);
     writer.WriteByte(this.MaxRoomId);
 }
コード例 #13
0
ファイル: PrismInformation.cs プロジェクト: tuita520/RaidBot
 public override void Serialize(ICustomDataWriter writer)
 {
     writer.WriteByte(this.TypeId);
     writer.WriteByte(this.State);
     writer.WriteInt(this.NextVulnerabilityDate);
     writer.WriteInt(this.PlacementDate);
     writer.WriteVarInt(this.RewardTokenCount);
 }
コード例 #14
0
 public override void Serialize(ICustomDataWriter writer)
 {
     writer.WriteByte(this.TeamId);
     writer.WriteDouble(this.LeaderId);
     writer.WriteByte(this.TeamSide);
     writer.WriteByte(this.TeamTypeId);
     writer.WriteByte(this.NbWaves);
 }
コード例 #15
0
 public override void Serialize(ICustomDataWriter writer)
 {
     writer.WriteInt(this.AreaId);
     writer.WriteByte(this.AtLeastNbMount);
     writer.WriteByte(this.AtLeastNbMachine);
     writer.WriteVarLong(this.MaxPrice);
     writer.WriteByte(this.OrderBy);
 }
コード例 #16
0
ファイル: JobExperience.cs プロジェクト: tuita520/RaidBot
 public override void Serialize(ICustomDataWriter writer)
 {
     writer.WriteByte(this.JobId);
     writer.WriteByte(this.JobLevel);
     writer.WriteVarLong(this.JobXP);
     writer.WriteVarLong(this.JobXpLevelFloor);
     writer.WriteVarLong(this.JobXpNextLevelFloor);
 }
コード例 #17
0
 public override void Serialize(ICustomDataWriter writer)
 {
     writer.WriteInt(this.AreaId);
     writer.WriteByte(this.AtLeastNbRoom);
     writer.WriteByte(this.AtLeastNbChest);
     writer.WriteVarShort(this.SkillRequested);
     writer.WriteVarLong(this.MaxPrice);
     writer.WriteByte(this.OrderBy);
 }
コード例 #18
0
 public override void Serialize(ICustomDataWriter writer)
 {
     writer.WriteByte(this.Major);
     writer.WriteByte(this.Minor);
     writer.WriteByte(this.Release);
     writer.WriteInt(this.Revision);
     writer.WriteByte(this.Patch);
     writer.WriteByte(this.BuildType);
 }
コード例 #19
0
 public override void Serialize(ICustomDataWriter writer)
 {
     base.Serialize(writer);
     writer.WriteByte(this.PartyType);
     writer.WriteUTF(this.PartyName);
     writer.WriteByte(this.MaxParticipants);
     writer.WriteVarLong(this.FromId);
     writer.WriteUTF(this.FromName);
     writer.WriteVarLong(this.ToId);
 }
コード例 #20
0
 public override void Serialize(ICustomDataWriter writer)
 {
     writer.WriteUTF(this.GuildOwner);
     writer.WriteShort(this.WorldX);
     writer.WriteShort(this.WorldY);
     writer.WriteVarShort(this.SubAreaId);
     writer.WriteByte(this.NbMount);
     writer.WriteByte(this.NbObject);
     writer.WriteVarLong(this.Price);
 }
コード例 #21
0
        public override void Serialize(ICustomDataWriter writer)
        {
            byte box = 0;

            box = BooleanByteWrapper.SetFlag(box, 0, Activate);
            box = BooleanByteWrapper.SetFlag(box, 1, Party);
            writer.WriteByte(box);
            writer.WriteByte(this.Reason);
            writer.WriteVarShort(this.IdolId);
        }
コード例 #22
0
 public override void Serialize(ICustomDataWriter writer)
 {
     writer.WriteDouble(this.SlaveId);
     writer.WriteShort(this.SpellCooldowns.Length);
     foreach (GameFightSpellCooldown item in this.SpellCooldowns)
     {
         item.Serialize(writer);
     }
     writer.WriteByte(this.SummonCount);
     writer.WriteByte(this.BombCount);
 }
コード例 #23
0
 public override void Serialize(ICustomDataWriter writer)
 {
     base.Serialize(writer);
     writer.WriteByte(this.TeamId);
     writer.WriteByte(this.Wave);
     writer.WriteBoolean(this.Alive);
     writer.WriteShort(this.PreviousPositions.Length);
     foreach (short item in this.PreviousPositions)
     {
         writer.WriteVarShort(item);
     }
 }
コード例 #24
0
        public override void Serialize(ICustomDataWriter writer)
        {
            base.Serialize(writer);
            byte box = 0;

            box = BooleanByteWrapper.SetFlag(box, 0, SilentCast);
            box = BooleanByteWrapper.SetFlag(box, 1, VerboseCast);
            writer.WriteByte(box);
            writer.WriteDouble(this.TargetId);
            writer.WriteShort(this.DestinationCellId);
            writer.WriteByte(this.Critical);
        }
コード例 #25
0
 public override void Serialize(ICustomDataWriter writer)
 {
     writer.WriteInt(this.SpouseAccountId);
     writer.WriteVarLong(this.SpouseId);
     writer.WriteUTF(this.SpouseName);
     writer.WriteVarShort(this.SpouseLevel);
     writer.WriteByte(this.Breed);
     writer.WriteByte(this.Sex);
     this.SpouseEntityLook.Serialize(writer);
     this.GuildInfo.Serialize(writer);
     writer.WriteByte(this.AlignmentSide);
 }
コード例 #26
0
        public override void Serialize(ICustomDataWriter writer)
        {
            byte box = 0;

            box = BooleanByteWrapper.SetFlag(box, 0, IsTeamPhase);
            box = BooleanByteWrapper.SetFlag(box, 1, CanBeCancelled);
            box = BooleanByteWrapper.SetFlag(box, 2, CanSayReady);
            box = BooleanByteWrapper.SetFlag(box, 3, IsFightStarted);
            writer.WriteByte(box);
            writer.WriteShort(this.TimeMaxBeforeFightStart);
            writer.WriteByte(this.FightType);
        }
コード例 #27
0
        public override void Serialize(ICustomDataWriter writer)
        {
            byte box = 0;

            box = BooleanByteWrapper.SetFlag(box, 0, Sex);
            box = BooleanByteWrapper.SetFlag(box, 1, Alive);
            writer.WriteByte(box);
            writer.WriteDouble(this.Id_);
            writer.WriteByte(this.Wave);
            writer.WriteVarShort(this.Level);
            writer.WriteByte(this.Breed);
        }
コード例 #28
0
        public override void Serialize(ICustomDataWriter writer)
        {
            byte box = 0;

            box = BooleanByteWrapper.SetFlag(box, 0, Sex);
            box = BooleanByteWrapper.SetFlag(box, 1, IsRideable);
            box = BooleanByteWrapper.SetFlag(box, 2, IsWild);
            box = BooleanByteWrapper.SetFlag(box, 3, IsFecondationReady);
            box = BooleanByteWrapper.SetFlag(box, 4, UseHarnessColors);
            writer.WriteByte(box);
            writer.WriteDouble(this.Id_);
            writer.WriteVarInt(this.Model);
            writer.WriteShort(this.Ancestor.Length);
            foreach (int item in this.Ancestor)
            {
                writer.WriteInt(item);
            }
            writer.WriteShort(this.Behaviors.Length);
            foreach (int item in this.Behaviors)
            {
                writer.WriteInt(item);
            }
            writer.WriteUTF(this.Name);
            writer.WriteInt(this.OwnerId);
            writer.WriteVarLong(this.Experience);
            writer.WriteVarLong(this.ExperienceForLevel);
            writer.WriteDouble(this.ExperienceForNextLevel);
            writer.WriteByte(this.Level);
            writer.WriteVarInt(this.MaxPods);
            writer.WriteVarInt(this.Stamina);
            writer.WriteVarInt(this.StaminaMax);
            writer.WriteVarInt(this.Maturity);
            writer.WriteVarInt(this.MaturityForAdult);
            writer.WriteVarInt(this.Energy);
            writer.WriteVarInt(this.EnergyMax);
            writer.WriteInt(this.Serenity);
            writer.WriteInt(this.AggressivityMax);
            writer.WriteVarInt(this.SerenityMax);
            writer.WriteVarInt(this.Love);
            writer.WriteVarInt(this.LoveMax);
            writer.WriteInt(this.FecondationTime);
            writer.WriteInt(this.BoostLimiter);
            writer.WriteDouble(this.BoostMax);
            writer.WriteInt(this.ReproductionCount);
            writer.WriteVarInt(this.ReproductionCountMax);
            writer.WriteVarShort(this.HarnessGID);
            writer.WriteShort(this.EffectList.Length);
            foreach (ObjectEffectInteger item in this.EffectList)
            {
                item.Serialize(writer);
            }
        }
コード例 #29
0
 public override void Serialize(ICustomDataWriter writer)
 {
     writer.WriteVarLong(this.PlayerId);
     writer.WriteUTF(this.PlayerName);
     writer.WriteByte(this.AlignmentSide);
     writer.WriteByte(this.Breed);
     writer.WriteBoolean(this.Sex);
     writer.WriteBoolean(this.IsInWorkshop);
     writer.WriteShort(this.WorldX);
     writer.WriteShort(this.WorldY);
     writer.WriteDouble(this.MapId);
     writer.WriteVarShort(this.SubAreaId);
 }
コード例 #30
0
        public override void Serialize(ICustomDataWriter writer)
        {
            byte box = 0;

            box = BooleanByteWrapper.SetFlag(box, 0, TutorialAvailable);
            box = BooleanByteWrapper.SetFlag(box, 1, CanCreateNewCharacter);
            writer.WriteByte(box);
            writer.WriteInt(this.AccountId);
            writer.WriteVarInt(this.BreedsVisible);
            writer.WriteVarInt(this.BreedsAvailable);
            writer.WriteByte(this.Status);
            writer.WriteDouble(this.UnlimitedRestatEndDate);
        }