Пример #1
0
    public FieldWar(int id)
    {
        Id    = id;
        MapId = FieldWarMetadataStorage.MapId(id);

        List <Player> onlinePlayers = GameServer.PlayerManager.GetAllPlayers().Where(x => !MapMetadataStorage.MapIsInstancedOnly(x.MapId)).ToList();

        DateTimeOffset now = DateTimeOffset.UtcNow;

        EntryClosureTime = now.AddSeconds(-now.Second).AddMinutes(5);

        foreach (Player player in onlinePlayers)
        {
            player.Session.Send(FieldWarPacket.LegionPopup(id, EntryClosureTime.ToUnixTimeSeconds()));
        }
    }
Пример #2
0
    private static void HandleLegionEnter(GameSession session)
    {
        FieldWar currentFieldWar = GameServer.FieldWarManager.CurrentFieldWar;

        if (currentFieldWar is null)
        {
            return;
        }
        if (currentFieldWar.EntryClosureTime < DateTimeOffset.UtcNow)
        {
            return;
        }

        int mapId = FieldWarMetadataStorage.MapId(currentFieldWar.Id);

        session.Player.Warp(mapId);
    }