From 66a3acc7ed86307408c3497980f2bca421f344d6 Mon Sep 17 00:00:00 2001 From: mastyra Date: Tue, 23 Dec 2025 18:58:43 -0500 Subject: [PATCH 1/7] Send playerlist packets for adding and removing a client from the server. --- server/client_manager.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/server/client_manager.py b/server/client_manager.py index 828f4ea9..02fd2cd5 100644 --- a/server/client_manager.py +++ b/server/client_manager.py @@ -2292,6 +2292,17 @@ def new_client(self, transport): for client in self.server.client_manager.clients: if client.ipid == temp_ipid: client.clientscon += 1 + # 2.11 player list support + c.send_command("PR", c.id, 0) + for target in self.server.client_manager.clients: + if target.area.id == 0 and target.id != c.id: + target.send_command("PR", c.id, 0) #register new client to others in lobby + + c.send_command("PR", target.id, 0) #register others in lobby to new client + c.send_command("PU", target.id, 0, target.name) #fetch names of others in lobby + c.send_command("PU", target.id, 1, target.char_name) #fetch chars of others in lobby + c.send_command("PU", target.id, 2, target.showname) #fetch shownames of others in lobby + c.send_command("PU", target.id, 3, target.area.id) #fetch area of others in lobby return c def remove_client(self, client): @@ -2316,6 +2327,9 @@ def remove_client(self, client): c.clientscon -= 1 if c.following == client: c.unfollow() + # 2.11 player list support + if c.area.id == client.area.id: + c.send_command("PR", client.id, 1) self.clients.remove(client) # TODO: Maybe take into account than sending the "CU" packet can reveal your cover. From 4c84bd4c2fde18844d35e0f6449767b25f47b828 Mon Sep 17 00:00:00 2001 From: mastyra Date: Tue, 23 Dec 2025 19:01:11 -0500 Subject: [PATCH 2/7] Send playerlist packets when a client successfully changes area --- server/client_manager.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/server/client_manager.py b/server/client_manager.py index 02fd2cd5..81782b41 100644 --- a/server/client_manager.py +++ b/server/client_manager.py @@ -1248,6 +1248,26 @@ def change_area(self, area, password=""): self.set_area(area, target_pos) self.last_move_time = round(time.time() * 1000.0) + # 2.11 player list support + for target in self.server.client_manager.clients: + if target.area.id == old_area.id and target.id != self.id: + self.send_command("PR", target.id, 1) # remove clients from previous area + target.send_command("PR", self.id, 1) # remove self from previous area to other clients + if target.area.id == self.area.id and target.id != self.id: + target.send_command("PR", self.id, 0) # add self to new area to other clients + target.send_command("PU", self.id, 0, self.name) # send name to other clients + target.send_command("PU", self.id, 1, self.char_name) # send char id to other clients + target.send_command("PU", self.id, 2, self.showname) # send showname to other clients + target.send_command("PU", self.id, 3, self.area.id) # send area id to other clients + + self.send_command("PR", target.id, 0) # add client from new area + self.send_command("PU", target.id, 0, target.name) + self.send_command("PU", target.id, 1, target.char_name) + self.send_command("PU", target.id, 2, target.showname) + self.send_command("PU", target.id, 3, target.area.id) + + self.send_command("PU", self.id, 3, self.area.id) # send area id to self + for c in self.server.client_manager.clients: # If target c is following us if c.following == self: From 45f4a8ecb5d9ebbb7cd3a5b7b6d1049da3edf9a6 Mon Sep 17 00:00:00 2001 From: mastyra Date: Tue, 23 Dec 2025 19:04:40 -0500 Subject: [PATCH 3/7] Send playerlist packet when client successfully changes character --- server/client_manager.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/client_manager.py b/server/client_manager.py index 81782b41..0e30d29c 100644 --- a/server/client_manager.py +++ b/server/client_manager.py @@ -531,6 +531,11 @@ def change_character(self, char_id, force=False): self.area, message={"from": old_char, "to": new_char}, ) + # 2.11 player list support + for target in self.server.client_manager.clients: + if target.area.id == self.area.id: + target.send_command("PU", self.id, 1, self.char_name) + # Inform the CMs of character change self.area.send_owner_command( "CT", From 6a45d97be83c8163fda85d3ad18c35bc8d74f79b Mon Sep 17 00:00:00 2001 From: mastyra Date: Tue, 23 Dec 2025 19:07:07 -0500 Subject: [PATCH 4/7] Send playerlist packets to update shownames on message sent --- server/network/aoprotocol.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/server/network/aoprotocol.py b/server/network/aoprotocol.py index ac85ad8b..269846a7 100644 --- a/server/network/aoprotocol.py +++ b/server/network/aoprotocol.py @@ -1494,6 +1494,12 @@ def net_cmd_ms(self, args): ): additive = 0 + # 2.11 player list support + for target in self.client.server.client_manager.clients: + if target.area.id == self.client.area.id: + target.send_command("PU", self.client.id, 2, self.client.showname) + self.client.send_command("PU", self.client.id, 2, self.client.showname) + self.client.area.send_ic( client=self.client, msg_type=msg_type, @@ -1718,6 +1724,13 @@ def net_cmd_ct(self, args): args[1] = self.client.shake_message(args[1]) if self.client.disemvowel: args[1] = self.client.disemvowel_message(args[1]) + + # 2.11 player list support + for target in self.client.server.client_manager.clients: + if target.area.id == self.client.area.id: + target.send_command("PU", self.client.id, 0, self.client.name) + self.client.send_command("PU", self.client.id, 0, self.client.name) + self.client.area.send_command("CT", name, args[1]) self.client.area.send_owner_command( "CT", f"[{self.client.area.id}]{name}", args[1] From 7008ba0927c4486d680d2796ff42bf02d2ccff85 Mon Sep 17 00:00:00 2001 From: mastyra Date: Sun, 28 Dec 2025 22:43:51 -0500 Subject: [PATCH 5/7] Only update showname if it does not match character name --- server/network/aoprotocol.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/network/aoprotocol.py b/server/network/aoprotocol.py index 269846a7..1087cad7 100644 --- a/server/network/aoprotocol.py +++ b/server/network/aoprotocol.py @@ -1495,10 +1495,11 @@ def net_cmd_ms(self, args): additive = 0 # 2.11 player list support - for target in self.client.server.client_manager.clients: - if target.area.id == self.client.area.id: - target.send_command("PU", self.client.id, 2, self.client.showname) - self.client.send_command("PU", self.client.id, 2, self.client.showname) + if self.client.showname != self.client.char_name: + for target in self.client.server.client_manager.clients: + if target.area.id == self.client.area.id: + target.send_command("PU", self.client.id, 2, self.client.showname) + self.client.send_command("PU", self.client.id, 2, self.client.showname) self.client.area.send_ic( client=self.client, From a7109683faafd1c8fe49a6fa3acaae1d42d67fc4 Mon Sep 17 00:00:00 2001 From: mastyra Date: Sun, 28 Dec 2025 22:45:40 -0500 Subject: [PATCH 6/7] Only update showname if it does not match char name. Send packet for OOC blank names --- server/client_manager.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/client_manager.py b/server/client_manager.py index 0e30d29c..c10f17e1 100644 --- a/server/client_manager.py +++ b/server/client_manager.py @@ -2319,14 +2319,17 @@ def new_client(self, transport): client.clientscon += 1 # 2.11 player list support c.send_command("PR", c.id, 0) + c.send_command("PU", c.id, 0, c.name) for target in self.server.client_manager.clients: if target.area.id == 0 and target.id != c.id: target.send_command("PR", c.id, 0) #register new client to others in lobby + target.send_command("PU", c.id, 0, c.name) #register name of new client to others in lobby c.send_command("PR", target.id, 0) #register others in lobby to new client c.send_command("PU", target.id, 0, target.name) #fetch names of others in lobby c.send_command("PU", target.id, 1, target.char_name) #fetch chars of others in lobby - c.send_command("PU", target.id, 2, target.showname) #fetch shownames of others in lobby + if target.showname != target.char_name: + c.send_command("PU", target.id, 2, target.showname) #fetch shownames of others in lobby c.send_command("PU", target.id, 3, target.area.id) #fetch area of others in lobby return c From c8a9574cc612de2982a8a331dfc42780d3688747 Mon Sep 17 00:00:00 2001 From: mastyra Date: Sun, 28 Dec 2025 22:47:59 -0500 Subject: [PATCH 7/7] Update client_manager.py --- server/client_manager.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/client_manager.py b/server/client_manager.py index c10f17e1..8463defc 100644 --- a/server/client_manager.py +++ b/server/client_manager.py @@ -1262,13 +1262,15 @@ def change_area(self, area, password=""): target.send_command("PR", self.id, 0) # add self to new area to other clients target.send_command("PU", self.id, 0, self.name) # send name to other clients target.send_command("PU", self.id, 1, self.char_name) # send char id to other clients - target.send_command("PU", self.id, 2, self.showname) # send showname to other clients + if self.showname != self.char_name: + target.send_command("PU", self.id, 2, self.showname) # send showname to other clients target.send_command("PU", self.id, 3, self.area.id) # send area id to other clients self.send_command("PR", target.id, 0) # add client from new area self.send_command("PU", target.id, 0, target.name) self.send_command("PU", target.id, 1, target.char_name) - self.send_command("PU", target.id, 2, target.showname) + if target.showname != target.char_name: + self.send_command("PU", target.id, 2, target.showname) self.send_command("PU", target.id, 3, target.area.id) self.send_command("PU", self.id, 3, self.area.id) # send area id to self