コード例 #1
0
 public AdminChatMessageEvent(Player player, ChatDestination chatDestination, NetworkAction action, string msg)
 {
     this.Player          = player;
     this.Message         = msg;
     this.ChatDestination = chatDestination;
     this.NetworkAction   = action;
 }
コード例 #2
0
 public ReceivedChatMessage(string msg, Player player, ChatDestination chatDestination, ServerInfo serverInfo)
 {
     this.Player          = player;
     this.Message         = msg;
     this.ChatDestination = chatDestination;
     this.ServerInfo      = serverInfo;
 }
コード例 #3
0
 public AdminChatMessage(NetworkAction networkAction, ChatDestination chatDestination, uint destination, string message)
 {
     this.NetworkAction   = networkAction;
     this.ChatDestination = chatDestination;
     this.Message         = message;
     this.Destination     = destination;
 }
コード例 #4
0
        private void TcpClient_MessageReceived(object sender, ITcpMessage e)
        {
            switch (e.MessageType)
            {
            case TcpMessageType.PACKET_SERVER_CHAT:
            {
                var m = e as PacketServerChatMessage;
                if (m.ClientId == this.tcpClient.MyClientId)
                {
                    break;
                }
                ChatDestination destination = (ChatDestination)((int)m.NetworkAction - (int)NetworkAction.NETWORK_ACTION_CHAT);

                if (new ChatDestination[] { ChatDestination.DESTTYPE_BROADCAST, ChatDestination.DESTTYPE_CLIENT, ChatDestination.DESTTYPE_TEAM }.Contains(destination))
                {
                    this.ReceivedChatMessage?.Invoke(this, new ReceivedChatMessage(m.Message, tcpClient.Players[m.ClientId], destination, this.ServerInfo));
                }
                break;
            }
            }
        }
コード例 #5
0
 public PacketClientChatMessage(ChatDestination chatDestination, uint destination, string message)
 {
     this.ChatDestination = chatDestination;
     this.Message         = message;
     this.Destination     = destination;
 }