mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-25 06:35:45 +00:00
add logs
This commit is contained in:
parent
ae7d0a0396
commit
8fbafd7e4c
@ -27,6 +27,7 @@ namespace QSB.Events
|
||||
|
||||
public override void OnServerReceive(ToggleMessage message)
|
||||
{
|
||||
DebugLog.ToConsole($"Receieved ready message from {message.SenderId}");
|
||||
PlayerRegistry.GetPlayer(message.SenderId).IsReady = message.ToggleValue;
|
||||
PlayerState.LocalInstance.Send();
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ namespace QSB.Events
|
||||
|
||||
public void Request()
|
||||
{
|
||||
DebugLog.ToConsole("Requesting player states...", OWML.Common.MessageType.Info);
|
||||
StartCoroutine(SendRequest());
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System.Linq;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using QSB.Tools;
|
||||
using QSB.Utility;
|
||||
using UnityEngine;
|
||||
|
@ -5,6 +5,7 @@ using QSB.TransformSync;
|
||||
using QSB.Animation;
|
||||
using QSB.Utility;
|
||||
using QSB.Messaging;
|
||||
using System;
|
||||
|
||||
namespace QSB
|
||||
{
|
||||
@ -19,6 +20,7 @@ namespace QSB
|
||||
|
||||
public static PlayerInfo CreatePlayer(uint id)
|
||||
{
|
||||
DebugLog.ToConsole($"Creating player with ID {id}", OWML.Common.MessageType.Info);
|
||||
if (PlayerExists(id))
|
||||
{
|
||||
return null;
|
||||
@ -49,7 +51,7 @@ namespace QSB
|
||||
player.Name = message.PlayerName;
|
||||
player.IsReady = message.PlayerReady;
|
||||
player.State = message.PlayerState;
|
||||
|
||||
DebugLog.ToConsole($"Updating state for player {player.NetId} to {Convert.ToString((int)player.State, 2)}");
|
||||
if (LocalPlayer.IsReady == true)
|
||||
{
|
||||
player.UpdateStateObjects();
|
||||
|
@ -37,6 +37,7 @@ namespace QSB
|
||||
private void OnWakeUp()
|
||||
{
|
||||
WokenUp = true;
|
||||
PlayerStatesRequest.Instance.Request();
|
||||
}
|
||||
|
||||
private void OnLoopStart()
|
||||
|
@ -50,7 +50,6 @@ namespace QSB.TimeSync
|
||||
}
|
||||
|
||||
GlobalMessenger.AddListener("RestartTimeLoop", OnLoopStart);
|
||||
GlobalMessenger.AddListener("WakeUp", OnWakeUp);
|
||||
}
|
||||
|
||||
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
|
||||
@ -70,11 +69,6 @@ namespace QSB.TimeSync
|
||||
_localLoopCount++;
|
||||
}
|
||||
|
||||
private void OnWakeUp()
|
||||
{
|
||||
PlayerStatesRequest.Instance.Request();
|
||||
}
|
||||
|
||||
private void Init()
|
||||
{
|
||||
PlayerStatesRequest.Instance.Request();
|
||||
|
Loading…
x
Reference in New Issue
Block a user