SCUMM HE: MBC: Implement Net::disableSessionJoining()

This commit is contained in:
Eugene Sandulenko 2019-11-05 00:21:24 +01:00
parent 5268e582bf
commit 77ee206cd7
2 changed files with 24 additions and 1 deletions

View File

@ -228,7 +228,27 @@ void Net::endSessionErrorCallback(Networking::ErrorResponse error) {
void Net::disableSessionJoining() {
warning("STUB: Net::disableSessionJoining()"); // PN_DisableSessionPlayerJoin
debug(1, "Net::disableSessionJoining()"); // PN_DisableSessionPlayerJoin
Networking::PostRequest *rq = new Networking::PostRequest(_serverprefix + "/disablesession",
new Common::Callback<Net, Common::JSONValue *>(this, &Net::disableSessionJoiningCallback),
new Common::Callback<Net, Networking::ErrorResponse>(this, &Net::disableSessionJoiningErrorCallback));
char *buf = (char *)malloc(MAX_PACKET_SIZE);
snprintf(buf, MAX_PACKET_SIZE, "{\"sessionid\":%d}", _sessionid);
rq->setPostData((byte *)buf, strlen(buf));
rq->setContentType("application/json");
rq->start();
ConnMan.addRequest(rq);
}
void Net::disableSessionJoiningCallback(Common::JSONValue *response) {
}
void Net::disableSessionJoiningErrorCallback(Networking::ErrorResponse error) {
warning("Error in disableSessionJoining(): %ld %s", error.httpResponseCode, error.response.c_str());
}
void Net::enableSessionJoining() {

View File

@ -78,6 +78,9 @@ private:
void addUserCallback(Common::JSONValue *response);
void addUserErrorCallback(Networking::ErrorResponse error);
void disableSessionJoiningCallback(Common::JSONValue *response);
void disableSessionJoiningErrorCallback(Networking::ErrorResponse error);
void endSessionCallback(Common::JSONValue *response);
void endSessionErrorCallback(Networking::ErrorResponse error);