This commit is contained in:
2023-03-02 22:07:43 +02:00
parent 1a0709d113
commit 5e48806b8c
21 changed files with 145 additions and 82 deletions

View File

@@ -27,6 +27,7 @@ namespace Game
public static bool Connect(string ip = null, ushort port = 0)
{
Console.Clear();
if (ServerRunning)
NetworkManager_Cleanup();
@@ -48,6 +49,7 @@ namespace Game
public static bool StartServer(bool listenServer)
{
Console.Clear();
if (ServerRunning)
NetworkManager_Cleanup();
@@ -198,8 +200,15 @@ namespace Game
Console.PrintError("GameModeManager: Failed to find PlayerPrefab");
PlayerActor playerActor = PrefabManager.SpawnPrefab(playerPrefab).As<PlayerActor>();
NetworkReplicator.AddObject(playerActor);
playerActor.hai = 123;
playerActor.Initialize(clientId);
playerActor.IsActive = true;
playerActor.Teleport(spawnPosition, spawnAngles);
//NetworkReplicator.SetObjectOwnership(playerActor, clientId);
NetworkReplicator.SpawnObject(playerActor);
}
public void OnPlayerInit()