Friday, July 28, 2023

update goldberg_emulator and dependent ports to Steam SDK 1.57, including GodotSteam (in godot port)

Hi,

This diff updates goldberg_emulator to a recent checkout that
implements Steam SDK 1.56/1.57. At lease most of it - it seems that
isteamdualsense.h is referenced, but not included at this point
(relevant parts are stubbed).

Other ports depend on the API provided by goldberg, specifically
libcsteamworks, hlsteam, and godot as the latter builds with the
GodotSteam module.

I tested the result with the following games that use Steam SDK API:

- Brotato (godot)
- Salt and Sanctuary (libcsteamworks)
- Glitchangels (libcsteamworks)
- Northgard (hlsteam)

Would appreciate op@'s look if everyting with godot and the update
of the GodotSteam version look ok... some change to the case in the
directory was needed for this to pick up the right function names due
to the build system auto-generating some stuff there.

comments? oks? (as these are niche ports, I intend to commit the
updates if the godot part is ok with op@ if I don't hear back about the
rest...)

Index: goldberg_emulator/Makefile
===================================================================
RCS file: /cvs/ports/games/goldberg_emulator/Makefile,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile
--- goldberg_emulator/Makefile 10 Oct 2022 18:36:02 -0000 1.5
+++ goldberg_emulator/Makefile 28 Jul 2023 19:17:16 -0000
@@ -1,14 +1,14 @@
COMMENT = emulator for Steam online features

-# commit from 2022-09-06
-GL_V = 0.2.5pl2
+# commit from 2023-05-08
+GL_V = 0.2.5pl3
GL_ACCOUNT = Mr_Goldberg
GL_PROJECT = goldberg_emulator
-GL_COMMIT = 802d8bcc8fc33fed263b98590373a3bacaa19a9c
+GL_COMMIT = 475342f0d8b2bd7eb0d93bd7cfdd61e3ae7cda24
DISTNAME = ${GL_PROJECT}-${GL_V}{${GL_COMMIT}}
PKGNAME = ${GL_PROJECT}-${GL_V}

-SHARED_LIBS += steam_api 2.0 # 2022-08-05 (sdk 1.55)
+SHARED_LIBS += steam_api 3.0 # 2023-05-08 (sdk 1.57)
CATEGORIES = games
HOMEPAGE = https://gitlab.com/${GL_ACCOUNT}/${GL_PROJECT}
MAINTAINER = Thomas Frohwein <thfr@openbsd.org>
Index: goldberg_emulator/distinfo
===================================================================
RCS file: /cvs/ports/games/goldberg_emulator/distinfo,v
retrieving revision 1.3
diff -u -p -r1.3 distinfo
--- goldberg_emulator/distinfo 10 Oct 2022 18:36:02 -0000 1.3
+++ goldberg_emulator/distinfo 28 Jul 2023 19:17:16 -0000
@@ -1,2 +1,2 @@
-SHA256 (goldberg_emulator-0.2.5pl2.tar.gz) = uGsKf+MgLt+zfKNGhRVvOHY4yhWxuNXeQAYD4eYdnWE=
-SIZE (goldberg_emulator-0.2.5pl2.tar.gz) = 2255882
+SHA256 (goldberg_emulator-0.2.5pl3.tar.gz) = Nc8KGamuu7Xq4791kI0qvQGh8Rl+th74kqj723U4wfk=
+SIZE (goldberg_emulator-0.2.5pl3.tar.gz) = 2260829
Index: goldberg_emulator/patches/patch-sdk_includes_steam_gameserver_h
===================================================================
RCS file: /cvs/ports/games/goldberg_emulator/patches/patch-sdk_includes_steam_gameserver_h,v
retrieving revision 1.1
diff -u -p -r1.1 patch-sdk_includes_steam_gameserver_h
--- goldberg_emulator/patches/patch-sdk_includes_steam_gameserver_h 10 Oct 2022 18:36:02 -0000 1.1
+++ goldberg_emulator/patches/patch-sdk_includes_steam_gameserver_h 28 Jul 2023 19:17:16 -0000
@@ -3,7 +3,7 @@ remove duplicate function definition wit
Index: sdk_includes/steam_gameserver.h
--- sdk_includes/steam_gameserver.h.orig
+++ sdk_includes/steam_gameserver.h
-@@ -62,9 +62,6 @@ const uint16 STEAMGAMESERVER_QUERY_PORT_SHARED = 0xfff
+@@ -63,9 +63,6 @@ const uint16 STEAMGAMESERVER_QUERY_PORT_SHARED = 0xfff
// ISteamGameServer::GetNextOutgoingPacket.)
// - The version string should be in the form x.x.x.x, and is used by the master server to detect when the
// server is out of date. (Only servers with the latest version will be listed.)
Index: goldberg_emulator/patches/patch-sdk_includes_steamclientpublic_h
===================================================================
RCS file: /cvs/ports/games/goldberg_emulator/patches/patch-sdk_includes_steamclientpublic_h,v
retrieving revision 1.4
diff -u -p -r1.4 patch-sdk_includes_steamclientpublic_h
--- goldberg_emulator/patches/patch-sdk_includes_steamclientpublic_h 10 Oct 2022 18:36:02 -0000 1.4
+++ goldberg_emulator/patches/patch-sdk_includes_steamclientpublic_h 28 Jul 2023 19:17:16 -0000
@@ -3,12 +3,12 @@ fix error on 32bit arches with size of V
Index: sdk_includes/steamclientpublic.h
--- sdk_includes/steamclientpublic.h.orig
+++ sdk_includes/steamclientpublic.h
-@@ -1521,7 +1521,7 @@ enum ESteamIPv6ConnectivityState
+@@ -1531,7 +1531,7 @@ enum ESteamIPv6ConnectivityState
// Define compile time assert macros to let us validate the structure sizes.
#define VALVE_COMPILE_TIME_ASSERT( pred ) typedef char compile_time_assert_type[(pred) ? 1 : -1];

