summaryrefslogtreecommitdiff
path: root/src/network/network_server.cpp
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-04-18 09:54:47 +0200
committerPatric Stout <github@truebrain.nl>2021-04-24 21:43:58 +0200
commit526635942451479bee66e9eb61c50f91ae48a7dd (patch)
tree34a757634102f384eb2e70ae1044dd86916243f9 /src/network/network_server.cpp
parentaca20092aadd65a764f1ea493c36f0ca507b32ff (diff)
downloadopenttd-526635942451479bee66e9eb61c50f91ae48a7dd.tar.xz
Feature: rework in-game Online Players GUI
The GUI now more clearly shows some basic information about the server you joined, your client name (and the ability to change it), and what players are in which company. It also contains useful buttons to press to join companies, chat with other people, and for admins to kick/ban people. Additionally, renamed "advertised" to "visibility"; this has to do with future additions, but also because it is more clear in wording.
Diffstat (limited to 'src/network/network_server.cpp')
-rw-r--r--src/network/network_server.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp
index a0d1a0066..746077abd 100644
--- a/src/network/network_server.cpp
+++ b/src/network/network_server.cpp
@@ -288,13 +288,14 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::CloseConnection(NetworkRecvSta
_network_clients_connected--;
DeleteWindowById(WC_CLIENT_LIST_POPUP, this->client_id);
- SetWindowDirty(WC_CLIENT_LIST, 0);
this->SendPackets(true);
delete this->GetInfo();
delete this;
+ InvalidateWindowData(WC_CLIENT_LIST, 0);
+
return status;
}
@@ -1043,6 +1044,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_MAP_OK(Packet *
this->GetClientName(client_name, lastof(client_name));
NetworkTextMessage(NETWORK_ACTION_JOIN, CC_DEFAULT, false, client_name, nullptr, this->client_id);
+ InvalidateWindowData(WC_CLIENT_LIST, 0);
/* Mark the client as pre-active, and wait for an ACK
* so we know he is done loading and in sync with us */
@@ -2061,6 +2063,9 @@ void NetworkServerDoMove(ClientID client_id, CompanyID company_id)
NetworkAction action = (company_id == COMPANY_SPECTATOR) ? NETWORK_ACTION_COMPANY_SPECTATOR : NETWORK_ACTION_COMPANY_JOIN;
NetworkServerSendChat(action, DESTTYPE_BROADCAST, 0, "", client_id, company_id + 1);
+
+ InvalidateWindowClassesData(WC_CLIENT_LIST_POPUP);
+ InvalidateWindowData(WC_CLIENT_LIST, 0);
}
/**