コード例 #1
0
        private void Performpublic(PrivateChatActionType actionType, string playerName)
        {
            if (!OpenTibiaUnity.GameManager.IsGameRunning)
            {
                return;
            }

            var chatStorage  = OpenTibiaUnity.ChatStorage;
            var protocolGame = OpenTibiaUnity.ProtocolGame;

            switch (actionType)
            {
            case PrivateChatActionType.OpenChatChannel: {
                var channel = chatStorage.GetChannel(chatStorage.OwnPrivateChannelId);
                if (channel == null)
                {
                    protocolGame.SendOpenChannel();
                }
                else
                {
                    // TODO select chat
                }

                break;
            }

            case PrivateChatActionType.ChatChannelInvite: {
                if (_channelId > -1)
                {
                    protocolGame.SendInviteToChannel(_name, _channelId);
                }
                break;
            }

            case PrivateChatActionType.ChatChannelExclude: {
                if (_channelId > -1)
                {
                    protocolGame.SendExcludeFromChannel(_name, _channelId);
                }
                break;
            }

            case PrivateChatActionType.OpenMessageChannel: {
                var channel = chatStorage.GetChannel(playerName);
                if (channel == null)
                {
                    protocolGame.SendPrivateChannel(playerName);
                }
                else
                {
                    // TODO select chat
                }

                break;
            }
            }
        }
コード例 #2
0
 public PrivateChatActionImpl(PrivateChatActionType actionType, int channelId, string name)
 {
     _actionType = actionType;
     _channelId  = channelId;
     _name       = name;
 }
コード例 #3
0
 public PrivateChatActionImpl(PrivateChatActionType actionType, int channelID, string name)
 {
     m_ActionType = actionType;
     m_ChannelID  = channelID;
     m_Name       = name;
 }