Rework the server connection to be more structured
This commit is contained in:
1 parent
7b58ca0338
commit
64dbd02874
10 files changed
+139
-141
No files matched your search
@@ -1,16 +1,15 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MistoxServer {
|
||||
namespace Mistox {
|
||||
public class mServer {
|
||||
|
||||
public static IMistoxServer newServer(int port) {
|
||||
public static ServerInterface newServer(int port, string serverName) {
|
||||
DataPacket.BuildNetworkPacketList();
|
||||
return new ServerInterface(port);
|
||||
return new ServerInterface(port, serverName);
|
||||
}
|
||||
|
||||
public static IMistoxServer newClient(string ServerIPOrHostName, int Port) {
|
||||
public static ClientInterface newClient(string ServerIPOrHostName, int Port) {
|
||||
DataPacket.BuildNetworkPacketList();
|
||||
int index = 0;
|
||||
IPAddress[] remoteAddress = Dns.GetHostAddresses(ServerIPOrHostName);
|
||||
@@ -30,18 +29,4 @@ namespace MistoxServer {
|
||||
|
||||
}
|
||||
|
||||
public interface IMistoxServer {
|
||||
public event EventHandler onConnected;
|
||||
public event EventHandler onSlowReceive;
|
||||
public event EventHandler onFastReceive;
|
||||
public event EventHandler onDisconnected;
|
||||
|
||||
public Task Send<Packet>(Packet data, SendType speed);
|
||||
}
|
||||
|
||||
public enum SendType {
|
||||
SlowUpdate,
|
||||
FastUpdate
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user