/// <summary> /// 服务端响应客户端请求的返回 /// </summary> /// <param name="operationResponse"></param> public override void OnOperationResponse(OperationResponse operationResponse) { ReturnCode returnCode = (ReturnCode)operationResponse.ReturnCode; Debug.Log(returnCode); registerPanel.OnRegisterResponse(returnCode); }
public override void OnResponse(string data) { ReturnCode returnCode = (ReturnCode)int.Parse(data); registerPanel.OnRegisterResponse(returnCode); //Debug.Log("ReturnCode:" + returnCode.ToString()); }
public override void OnResponse(string data) { base.OnResponse(data); ReturnCode returnCode = (ReturnCode)int.Parse(data); registerPanel.OnRegisterResponse(returnCode); }
/// <summary> /// 服务器端返回响应 /// </summary> /// <param name="data">这里传入的是转成int类型的ReturnCode枚举类型的值</param> public override void OnResponse(string data) { JsonData jsonData = JsonMapper.ToObject(data); int returnCodeInt = int.Parse(jsonData["returnCode"].ToString()); ReturnCode returnCode = (ReturnCode)returnCodeInt; //先将int类型转换为对应的枚举类型 registerPanel.OnRegisterResponse(returnCode); //交给UIPanel对象根据返回值做相应处理 }
// 重写OnResponse data是服务器端发送的响应数据 数据的解析 具体处理交给LoginPanel public override void OnResponse(string data) { // 先得到响应的状态码 // data先转int,然后整体强制转换枚举类型 ReturnCode returnCode = (ReturnCode)int.Parse(data); registerPanel.OnRegisterResponse(returnCode); }
public override void OnOperationResponse(OperationResponse operationResponse) { if ((OperationCode)operationResponse.OperationCode == OpCode) { scriptRegisterPanel.OnRegisterResponse((ReturnCode)operationResponse.ReturnCode); }//else 非法请求 //Debug.Log(operationResponse.OperationCode + " RegisterState:" + operationResponse.ReturnCode); //string strRegisterState = DictTool.GetValue<byte, object>(operationResponse.Parameters, (byte)ParameterCode.LoginState).ToString(); //Debug.Log(operationResponse.OperationCode + " RegisterState:" + strRegisterState); }
public override void OnResponse(string data) { Debug.Log(data); string[] strs = data.Split('|'); ReturnCode returnCode = (ReturnCode)int.Parse(strs[0]); if (returnCode == ReturnCode.Success) { facade.setUserInfo(data); } registerPanel.OnRegisterResponse(returnCode); }
public override void OnResponse(string data) { string[] strs = data.Split(','); ReturnCode returnCode = (ReturnCode)int.Parse(strs[0]); registerPanel.OnRegisterResponse(returnCode); if (returnCode == ReturnCode.Success) { // UIManager.Instance.PushPanel(UIPanelType.MainMenu); //string username = strs[1]; //int totalCount = int.Parse(strs[2]); //int winCount = int.Parse(strs[3]); //UserData ud = new UserData(username, totalCount, winCount); //facade.SetUserData(ud); } }
public override void OnResponse(string data) { base.OnResponse(data); string[] strs = data.Split(','); ReturnCode returnCode = (ReturnCode)int.Parse(strs[0]); if (returnCode == ReturnCode.Success) { string username = strs[1]; int totalcount = int.Parse(strs[2]); int wincount = int.Parse(strs[3]); UserData user = new UserData(username, totalcount, wincount); gameFacade.SetUserData(user); } registerPanel.OnRegisterResponse(returnCode); }
public override void OnOperationResonse(OperationResponse response) { ReturenCode returenCode = (ReturenCode)response.ReturnCode; registerPanel.OnRegisterResponse(returenCode); }
protected override void OnResponse(string data) { RetuenCode returnCode = (RetuenCode)int.Parse(data); registerPanel.OnRegisterResponse(returnCode); }
public override void OnOperationResponse(OperationResponse response) { m_RegisterPanel.OnRegisterResponse(response); }