public static void HandleCharList(S_GET_USER_LIST p) { /*- Moved from HandleReturnToLobby -*/ SessionManager.Logged = false; SessionManager.CurrentPlayer.ClearAbnormalities(); BuffBarWindowViewModel.Instance.Player.ClearAbnormalities(); SkillManager.Clear(); EntitiesManager.ClearNPC(); GroupWindowViewModel.Instance.ClearAll(); /*---------------------------------*/ foreach (var item in p.CharacterList) { var ch = InfoWindowViewModel.Instance.Characters.FirstOrDefault(x => x.Id == item.Id); if (ch != null) { ch.Name = item.Name; ch.Laurel = item.Laurel; ch.Position = item.Position; } else { InfoWindowViewModel.Instance.Characters.Add(item); } } InfoWindowViewModel.Instance.SaveToFile(); }
public static void HandleReturnToLobby(S_RETURN_TO_LOBBY p) { SessionManager.Logged = false; WindowManager.CharacterWindow.Reset(); SkillManager.Clear(); SessionManager.ClearPlayersAbnormalities(); EntitiesManager.ClearNPC(); }
public static void HandleReturnToLobby(S_RETURN_TO_LOBBY p) { SessionManager.Logged = false; SessionManager.CurrentPlayer.ClearAbnormalities(); BuffBarWindowViewModel.Instance.Player.ClearAbnormalities(); SkillManager.Clear(); EntitiesManager.ClearNPC(); GroupWindowViewModel.Instance.ClearAll(); }
public static void HandleSpawnMe(S_SPAWN_ME p) { EntitiesManager.ClearNPC(); System.Timers.Timer t = new System.Timers.Timer(2000); t.Elapsed += (s, ev) => { t.Stop(); SessionManager.LoadingScreen = false; WindowManager.RefreshDim(); }; t.Enabled = true; }
public static void HandleSpawnMe(S_SPAWN_ME p) { //WindowManager.ShowWindow(WindowManager.CharacterWindow); EntitiesManager.ClearNPC(); System.Timers.Timer t = new System.Timers.Timer(2000); t.Elapsed += (s, ev) => { SessionManager.LoadingScreen = false; t.Stop(); }; t.Enabled = true; }
public static void HandleLogin(S_LOGIN p) { if (SettingsManager.ClassWindowSettings.Enabled) { ClassWindowViewModel.Instance.CurrentClass = p.CharacterClass; } Server = BasicTeraData.Instance.Servers.GetServer(p.ServerId); if (!SettingsManager.StatSent) { App.SendUsageStat(); } SettingsManager.LastRegion = Language; TimeManager.Instance.SetServerTimeZone(SettingsManager.LastRegion); TimeManager.Instance.SetGuildBamTime(false); SessionManager.InitDatabases(SettingsManager.LastRegion); CooldownWindowViewModel.Instance.ClearSkills(); SessionManager.CurrentPlayer.Class = p.CharacterClass; if (Utils.ClassEnumToString(p.CharacterClass).ToLower() != "") //why???? { CooldownWindowViewModel.Instance.LoadSkills(Utils.ClassEnumToString(p.CharacterClass).ToLower() + "-skills.xml", p.CharacterClass); } WindowManager.FloatingButton.SetMoongourdButtonVisibility(); EntitiesManager.ClearNPC(); GroupWindowViewModel.Instance.ClearAll(); BuffBarWindowViewModel.Instance.Player.ClearAbnormalities(); SkillManager.Clear(); SessionManager.LoadingScreen = true; SessionManager.Logged = true; SessionManager.Encounter = false; MessageFactory.Update(); SessionManager.CurrentPlayer.EntityId = p.entityId; SessionManager.CurrentPlayer.PlayerId = p.PlayerId; SessionManager.CurrentPlayer.ServerId = p.ServerId; SessionManager.CurrentPlayer.Name = p.Name; SessionManager.CurrentPlayer.Level = p.Level; SessionManager.SetPlayerLaurel(SessionManager.CurrentPlayer); CharacterWindowViewModel.Instance.Player.Class = p.CharacterClass; CharacterWindowViewModel.Instance.Player.Name = p.Name; CharacterWindowViewModel.Instance.Player.Level = p.Level; SessionManager.SetPlayerLaurel(CharacterWindowViewModel.Instance.Player); InfoWindowViewModel.Instance.SetLoggedIn(p.PlayerId); }
public static void HandleLogin(S_LOGIN p) { var srv = p.ServerId; ServerId = srv; InitDb(srv); CooldownWindowViewModel.Instance.ClearSkills(); CooldownWindowViewModel.Instance.LoadSkills(Utils.ClassEnumToString(p.CharacterClass).ToLower() + "-skills.xml", p.CharacterClass); if (SettingsManager.ClassWindowSettings.Enabled) { WindowManager.ClassWindow.Context.CurrentClass = p.CharacterClass; } EntitiesManager.ClearNPC(); GroupWindowViewModel.Instance.ClearAll(); BuffBarWindowViewModel.Instance.Player.ClearAbnormalities(); SkillManager.Clear(); SessionManager.LoadingScreen = true; SessionManager.Logged = true; SessionManager.Encounter = false; SessionManager.CurrentPlayer.Class = p.CharacterClass; MessageFactory.Update(); SessionManager.CurrentPlayer.EntityId = p.entityId; SessionManager.CurrentPlayer.PlayerId = p.PlayerId; SessionManager.CurrentPlayer.ServerId = p.ServerId; SessionManager.CurrentPlayer.Name = p.Name; SessionManager.CurrentPlayer.Level = p.Level; SessionManager.SetPlayerLaurel(SessionManager.CurrentPlayer); CharacterWindowViewModel.Instance.Player.Class = p.CharacterClass; CharacterWindowViewModel.Instance.Player.Name = p.Name; CharacterWindowViewModel.Instance.Player.Level = p.Level; SessionManager.SetPlayerLaurel(CharacterWindowViewModel.Instance.Player); InfoWindowViewModel.Instance.SetLoggedIn(p.PlayerId); }