Exemplo n.º 1
0
 /// <summary>
 /// 移除监听事件
 /// </summary>
 public override void RemoveListener()
 {
     HandlerMediat.RemoveAllListener(OperationCode.Login);
     HandlerMediat.RemoveAllListener(OperationCode.Register);
 }
Exemplo n.º 2
0
 /// <summary>
 /// 注册监听事件
 /// </summary>
 public override void AddListener()
 {
     HandlerMediat.AddListener(OperationCode.Login, OnLoginReceived);
     HandlerMediat.AddListener(OperationCode.Register, OnRegisterReceived);
 }
Exemplo n.º 3
0
        //当我们在客户端向服务器端发起请求后,服务器端接受处理这个请求给客户端一个响应就会在这个方法里进行处理
        public void OnOperationResponse(OperationResponse operationResponse)
        {
            MessageCode code = (MessageCode)operationResponse.OperationCode;//得到响应的OperationCode

            HandlerMediat.Dispatch(code, operationResponse);
        }
Exemplo n.º 4
0
 public override void RemoveListener()
 {
     HandlerMediat.RemoveListener(OperationCode.SyncPlayer, OnSyncPlayerReceived);
 }
Exemplo n.º 5
0
 public override void RemoveListener()
 {
     HandlerMediat.RemoveListener(MessageCode.AddPlayer, OnSyncAddPlayerReceived);
 }
Exemplo n.º 6
0
 /// <summary>
 /// 移除监听事件
 /// </summary>
 public override void RemoveListener()
 {
     HandlerMediat.RemoveAllListener(MessageCode.Login);
     HandlerMediat.RemoveAllListener(MessageCode.Register);
 }