Пример #1
0
 public static void WriteEmpty(PythonWriter pw)
 {
     pw.WriteTuple(4);
     pw.WriteNoneStruct();
     pw.WriteNoneStruct();
     pw.WriteNoneStruct();
     pw.WriteNoneStruct();
 }
Пример #2
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();
            }
        }
        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();
            }
        }
Пример #5
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();
            }
        }