Split out the UDP listener for a single instance

This commit is contained in:
derek.holloway committed 2026-07-10 14:24:24 -07:00
1 parent 6931846a64
commit d3d437b0c8
5 files changed
+127 -68

No files matched your search

+7 -2
View File
@@ -36,13 +36,18 @@ namespace Mistox {
}
public async Task SendAllClients<Packet>(Packet data) {
foreach(KeyValuePair<string, mUDPClient> cur in serverInstance.clientConnections){
foreach( KeyValuePair<UInt128, mUDPClient> cur in serverInstance.clientConnections ){
await cur.Value.Send( data );
}
}
public async Task SendClient<Packet>(string UserName, Packet data) {
await serverInstance.clientConnections[UserName].Send( data );
foreach( KeyValuePair<UInt128, mUDPClient> cur in serverInstance.clientConnections) {
if (cur.Value.UserName.ToLower() == UserName.ToLower()) {
await cur.Value.Send( data );
break;
}
}
}
public async Task SendServer<Packet>(Packet data) {