Exemplo n.º 1
0
 public override void run()
 {
     try
     {
         Account player = this._client._player;
         if (player == null)
         {
             return;
         }
         PlayerTitles titles = player._titles;
         TitleQ       title  = TitlesXML.getTitle((int)this.titleId, true);
         TitleQ       title1;
         TitleQ       title2;
         TitleQ       title3;
         TitlesXML.get3Titles(titles.Equiped1, titles.Equiped2, titles.Equiped3, out title1, out title2, out title3, false);
         if (this.slotIdx >= (byte)3 || this.titleId >= (byte)45 || (titles == null || title == null) || (title._classId == title1._classId && this.slotIdx != (byte)0 || title._classId == title2._classId && this.slotIdx != (byte)1) || (title._classId == title3._classId && this.slotIdx != (byte)2 || (!titles.Contains(title._flag) || titles.Equiped1 == (int)this.titleId) || (titles.Equiped2 == (int)this.titleId || titles.Equiped3 == (int)this.titleId)))
         {
             this.erro = 2147483648U;
         }
         else if (TitleManager.getInstance().updateEquipedTitle(titles.ownerId, (int)this.slotIdx, (int)this.titleId))
         {
             titles.SetEquip((int)this.slotIdx, (int)this.titleId);
         }
         else
         {
             this.erro = 2147483648U;
         }
         this._client.SendPacket((SendPacket) new BASE_TITLE_USE_PAK(this.erro));
     }
     catch (Exception ex)
     {
         Logger.info("BASE_TITLE_USE_REC: " + ex.ToString());
     }
 }
Exemplo n.º 2
0
        public static string GetAllTitles(Account p)
        {
            if (p._titles.ownerId == 0L)
            {
                TitleManager.getInstance().CreateTitleDB(p.player_id);
                p._titles = new PlayerTitles()
                {
                    ownerId = p.player_id
                };
            }
            PlayerTitles titles = p._titles;
            int          num    = 0;

            for (int titleId = 1; titleId <= 44; ++titleId)
            {
                TitleQ title = TitlesXML.getTitle(titleId, true);
                if (title != null && !titles.Contains(title._flag))
                {
                    ++num;
                    titles.Add(title._flag);
                    if (titles.Slots < title._slot)
                    {
                        titles.Slots = title._slot;
                    }
                }
            }
            if (num > 0)
            {
                ComDiv.updateDB("player_titles", "titleslots", (object)titles.Slots, "owner_id", (object)p.player_id);
                TitleManager.getInstance().updateTitlesFlags(p.player_id, titles.Flags);
                p.SendPacket((SendPacket) new BASE_2626_PAK(p));
            }
            return(Translation.GetLabel("TitleAcquisiton", (object)num));
        }
