Title         : Map-Vote 
Game          : Unreal Tournament
Version       : 2.9
Release Date  : 2/23/2001
Filenames     : BDBMapVote2.u, BDBMapVote2.int
Author        : Bruce Bickar aka BDB
Email Address : BDB@planetunreal.com or BBickar@carolina.rr.com
Web Page      : http://www.planetunreal.com/BDBUnreal

Description   : This mutator allows players to control what maps are played on a server through voting.

Features      o Graphical user interface. At the end of each game a Voting Window will pop up automatically,
                so no key binding is required and there are no console commands to remember.

              o Screen-Shot preview. When a map is selected a screen-shot (picture) of the map will be displayed 
                along with information about the map such as the author and the recommended number of players. 
                If the player doesn't have the selected map file on their computer then it will indicate that 
                downloading is required.

              o Mid game map change option. The players can vote for a map at any time during the course of the game.
                If all of the players vote mid game the map will be changed immediately.
                
              o Players can configure a keyboard key that can be used at any time during the game to open the voting window.
                This is not required because the voting window will automatically open it self at the end of each game. But
                if the players want to take advantage of the player kick voting or the early map voting features then this would
                be required. Also, the key configuration does not require any console commands or opening of the preferences menu.
                This key configuration is built in to the voting window which makes it much easier to do.
                It also will work with-out a Mod Menu INT file, this is important because INT files are not automatically 
                downloaded from the server in network play and Mod Menu configuration windows require an INT file.

              o Tie breaker feature. Each player can only vote for one map. If all of the players vote the votes will be counted 
                and the map with the highest vote count will win. If there is a tie, then a map will be choosen at random from 
                the maps that tied for first place. 

              o Player Kick feature. Players can place "kick" votes against other players. If the percentage of players that
                vote against a particular player reaches the configurable kick requirement percentage then that player will 
                be disconnected from the server. If the kicked player reconnects to the server during the same game that he
                was kicked from, he/she will be re-kicked automatically. To clairify, This kick/ban only lasts until the end 
                of the current game, or until the map is changed. Note: The server administrator can not be kicked.
                New in version 2.7 - This feature can now be disabled by the server administrator.

              o Remote dedicated server configuration window, which can be used by remote administrators to configure Map-Vote.
                There are no console configuration commands to look up and remember.

              o Works with all games types. The server administrator can configure which types of maps will be loaded in to the 
                map voting list. The following Map types can be turned on or off:
                - Death Match (DM)
                - Team Death Match (DM)
                - Last Man Standing (DM)
                - Assault (AS)
                - Capture The Flag (CTF)
                - Domination (DOM)
                - Other Game Type - This is a configurable game type. It can be used for Mods like Rocket-Arena, Tactical-Ops, Strike-Force
                  and any other mod. (It has only been tested with Rocket-Arena ,Tactical Ops, Strike-Force, and Unreal Fortress)
                       
              o Configurable message expiration time. Players can use this feature to change the amount of time that messages
                remain on their HUD/screen. This is good for people who can't speed read messages in 3 seconds.
                
              o Voting status report window. This window displays a list of maps that were voted for and the amount of votes for
                each. It also shows player names that were had kick votes cast against them.
                      
              o Configurable End-Game voting time limit. At the end of a game the players have a set about of time to place their
                votes. If all players have not voted with in this time limit then a map change will be forced.

Requirements  : Required version 413 or better of Unreal Tournament. (This include the players as well as the server)
                
Installation Instruction :
              If you downloaded the UMOD version just double click it and it should install it self.
              If you downloaded the ZIP version:
              1. Place BDBMapVote2.int in the \UnrealTournament\System directory.
              2. Place BDBMapVote2.u in the \UnrealTournament\System directory.
              3. Add "ServerPackages=BDBMapVote2" to the \UnrealTournament\system\UnrealTournament.ini file under 
                 the "[Engine.GameEngine]" section. (***Note: this if very important, it will not work without this.)

Server Setup    1. Set the settings that you want for each game type using the normal UT menus or 
                   edit the UnrealTournament.ini file.
                   For example set the number of frags in deathmatch before the match ends and
                   then change to CTF and change the number of flag capture's before the match ends.
                   Close the Multiplayer window to save the settings.
                2. Select any mutators that you want plus the "Map-Vote" mutator.
                3. Start the game. (see dedicated server setup below for dedicated servers)
                
