Major overall of data
This commit is contained in:
1 parent
64dbd02874
commit
6126b8259c
12 files changed
+160
-126
No files matched your search
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
|
||||
namespace Mistox.Server {
|
||||
|
||||
public class MistoxServer {
|
||||
public string ServerName { get; set; } = ""; // The name of the server
|
||||
public IPAddress BindAddress { get; set; } = IPAddress.Any; // What IP to bind on
|
||||
public int Port { get; set; } = 9126; // What Port to bind on
|
||||
public int MaxClients { get; set; } = 10; // The max players per server
|
||||
public bool Alive { get; set; } = true; // Is the server running
|
||||
|
||||
public event EventHandler onUserConnected;
|
||||
public void InvokeOnUserConnected(TcpClientConnection ConnectedUser){
|
||||
onUserConnected?.Invoke(ConnectedUser, new EventArgs());
|
||||
}
|
||||
public event EventHandler onReceived;
|
||||
public void InvokeOnReceived(dynamic DataPacket){
|
||||
onReceived?.Invoke(DataPacket, new EventArgs());
|
||||
}
|
||||
public event EventHandler onUserDisconnected;
|
||||
public void InvokeOnUserDisconnected(TcpClientConnection DisconnectedUser){
|
||||
onUserDisconnected?.Invoke(DisconnectedUser, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Numerics;
|
||||
|
||||
namespace Mistox.Server {
|
||||
public class TcpClientConnection {
|
||||
public string UserName { get; set; } = ""; // The Players UserName
|
||||
public bool IsAuthenticated { get; set; } = false; // Has the player authenticated
|
||||
public Vector3 Position { get; set; } // The ingame position of the player
|
||||
public float ConnectionRange { get; set; } // The ingame distance players need to be to be connected together
|
||||
public DateTime LastHeartbeat { get; set; } = DateTime.UtcNow; // Connection heartbeat for integrity
|
||||
public bool Connected { get; set; } = true; // Is the connection valid
|
||||
public IPAddress RemoteAddress { get; set; } // The remote users IP Address
|
||||
public TCPConnection Connection { get; set; } // The TCP Server Object
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user