Exemplo n.º 3
0
 public override void run()
 {
     try
     {
         Account player = this._client._player;
         if (player == null || this.titleIdx >= 45)
         {
             return;
         }
         if (player._titles.ownerId == 0L)
         {
             TitleManager.getInstance().CreateTitleDB(player.player_id);
             player._titles = new PlayerTitles()
             {
                 ownerId = player.player_id
             };
         }
         TitleQ title = TitlesXML.getTitle(this.titleIdx, true);
         if (title != null)
         {
             TitleQ title1;
             TitleQ title2;
             TitlesXML.get2Titles(title._req1, title._req2, out title1, out title2, false);
             if ((title._req1 == 0 || title1 != null) && (title._req2 == 0 || title2 != null) && (player._rank >= title._rank && player.brooch >= title._brooch && (player.medal >= title._medals && player.blue_order >= title._blueOrder)) && (player.insignia >= title._insignia && !player._titles.Contains(title._flag) && (player._titles.Contains(title1._flag) && player._titles.Contains(title2._flag))))
             {
                 player.brooch     -= title._brooch;
                 player.medal      -= title._medals;
                 player.blue_order -= title._blueOrder;
                 player.insignia   -= title._insignia;
                 long flags = player._titles.Add(title._flag);
                 TitleManager.getInstance().updateTitlesFlags(player.player_id, flags);
                 List <ItemsModel> awards = TitleAwardsXML.getAwards(this.titleIdx);
                 if (awards.Count > 0)
                 {
                     this._client.SendPacket((SendPacket) new INVENTORY_ITEM_CREATE_PAK(1, player, awards));
                 }
                 this._client.SendPacket((SendPacket) new BASE_QUEST_UPDATE_INFO_PAK(player));
                 TitleManager.getInstance().updateRequi(player.player_id, player.medal, player.insignia, player.blue_order, player.brooch);
                 if (player._titles.Slots < title._slot)
                 {
                     player._titles.Slots = title._slot;
                     ComDiv.updateDB("player_titles", "titleslots", (object)player._titles.Slots, "owner_id", (object)player.player_id);
                 }
             }
             else
             {
                 this.erro = 2147487875U;
             }
         }
         else
         {
             this.erro = 2147487875U;
         }
         this._client.SendPacket((SendPacket) new BASE_TITLE_GET_PAK(this.erro, player._titles.Slots));
     }
     catch (Exception ex)
     {
         Logger.warning("[BASE_TITLE_GET_REC] " + ex.ToString());
     }
 }
        public static string GetAllTitles(Account p)
        {
            if (p._titles.ownerId == 0)
            {
                TitleManager.getInstance().CreateTitleDB(p.player_id);
                p._titles = new PlayerTitles {
                    ownerId = p.player_id
                };
            }
            PlayerTitles titles = p._titles;
            int          count  = 0;

            for (int i = 1; i <= 44; i++)
            {
                TitleQ title = TitlesXML.getTitle(i, true);
                if (title != null && !titles.Contains(title._flag))
                {
                    count++;
                    titles.Add(title._flag);
                    if (titles.Slots < title._slot)
                    {
                        titles.Slots = title._slot;
                    }
                }
            }
            if (count > 0)
            {
                ComDiv.updateDB("player_titles", "titleslots", titles.Slots, "owner_id", p.player_id);
                TitleManager.getInstance().updateTitlesFlags(p.player_id, titles.Flags);
                p.SendPacket(new BASE_2626_PAK(p));
            }
            return(Translation.GetLabel("TitleAcquisiton", count));
        }
        public static string SendTitlePlayer(string str)
        {
            string txt = str.Substring(str.IndexOf(" ") + 1);

            string[] split     = txt.Split(' ');
            long     player_id = Convert.ToInt64(split[0]);

            Account p = AccountManager.getAccount(player_id, 0);

            if (p._titles.ownerId == 0)
            {
                TitleManager.getInstance().CreateTitleDB(p.player_id);
                p._titles = new PlayerTitles {
                    ownerId = p.player_id
                };
            }
            PlayerTitles titles = p._titles;
            int          count  = 0;

            for (int i = 1; i <= 44; i++)
            {
                TitleQ title = TitlesXML.getTitle(i, true);
                if (title != null && !titles.Contains(title._flag))
                {
                    count++;
                    titles.Add(title._flag);
                    if (titles.Slots < title._slot)
                    {
                        titles.Slots = title._slot;
                    }
                }
            }
            if (count > 0)
            {
                ComDiv.updateDB("player_titles", "titleslots", titles.Slots, "owner_id", p.player_id);
                TitleManager.getInstance().updateTitlesFlags(p.player_id, titles.Flags);
                p.SendPacket(new BASE_2626_PAK(p));
            }
            return(Translation.GetLabel("TitleAcquisiton", count));
        }
 public override void run()
 {
     try
     {
         Account p = _client._player;
         if (p == null)
         {
             return;
         }
         PlayerTitles t = p._titles;
         TitleQ       titleQ = TitlesXML.getTitle(titleId),
                      eq1, eq2, eq3;
         TitlesXML.get3Titles(t.Equiped1, t.Equiped2, t.Equiped3, out eq1, out eq2, out eq3, false);
         if (slotIdx >= 3 || titleId >= 45 || t == null || titleQ == null || titleQ._classId == eq1._classId && slotIdx != 0 || titleQ._classId == eq2._classId && slotIdx != 1 || titleQ._classId == eq3._classId && slotIdx != 2 || !t.Contains(titleQ._flag) || t.Equiped1 == titleId || t.Equiped2 == titleId || t.Equiped3 == titleId)
         {
             erro = 0x80000000;
         }
         else
         {
             if (TitleManager.getInstance().updateEquipedTitle(t.ownerId, slotIdx, titleId))
             {
                 t.SetEquip(slotIdx, titleId);
             }
             else
             {
                 erro = 0x80000000;
             }
         }
         _client.SendPacket(new BASE_TITLE_USE_PAK(erro));
     }
     catch (Exception ex)
     {
         SaveLog.fatal(ex.ToString());
         Printf.b_danger("[BASE_TITLE_USE_REC.run] Erro fatal!");
     }
 }
