예제 #1
0
        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();
        }
예제 #2
0
        public static void HandleCharList(S_GET_USER_LIST p)
        {
            /*- Moved from HandleReturnToLobby -*/
            SessionManager.Logged = false;
            SkillManager.Clear();
            EntityManager.ClearNPC();
            GroupWindowViewModel.Instance.ClearAll();
            WindowManager.Dashboard.VM.UpdateBuffs();
            SessionManager.CurrentPlayer.ClearAbnormalities();

            /*---------------------------------*/

            foreach (var item in p.CharacterList)
            {
                var ch = WindowManager.Dashboard.VM.Characters.FirstOrDefault(x => x.Id == item.Id);
                if (ch != null)
                {
                    ch.Name = item.Name;
                    ch.Laurel = item.Laurel;
                    ch.Position = item.Position;
                    ch.GuildName = item.GuildName;
                    ch.Level = item.Level;
                    ch.LastLocation = item.LastLocation;
                    ch.LastOnline = item.LastOnline;
                    ch.ServerName = SessionManager.Server.Name;
                }
                else
                {
                    WindowManager.Dashboard.VM.Characters.Add(item);
                }
            }

            WindowManager.Dashboard.VM.SaveCharacters();

        }
 public static void HandleReturnToLobby(S_RETURN_TO_LOBBY p)
 {
     SessionManager.Logged = false;
     WindowManager.CharacterWindow.Reset();
     SkillManager.Clear();
     SessionManager.ClearPlayersAbnormalities();
     EntitiesManager.ClearNPC();
 }
예제 #4
0
 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();
 }
예제 #5
0
        /*
                public static void SendTestMessage()
                {
                    //var str = "@3947questNameDefeat HumedraszoneName@zoneName:181npcName@creature:181#2050";
                    //var str = "@3789cityname@cityWar:20guildFated";
                    //var str = "@1773ItemName@item:152141ItemName1@item:447ItemCount5";
                    const string str = "@3821userNametestNameguildQuestName@GuildQuest:31007001value1targetValue3";
                    var toBytes = Encoding.Unicode.GetBytes(str);
                    var arr = new byte[toBytes.Length + 2 + 4];
                    for (var i = 0; i < toBytes.Length - 1; i++)
                    {
                        arr[i + 4] = toBytes[i];
                    }

                    var seg = new ArraySegment<byte>(arr);

                    var sysMsg = new S_SYSTEM_MESSAGE(new TeraMessageReader(new Message(DateTime.Now, MessageDirection.ServerToClient, seg), OpCodeNamer, Factory, SystemMessageNamer));
                    HandleSystemMessage(sysMsg);

                }
        */
        public static void HandleReturnToLobby(S_RETURN_TO_LOBBY p)
        {
            SessionManager.Logged = false;
            WindowManager.Dashboard.VM.UpdateBuffs();
            SessionManager.CurrentPlayer.ClearAbnormalities();
            SkillManager.Clear();
            EntityManager.ClearNPC();
            GroupWindowViewModel.Instance.ClearAll();
            ClassWindowViewModel.Instance.CurrentClass = Class.None;

        }
        private static void OnEndConnection()
        {
            ChatWindowManager.Instance.AddTccMessage("Disconnected from the server.");
            WindowManager.FloatingButton.NotifyExtended("TCC", "Disconnected", NotificationType.Warning);

            GroupWindowViewModel.Instance.ClearAllAbnormalities();
            WindowManager.Dashboard.VM.UpdateBuffs();
            WindowManager.Dashboard.VM.SaveCharacters();
            SessionManager.CurrentPlayer.ClearAbnormalities();
            EntityManager.ClearNPC();
            SkillManager.Clear();
            WindowManager.TrayIcon.Icon = WindowManager.DefaultIcon;
            Proxy.Proxy.CloseConnection();
            SessionManager.Logged        = false;
            SessionManager.LoadingScreen = 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);
        }
예제 #8
0
        private static void OnEndConnection()
        {
            Firebase.RegisterWebhook(SettingsHolder.WebhookUrlGuildBam, false);
            Firebase.RegisterWebhook(SettingsHolder.WebhookUrlFieldBoss, false);

            ChatWindowManager.Instance.AddTccMessage("Disconnected from the server.");
            WindowManager.FloatingButton.NotifyExtended("TCC", "Disconnected", NotificationType.Warning);

            WindowManager.GroupWindow.VM.ClearAllAbnormalities();
            WindowManager.Dashboard.VM.UpdateBuffs();
            WindowManager.Dashboard.VM.SaveCharacters();
            SessionManager.CurrentPlayer.ClearAbnormalities();
            EntityManager.ClearNPC();
            SkillManager.Clear();
            WindowManager.TrayIcon.Icon = WindowManager.DefaultIcon;
            ProxyInterface.Instance.Disconnect(); //ProxyOld.CloseConnection();
            SessionManager.Logged        = false;
            SessionManager.LoadingScreen = true;
        }
예제 #9
0
        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);
        }
예제 #10
0
        public static void HandleLogin(S_LOGIN p)
        {
            SessionManager.CurrentPlayer.Class = p.CharacterClass;
            WindowManager.ReloadPositions();
            //S_IMAGE_DATA.LoadCachedImages(); //TODO: refactor this thing
            if (Settings.SettingsHolder.ClassWindowSettings.Enabled) ClassWindowViewModel.Instance.CurrentClass = p.CharacterClass;
            AbnormalityManager.SetAbnormalityTracker(p.CharacterClass);
            SessionManager.Server = BasicTeraData.Instance.Servers.GetServer(p.ServerId);
            if (!Settings.SettingsHolder.StatSent) App.SendUsageStat();
            Settings.SettingsHolder.LastRegion = SessionManager.Language;
            TimeManager.Instance.SetServerTimeZone(Settings.SettingsHolder.LastRegion);
            TimeManager.Instance.SetGuildBamTime(false);
            SessionManager.InitDatabases(Settings.SettingsHolder.LastRegion);
            SkillManager.Clear();
            CooldownWindowViewModel.Instance.LoadSkills(p.CharacterClass);
            WindowManager.FloatingButton.SetMoongourdButtonVisibility();
            EntityManager.ClearNPC();
            GroupWindowViewModel.Instance.ClearAll();
            ChatWindowManager.Instance.BlockedUsers.Clear();
            SessionManager.CurrentPlayer.ClearAbnormalities();

            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);
            WindowManager.Dashboard.VM.SetLoggedIn(p.PlayerId);
            SessionManager.GuildMembersNames.Clear();
            //if (Settings.Settings.LastRegion == "NA")
            //    Task.Delay(20000).ContinueWith(t => ChatWindowManager.Instance.AddTccMessage(App.ThankYou_mEME));

        }
예제 #11
0
 public void LeaveWorld()
 {
     if (skillManager != null)
     {
         skillManager.Clear();
     }
     if (battleManager != null)
     {
         battleManager.Clean();
     }
     if (propertyManager != null)
     {
         propertyManager.Clear();
     }
     if (sfxManager != null)
     {
         sfxManager.Clear();
     }
     if (fsm != null)
     {
         fsm.Clear();
     }
     OnLeaveWorld();
 }