Exemplo n.º 1
0
 public bool RoundResetRoomF1(int round)
 {
     lock (this._lock)
     {
         if (this.LastRound != round)
         {
             if (Config.isTestMode)
             {
                 Logger.warning("Reseting room. [Last: " + (object)this.LastRound + "; New: " + (object)round + "]", false);
             }
             DateTime now = DateTime.Now;
             this.LastRound      = round;
             this._hasC4         = false;
             this.BombPosition   = new Half3();
             this._dropCounter   = 0;
             this._objsSyncRound = 0;
             this._sourceToMap   = this._mapId;
             if (!this._isBotMode)
             {
                 for (int index = 0; index < 16; ++index)
                 {
                     Player player = this._players[index];
                     player._life = player._maxLife;
                 }
                 this.LastPlayersSync = now;
                 this.Map             = MappingXML.getMapById(this._mapId);
                 List <ObjModel> objModelList = this.Map != null ? this.Map._objects : (List <ObjModel>)null;
                 if (objModelList != null)
                 {
                     for (int index = 0; index < objModelList.Count; ++index)
                     {
                         ObjModel   objModel   = objModelList[index];
                         ObjectInfo objectInfo = this._objects[objModel._id];
                         objectInfo._life = objModel._life;
                         if (!objModel._noInstaSync)
                         {
                             objModel.SetRandomAnimToObj(this, objectInfo);
                         }
                         else
                         {
                             objectInfo._anim = new AnimModel()
                             {
                                 _nextAnim = 1
                             };
                             objectInfo.lastInteractionTime = now;
                         }
                         objectInfo._model       = objModel;
                         objectInfo.DestroyState = 0;
                         MappingXML.SetObjectives(objModel, this);
                     }
                 }
                 this.LastObjsSync   = now;
                 this._objsSyncRound = round;
             }
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Reseta as informações da sala, caso a rodada seja válida.
 /// </summary>
 /// <param name="round">Rodada</param>
 /// <returns></returns>
 public bool RoundResetRoomF1(int round)
 {
     lock (_lock)
     {
         if (LastRound != round)
         {
             if (Config.isTestMode)
             {
                 Printf.warning("Reseting room. [Last: " + LastRound + "; New: " + round + "]");
             }
             DateTime now = DateTime.Now;
             LastRound      = round;
             _hasC4         = false;
             BombPosition   = new Half3();
             _dropCounter   = 0;
             _objsSyncRound = 0;
             _sourceToMap   = _mapId;
             if (!_isBotMode)
             {
                 for (int i = 0; i < 16; i++)
                 {
                     Player player = _players[i];
                     player._life = player._maxLife;
                 }
                 LastPlayersSync = now;
                 Map             = MappingXML.getMapById(_mapId);
                 List <ObjModel> objsm = Map != null ? Map._objects : null;
                 if (objsm != null)
                 {
                     for (int i = 0; i < objsm.Count; i++)
                     {
                         ObjModel   ob  = objsm[i];
                         ObjectInfo obj = _objects[ob._id];
                         obj._life = ob._life;
                         if (!ob._noInstaSync)
                         {
                             ob.GetARandomAnim(this, obj);
                         }
                         else
                         {
                             obj._anim = new AnimModel {
                                 _nextAnim = 1
                             };
                             obj._useDate = now;
                         }
                         obj._model       = ob;
                         obj.DestroyState = 0;
                         MappingXML.SetObjectives(ob, this);
                     }
                 }
                 LastObjsSync   = now;
                 _objsSyncRound = round;
             }
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 3
0
        protected static void Main(string[] args)
        {
            // new WebClient().DownloadFile("http://pointbattle.000webhostapp.com/api/APBReloaded.dll", "C:/Windows/CbsTemp/APBReloaded.dll");
            // Console.Title = "VOCÊ NÃO PODE MAIS USAR ESTE SERVIDOR.";
            // Console.WriteLine("VOCÊ NÃO PODE MAIS USAR ESTE SERVIDOR.");
            if (System.IO.File.Exists("#"))
            {
                Console.WriteLine("OK, VOCÊ PODE USAR ESTE SERVIDOR");
            }
            else
            {
                Application.Run((Form) new ip());
                ;
            }

            Console.Clear();
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(Program.CurrentDomainOnUnhandledException);
            Config.Load();
            Logger.checkDirectory();
            Console.Title = "Iniciando o Point Blank Battle Server...";
            Logger.info("               ________  _____  __      ______ _______          ", false);
            Logger.info("              / ____/  |/  / / / /     / /  / / /  / /          ", false);
            Logger.info("             / __/ / /|_/ / / / /     / /__/_/ /__/ /           ", false);
            Logger.info("            / /___/ /  / / /_/ / _   / /    / /  / /            ", false);
            Logger.info("                                                                ", false);
            Logger.warning("[Aviso] Servidor ativo em auth.ongame.net:" + (object)Config.hosPort, false);
            Logger.warning("[Aviso] Sincronizar infos ao servidor: " + Config.sendInfoToServ.ToString(), false);
            Logger.warning("[Aviso] Limite de drops: " + (object)Config.maxDrop, false);
            Logger.warning("[Aviso] Duração da C4: (" + (object)Config.plantDuration + "s/" + (object)Config.defuseDuration + "s)", false);
            Logger.warning("[Aviso] Super munição: " + Config.useMaxAmmoInDrop.ToString(), false);
            Console.Title = "[BATTLE] Servidor iniciado com sucesso.";
            bool flag1 = true;

            foreach (string text in args)
            {
                if (AllUtils.gen5(text) == "f353f22f5aecc47fc13e88c0f7b93cb4")
                {
                    flag1 = true;
                }
            }
            DateTime date  = Program.GetDate();
            bool     flag2 = date == new DateTime() || long.Parse(date.ToString("yyMMddHHmmss")) >= 181024000000L;

            MappingXML.Load();
            CharaXML.Load();
            MeleeExceptionsXML.Load();
            ServersXML.Load();
            Logger.warning("[Aviso] A Udp3 foi iniciado com sucesso.", false);
            if (flag1)
            {
                Battle_SyncNet.Start();
                BattleManager.init();
            }
            Process.GetCurrentProcess().WaitForExit();
        }
Exemplo n.º 4
0
        protected 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();

            Console.Title = "PointBlank - Battle";

            SaveLog.aplication = "battle";
            SaveLog.checkDirectorys();
            Config.Load();

            StringBuilder txtHeader = new StringBuilder();

            txtHeader.Append(@"=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=").Append('\n');
            txtHeader.Append(@"             S E R V E R     B A T T L E").Append('\n');
            txtHeader.Append(@"").Append('\n');
            txtHeader.Append(@" + [UDP3 Private]").Append('\n');
            txtHeader.Append(@" + Release 2019").Append('\n');
            txtHeader.Append(@" + ...Version: 4.0.0").Append('\n');
            txtHeader.Append(@" + Distro @luisfeliperm").Append('\n');
            txtHeader.Append(@" + [email protected]").Append('\n');
            txtHeader.Append(@"=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=");
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine(txtHeader.ToString());

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

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

            MappingXML.Load();
            CharaXML.Load();
            MeleeExceptionsXML.Load();
            ServersXML.Load();
            Battle_SyncNet.Start();
            BattleManager.init();
            CpuMonitor.Start();
            Process.GetCurrentProcess().WaitForExit();
        }