--#if defined(__linux__) || defined(__APPLE__)
-+#if defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__)
+-#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
++#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
// The 32-bit version of gcc has the alignment requirement for uint64 and double set to
// 4 meaning that even with #pragma pack(8) these types will only be four-byte aligned.
// The 64-bit version of gcc has the alignment requirement for these types set to
Index: goldberg_emulator/pkg/PLIST
===================================================================
RCS file: /cvs/ports/games/goldberg_emulator/pkg/PLIST,v
retrieving revision 1.4
diff -u -p -r1.4 PLIST
--- goldberg_emulator/pkg/PLIST 10 Oct 2022 18:36:02 -0000 1.4
+++ goldberg_emulator/pkg/PLIST 28 Jul 2023 19:17:16 -0000
@@ -57,6 +57,7 @@ include/goldberg_emulator/steam/isteamga
include/goldberg_emulator/steam/isteamgameserver011.h
include/goldberg_emulator/steam/isteamgameserver012.h
include/goldberg_emulator/steam/isteamgameserver013.h
+include/goldberg_emulator/steam/isteamgameserver014.h
include/goldberg_emulator/steam/isteamgameserverstats.h
include/goldberg_emulator/steam/isteamhtmlsurface.h
include/goldberg_emulator/steam/isteamhtmlsurface001.h
@@ -139,6 +140,7 @@ include/goldberg_emulator/steam/isteamug
include/goldberg_emulator/steam/isteamugc013.h
include/goldberg_emulator/steam/isteamugc014.h
include/goldberg_emulator/steam/isteamugc015.h
+include/goldberg_emulator/steam/isteamugc016.h
include/goldberg_emulator/steam/isteamunifiedmessages.h
include/goldberg_emulator/steam/isteamuser.h
include/goldberg_emulator/steam/isteamuser009.h
@@ -153,6 +155,8 @@ include/goldberg_emulator/steam/isteamus
include/goldberg_emulator/steam/isteamuser018.h
include/goldberg_emulator/steam/isteamuser019.h
include/goldberg_emulator/steam/isteamuser020.h
+include/goldberg_emulator/steam/isteamuser021.h
+include/goldberg_emulator/steam/isteamuser022.h
include/goldberg_emulator/steam/isteamuserstats.h
include/goldberg_emulator/steam/isteamuserstats001.h
include/goldberg_emulator/steam/isteamuserstats002.h
Index: godot/Makefile
===================================================================
RCS file: /cvs/ports/games/godot/Makefile,v
retrieving revision 1.44
diff -u -p -r1.44 Makefile
--- godot/Makefile 14 Jul 2023 20:36:14 -0000 1.44
+++ godot/Makefile 28 Jul 2023 19:17:16 -0000
@@ -4,12 +4,10 @@ COMMENT-main = 2D and 3D game engine
COMMENT-tools= 2D and 3D game engine (with tools)

V = 3.5.2
-# Later versions of GodotSteam need isteamdualsense.h.
-# Can only update once that is part of games/goldberg_emulator
-GODOTSTEAM_V = g35-s155-gs3171
+GODOTSTEAM_V = g352-s157-gs3193
DISTNAME = godot-${V}-stable
PKGNAME = godot-${V}
-REVISION = 0
+REVISION = 1

