Exemple #1
0
        public void EndStatusUpdates()
        {
            lock (PendingUpdates)
            {
                StatusUpdateEntry[] Entries = PendingUpdates.Values.ToArray();
                StatusUpdate *      Update  = PacketHelper.UpdatePacket(Entries);
                Update->UID = UID;
                Owner.Send(Update, Update->Size);
                Memory.Free(Update);

                PendingUpdates.Clear();
            }
        }
        public static StatusUpdate *UpdatePacket(params StatusUpdateEntry[] entries)
        {
            int           Size   = 20 + (entries.Length * 8);
            StatusUpdate *Packet = (StatusUpdate *)Memory.Alloc(Size);

            Packet->Size   = (ushort)Size;
            Packet->Type   = 0x3F9;
            Packet->Amount = (uint)entries.Length;
            fixed(StatusUpdateEntry *entry = entries)
            {
                Memory.Copy(entry, Packet->Data, 8 * entries.Length);
            }

            return(Packet);
        }