(svn r21358) -Codechange: make some network function names conform to coding style

This commit is contained in:
rubidium
2010-11-30 13:38:46 +00:00
parent 9f9141c3c1
commit c7066d00af
25 changed files with 141 additions and 141 deletions

View File

@@ -103,7 +103,7 @@ void NetworkCoreShutdown()
* @param p the packet to write the data to
* @param grf the GRFIdentifier to serialize
*/
void NetworkSocketHandler::Send_GRFIdentifier(Packet *p, const GRFIdentifier *grf)
void NetworkSocketHandler::SendGRFIdentifier(Packet *p, const GRFIdentifier *grf)
{
uint j;
p->Send_uint32(grf->grfid);
@@ -117,7 +117,7 @@ void NetworkSocketHandler::Send_GRFIdentifier(Packet *p, const GRFIdentifier *gr
* @param p the packet to read the data from
* @param grf the GRFIdentifier to deserialize
*/
void NetworkSocketHandler::Recv_GRFIdentifier(Packet *p, GRFIdentifier *grf)
void NetworkSocketHandler::ReceiveGRFIdentifier(Packet *p, GRFIdentifier *grf)
{
uint j;
grf->grfid = p->Recv_uint32();

View File

@@ -74,9 +74,9 @@ public:
*/
void Reopen() { this->has_quit = false; }
void Send_GRFIdentifier(Packet *p, const GRFIdentifier *grf);
void Recv_GRFIdentifier(Packet *p, GRFIdentifier *grf);
void Send_CompanyInformation(Packet *p, const struct Company *c, const struct NetworkCompanyStats *stats);
void SendGRFIdentifier(Packet *p, const GRFIdentifier *grf);
void ReceiveGRFIdentifier(Packet *p, GRFIdentifier *grf);
void SendCompanyInformation(Packet *p, const struct Company *c, const struct NetworkCompanyStats *stats);
};
#endif /* ENABLE_NETWORK */

View File

@@ -56,7 +56,7 @@ NetworkRecvStatus NetworkTCPSocketHandler::CloseConnection(bool error)
* if the OS-network-buffer is full)
* @param packet the packet to send
*/
void NetworkTCPSocketHandler::Send_Packet(Packet *packet)
void NetworkTCPSocketHandler::SendPacket(Packet *packet)
{
Packet *p;
assert(packet != NULL);
@@ -90,7 +90,7 @@ void NetworkTCPSocketHandler::Send_Packet(Packet *packet)
* @return \c true if a (part of a) packet could be sent and
* the connection is not closed yet.
*/
bool NetworkTCPSocketHandler::Send_Packets(bool closing_down)
bool NetworkTCPSocketHandler::SendPackets(bool closing_down)
{
ssize_t res;
Packet *p;
@@ -141,7 +141,7 @@ bool NetworkTCPSocketHandler::Send_Packets(bool closing_down)
* @param status the variable to store the status into
* @return the received packet (or NULL when it didn't receive one)
*/
Packet *NetworkTCPSocketHandler::Recv_Packet()
Packet *NetworkTCPSocketHandler::ReceivePacket()
{
ssize_t res;

View File

@@ -35,11 +35,11 @@ public:
bool IsConnected() const { return this->sock != INVALID_SOCKET; }
virtual NetworkRecvStatus CloseConnection(bool error = true);
void Send_Packet(Packet *packet);
bool Send_Packets(bool closing_down = false);
void SendPacket(Packet *packet);
bool SendPackets(bool closing_down = false);
bool IsPacketQueueEmpty();
Packet *Recv_Packet();
Packet *ReceivePacket();
bool CanSendReceive();

View File

@@ -100,11 +100,11 @@ NetworkRecvStatus NetworkAdminSocketHandler::HandlePacket(Packet *p)
* HandlePacket is returned.
* @return #NetworkRecvStatus of the last handled packet.
*/
NetworkRecvStatus NetworkAdminSocketHandler::Recv_Packets()
NetworkRecvStatus NetworkAdminSocketHandler::ReceivePackets()
{
Packet *p;
while ((p = this->Recv_Packet()) != NULL) {
NetworkRecvStatus res = HandlePacket(p);
while ((p = this->ReceivePacket()) != NULL) {
NetworkRecvStatus res = this->HandlePacket(p);
if (res != NETWORK_RECV_STATUS_OKAY) return res;
}

View File

@@ -347,10 +347,10 @@ public:
NetworkAdminSocketHandler(SOCKET s);
~NetworkAdminSocketHandler();
NetworkRecvStatus Recv_Packets();
NetworkRecvStatus ReceivePackets();
const char *Recv_Command(Packet *p, CommandPacket *cp);
void Send_Command(Packet *p, const CommandPacket *cp);
const char *ReceiveCommand(Packet *p, CommandPacket *cp);
void SendCommand(Packet *p, const CommandPacket *cp);
};
#endif /* ENABLE_NETWORK */

View File

@@ -117,11 +117,11 @@ bool NetworkContentSocketHandler::HandlePacket(Packet *p)
/**
* Receive a packet at TCP level
*/
void NetworkContentSocketHandler::Recv_Packets()
void NetworkContentSocketHandler::ReceivePackets()
{
Packet *p;
while ((p = this->Recv_Packet()) != NULL) {
bool cont = HandlePacket(p);
while ((p = this->ReceivePacket()) != NULL) {
bool cont = this->HandlePacket(p);
delete p;
if (!cont) return;
}

View File

@@ -210,7 +210,7 @@ public:
virtual ~NetworkContentSocketHandler() { this->Close(); }
/** Do the actual receiving of packets. */
void Recv_Packets();
void ReceivePackets();
};
#endif /* ENABLE_NETWORK */

View File

@@ -34,7 +34,7 @@ NetworkGameSocketHandler::NetworkGameSocketHandler(SOCKET s)
}
/**
* Functions to help NetworkRecv_Packet/NetworkSend_Packet a bit
* Functions to help ReceivePacket/SendPacket a bit
* A socket can make errors. When that happens this handles what to do.
* For clients: close connection and drop back to main-menu
* For servers: close connection and that is it
@@ -136,10 +136,10 @@ NetworkRecvStatus NetworkGameSocketHandler::HandlePacket(Packet *p)
* HandlePacket is returned.
* @return #NetworkRecvStatus of the last handled packet.
*/
NetworkRecvStatus NetworkGameSocketHandler::Recv_Packets()
NetworkRecvStatus NetworkGameSocketHandler::ReceivePackets()
{
Packet *p;
while ((p = this->Recv_Packet()) != NULL) {
while ((p = this->ReceivePacket()) != NULL) {
NetworkRecvStatus res = HandlePacket(p);
delete p;
if (res != NETWORK_RECV_STATUS_OKAY) return res;

View File

@@ -482,10 +482,10 @@ public:
inline void SetInfo(NetworkClientInfo *info) { assert(info != NULL && this->info == NULL); this->info = info; }
inline NetworkClientInfo *GetInfo() const { return this->info; }
NetworkRecvStatus Recv_Packets();
NetworkRecvStatus ReceivePackets();
const char *Recv_Command(Packet *p, CommandPacket *cp);
void Send_Command(Packet *p, const CommandPacket *cp);
const char *ReceiveCommand(Packet *p, CommandPacket *cp);
void SendCommand(Packet *p, const CommandPacket *cp);
};
#endif /* ENABLE_NETWORK */

View File

@@ -129,7 +129,7 @@ public:
FOR_ALL_ITEMS_FROM(Tsocket, idx, cs, 0) {
cs->writable = !!FD_ISSET(cs->sock, &write_fd);
if (FD_ISSET(cs->sock, &read_fd)) {
cs->Recv_Packets();
cs->ReceivePackets();
}
}
return _networking;

View File

@@ -151,7 +151,7 @@ void NetworkUDPSocketHandler::ReceivePackets()
* @param p the packet to write the data to
* @param info the NetworkGameInfo struct to serialize
*/
void NetworkUDPSocketHandler::Send_NetworkGameInfo(Packet *p, const NetworkGameInfo *info)
void NetworkUDPSocketHandler::SendNetworkGameInfo(Packet *p, const NetworkGameInfo *info)
{
p->Send_uint8 (NETWORK_GAME_INFO_VERSION);
@@ -180,7 +180,7 @@ void NetworkUDPSocketHandler::Send_NetworkGameInfo(Packet *p, const NetworkGameI
/* Send actual GRF Identifications */
for (c = info->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);
}
}
@@ -213,7 +213,7 @@ void NetworkUDPSocketHandler::Send_NetworkGameInfo(Packet *p, const NetworkGameI
* @param p the packet to read the data from
* @param info the NetworkGameInfo to deserialize into
*/
void NetworkUDPSocketHandler::Recv_NetworkGameInfo(Packet *p, NetworkGameInfo *info)
void NetworkUDPSocketHandler::ReceiveNetworkGameInfo(Packet *p, NetworkGameInfo *info)
{
static const Date MAX_DATE = ConvertYMDToDate(MAX_YEAR, 11, 31); // December is month 11
@@ -238,7 +238,7 @@ void NetworkUDPSocketHandler::Recv_NetworkGameInfo(Packet *p, NetworkGameInfo *i
for (i = 0; i < num_grfs; i++) {
GRFConfig *c = new GRFConfig();
this->Recv_GRFIdentifier(p, &c->ident);
this->ReceiveGRFIdentifier(p, &c->ident);
this->HandleIncomingNetworkGameInfoGRFConfig(c);
/* Append GRFConfig to the list */

View File

@@ -153,8 +153,8 @@ public:
void SendPacket(Packet *p, NetworkAddress *recv, bool all = false, bool broadcast = false);
void ReceivePackets();
void Send_NetworkGameInfo(Packet *p, const NetworkGameInfo *info);
void Recv_NetworkGameInfo(Packet *p, NetworkGameInfo *info);
void SendNetworkGameInfo(Packet *p, const NetworkGameInfo *info);
void ReceiveNetworkGameInfo(Packet *p, NetworkGameInfo *info);
};
#endif /* ENABLE_NETWORK */