[Scummvm-git-logs] scummvm master -> 53db8dc5ff8d7276d635bc12766f494e7b7a9030

sev- sev at scummvm.org
Fri Nov 1 00:29:28 CET 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
53db8dc5ff SCUMM HE: MBC: Read script params from the JSON packets


Commit: 53db8dc5ff8d7276d635bc12766f494e7b7a9030
    https://github.com/scummvm/scummvm/commit/53db8dc5ff8d7276d635bc12766f494e7b7a9030
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-11-01T00:29:11+01:00

Commit Message:
SCUMM HE: MBC: Read script params from the JSON packets

Changed paths:
    engines/scumm/he/moonbase/net_main.cpp


diff --git a/engines/scumm/he/moonbase/net_main.cpp b/engines/scumm/he/moonbase/net_main.cpp
index dbed749..4df7dd6 100644
--- a/engines/scumm/he/moonbase/net_main.cpp
+++ b/engines/scumm/he/moonbase/net_main.cpp
@@ -497,22 +497,16 @@ bool Net::remoteReceiveData() {
 	uint from = _packetdata->child("from")->asIntegerNumber();
 	uint type = _packetdata->child("type")->asIntegerNumber();
 
-	int datalen = _packetdata->child("data")->asArray().size();
-	for (uint i = 0; i < datalen; i++) {
-		_packbuffer[i] = _packetdata->child("data")->asArray()[i]->asIntegerNumber();
-	}
-
-	Common::MemoryReadStream pack(_packbuffer, datalen);
-
 	uint32 *params;
 
 	switch (type) {
 	case PACKETTYPE_REMOTESTARTSCRIPT:
 		{
+			int datalen = _packetdata->child("data")->child("params")->asArray().size();
 			params = (uint32 *)_tmpbuffer;
 
-			for (int i = 0; i < 24; i++) {
-				*params = pack.readUint32LE();
+			for (int i = 0; i < datalen; i++) {
+				*params = _packetdata->child("data")->child("params")->asArray()[i]->asIntegerNumber();
 				params++;
 			}
 
@@ -522,10 +516,11 @@ bool Net::remoteReceiveData() {
 
 	case PACKETTYPE_REMOTESTARTSCRIPTRETURN:
 		{
+			int datalen = _packetdata->child("data")->child("params")->asArray().size();
 			params = (uint32 *)_tmpbuffer;
 
-			for (int i = 0; i < 24; i++) {
-				*params = pack.readUint32LE();
+			for (int i = 0; i < datalen; i++) {
+				*params = _packetdata->child("data")->child("params")->asArray()[i]->asIntegerNumber();
 				params++;
 			}
 
@@ -553,7 +548,7 @@ bool Net::remoteReceiveData() {
 			// and unpack it into an scumm array :-)
 
 			newArray = _vm->findFreeArrayId();
-			unpackageArray(newArray, _packbuffer, datalen);
+			//unpackageArray(newArray, _packbuffer, datalen);
 			memset(_tmpbuffer, 0, 25 * 4);
 			WRITE_UINT32(_tmpbuffer, newArray);
 





More information about the Scummvm-git-logs mailing list