Exemplo n.º 1
0
        public static void Add
        (
            NetworkMessage message,
            string senderName,
            ushort senderLevel,
            SpeechType speechType,
            string text,
            Location location,
            ChatChannel channelId,
            uint time
        )
        {
            message.AddByte((byte)ServerPacketType.CreatureSpeech);

            message.AddUInt32(0x00000000);
            message.AddString(senderName);
            message.AddUInt16(senderLevel);
            message.AddByte((byte)speechType);

            switch (speechType)
            {
            case SpeechType.Say:
            case SpeechType.Whisper:
            case SpeechType.Yell:
            case SpeechType.MonsterSay:
            case SpeechType.MonsterYell:
            case SpeechType.PrivateNPCToPlayer:
                message.AddLocation(location);
                break;

            case SpeechType.ChannelRed:
            case SpeechType.ChannelRedAnonymous:
            case SpeechType.ChannelOrange:
            case SpeechType.ChannelYellow:
            case SpeechType.ChannelWhite:
                message.AddUInt16((ushort)channelId);
                break;

            case SpeechType.RuleViolationReport:
                message.AddUInt32(time);
                break;

            default:
                break;
            }

            message.AddString(text);
        }
Exemplo n.º 2
0
        public static void Add(NetworkMessage message, IEnumerable <CharacterListItem> characters, ushort premiumDaysLeft)
        {
            message.AddByte((byte)ServerPacketType.CharacterList);

            message.AddByte((byte)characters.Count());

            foreach (CharacterListItem character in characters)
            {
                message.AddString(character.Name);
                message.AddString(character.World);
                message.AddBytes(character.Ip);
                message.AddUInt16(character.Port);
            }

            message.AddUInt16(premiumDaysLeft);
        }
Exemplo n.º 3
0
        public static void Add(
            NetworkMessage message,
            string senderName,
            ushort senderLevel,
            SpeechType speechType,
            string text,
            Location location,
            ChatChannel channelId,
            uint time
            )
        {
            message.AddByte((byte)ServerPacketType.CreatureSpeech);

            message.AddUInt32(0x00000000);
            message.AddString(senderName);
            message.AddUInt16(senderLevel);
            message.AddByte((byte)speechType);

            switch (speechType)
            {
                case SpeechType.Say:
                case SpeechType.Whisper:
                case SpeechType.Yell:
                case SpeechType.MonsterSay:
                case SpeechType.MonsterYell:
                case SpeechType.PrivateNPCToPlayer:
                    message.AddLocation(location);
                    break;
                case SpeechType.ChannelRed:
                case SpeechType.ChannelRedAnonymous:
                case SpeechType.ChannelOrange:
                case SpeechType.ChannelYellow:
                case SpeechType.ChannelWhite:
                    message.AddUInt16((ushort)channelId);
                    break;
                case SpeechType.RuleViolationReport:
                    message.AddUInt32(time);
                    break;
                default:
                    break;

            }

            message.AddString(text);
        }
Exemplo n.º 4
0
        public static void Add(NetworkMessage message, List <Channel> channels)
        {
            message.AddByte((byte)ServerPacketType.ChannelList);
            message.AddByte((byte)channels.Count);

            foreach (var c in channels)
            {
                message.AddUInt16((ushort)c.Id);
                message.AddString(c.Name);
            }
        }
Exemplo n.º 5
0
        public static void Add(NetworkMessage message, List<Channel> channels)
        {
            message.AddByte((byte)ServerPacketType.ChannelList);
            message.AddByte((byte)channels.Count);

            foreach (var c in channels)
            {
                message.AddUInt16((ushort)c.Id);
                message.AddString(c.Name);
            }
        }
Exemplo n.º 6
0
        public static void Add(
            NetworkMessage message,
            Creature creature
            )
        {
            message.AddByte((byte)ServerPacketType.TileTransformThing);

            message.AddLocation(creature.Tile.Location);
            message.AddByte(creature.Tile.GetStackPosition(creature));
            message.AddUInt16(0x63);
            message.AddUInt32(creature.Id);
            message.AddByte((byte)creature.Direction);
        }
Exemplo n.º 7
0
        public static void Add(NetworkMessage message, Player player, IEnumerable <Outfit> outfits)
        {
            message.AddByte((byte)ServerPacketType.OutfitWindow);
            message.AddOutfit(player.Outfit);

            message.AddByte((byte)outfits.Count());

            foreach (Outfit outfit in outfits)
            {
                message.AddUInt16((ushort)outfit.LookType);
                message.AddString(outfit.Name);
                message.AddByte(outfit.Addons);
            }
        }
