예제 #1
0
 private void _pipeServer_ClientMessage(NamedPipeConnection <PipeClass, PipeClass> connection, PipeClass message)
 {
     if (message.Current == KeyEnum.Message)
     {
         _serverMessages.Add((string)message.Data);
     }
     else if (message.Current == KeyEnum.Kick)
     {
         _serverKicks.Add((string)message.Data);
     }
     else if (message.Current == KeyEnum.Ban)
     {
         var data = (NameReason)message.Data;
         if (!_serverBans.Any(x => string.Equals(x.Key, data.Name, StringComparison.CurrentCultureIgnoreCase)))
         {
             _serverBans.Add(data.Name, data.Reason);
         }
     }
     else if (message.Current == KeyEnum.Unban)
     {
         _serverUnbans.Add((string)message.Data);
     }
     else if (message.Current == KeyEnum.Mute)
     {
         var data = (NameMinutes)message.Data;
         if (!_serverMutes.Any(x => string.Equals(x.Key, data.Name, StringComparison.CurrentCultureIgnoreCase)))
         {
             _serverMutes.Add(data.Name, data.Minutes);
         }
     }
     else if (message.Current == KeyEnum.UnMute)
     {
         _serverUnMutes.Add((string)message.Data);
     }
 }
예제 #2
0
 private void _pipeServer_ServerMessage(NamedPipeConnection <PipeClass, PipeClass> connection, PipeClass message)
 {
     if (message.Current == KeyEnum.Intergrated)
     {
         PrintText("Server hooked in successfully", true);
         _connection = connection;
     }
     else if (message.Current == KeyEnum.OnlineUsers)
     {
         UpdateUserList((List <string>)message.Data);
     }
 }