(svn r13811) [0.6] -Backport from trunk:

- Fix: Several minor memory leaks. They only happened once per game (r13809, 13810)
- Fix: Checking for train waiting at other side of two-way signal was broken [FS#2162] (r13806)
- Fix: Some revision checking code was unintentionally disabled (r13776)
- Fix: Enforce the validity of a NetworkAction (chat packet) issued by a client (r13775)
- Fix: Selecting non-full length vehicles in the depot gui would place the "mouse pointer" out of the center of the vehicle making it hard to "aim" [FS#2147] (r13759)
This commit is contained in:
rubidium
2008-07-23 21:51:25 +00:00
parent 6097389437
commit c29c7f7932
9 changed files with 67 additions and 27 deletions
+15 -3
View File
@@ -646,14 +646,12 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_JOIN)
p->Recv_string(client_revision, sizeof(client_revision));
#if defined(WITH_REV) || defined(WITH_REV_HACK)
// Check if the client has revision control enabled
if (!IsNetworkCompatibleVersion(client_revision)) {
// Different revisions!!
SEND_COMMAND(PACKET_SERVER_ERROR)(cs, NETWORK_ERROR_WRONG_REVISION);
return;
}
#endif
p->Recv_string(name, sizeof(name));
playas = (Owner)p->Recv_uint8();
@@ -1168,7 +1166,21 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_CHAT)
p->Recv_string(msg, MAX_TEXT_MSG_LEN);
NetworkServer_HandleChat(action, desttype, dest, msg, cs->index);
const NetworkClientInfo *ci = DEREF_CLIENT_INFO(cs);
switch (action) {
case NETWORK_ACTION_GIVE_MONEY:
if (!IsValidPlayer(ci->client_playas)) break;
/* Fall-through */
case NETWORK_ACTION_CHAT:
case NETWORK_ACTION_CHAT_CLIENT:
case NETWORK_ACTION_CHAT_COMPANY:
NetworkServer_HandleChat(action, desttype, dest, msg, cs->index);
break;
default:
IConsolePrintF(_icolour_err, "WARNING: invalid chat action from client %d (IP: %s).", ci->client_index, GetPlayerIP(ci));
SEND_COMMAND(PACKET_SERVER_ERROR)(cs, NETWORK_ERROR_NOT_EXPECTED);
break;
}
}
DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_SET_PASSWORD)