Implement RPC Node

This commit is contained in:
Aslan 2026-02-02 12:17:04 -05:00
parent f7ee533d5a
commit 605e43273e
13 changed files with 524 additions and 206 deletions

View file

@ -16,17 +16,7 @@ public class Character(Sector sector, Vector3 localCoordinates) : GameObject(sec
if (IsMainPlayer())
{
GameManager.Singleton.ApplyOrigin();
if (!Global.IsGameHost)
{
GameManager.Singleton.RpcId(
1,
nameof(GameManager.Singleton.RpcSendNearbySectors),
CurrentSector.Coordinates,
NetworkManager.Singleton.LocalNetId
);
}
GameManager.Instance.ApplyOrigin();
}
reassigning = false;
@ -34,7 +24,7 @@ public class Character(Sector sector, Vector3 localCoordinates) : GameObject(sec
public bool IsMainPlayer()
{
return player == GameManager.Singleton.MainPlayer;
return player == GameManager.Instance.MainPlayer;
}
public Player InstantiatePlayer()
@ -48,6 +38,14 @@ public class Character(Sector sector, Vector3 localCoordinates) : GameObject(sec
return instance;
}
public override void Simulate(double delta)
{
if (!reassigning && !IsInCurrentSector())
{
UpdateSector();
}
}
public override void UpdateNodePosition()
{
if (IsMainPlayer())