示例#1
0
 private void M_server_OnMessageRecived(object sender, string e)
 {
     try
     {
         CommandRecievedEventArgs crea = CommandRecievedEventArgs.FromJson(e);
         bool result;
         if (crea.CommandID == (int)CommandEnum.CloseCommand)
         {
             m_server.SendCommand(new
                                  CommandRecievedEventArgs((int)CommandEnum.CloseCommand, null, crea.Args[0]));
             GUIServer.Instance.Write("Close " + crea.Args[0]);
             return;
         }
         string         res           = this.m_controller.ExecuteCommand(crea.CommandID, crea.Args, out result);
         IClientHandler clientHandler = (IClientHandler)sender;
         clientHandler.Write(this, res);
     }
     catch
     {
         Debug.Write("we are on GUIServer InM_server_OnMessageRecived and it isnt good!");
     }
 }