Example #1
0
        private void ParseChannelEvent(InputMessage message)
        {
            int channelID = message.GetU16();

            Chat.Channel channel    = m_ChatStorage.GetChannel(channelID);
            string       playerName = message.GetString();
            int          eventType  = message.GetU8();

            switch (eventType)
            {
            case 0:
                channel.PlayerJoined(playerName);
                break;

            case 1:
                channel.PlayerLeft(playerName);
                break;

            case 2:
                channel.PlayerInvited(playerName);
                break;

            case 3:
                channel.PlayerExcluded(playerName);
                break;

            case 4:
                channel.PlayerPending(playerName);
                break;
            }
        }
Example #2
0
        private void ParseOpenOwnChannel(InputMessage message)
        {
            int    channelID   = message.GetU16();
            string channelName = message.GetString();

            Chat.Channel channel = m_ChatStorage.AddChannel(channelID, channelName, MessageModes.Channel);
            channel.CanModerate = true;

            if (channel.IsPrivate)
            {
                m_ChatStorage.OwnPrivateChannelID = channelID;
            }

            int joinedUsers = message.GetU16();

            for (int i = 0; i < joinedUsers; i++)
            {
                channel.PlayerJoined(message.GetString());
            }

            int invitedUsers = message.GetU16();

            for (int i = 0; i < invitedUsers; i++)
            {
                channel.PlayerInvited(message.GetString());
            }
        }
Example #3
0
 private static void ChatMessage(string message, Chat.Channel channel)
 {
     if (channel == Chat.Channel.Command)
     {
         Networking.Channels.Social.Emote(message);
     }
     else
     {
         Networking.Channels.Social.Message(message);
     }
 }
Example #4
0
        private void ParseOpenChannel(Internal.ByteArray message)
        {
            int    channelId   = message.ReadUnsignedShort();
            string channelName = message.ReadString();

            Chat.Channel channel = ChatStorage.AddChannel(channelId, channelName, MessageModeType.Channel);
            channel.CanModerate = true;

            if (OpenTibiaUnity.GameManager.GetFeature(GameFeature.GameChannelPlayerList))
            {
                int joinedUsers = message.ReadUnsignedShort();
                for (int i = 0; i < joinedUsers; i++)
                {
                    channel.PlayerJoined(message.ReadString());
                }

                int invitedUsers = message.ReadUnsignedShort();
                for (int i = 0; i < invitedUsers; i++)
                {
                    channel.PlayerInvited(message.ReadString());
                }
            }
        }