Exemplo n.º 7
0
        public static string SendTitlePlayer(string str)
        {
            Account account = AccountManager.getAccount(Convert.ToInt64(str.Substring(str.IndexOf(" ") + 1).Split(' ')[0]), 0);

            if (account._titles.ownerId == 0L)
            {
                TitleManager.getInstance().CreateTitleDB(account.player_id);
                account._titles = new PlayerTitles()
                {
                    ownerId = account.player_id
                };
            }
            PlayerTitles titles = account._titles;
            int          num    = 0;

            for (int titleId = 1; titleId <= 44; ++titleId)
            {
                TitleQ title = TitlesXML.getTitle(titleId, true);
                if (title != null && !titles.Contains(title._flag))
                {
                    ++num;
                    titles.Add(title._flag);
                    if (titles.Slots < title._slot)
                    {
                        titles.Slots = title._slot;
                    }
                }
            }
            if (num > 0)
            {
                ComDiv.updateDB("player_titles", "titleslots", (object)titles.Slots, "owner_id", (object)account.player_id);
                TitleManager.getInstance().updateTitlesFlags(account.player_id, titles.Flags);
                account.SendPacket((SendPacket) new BASE_2626_PAK(account));
            }
            return(Translation.GetLabel("TitleAcquisiton", (object)num));
        }
Exemplo n.º 8
0
 public override void run()
 {
     try
     {
         Account p = _client._player;
         if (p == null || titleIdx >= 45)
         {
             return;
         }
         if (p._titles.ownerId == 0)
         {
             TitleManager.getInstance().CreateTitleDB(p.player_id);
             p._titles = new PlayerTitles {
                 ownerId = p.player_id
             };
         }
         TitleQ t1 = TitlesXML.getTitle(titleIdx);
         if (t1 != null)
         {
             TitleQ tr1, tr2;
             TitlesXML.get2Titles(t1._req1, t1._req2, out tr1, out tr2, false);
             if ((t1._req1 == 0 || tr1 != null) &&
                 (t1._req2 == 0 || tr2 != null) &&
                 p._rank >= t1._rank &&
                 p.brooch >= t1._brooch &&
                 p.medal >= t1._medals &&
                 p.blue_order >= t1._blueOrder &&
                 p.insignia >= t1._insignia &&
                 !p._titles.Contains(t1._flag) &&
                 p._titles.Contains(tr1._flag) &&
                 p._titles.Contains(tr2._flag))
             {
                 p.brooch     -= t1._brooch;
                 p.medal      -= t1._medals;
                 p.blue_order -= t1._blueOrder;
                 p.insignia   -= t1._insignia;
                 long flags = p._titles.Add(t1._flag);
                 TitleManager.getInstance().updateTitlesFlags(p.player_id, flags);
                 List <ItemsModel> items = TitleAwardsXML.getAwards(titleIdx);
                 if (items.Count > 0)
                 {
                     _client.SendPacket(new INVENTORY_ITEM_CREATE_PAK(1, p, items));
                 }
                 _client.SendPacket(new BASE_QUEST_UPDATE_INFO_PAK(p));
                 TitleManager.getInstance().updateRequi(p.player_id, p.medal, p.insignia, p.blue_order, p.brooch);
                 if (p._titles.Slots < t1._slot)
                 {
                     p._titles.Slots = t1._slot;
                     ComDiv.updateDB("player_titles", "titleslots", p._titles.Slots, "owner_id", p.player_id);
                 }
             }
             else
             {
                 erro = 0x80001083;
             }
         }
         else
         {
             erro = 0x80001083;
         }
         _client.SendPacket(new BASE_TITLE_GET_PAK(erro, p._titles.Slots));
     }
     catch (Exception ex)
     {
         SaveLog.fatal(ex.ToString());
         Printf.b_danger("[BASE_TITLE_GET_REC.run] Erro fatal!");
     }
 }
