public void IntializeDataUser(GameObject role, string pathTemp) { Debug.Log("IntializeDataUser:" + role + pathTemp); DataOfUser data = JsonUti.JsonstreamToObject <DataOfUser> (pathTemp); role.GetComponent <Role_Main> ().playerName = data.username; }
public ActionResult Login(DataOfUser model) { var db = new UserModel(); DataOfUser log; try { log = db.DataOfUser.Where(x => x.Login == model.Login && x.Password == model.Password).First(); } catch (InvalidOperationException) { log = null; } if (log != null) { Response.SetCookie(new HttpCookie("Login", model.Login)); return(RedirectToAction("Index")); } else { ModelState.AddModelError("", "Неверный Логин/Пароль"); return(View()); } }
public UserEntityConfiguration(DataOfUser user) { _user = user; }
public void LoginGame() { string path = Application.dataPath + "/InitializeInfo/"; path += "Login.text"; UserDataS userdata = JsonUti.JsonstreamToObject <UserDataS> (path); bool canLod = false; Debug.Log("登陆时,所填写:" + userName.text + passWord.text); for (int i = 0; i < userdata.userdatas.Count; i++) { if (userName.text == userdata.userdatas [i].username) { if (passWord.text == userdata.userdatas [i].password) { canLod = true; break; } else { //密码错误 tips.SetActive(true); Debug.Log("密码错误"); break; } } else { continue; } } if (!canLod) { //用户不存在,请注册 tips.transform.Find("Text").GetComponent <Text> ().text = "用户不存在\n请注册"; tips.SetActive(true); } if (canLod) { string pathUser = Application.dataPath + "/InitializeInfo/DataOfUser/"; pathUser = pathUser + userName.text + ".text"; Debug.Log("登录的用户" + userName.text + pathUser); DataOfUser dataOfUser = JsonUti.JsonstreamToObject <DataOfUser> (pathUser); Debug.Log("登录的用户" + dataOfUser.username); string curLoadPlayer = Application.dataPath + "/InitializeInfo/CurLoadPlayer.text"; JsonUti.ObjectToJsonStream <DataOfUser> (curLoadPlayer, dataOfUser); Debug.Log("登录的用户" + dataOfUser.Level); Debug.Log("进入游戏"); // StartCoroutine (LoadScene ()); //异步加载场景 canvas03.SetActive(false); canvas01.SetActive(false); canvas02.SetActive(true); cameraShow.SetActive(false); Debug.Log(dataOfUser.Money); ClearInput(); // Debug.Log (dataOfUser.OwnHero); } ClearInput(); }