From da35b451d6b7f5f2289b6991b642ec9852b726f6 Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Wed, 17 Aug 2016 14:43:53 +0600 Subject: SCUMM HE: Add more LogicHEmoonbase kludges Less stubs there, more stubs in Net. --- engines/scumm/he/logic/moonbase_logic.cpp | 21 ++++++++++++--------- engines/scumm/he/moonbase/net_main.cpp | 22 ++++++++++++++++++++++ engines/scumm/he/moonbase/net_main.h | 7 ++++++- 3 files changed, 40 insertions(+), 10 deletions(-) (limited to 'engines/scumm') diff --git a/engines/scumm/he/logic/moonbase_logic.cpp b/engines/scumm/he/logic/moonbase_logic.cpp index 9c2145d0f6..1e18b6030f 100644 --- a/engines/scumm/he/logic/moonbase_logic.cpp +++ b/engines/scumm/he/logic/moonbase_logic.cpp @@ -455,24 +455,27 @@ int LogicHEmoonbase::op_net_create_session(int op, int numArgs, int32 *args) { warning("STUB: op_net_create_session()"); return 1; } + int LogicHEmoonbase::op_net_join_session(int op, int numArgs, int32 *args) { - warning("STUB: op_net_join_session()"); - return 1; + return _vm1->_moonbase->_net->joinSession(args[0] - 1); } + int LogicHEmoonbase::op_net_end_session(int op, int numArgs, int32 *args) { - warning("STUB: op_net_end_session()"); - return 1; + return _vm1->_moonbase->_net->endSession(); } + int LogicHEmoonbase::op_net_disable_session_player_join(int op, int numArgs, int32 *args) { - warning("STUB: op_net_disable_session_player_join()"); + _vm1->_moonbase->_net->disableSessionJoining(); return 1; } + int LogicHEmoonbase::op_net_enable_session_player_join(int op, int numArgs, int32 *args) { - warning("STUB: op_net_enable_session_player_join()"); + _vm1->_moonbase->_net->enableSessionJoining(); return 1; } + int LogicHEmoonbase::op_net_set_ai_player_count(int op, int numArgs, int32 *args) { - warning("STUB: op_net_set_ai_player_count()"); + _vm1->_moonbase->_net->setBotsCount(args[0]); return 1; } @@ -507,7 +510,7 @@ void LogicHEmoonbase::op_net_set_fake_latency(int op, int numArgs, int32 *args) int LogicHEmoonbase::op_net_get_host_name(int op, int numArgs, int32 *args) { char name[MAX_HOSTNAME_SIZE]; - if (_vm1->_moonbase->_net->getHostName(name, MAX_HOSTNAME_SIZE)) { // PN_GetHostName + if (_vm1->_moonbase->_net->getHostName(name, MAX_HOSTNAME_SIZE)) { return _vm1->setupStringArrayFromString(name); } @@ -520,7 +523,7 @@ int LogicHEmoonbase::op_net_get_ip_from_name(int op, int numArgs, int32 *args) { char ip[MAX_IP_SIZE]; - if (_vm1->_moonbase->_net->getIPfromName(ip, MAX_IP_SIZE, name)) { // PN_GetIPfromName + if (_vm1->_moonbase->_net->getIPfromName(ip, MAX_IP_SIZE, name)) { return _vm1->setupStringArrayFromString(ip); } diff --git a/engines/scumm/he/moonbase/net_main.cpp b/engines/scumm/he/moonbase/net_main.cpp index 2d92313b1d..3d251266d1 100644 --- a/engines/scumm/he/moonbase/net_main.cpp +++ b/engines/scumm/he/moonbase/net_main.cpp @@ -60,6 +60,28 @@ int Net::whoAmI() { return 0; } +int Net::joinSession(int sessionIndex) { + warning("STUB: Net::joinSession(%d)", sessionIndex); // PN_JoinSession + return 0; +} + +int Net::endSession() { + warning("STUB: Net::endSession()"); // PN_EndSession + return 0; +} + +void Net::disableSessionJoining() { + warning("STUB: Net::disableSessionJoining()"); // PN_DisableSessionPlayerJoin +} + +void Net::enableSessionJoining() { + warning("STUB: Net::enableSessionJoining()"); // PN_EnableSessionPlayerJoin +} + +void Net::setBotsCount(int botsCount) { + warning("STUB: Net::setBotsCount(%d)", botsCount); // PN_SetAIPlayerCountKludge +} + bool Net::getHostName(char *hostname, int length) { warning("STUB: Net::getHostName(\"%s\", %d)", hostname, length); // PN_GetHostName return false; diff --git a/engines/scumm/he/moonbase/net_main.h b/engines/scumm/he/moonbase/net_main.h index 8b555942dd..fb7dffe0ac 100644 --- a/engines/scumm/he/moonbase/net_main.h +++ b/engines/scumm/he/moonbase/net_main.h @@ -39,7 +39,12 @@ public: int removeUser(); int whoSentThis(); int whoAmI(); - + int joinSession(int sessionIndex); + int endSession(); + void disableSessionJoining(); + void enableSessionJoining(); + void setBotsCount(int botsCount); + private: public: -- cgit v1.2.3