Shrink packet header size
This commit is contained in:
1 parent
c3906e7d60
commit
7b58ca0338
10 files changed
+140
-115
No files matched your search
@@ -3,12 +3,15 @@ using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MistoxServer {
|
||||
public partial class mServer {
|
||||
public static IMistoxServer newServer(int port, ServerMode mode) {
|
||||
return new ServerInterface(port, mode);
|
||||
public class mServer {
|
||||
|
||||
public static IMistoxServer newServer(int port) {
|
||||
DataPacket.BuildNetworkPacketList();
|
||||
return new ServerInterface(port);
|
||||
}
|
||||
|
||||
public static IMistoxServer newClient(string ServerIPOrHostName, int Port) {
|
||||
DataPacket.BuildNetworkPacketList();
|
||||
int index = 0;
|
||||
IPAddress[] remoteAddress = Dns.GetHostAddresses(ServerIPOrHostName);
|
||||
for( int i=0; i< remoteAddress.Length; i++ ) {
|
||||
@@ -24,17 +27,16 @@ namespace MistoxServer {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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 {
|
||||
@@ -42,9 +44,4 @@ namespace MistoxServer {
|
||||
FastUpdate
|
||||
}
|
||||
|
||||
public enum ServerMode {
|
||||
Passive,
|
||||
Authoritative
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user