CATEGORIES = games

@@ -36,7 +34,7 @@ WANTLIB-tools = ${WANTLIB}
COMPILER = base-clang ports-gcc

MASTER_SITES = https://downloads.tuxfamily.org/godotengine/${V}/
-MASTER_SITES0
= https://github.com/Gramps/GodotSteam/archive/refs/tags/
+MASTER_SITES0
= https://github.com/CoaguCo-Industries/GodotSteam/archive/refs/tags/
DISTFILES = ${DISTNAME}${EXTRACT_SUFX} \
${GODOTSTEAM_V}.tar.gz:0
EXTRACT_SUFX = .tar.xz
@@ -66,7 +64,7 @@ MODSCONS_FLAGS = CC="${CC}" \
builtin_pcre2=no \
builtin_zlib=no \
builtin_zstd=no \
- custom_modules=${WRKSRC}/GodotSteam/godotsteam \
+ custom_modules=${WRKSRC}/godotsteam \
progress=no \
pulseaudio=no \
verbose=yes \
@@ -120,12 +118,12 @@ WANTLIB += atomic

CFLAGS += -I${LOCALBASE}/include/goldberg_emulator

-# symlink to allow patching GodotSteam
+# copy over to allow patching GodotSteam
post-extract:
cp -R ${FILESDIR}/sndio ${WRKDIST}/drivers
cp ${FILESDIR}/ujoy/joypad_openbsd.{cpp,h} \
${WRKDIST}/platform/x11/
- cp -R ${WRKDIR}/GodotSteam-${GODOTSTEAM_V} ${WRKSRC}/GodotSteam
+ cp -R ${WRKDIR}/GodotSteam-${GODOTSTEAM_V} ${WRKSRC}/godotsteam

