[Scummvm-git-logs] scummvm master -> 6e8cb70833f3daa6da3fd2006df14ed52b790720

LittleToonCat noreply at scummvm.org
Fri Nov 24 02:04:17 UTC 2023


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:
6e8cb70833 HE SCUMM: Implement SET_POLL_ANSWER.


Commit: 6e8cb70833f3daa6da3fd2006df14ed52b790720
    https://github.com/scummvm/scummvm/commit/6e8cb70833f3daa6da3fd2006df14ed52b790720
Author: Little Cat (toontownlittlecat at gmail.com)
Date: 2023-11-23T22:04:00-04:00

Commit Message:
HE SCUMM: Implement SET_POLL_ANSWER.

Changed paths:
    engines/scumm/he/net/net_lobby.cpp
    engines/scumm/he/net/net_lobby.h


diff --git a/engines/scumm/he/net/net_lobby.cpp b/engines/scumm/he/net/net_lobby.cpp
index 7147554aa19..7ab07911fb2 100644
--- a/engines/scumm/he/net/net_lobby.cpp
+++ b/engines/scumm/he/net/net_lobby.cpp
@@ -274,6 +274,9 @@ int32 Lobby::dispatch(int op, int numArgs, int32 *args) {
 	case OP_NET_GET_POPULATION:
 		getPopulation(args[0], args[1]);
 		break;
+	case OP_NET_SET_POLL_ANSWER:
+		setPollAnswer(args[0]);
+		break;
 	case OP_NET_UNKNOWN_2229:
 		// TODO
 		break;
@@ -568,6 +571,16 @@ void Lobby::setIcon(int icon) {
 	send(setIconRequest);
 }
 
+void Lobby::setPollAnswer(int pollAnswer) {
+	if (!_socket)
+		return;
+
+	Common::JSONObject setPollAnswerRequest;
+	setPollAnswerRequest.setVal("cmd", new Common::JSONValue("set_poll_answer"));
+	setPollAnswerRequest.setVal("answer", new Common::JSONValue((long long int)pollAnswer));
+	send(setPollAnswerRequest);
+}
+
 void Lobby::sendGameResults(int userId, int arrayIndex, int lastFlag) {
 	if (!_socket) {
 		return;
diff --git a/engines/scumm/he/net/net_lobby.h b/engines/scumm/he/net/net_lobby.h
index e0a87f18422..ec18ea1c14c 100644
--- a/engines/scumm/he/net/net_lobby.h
+++ b/engines/scumm/he/net/net_lobby.h
@@ -58,6 +58,7 @@
 #define OP_NET_UPDATE_PROFILE_ARRAY				2225
 #define OP_NET_LOCATE_PLAYER					2226
 #define OP_NET_GET_POPULATION					2227
+#define OP_NET_SET_POLL_ANSWER					2228
 #define OP_NET_UNKNOWN_2229						2229
 // Used in baseball to get news, poll and banner.
 #define OP_NET_DOWNLOAD_FILE					2238
@@ -138,6 +139,8 @@ protected:
 	void handleFileData(Common::String filename, Common::String data);
 
 	void setIcon(int icon);
+	void setPollAnswer(int pollAnswer);
+
 	void sendGameResults(int userId, int arrayIndex, int lastFlag);
 
 	void getPopulation(int areaId, int unknown);




More information about the Scummvm-git-logs mailing list