Configuration : There are three ways to configure Map Vote on a server.
                Configuration Methods: (choose one and only one)
                ---------------------
                A. 1. Click the "MOD" menu then select "Map-Vote Configuration".
                   2. Check the game types that you want to be available or just check Auto Detect and 
                      it will automatically set the game type that the server was started with.
                   3. Close the Configuration window.
                     
                B. 1. Open the UnrealTournament.ini file, located in the \UnrealTournament\System directory, with any text editor.
                   2. Modify the values for each parameter after the = to True or False.
                      If you want only CTF maps to be loaded in the map list then change the value after bCTF= to True
                      and the rest of the values to False. 
                      Example UnrealTournament.ini file contents:
                      -----------------------------------------
                      [BDBMapVote2.BDBMapVote2]
                      bAutoDetect=True
                      bDM=False
                      bLMS=False
                      bTDM=False
                      bDOM=False
                      bCTF=False
                      bAS=False
                      bOther=False
                      MsgTimeOut=30
                      OtherClass=SFGame.SFTeamDM
                      VoteTimeLimit=70
                      KickPercent=51
                      bUseMapList=True
                      ScoreBoardDelay=10
                      bAutoOpen=True
                      bKickVote=True
                      bTOTieGameFix=True
                      bCheckOtherGameTie=False
                      ------------------------------------------
                      Note: This section will not be present until you run UT and save the configuration.
                          
                C. (This method is for configuring a remote dedicated server)
                   1. Start the server with the "Map-Vote" mutator. (See decicated server setup instructions below)
                   2. Connect to your server with UT. 
                   3. Login as Admin with the "ADMINLOGIN password" console command. 
                      Note: If you don't see a message like "YourPlayerName has become the administrator" then the password was wrong.
                   4. In the command console enter "MUTATE BDBMAPVOTE VOTEMENU". This should display the Map-Voting window.
                   5. First click the "Config" tab and bind a menu hot key. 
                      Instead of entering the MUTATE... command now you can just hit the hot key to bring up the voting window.
                   6. Click the "Admin" tab which should be all the way to the right. It may be covered by the <|> buttons in the
                      top right corner. If so , click the > button.  If there is No "Admin" tab then you have not
                      successfully logged in as administrator, close the window and go back to step 3.
                   7. Change the options in the scrolling Admin window. There is a second half of the page which does not show.
                      Just use the scroll bar on the far right to scroll down.
                   8. Click the "Remote Save" button. This will save your selected options on the remote server and reload the maplist 
                      on the server.
                   9. Now close and reopen the voting window to refresh the map list.

OtherGame Classes: If you want to use Map-Vote with a MOD then you can just use the Auto Detect option.
                   This will setup the game class automatically when the server is stared.
                   
                   You still have the option of specifing the Other Game Class option and Check the Other Mod Game 
                   check box in the Configuration window. You would have to do this if you wanted to have a MOD
                   and UT maps/games types avaialble for voting in the same list at the same time.

                   Known Mod Game Classes:
                   -----------------------
                   Rocket-Arena      - RocketArena.RocketArenaGame
                   Tactical-Ops      - s_SWAT.s_SWATGame
                   Strike-Force      - SFGame.SFTeamDM
                                       SFGame.SFDM
                                       SFGame.SFHostageRescue
                                       SFGame.SFEscape
                                       SFGame.SFAssault
                                       SFGame.SFJailBreak
                   Unreal-Fortress   - UnrealFortress.Game_UnrealFortress
                   Infiltration 2.75 - InfiltrationUT.InfilDeathMatchPlus
                                       InfiltrationUT.InfilTeamGamePlus
                                       InfiltrationUT.InfilCTFGame
                                       InfiltrationUT.InfilDomination
                                       InfiltrationUT.InfilAssault
                                       InfiltrationUT.InfilLastManStanding
              
