Ejemplo n.º 1
0
 public virtual void OnMapRotation(MapRotationEventArgs e)
 {
 }
Ejemplo n.º 2
0
        public void InvokeOnMapRotation()
        {
            buffer.PopAll();

            const int MAX_TRIES = 20;
            string mapName = null;
            for (int i = 0; i < MAX_TRIES; ++i)
            {
                mapName = GameServer.GetCurrentMapName();
                if (currentMapName != mapName)
                {
                    break;
                }

                Thread.Sleep(1000);
            }

            VTankObject.GameMode mode = GameServer.GetCurrentGameMode();

            MapRotationEventArgs args = new MapRotationEventArgs(mapName, mode);

            Game.Reset();
            if (Game.GameModeHandler != null)
                Game.GameModeHandler.Dispose();

            DownloadAndLoadMap();
            Game.GameModeHandler = CreateGameHandler(mode);

            RefreshPlayerList();

            OnMapRotation(args);

            GameServer.Ready();
        }