diff options
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/network_chat_gui.cpp | 4 | ||||
-rw-r--r-- | src/network/network_content_gui.cpp | 6 | ||||
-rw-r--r-- | src/network/network_gamelist.cpp | 8 | ||||
-rw-r--r-- | src/network/network_udp.cpp | 8 |
4 files changed, 9 insertions, 17 deletions
diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp index 10ed4e20c..a3c9208cb 100644 --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -35,9 +35,7 @@ * some spaces and possible translations of [All] to other languages. */ assert_compile((int)DRAW_STRING_BUFFER >= (int)NETWORK_CHAT_LENGTH + NETWORK_NAME_LENGTH + 40); -enum { - NETWORK_CHAT_LINE_SPACING = 3, -}; +static const uint NETWORK_CHAT_LINE_SPACING = 3; struct ChatMessage { char message[DRAW_STRING_BUFFER]; diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 8f377a0ba..b2b15133c 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -225,10 +225,8 @@ enum NetworkContentListWindowWidgets { class NetworkContentListWindow : public QueryStringBaseWindow, ContentCallback { typedef GUIList<const ContentInfo*> GUIContentList; - enum { - EDITBOX_MAX_SIZE = 50, - EDITBOX_MAX_LENGTH = 300, - }; + static const uint EDITBOX_MAX_SIZE = 50; + static const uint EDITBOX_MAX_LENGTH = 300; /** Runtime saved values */ static Listing last_sorting; diff --git a/src/network/network_gamelist.cpp b/src/network/network_gamelist.cpp index 61efe3b79..0ef8b1b2e 100644 --- a/src/network/network_gamelist.cpp +++ b/src/network/network_gamelist.cpp @@ -132,11 +132,9 @@ void NetworkGameListRemoveItem(NetworkGameList *remove) } } -enum { - MAX_GAME_LIST_REQUERY_COUNT = 10, ///< How often do we requery in number of times per server? - REQUERY_EVERY_X_GAMELOOPS = 60, ///< How often do we requery in time? - REFRESH_GAMEINFO_X_REQUERIES = 50, ///< Refresh the game info itself after REFRESH_GAMEINFO_X_REQUERIES * REQUERY_EVERY_X_GAMELOOPS game loops -}; +static const uint MAX_GAME_LIST_REQUERY_COUNT = 10; ///< How often do we requery in number of times per server? +static const uint REQUERY_EVERY_X_GAMELOOPS = 60; ///< How often do we requery in time? +static const uint REFRESH_GAMEINFO_X_REQUERIES = 50; ///< Refresh the game info itself after REFRESH_GAMEINFO_X_REQUERIES * REQUERY_EVERY_X_GAMELOOPS game loops /** Requeries the (game) servers we have not gotten a reply from */ void NetworkGameListRequery() diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp index 14cab7647..eb4f8b99b 100644 --- a/src/network/network_udp.cpp +++ b/src/network/network_udp.cpp @@ -36,11 +36,9 @@ static ThreadMutex *_network_udp_mutex = ThreadMutex::New(); /** Session key to register ourselves to the master server */ static uint64 _session_key = 0; -enum { - ADVERTISE_NORMAL_INTERVAL = 30000, // interval between advertising in ticks (15 minutes) - ADVERTISE_RETRY_INTERVAL = 300, // readvertise when no response after this many ticks (9 seconds) - ADVERTISE_RETRY_TIMES = 3 // give up readvertising after this much failed retries -}; +static const uint ADVERTISE_NORMAL_INTERVAL = 30000; ///< interval between advertising in ticks (15 minutes) +static const uint ADVERTISE_RETRY_INTERVAL = 300; ///< readvertise when no response after this many ticks (9 seconds) +static const uint ADVERTISE_RETRY_TIMES = 3; ///< give up readvertising after this much failed retries NetworkUDPSocketHandler *_udp_client_socket = NULL; ///< udp client socket NetworkUDPSocketHandler *_udp_server_socket = NULL; ///< udp server socket |