diff options
author | Alexander Tkachev | 2016-08-17 15:16:18 +0600 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-30 23:26:29 +0200 |
commit | c997612bfc0e12b04124ef11906d2104537dfbf7 (patch) | |
tree | 2700b6c201dadfead7da2f000f0d0fb0bba94d63 | |
parent | 0f82e2acdc594b96ca7016215f24b879336de6fd (diff) | |
download | scummvm-rg350-c997612bfc0e12b04124ef11906d2104537dfbf7.tar.gz scummvm-rg350-c997612bfc0e12b04124ef11906d2104537dfbf7.tar.bz2 scummvm-rg350-c997612bfc0e12b04124ef11906d2104537dfbf7.zip |
SCUMM HE: Add a few more logic kludges
-rw-r--r-- | engines/scumm/he/logic/moonbase_logic.cpp | 21 | ||||
-rw-r--r-- | engines/scumm/he/moonbase/net_main.cpp | 11 | ||||
-rw-r--r-- | engines/scumm/he/moonbase/net_main.h | 2 |
3 files changed, 25 insertions, 9 deletions
diff --git a/engines/scumm/he/logic/moonbase_logic.cpp b/engines/scumm/he/logic/moonbase_logic.cpp index bea5672b71..c8f01d983b 100644 --- a/engines/scumm/he/logic/moonbase_logic.cpp +++ b/engines/scumm/he/logic/moonbase_logic.cpp @@ -439,21 +439,23 @@ int LogicHEmoonbase::op_net_get_session_player_count(int op, int numArgs, int32 warning("STUB: op_net_get_session_player_count()"); return 1; } -int LogicHEmoonbase::op_net_destroy_player(int op, int numArgs, int32 *args) { - warning("STUB: op_net_destroy_player()"); - return 1; + +int LogicHEmoonbase::op_net_destroy_player(int op, int numArgs, int32 *args) { + return _vm1->_moonbase->_net->destroyPlayer(args[0]); } + int LogicHEmoonbase::op_net_get_player_long_name(int op, int numArgs, int32 *args) { - warning("STUB: op_net_get_player_long_name()"); - return 1; + return _vm1->setupStringArrayFromString("long name"); // TODO: gdefMultiPlay.playername1 } + int LogicHEmoonbase::op_net_get_player_short_name(int op, int numArgs, int32 *args) { - warning("STUB: op_net_get_player_short_name()"); - return 1; + return _vm1->setupStringArrayFromString("short"); // TODO: gdefMultiPlay.playername2 } + int LogicHEmoonbase::op_net_create_session(int op, int numArgs, int32 *args) { - warning("STUB: op_net_create_session()"); - return 1; + char name[MAX_SESSION_NAME]; + _vm1->getStringFromArray(args[0], name, sizeof(name)); + return _vm1->_moonbase->_net->createSession(name); } int LogicHEmoonbase::op_net_join_session(int op, int numArgs, int32 *args) { @@ -502,6 +504,7 @@ int LogicHEmoonbase::op_net_set_provider_by_name(int op, int numArgs, int32 *arg // Parameter 2 is the (optional) tcp/ip address return _vm1->_moonbase->_net->setProviderByName(args[0], args[1]); } + void LogicHEmoonbase::op_net_set_fake_latency(int op, int numArgs, int32 *args) { _vm1->_moonbase->_net->setFakeLatency(args[0]); } diff --git a/engines/scumm/he/moonbase/net_main.cpp b/engines/scumm/he/moonbase/net_main.cpp index fb835ebfd4..3835a78e83 100644 --- a/engines/scumm/he/moonbase/net_main.cpp +++ b/engines/scumm/he/moonbase/net_main.cpp @@ -60,6 +60,11 @@ int Net::whoAmI() { return 0; } +int Net::createSession(char *name) { + warning("STUB: Net::createSession(\"%s\")", name); // PN_CreateSession + return 0; +} + int Net::joinSession(int sessionIndex) { warning("STUB: Net::joinSession(%d)", sessionIndex); // PN_JoinSession return 0; @@ -93,6 +98,12 @@ void Net::setFakeLatency(int time) { _fakeLatency = true; } +bool Net::destroyPlayer(int32 playerDPID) { + // bool PNETWIN_destroyplayer(DPID idPlayer) + warning("STUB: Net::destroyPlayer(%d)", playerDPID); + return false; +} + 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 41dc45a14b..22e9982cb9 100644 --- a/engines/scumm/he/moonbase/net_main.h +++ b/engines/scumm/he/moonbase/net_main.h @@ -39,6 +39,7 @@ public: int removeUser(); int whoSentThis(); int whoAmI(); + int createSession(char *name); int joinSession(int sessionIndex); int endSession(); void disableSessionJoining(); @@ -46,6 +47,7 @@ public: void setBotsCount(int botsCount); int32 setProviderByName(int32 parameter1, int32 parameter2); void setFakeLatency(int time); + bool destroyPlayer(int32 playerDPID); private: |