//接受到 你所感兴趣的消息 public override void ProcessEvent(MsgBase msg) { switch (msg.msgId) { case (ushort)LoadingEvent.Initial: { Debug.Log("Regist Initial"); } break; case (ushort)RegistEvent.Regist: { Debug.Log("Regist Initial 222"); RegistMsg tmp = (RegistMsg)msg; Debug.Log(tmp.data.name); Debug.Log(tmp.blood); } break; default: break; } }
public void Process(Socket workerSock) { RegistMsg msg = new RegistMsg(); msg.ReceiveFrom(workerSock); Console.WriteLine("New user 【{0}】 registered", msg.UserName); RegistResultMsg r = new RegistResultMsg(REGIST_RESULT.OK); r.Send(workerSock); }
private void RegistNewUser() { Console.WriteLine(">Please input your user name:"); var uName = Console.ReadLine(); Console.WriteLine(">Please input your password:"******">Please confirm your password:"******">Confirm password not match!"); return; } UserService.RegistUserName = uName; RegistMsg msg = new RegistMsg(uName, uPwd); msg.Send(serverSock); }