public void TryAuthenticate(string Username, string Password, string RemoteAddress, bool Register = false) { using (SqlDatabaseClient client = SqlDatabaseManager.GetClient()) { uint characterId = UserCredentialsAuthenticator.TryAuthenticate(client, Username, Password, RemoteAddress); if (characterId == 0) { this.SendData(AuthenticationKoComposer.Compose(false), false); } else { BoomBang.Game.Characters.CharacterInfo info = CharacterInfoLoader.GetCharacterInfo(client, characterId, this.uint_0, true); if (ModerationBanManager.IsUserIdBlacklisted(info.UInt32_0)) { this.SendData(ModerationBanComposer.Compose(ModerationBanManager.GetBanDetails(info.UInt32_0)), false); SessionManager.StopSession(this.uint_0); } else if ((info != null) && info.HasLinkedSession) { this.characterInfo_0 = info; this.characterInfo_0.TimestampLastOnline = UnixTimestamp.GetCurrent(); CharacterResolverCache.AddToCache(this.characterInfo_0.UInt32_0, this.characterInfo_0.Username, true); this.sessionLaptopFriendCache_0 = new SessionLaptopFriendCache(client, this.CharacterId); this.userIgnoreCache_0 = new UserIgnoreCache(client, this.CharacterId); this.bool_1 = true; if (Register) { this.SendData(RegisterComposer.Compose(this.characterInfo_0), false); } else { this.SendData(AuthenticationOkComposer.Compose(this.characterInfo_0), false); } LaptopHandler.MarkUpdateNeeded(this, 0, true); } else { SessionManager.StopSession(this.uint_0); } } } }
public LaptopUpdate(int Mode, BoomBang.Game.Characters.CharacterInfo CharacterInfo) { this.int_0 = Mode; this.characterInfo_0 = CharacterInfo; }