internal void Login(string login, string password) { string resourceAddress = "http://mac4.ixcglobal.com:8081/login"; LoginSend loginSend = CreateLoginInfo(login, password); PostJsonRequestWebClient(resourceAddress, Helper.GetJson(loginSend)); }
private void OnClickPlay() { //SceneManager.LoadScene("Main"); //UIManager.Instance.ShowPanel(PanelID.Main); LoginSend loginSend = new LoginSend(); loginSend.Account = "cct"; loginSend.Password = "******"; NetManager.Instance.Send(loginSend); }
private void System_Login(byte[] bytes) { LoginSend loginSend = Utility.FromBytes <LoginSend>(bytes); Debug.Log(loginSend.Account); Debug.Log(loginSend.Password); LoginReceive loginReceive = new LoginReceive(); loginReceive.IsSuccess = true; loginReceive.Name = "cct"; loginReceive.Level = 7; Server.Instance.Send(loginReceive); }
private static LoginSend CreateLoginInfo(string login, string password) { LoginSend loginSend = new LoginSend(login, password); string ipAddress = FindIPAddress(); if (string.IsNullOrWhiteSpace(ipAddress)) { loginSend.customer_ip_address = ipAddress; } ////loginSend.deviceMAC = "B8:E8:56:4A:37:20"; ////deviceToken = "MPqQ/E98Jt6Ve+fiiHftoZcUme17cZ4pT8wOsXcZ72U="; ////deviceType = "x86_64"; ////iphoneUDID = "424c49454fca8adffedddd536c99c5fb2ee5dd1d"; ////isBonusNotificationEnabled = "1"; ////localeIdentifier = "en_US"; loginSend.newDeviceId = GetDeviceID(); ////version = "3.0"; return(loginSend); }
public static bool LogIn(string email, string senha) { LoginSend login = new LoginSend { grant_type = "password", password = senha, username = email }; RootToken retorno = JsonConvert .DeserializeObject <RootToken>( Utils.Json(Method.POST, "/Token", login, false, null) ); Biblioteca.SetToken(retorno.access_token); if (retorno != null) { UsuarioDTO userinfo = JsonConvert .DeserializeObject <UsuarioDTO>( Utils.Json(Method.GET, "/api/Account/UserInfo", null, true, Biblioteca.GetToken()) ); if (userinfo != null) { AddOrUpdate(userinfo); Biblioteca.SetSessao(userinfo); return(true); } else { return(false); } } else { return(false); } }
public static void Send(LoginSend obj, Action <LoginReceive> cb, Func <ErrorCode, bool> error = null) { new Communication("Login").Push(obj).Send((res, str) => OnReceive(res, str, cb, error)); }
public static string GetJson(LoginSend loginSend) { var json = Newtonsoft.Json.JsonConvert.SerializeObject(loginSend); return(json); }