Skip to content

Commit

Permalink
Attempt to fix weird multi crash
Browse files Browse the repository at this point in the history
  • Loading branch information
nico-abram committed Jul 16, 2018
1 parent 11aef92 commit ab642cc
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/NetworkSyncManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,27 +420,28 @@ bool ETTProtocol::Connect(NetworkSyncManager * n, unsigned short port, RString a
n->isSMOnline = false;
msgId = 0;
error = false;
uWSh->onDisconnection([this, n](uWS::WebSocket<uWS::CLIENT> *ws, int code, char *message, size_t length) {
this->ws = nullptr;
});
uWSh->onConnection([n, this, address](uWS::WebSocket<uWS::CLIENT> *ws, uWS::HttpRequest req) {
n->isSMOnline = true;
this->ws = ws;
LOG->Trace("Connected to ett server: %s", address.c_str());
});
uWSh->onError([this](void* ptr) {
this->error = true;
this->ws = nullptr;
});
uWSh->onHttpDisconnection([this](uWS::HttpSocket<true>* ptr) {
this->error = true;
this->ws = nullptr;
});
uWSh->onDisconnection([this](uWS::WebSocket<false> *, int code, char *message, size_t length) {
uWSh->onDisconnection([this](uWS::WebSocket<uWS::CLIENT> *, int code, char *message, size_t length) {
this->error = true;
this->errorMsg = string(message, length);
this->ws = nullptr;
});
uWSh->onDisconnection([this](uWS::WebSocket<true> *, int code, char *message, size_t length) {
uWSh->onDisconnection([this](uWS::WebSocket<uWS::SERVER> *, int code, char *message, size_t length) {
this->error = true;
this->errorMsg = string(message, length);
this->ws = nullptr;
});
uWSh->onMessage([this](uWS::WebSocket<uWS::CLIENT> *ws, char *message, size_t length, uWS::OpCode opCode) {
string msg(message, length);
Expand Down

0 comments on commit ab642cc

Please sign in to comment.