Adapt for web
This commit is contained in:
1 parent
b59a10b7e6
commit
d883b58260
4 files changed
+10
-6
No files matched your search
+2
-2
@@ -95,10 +95,10 @@ namespace ZL
|
||||
#ifdef NETWORK
|
||||
#ifdef EMSCRIPTEN
|
||||
networkClient = std::make_unique<WebSocketClientEmscripten>();
|
||||
networkClient->Connect("192.168.131.143", 8081);
|
||||
networkClient->Connect("localhost", 8081);
|
||||
#else
|
||||
networkClient = std::make_unique<WebSocketClient>(taskManager.getIOContext());
|
||||
networkClient->Connect("127.0.0.1", 8081);
|
||||
networkClient->Connect("localhost", 8081);
|
||||
#endif
|
||||
#endif
|
||||
lastTickCount = 0;
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
namespace ZL {
|
||||
void WebSocketClientEmscripten::Connect(const std::string& host, uint16_t port) {
|
||||
// Формируем URL. Обратите внимание, что в Web часто лучше использовать ws://localhost
|
||||
//std::string url = "ws://" + host + ":" + std::to_string(port);
|
||||
std::string url = "wss://api.spacegame.fishrungames.com";
|
||||
std::string url = "ws://" + host + ":" + std::to_string(port);
|
||||
//std::string url = "wss://api.spacegame.fishrungames.com";
|
||||
|
||||
EmscriptenWebSocketCreateAttributes attr = {
|
||||
url.c_str(),
|
||||
|
||||
Reference in new issue
Block a user