Esempio n. 1
0
        public void Write(PythonWriter pw)
        {
            pw.WriteInt(SlotId);

            pw.WriteTuple(2);
            pw.WriteInt(ClassId);
            pw.WriteStruct(Color);
        }
Esempio n. 2
0
 public void Write(PythonWriter pw)
 {
     pw.WriteTuple(4);
     pw.WriteInt(Red);
     pw.WriteInt(Green);
     pw.WriteInt(Blue);
     pw.WriteInt(Alpha);
 }
Esempio n. 3
0
 public void Write(PythonWriter pw)
 {
     pw.WriteTuple(10);
     pw.WriteUnicodeString(Name);
     pw.WriteUInt(MapContextId);
     pw.WriteUInt(ExpPoints);
     pw.WriteInt(ExpLevel);
     pw.WriteUInt(Body);
     pw.WriteUInt(Mind);
     pw.WriteUInt(Spirit);
     pw.WriteUInt(Class);
     pw.WriteUInt(CloneCredits);
     pw.WriteInt((int)RaceId);
 }
        public override void Write(PythonWriter pw)
        {
            pw.WriteTuple(5);
            pw.WriteUnicodeString(FamilyName);
            pw.WriteBool(HasCharacters);
            pw.WriteInt((int)UserId);

            pw.WriteTuple(EnabledRaceList.Count);

            foreach (var race in EnabledRaceList)
            {
                pw.WriteInt(race);
            }

            pw.WriteBool(CanSkipBootcamp);
        }
        public override void Write(PythonWriter pw)
        {
            pw.WriteTuple(3);
            pw.WriteUInt(EntityId);
            pw.WriteInt((int)ClassId);

            /*
             * These packets will be called on the newly created entity. It behaves the same as if we've sent them separately. Order matters!
             *
             * Possible packets that can be appended here: (Not all of them are reasonable to include...)
             *   + PhysicalEntity
             *     - BodyAttributes
             *     - WorldLocationDescriptor
             *     - WorldPlacementDescriptor
             *     - IsTargetable
             *     - ServerSkeleton
             *     - ExamineResults
             *     - GameEffectAttached
             *     - GameEffectAttachFailed
             *     - GameEffectTick
             *     - CallGameEffectMethod
             *     - GameEffectDetached
             *     - GameEffects
             *     - GameEffectUpdateTooltip
             *     - PerformObjectAbility
             *   + CharacterSelectionPod augmentation:
             *        - CharacterInfo
             *        - CloneCreditsChanged
             *   + Other augmentations: ...
             */
            if (EntityData.Count > 0)
            {
                pw.WriteList(EntityData.Count);

                foreach (var packet in EntityData)
                {
                    pw.WriteTuple(2);
                    pw.WriteInt((int)packet.Opcode);

                    packet.Write(pw);
                }
            }
            else
            {
                pw.WriteNoneStruct();
            }
        }
Esempio n. 6
0
 public override void Write(PythonWriter pw)
 {
     pw.WriteTuple(1);
     pw.WriteDictionary(AppearanceData.Count);
     foreach (var t in AppearanceData)
     {
         var appearance = t.Value;
         pw.WriteInt((int)appearance.SlotId);
         pw.WriteTuple(2);
         pw.WriteUInt((uint)appearance.Class);
         pw.WriteTuple(4);
         pw.WriteInt(appearance.Color.Red);
         pw.WriteInt(appearance.Color.Green);
         pw.WriteInt(appearance.Color.Blue);
         pw.WriteInt(appearance.Color.Alpha);
     }
 }
Esempio n. 7
0
        public void Write(PythonWriter pw)
        {
            pw.WriteInt((int)SlotId);

            pw.WriteTuple(3);
            pw.WriteUInt(Class);
            pw.WriteStruct(Color);

            Color.WriteEmpty(pw);
        }
Esempio n. 8
0
        public override void Write(PythonWriter pw)
        {
            pw.WriteTuple(1);
            pw.WriteDictionary(9);

            pw.WriteString("SlotId");
            pw.WriteUInt(SlotId);

            pw.WriteString("IsSelected");
            pw.WriteInt(IsSelected ? 1 : 0);

            pw.WriteString("BodyData");
            pw.WriteStruct(BodyData);

            pw.WriteString("CharacterData");
            pw.WriteStruct(CharacterData);

            pw.WriteString("AppearanceData");
            pw.WriteDictionary(AppearanceData.Count);

            foreach (var appearance in AppearanceData)
            {
                appearance.Value.Write(pw);
            }

            pw.WriteString("UserName");
            if (FamilyName != null)
            {
                pw.WriteUnicodeString(FamilyName);
            }
            else
            {
                pw.WriteNoneStruct();
            }

            pw.WriteString("GameContextId");
            if (GameContextId == 0)
            {
                pw.WriteNoneStruct();
            }
            else
            {
                pw.WriteUInt(GameContextId);
            }

            pw.WriteString("LoginData");
            pw.WriteStruct(LoginData);

            pw.WriteString("ClanData");
            pw.WriteStruct(ClanData);
        }
        public override void Write(PythonWriter pw)
        {
            pw.WriteTuple(3);
            pw.WriteUInt(EntityId);
            pw.WriteInt(ClassId);

            if (EntityData != null)
            {
                // todo
            }
            else
            {
                pw.WriteNoneStruct();
            }
        }
