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

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using Godot;
@ -46,6 +47,14 @@ public class Sector
});
}
public void NetworkSync(long id)
{
GameObjects.ForEach(gameObject =>
{
gameObject.NetworkWrite(id, false);
});
}
public bool IsObjectInSector(GameObject gameObject)
{
return Helpers.IsInsideGlobalArea(GlobalStartCoordinates, GlobalEndCoordinates, gameObject.GlobalCoordinates);
@ -58,7 +67,20 @@ public class Sector
public void SpawnObjects()
{
GameObjects.ForEach(GameManager.Singleton.Spawn);
GameObjects.ForEach(GameManager.Instance.Spawn);
}
public GameObject GetObjectById(Guid id)
{
foreach (GameObject gameObject in GameObjects)
{
if (gameObject.UUID.Equals(id))
{
return gameObject;
}
}
return null;
}
public List<Sector> GetNeighbouringSectors()