-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add random level rotation option for dedicated servers (#330)
* Add "vote rand" for random nextmap vote, and add "map_rand" to server command list * update changelog, add new command to readme, add new command to rcon whitelist * Added $DF Randomize Rotation to dedicated server config, fixed logic error with map_rand command, updated readme, updated changelog * fix typo in readme * Adjusted option name, optimized and consolidated code, swapped srand for rand * Add alias vote random, fix changelog typo * add "shuffle_maps" command to shuffle maplist, make readme more clear, update changelog * better formatting for shuffle_level_array function * avoid stomping current level index * optimize random selection logic and properly handle case of just 1 map in the rotation * Add DF Dynamic Rotation dedicated server config option, minor formatting improvement * removed "shuffle_maps" command (unnecessary) * Fix ordering of $DF options in readme, and made order of options in dedicated server config file make more sense * shuffle rotation on server start, deleted Random Level Order option, introduced vastly improved RNG method (initialized in main.cpp so can be used elsewhere) * utilize std::shuffle for shuffle_level_array * adjusted random methods to consolidate, optimize, and improve type conversion safety * improve get_rand_level_filename logic, clean up code * fix type conversion regression, remove debug logging and unneeded var * fix infinite loop * Update game_patch/multi/server.cpp Co-authored-by: is-this-c <87069698+is-this-c@users.noreply.github.com> * reverting change causing error * resolve pointer issue * remove unneeded variable * use g_ naming convention for rng * Fix code structure * Rename dynamic rotation to random rotation Also reduce log level * Fix changelog entries for random rotation being in wrong section --------- Co-authored-by: Goober <gooberCP@gmail.com> Co-authored-by: is-this-c <87069698+is-this-c@users.noreply.github.com>
- Loading branch information
1 parent
6775ae0
commit 95162ef
Showing
9 changed files
with
125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
#pragma once | ||
|
||
#include <random> | ||
#include <common/config/GameConfig.h> | ||
|
||
extern GameConfig g_game_config; | ||
|
||
// random number generator | ||
extern std::mt19937 g_rng; | ||
|
||
#ifdef _WINDOWS_ | ||
extern HMODULE g_hmodule; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters