Split out the UDP listener for a single instance
This commit is contained in:
1 parent
6931846a64
commit
d3d437b0c8
5 files changed
+127
-68
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user