added tool syncing

This commit is contained in:
Mister_Nebula 2020-08-09 22:10:47 +01:00
parent 99064c4572
commit 83e8d9d714
6 changed files with 5 additions and 2 deletions

View File

@ -29,6 +29,7 @@ namespace QSB.Events
public override void OnReceiveLocal(ToggleMessage message)
{
PlayerRegistry.LocalPlayer.UpdateState(State.Flashlight, message.ToggleValue);
PlayerRegistry.LocalPlayer.FlashLight.UpdateState(message.ToggleValue);
}
}

View File

@ -30,6 +30,7 @@ namespace QSB.Events
public override void OnReceiveLocal(ToggleMessage message)
{
PlayerRegistry.LocalPlayer.UpdateState(State.ProbeLauncher, message.ToggleValue);
PlayerRegistry.LocalPlayer.ProbeLauncher.ChangeEquipState(message.ToggleValue);
}
}

View File

@ -30,6 +30,7 @@ namespace QSB.Events
public override void OnReceiveLocal(ToggleMessage message)
{
PlayerRegistry.LocalPlayer.UpdateState(State.Signalscope, message.ToggleValue);
PlayerRegistry.LocalPlayer.Signalscope.ChangeEquipState(message.ToggleValue);
}
}

View File

@ -30,6 +30,7 @@ namespace QSB.Events
public override void OnReceiveLocal(ToggleMessage message)
{
PlayerRegistry.LocalPlayer.UpdateState(State.Translator, message.ToggleValue);
PlayerRegistry.LocalPlayer.Translator.ChangeEquipState(message.ToggleValue);
}
}

View File

@ -19,7 +19,6 @@ namespace QSB
public static PlayerInfo CreatePlayer(uint id)
{
DebugLog.ToConsole($"Creating player {id}");
if (PlayerExists(id))
{
return null;

View File

@ -110,7 +110,7 @@ namespace QSB
NetworkServer.SpawnWithClientAuthority(Instantiate(_cameraPrefab), connection);
NetworkServer.SpawnWithClientAuthority(Instantiate(_probePrefab), connection);
var gameState = gameObject.AddComponent<Events.PlayerState>();
gameObject.AddComponent<Events.PlayerState>();
}
public override void OnClientConnect(NetworkConnection connection) // Called on the client when connecting to a server