summaryrefslogtreecommitdiff
path: root/protocols/Steam/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Steam/src')
-rw-r--r--protocols/Steam/src/steam_proto.h1
-rw-r--r--protocols/Steam/src/steam_ws.cpp41
2 files changed, 15 insertions, 27 deletions
diff --git a/protocols/Steam/src/steam_proto.h b/protocols/Steam/src/steam_proto.h
index 70a00da312..67bd990529 100644
--- a/protocols/Steam/src/steam_proto.h
+++ b/protocols/Steam/src/steam_proto.h
@@ -164,7 +164,6 @@ class CSteamProto : public PROTO<CSteamProto>
void* GetRequestInfo(uint64_t);
void __cdecl ServerThread(void *);
- bool ServerThreadStub(const char *szHost);
void ProcessMulti(const uint8_t *buf, size_t cbLen);
void ProcessMessage(const uint8_t *buf, size_t cbLen);
diff --git a/protocols/Steam/src/steam_ws.cpp b/protocols/Steam/src/steam_ws.cpp
index 41acb5efbb..85c4ee5f33 100644
--- a/protocols/Steam/src/steam_ws.cpp
+++ b/protocols/Steam/src/steam_ws.cpp
@@ -34,43 +34,32 @@ void __cdecl CSteamProto::ServerThread(void *)
m_ws = nullptr;
CMStringA szHost;
- do {
- szHost.Format("Host%d", rand() % iHostCount);
- szHost = db_get_sm(0, MODULENAME, szHost);
- szHost.Insert(0, "wss://");
- szHost += "/cmsocket/";
- }
- while (ServerThreadStub(szHost));
-}
+ szHost.Format("Host%d", rand() % iHostCount);
+ szHost = db_get_sm(0, MODULENAME, szHost);
+ szHost.Insert(0, "wss://");
+ szHost += "/cmsocket/";
-bool CSteamProto::ServerThreadStub(const char *szHost)
-{
WebSocket<CSteamProto> ws(this);
NLHR_PTR pReply(ws.connect(m_hNetlibUser, szHost));
- if (pReply == nullptr) {
- debugLogA("websocket connection failed");
- return false;
- }
+ if (pReply) {
+ if (pReply->resultCode == 101) {
+ m_ws = &ws;
- if (pReply->resultCode != 101) {
- debugLogA("websocket connection failed: %d", pReply->resultCode);
- return false;
- }
+ debugLogA("Websocket connection succeeded");
- m_ws = &ws;
+ // Send init packets
+ Login();
- debugLogA("Websocket connection succeeded");
-
- // Send init packets
- Login();
-
- ws.run();
+ ws.run();
+ }
+ else debugLogA("websocket connection failed: %d", pReply->resultCode);
+ }
+ else debugLogA("websocket connection failed");
Logout();
m_impl.m_heartBeat.Stop();
m_ws = nullptr;
- return false;
}
/////////////////////////////////////////////////////////////////////////////////////////