diff options
author | Alexander Tkachev | 2016-08-17 15:25:48 +0600 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-30 23:26:29 +0200 |
commit | e70522e506cdeb4a0bb1d9deafe2f8062a9bd47e (patch) | |
tree | 64a53205c68f544d9ea699d6584960cb2c711e85 | |
parent | c997612bfc0e12b04124ef11906d2104537dfbf7 (diff) | |
download | scummvm-rg350-e70522e506cdeb4a0bb1d9deafe2f8062a9bd47e.tar.gz scummvm-rg350-e70522e506cdeb4a0bb1d9deafe2f8062a9bd47e.tar.bz2 scummvm-rg350-e70522e506cdeb4a0bb1d9deafe2f8062a9bd47e.zip |
SCUMM HE: Add session-related kludges
-rw-r--r-- | engines/scumm/he/logic/moonbase_logic.cpp | 10 | ||||
-rw-r--r-- | engines/scumm/he/moonbase/net_main.cpp | 11 | ||||
-rw-r--r-- | engines/scumm/he/moonbase/net_main.h | 3 |
3 files changed, 19 insertions, 5 deletions
diff --git a/engines/scumm/he/logic/moonbase_logic.cpp b/engines/scumm/he/logic/moonbase_logic.cpp index c8f01d983b..d425b5ad58 100644 --- a/engines/scumm/he/logic/moonbase_logic.cpp +++ b/engines/scumm/he/logic/moonbase_logic.cpp @@ -431,13 +431,15 @@ int LogicHEmoonbase::op_net_query_sessions(int op, int numArgs, int32 *args) { warning("STUB: op_net_query_sessions()"); return 1; } + int LogicHEmoonbase::op_net_get_session_name(int op, int numArgs, int32 *args) { - warning("STUB: op_net_get_session_name()"); - return 1; + char name[MAX_PROVIDER_NAME]; + _vm1->_moonbase->_net->getSessionName(args[0] - 1, name, sizeof(name)); + return _vm1->setupStringArrayFromString(name); } + int LogicHEmoonbase::op_net_get_session_player_count(int op, int numArgs, int32 *args) { - warning("STUB: op_net_get_session_player_count()"); - return 1; + return _vm1->_moonbase->_net->getSessionPlayerCount(args[0] - 1); } int LogicHEmoonbase::op_net_destroy_player(int op, int numArgs, int32 *args) { diff --git a/engines/scumm/he/moonbase/net_main.cpp b/engines/scumm/he/moonbase/net_main.cpp index 3835a78e83..1f2e094df0 100644 --- a/engines/scumm/he/moonbase/net_main.cpp +++ b/engines/scumm/he/moonbase/net_main.cpp @@ -114,4 +114,15 @@ bool Net::getIPfromName(char *ip, int ipLength, char *nameBuffer) { return false; } +void Net::getSessionName(int sessionNumber, char *buffer, int length) { + warning("STUB: Net::getSessionPlayerCount(%d, \"%s\", %d)", sessionNumber, buffer, length); // PN_GetSessionName +} + +int Net::getSessionPlayerCount(int sessionNumber) { + warning("STUB: Net::getSessionPlayerCount(%d)", sessionNumber); // case GET_SESSION_PLAYER_COUNT_KLUDGE: + //assert(sessionNumber >= 0 && sessionNumber < NUMELEMENTS(gdefMultiPlay.gamedescptr)); + //return gdefMultiPlay.gamedescptr[sessionNumber].currentplayers; + return 0; +} + } // End of namespace Scumm diff --git a/engines/scumm/he/moonbase/net_main.h b/engines/scumm/he/moonbase/net_main.h index 22e9982cb9..949332a8d4 100644 --- a/engines/scumm/he/moonbase/net_main.h +++ b/engines/scumm/he/moonbase/net_main.h @@ -55,7 +55,8 @@ public: //getters bool getHostName(char *hostname, int length); bool getIPfromName(char *ip, int ipLength, char *nameBuffer); - + void getSessionName(int sessionNumber, char *buffer, int length); + int getSessionPlayerCount(int sessionNumber); private: //mostly getters |