diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/scumm/he/moonbase/net_main.cpp | 16 | ||||
-rw-r--r-- | engines/scumm/he/moonbase/net_main.h | 5 |
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); |