Add network output compatible with MAME.#303
Conversation
|
Need more time to look at this but bool m_running; Why do you have the sleep there? Shouldn't need it. Also what happens if the thread has already exited? I forget, will join() bork? Maybe need to check if it's joinable first? unsigned int m_maxClients = 10; Add const to this! |
|
I’d like to take a look later this week as well before this merges. |
9bcf7cc to
702906b
Compare
|
Take your time, this is not urgent, I'm playing with local builds since some weeks. @dukeeeey |
|
Last comments :) Looking good const unsigned int NET_OUTPUTS_DEFAULT_TCP_PORT = 8000; I'd put those inside a class? Class is also a namespace rather than global Why are these lower case to start? :) |
702906b to
8968f3d
Compare
This I didn't get fully, you meant something like this?
Company coding guide 😆 fixed it to uppercase. |
|
Code looks good |
There was a problem hiding this comment.
Looks good but I have one request, if possible: I have never used an application that listens for these outputs. Would it be possible to write a Python script that listens for them and prints them out? We have a scripts directory. This would be great for testing.
Ideally, the Python script wouldn't depend on any external packages for now. I assume you would just vibe code that but I have Python code for UDP listeners and TCP servers and clients if you want me to point you to some references.
8968f3d to
dc7fb80
Compare
I've had a test script from development, pimped it a bit and stored it in the Scripts folder. The script waits for UDP broadcast and continuously tries to connect to the TCP interface. Messages are logged with their content to the console. |
dc7fb80 to
4cbe3bd
Compare
|
This doesn't compile for me: |
|
Wait... this requires NET_BOARD=1 to pull in SDL_net. Do we just get rid of NET_BOARD altogether and always compile the net code? Can't see why not. |
|
Another change required:
|
This pull request adds a new network-based output system to the SDL build, allowing output messages to be sent over TCP and UDP for integration with tools like MAMEHooker.
This is meant as a successor of the following PR: #253
Successfully tested with Daytona 2, LA Machineguns, Lost World, SW Trilogy.
So far tests only on Linux, waiting for the build system to produce a Windows build.Tested on Windows with Hook Of The Reaper and QMameHooker / custom scripts / Wireshark on Linux.
Updating docs will follow before leaving draft state.Docs updated.
PR summary (Copilot):
Network Output System Integration:
NetOutputs.cppandNetOutputs.himplementing theCNetOutputsclass, which sends output messages over TCP and UDP in a MAMEHooker-compatible format. This includes client registration, data transmission, and UDP broadcast for discovery. [1] [2]Main.cppto support selecting the "net" output system via configuration, including instantiation, initialization, and configuration of TCP/UDP ports and line endings. [1] [2]Configuration Enhancements:
OutputsWithLF(line ending),OutputsTCPPort, andOutputsUDPBroadcastPortto control network output behavior.Build System and Project File Updates:
NetOutputs.cppin the SDL source file list for building.NetOutputs.hto the Visual Studio project and filter files, ensuring proper inclusion in the build environment. [1] [2] [3]