//处理命令
 public void DealCommandWithBytes(byte[] bytes)
 {
     Console.WriteLine("deal command: {0}", Encoding.UTF8.GetString(bytes));
     JObject commandobj = (JObject)JsonConvert.DeserializeObject(Encoding.UTF8.GetString(bytes));
     string cType = commandobj["type"].ToString();
     JObject content = (JObject)commandobj["content"];
     Debug.WriteLine(cType);
     if (cType.Equals("sendMsg"))
     {
         CatAdapter.GetInstance().SendMsg(content);
     }
     else if (cType.Equals("call"))
     {
         CatAdapter.GetInstance().Call(content);
     }
 }
Exemple #2
0
 public static void Main(string[] args)
 {
     CommandAdapter.GetInstance().ConnectToCommandServer();
     CatAdapter.GetInstance().ConnectToCat();
     Console.ReadLine();
 }