public override void ReadImpl()
 {
     //ReadH();
     loginLength = ReadC();
     login       = ReadS(loginLength);
     AccountTable.LoadTable();
     getClient().setAccount(AccountTable.accounts[login]);
     /* Загружаем всю базу данных крч */
     ClansTable.LoadTable();
     ItemsTable.LoadTable();
     PlayersTable.LoadTable();
     QuestsTable.LoadTable();
     TitlesTable.LoadTable();
     PlayersConfigTable.LoadTable();
     PlayersStatsTable.LoadTable();
     TitlesTable.LoadTable();
     PlayerEquipTable.LoadTable();
     PlayersMedalsTable.LoadTable();
     getClient().setPlayer(PlayersTable.players[getClient().getAccount().AccountID]);
     getClient().getPlayer().setClient(getClient());
     getClient().getPlayer().setAddress(((IPEndPoint)getClient()._address).Address.ToString());
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.Title = "Point Blank Auth Server";
            Logger.Info("===============================================================================");
            Logger.Info("Point Blank Auth Server");
            Logger.Info("Develop OZ-Network.RU - 2016");
            Logger.Info("===============================================================================");
            ConfigModel.Load();
            Logger.Warn("Load XML=======================================================================");
            TutorialParser.Load();
            GameServersParser.Load();
            Logger.Warn("Load DataBase==================================================================");
            Connector.Connect();
            ClansTable.LoadTable();
            AccountTable.LoadTable();
            ItemsTable.LoadTable();
            PlayersTable.LoadTable();
            QuestsTable.LoadTable();
            PlayersConfigTable.LoadTable();
            PlayersStatsTable.LoadTable();
            TitlesTable.LoadTable();
            PlayerEquipTable.LoadTable();
            PlayersMedalsTable.LoadTable();
            FriendsTable.LoadTable();
            Logger.Warn("Load Protection================================================================");
            ProtectionService.Initialization();
            Logger.Warn("Load Network===================================================================");
            NetworkS.Load();

            int Mask = 0;

            Mask |= 1 << (int)Maps.StageId.TD_PORTAKABA;
            Mask |= 1 << (int)Maps.StageId.TD_REDROCK;

            Console.WriteLine(Mask);
        }
Exemplo n.º 3
0
 static void Main(string[] args)
 {
     try
     {
         Console.Title = "Point Blank Game Server";
         Logger.Info("===============================================================================");
         Logger.Info("Point Blank Game Server");
         Logger.Info("Develop OZ-Network.RU - 2016");
         Logger.Info("===============================================================================");
         ConfigModel.Load();
         Logger.Warn("Load XML=======================================================================");
         ChannelsParser.Load();
         GoodsParser.Load();
         LevelUpParser.Load();
         TutorialParser.Load();
         Logger.Warn("Load DataBase==================================================================");
         Connector.Connect();
         ClansTable.LoadTable();
         AccountTable.LoadTable();
         ItemsTable.LoadTable();
         PlayersTable.LoadTable();
         QuestsTable.LoadTable();
         TitlesTable.LoadTable();
         PlayersConfigTable.LoadTable();
         PlayersStatsTable.LoadTable();
         TitlesTable.LoadTable();
         PlayerEquipTable.LoadTable();
         PlayersMedalsTable.LoadTable();
         Logger.Warn("Load Network===================================================================");
         NetworkS.Load();
     }
     catch (Exception e)
     {
         Logger.Error("[FATAL ERROR] " + e);
     }
 }
