aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/he/moonbase/net_main.cpp22
-rw-r--r--engines/scumm/he/moonbase/net_main.h3
2 files changed, 24 insertions, 1 deletions
diff --git a/engines/scumm/he/moonbase/net_main.cpp b/engines/scumm/he/moonbase/net_main.cpp
index f93f018ef8..4645f30c70 100644
--- a/engines/scumm/he/moonbase/net_main.cpp
+++ b/engines/scumm/he/moonbase/net_main.cpp
@@ -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() {
diff --git a/engines/scumm/he/moonbase/net_main.h b/engines/scumm/he/moonbase/net_main.h
index c23a0b0c0c..31dba6730f 100644
--- a/engines/scumm/he/moonbase/net_main.h
+++ b/engines/scumm/he/moonbase/net_main.h
@@ -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);