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