Ejemplo n.º 1
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());
     }
 }
Ejemplo n.º 2
0
 public override void run()
 {
     try
     {
         Account player = this._client._player;
         if (player == null || this.slotIdx >= 3 || player._titles == null)
         {
             return;
         }
         PlayerTitles titles = player._titles;
         int          equip  = titles.GetEquip(this.slotIdx);
         if (equip > 0 && TitleManager.getInstance().updateEquipedTitle(titles.ownerId, this.slotIdx, 0))
         {
             titles.SetEquip(this.slotIdx, 0);
             if (TitleAwardsXML.Contains(equip, player._equip._beret) && ComDiv.updateDB("accounts", "char_beret", (object)0, "player_id", (object)player.player_id))
             {
                 player._equip._beret = 0;
                 Room room = player._room;
                 if (room != null)
                 {
                     AllUtils.updateSlotEquips(player, room);
                 }
             }
         }
         else
         {
             this.erro = 2147483648U;
         }
         this._client.SendPacket((SendPacket) new BASE_TITLE_DETACH_PAK(this.erro));
     }
     catch (Exception ex)
     {
         Logger.info("BASE_TITLE_DETACH_REC: " + ex.ToString());
     }
 }
 public override void run()
 {
     try
     {
         Account p = _client._player;
         if (p == null || slotIdx >= 3 || p._titles == null)
         {
             return;
         }
         PlayerTitles t       = p._titles;
         int          titleId = t.GetEquip(slotIdx);
         if (titleId > 0 &&
             TitleManager.getInstance().updateEquipedTitle(t.ownerId, slotIdx, 0))
         {
             t.SetEquip(slotIdx, 0);
             if (TitleAwardsXML.Contains(titleId, p._equip._beret) && ComDiv.updateDB("contas", "char_beret", 0, "player_id", p.player_id))
             {
                 p._equip._beret = 0;
                 Room room = p._room;
                 if (room != null)
                 {
                     AllUtils.updateSlotEquips(p, room);
                 }
             }
         }
         else
         {
             erro = 0x80000000;
         }
         _client.SendPacket(new BASE_TITLE_DETACH_PAK(erro));
     }
     catch (Exception ex)
     {
         SaveLog.fatal(ex.ToString());
         Printf.b_danger("[BASE_TITLE_DETACH_REC.run] Erro fatal!");
     }
 }
Ejemplo n.º 4
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!");
     }
 }
Ejemplo n.º 5
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();
        }
Ejemplo n.º 6
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();
        }