The old implementation was hacky and often returned desynchronized
results. This implementation gives a seed to each sync object, and
synchronizes that seed. Also allows for a seed to be saved temporarily
based on position and recycled for multiple calls.
Allows mods to register themselves so that mismatches don't occur. This
does not automagically detect when someone modified the game, so the
mods will have to insert a function like this into their patch:
static void __attribute__((constructor)) _register_this_mod() {
network_register_mod("mod name here");
}
Changed synchronizing text to be more descriptive
Added 'player connected', 'player disconnected', 'network shutdown' chat messages
Prevented someone from joining through Discord while in another lobby
Added the distinction of sending a packet to all vs to a specific player
Enforced lobby size of 2, multiple joiners in a direct connection will be booted
Stored network destination for each player
Detected network drops
The vanilla main menu is an awful pile of code that is extremely painful
to make additions to. So I've side-stepped the problem by writing an
entiely new menu system without all of vanilla's quirks. I've separated
the custom menu system from the menus I want to make, which allows for
easy additions and a clear separation of responsibilities.
Along with this rewrite comes a host menu, adding the missing
configuration options in-game.
Fixes#29
In preparation for other forms of communication, I have abstracted all
of the socket code (which needs direct connections) behind a struct
whose calls can be swapped out for other systems if desired.
Should be snappier and less prone to crashes. I tested as many scenarios
as I could think of and it has been rock solid. But time will tell.
Also created a new debug log system, just so I could understand what the
hell was going on with this code.
Now when a client joins, it will request the entire 512 byte EEPROM from
the server and refuse to continue until the server replies with the
contents. Then the client will override all reads and writes to the
EEPROM/save file. Thus, a client will never overwrite their local save.
Fixes#21
Synchronized currentRoom per-player
Synchronized haunted bookshelf, and the bookshelf manager
Synchronized haunted chairs
Synchronized mad piano
Synchronized BBH's tilting trap, and made the physics multiple-player-aware
Synchronized scuttlebugs
Synchronized every variety of Boo
Synchronized elevators
Synchronized flamethrowers
Synchronized the various types of enemy books
Synchronized the book switches
Synchronized jumping box
Made coffins multiple-player-aware
Fixed everything that used gMarioState as an array instead of gMarioStates
Prevented some NPC-dialog softlocks
Prevented the remote player from messing up the local's camera settings
Possibly fixed the relatively rare chain chomp softlock
Possibly fixed the relatively rare chain hoot softlock
Fixed the first-person-camera softlock
Forced camera code to use the correct mario struct
Created functions to trivially translate an ID to a Behavior and vice
versa. Sent ID over packets instead of Behavior pointer. This should
allow Linux and Windows to play together.