Esempio n. 10
0
 public override void Write(PythonWriter pw)
 {
     pw.WriteTuple(1);
     pw.WriteInt(LangId);
 }
Esempio n. 11
0
        public override void Write(PythonWriter pw)
        {
            pw.WriteTuple(1);
            pw.WriteDictionary(9);

            pw.WriteString("SlotId");
            pw.WriteUInt(SlotId);

            pw.WriteString("IsSelected");
            pw.WriteInt(SlotId == 0 ? 1 : 0);

            pw.WriteString("BodyData");
            if (BodyData != null && !_empty)
            {
                pw.WriteTuple(2);
                pw.WriteInt(BodyData.GenderClassId);
                pw.WriteDouble(BodyData.Scale);
            }
            else
            {
                pw.WriteNoneStruct();
            }

            pw.WriteString("CharacterData");
            if (CharacterData != null && !_empty)
            {
                pw.WriteTuple(10); // TODO
                pw.WriteUnicodeString("CharName");
                pw.WriteInt(1);    // pos
                pw.WriteInt(41);   // xpptrs
                pw.WriteInt(10);   // xplvl
                pw.WriteInt(111);  // body
                pw.WriteInt(12);   //mind
                pw.WriteInt(21);   // spirit
                pw.WriteInt(2);    // class id
                pw.WriteInt(3);    // clone credits
                pw.WriteInt(3);    // raceId
            }
            else
            {
                pw.WriteNoneStruct();
            }

            pw.WriteString("AppearanceData");
            if (AppearanceData != null && !_empty)
            {
                // TODO
                var count = 0;
                for (var i = 0; i < 21; ++i)
                {
                    if (true) // TODO:
                    {
                        ++count;
                    }
                }

                pw.WriteDictionary(count);

                for (var i = 0; i < 21; ++i)
                {
                    if (true)
                    {
                        pw.WriteInt(i + 1); // equipment slot id
                        pw.WriteTuple(2);
                        pw.WriteInt(0);     // classId

                        pw.WriteTuple(4);
                        pw.WriteInt(0); // hueR
                        pw.WriteInt(0); // hueG
                        pw.WriteInt(0); // hueB
                        pw.WriteInt(0); // hueA
                    }// TODO: else nonstruct?
                }
            }
            else
            {
                pw.WriteTuple(0);
            }

            pw.WriteString("UserName");
            if (UserName != null && !_empty)
            {
                pw.WriteUnicodeString(UserName);
            }
            else
            {
                pw.WriteNoneStruct();
            }

            pw.WriteString("GameContextId");
            if (!_empty)
            {
                pw.WriteInt(GameContextId);
            }
            else
            {
                pw.WriteNoneStruct();
            }

            pw.WriteString("LoginData");
            if (LoginData != null && !_empty)
            {
                pw.WriteTuple(3);
                pw.WriteInt(0); // num logins
                pw.WriteInt(0); // total time played
                pw.WriteInt(0); // time since last played
            }
            else
            {
                pw.WriteNoneStruct();
            }

            pw.WriteString("ClanData");
            if (ClanData != null && !_empty)
            {
                pw.WriteTuple(2);
                pw.WriteInt(0);                     // clan id
                pw.WriteUnicodeString("Clan name"); // clan name
            }
            else
            {
                pw.WriteNoneStruct();
            }
        }
 public override void Write(PythonWriter pw)
 {
     pw.WriteTuple(1);
     pw.WriteInt((int)Result);
 }
Esempio n. 13
0
 public override void Write(PythonWriter pw)
 {
     pw.WriteTuple(2);
     pw.WriteInt(SlotNum);
     pw.WriteUnicodeString(FamilyName);
 }
Esempio n. 14
0
        } = 0;                                 // wonktype isn't used by game client, so we send 0

        public override void Write(PythonWriter pw)
        {
            pw.WriteTuple(1);
            pw.WriteInt(WonkType);
        }
Esempio n. 15
0
 public override void Write(PythonWriter pw)
 {
     pw.WriteTuple(1);
     pw.WriteInt(RunningTime);
 }
 public override void Write(PythonWriter pw)
 {
     pw.WriteTuple(1);
     pw.WriteInt(5000); // 5 sec
 }