New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SCUMM HE: Online/Network Multiplayer Support #4725
Conversation
Amazing work, thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did my first round of reviews. sessionselector.*
has to be moved back to the SCUMM engine, since gui/ code cannot depend on some engine code.
Also, please bump themes version (in THEMERC in every theme dir as well as in gui/ThemeEngine.h
and put themes regeneration, e.g. .zip files into a separate commit.
backends/networking/curl/socket.h
Outdated
|
||
} // End of namespace Networking | ||
|
||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing end of line
backends/networking/curl/url.h
Outdated
|
||
} // End of Namespace Networking | ||
|
||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing end of line
#include "common/debug.h" | ||
#include "common/system.h" | ||
#include "common/taskbar.h" | ||
#include "common/translation.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also have to add this file to po/POTFILES
, so it goes to our Weblate for translation.
_timestamp = 0; | ||
|
||
_queryProgressText = new StaticTextWidget(this, "SessionSelector.QueryProgressText", | ||
_("Querying games...")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a commend for translators here with I18N:
prefix. Something like
// I18N: Retrieving list of online games
|
||
_joinButton->setEnabled(false); | ||
// Update the dialog | ||
_queryProgressText->setLabel(Common::U32String::format(_("Found %d available games."), l.size())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is also, please add a comment to the translators that the games here are online and active ones, not like game files.
* | ||
*/ | ||
|
||
#ifndef SESSION_SELECTOR_DIALOG_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename it to match the current file name
#include "common/stack.h" | ||
#include "common/str.h" | ||
|
||
#include "scumm/he/intern_he.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. You cannot do it from the GUI. This means that you have to move these two files, sessionselector.*
back to engines/scumm
. Perhaps, call it there dialog_sessionselector.h
Thank you for addressing all my notes. Once it is rebased, so there are no conflicts, I'll merge and the work could be continued in-tree |
Useful for connecting to a "rendezvous" server or some sort.
Normally, GameSpy Arcade (or a third-party app) would set these settings into moonbase.ini for the game to read. But I feel like a couple of command line options would be a lot simpler. Also, doubles as a quick way to host and join a game for testing. Unfortunately this does not support the demo version.
This can be used to create custom protocols with an SDL_net like interface while being able to connect to SSL/TLS servers.
195c02f
to
00ab6d4
Compare
Thank you! |
List of things left to do before this could be merged (more could be added due to feedback):
net_main.cpp
, usingJSONObjects
instead of constructing messages via string formatting, like hownet_lobby.cpp
does.sessionselector.*
to SCUMM engine and bump theme version.This has been a pet project I've been working on for multiple months, and I believe it's finally time to gather some code feedback. :)
This adds network multiplayer play supported by the compatible Humongous Entertainment games: Backyard Football, Backyard Baseball 2001, Backyard Football 2002, and Moonbase Commander.
It includes a new networking backend based of ENet. It is primarily used for hosting and joining peer-to-peer game sessions and transferring in-game data. For Internet-wide game sessions, it communicates with a separate "session server" to advertise and join such sessions, with basic hole-punching to bypass NAT, if that does not work, the server will relay data for the user. Hosting from and joining to other devices in your local network is also possible. It also contains lobby client code for Football 1999 and Baseball 2001.
The ENet backend is located in
backends/networking/enet
, while the source code for its latest stable version (1.3.17) is located in thesource
directory. While the whole netcode itself is located inengines/scumm/he/net
A couple of years back, I've gotten online play for Backyard Football (the 1999 version) and Backyard Baseball 2001 working on an old and soon to be obsolete fork, and support for these games is provided by Backyard Sports Online, a service and community I maintain. Clicking the register button on these games in this branch has a brief mention of the service, this is because ScummVM will be generously providing support and hosting of the project itself. (Thanks sev and rootfather!)
At Backyard Sports Online, we have our competitive online leagues, and have implemented game modifications that suit our needs, notably custom teams, which includes kids not normally playable online (such as Season Play NPCs and Mr. Clanky). We've included such mods here, but under a toggle option in the game settings (disabled by default), since such mods are not needed for casual players. sev has said this is completely fine.
The old lobby code communication was previously done via
SDL2_net
, but for this one, I've decided to use libcurl, simply because it can communicate with TLS/SSL servers and does the handshaking, making the connection secure. The new backend code can be found inbackends/networking/curl/socket.cpp
.Server code and more information for both the session and lobby servers will be located in the
scummvm-sites
repository. The PR for the server could be found here: scummvm/scummvm-sites/pull/20For those interested in testing: You should be able to checkout the branch from the fork and start hosting games as the default servers are already up and running as of writing, feedback is greatly appreciated.
Special Thanks: