Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions Archipelago.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#define AP_OFFLINE_SLOT 1404
#define AP_OFFLINE_NAME "You"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have been John Doe :)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way, if there is a message and you construct for example, "target got item", you get " You got item" which i thought was funny :3

#define AP_RETRY_COUNT 5

//Setup Stuff
bool init = false;
Expand Down Expand Up @@ -147,11 +148,18 @@ void AP_Init(const char* ip, const char* game, const char* player_name, const ch
itr.second->status = AP_RequestStatus::Error;
map_server_data.erase(itr.first);
}
printf("AP: Error connecting to Archipelago. Retries: %d\n", msg->errorInfo.retries-1);
if (msg->errorInfo.retries-1 >= 2 && isSSL && !ssl_success) {
printf("AP: SSL connection failed. Attempting unencrypted...\n");
webSocket.setUrl("ws://" + ap_ip);
isSSL = false;
if (msg->errorInfo.retries >= AP_RETRY_COUNT)
{
refused = true;
}
else
{
printf("AP: Error connecting to Archipelago. Retries: %d\n", msg->errorInfo.retries-1);
if (msg->errorInfo.retries-1 >= 2 && isSSL && !ssl_success) {
printf("AP: SSL connection failed. Attempting unencrypted...\n");
webSocket.setUrl("ws://" + ap_ip);
isSSL = false;
}
}
}
}
Expand Down