private void HandlHandSnake(MyEvent evt) { UnityClientEvent ucEvt = evt as UnityClientEvent; if (evt.Success) { HandSnakeResp resp = evt.GetParame <HandSnakeResp>(); this.sessionToken = resp.ReconnectToken; if (this.debug) { string[] messages = new string[] { string.Format("Handshake response: sessionToken => {0}, heartbeatTime => {1}", this.sessionToken, resp.HeartbeatTime) }; this.log.Debug(messages); } if (this.client.IsReconnecting) { this.client.IsReconnecting = false; this.Dispatch(new UnityClientEvent(UnityClientEvent.CONNECTION_RESUME)); } else { this.isConnecting = false; this.Dispatch(new UnityClientEvent(UnityClientEvent.CONNECTION)); } } else { UnityClientEvent cEvt = new UnityClientEvent(UnityClientEvent.CONNECTION); cEvt.Success = false; cEvt.ErrorDes = "Failed to HandSnake"; this.Dispatch(cEvt); } }
static void Onlogin1(MyEvent evt) { if (evt.Success) { LoginResp loginResp = evt.GetParame <LoginResp>(); Console.WriteLine("Account =>> " + loginResp.Account + ",Password =>> " + loginResp.Password); } }