Exemplo n.º 9
0
        public static void Main(string[] args)
        {
            {
                Application.Run((Form) new ip());
            }

            Console.Clear();
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(Programm.CurrentDomainOnUnhandledException);
            Console.Title     = "Iniciando o Point Blank Game Server...";
            Logger.StartedFor = "game";
            Logger.checkDirectorys();
            StringUtil stringUtil = new StringUtil();

            stringUtil.AppendLine("               ________  _____  __      ______ _______          ");
            stringUtil.AppendLine("              / ____/  |/  / / / /     / /  / / /  / /          ");
            stringUtil.AppendLine("             / __/ / /|_/ / / / /     / /__/_/ /__/ /           ");
            stringUtil.AppendLine("            / /___/ /  / / /_/ / _   / /    / /  / /            ");
            stringUtil.AppendLine("                                                                ");
            string str = ComDiv.GetLinkerTime(Assembly.GetExecutingAssembly(), (TimeZoneInfo)null).ToString("dd/MM/yyyy HH:mm");

            stringUtil.AppendLine("             Data de Inicialização: " + str + "                 ");
            Logger.info(stringUtil.getString());
            ConfigGS.Load();
            ComDiv.GetDate();
            BasicInventoryXML.Load();
            ServerConfigSyncer.GenerateConfig(ConfigGS.configId);
            ServersXML.Load();
            ChannelsXML.Load(ConfigGS.serverId);
            EventLoader.LoadAll();
            TitlesXML.Load();
            TitleAwardsXML.Load();
            ClanManager.Load();
            NickFilter.Load();
            MissionCardXML.LoadBasicCards(1);
            BattleServerXML.Load();
            RankXML.Load();
            RankXML.LoadAwards();
            ClanRankXML.Load();
            MissionAwards.Load();
            MissionsXML.Load();
            Translation.Load();
            ShopManager.Load(1);
            TorunamentRulesManager.LoadList();
            RandomBoxXML.LoadBoxes();
            CupomEffectManager.LoadCupomFlags();
            bool flag1 = true;

            foreach (string text in args)
            {
                if (ComDiv.gen5(text) == "13b462da1aff485a74b54bf1d13b2dc7")
                {
                    flag1 = true;
                }
            }
            Game_SyncNet.Start();
            if (flag1)
            {
                bool flag2 = GameManager.Start();
                Logger.warning("[Aviso] Padrão de textos: " + ConfigGB.EncodeText.EncodingName);
                Logger.warning("[Aviso] Modo atual: " + (ConfigGS.isTestMode ? "Testes" : "Público"));
                Logger.warning(Programm.StartSuccess());
                if (flag2)
                {
                    LoggerGS.updateRAM();
                }
            }
            Process.GetCurrentProcess().WaitForExit();
        }
Exemplo n.º 10
0
        public static void Main(string[] args)
        {
            Printf.blue("[Licença de uso]", false);
            Printf.blue("[+] Esta é uma versão compilada para Project Bloodi!!!", false);
            Printf.blue("[+] https://github.com/luisfeliperm", false);
            Printf.info("\n\n\n Iniciando servidor...", false);
            Thread.Sleep(5000);
            Console.Clear();


            TimeStarted        = DateTime.Now;
            SaveLog.aplication = "game";

            Console.Title = "PointBlank - Game";
            header(true);


            // Validações
            System.Reflection.Assembly assembly    = System.Reflection.Assembly.GetExecutingAssembly();
            FileVersionInfo            fileVersion = FileVersionInfo.GetVersionInfo(assembly.Location);

            if (!Compatible.Check(fileVersion.FileVersion, "game") || !ServerLicense.check() || !ServerPasswd.Compare(args))
            {
                Console.ReadKey();
                return;
            }

            SaveLog.checkDirectorys();
            ConfigGS.Load();
            WelcomeXML.Load();
            BasicInventoryXML.Load();
            ServerConfig.Load();
            ServersXML.Load();
            ChannelsXML.Load(ConfigGS.serverId);
            EventLoader.LoadAll();
            RankUp.load();
            TitlesXML.Load();
            TitleAwardsXML.Load();
            ClanManager.Load();
            NickFilter.Load();
            MissionCardXML.LoadBasicCards(1);
            BattleServerJSON.Load();
            RankXML.Load();
            RankXML.LoadAwards();
            ClanRankXML.Load();
            MissionAwards.Load();
            MissionsXML.Load();
            Translation.Load();
            ShopManager.Load(1);
            ClassicModeManager.LoadList();
            RandomBoxXML.LoadBoxes();
            CupomEffectManager.LoadCupomFlags();
            Game_SyncNet.Start();
            bool started = GameManager.Start();

            if (started)
            {
                cpuMonitor.updateRAM();
            }

            header(false);

            while (true)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.Write("[SHELL]# ");
                Console.ForegroundColor = ConsoleColor.White;
                String input = Console.ReadLine();

                if (string.IsNullOrEmpty(input))
                {
                    continue;
                }
                Comandos.checkCmd(input);
            }

            //Process.GetCurrentProcess().WaitForExit();
        }