Advanced Server Setup: For decicated server owners.
                       Put the appropriate command and parameters (found below) in your server batch file.

                Unreal-Tournament Game Types:
                -----------------------------
                UCC server DM-Morpheus.unr?Game=Botpack.DeathMatchPlus?mutator=BDBMapVote2.BDBMapVote2 
                UCC server DM-Morpheus.unr?Game=Botpack.TeamGamePlus?mutator=BDBMapVote2.BDBMapVote2 
                UCC server DM-Morpheus.unr?Game=Botpack.LastManStanding?mutator=BDBMapVote2.BDBMapVote2 
                UCC server AS-Guardia.unr.unr?Game=Botpack.Assault?mutator=BDBMapVote2.BDBMapVote2 
                UCC server CTF-LavaGiant.unr?Game=Botpack.CTFGame?mutator=BDBMapVote2.BDBMapVote2 
                UCC server DOM-Cinder.unr?Game=Botpack.Domination?mutator=BDBMapVote2.BDBMapVote2 
                  
                Rocket-Arena:
                -----------------------------
                UCC server RA-Cliffyb.unr?Game=RocketArena.RocketArenaGame?mutator=BDBMapVote2.BDBMapVote2 
                  
                Tactical Ops: (as of Version 1.5) (Note: You might have to change this when the next version is released.)
                -----------------------------
                UCC server SW-OilRig.unr?Game=s_SWAT.s_SWATGame?mutator=BDBMapVote2.BDBMapVote2 
                 
                Strike-Force:               
                -----------------------------
                UCC server SFTDM-Canal_140.unr?Game=SFGame.SFTeamDM?mutator=BDBMapVote2.BDBMapVote2 -userini=SFUser.ini -ini=StrikeForce.ini
                ***Note: Since StrikeForce uses it's own ini file you need to edit the StrikeForce.ini file and add
                "ServerPackages=BDBMapVote2" under the "[Engine.GameEngine]" section. It will not work with-out this.
         
                Unreal-Fortress:
                -----------------------------
                UCC server UNF-Cliffside.unr?Game=UnrealFortress.Game_UnrealFortress?mutator=BDBMapVote2.BDBMapVote2
                ***Note: UnrealFortress games can have Sudden Death OverTime during a tied game,
                         therefore you need to change the "Check Sudden Death Overtime" option in the configuration.
                         Or change bCheckOtherGameTie to True in the UnrealTournament.ini file.

Known bugs    : 1. If you use GameSpy or something like it to connect to servers and you have a lot of Mods installed
                   you might get disconnected from the server when it trys to load the Voting Window.
                   This would only happen the first time after connecting to a server.
                   Just reconnect to the server using the "Reconnect" option under the "Multiplayer" menu.
                                  
                2. When I tested this with "DOM-LittleThings" map , it always played under DeathMatch and dropped the mutator.
                   I couldnt figure out the problem , but it works fine with all the other maps. I might have a corrupted map file.

                3. Strike-Force (version 1.55) disables auto downloading by defaulting the AllowDownloads option to False in the StrikeForce.ini file.
                   (found under the [IpDrv.TcpNetDriver] section), Therefore; if you setup a SF server players who do not have 
                    this mutator installed on their computer will not be able to connect. 
                    There are two ways to fix this:
                    a. Edit the StrikeForce.ini files on both the Server and every Client and change AllowDownloads to True.
                       This is not practical considering the ammount of Clients out there that wouldn't know how to open a file
                       let alone change the value in one. 
                    b. Require all Clients/Players to download and install this mutator.

                    * I've been in contact with Gruff from StrikeForce and they are going to include Map-Vote 
                      with the download of their next version (1.6). This will solve the AutoDownload problem.
                 
                4. The Re-Kick Player feature doesn't work properly in Strike-Force version 1.55. 
                   You can Kick players but they can rejoin the server. This will be fixed in SF version 1.6 when it 
                   is released.
              
                5. The version 1.6 patch for Tactical Ops broke the Re-Kick Player feature, same as above with StrikeForce.
                   According to the TO web site version 2.0 will re-enable mutator support which should fix this.
                                   
