Transport.ServerStartWebsockets wrapper

This commit is contained in:
vis2k 2018-08-20 18:30:47 +02:00
parent 8c5dd5c332
commit a2579dc7a8
3 changed files with 7 additions and 2 deletions

View File

@ -123,8 +123,8 @@ static internal bool InternalListen(string ipAddress, int serverPort, int maxCon
if (s_UseWebSockets) if (s_UseWebSockets)
{ {
// TODO Transport.layer.ServerStartWebsockets(ipAddress, serverPort, maxConnections);
Debug.LogWarning("TODO Transport.StartWebGL?"); s_ServerHostId = 0; // so it doesn't return false
} }
else else
{ {

View File

@ -29,6 +29,7 @@ public interface TransportLayer
// server // server
bool ServerActive(); bool ServerActive();
void ServerStart(string address, int port, int maxConnections); void ServerStart(string address, int port, int maxConnections);
void ServerStartWebsockets(string address, int port, int maxConnections);
bool ServerSend(int connectionId, byte[] data); bool ServerSend(int connectionId, byte[] data);
bool ServerGetNextMessage(out int connectionId, out TransportEvent transportEvent, out byte[] data); bool ServerGetNextMessage(out int connectionId, out TransportEvent transportEvent, out byte[] data);
bool GetConnectionInfo(int connectionId, out string address); bool GetConnectionInfo(int connectionId, out string address);

View File

@ -55,6 +55,10 @@ public bool ClientGetNextMessage(out TransportEvent transportEvent, out byte[] d
// server // server
public bool ServerActive() { return server.Active; } public bool ServerActive() { return server.Active; }
public void ServerStart(string address, int port, int maxConnections) { server.Start(port, maxConnections); } public void ServerStart(string address, int port, int maxConnections) { server.Start(port, maxConnections); }
public void ServerStartWebsockets(string address, int port, int maxConnections)
{
Debug.LogWarning("TelepathyTransport.ServerStartWebsockets not implemented yet!");
}
public bool ServerSend(int connectionId, byte[] data) { return server.Send(connectionId, data); } public bool ServerSend(int connectionId, byte[] data) { return server.Send(connectionId, data); }
public bool ServerGetNextMessage(out int connectionId, out TransportEvent transportEvent, out byte[] data) public bool ServerGetNextMessage(out int connectionId, out TransportEvent transportEvent, out byte[] data)
{ {