Ejemplo n.º 1
0
        public static void SetUpdate(Entities.GameClient client, Enums.UpdateType type, ulong data, Enums.SynchroType synchro, ulong data2 = 0)
        {
            var packet = UpdatePacket.Create(client.EntityUID);

            if (!packet.AddUpdate(type, data))
            {
                return;
            }
            if (synchro != Enums.SynchroType.False)
            {
                switch (synchro)
                {
                case Enums.SynchroType.True:
                {
                    client.Send(packet);
                    break;
                }

                case Enums.SynchroType.Broadcast:
                {
                    client.SendToScreen(packet, true);
                    break;
                }
                }
            }
        }
Ejemplo n.º 2
0
        public static UpdatePacket Create(uint userId)
        {
            var packet = new UpdatePacket();

            packet.UserId         = userId;
            packet.AttributeCount = 0;
            packet._values        = new List <UpdateData>();
            return(packet);
        }
Ejemplo n.º 3
0
        public static UpdatePacket Create(uint userId, Enums.UpdateType type, ulong data)
        {
            var packet = new UpdatePacket();

            if (!(type == Enums.UpdateType.None || type >= Enums.UpdateType.HP))
            {
                throw new ArgumentException("type must be a valid UpdateType!", "type");
            }

            packet.UserId         = userId;
            packet.AttributeCount = 0;

            packet._values = new List <UpdateData>();
            if (type >= Enums.UpdateType.HP)
            {
                packet._values.Add(new UpdateData {
                    Type = type, Data1 = data
                });
                packet.AttributeCount++;
            }

            return(packet);
        }
Ejemplo n.º 4
0
        public static UpdatePacket Create(uint userId, Enums.UpdateType type, ulong data)
        {
            var packet = new UpdatePacket();
            if (!(type == Enums.UpdateType.None || type >= Enums.UpdateType.HP))
                throw new ArgumentException("type must be a valid UpdateType!", "type");

            packet.UserId = userId;
            packet.AttributeCount = 0;

            packet._values = new List<UpdateData>();
            if (type >= Enums.UpdateType.HP)
            {
                packet._values.Add(new UpdateData { Type = type, Data1 = data });
                packet.AttributeCount++;
            }

            return packet;
        }
Ejemplo n.º 5
0
 public static UpdatePacket Create(uint userId)
 {
     var packet = new UpdatePacket();
     packet.UserId = userId;
     packet.AttributeCount = 0;
     packet._values = new List<UpdateData>();
     return packet;
 }