diff options
author | rubidium <rubidium@openttd.org> | 2010-11-30 13:38:46 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-11-30 13:38:46 +0000 |
commit | b6c2216749765e4d29fc3fa05dc1023c2c643cce (patch) | |
tree | abc3302f27c09c0e0494f4691e5989aa514116e2 /src/network/network_server.cpp | |
parent | 9c83a8975fe93568d4a3c44bd273e846b18d8e3f (diff) | |
download | openttd-b6c2216749765e4d29fc3fa05dc1023c2c643cce.tar.xz |
(svn r21358) -Codechange: make some network function names conform to coding style
Diffstat (limited to 'src/network/network_server.cpp')
-rw-r--r-- | src/network/network_server.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 705528727..442df0b69 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -80,9 +80,9 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::CloseConnection(NetworkRecvSta { assert(status != NETWORK_RECV_STATUS_OKAY); /* - * Sending a message just before leaving the game calls cs->Send_Packets. + * Sending a message just before leaving the game calls cs->SendPackets. * This might invoke this function, which means that when we close the - * connection after cs->Send_Packets we will close an already closed + * connection after cs->SendPackets we will close an already closed * connection. This handles that case gracefully without having to make * that code any more complex or more aware of the validity of the socket. */ @@ -114,7 +114,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::CloseConnection(NetworkRecvSta SetWindowDirty(WC_CLIENT_LIST, 0); - this->Send_Packets(true); + this->SendPackets(true); delete this->GetInfo(); delete this; @@ -138,7 +138,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::CloseConnection(NetworkRecvSta NetworkClientSocket *cs; FOR_ALL_CLIENT_SOCKETS(cs) { if (cs->writable) { - if (cs->Send_Packets() && cs->status == STATUS_MAP) { + if (cs->SendPackets() && cs->status == STATUS_MAP) { /* This client is in the middle of a map-send, call the function for that */ cs->SendMap(); } @@ -161,7 +161,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendClientInfo(NetworkClientIn p->Send_uint8 (ci->client_playas); p->Send_string(ci->client_name); - this->Send_Packet(p); + this->SendPacket(p); } return NETWORK_RECV_STATUS_OKAY; } @@ -208,7 +208,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendCompanyInfo() p->Send_uint8 (NETWORK_COMPANY_INFO_VERSION); p->Send_bool (true); - this->Send_CompanyInformation(p, company, &company_stats[company->index]); + this->SendCompanyInformation(p, company, &company_stats[company->index]); if (StrEmpty(clients[company->index])) { p->Send_string("<none>"); @@ -216,7 +216,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendCompanyInfo() p->Send_string(clients[company->index]); } - this->Send_Packet(p); + this->SendPacket(p); } p = new Packet(PACKET_SERVER_COMPANY_INFO); @@ -224,7 +224,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendCompanyInfo() p->Send_uint8 (NETWORK_COMPANY_INFO_VERSION); p->Send_bool (false); - this->Send_Packet(p); + this->SendPacket(p); return NETWORK_RECV_STATUS_OKAY; } @@ -234,7 +234,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendError(NetworkErrorCode err Packet *p = new Packet(PACKET_SERVER_ERROR); p->Send_uint8(error); - this->Send_Packet(p); + this->SendPacket(p); StringID strid = GetNetworkErrorMsg(error); GetString(str, strid, lastof(str)); @@ -282,10 +282,10 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendNewGRFCheck() p->Send_uint8 (grf_count); for (c = _grfconfig; c != NULL; c = c->next) { - if (!HasBit(c->flags, GCF_STATIC)) this->Send_GRFIdentifier(p, &c->ident); + if (!HasBit(c->flags, GCF_STATIC)) this->SendGRFIdentifier(p, &c->ident); } - this->Send_Packet(p); + this->SendPacket(p); return NETWORK_RECV_STATUS_OKAY; } @@ -297,7 +297,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendNeedGamePassword() this->status = STATUS_AUTH_GAME; Packet *p = new Packet(PACKET_SERVER_NEED_GAME_PASSWORD); - this->Send_Packet(p); + this->SendPacket(p); return NETWORK_RECV_STATUS_OKAY; } @@ -311,7 +311,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendNeedCompanyPassword() Packet *p = new Packet(PACKET_SERVER_NEED_COMPANY_PASSWORD); p->Send_uint32(_settings_game.game_creation.generation_seed); p->Send_string(_settings_client.network.network_id); - this->Send_Packet(p); + this->SendPacket(p); return NETWORK_RECV_STATUS_OKAY; } @@ -330,7 +330,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendWelcome() p->Send_uint32(this->client_id); p->Send_uint32(_settings_game.game_creation.generation_seed); p->Send_string(_settings_client.network.network_id); - this->Send_Packet(p); + this->SendPacket(p); /* Transmit info about all the active clients */ FOR_ALL_CLIENT_SOCKETS(new_cs) { @@ -355,7 +355,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendWait() p = new Packet(PACKET_SERVER_WAIT); p->Send_uint8(waiting); - this->Send_Packet(p); + this->SendPacket(p); return NETWORK_RECV_STATUS_OKAY; } @@ -390,7 +390,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendMap() Packet *p = new Packet(PACKET_SERVER_MAP_BEGIN); p->Send_uint32(_frame_counter); p->Send_uint32(ftell(file_pointer)); - this->Send_Packet(p); + this->SendPacket(p); fseek(file_pointer, 0, SEEK_SET); @@ -413,11 +413,11 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendMap() if (ferror(file_pointer)) usererror("Error reading temporary network savegame!"); p->size += res; - this->Send_Packet(p); + this->SendPacket(p); if (feof(file_pointer)) { /* Done reading! */ Packet *p = new Packet(PACKET_SERVER_MAP_DONE); - this->Send_Packet(p); + this->SendPacket(p); /* Set the status to DONE_MAP, no we will wait for the client * to send it is ready (maybe that happens like never ;)) */ @@ -450,7 +450,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendMap() } /* Send all packets (forced) and check if we have send it all */ - if (this->Send_Packets() && this->IsPacketQueueEmpty()) { + if (this->SendPackets() && this->IsPacketQueueEmpty()) { /* All are sent, increase the sent_packets */ sent_packets *= 2; } else { @@ -467,7 +467,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendJoin(ClientID client_id) p->Send_uint32(client_id); - this->Send_Packet(p); + this->SendPacket(p); return NETWORK_RECV_STATUS_OKAY; } @@ -483,7 +483,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendFrame() p->Send_uint32(_sync_seed_2); #endif #endif - this->Send_Packet(p); + this->SendPacket(p); return NETWORK_RECV_STATUS_OKAY; } @@ -496,7 +496,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendSync() #ifdef NETWORK_SEND_DOUBLE_SEED p->Send_uint32(_sync_seed_2); #endif - this->Send_Packet(p); + this->SendPacket(p); return NETWORK_RECV_STATUS_OKAY; } @@ -504,11 +504,11 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendCommand(const CommandPacke { Packet *p = new Packet(PACKET_SERVER_COMMAND); - this->Send_Command(p, cp); + this->NetworkGameSocketHandler::SendCommand(p, cp); p->Send_uint32(cp->frame); p->Send_bool (cp->my_cmd); - this->Send_Packet(p); + this->SendPacket(p); return NETWORK_RECV_STATUS_OKAY; } @@ -522,7 +522,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendChat(NetworkAction action, p->Send_string(msg); p->Send_uint64(data); - this->Send_Packet(p); + this->SendPacket(p); return NETWORK_RECV_STATUS_OKAY; } @@ -533,7 +533,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendErrorQuit(ClientID client_ p->Send_uint32(client_id); p->Send_uint8 (errorno); - this->Send_Packet(p); + this->SendPacket(p); return NETWORK_RECV_STATUS_OKAY; } @@ -543,21 +543,21 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendQuit(ClientID client_id) p->Send_uint32(client_id); - this->Send_Packet(p); + this->SendPacket(p); return NETWORK_RECV_STATUS_OKAY; } NetworkRecvStatus ServerNetworkGameSocketHandler::SendShutdown() { Packet *p = new Packet(PACKET_SERVER_SHUTDOWN); - this->Send_Packet(p); + this->SendPacket(p); return NETWORK_RECV_STATUS_OKAY; } NetworkRecvStatus ServerNetworkGameSocketHandler::SendNewGame() { Packet *p = new Packet(PACKET_SERVER_NEWGAME); - this->Send_Packet(p); + this->SendPacket(p); return NETWORK_RECV_STATUS_OKAY; } @@ -567,7 +567,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendRConResult(uint16 colour, p->Send_uint16(colour); p->Send_string(command); - this->Send_Packet(p); + this->SendPacket(p); return NETWORK_RECV_STATUS_OKAY; } @@ -577,7 +577,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendMove(ClientID client_id, C p->Send_uint32(client_id); p->Send_uint8(company_id); - this->Send_Packet(p); + this->SendPacket(p); return NETWORK_RECV_STATUS_OKAY; } @@ -586,7 +586,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendCompanyUpdate() Packet *p = new Packet(PACKET_SERVER_COMPANY_UPDATE); p->Send_uint16(_network_company_passworded); - this->Send_Packet(p); + this->SendPacket(p); return NETWORK_RECV_STATUS_OKAY; } @@ -596,7 +596,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendConfigUpdate() p->Send_uint8(_settings_client.network.max_companies); p->Send_uint8(_settings_client.network.max_spectators); - this->Send_Packet(p); + this->SendPacket(p); return NETWORK_RECV_STATUS_OKAY; } @@ -854,7 +854,7 @@ DEF_GAME_RECEIVE_COMMAND(Server, PACKET_CLIENT_COMMAND) } CommandPacket cp; - const char *err = this->Recv_Command(p, &cp); + const char *err = this->ReceiveCommand(p, &cp); if (this->HasClientQuit()) return NETWORK_RECV_STATUS_CONN_LOST; @@ -1239,7 +1239,7 @@ DEF_GAME_RECEIVE_COMMAND(Server, PACKET_CLIENT_MOVE) return NETWORK_RECV_STATUS_OKAY; } -void NetworkSocketHandler::Send_CompanyInformation(Packet *p, const Company *c, const NetworkCompanyStats *stats) +void NetworkSocketHandler::SendCompanyInformation(Packet *p, const Company *c, const NetworkCompanyStats *stats) { /* Grab the company name */ char company_name[NETWORK_COMPANY_NAME_LENGTH]; |