Added Server Browser and Lobby Server (#10, #45, #35), in-game chat (#8) and minor bug fixes (#36)#46
Open
AMacro wants to merge 589 commits intoInsprill:masterfrom
Open
Added Server Browser and Lobby Server (#10, #45, #35), in-game chat (#8) and minor bug fixes (#36)#46AMacro wants to merge 589 commits intoInsprill:masterfrom
AMacro wants to merge 589 commits intoInsprill:masterfrom
Conversation
This was referenced Sep 22, 2024
Open
Open
Jarnster
pushed a commit
to Jarnster/dv-multiplayer
that referenced
this pull request
Nov 27, 2024
Fix project board link in the README
1e8fee4 to
48e900a
Compare
When a new player connects all players were receiving the list of jobs.
When a new player connects all players were receiving the list of jobs.
Removed call to `ClearAvailableJobOverviewGOs` in `NetworkedStationController`. Fixes issue where clearing a carriage for an available job causes all client job overviews to despawn at the station.
Introduces a new setting 'Show Player List in Alt Mouse Mode' to control the visibility of the player list when mouse mode is active. Updates PlayerListGUI to respect this setting when toggling the player list display.
Added null checks and improved error handling across multiple components to prevent null reference exceptions.
isUnloading and isQuitting are not set until after scene unload has begun, causing unnecessary logging. Introduces an IsReturningToMenu property to track when a scene switch to the main menu is requested. Updated NetworkLifecycle.OnTick() invocation and error logging to avoid processing during game scene unload.
Moved the logic for destroying JobOverview and JobBooklet items into dedicated methods in NetworkedJob. Updated NetworkedStationController to use these new methods, improving code clarity and encapsulation. Fixed error where a job overview could be destroyed while in a client's inventory, and slot would remain used (item not properly removed)
Introduced additional Log statements throughout NetworkClient and NetworkServer to improve traceability of key connection events.
If the host shows the pause menu and then changes focus to a new window, the simulation pauses. Clients will continue to run the simulation, but when the host returns to the game the simulation will reset to the pre-pause state. On Clients this can cause a large jump and physics glitches.
Disable Teleport and Pause Menu inputs when chat is toggled. This fixes an issue where the 'F' key teleports the player and allows 'escape' to be used to close the chat window.
Register MessageBox and BetterModUI as Client compatibility in ModCompatibilityManager so they are treated as client-side only mods.
Patch HoseSeparationChecker to prevent clients from breaking the hose connection if carriages are too far from each other.
Expanded instructions for building the mod and clarified installation steps.
Updated the instructions for building the project to use numbered steps for clarity.
Player coupling interaction was being stored and not cleared on the host, resulting in subsequent interactions being rejected and not correctly restoring state
Added ServerboundTrainSpawnRequestPacket and server-side validation for client-initiated car spawns. Updated NetworkedCarSpawner and related patches to support new spawn flow and play spawn sounds for player-initiated spawns. Removed unused ClientboundSpawnTrainCarPacket
Introduce a generic RPC response mechanism: adds RpcManager (discovery/registration of IRpcResponse types, FNV-1a hashing, ticket creation/resolution and expiry handling), RpcTicket (callbacks for resolve/timeout), and IRpcResponse interface for serialisation. Adds ClientboundRpcResponsePacket to carry ticket id, response type hash and serialised response data. NetworkClient now subscribes to and handles RPC response packets by resolving tickets via RpcManager; NetworkServer exposes SendRpcResponse to send responses to peers. Reflection-based type discovery ensures server/client can instantiate correct response types during deserialisation.
Allow clients to request work trains.
Low pings cause premature timeout for CommsRadio WorkTrain RPC packets, added a minimum of 2 seconds. Added a German translation for a "work train in use". Removed an extra "\n" that was causing the LCD text field to overflow.
Move various Multiplayer.Networking.Data types into focused subnamespaces and folders (Items, Jobs, World, RPCs) and update all affected using directives and references across the codebase.
Add base framework for inventory initial load. Add dummy test items for all clients. Items are selected for running steam locos, i.e. Oiler, Lighter, Shovel and Lantern
Increase client timeout to be 8x the one-way ping
Attempting to fix a null reference issue that may be related to a CCL car misconfig.
Ensure lastRemoteValueDict contains an entry for the current resourceType before calling SetUnits. If the resource has a corresponding loco resource module, initialize to rm.Data.unitsToBuy; otherwise default to 0f.
Use null-safe coupler?.train?.ID instead of coupler.name/otherCoupler.name in the SendHoseConnected warning.
* Add CrewName and DisplayName to player objects Player objects updated to add a crew name designation and a display name that returns the username and if set, CrewName. Exposed properties for IPlayer objects. * Add support username override at login and sync of crewnames Pass and store a player's crew name and handle server-provided username overrides. Changes: ClientPlayerManager.AddPlayer now accepts crewName and sets NetworkedPlayer.CrewName; NetworkClient stores Username and CrewName, exposes DisplayName, initializes Username from settings, and applies packet.OverrideUsername on login; NetworkServer includes OverrideUsername in the login response and sends CrewName in the PlayerJoined packet; clientbound packets (LoginResponse, PlayerJoined) get new fields for OverrideUsername and CrewName. This enables showing crew tags in player names and resolving duplicate-username conflicts. * Update MapMarkers to use the DisplayName Map markers will now show the crewname if available * Update PlayerListGUI to show crewnames if available and overridden username when applicable Replace cached localPlayerUsername with a read-only property that returns NetworkLifecycle.Instance.Client.DisplayName or falls back to Multiplayer.Settings.GetUserName(). Use player.DisplayName when building the list and use the new LocalPlayerUsername for the local entry. Removes stale initialization and adds null-safe access to the client display name so the UI shows up-to-date names. * Add a method for syncing player preferences Add a clientbound packet and handlers to propagate player preferences (currently crew name) to clients. Introduces ClientboundPlayerPreferencesUpdatePacket, NetworkServer.SendPlayerPreferencesUpdate, and a client handler in NetworkClient. Adds ClientPlayerManager.UpdatePreferences and OnPlayerPrefsUpdated event to update the local NetworkedPlayer state, and updates NetworkedMapMarkersController to refresh displayed crew names when preferences change. * Update ChatManager.cs * Add player management API methods (kick, set crew name) * Move player wrapper caching into network managers * Increase crew name max and fix truncation Bump MAX_CREW_NAME_LENGTH from 5 to 6 to allow a longer crew name. Fix a bug in the CrewName setter where a truncated name was immediately overwritten by the original value * Add /crew chat command and crew name setting Introduce support for setting player crew names via chat: add new /crew (and /sc) command handling in ChatManager with a SetCrewNameMessage handler that supports host-managed and optional client-set crew names. Add a new AllowClientCrewNames setting (with UI attributes) to control whether clients can change their own crew. Add related locale keys and translations (help texts and messages for disallowed, player not found, and joined announcements) and corresponding constants in Locale.cs. * Use player wrapper API for remote dispatch Replace direct NetworkedPlayer/Transform usage with the MPAPI IPlayer wrappers and unify host/client handling. The patch iterates ServerPlayerWrappers or ClientPlayerWrappers via IPlayer, reads Position and RotationY properties (adjusted by WorldMover), and adds the player's CrewName to the dispatched JSON. Also updates usings (adds MPAPI, LINQ, Collections) and removes direct Transform access to improve compatibility with the new player abstraction.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@Insprill
This is a consolidation PR that covers multiple issues.
Work is ongoing for #6 and #11.