Introduces several changes related to the main and multiplayer menus.
In the InputManager.gd file, the add_action_event_key function was modified to only execute if the key value is greater than 0. This change ensures that the function is not called with an invalid key value.
In the NetworkManager.gd file, a new reset function was added to close the current connection and create a new multiplayer peer. This function is useful for resetting the multiplayer state.
In the PlayerManager.gd file, a new players variable of type UniqueSet was added to keep track of all players in the game. This variable allows for easy management of players and their settings.
In the CharacterExtension3D.gd file, several new functions (is_authority, is_authority_owner, is_host) were added to check the multiplayer authority and ownership of the character. These functions are useful for handling multiplayer-specific behavior.
In the FirstPersonCharacter.gd file, the _enter_tree function was modified to add the current player to the PlayerManager.players set and set the multiplayer authority if the NetworkManager is enabled.
In the FirstPersonIronSight.gd file, the character_camera variable was modified to correctly reference the parent's character camera.
In the FirstPersonItem.gd file, the connect_magazine function was modified to call the hitscan_node.action.rpc() method when the magazine is discharged. This change ensures that the hitscan action is properly synchronized in multiplayer.
In the FirstPersonMouseInput.gd file, the mouse_sensitivity variable was moved to the global InputManager, and the character variable was added to correctly reference the parent's character. Additionally, the _input function was modified to only process input if the character has authority ownership.
These changes enhance the main and multiplayer menus by improving multiplayer synchronization, adding player management functionality, and ensuring correct input processing.
Introduces several changes related to the main and multiplayer menus.
In the
InputManager.gd
file, theadd_action_event_key
function was modified to only execute if thekey
value is greater than 0. This change ensures that the function is not called with an invalid key value.In the
NetworkManager.gd
file, a newreset
function was added to close the current connection and create a new multiplayer peer. This function is useful for resetting the multiplayer state.In the
PlayerManager.gd
file, a newplayers
variable of typeUniqueSet
was added to keep track of all players in the game. This variable allows for easy management of players and their settings.In the
CharacterExtension3D.gd
file, several new functions (is_authority
,is_authority_owner
,is_host
) were added to check the multiplayer authority and ownership of the character. These functions are useful for handling multiplayer-specific behavior.In the
FirstPersonCharacter.gd
file, the_enter_tree
function was modified to add the current player to thePlayerManager.players
set and set the multiplayer authority if theNetworkManager
is enabled.In the
FirstPersonIronSight.gd
file, thecharacter_camera
variable was modified to correctly reference the parent's character camera.In the
FirstPersonItem.gd
file, theconnect_magazine
function was modified to call thehitscan_node.action.rpc()
method when the magazine is discharged. This change ensures that the hitscan action is properly synchronized in multiplayer.In the
FirstPersonMouseInput.gd
file, themouse_sensitivity
variable was moved to the global InputManager, and thecharacter
variable was added to correctly reference the parent's character. Additionally, the_input
function was modified to only process input if the character has authority ownership.These changes enhance the main and multiplayer menus by improving multiplayer synchronization, adding player management functionality, and ensuring correct input processing.