Exemplo n.º 4
0
        public override void RunImpl()
        {
            getClient().SendPacket(new PACKET_LEVEL_UP_ACK(getClient().getPlayer().getRank()));

            Player player = getClient().getPlayer();
            Room   room   = player.getRoom();

            stats = PlayersStatsTable.statistics[player.PlayerID];
            room.getRoomSlotByPlayer(player).setState(SLOT_STATE.SLOT_STATE_NORMAL);

            if (coupon == 0)
            {
                PlayersStatsTable.UpdateEscapes(player.PlayerID, stats.getSeasonEscapes() + 1);//записываем побег
            }

            getClient().getPlayer().getRoom().getRoomSlotByPlayer(getClient().getPlayer()).setState(SLOT_STATE.SLOT_STATE_NORMAL); // статус слота

            if (player == room.getLeader() & room.getPlayers().Count == 1)                                                         //если игрок лидер и он один в комнате
            {
                foreach (Player member in getClient().getPlayer().getRoom().getPlayers().Values)
                {
                    SLOT slot = room.getRoomSlotByPlayer(member);
                    if (slot.getState() == SLOT_STATE.SLOT_STATE_BATTLE || slot.getState() == SLOT_STATE.SLOT_STATE_BATTLE_READY || slot.getState() == SLOT_STATE.SLOT_STATE_PRESTART || slot.getState() == SLOT_STATE.SLOT_STATE_LOAD || slot.getState() == SLOT_STATE.SLOT_STATE_RENDEZVOUS)
                    {
                        member.getClient().SendPacket(new PROTOCOL_ROOM_INFO_ACK(room));                                        //отправляем инфу о комнате
                        member.getClient().SendPacket(new PROTOCOL_BATTLE_LEAVE_ACK(room.getRoomSlotByPlayer(player).getId())); //инфа о том,что игрок вышел из боя
                    }
                }
                for (int i = 0; i < 16; i++)
                {
                    SLOT slot = room.getRoomSlot(i);
                    slot.setKillMessage(0);
                    slot.setLastKillMessage(0);
                    slot.setOneTimeKills(0);
                    slot.setAllKills(0);
                    slot.setAllDeahts(0);
                    slot.setBotScore(0);
                }
                room.setRedKills(0);
                room.setRedDeaths(0);
                room.setBlueKills(0);
                room.setBlueDeaths(0);
                room.setFigth(0);

                player.getClient().SendPacket(new PROTOCOL_BATTLE_END_ACK(player,room));
            }

            if (player != room.getLeader())//если игрок не лидер
            {
                foreach (Player member in getClient().getPlayer().getRoom().getPlayers().Values)
                {
                    SLOT slot = room.getRoomSlotByPlayer(member);
                    if (slot.getState() == SLOT_STATE.SLOT_STATE_BATTLE || slot.getState() == SLOT_STATE.SLOT_STATE_BATTLE_READY || slot.getState() == SLOT_STATE.SLOT_STATE_PRESTART || slot.getState() == SLOT_STATE.SLOT_STATE_LOAD || slot.getState() == SLOT_STATE.SLOT_STATE_RENDEZVOUS)
                    {
                        member.getClient().SendPacket(new PROTOCOL_ROOM_INFO_ACK(room));                                        //отправляем инфу о комнате
                        member.getClient().SendPacket(new PROTOCOL_BATTLE_LEAVE_ACK(room.getRoomSlotByPlayer(player).getId())); //инфа о том,что игрок вышел из боя
                    }
                }
            }

            if (player == room.getLeader() & room.getPlayers().Count > 1) //если игрок лидер и игроков в комнате больше одного
            {
                room.setNewLeader();                                      //выбираем нового лидера
                BattleHandler.ChangeHost(room,room.getLeader());          //отправляем на боевой сервер информацию о новом лидере комнаты
                foreach (Player member in getClient().getPlayer().getRoom().getPlayers().Values)
                {
                    SLOT slot = room.getRoomSlotByPlayer(member);
                    if (slot.getState() == SLOT_STATE.SLOT_STATE_BATTLE || slot.getState() == SLOT_STATE.SLOT_STATE_BATTLE_READY || slot.getState() == SLOT_STATE.SLOT_STATE_PRESTART || slot.getState() == SLOT_STATE.SLOT_STATE_LOAD || slot.getState() == SLOT_STATE.SLOT_STATE_RENDEZVOUS)
                    {
                        member.getClient().SendPacket(new PROTOCOL_ROOM_INFO_ACK(room));                                        //отправляем инфу о комнате
                        member.getClient().SendPacket(new PROTOCOL_BATTLE_LEAVE_ACK(room.getRoomSlotByPlayer(player).getId())); //инфа о том,что игрок вышел из боя
                        member.getClient().SendPacket(new PROTOCOL_BATTLE_CHANGE_NETWORK_ACK(room));                            //отправляем пакет с инфой о смене адреса
                    }
                }
            }
        }
        public override void RunImpl()
        {
            Room room = getClient().getPlayer().getRoom();

            room.setTimeLost(timeLost);
            Player player = getClient().getPlayer();

            if (room != null)
            {
                if (timeLost < 1 & getClient().getPlayer().getRoom().getBombState() == 0)
                {
                    if (room.getLeader().Equals(player))
                    {
                        if (room.getType() == 2)
                        {
                            room.setBlueWinRounds(room.getBlueWinRounds() + 1);
                        }
                        if (room.getType() == 2 && room.getBlueWinRounds() != room.getKillsByMask())
                        {
                            foreach (Player member in getClient().getPlayer().getRoom().getPlayers().Values)
                            {
                                SLOT slot = room.getRoomSlotByPlayer(member);
                                slot.setKillMessage(0);
                                slot.setLastKillMessage(0);
                                slot.setOneTimeKills(0);
                                member.getClient().SendPacket(new PROTOCOL_BATTLE_ROUND_END_ACK(1,2,getClient().getPlayer().getRoom()));
                            }
                            Thread.Sleep(10000);
                            foreach (Player member in getClient().getPlayer().getRoom().getPlayers().Values)
                            {
                                member.getClient().SendPacket(new opcode_3865_ACK());
                                member.getClient().SendPacket(new PROTOCOL_BATTLE_ROUND_START(member.getRoom()));
                            }
                        }
                        else
                        {
                            foreach (Player member in getClient().getPlayer().getRoom().getPlayers().Values)
                            {
                                SLOT slot = room.getRoomSlotByPlayer(member);
                                if (slot.getState() == SLOT_STATE.SLOT_STATE_BATTLE || slot.getState() == SLOT_STATE.SLOT_STATE_BATTLE_READY || slot.getState() == SLOT_STATE.SLOT_STATE_PRESTART || slot.getState() == SLOT_STATE.SLOT_STATE_LOAD || slot.getState() == SLOT_STATE.SLOT_STATE_RENDEZVOUS)
                                {
                                    slot.setState(SLOT_STATE.SLOT_STATE_NORMAL);

                                    /* Подсчет статистики */
                                    stats = PlayersStatsTable.statistics[member.getClient().getPlayer().AccountID];

                                    stats.setSeasonKills(stats.getSeasonKills() + slot.getAllKills());   //подсчет убийств
                                    stats.setSeasonDeaths(stats.getSeasonDeaths() + slot.getAllDeath()); //подсчет смертей
                                    stats.setHeadshots(stats.getHeadshots() + slot.getHeadshots());      //подсчет попаданий в голову
                                    PlayersStatsTable.UpdateStats(member.getClient().getPlayer().PlayerID,stats.getSeasonKills(),stats.getHeadshots(),stats.getSeasonDeaths());

                                    member.getClient().SendPacket(new PROTOCOL_ROOM_INFO_ACK(room));
                                    member.getClient().SendPacket(new PROTOCOL_BATTLE_END_ACK(member,getClient().getPlayer().getRoom()));
                                    member.getClient().SendPacket(new PROTOCOL_ROOM_INFO_ACK(room));
                                }
                            }
                            for (int i = 0; i < 16; i++)
                            {
                                SLOT slot = room.getRoomSlot(i);
                                slot.setKillMessage(0);
                                slot.setLastKillMessage(0);
                                slot.setOneTimeKills(0);
                                slot.setAllKills(0);
                                slot.setAllDeahts(0);
                                slot.setBotScore(0);
                            }
                            room.setRedKills(0);
                            room.setRedDeaths(0);
                            room.setBlueKills(0);
                            room.setBlueDeaths(0);
                            room.setFigth(0);
                        }
                    }
                }
            }
        }