|
@ -40,6 +40,15 @@ namespace Networking.Client |
|
|
[SerializeField] |
|
|
[SerializeField] |
|
|
[Tooltip("Client Inventory")] |
|
|
[Tooltip("Client Inventory")] |
|
|
protected Inventory Inventory; |
|
|
protected Inventory Inventory; |
|
|
|
|
|
|
|
|
|
|
|
[SerializeField] |
|
|
|
|
|
[Tooltip("Current Time in Round")] |
|
|
|
|
|
public float RoundTime; |
|
|
|
|
|
|
|
|
|
|
|
[SerializeField] |
|
|
|
|
|
[Tooltip("Current Score in Round")] |
|
|
|
|
|
public float RoundScore; |
|
|
|
|
|
|
|
|
#endregion Inspector Fields
|
|
|
#endregion Inspector Fields
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -64,6 +73,7 @@ namespace Networking.Client |
|
|
client.RegisterHandler(LogicProtocols.SendInventory, RecieveInventory); |
|
|
client.RegisterHandler(LogicProtocols.SendInventory, RecieveInventory); |
|
|
client.RegisterHandler(LoginProtocols.SceneChange, RecieveSceneChange); |
|
|
client.RegisterHandler(LoginProtocols.SceneChange, RecieveSceneChange); |
|
|
client.RegisterHandler(MsgType.Disconnect, OnDisconnect); |
|
|
client.RegisterHandler(MsgType.Disconnect, OnDisconnect); |
|
|
|
|
|
client.RegisterHandler(LogicProtocols.SendRoundTime, UpdateTime); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void Stop() |
|
|
public void Stop() |
|
@ -105,6 +115,16 @@ namespace Networking.Client |
|
|
{ |
|
|
{ |
|
|
UnityEngine.SceneManagement.SceneManager.LoadScene(DisconnectScene); |
|
|
UnityEngine.SceneManagement.SceneManager.LoadScene(DisconnectScene); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void UpdateTime(NetworkMessage msg) |
|
|
|
|
|
{ |
|
|
|
|
|
Debug.Log("Recieveing time from server"); |
|
|
|
|
|
LogicProtocols.FloatMsg floatMsg; |
|
|
|
|
|
if (!msg.TryRead(out floatMsg)) |
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
RoundTime = floatMsg.Float; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |