mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-18 05:39:19 +02:00
multiplayer: fix the black screen - a cab and is_ready waiting on each other
The renderer draws nothing at all while simulation::is_ready is false, and that flag only goes up once the local player's cab is built. The previous commit made walking into a cab a crew request, so the cab of a claimed vehicle is created by Crews::reconcile() rather than by the command itself. reconcile() runs from the network housekeeping, which was gated on simulation::is_ready - so a host started with -v had its entervehicle turned into a claim, and then the cab waited for is_ready while is_ready waited for the cab. Black screen on both ends, since a client whose server never gets going has nothing to show either. - the housekeeping now waits for Global.simulation_loaded, which says the world exists, instead of simulation::is_ready, which says the player has a cab - in a session, a player with no cab counts as ready: they are an observer in the lobby, not a game still loading, and the world has to be drawn for them - entervehicle is only taken as a crew request when the session actually lists that vehicle; anything else stays an ordinary command, so a scenario that starts its host in something the roster does not cover still works
This commit is contained in:
@@ -62,6 +62,10 @@ bool scenarioloader_mode::update() {
|
||||
Application.pop_mode();
|
||||
}
|
||||
|
||||
// the world exists from here on. this is what the network housekeeping waits for;
|
||||
// simulation::is_ready means something else, namely that the player has a cab
|
||||
Global.simulation_loaded = true;
|
||||
|
||||
if( Application.is_server() ) {
|
||||
// the server owns the vehicle numbering for the whole session and publishes it
|
||||
network::Entities.build();
|
||||
|
||||
Reference in New Issue
Block a user