Version History : 
         1.0 MapVote.unr Map (3D Voting, cool idea but not practical)
         2.0 Initial Testing Version (Dropped the Map and used UWindows and Mutator)
         2.1 Fixed the Assault mid-game RestartWait problem. (game waited 5 minutes before continuing to second half of match)
             Add a Config tab window to the MapVote window for players who autodownloaded the mutator and do not have the .int file.
             This will allow them to configure a keyboard key to launch the voting window.
         2.2 Added a 20 second voting restriction at the beginning of the game so that the first player to enter the game after a level switch can not
             vote and force a level switch before the other players have joined the game.
             Also changed the voting message type from critical to normal so that others can see the message that tells which
             map you voted for.
         2.3 Added a 20 second timer at the end of the game that when triggered forces open the players voting window if they
             have not voted and the window is not already open. This will help out any player who has closed the window and dont have 
             a key bound to reopen it.
         2.4 a. Fixed the RestartWait-ini problem by setting bDontRestart to true instead of messing with the RestartWait.
             b. Add a configurable "Message Expiration Time" option. This allows you to configure the amount of time a Say & TeamSay message 
                stays on your HUD. 
             c. Also added a little note at the bottom of the config screen that explains that the Load Map options only
                apply on the server.
             d. Added "Download Required" text to the map screenshot window to indicate when a player doesn't have the
                map that he/she selected.
             f. Add client message to tell the player that they can not kick the server.
             g. Changed tie detection function so that it always returns false for Domination games because once during testing
                I encountered a tie game and it did not go into over-time.
         2.5 a. Added a configurable Kick Vote Requirement percentage.  
             b. Added a configurable voting time limit at game end. 
             c. Increased the size of the map list box and screen shot.
             d. Moved the game type configuration options to an "Admin" tab that only shows up for the player that is logged in
                as the admin. (via adminlogin console command). This Admin tab can save the configuration values to a remote server.
             e. Added LMS, Team Deathmatch, and an "Other" game type. The Other game type can be configured to work with custom Mods 
                such as Rocket-Arena,Tactical Ops, and Strike-Force. (These are the only Mods that have been tested.)
             f. Added a "Status" tab that shows a report of the maps and players that were voted for and the number of votes for each.
             k. Added an "About" tab and renamed the "Players" tab to "Kick" to make more room for tabs.                          
         2.6 Fixed the problem that prevented voting windows from opening when connected to a listening server.                          
          
         2.7 - Added an option to load map names from the map cycle list instead of all maps.
             - Added mouse wheel and keyboard (up,down,pageup,pagedown) scrolling support for list boxes.
             - Added a 1 second screen-shot loading delay to the map window. This reduces scrolling delays caused 
               by the loading of the screen-shot image. 
             - Integrated message sender. Pops up when the Talk button is pressed.
             - After placing a vote the window will now switch to the "Status" tab.
             - Moved the configuration settings into UnrealTournament.ini instead of MapVote.ini.
             - Add a configurable Score Board time Delay. This is the amount of time that it waits before opening
               the voting windows after the end of the game. This will allow players to look at the final scores
               before voting. 
             - Added an option to disable player kick voting.
             - Added an option to disable End-of-Game voting. Allows server to run as normal and cycle through the 
               map list. Players can only vote during the game. 
             - Added code that eliminates the currently played map from a tie. This was requested by a user.
             - The "Remove Save" button on the "Admin" configuation window will now reload the map list with the
               new configuation. In other words you can change game types and the map list will change right away.
               Note: Any open voting windows will have to be closed and reopened to refresh the map list on the
                     player/client side.
             - Added a 3 second delay between the closing of all voting windows to the switching of the level
               on the server. (Hopefully this will prevent GPFs on clients.)
             - Fixed the "Failed to load 'NULL': Can't resolve package name" error log message by preventing the
               loading of the Other game class if the Other Game type has not been checked.
             - Changed the WRI class back to the original code. This will break compatiblity with V400 of UT.
             - Added a fix for the Tactical Ops v1.6 Tie Game problem where the voting window would not open at game
               end because of sudden death overtime. Also added a config option to disable this if needed.
             - Added an option that determines if a tie game is checked for when using a Other Game type (Mods).
               This is used to tell Map-Vote if the Mod game can go into OverTime so that it will not open the voting 
               windows during a sudden death overtime situation.

         2.8 - Added an "Auto Detect" option that will automatically detect the game type that the server was started
               with and load the appropriate maps. This will make configuration incredibly easy, especially for MODs.
             - Fixed Spectator voting problem. Spectators can not vote now.

         2.9 - Fix the 256 map limit bug. In network play the Unreal engine will not replicate arrays that have more 
               than 256 items in them. So, I created 4 arrays. The limit is now 1020 maps. 
             - Removed the ".unr" from map names. 
             - The map list is now sorted correctly and NOT case sensitive. 
             - Client side GPF crash fix - Removed the MyWRI variable from the MapVoteTabWindow to eliminate the GPF
               crash caused by garbage collection and converted all Client-To-Server replicated function into Mutate 
               console commands. 


Thanks:      Special thanks to DrSin and Mongo for making and letting me use the WRI (Windows Replication Info) class.

Copyright / Permissions
-----------------------
Copyright Bruce D. Bickar 2000 - 2001
Authors may NOT use this code with out my permission.
You are NOT allowed to commercially exploit this release, i.e. put it on a CD
or any other electronic medium that is sold for money without my explicit
permission!
You MAY distribute this release through any electronic network (internet,
FIDO, local BBS etc.), provided you include this file and leave the archive
intact.
----------------------
UNREAL TOURNAMENT (c)1999 Epic Megagames, Inc.  All Rights Reserved.  
Distributed by GT Software, Inc. under license.  UNREAL TOURNAMENT and 
the UNREAL TOURNAMENT logo are registered trademarks of Epic Megagames, Inc. 
All other trademarks and trade names are properties of their respective owners.
