[Scummvm-git-logs] scummvm master -> f93bbfd7cae334d242760f6d3681b4ae318fa981

sev- sev at scummvm.org
Tue Oct 29 01:08:51 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:
f93bbfd7ca SCUMM HE: MBC: Fixed empty packet check


Commit: f93bbfd7cae334d242760f6d3681b4ae318fa981
    https://github.com/scummvm/scummvm/commit/f93bbfd7cae334d242760f6d3681b4ae318fa981
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-10-29T00:08:19Z

Commit Message:
SCUMM HE: MBC: Fixed empty packet check

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 9091842..10a6544 100644
--- a/engines/scumm/he/moonbase/net_main.cpp
+++ b/engines/scumm/he/moonbase/net_main.cpp
@@ -338,8 +338,8 @@ int Net::remoteSendData(int typeOfSend, int sendTypeParam, int type, byte *data,
 	// I'd rather parse it
 	Common::String res = Common::String::format(
 		"{\"sessionid\":%d, \"userid\":%d, \"to\":%d, \"toparam\": %d, "
-		"\"type\":%d, \"timestamp\": %d, \"data\": [", _sessionid, _myUserId,
-		typeOfSend, sendTypeParam, type, g_system->getMillis());
+		"\"type\":%d, \"timestamp\": %d, \"size\": %d, \"data\": [", _sessionid, _myUserId,
+		typeOfSend, sendTypeParam, type, g_system->getMillis(), len);
 
 	for (int i = 0; i < len - 1; i++)
 		res += Common::String::format("%d, ", data[i]);
@@ -471,7 +471,7 @@ bool Net::remoteReceiveData() {
 		g_system->delayMillis(5);
 	}
 
-	if (!_packetdata)
+	if (!_packetdata || _packetdata->child("size")->asIntegerNumber() == 0)
 		return false;
 
 	uint from = _packetdata->child("from")->asIntegerNumber();





More information about the Scummvm-git-logs mailing list