Esempio n. 1
0
        public static void SendPetitionSignatures(IPacketReceiver client, PetitionCharter charter)
        {
            if (charter.Petition == null)
            {
                return;
            }

            var signs = charter.Petition.SignedIds;

            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_PETITION_SHOW_SIGNATURES, 8 + 8 + 4 + 1 + signs.Count * 12))
            {
                packet.WriteULong(charter.EntityId.Full);
                packet.WriteULong(charter.Owner.EntityId.Full);
                packet.WriteUInt(charter.EntityId.Low);
                packet.WriteByte(signs.Count);

                foreach (var guid in signs)
                {
                    packet.WriteULong(guid);
                    packet.WriteUInt(0);
                }

                client.Send(packet);
            }
        }
Esempio n. 2
0
        public static void SendPetitionSignatures(IPacketReceiver client, PetitionCharter charter)
        {
            if (charter.Petition == null)
            {
                return;
            }
            List <uint> signedIds = charter.Petition.SignedIds;

            using (RealmPacketOut packet =
                       new RealmPacketOut((PacketId)RealmServerOpCode.SMSG_PETITION_SHOW_SIGNATURES,
                                          21 + signedIds.Count * 12))
            {
                packet.WriteULong(charter.EntityId.Full);
                packet.WriteULong(charter.Owner.EntityId.Full);
                packet.WriteUInt(charter.EntityId.Low);
                packet.WriteByte(signedIds.Count);
                foreach (uint val in signedIds)
                {
                    packet.WriteULong(val);
                    packet.WriteUInt(0);
                }

                client.Send(packet, false);
            }
        }
Esempio n. 3
0
        public static void SendPetitionRename(IPacketReceiver client, PetitionCharter petition)
        {
            var name = petition.Petition.Name;

            using (var packet = new RealmPacketOut(RealmServerOpCode.MSG_PETITION_RENAME, 8 + name.Length + 1))
            {
                packet.WriteULong(petition.EntityId.Full);
                packet.WriteCString(name);

                client.Send(packet);
            }
        }
Esempio n. 4
0
        public static void SendPetitionQueryResponse(IPacketReceiver client, PetitionCharter charter)
        {
            string name = charter.Petition.Name;

            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_PETITION_QUERY_RESPONSE, 4 + 8 + name.Length + 1 + 1 + 4 * 12 + 2 + 10))
            {
                packet.WriteUInt(charter.EntityId.Low);
                packet.WriteULong(charter.Owner.EntityId.Full);
                packet.WriteCString(name);
                packet.WriteByte(0);

                var type = (uint)charter.Petition.Type;
                if (type == (uint)PetitionType.Guild)
                {
                    packet.WriteUInt(type);
                    packet.WriteUInt(type);
                    packet.WriteUInt(0);
                }
                else
                {
                    packet.WriteUInt(type - 1);
                    packet.WriteUInt(type - 1);
                    packet.WriteUInt(type);
                }
                packet.WriteUInt(0);
                packet.WriteUInt(0);
                packet.WriteUInt(0);
                packet.WriteUInt(0);
                packet.WriteUShort(0);
                packet.WriteUInt(0);
                packet.WriteUInt(0);
                packet.WriteUInt(0);

                for (int i = 0; i < 10; ++i)
                {
                    packet.WriteByte(0);
                }

                packet.WriteUInt(0);

                if (type == (uint)PetitionType.Guild)
                {
                    packet.WriteUInt(0);
                }
                else
                {
                    packet.WriteUInt(1);
                }

                client.Send(packet);
            }
        }
Esempio n. 5
0
        public static void SendPetitionQueryResponse(IPacketReceiver client, PetitionCharter charter)
        {
            string name = charter.Petition.Name;

            using (RealmPacketOut packet = new RealmPacketOut((PacketId)RealmServerOpCode.SMSG_PETITION_QUERY_RESPONSE,
                                                              12 + name.Length + 1 + 1 + 48 + 2 + 10))
            {
                packet.WriteUInt(charter.EntityId.Low);
                packet.WriteULong(charter.Owner.EntityId.Full);
                packet.WriteCString(name);
                packet.WriteByte(0);
                uint type = (uint)charter.Petition.Type;
                if (type == 9U)
                {
                    packet.WriteUInt(type);
                    packet.WriteUInt(type);
                    packet.WriteUInt(0);
                }
                else
                {
                    packet.WriteUInt(type - 1U);
                    packet.WriteUInt(type - 1U);
                    packet.WriteUInt(type);
                }

                packet.WriteUInt(0);
                packet.WriteUInt(0);
                packet.WriteUInt(0);
                packet.WriteUInt(0);
                packet.WriteUShort(0);
                packet.WriteUInt(0);
                packet.WriteUInt(0);
                packet.WriteUInt(0);
                for (int index = 0; index < 10; ++index)
                {
                    packet.WriteByte(0);
                }
                packet.WriteUInt(0);
                if (type == 9U)
                {
                    packet.WriteUInt(0);
                }
                else
                {
                    packet.WriteUInt(1);
                }
                client.Send(packet, false);
            }
        }