Exemplo n.º 8
0
        public static void Add
        (
            NetworkMessage message,
            Creature creature
        )
        {
            message.AddByte((byte)ServerPacketType.TileTransformThing);

            message.AddLocation(creature.Tile.Location);
            message.AddByte(creature.Tile.GetStackPosition(creature));
            message.AddUInt16(0x63);
            message.AddUInt32(creature.Id);
            message.AddByte((byte)creature.Direction);
        }
Exemplo n.º 9
0
        public static void Add(NetworkMessage message, Player player, IEnumerable<Outfit> outfits)
        {
            message.AddByte((byte)ServerPacketType.OutfitWindow);
            message.AddOutfit(player.Outfit);

            message.AddByte((byte)outfits.Count());

            foreach (Outfit outfit in outfits)
            {
                message.AddUInt16((ushort)outfit.LookType);
                message.AddString(outfit.Name);
                message.AddByte(outfit.Addons);
            }
        }
Exemplo n.º 10
0
        public static void Add
        (
            NetworkMessage message,
            byte containerId,
            ushort containerSpriteId,
            string containerName,
            byte volume,
            bool hasParent,
            IEnumerable <Item> items
        )
        {
            message.AddByte((byte)ServerPacketType.ContainerOpen);

            message.AddByte(containerId);
            message.AddUInt16(containerSpriteId);
            message.AddString(containerName);
            message.AddByte(volume);
            message.AddByte(Convert.ToByte(hasParent));
            message.AddByte((byte)items.Count());
            foreach (Item item in items)
            {
                message.AddItem(item);
            }
        }
Exemplo n.º 11
0
        public static void Add
        (
            NetworkMessage message,
            ushort health,
            ushort maxHealth,
            uint capacity,
            uint experience,
            ushort level,
            byte levelPercent,
            ushort mana,
            ushort maxMana,
            byte magicLevel,
            byte magicLevelPercent,
            byte soul,
            ushort stamina
        )
        {
            message.AddByte((byte)ServerPacketType.PlayerStatus);

            message.AddUInt16(health);
            message.AddUInt16(maxHealth);
            message.AddUInt32(capacity);

            message.AddUInt32(experience);

            message.AddUInt16(level);

            message.AddByte(levelPercent);

            message.AddUInt16(mana);
            message.AddUInt16(maxMana);

            message.AddByte(magicLevel);
            message.AddByte(magicLevelPercent);
            message.AddByte(soul);

            message.AddUInt16(stamina);
        }
Exemplo n.º 12
0
        public static void Add(
            NetworkMessage message,
            ushort health,
            ushort maxHealth,
            uint capacity,
            uint experience,
            ushort level,
            byte levelPercent,
            ushort mana,
            ushort maxMana,
            byte magicLevel,
            byte magicLevelPercent,
            byte soul,
            ushort stamina
            )
        {
            message.AddByte((byte)ServerPacketType.PlayerStatus);

            message.AddUInt16(health);
            message.AddUInt16(maxHealth);
            message.AddUInt32(capacity);

            message.AddUInt32(experience);

            message.AddUInt16(level);

            message.AddByte(levelPercent);

            message.AddUInt16(mana);
            message.AddUInt16(maxMana);

            message.AddByte(magicLevel);
            message.AddByte(magicLevelPercent);
            message.AddByte(soul);

            message.AddUInt16(stamina);
        }
Exemplo n.º 13
0
 public static void Add(NetworkMessage message, Creature creature)
 {
     message.AddByte((byte)ServerPacketType.CreatureSpeed);
     message.AddUInt32(creature.Id);
     message.AddUInt16(creature.Speed);
 }
Exemplo n.º 14
0
 public static void Add(NetworkMessage message, int flags)
 {
     message.AddByte((byte)ServerPacketType.PlayerFlags);
     message.AddUInt16((ushort)flags);
 }
Exemplo n.º 15
0
 public static void Add(NetworkMessage message, ushort channelId, string channelName)
 {
     message.AddByte((byte)ServerPacketType.ChannelOpen);
     message.AddUInt16(channelId);
     message.AddString(channelName);
 }
 public static void Add(NetworkMessage message, Creature creature)
 {
     message.AddByte((byte)ServerPacketType.CreatureSpeed);
     message.AddUInt32(creature.Id);
     message.AddUInt16(creature.Speed);
 }
Exemplo n.º 17
0
 public static void Add(NetworkMessage message, ushort channelId, string channelName)
 {
     message.AddByte((byte)ServerPacketType.ChannelOpen);
     message.AddUInt16(channelId);
     message.AddString(channelName);
 }
Exemplo n.º 18
0
 public static void Add(NetworkMessage message, int flags)
 {
     message.AddByte((byte)ServerPacketType.PlayerFlags);
     message.AddUInt16((ushort)flags);
 }