diff options
author | rubidium <rubidium@openttd.org> | 2010-08-18 21:30:38 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-08-18 21:30:38 +0000 |
commit | e8e22c99fd5cfccf6087632b46664fbd02f7900c (patch) | |
tree | 6d17fdbcdebe29e0366454e4530f7de6761350b3 /src/network | |
parent | 926594b599e76886fd877e953036918687418b0c (diff) | |
download | openttd-e8e22c99fd5cfccf6087632b46664fbd02f7900c.tar.xz |
(svn r20548) -Codechange: rename some variables giving them slightly more meaningful names
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/core/tcp_game.h | 2 | ||||
-rw-r--r-- | src/network/network_command.cpp | 14 | ||||
-rw-r--r-- | src/network/network_server.cpp | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/network/core/tcp_game.h b/src/network/core/tcp_game.h index d6952d1bf..f150a5f08 100644 --- a/src/network/core/tcp_game.h +++ b/src/network/core/tcp_game.h @@ -122,7 +122,7 @@ public: ClientStatus status; ///< Status of this client - CommandQueue command_queue; ///< The command-queue awaiting delivery + CommandQueue outgoing_queue; ///< The command-queue awaiting delivery NetworkRecvStatus CloseConnection(bool error = true); diff --git a/src/network/network_command.cpp b/src/network/network_command.cpp index 8c550338c..6f6cae886 100644 --- a/src/network/network_command.cpp +++ b/src/network/network_command.cpp @@ -97,8 +97,8 @@ void CommandQueue::Free() } -/** Local queue of packets */ -static CommandQueue _local_command_queue; +/** Local queue of packets waiting for execution. */ +static CommandQueue _local_execution_queue; /** * Add a command to the local or client socket command queue, @@ -110,7 +110,7 @@ void NetworkAddCommandQueue(CommandPacket cp, NetworkClientSocket *cs) { CommandPacket *new_cp = MallocT<CommandPacket>(1); *new_cp = cp; - (cs == NULL ? _local_command_queue : cs->command_queue).Append(new_cp); + (cs == NULL ? _local_execution_queue : cs->outgoing_queue).Append(new_cp); } /** @@ -177,7 +177,7 @@ void NetworkSend_Command(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, Comma */ void NetworkSyncCommandQueue(NetworkClientSocket *cs) { - for (CommandPacket *p = _local_command_queue.Peek(); p != NULL; p = p->next) { + for (CommandPacket *p = _local_execution_queue.Peek(); p != NULL; p = p->next) { CommandPacket c = *p; c.callback = 0; c.next = NULL; @@ -193,7 +193,7 @@ void NetworkExecuteLocalCommandQueue() assert(IsLocalCompany()); CommandPacket *cp; - while ((cp = _local_command_queue.Peek()) != NULL) { + while ((cp = _local_execution_queue.Peek()) != NULL) { /* The queue is always in order, which means * that the first element will be executed first. */ if (_frame_counter < cp->frame) break; @@ -209,7 +209,7 @@ void NetworkExecuteLocalCommandQueue() cp->cmd |= CMD_NETWORK_COMMAND; DoCommandP(cp, cp->my_cmd); - _local_command_queue.Pop(); + _local_execution_queue.Pop(); free(cp); } @@ -222,7 +222,7 @@ void NetworkExecuteLocalCommandQueue() */ void NetworkFreeLocalCommandQueue() { - _local_command_queue.Free(); + _local_execution_queue.Free(); } /** diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index a363c2058..e9cb791d5 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -1612,7 +1612,7 @@ void NetworkServer_ReadPackets(NetworkClientSocket *cs) static void NetworkHandleCommandQueue(NetworkClientSocket *cs) { CommandPacket *cp; - while ((cp = cs->command_queue.Pop()) != NULL) { + while ((cp = cs->outgoing_queue.Pop()) != NULL) { SEND_COMMAND(PACKET_SERVER_COMMAND)(cs, cp); free(cp); } |