mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-19 04:29:09 +00:00
(svn r9050) -Codechange: Foo(void) -> Foo()
This commit is contained in:
@@ -21,7 +21,7 @@ struct Library *SocketBase = NULL;
|
||||
* Initializes the network core (as that is needed for some platforms
|
||||
* @return true if the core has been initialized, false otherwise
|
||||
*/
|
||||
bool NetworkCoreInitialize(void)
|
||||
bool NetworkCoreInitialize()
|
||||
{
|
||||
#if defined(__MORPHOS__) || defined(__AMIGA__)
|
||||
/*
|
||||
@@ -72,7 +72,7 @@ bool NetworkCoreInitialize(void)
|
||||
/**
|
||||
* Shuts down the network core (as that is needed for some platforms
|
||||
*/
|
||||
void NetworkCoreShutdown(void)
|
||||
void NetworkCoreShutdown()
|
||||
{
|
||||
#if defined(__MORPHOS__) || defined(__AMIGA__)
|
||||
/* free allocated resources */
|
||||
|
@@ -12,8 +12,8 @@
|
||||
#include "os_abstraction.h"
|
||||
#include "../../newgrf_config.h"
|
||||
|
||||
bool NetworkCoreInitialize(void);
|
||||
void NetworkCoreShutdown(void);
|
||||
bool NetworkCoreInitialize();
|
||||
void NetworkCoreShutdown();
|
||||
|
||||
/** Status of a network client; reasons why a client has quit */
|
||||
typedef enum {
|
||||
|
@@ -63,7 +63,7 @@ Packet *NetworkSend_Init(PacketType type)
|
||||
/**
|
||||
* Writes the packet size from the raw packet from packet->size
|
||||
*/
|
||||
void Packet::PrepareToSend(void)
|
||||
void Packet::PrepareToSend()
|
||||
{
|
||||
assert(this->cs == NULL && this->next == NULL);
|
||||
|
||||
@@ -163,7 +163,7 @@ bool Packet::CanReadFromPacket(uint bytes_to_read)
|
||||
/**
|
||||
* Reads the packet size from the raw packet and stores it in the packet->size
|
||||
*/
|
||||
void Packet::ReadRawPacketSize(void)
|
||||
void Packet::ReadRawPacketSize()
|
||||
{
|
||||
assert(this->cs != NULL && this->next == NULL);
|
||||
this->size = (PacketSize)this->buffer[0];
|
||||
@@ -173,7 +173,7 @@ void Packet::ReadRawPacketSize(void)
|
||||
/**
|
||||
* Prepares the packet so it can be read
|
||||
*/
|
||||
void Packet::PrepareToRead(void)
|
||||
void Packet::PrepareToRead()
|
||||
{
|
||||
this->ReadRawPacketSize();
|
||||
|
||||
@@ -181,12 +181,12 @@ void Packet::PrepareToRead(void)
|
||||
this->pos = sizeof(PacketSize);
|
||||
}
|
||||
|
||||
bool Packet::Recv_bool(void)
|
||||
bool Packet::Recv_bool()
|
||||
{
|
||||
return this->Recv_uint8() != 0;
|
||||
}
|
||||
|
||||
uint8 Packet::Recv_uint8(void)
|
||||
uint8 Packet::Recv_uint8()
|
||||
{
|
||||
uint8 n;
|
||||
|
||||
@@ -196,7 +196,7 @@ uint8 Packet::Recv_uint8(void)
|
||||
return n;
|
||||
}
|
||||
|
||||
uint16 Packet::Recv_uint16(void)
|
||||
uint16 Packet::Recv_uint16()
|
||||
{
|
||||
uint16 n;
|
||||
|
||||
@@ -207,7 +207,7 @@ uint16 Packet::Recv_uint16(void)
|
||||
return n;
|
||||
}
|
||||
|
||||
uint32 Packet::Recv_uint32(void)
|
||||
uint32 Packet::Recv_uint32()
|
||||
{
|
||||
uint32 n;
|
||||
|
||||
@@ -220,7 +220,7 @@ uint32 Packet::Recv_uint32(void)
|
||||
return n;
|
||||
}
|
||||
|
||||
uint64 Packet::Recv_uint64(void)
|
||||
uint64 Packet::Recv_uint64()
|
||||
{
|
||||
uint64 n;
|
||||
|
||||
|
@@ -43,7 +43,7 @@ public:
|
||||
Packet(PacketType type);
|
||||
|
||||
/* Sending/writing of packets */
|
||||
void PrepareToSend(void);
|
||||
void PrepareToSend();
|
||||
|
||||
void Send_bool (bool data);
|
||||
void Send_uint8 (uint8 data);
|
||||
@@ -53,15 +53,15 @@ public:
|
||||
void Send_string(const char* data);
|
||||
|
||||
/* Reading/receiving of packets */
|
||||
void ReadRawPacketSize(void);
|
||||
void PrepareToRead(void);
|
||||
void ReadRawPacketSize();
|
||||
void PrepareToRead();
|
||||
|
||||
bool CanReadFromPacket (uint bytes_to_read);
|
||||
bool Recv_bool (void);
|
||||
uint8 Recv_uint8 (void);
|
||||
uint16 Recv_uint16(void);
|
||||
uint32 Recv_uint32(void);
|
||||
uint64 Recv_uint64(void);
|
||||
bool Recv_bool ();
|
||||
uint8 Recv_uint8 ();
|
||||
uint16 Recv_uint16();
|
||||
uint32 Recv_uint32();
|
||||
uint64 Recv_uint64();
|
||||
void Recv_string(char* buffer, size_t size);
|
||||
};
|
||||
|
||||
|
@@ -63,7 +63,7 @@ static byte _network_clients_connected = 0;
|
||||
static uint16 _network_client_index = NETWORK_SERVER_INDEX + 1;
|
||||
|
||||
/* Some externs / forwards */
|
||||
extern void StateGameLoop(void);
|
||||
extern void StateGameLoop();
|
||||
|
||||
// Function that looks up the CI for a given client-index
|
||||
NetworkClientInfo *NetworkFindClientInfoFromIndex(uint16 client_index)
|
||||
@@ -117,7 +117,7 @@ void NetworkGetClientName(char *client_name, size_t size, const NetworkTCPSocket
|
||||
}
|
||||
}
|
||||
|
||||
byte NetworkSpectatorCount(void)
|
||||
byte NetworkSpectatorCount()
|
||||
{
|
||||
NetworkTCPSocketHandler *cs;
|
||||
byte count = 0;
|
||||
@@ -301,7 +301,7 @@ char* GetNetworkErrorMsg(char* buf, NetworkErrorCode err, const char* last)
|
||||
}
|
||||
|
||||
/* Count the number of active clients connected */
|
||||
static uint NetworkCountPlayers(void)
|
||||
static uint NetworkCountPlayers()
|
||||
{
|
||||
NetworkTCPSocketHandler *cs;
|
||||
uint count = 0;
|
||||
@@ -317,7 +317,7 @@ static uint NetworkCountPlayers(void)
|
||||
static bool _min_players_paused = false;
|
||||
|
||||
/* Check if the minimum number of players has been reached and pause or unpause the game as appropriate */
|
||||
void CheckMinPlayers(void)
|
||||
void CheckMinPlayers()
|
||||
{
|
||||
if (!_network_dedicated) return;
|
||||
|
||||
@@ -337,7 +337,7 @@ void CheckMinPlayers(void)
|
||||
}
|
||||
|
||||
// Find all IP-aliases for this host
|
||||
static void NetworkFindIPs(void)
|
||||
static void NetworkFindIPs()
|
||||
{
|
||||
#if !defined(PSP)
|
||||
int i;
|
||||
@@ -717,7 +717,7 @@ static bool NetworkConnect(const char *hostname, int port)
|
||||
}
|
||||
|
||||
// For the server, to accept new clients
|
||||
static void NetworkAcceptClients(void)
|
||||
static void NetworkAcceptClients()
|
||||
{
|
||||
struct sockaddr_in sin;
|
||||
NetworkTCPSocketHandler *cs;
|
||||
@@ -782,7 +782,7 @@ static void NetworkAcceptClients(void)
|
||||
}
|
||||
|
||||
// Set up the listen socket for the server
|
||||
static bool NetworkListen(void)
|
||||
static bool NetworkListen()
|
||||
{
|
||||
SOCKET ls;
|
||||
struct sockaddr_in sin;
|
||||
@@ -826,7 +826,7 @@ static bool NetworkListen(void)
|
||||
}
|
||||
|
||||
// Close all current connections
|
||||
static void NetworkClose(void)
|
||||
static void NetworkClose()
|
||||
{
|
||||
NetworkTCPSocketHandler *cs;
|
||||
|
||||
@@ -848,7 +848,7 @@ static void NetworkClose(void)
|
||||
}
|
||||
|
||||
// Inits the network (cleans sockets and stuff)
|
||||
static void NetworkInitialize(void)
|
||||
static void NetworkInitialize()
|
||||
{
|
||||
NetworkTCPSocketHandler *cs;
|
||||
|
||||
@@ -921,7 +921,7 @@ void NetworkAddServer(const char *b)
|
||||
/* Generates the list of manually added hosts from NetworkGameList and
|
||||
* dumps them into the array _network_host_list. This array is needed
|
||||
* by the function that generates the config file. */
|
||||
void NetworkRebuildHostList(void)
|
||||
void NetworkRebuildHostList()
|
||||
{
|
||||
uint i = 0;
|
||||
const NetworkGameList *item = _network_game_list;
|
||||
@@ -968,7 +968,7 @@ bool NetworkClientConnectGame(const char *host, uint16 port)
|
||||
return _networking;
|
||||
}
|
||||
|
||||
static void NetworkInitGameInfo(void)
|
||||
static void NetworkInitGameInfo()
|
||||
{
|
||||
NetworkClientInfo *ci;
|
||||
|
||||
@@ -1013,7 +1013,7 @@ static void NetworkInitGameInfo(void)
|
||||
ttd_strlcpy(ci->unique_id, _network_unique_id, sizeof(ci->unique_id));
|
||||
}
|
||||
|
||||
bool NetworkServerStart(void)
|
||||
bool NetworkServerStart()
|
||||
{
|
||||
if (!_network_available) return false;
|
||||
|
||||
@@ -1060,7 +1060,7 @@ bool NetworkServerStart(void)
|
||||
|
||||
// The server is rebooting...
|
||||
// The only difference with NetworkDisconnect, is the packets that is sent
|
||||
void NetworkReboot(void)
|
||||
void NetworkReboot()
|
||||
{
|
||||
if (_network_server) {
|
||||
NetworkTCPSocketHandler *cs;
|
||||
@@ -1084,7 +1084,7 @@ void NetworkReboot(void)
|
||||
}
|
||||
|
||||
// We want to disconnect from the host/clients
|
||||
void NetworkDisconnect(void)
|
||||
void NetworkDisconnect()
|
||||
{
|
||||
if (_network_server) {
|
||||
NetworkTCPSocketHandler *cs;
|
||||
@@ -1112,7 +1112,7 @@ void NetworkDisconnect(void)
|
||||
}
|
||||
|
||||
// Receives something from the network
|
||||
static bool NetworkReceive(void)
|
||||
static bool NetworkReceive()
|
||||
{
|
||||
NetworkTCPSocketHandler *cs;
|
||||
int n;
|
||||
@@ -1167,7 +1167,7 @@ static bool NetworkReceive(void)
|
||||
}
|
||||
|
||||
// This sends all buffered commands (if possible)
|
||||
static void NetworkSend(void)
|
||||
static void NetworkSend()
|
||||
{
|
||||
NetworkTCPSocketHandler *cs;
|
||||
FOR_ALL_CLIENTS(cs) {
|
||||
@@ -1183,7 +1183,7 @@ static void NetworkSend(void)
|
||||
}
|
||||
|
||||
// Handle the local-command-queue
|
||||
static void NetworkHandleLocalQueue(void)
|
||||
static void NetworkHandleLocalQueue()
|
||||
{
|
||||
CommandPacket *cp, **cp_prev;
|
||||
|
||||
@@ -1218,7 +1218,7 @@ static void NetworkHandleLocalQueue(void)
|
||||
|
||||
}
|
||||
|
||||
static bool NetworkDoClientLoop(void)
|
||||
static bool NetworkDoClientLoop()
|
||||
{
|
||||
_frame_counter++;
|
||||
|
||||
@@ -1259,7 +1259,7 @@ static bool NetworkDoClientLoop(void)
|
||||
}
|
||||
|
||||
// We have to do some UDP checking
|
||||
void NetworkUDPGameLoop(void)
|
||||
void NetworkUDPGameLoop()
|
||||
{
|
||||
if (_network_udp_server) {
|
||||
_udp_server_socket->ReceivePackets();
|
||||
@@ -1273,7 +1273,7 @@ void NetworkUDPGameLoop(void)
|
||||
|
||||
// The main loop called from ttd.c
|
||||
// Here we also have to do StateGameLoop if needed!
|
||||
void NetworkGameLoop(void)
|
||||
void NetworkGameLoop()
|
||||
{
|
||||
if (!_networking) return;
|
||||
|
||||
@@ -1318,7 +1318,7 @@ void NetworkGameLoop(void)
|
||||
NetworkSend();
|
||||
}
|
||||
|
||||
static void NetworkGenerateUniqueId(void)
|
||||
static void NetworkGenerateUniqueId()
|
||||
{
|
||||
md5_state_t state;
|
||||
md5_byte_t digest[16];
|
||||
@@ -1372,7 +1372,7 @@ void NetworkStartDebugLog(const char *hostname, uint16 port)
|
||||
}
|
||||
|
||||
/** This tries to launch the network for a given OS */
|
||||
void NetworkStartUp(void)
|
||||
void NetworkStartUp()
|
||||
{
|
||||
DEBUG(net, 3, "[core] starting network...");
|
||||
|
||||
@@ -1409,7 +1409,7 @@ void NetworkStartUp(void)
|
||||
}
|
||||
|
||||
/** This shuts the network down */
|
||||
void NetworkShutDown(void)
|
||||
void NetworkShutDown()
|
||||
{
|
||||
NetworkDisconnect();
|
||||
NetworkUDPShutdown();
|
||||
|
@@ -153,7 +153,7 @@ VARDEF uint8 _network_min_players; // Minimum number of players for ga
|
||||
|
||||
void NetworkTCPQueryServer(const char* host, unsigned short port);
|
||||
|
||||
byte NetworkSpectatorCount(void);
|
||||
byte NetworkSpectatorCount();
|
||||
|
||||
VARDEF char *_network_host_list[10];
|
||||
VARDEF char *_network_ban_list[25];
|
||||
@@ -161,22 +161,22 @@ VARDEF char *_network_ban_list[25];
|
||||
void ParseConnectionString(const char **player, const char **port, char *connection_string);
|
||||
void NetworkUpdateClientInfo(uint16 client_index);
|
||||
void NetworkAddServer(const char *b);
|
||||
void NetworkRebuildHostList(void);
|
||||
void NetworkRebuildHostList();
|
||||
bool NetworkChangeCompanyPassword(byte argc, char *argv[]);
|
||||
void NetworkPopulateCompanyInfo(void);
|
||||
void NetworkPopulateCompanyInfo();
|
||||
void UpdateNetworkGameWindow(bool unselect);
|
||||
void CheckMinPlayers(void);
|
||||
void CheckMinPlayers();
|
||||
void NetworkStartDebugLog(const char *hostname, uint16 port);
|
||||
|
||||
void NetworkStartUp(void);
|
||||
void NetworkStartUp();
|
||||
void NetworkUDPCloseAll();
|
||||
void NetworkShutDown(void);
|
||||
void NetworkGameLoop(void);
|
||||
void NetworkUDPGameLoop(void);
|
||||
bool NetworkServerStart(void);
|
||||
void NetworkShutDown();
|
||||
void NetworkGameLoop();
|
||||
void NetworkUDPGameLoop();
|
||||
bool NetworkServerStart();
|
||||
bool NetworkClientConnectGame(const char *host, uint16 port);
|
||||
void NetworkReboot(void);
|
||||
void NetworkDisconnect(void);
|
||||
void NetworkReboot();
|
||||
void NetworkDisconnect();
|
||||
|
||||
bool IsNetworkCompatibleVersion(const char *version);
|
||||
|
||||
@@ -188,8 +188,8 @@ VARDEF bool _network_advertise; ///< is the server advertising to the master se
|
||||
#else /* ENABLE_NETWORK */
|
||||
/* Network function stubs when networking is disabled */
|
||||
|
||||
static inline void NetworkStartUp(void) {}
|
||||
static inline void NetworkShutDown(void) {}
|
||||
static inline void NetworkStartUp() {}
|
||||
static inline void NetworkShutDown() {}
|
||||
|
||||
#define _networking 0
|
||||
#define _network_server 0
|
||||
|
@@ -839,7 +839,7 @@ static NetworkClientPacket* const _network_client_packet[] = {
|
||||
assert_compile(lengthof(_network_client_packet) == PACKET_END);
|
||||
|
||||
// Is called after a client is connected to the server
|
||||
void NetworkClient_Connected(void)
|
||||
void NetworkClient_Connected()
|
||||
{
|
||||
// Set the frame-counter to 0 so nothing happens till we are ready
|
||||
_frame_counter = 0;
|
||||
|
@@ -18,7 +18,7 @@ DEF_CLIENT_SEND_COMMAND(PACKET_CLIENT_ACK);
|
||||
DEF_CLIENT_SEND_COMMAND_PARAM(PACKET_CLIENT_RCON)(const char *pass, const char *command);
|
||||
|
||||
NetworkRecvStatus NetworkClient_ReadPackets(NetworkTCPSocketHandler *cs);
|
||||
void NetworkClient_Connected(void);
|
||||
void NetworkClient_Connected();
|
||||
|
||||
#endif /* ENABLE_NETWORK */
|
||||
|
||||
|
@@ -84,7 +84,7 @@ extern NetworkTCPSocketHandler _clients[MAX_CLIENTS];
|
||||
|
||||
// Macros to make life a bit more easier
|
||||
#define DEF_CLIENT_RECEIVE_COMMAND(type) NetworkRecvStatus NetworkPacketReceive_ ## type ## _command(Packet *p)
|
||||
#define DEF_CLIENT_SEND_COMMAND(type) void NetworkPacketSend_ ## type ## _command(void)
|
||||
#define DEF_CLIENT_SEND_COMMAND(type) void NetworkPacketSend_ ## type ## _command()
|
||||
#define DEF_CLIENT_SEND_COMMAND_PARAM(type) void NetworkPacketSend_ ## type ## _command
|
||||
#define DEF_SERVER_RECEIVE_COMMAND(type) void NetworkPacketReceive_ ## type ## _command(NetworkTCPSocketHandler *cs, Packet *p)
|
||||
#define DEF_SERVER_SEND_COMMAND(type) void NetworkPacketSend_ ## type ## _command(NetworkTCPSocketHandler *cs)
|
||||
@@ -104,7 +104,7 @@ void NetworkCloseClient(NetworkTCPSocketHandler *cs);
|
||||
void CDECL NetworkTextMessage(NetworkAction action, uint16 color, bool self_send, const char *name, const char *str, ...);
|
||||
void NetworkGetClientName(char *clientname, size_t size, const NetworkTCPSocketHandler *cs);
|
||||
uint NetworkCalculateLag(const NetworkTCPSocketHandler *cs);
|
||||
byte NetworkGetCurrentLanguageIndex(void);
|
||||
byte NetworkGetCurrentLanguageIndex();
|
||||
NetworkClientInfo *NetworkFindClientInfoFromIndex(uint16 client_index);
|
||||
NetworkClientInfo *NetworkFindClientInfoFromIP(const char *ip);
|
||||
NetworkTCPSocketHandler *NetworkFindClientStateFromIndex(uint16 client_index);
|
||||
|
@@ -89,7 +89,7 @@ enum {
|
||||
};
|
||||
|
||||
/** Requeries the (game) servers we have not gotten a reply from */
|
||||
void NetworkGameListRequery(void)
|
||||
void NetworkGameListRequery()
|
||||
{
|
||||
static uint8 requery_cnt = 0;
|
||||
|
||||
|
@@ -19,6 +19,6 @@ extern NetworkGameList *_network_game_list;
|
||||
|
||||
NetworkGameList *NetworkGameListAddItem(uint32 ip, uint16 port);
|
||||
void NetworkGameListRemoveItem(NetworkGameList *remove);
|
||||
void NetworkGameListRequery(void);
|
||||
void NetworkGameListRequery();
|
||||
|
||||
#endif /* NETWORK_GAMELIST_H */
|
||||
|
@@ -54,7 +54,7 @@ static Listing _ng_sorting;
|
||||
static char _edit_str_buf[150];
|
||||
static bool _chat_tab_completion_active;
|
||||
|
||||
static void ShowNetworkStartServerWindow(void);
|
||||
static void ShowNetworkStartServerWindow();
|
||||
static void ShowNetworkLobbyWindow(NetworkGameList *ngl);
|
||||
extern void SwitchMode(int new_mode);
|
||||
|
||||
@@ -551,7 +551,7 @@ static const WindowDesc _network_game_window_desc = {
|
||||
NetworkGameWindowWndProc,
|
||||
};
|
||||
|
||||
void ShowNetworkGameWindow(void)
|
||||
void ShowNetworkGameWindow()
|
||||
{
|
||||
static bool first = true;
|
||||
Window *w;
|
||||
@@ -778,7 +778,7 @@ static const WindowDesc _network_start_server_window_desc = {
|
||||
NetworkStartServerWindowWndProc,
|
||||
};
|
||||
|
||||
static void ShowNetworkStartServerWindow(void)
|
||||
static void ShowNetworkStartServerWindow()
|
||||
{
|
||||
Window *w;
|
||||
DeleteWindowById(WC_NETWORK_WINDOW, 0);
|
||||
@@ -1151,7 +1151,7 @@ static bool CheckClientListHeight(Window *w)
|
||||
}
|
||||
|
||||
// Finds the amount of actions in the popup and set the height correct
|
||||
static uint ClientListPopupHeigth(void) {
|
||||
static uint ClientListPopupHeigth() {
|
||||
int i, num = 0;
|
||||
|
||||
// Find the amount of actions
|
||||
@@ -1368,7 +1368,7 @@ static void ClientListWndProc(Window *w, WindowEvent *e)
|
||||
}
|
||||
}
|
||||
|
||||
void ShowClientList(void)
|
||||
void ShowClientList()
|
||||
{
|
||||
AllocateWindowDescFront(&_client_list_desc, 0);
|
||||
}
|
||||
@@ -1460,7 +1460,7 @@ static const WindowDesc _network_join_status_window_desc = {
|
||||
NetworkJoinStatusWindowWndProc,
|
||||
};
|
||||
|
||||
void ShowJoinStatusWindow(void)
|
||||
void ShowJoinStatusWindow()
|
||||
{
|
||||
Window *w;
|
||||
DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0);
|
||||
|
@@ -10,16 +10,16 @@
|
||||
void ShowNetworkNeedPassword(NetworkPasswordType npt);
|
||||
void ShowNetworkGiveMoneyWindow(PlayerID player); // PlayerID
|
||||
void ShowNetworkChatQueryWindow(DestType type, byte dest);
|
||||
void ShowJoinStatusWindow(void);
|
||||
void ShowNetworkGameWindow(void);
|
||||
void ShowClientList(void);
|
||||
void ShowJoinStatusWindow();
|
||||
void ShowNetworkGameWindow();
|
||||
void ShowClientList();
|
||||
|
||||
#else /* ENABLE_NETWORK */
|
||||
/* Network function stubs when networking is disabled */
|
||||
|
||||
static inline void ShowNetworkChatQueryWindow(byte desttype, byte dest) {}
|
||||
static inline void ShowClientList(void) {}
|
||||
static inline void ShowNetworkGameWindow(void) {}
|
||||
static inline void ShowClientList() {}
|
||||
static inline void ShowNetworkGameWindow() {}
|
||||
|
||||
#endif /* ENABLE_NETWORK */
|
||||
|
||||
|
@@ -1228,7 +1228,7 @@ static NetworkServerPacket* const _network_server_packet[] = {
|
||||
assert_compile(lengthof(_network_server_packet) == PACKET_END);
|
||||
|
||||
// This update the company_info-stuff
|
||||
void NetworkPopulateCompanyInfo(void)
|
||||
void NetworkPopulateCompanyInfo()
|
||||
{
|
||||
char password[NETWORK_PASSWORD_LENGTH];
|
||||
const Player *p;
|
||||
@@ -1355,7 +1355,7 @@ void NetworkUpdateClientInfo(uint16 client_index)
|
||||
}
|
||||
|
||||
/* Check if we want to restart the map */
|
||||
static void NetworkCheckRestartMap(void)
|
||||
static void NetworkCheckRestartMap()
|
||||
{
|
||||
if (_network_restart_game_year != 0 && _cur_year >= _network_restart_game_year) {
|
||||
DEBUG(net, 0, "Auto-restarting map. Year %d reached", _cur_year);
|
||||
@@ -1369,7 +1369,7 @@ static void NetworkCheckRestartMap(void)
|
||||
1) If a company is not protected, it is closed after 1 year (for example)
|
||||
2) If a company is protected, protection is disabled after 3 years (for example)
|
||||
(and item 1. happens a year later) */
|
||||
static void NetworkAutoCleanCompanies(void)
|
||||
static void NetworkAutoCleanCompanies()
|
||||
{
|
||||
NetworkTCPSocketHandler *cs;
|
||||
const NetworkClientInfo *ci;
|
||||
@@ -1564,12 +1564,12 @@ void NetworkServer_Tick(bool send_frame)
|
||||
NetworkUDPAdvertise();
|
||||
}
|
||||
|
||||
void NetworkServerYearlyLoop(void)
|
||||
void NetworkServerYearlyLoop()
|
||||
{
|
||||
NetworkCheckRestartMap();
|
||||
}
|
||||
|
||||
void NetworkServerMonthlyLoop(void)
|
||||
void NetworkServerMonthlyLoop()
|
||||
{
|
||||
NetworkAutoCleanCompanies();
|
||||
}
|
||||
|
@@ -17,8 +17,8 @@ void NetworkServer_HandleChat(NetworkAction action, DestType type, int dest, con
|
||||
|
||||
bool NetworkServer_ReadPackets(NetworkTCPSocketHandler *cs);
|
||||
void NetworkServer_Tick(bool send_frame);
|
||||
void NetworkServerMonthlyLoop(void);
|
||||
void NetworkServerYearlyLoop(void);
|
||||
void NetworkServerMonthlyLoop();
|
||||
void NetworkServerYearlyLoop();
|
||||
|
||||
static inline const char* GetPlayerIP(const NetworkClientInfo* ci)
|
||||
{
|
||||
@@ -31,8 +31,8 @@ static inline const char* GetPlayerIP(const NetworkClientInfo* ci)
|
||||
#else /* ENABLE_NETWORK */
|
||||
/* Network function stubs when networking is disabled */
|
||||
|
||||
static inline void NetworkServerMonthlyLoop(void) {}
|
||||
static inline void NetworkServerYearlyLoop(void) {}
|
||||
static inline void NetworkServerMonthlyLoop() {}
|
||||
static inline void NetworkServerYearlyLoop() {}
|
||||
|
||||
#endif /* ENABLE_NETWORK */
|
||||
|
||||
|
@@ -402,7 +402,7 @@ void ClientNetworkUDPSocketHandler::HandleIncomingNetworkGameInfoGRFConfig(GRFCo
|
||||
}
|
||||
|
||||
// Close UDP connection
|
||||
void NetworkUDPCloseAll(void)
|
||||
void NetworkUDPCloseAll()
|
||||
{
|
||||
DEBUG(net, 1, "[udp] closed listeners");
|
||||
|
||||
@@ -435,7 +435,7 @@ static void NetworkUDPBroadCast(NetworkUDPSocketHandler *socket)
|
||||
|
||||
|
||||
// Request the the server-list from the master server
|
||||
void NetworkUDPQueryMasterServer(void)
|
||||
void NetworkUDPQueryMasterServer()
|
||||
{
|
||||
struct sockaddr_in out_addr;
|
||||
|
||||
@@ -458,7 +458,7 @@ void NetworkUDPQueryMasterServer(void)
|
||||
}
|
||||
|
||||
// Find all servers
|
||||
void NetworkUDPSearchGame(void)
|
||||
void NetworkUDPSearchGame()
|
||||
{
|
||||
// We are still searching..
|
||||
if (_network_udp_broadcast > 0) return;
|
||||
@@ -504,7 +504,7 @@ void NetworkUDPQueryServer(const char* host, unsigned short port, bool manually)
|
||||
}
|
||||
|
||||
/* Remove our advertise from the master-server */
|
||||
void NetworkUDPRemoveAdvertise(void)
|
||||
void NetworkUDPRemoveAdvertise()
|
||||
{
|
||||
struct sockaddr_in out_addr;
|
||||
|
||||
@@ -533,7 +533,7 @@ void NetworkUDPRemoveAdvertise(void)
|
||||
|
||||
/* Register us to the master server
|
||||
This function checks if it needs to send an advertise */
|
||||
void NetworkUDPAdvertise(void)
|
||||
void NetworkUDPAdvertise()
|
||||
{
|
||||
struct sockaddr_in out_addr;
|
||||
|
||||
@@ -580,7 +580,7 @@ void NetworkUDPAdvertise(void)
|
||||
_udp_master_socket->SendPacket(&p, &out_addr);
|
||||
}
|
||||
|
||||
void NetworkUDPInitialize(void)
|
||||
void NetworkUDPInitialize()
|
||||
{
|
||||
_udp_client_socket = new ClientNetworkUDPSocketHandler();
|
||||
_udp_server_socket = new ServerNetworkUDPSocketHandler();
|
||||
@@ -590,7 +590,7 @@ void NetworkUDPInitialize(void)
|
||||
_network_udp_broadcast = 0;
|
||||
}
|
||||
|
||||
void NetworkUDPShutdown(void)
|
||||
void NetworkUDPShutdown()
|
||||
{
|
||||
NetworkUDPCloseAll();
|
||||
|
||||
|
@@ -5,13 +5,13 @@
|
||||
|
||||
#ifdef ENABLE_NETWORK
|
||||
|
||||
void NetworkUDPInitialize(void);
|
||||
void NetworkUDPSearchGame(void);
|
||||
void NetworkUDPQueryMasterServer(void);
|
||||
void NetworkUDPInitialize();
|
||||
void NetworkUDPSearchGame();
|
||||
void NetworkUDPQueryMasterServer();
|
||||
void NetworkUDPQueryServer(const char* host, unsigned short port, bool manually = false);
|
||||
void NetworkUDPAdvertise(void);
|
||||
void NetworkUDPRemoveAdvertise(void);
|
||||
void NetworkUDPShutdown(void);
|
||||
void NetworkUDPAdvertise();
|
||||
void NetworkUDPRemoveAdvertise();
|
||||
void NetworkUDPShutdown();
|
||||
|
||||
#endif /* ENABLE_NETWORK */
|
||||
|
||||
|
Reference in New Issue
Block a user