pre-configure:
${SUBST_CMD} ${WRKSRC}/misc/dist/linux/*.desktop
Index: godot/distinfo
===================================================================
RCS file: /cvs/ports/games/godot/distinfo,v
retrieving revision 1.18
diff -u -p -r1.18 distinfo
--- godot/distinfo 12 Mar 2023 08:28:59 -0000 1.18
+++ godot/distinfo 28 Jul 2023 19:17:16 -0000
@@ -1,4 +1,4 @@
-SHA256 (godot-3.5.2/g35-s155-gs3171.tar.gz) = ZmX0vXnW1/wGxY/7OQYE0XLRf0eCTlJlFWSKI1DcP/E=
+SHA256 (godot-3.5.2/g352-s157-gs3193.tar.gz) = fkEgw4Z1qS5NbmdXJpB/yOVUOMRiPCo0ZQCvcKfLDHk=
SHA256 (godot-3.5.2/godot-3.5.2-stable.tar.xz) = tDodaynqJby6+86/e6CEMmGqEjfic5SUU4oiANjHvmI=
-SIZE (godot-3.5.2/g35-s155-gs3171.tar.gz) = 186585
+SIZE (godot-3.5.2/g352-s157-gs3193.tar.gz) = 185341
SIZE (godot-3.5.2/godot-3.5.2-stable.tar.xz) = 24047432
Index: godot/patches/patch-GodotSteam_godotsteam_godotsteam_cpp
===================================================================
RCS file: godot/patches/patch-GodotSteam_godotsteam_godotsteam_cpp
diff -N godot/patches/patch-GodotSteam_godotsteam_godotsteam_cpp
--- godot/patches/patch-GodotSteam_godotsteam_godotsteam_cpp 10 Oct 2022 18:39:05 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,155 +0,0 @@
-fix function signature in call to SteamGameServer_Init()
-stub Steam::setDualSenseTriggerEffect
-stub Steam::inputActionEventCallback
-remove deprecated/incompatible namespaces ISteamHTMLSurface
-InitiateGameConnection_DEPRECATED => InitiateGameConnection
-
-Index: GodotSteam/godotsteam/godotsteam.cpp
---- GodotSteam/godotsteam/godotsteam.cpp.orig
-+++ GodotSteam/godotsteam/godotsteam.cpp
-@@ -461,7 +461,8 @@ bool Steam::serverInit(const String& ip, uint16 game_p
- return false;
- }
- uint32_t ip4 = *((uint32_t *)address.get_ipv4());
-- if(!SteamGameServer_Init(ip4, game_port, query_port, mode, version_string.utf8().get_data())){
-+ /* use '0' in port for uint16 usSteamPort in the API */
-+ if(!SteamGameServer_Init(ip4, 0, game_port, query_port, mode, version_string.utf8().get_data())){
- return false;
- }
- return true;
-@@ -2389,7 +2390,7 @@ void Steam::keyChar(uint32 unicode_char, int key_modif
- if(this_handle == 0){
- this_handle = browser_handle;
- }
-- SteamHTMLSurface()->KeyChar(this_handle, unicode_char, (ISteamHTMLSurface::EHTMLKeyModifiers)key_modifiers);
-+ SteamHTMLSurface()->KeyChar(this_handle, unicode_char, (EHTMLKeyModifiers)key_modifiers);
- }
- }
-
-@@ -2400,7 +2401,7 @@ void Steam::keyDown(uint32 native_key_code, int key_mo
- if(this_handle == 0){
- this_handle = browser_handle;
- }
-- SteamHTMLSurface()->KeyDown(this_handle, native_key_code, (ISteamHTMLSurface::EHTMLKeyModifiers)key_modifiers);
-+ SteamHTMLSurface()->KeyDown(this_handle, native_key_code, (EHTMLKeyModifiers)key_modifiers);
- }
- }
-
-@@ -2411,7 +2412,7 @@ void Steam::keyUp(uint32 native_key_code, int key_modi
- if(this_handle == 0){
- this_handle = browser_handle;
- }
-- SteamHTMLSurface()->KeyUp(this_handle, native_key_code, (ISteamHTMLSurface::EHTMLKeyModifiers)key_modifiers);
-+ SteamHTMLSurface()->KeyUp(this_handle, native_key_code, (EHTMLKeyModifiers)key_modifiers);
- }
- }
-
-@@ -2433,7 +2434,7 @@ void Steam::mouseDoubleClick(int mouse_button, uint32
- if(this_handle == 0){
- this_handle = browser_handle;
- }
-- SteamHTMLSurface()->MouseDoubleClick(this_handle, (ISteamHTMLSurface::EHTMLMouseButton)mouse_button);
-+ SteamHTMLSurface()->MouseDoubleClick(this_handle, (EHTMLMouseButton)mouse_button);
- }
- }
-
-@@ -2444,7 +2445,7 @@ void Steam::mouseDown(int mouse_button, uint32 this_ha
- if(this_handle == 0){
- this_handle = browser_handle;
- }
-- SteamHTMLSurface()->MouseDown(this_handle, (ISteamHTMLSurface::EHTMLMouseButton)mouse_button);
-+ SteamHTMLSurface()->MouseDown(this_handle, (EHTMLMouseButton)mouse_button);
- }
- }
-
-@@ -2466,7 +2467,7 @@ void Steam::mouseUp(int mouse_button, uint32 this_hand
- if(this_handle == 0){
- this_handle = browser_handle;
- }
-- SteamHTMLSurface()->MouseUp(this_handle, (ISteamHTMLSurface::EHTMLMouseButton)mouse_button);
-+ SteamHTMLSurface()->MouseUp(this_handle, (EHTMLMouseButton)mouse_button);
- }
- }
-
-@@ -3212,6 +3213,8 @@ bool Steam::setInputActionManifestFilePath(const Strin
-
- // Set the trigger effect for a DualSense controller
- void Steam::setDualSenseTriggerEffect(uint64_t input_handle, int parameter_index, int trigger_mask, int effect_mode, int position, int amplitude, int frequency){
-+ return;
-+ /*
- if(SteamInput() != NULL){
- ScePadTriggerEffectParam these_parameters;
- memset(&these_parameters, 0, sizeof(these_parameters));
-@@ -3242,6 +3245,7 @@ void Steam::setDualSenseTriggerEffect(uint64_t input_h
- these_parameters.command[parameter_index].commandData.vibrationParam.frequency = frequency;
- SteamInput()->SetDualSenseTriggerEffect((InputHandle_t)input_handle, &these_parameters);
- }
-+ */
- }
-
- //! Waits on an IPC event from Steam sent when there is new data to be fetched from the data drop. Returns true when data was recievied before the timeout expires. Useful for games with a dedicated input thread.
-@@ -8251,7 +8255,7 @@ Dictionary Steam::initiateGameConnection(uint64_t serv
- int authSize = 2048;
- auth.resize(authSize);
- CSteamID server = (uint64)server_id;
-- if(SteamUser()->InitiateGameConnection_DEPRECATED(&auth, authSize, server, server_ip, server_port, secure) > 0){
-+ if(SteamUser()->InitiateGameConnection(&auth, authSize, server, server_ip, server_port, secure) > 0){
- connection["auth_blob"] = auth;
- connection["server_id"] = server_id;
- connection["server_ip"] = server_ip;
-@@ -8350,7 +8354,7 @@ void Steam::stopVoiceRecording(){
- //! Notify the game server that we are disconnecting. NOTE: This is part of the old user authentication API and should not be mixed with the new API.
- void Steam::terminateGameConnection(uint32 server_ip, uint16 server_port){
- if(SteamUser() != NULL){
-- SteamUser()->TerminateGameConnection_DEPRECATED(server_ip, server_port);
-+ SteamUser()->TerminateGameConnection(server_ip, server_port);
- }
- }
-
-@@ -10044,27 +10048,28 @@ void Steam::http_request_headers_received(HTTPRequestH
- //
- // Purpose: when callbacks are enabled this fires each time a controller action state changes
- void Steam::inputActionEventCallback(SteamInputActionEvent_t* call_data){
-- uint64_t input_handle = call_data->controllerHandle;
-- int event_type = call_data->eEventType;
-- uint64_t analog_handle = call_data->analogAction.actionHandle;
-- uint64_t digital_handle = call_data->digitalAction.actionHandle;
-+ return;
-+ //uint64_t input_handle = call_data->controllerHandle;
-+ //int event_type = call_data->eEventType;
-+ //uint64_t analog_handle = call_data->analogAction.actionHandle;
-+ //uint64_t digital_handle = call_data->digitalAction.actionHandle;
- // Get the digital action data
-- Dictionary digital_action;
-- digital_action["state"] = call_data->digitalAction.digitalActionData.bState;
-- digital_action["active"] = call_data->digitalAction.digitalActionData.bActive;
-+ //Dictionary digital_action;
-+ //digital_action["state"] = call_data->digitalAction.digitalActionData.bState;
-+ //digital_action["active"] = call_data->digitalAction.digitalActionData.bActive;
- // Get the analog action data
-- Dictionary analog_action;
-- analog_action["mode"] = call_data->analogAction.analogActionData.eMode;
-- analog_action["x"] = call_data->analogAction.analogActionData.x;
-- analog_action["y"] = call_data->analogAction.analogActionData.y;
-- analog_action["active"] = call_data->analogAction.analogActionData.bActive;
-+ //Dictionary analog_action;
-+ //analog_action["mode"] = call_data->analogAction.analogActionData.eMode;
-+ //analog_action["x"] = call_data->analogAction.analogActionData.x;
-+ //analog_action["y"] = call_data->analogAction.analogActionData.y;
-+ //analog_action["active"] = call_data->analogAction.analogActionData.bActive;
- // Split into a dictionary since Godot won't allow more than 6 arguments sent back
-- Dictionary action_information;
-- action_information["analog_action_handle"] = analog_handle;
-- action_information["analog_action_data"] = analog_action;
-- action_information["digital_action_handle"] = digital_handle;
-- action_information["digital_action_data"] = digital_action;
-- emit_signal("input_action_event", input_handle, event_type, action_information);
-+ //Dictionary action_information;
-+ //action_information["analog_action_handle"] = analog_handle;
-+ //action_information["analog_action_data"] = analog_action;
-+ //action_information["digital_action_handle"] = digital_handle;
-+ //action_information["digital_action_data"] = digital_action;
-+ //emit_signal("input_action_event", input_handle, event_type, action_information);
- }
-
- //! Purpose: called when a new controller has been connected, will fire once per controller if multiple new controllers connect in the same frame
Index: godot/patches/patch-GodotSteam_godotsteam_godotsteam_h
===================================================================
RCS file: godot/patches/patch-GodotSteam_godotsteam_godotsteam_h
diff -N godot/patches/patch-GodotSteam_godotsteam_godotsteam_h
--- godot/patches/patch-GodotSteam_godotsteam_godotsteam_h 10 Oct 2022 18:39:05 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,20 +0,0 @@
-don't use isteamdualsense.h API while not part of games/goldberg_emulator
-
-Index: GodotSteam/godotsteam/godotsteam.h
---- GodotSteam/godotsteam/godotsteam.h.orig
-+++ GodotSteam/godotsteam/godotsteam.h
-@@ -23,7 +23,6 @@
- #include "steam/steam_api.h"
- #include "steam/steam_gameserver.h"
- #include "steam/steamnetworkingfakeip.h"
--#include "steam/isteamdualsense.h"
-
- // Include Godot headers
- #include "core/object.h"
-@@ -1733,4 +1732,4 @@ class Steam: public Object {
- CCallResult<Steam, CheckFileSignature_t> callResultCheckFileSignature;
- void check_file_signature(CheckFileSignature_t *call_data, bool io_failure);
- };
--

No comments:

Post a Comment