aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/he
diff options
context:
space:
mode:
authorEugene Sandulenko2019-10-24 00:04:38 +0200
committerEugene Sandulenko2019-10-24 00:15:33 +0200
commit2c5ae963561eead1dcfdd5885e1f1ebc8d9293eb (patch)
tree910e6368678f2cdbcf9bdb7d19d837ca511e27e5 /engines/scumm/he
parent22ba110e829d62af3e014b0a73a7155aa6bbbe3c (diff)
downloadscummvm-rg350-2c5ae963561eead1dcfdd5885e1f1ebc8d9293eb.tar.gz
scummvm-rg350-2c5ae963561eead1dcfdd5885e1f1ebc8d9293eb.tar.bz2
scummvm-rg350-2c5ae963561eead1dcfdd5885e1f1ebc8d9293eb.zip
SCUMM HE: Hook in PostRequest to Moonbase Commander
Diffstat (limited to 'engines/scumm/he')
-rw-r--r--engines/scumm/he/moonbase/net_main.cpp16
-rw-r--r--engines/scumm/he/moonbase/net_main.h5
2 files changed, 21 insertions, 0 deletions
diff --git a/engines/scumm/he/moonbase/net_main.cpp b/engines/scumm/he/moonbase/net_main.cpp
index c0b4b4c364..48fb044412 100644
--- a/engines/scumm/he/moonbase/net_main.cpp
+++ b/engines/scumm/he/moonbase/net_main.cpp
@@ -151,10 +151,26 @@ bool Net::destroyPlayer(int32 playerDPID) {
int32 Net::startQuerySessions() {
warning("STUB: Net::startQuerySessions()"); // StartQuerySessions
+ Networking::PostRequest rq("http://localhost/lobbies", NULL, 0,
+ new Common::Callback<Net, Common::JSONValue *>(this, &Net::startQuerySessionsCallback),
+ new Common::Callback<Net, Networking::ErrorResponse>(this, &Net::startQuerySessionsErrorCallback));
+
+ while(rq.state() == Networking::PROCESSING) {
+ g_system->delayMillis(5);
+ }
+
// FAKE 1 session. FIXME
return 1;
}
+void Net::startQuerySessionsCallback(Common::JSONValue *response) {
+ warning("Got: '%s'", response->stringify().c_str());
+}
+
+void Net::startQuerySessionsErrorCallback(Networking::ErrorResponse error) {
+ warning("Error in startQuerySessions()");
+}
+
int32 Net::updateQuerySessions() {
warning("STUB: Net::updateQuerySessions()"); // UpdateQuerySessions
return startQuerySessions();
diff --git a/engines/scumm/he/moonbase/net_main.h b/engines/scumm/he/moonbase/net_main.h
index 1d6af49ea3..54d1298b60 100644
--- a/engines/scumm/he/moonbase/net_main.h
+++ b/engines/scumm/he/moonbase/net_main.h
@@ -23,6 +23,8 @@
#ifndef SCUMM_HE_MOONBASE_NET_MAIN_H
#define SCUMM_HE_MOONBASE_NET_MAIN_H
+#include "backends/networking/curl/postrequest.h"
+
namespace Scumm {
class ScummEngine_v100he;
@@ -69,6 +71,9 @@ private:
int getMessageCount();
void remoteReceiveData();
+ void startQuerySessionsCallback(Common::JSONValue *response);
+ void startQuerySessionsErrorCallback(Networking::ErrorResponse error);
+
public:
//getters
bool getHostName(char *hostname, int length);