diff --git a/src/network/core/address.cpp b/src/network/core/address.cpp index 3b3c9f4..d8c990e 100644 --- a/src/network/core/address.cpp +++ b/src/network/core/address.cpp @@ -259,7 +259,7 @@ SOCKET NetworkAddress::Resolve(int family, int socktype, int flags, SocketList * for (struct addrinfo *runp = ai; runp != NULL; runp = runp->ai_next) { /* When we are binding to multiple sockets, make sure we do not * connect to one with exactly the same address twice. That's - * ofcourse totally unneeded ;) */ + * of course totally unneeded ;) */ if (sockets != NULL) { NetworkAddress address(runp->ai_addr, (int)runp->ai_addrlen); if (sockets->Contains(address)) continue; diff --git a/src/network/core/core.cpp b/src/network/core/core.cpp index fc1bbf9..867bb4b 100644 --- a/src/network/core/core.cpp +++ b/src/network/core/core.cpp @@ -51,7 +51,7 @@ bool NetworkCoreInitialize() if (OpenDevice("timer.device", UNIT_MICROHZ, (struct IORequest*)TimerRequest, 0) == 0) { TimerBase = TimerRequest->tr_node.io_Device; if (TimerBase == NULL) { - /* free ressources... */ + /* free resources... */ DEBUG(net, 0, "[core] can't initialize timer, network unavailable"); return false; } diff --git a/src/network/core/core.h b/src/network/core/core.h index ca7c763..a250dbb 100644 --- a/src/network/core/core.h +++ b/src/network/core/core.h @@ -28,12 +28,12 @@ enum NetworkRecvStatus { NETWORK_RECV_STATUS_DESYNC, ///< A desync did occur NETWORK_RECV_STATUS_NEWGRF_MISMATCH, ///< We did not have the required NewGRFs NETWORK_RECV_STATUS_SAVEGAME, ///< Something went wrong (down)loading the savegame - NETWORK_RECV_STATUS_CONN_LOST, ///< The conection is 'just' lost + NETWORK_RECV_STATUS_CONN_LOST, ///< The connection is 'just' lost NETWORK_RECV_STATUS_MALFORMED_PACKET, ///< We apparently send a malformed packet NETWORK_RECV_STATUS_SERVER_ERROR, ///< The server told us we made an error NETWORK_RECV_STATUS_SERVER_FULL, ///< The server is full NETWORK_RECV_STATUS_SERVER_BANNED, ///< The server has banned us - NETWORK_RECV_STATUS_CLOSE_QUERY, ///< Done quering the server + NETWORK_RECV_STATUS_CLOSE_QUERY, ///< Done querying the server }; /** Forward declaration due to circular dependencies */ @@ -48,7 +48,7 @@ public: /** Create a new unbound socket */ NetworkSocketHandler() { this->has_quit = false; } - /** Close the socket when distructing the socket handler */ + /** Close the socket when destructing the socket handler */ virtual ~NetworkSocketHandler() { this->Close(); } /** Really close the socket */ diff --git a/src/network/core/tcp.h b/src/network/core/tcp.h index e556055..b736189 100644 --- a/src/network/core/tcp.h +++ b/src/network/core/tcp.h @@ -52,7 +52,7 @@ public: /** * Whether there is something pending in the send queue. - * @return true when someting is pending in the send queue. + * @return true when something is pending in the send queue. */ bool HasSendQueue() { return this->packet_queue != NULL; } diff --git a/src/network/core/tcp_admin.h b/src/network/core/tcp_admin.h index f950f1a..932c3af 100644 --- a/src/network/core/tcp_admin.h +++ b/src/network/core/tcp_admin.h @@ -339,7 +339,7 @@ protected: virtual NetworkRecvStatus Receive_SERVER_COMPANY_UPDATE(Packet *p); /** - * Notification about a removed company (e.g. due to banrkuptcy). + * Notification about a removed company (e.g. due to bankruptcy). * uint8 ID of the company. * uint8 Reason for being removed (see #AdminCompanyRemoveReason). * @param p The packet that was just received. diff --git a/src/network/core/tcp_content.h b/src/network/core/tcp_content.h index b803d71..5ad6ac5 100644 --- a/src/network/core/tcp_content.h +++ b/src/network/core/tcp_content.h @@ -139,7 +139,7 @@ protected: /** * Client requesting a list of content info based on an external * 'unique' id; GRF ID + MD5 checksum for NewGRFS, shortname and - * xor-ed MD5 checsums for base graphics and AIs. + * xor-ed MD5 checksums for base graphics and AIs. * Scenarios and AI libraries are not supported * uint8 count of requests * for each request: diff --git a/src/network/core/tcp_game.h b/src/network/core/tcp_game.h index 580e129..7613996 100644 --- a/src/network/core/tcp_game.h +++ b/src/network/core/tcp_game.h @@ -326,8 +326,8 @@ protected: * Sends the current frame counter to the client: * uint32 Frame counter * uint32 Frame counter max (how far may the client walk before the server?) - * uint32 General seed 1 (dependant on compile settings, not default). - * uint32 General seed 2 (dependant on compile settings, not default). + * uint32 General seed 1 (dependent on compile settings, not default). + * uint32 General seed 2 (dependent on compile settings, not default). * uint8 Random token to validate the client is actually listening (only occasionally present). * @param p The packet that was just received. */ @@ -337,7 +337,7 @@ protected: * Sends a sync-check to the client: * uint32 Frame counter. * uint32 General seed 1. - * uint32 General seed 2 (dependant on compile settings, not default). + * uint32 General seed 2 (dependent on compile settings, not default). * @param p The packet that was just received. */ virtual NetworkRecvStatus Receive_SERVER_SYNC(Packet *p); @@ -413,13 +413,13 @@ protected: virtual NetworkRecvStatus Receive_CLIENT_SET_NAME(Packet *p); /** - * The client is quiting the game. + * The client is quitting the game. * @param p The packet that was just received. */ virtual NetworkRecvStatus Receive_CLIENT_QUIT(Packet *p); /** - * The client made an error and is quiting the game. + * The client made an error and is quitting the game. * uint8 Error of the code caused (see NetworkErrorCode). * @param p The packet that was just received. */ diff --git a/src/network/core/tcp_http.cpp b/src/network/core/tcp_http.cpp index 386ba77..a9829d5 100644 --- a/src/network/core/tcp_http.cpp +++ b/src/network/core/tcp_http.cpp @@ -177,7 +177,7 @@ int NetworkHTTPSocketHandler::HandleHeader() int ret = NetworkHTTPSocketHandler::Connect(uri, this->callback, this->data, this->redirect_depth + 1); if (ret != 0) return ret; - /* We've relinguished control of data now. */ + /* We've relinquished control of data now. */ this->data = NULL; /* Restore the header. */ diff --git a/src/network/core/tcp_http.h b/src/network/core/tcp_http.h index dc678cc..6222c76 100644 --- a/src/network/core/tcp_http.h +++ b/src/network/core/tcp_http.h @@ -117,7 +117,7 @@ public: virtual void OnConnect(SOCKET s) { new NetworkHTTPSocketHandler(s, this->callback, this->address.GetHostname(), this->url, this->data, this->depth); - /* We've relinguished control of data now. */ + /* We've relinquished control of data now. */ this->data = NULL; } }; diff --git a/src/network/core/udp.h b/src/network/core/udp.h index 29abb8a..9aa0c9d 100644 --- a/src/network/core/udp.h +++ b/src/network/core/udp.h @@ -27,7 +27,7 @@ enum PacketUDPType { PACKET_UDP_CLIENT_DETAIL_INFO, ///< Queries a game server about details of the game, such as companies PACKET_UDP_SERVER_DETAIL_INFO, ///< Reply of the game server about details of the game, such as companies PACKET_UDP_SERVER_REGISTER, ///< Packet to register itself to the master server - PACKET_UDP_MASTER_ACK_REGISTER, ///< Packet indicating registration has succedeed + PACKET_UDP_MASTER_ACK_REGISTER, ///< Packet indicating registration has succeeded PACKET_UDP_CLIENT_GET_LIST, ///< Request for serverlist from master server PACKET_UDP_MASTER_RESPONSE_LIST, ///< Response from master server with server ip's + port's PACKET_UDP_SERVER_UNREGISTER, ///< Request to be removed from the server-list @@ -73,7 +73,7 @@ protected: * all 1 the version of this packet's structure * * 4+ 1 number of GRFs attached (n) - * 4+ n * 20 unique identifier for GRF files. Constists of: + * 4+ n * 20 unique identifier for GRF files. Consists of: * - one 4 byte variable with the GRF ID * - 16 bytes (sent sequentially) for the MD5 checksum * of the GRF diff --git a/src/network/network.cpp b/src/network/network.cpp index 41af3d1..9601df5 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -455,7 +455,7 @@ static void CheckPauseOnJoin() * Converts a string to ip/port/company * Format: IP:port#company * - * connection_string will be re-terminated to seperate out the hostname, and company and port will + * connection_string will be re-terminated to separate out the hostname, and company and port will * be set to the company and port strings given by the user, inside the memory area originally * occupied by connection_string. */ @@ -488,7 +488,7 @@ void ParseConnectionString(const char **company, const char **port, char *connec } /** - * Handle the acception of a connection to the server. + * Handle the accepting of a connection to the server. * @param s The socket of the new connection. * @param address The address of the peer. */ @@ -549,7 +549,7 @@ void NetworkClose(bool close_admins) InitializeNetworkPools(close_admins); } -/* Inits the network (cleans sockets and stuff) */ +/* Initializes the network (cleans sockets and stuff) */ static void NetworkInitialize(bool close_admins = true) { InitializeNetworkPools(close_admins); @@ -809,7 +809,7 @@ void NetworkDisconnect(bool blocking, bool close_admins) /** * Receives something from the network. - * @return true if everthing went fine, false when the connection got closed. + * @return true if everything went fine, false when the connection got closed. */ static bool NetworkReceive() { diff --git a/src/network/network_admin.cpp b/src/network/network_admin.cpp index 45ceaa7..a78f0c8 100644 --- a/src/network/network_admin.cpp +++ b/src/network/network_admin.cpp @@ -974,7 +974,7 @@ void ServerNetworkAdminSocketHandler::WelcomeAll() /** * Send (push) updates to the admin network as they have registered for these updates. - * @param freq the frequency to be processd. + * @param freq the frequency to be processed. */ void NetworkAdminUpdate(AdminUpdateFrequency freq) { diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp index dca244a..f43f241 100644 --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -451,7 +451,7 @@ struct NetworkChatWindow : public Window { } if (second_scan) { - /* We walked all posibilities, and the user presses tab again.. revert to original text */ + /* We walked all possibilities, and the user presses tab again.. revert to original text */ this->message_editbox.text.Assign(_chat_tab_completion_buf); _chat_tab_completion_active = false; diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp index 8eaa2eb..44c13fb 100644 --- a/src/network/network_client.cpp +++ b/src/network/network_client.cpp @@ -617,8 +617,8 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_CLIENT_INFO(Pac } /* There are at most as many ClientInfo as ClientSocket objects in a - * server. Having more Infos than a server can have means something - * has gone wrong somewhere, i.e. the server has more Infos than it + * server. Having more info than a server can have means something + * has gone wrong somewhere, i.e. the server has more info than it * has actual clients. That means the server is feeding us an invalid * state. So, bail out! This server is broken. */ if (!NetworkClientInfo::CanAllocateItem()) return NETWORK_RECV_STATUS_MALFORMED_PACKET; @@ -1056,7 +1056,7 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_NEWGAME(Packet /* Only when we're trying to join we really * care about the server shutting down. */ if (this->status >= STATUS_JOIN) { - /* To trottle the reconnects a bit, every clients waits its + /* To throttle the reconnects a bit, every clients waits its * Client ID modulo 16. This way reconnects should be spread * out a bit. */ _network_reconnect = _network_own_client_id % 16; diff --git a/src/network/network_client.h b/src/network/network_client.h index 342834f..23878b5 100644 --- a/src/network/network_client.h +++ b/src/network/network_client.h @@ -29,7 +29,7 @@ private: STATUS_JOIN, ///< We are trying to join a server. STATUS_NEWGRFS_CHECK, ///< Last action was checking NewGRFs. STATUS_AUTH_GAME, ///< Last action was requesting game (server) password. - STATUS_AUTH_COMPANY, ///< Last action was requestion company password. + STATUS_AUTH_COMPANY, ///< Last action was requesting company password. STATUS_AUTHORIZED, ///< The client is authorized at the server. STATUS_MAP_WAIT, ///< The client is waiting as someone else is downloading the map. STATUS_MAP, ///< The client is downloading the map. diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp index afbca4a..07bf8ab 100644 --- a/src/network/network_content.cpp +++ b/src/network/network_content.cpp @@ -509,7 +509,7 @@ bool ClientNetworkContentSocketHandler::BeforeDownload() /* The filesize is > 0, so we are going to download it */ const char *filename = GetFullFilename(this->curInfo, true); if (filename == NULL || (this->curFile = fopen(filename, "wb")) == NULL) { - /* Unless that fails ofcourse... */ + /* Unless that fails of course... */ DeleteWindowById(WC_NETWORK_STATUS_WINDOW, WN_NETWORK_STATUS_WINDOW_CONTENT_DOWNLOAD); ShowErrorMessage(STR_CONTENT_ERROR_COULD_NOT_DOWNLOAD, STR_CONTENT_ERROR_COULD_NOT_DOWNLOAD_FILE_NOT_WRITABLE, WL_ERROR); return false; diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 3464efa..bab9f4a 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -528,7 +528,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendWait() /** This sends the map to the client */ NetworkRecvStatus ServerNetworkGameSocketHandler::SendMap() { - static uint sent_packets; // How many packets we did send succecfully last time + static uint sent_packets; // How many packets we did send successfully last time if (this->status < STATUS_AUTHORIZED) { /* Illegal call, return error and ignore the packet */ @@ -1500,7 +1500,7 @@ void NetworkSocketHandler::SendCompanyInformation(Packet *p, const Company *c, c p->Send_uint64(income); p->Send_uint16(c->old_economy[0].performance_history); - /* Send 1 if there is a passord for the company else send 0 */ + /* Send 1 if there is a password for the company else send 0 */ p->Send_bool (!StrEmpty(_network_company_states[c->index].password)); for (uint i = 0; i < NETWORK_VEH_END; i++) { @@ -1620,7 +1620,7 @@ static void NetworkAutoCleanCompanies() } } - /* Go through all the comapnies */ + /* Go through all the companies */ FOR_ALL_COMPANIES(c) { /* Skip the non-active once */ if (c->is_ai) continue; @@ -1786,7 +1786,7 @@ void NetworkServer_Tick(bool send_frame) switch (cs->status) { case NetworkClientSocket::STATUS_ACTIVE: if (lag > _settings_client.network.max_lag_time) { - /* Client did still not report in within the specififed limit. */ + /* Client did still not report in within the specified limit. */ IConsolePrintF(CC_ERROR, cs->last_packet + lag * MILLISECONDS_PER_TICK > _realtime_tick ? /* A packet was received in the last three game days, so the client is likely lagging behind. */ "Client #%d is dropped because the client's game state is more than %d ticks behind" : diff --git a/src/network/network_server.h b/src/network/network_server.h index e9d790a..0fc52ad 100644 --- a/src/network/network_server.h +++ b/src/network/network_server.h @@ -19,7 +19,7 @@ #include "../thread/thread.h" class ServerNetworkGameSocketHandler; -/** Make the code look slightliy nicer/simpler. */ +/** Make the code look slightly nicer/simpler. */ typedef ServerNetworkGameSocketHandler NetworkClientSocket; /** Pool with all client sockets. */ typedef Pool NetworkClientSocketPool; diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp index f58a393..cde2994 100644 --- a/src/network/network_udp.cpp +++ b/src/network/network_udp.cpp @@ -34,15 +34,15 @@ #include "core/udp.h" -/** Mutex for all out threaded udp resoltion and such. */ +/** Mutex for all out threaded udp resolution and such. */ static ThreadMutex *_network_udp_mutex = ThreadMutex::New(); /** Session key to register ourselves to the master server */ static uint64 _session_key = 0; 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 +static const uint ADVERTISE_RETRY_INTERVAL = 300; ///< re-advertise when no response after this many ticks (9 seconds) +static const uint ADVERTISE_RETRY_TIMES = 3; ///< give up re-advertising after this much failed retries NetworkUDPSocketHandler *_udp_client_socket = NULL; ///< udp client socket NetworkUDPSocketHandler *_udp_server_socket = NULL; ///< udp server socket