public bool LoginV2(string pinInput, string name, string surname, ref LoginMessageEnum lme) { bool Auth = false; List <AppUser> UserList = m_AppUserRepo.Find(f => f.Pin.ToLower() == pinInput.ToLower() && f.Name == name && f.Surname == surname); if (UserList == null || UserList.Count > 1 || UserList.Count == 0) { lme = LoginMessageEnum.BadPIN; return(Auth); } ; AppUser User = UserList[0]; if (User.Active == false) { lme = LoginMessageEnum.Inactive; return(Auth); } ; if (User.Pin.ToLower() == pinInput.ToLower()) { Auth = true; this.User = User; } return(Auth); }
private void SendLoginMessage(LoginMessageEnum msgType) { Player.Response.Write(new byte[] { 0x01, 0x00 }); Player.Response.WriteUInt32((int)msgType); Player.Response.WriteByte(0); Player.SendResponse(); }
void HandleLoginMessage(LoginMessageEnum msgType) { Response.Clear(); Response.Write(new byte[] { 0x01, 0x00 }); Response.WriteByte((byte)msgType); if (msgType != LoginMessageEnum.Sucess) { Response.WriteUInt32(0); } else { Response.WritePStr(GetLogin); Response.WriteUInt32(GetUID); Response.WriteUInt32(GetCapability); //Capacity Response.WriteUInt32(GetLevel); // Level Response.WriteUInt32(10); Response.WriteUInt16(12); Response.WritePStr(GetNickname); Send(Response.GetBytes()); } SendResponse(); }