Put IComm.WebSockets and Lua comm.ws_* behind #ifdef ENABLE_WEBSOCKETS
Not confident in the API shape, especially for ApiHawk
This commit is contained in:
parent
c137252211
commit
3179dc8ebe
|
@ -10,7 +10,9 @@ namespace BizHawk.Client.Common
|
|||
|
||||
SocketServer? Sockets { get; }
|
||||
|
||||
#if ENABLE_WEBSOCKETS
|
||||
WebSocketServer? WebSockets { get; }
|
||||
#endif
|
||||
|
||||
string? HttpTest();
|
||||
|
||||
|
|
|
@ -247,6 +247,7 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
}
|
||||
|
||||
#if ENABLE_WEBSOCKETS
|
||||
[LuaMethod("ws_open", "Opens a websocket and returns the id so that it can be retrieved later.")]
|
||||
[LuaMethodExample("local ws_id = comm.ws_open(\"wss://echo.websocket.org\");")]
|
||||
public string WebSocketOpen(string uri)
|
||||
|
@ -287,5 +288,6 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
if (_websockets.TryGetValue(Guid.Parse(guid), out var wrapper)) wrapper.Close(status, closeMessage);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue