public void Login(string account, string password, string serverID) { var rPassword = Util.MD5String(password); var rArgs = new Dict <string, string>(); rArgs["acc"] = account; rArgs["pass"] = rPassword; rArgs["serverID"] = serverID; var rPath = "Login"; this.SendRequest(rPath, rArgs, ServerType.LoginServer, (args) => { var stream = new MemoryStream(args.bytes); StreamReader sr = new StreamReader(stream, System.Text.Encoding.GetEncoding("UTF-8")); var ret = UInt32.Parse(sr.ReadLine()); var key = sr.ReadLine(); var user = Global.ModelManager.GetModel <UserModel>(); user.LoginKey = key; user.ServerID = serverID; var eventArgs = new ResponseLoginEventArgs(ret, key); ResponseLoginEvent(this, eventArgs); }); }
public override ExtendedEventArgs process() { ResponseLoginEventArgs args = new ResponseLoginEventArgs { status = status }; return(args); }
public void ResponseLogin(ExtendedEventArgs eventArgs) { ResponseLoginEventArgs args = eventArgs as ResponseLoginEventArgs; if (args.status == 0) { NetworkManager.gameState = NetworkManager.GameState.LOBBY; } }
public void ResponseLogin(ExtendedEventArgs eventArgs) { ResponseLoginEventArgs args = eventArgs as ResponseLoginEventArgs; if (args.status == 0) { Constants.USER_ID = args.user_id; } else { Debug.Log("Login Failed"); } }
public override ExtendedEventArgs process() { ResponseLoginEventArgs args = null; if (status == 0) { args = new ResponseLoginEventArgs(); args.status = status; args.user_id = user_id; args.username = username; } return(args); }
public override ExtendedEventArgs process() { ResponseLoginEventArgs args = null; args = new ResponseLoginEventArgs(); args.status = status; if (status == 0) { args.user_id = user_id; args.username = username; args.last_logout = last_logout; } return args; }
public void ResponseLogin(ExtendedEventArgs eventArgs) { ResponseLoginEventArgs args = eventArgs as ResponseLoginEventArgs; if (args.status == 0) { Constants.USER_ID = args.user_id; Debug.Log("Successful Login response : " + args.ToString()); //EditorUtility.DisplayDialog ("Login Successful", "You have successfully logged in.\nClick Ok to continue execution and see responses on console", "Ok"); cManager.send(requestTest("*", 7)); } else { Debug.Log("Login Failed"); } }
public void OnResponseLogin(ExtendedEventArgs eventArgs) { Debug.Log("Response join"); ResponseLoginEventArgs args = eventArgs as ResponseLoginEventArgs; if (args.status == 0) { if (args.user_id == 1) { Join.SetActive(false); Player1Overlay.SetActive(true); Player2Overlay.SetActive(true); Player2Box.SetActive(false); } else if (args.user_id == 2) { Join.SetActive(false); Player1Overlay.SetActive(true); Player1Box.SetActive(false); Player2Overlay.SetActive(true); } else { Debug.Log("ERROR: Invalid user_id in ResponseJoin: " + args.user_id); return; } Constants.USER_ID = args.user_id; Debug.Log("MYUSERID: " + Constants.USER_ID); Constants.OP_ID = 3 - args.user_id; if (args.op_id > 0) { if (args.op_id == Constants.OP_ID) { if (args.user_id == 1) { displayName2.SetActive(true); displayName2.GetComponent <Text>().text = args.op_name; } else { displayName1.SetActive(true); displayName1.GetComponent <Text>().text = args.op_name; } } } } }
public void ResponseLogin(ExtendedEventArgs eventArgs) { ResponseLoginEventArgs args = eventArgs as ResponseLoginEventArgs; if (args.status == 0) { Constants.USER_ID = args.user_id; Debug.Log("Successful Login response : " + args.ToString()); DBManager.username = username; DBManager.id = Constants.USER_ID; SceneManager.LoadScene("KeyToContinue"); } else { Debug.Log("Login Failed"); } }
public override ExtendedEventArgs process() { ResponseLoginEventArgs args = new ResponseLoginEventArgs { status = status }; if (status == 0) { args.user_id = user_id; args.op_id = op_id; args.op_name = op_name; args.op_confirm = op_confirm; } return(args); }
public override ExtendedEventArgs process() { ResponseLoginEventArgs args = null; if (status == 0) { args = new ResponseLoginEventArgs(); args.status = status; args.user_id = user_id; args.username = username; args.money = money; args.level = level; args.last_logout = last_logout; } return(args); }
public void OnResponseLogin(ExtendedEventArgs eventArgs) { ResponseLoginEventArgs args = eventArgs as ResponseLoginEventArgs; if (args.status == 0) { messageBoxMsg.text = "Login Successful!"; messageBox.SetActive(true); loginMenuPanel.SetActive(false); networkMenuPanel.SetActive(true); } else { messageBoxMsg.text = "Login Credentials Invalid"; messageBox.SetActive(true); } }
public void ResponseLogin(ExtendedEventArgs eventArgs) { ResponseLoginEventArgs args = eventArgs as ResponseLoginEventArgs; if (args.status == 0) { SwitchToWorldSelection(); Constants.USER_ID = args.user_id; gameObject.GetComponent <WorldMenu>().name = args.username; gameObject.GetComponent <WorldMenu>().last_logout = args.last_logout; } else { mainObject.GetComponent <Main>().CreateMessageBox("Login Failed"); } }
public void ResponseLogin(ExtendedEventArgs eventArgs) { ResponseLoginEventArgs args = eventArgs as ResponseLoginEventArgs; Debug.Log("Login Client Status: " + args.status); if (args.status == 0) { Constants.USER_ID = args.user_id; EditorUtility.DisplayDialog("Login Successful", "You have successfully logged in.\nClick Ok to continue execution and see responses on console", "Ok"); SceneManager.LoadScene("Work"); } else { Constants.USER_ID = args.user_id; Debug.Log("Login Failed"); EditorUtility.DisplayDialog("Login failed", "Please check your username and password.\n ", "Ok"); } }
public void ResponseLogin(ExtendedEventArgs eventArgs) { ResponseLoginEventArgs args = eventArgs as ResponseLoginEventArgs; if (args.status == 0) { User user = new User(); user.ID = args.user_id; user.userName = args.username; user.email = args.email; user.played = args.gamesPlayed; user.won = args.gamesWon; user.lost = args.gamesLost; Main.user = user; Main.gameState = Main.GameState.MAIN_MENU; switchPanelMain.Animate(); } else { wrongAnimator.Play("Notification In"); soundScript.Notification(); } }
public override ExtendedEventArgs process() { ResponseLoginEventArgs args = null; if (status == 0) { // Main.setLoggedIn(true); args = new ResponseLoginEventArgs(); args.status = status; args.user_id = user_id; args.username = username; args.email = email; args.gamesPlayed = gamesPlayed; args.gamesWon = gamesWon; args.gamesLost = gamesLost; Debug.Log("Logged In"); } else { Debug.Log("Login Failed"); } return(args); }
public void OnResponseLogin(ExtendedEventArgs eventArgs) { ResponseLoginEventArgs args = eventArgs as ResponseLoginEventArgs; if (args.status == 0) { if (args.user_id == 1) { playerName = player1Name; opponentName = player2Name; playerInput = player1Input; opponentInput = player2Input; } else if (args.user_id == 2) { playerName = player2Name; opponentName = player1Name; playerInput = player2Input; opponentInput = player1Input; } else { Debug.Log("ERROR: Invalid user_id in ResponseLogin: "******"Error joining game. Network returned invalid response."; messageBox.SetActive(true); return; } Constants.USER_ID = args.user_id; Constants.OP_ID = 3 - args.user_id; if (args.op_id > 0) { if (args.op_id == Constants.OP_ID) { opponentName.text = args.op_name; opConfirm = args.op_confirm; } else { Debug.Log("ERROR: Invalid op_id in ResponseLogin: "******"Error joining game. Network returned invalid response."; messageBox.SetActive(true); return; } } else { opponentName.text = "Waiting for opponent"; } playerInput.SetActive(true); opponentName.gameObject.SetActive(true); playerName.gameObject.SetActive(false); opponentInput.SetActive(false); rootMenuPanel.SetActive(false); networkMenuPanel.SetActive(true); } else { messageBoxMsg.text = "Server is full."; messageBox.SetActive(true); } }