1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-27 06:04:25 +01:00

(svn r22461) [1.1] -Backport from trunk:

- Fix: [NewGRF] Zero register 0x100 as specified before resolving custom station foundations (r22452)
- Fix: Do not 'log' the NewGRFs in the screenshot when in the menu [FS#4610] (r22450)
- Fix: Keep better accounting of the order in which clients joined; client can't be starved from joining and they get shown the amount of clients waiting in front of them. (r22372, r22370, r22369, r22368, r22367, r22366, r22365, r22364, r22363, r22362, r22361)
- Fix: Delete the client list popup when the client got removed (instead of previously selecting some other client) (r22360, r22359, r22358)
This commit is contained in:
rubidium
2011-05-15 09:38:54 +00:00
parent 829a2c201d
commit 59a11e6626
20 changed files with 187 additions and 177 deletions

View File

@@ -490,7 +490,7 @@ DEF_CONSOLE_CMD(ConClearBuffer)
static bool ConKickOrBan(const char *argv, bool ban)
{
const char *ip = argv;
uint n;
if (strchr(argv, '.') == NULL && strchr(argv, ':') == NULL) { // banning with ID
ClientID client_id = (ClientID)atoi(argv);
@@ -504,7 +504,7 @@ static bool ConKickOrBan(const char *argv, bool ban)
return true;
}
NetworkClientInfo *ci = NetworkFindClientInfoFromClientID(client_id);
NetworkClientInfo *ci = NetworkClientInfo::GetByClientID(client_id);
if (ci == NULL) {
IConsoleError("Invalid client");
return true;
@@ -517,10 +517,11 @@ static bool ConKickOrBan(const char *argv, bool ban)
}
/* When banning, kick+ban all clients with that IP */
ip = GetClientIP(ci);
n = NetworkServerKickOrBanIP(client_id, ban);
} else {
n = NetworkServerKickOrBanIP(argv, ban);
}
uint n = NetworkServerKickOrBanIP(ip, ban);
if (n == 0) {
IConsolePrint(CC_DEFAULT, ban ? "Client not online, address added to banlist" : "Client not found");
} else {
@@ -699,7 +700,7 @@ DEF_CONSOLE_CMD(ConClientNickChange)
return true;
}
if (NetworkFindClientInfoFromClientID(client_id) == NULL) {
if (NetworkClientInfo::GetByClientID(client_id) == NULL) {
IConsoleError("Invalid client");
return true;
}
@@ -727,7 +728,7 @@ DEF_CONSOLE_CMD(ConJoinCompany)
return true;
}
if (NetworkFindClientInfoFromClientID(_network_own_client_id)->client_playas == company_id) {
if (NetworkClientInfo::GetByClientID(_network_own_client_id)->client_playas == company_id) {
IConsoleError("You are already there!");
return true;
}
@@ -766,7 +767,7 @@ DEF_CONSOLE_CMD(ConMoveClient)
return true;
}
const NetworkClientInfo *ci = NetworkFindClientInfoFromClientID((ClientID)atoi(argv[1]));
const NetworkClientInfo *ci = NetworkClientInfo::GetByClientID((ClientID)atoi(argv[1]));
CompanyID company_id = (CompanyID)(atoi(argv[2]) <= MAX_COMPANIES ? atoi(argv[2]) - 1 : atoi(argv[2]));
/* check the client exists */
@@ -828,7 +829,7 @@ DEF_CONSOLE_CMD(ConResetCompany)
IConsoleError("Cannot remove company: a client is connected to that company.");
return false;
}
const NetworkClientInfo *ci = NetworkFindClientInfoFromClientID(CLIENT_ID_SERVER);
const NetworkClientInfo *ci = NetworkClientInfo::GetByClientID(CLIENT_ID_SERVER);
if (ci->client_playas == index) {
IConsoleError("Cannot remove company: the server is connected to that company.");
return true;