Chage remoteAddress to mUDPClient
This commit is contained in:
1 parent
d3d437b0c8
commit
873a6fa455
3 files changed
+4
-9
No files matched your search
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using Mistox.ResevedPackets;
|
||||
@@ -62,7 +61,7 @@ namespace Mistox.Client {
|
||||
/////////////////////////////
|
||||
|
||||
public event Action<dynamic> onDataReceived;
|
||||
public void InvokeOnReceived(dynamic DataPacket, IPEndPoint remote = null){
|
||||
public void InvokeOnReceived(dynamic DataPacket, mUDPClient remote = null){
|
||||
switch (DataPacket as object) {
|
||||
case UserConnectedPacket packet:
|
||||
UserConnected(packet);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -42,11 +41,8 @@ namespace Mistox.Client {
|
||||
// Extract the object
|
||||
dynamic buildObj = DataPacket.Deserialize( dataType, DataLength, data );
|
||||
|
||||
// Map the IPEndPoint to a user
|
||||
IPEndPoint endpoint = udpPacket.RemoteEndPoint;
|
||||
|
||||
// Return the object
|
||||
_parent.InvokeOnReceived( buildObj, udpPacket.RemoteEndPoint );
|
||||
_parent.InvokeOnReceived( buildObj, client );
|
||||
|
||||
}
|
||||
} catch( Exception e ) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
0. Messages sent from clients to clients or clients to the server dont have any information about who it came from on the receiving side?
|
||||
Probably need to route the event handlers throught the client objects to be able to pull that information off of the packets as well.
|
||||
Make a username -> connectionID dictionary for quick lookups instaed of using foreach loops with breaks.
|
||||
|
||||
1. Allow the server to setup a server name
|
||||
2. Allow the client to setup a user name
|
||||
3. Have the client connect to the server with a welcome packet
|
||||
|
||||
Reference in new issue
Block a user