public static MessageBean formatLoginMessage(string accountText, string password) { BLOKUSAccount account = new BLOKUSAccount(); account.account = accountText; account.password = password; MessageBean message = new MessageBean(); message.operationCode = OperationCode.LOGIN; message.statusCode = StatusCode.SUCCESS; message.data = ProtobufHelper.SerializerToBytes(account); return message; }
//private void connectSuccess(MessageBean message) { // GameObject.Find("UIController").SendMessage("hidePanel", GameObject.Find("ConnectionPanel").transform); // GameObject.Find("UIController").SendMessage("showPanel", GameObject.Find("LoginPanel").transform); //} private void login(MessageBean message) { //Debug.Log(message.operationCode); //Debug.Log(message.statusCode); //Debug.Log(message.data); if (message.statusCode == StatusCode.SUCCESS) { BLOKUSAccount account = ProtobufHelper.DederializerFromBytes <BLOKUSAccount>(message.data); GameCache.account = account.account; GameCache.inRoomListPanel = true; GameObject.Find("UIController").SendMessage("hidePanel", GameObject.Find("LoginPanel").transform); GameObject.Find("UIController").SendMessage("showPanel", GameObject.Find("RoomListPanel").transform); } else { GameObject.Find("UIController").SendMessage("showPromptWithButtonMessage", "login fail!"); } }