Ejemplo n.º 1
0
 protected override void RecvMsg(SocketClient client, string msg)
 {
     JObject jo = JObject.Parse(msg);
     var cmd = jo["cmd"].ToString();
     var content = jo["msg"];
     switch (cmd)
     {
         case "toall":
             Knl.SendAll(new {cmd,msg=new { from = client.User.Name, msg= content .ToString()} });
             break;
         default:
             break;
     }
 }
 protected override void OnConnected(SocketClient client)
 {
     Knl.SendAll(new { cmd = "updateuser",
                       msg = Knl.GetAllUsers() });
 }