unstaticify part1
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -27,3 +27,4 @@ Assets/Maps/autosave/
|
|||||||
Demos/
|
Demos/
|
||||||
omnisharp.json
|
omnisharp.json
|
||||||
console.log
|
console.log
|
||||||
|
console-1.log
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ namespace Game
|
|||||||
//FlaxEditor.Editor.Instance.PlayModeBegin -= Instance_PlayModeBegin;
|
//FlaxEditor.Editor.Instance.PlayModeBegin -= Instance_PlayModeBegin;
|
||||||
LoadConfig();
|
LoadConfig();
|
||||||
//GameMode.Connect();
|
//GameMode.Connect();
|
||||||
WorldStateManager.Init();
|
//WorldStateManager.Init();
|
||||||
//NetworkManager.StartServer();
|
//NetworkManager.StartServer();
|
||||||
|
|
||||||
//GameMode.StartServer(true);
|
//GameMode.StartServer(true);
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ namespace Game
|
|||||||
Editor.Instance.PlayModeEnd += Cleanup;
|
Editor.Instance.PlayModeEnd += Cleanup;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
WorldStateManager.Init(); // FIXME
|
//WorldStateManager.Init(); // FIXME
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Cleanup()
|
public static void Cleanup()
|
||||||
@@ -107,7 +107,7 @@ namespace Game
|
|||||||
Editor.Instance.PlayModeEnd -= Cleanup;
|
Editor.Instance.PlayModeEnd -= Cleanup;
|
||||||
//GameModeManager.Cleanup(); // FIXME
|
//GameModeManager.Cleanup(); // FIXME
|
||||||
#endif
|
#endif
|
||||||
WorldStateManager.Cleanup(); // FIXME
|
//WorldStateManager.Cleanup(); // FIXME
|
||||||
|
|
||||||
StopRecording();
|
StopRecording();
|
||||||
|
|
||||||
|
|||||||
@@ -13,12 +13,19 @@ namespace Game
|
|||||||
|
|
||||||
public static INetworkDriver ClientNetworkDriver { get; set; }
|
public static INetworkDriver ClientNetworkDriver { get; set; }
|
||||||
|
|
||||||
|
public static WorldStateManager clientWorldStateManager = null;
|
||||||
|
|
||||||
public static bool ConnectServer(string serverAddress = "localhost", bool listenServer = false)
|
public static bool ConnectServer(string serverAddress = "localhost", bool listenServer = false)
|
||||||
{
|
{
|
||||||
if (!listenServer)
|
if (!listenServer)
|
||||||
{
|
{
|
||||||
Cleanup();
|
Cleanup();
|
||||||
WorldStateManager.Init();
|
//WorldStateManager.Init();
|
||||||
|
clientWorldStateManager = new WorldStateManager(isClient: true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
clientWorldStateManager = new WorldStateManager(isLocalClient: true);
|
||||||
}
|
}
|
||||||
ServerAddress = serverAddress;
|
ServerAddress = serverAddress;
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace Game
|
|||||||
{
|
{
|
||||||
{
|
{
|
||||||
Cleanup();
|
Cleanup();
|
||||||
WorldStateManager.Init();
|
clientWorldStateManager = new WorldStateManager(isServer: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ReadDemo(demoName))
|
if (!ReadDemo(demoName))
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ namespace Game
|
|||||||
|
|
||||||
public static INetworkDriver ServerNetworkDriver { get; set; }
|
public static INetworkDriver ServerNetworkDriver { get; set; }
|
||||||
|
|
||||||
|
public static WorldStateManager serverWorldStateManager = null;
|
||||||
|
|
||||||
public static bool StartServer(bool listenServer = true)
|
public static bool StartServer(bool listenServer = true)
|
||||||
{
|
{
|
||||||
Cleanup();
|
Cleanup();
|
||||||
@@ -79,7 +81,8 @@ namespace Game
|
|||||||
foreach (Type type in NetworkedTypes)
|
foreach (Type type in NetworkedTypes)
|
||||||
Console.Print("tracking networked type: " + type.Name);
|
Console.Print("tracking networked type: " + type.Name);
|
||||||
#endif
|
#endif
|
||||||
WorldStateManager.Init();
|
serverWorldStateManager = new WorldStateManager(isServer: true);
|
||||||
|
//WorldStateManager.Init();
|
||||||
|
|
||||||
if (listenServer)
|
if (listenServer)
|
||||||
return ConnectServer(listenServer: true);
|
return ConnectServer(listenServer: true);
|
||||||
@@ -135,13 +138,13 @@ namespace Game
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
IsServer = true;
|
IsServer = true;
|
||||||
if (WorldStateManager.OnClientConnecting(networkEvent.Sender))
|
if (serverWorldStateManager.OnClientConnecting(networkEvent.Sender))
|
||||||
{
|
{
|
||||||
ConnectedClients.Add(networkEvent.Sender);
|
ConnectedClients.Add(networkEvent.Sender);
|
||||||
Console.Print(
|
Console.Print(
|
||||||
$"Client({networkEvent.Sender.ConnectionId}) connected. Total clients: {ConnectedClients.Count}");
|
$"Client({networkEvent.Sender.ConnectionId}) connected. Total clients: {ConnectedClients.Count}");
|
||||||
|
|
||||||
WorldStateManager.OnClientConnected(networkEvent.Sender);
|
serverWorldStateManager.OnClientConnected(networkEvent.Sender);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Console.Print($"Client({networkEvent.Sender.ConnectionId}) connection refused");
|
Console.Print($"Client({networkEvent.Sender.ConnectionId}) connection refused");
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ namespace Game
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Manages world simulation and handles network messages
|
||||||
public static class WorldStateManager //FIXME: remove static for better init/cleanup
|
public class WorldStateManager
|
||||||
{
|
{
|
||||||
private class WorldState
|
private class WorldState
|
||||||
{
|
{
|
||||||
@@ -43,28 +43,42 @@ namespace Game
|
|||||||
public Float3 position;
|
public Float3 position;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Dictionary<uint, PlayerActor> players;
|
private Dictionary<uint, PlayerActor> players;
|
||||||
private static Dictionary<uint, NetworkConnection> playerConnections;
|
private Dictionary<uint, NetworkConnection> playerConnections;
|
||||||
public static Dictionary<uint, ulong> playerLastReceivedFrames;
|
public Dictionary<uint, ulong> playerLastReceivedFrames;
|
||||||
private static Dictionary<uint, ulong> playerLastFrame;
|
private Dictionary<uint, ulong> playerLastFrame;
|
||||||
private static bool welcomed = false;
|
private bool welcomed = false;
|
||||||
|
|
||||||
private static WorldState serverWorldState;
|
private WorldState serverWorldState;
|
||||||
private static WorldState clientWorldState;
|
private WorldState clientWorldState;
|
||||||
private static GameMode gameMode;
|
private GameMode gameMode;
|
||||||
|
|
||||||
private static ulong lastReceivedServerFrame = 0;
|
private ulong lastReceivedServerFrame = 0;
|
||||||
public static ulong ServerFrame => /*NetworkManager.server != null ? serverWorldState.frame :*/ lastReceivedServerFrame;
|
public ulong ServerFrame => /*NetworkManager.server != null ? serverWorldState.frame :*/ lastReceivedServerFrame;
|
||||||
public static ulong ClientFrame => clientWorldState.frame;
|
public ulong ClientFrame => clientWorldState.frame;
|
||||||
public static float ServerTime = 0f;
|
public float ServerTime = 0f;
|
||||||
public static float ClientTime = 0f;
|
public float ClientTime = 0f;
|
||||||
|
|
||||||
public static void Init()
|
public bool IsServer = false;
|
||||||
|
public bool IsClient = false;
|
||||||
|
public bool IsLocalClient = false; // Context dependant, true when message is handled by local client
|
||||||
|
|
||||||
|
public WorldStateManager(bool isServer = false, bool isClient = false, bool isLocalClient = false)
|
||||||
{
|
{
|
||||||
welcomed = false;
|
IsServer = isServer;
|
||||||
lastReceivedServerFrame = 0;
|
IsClient = isClient;
|
||||||
|
IsLocalClient = isLocalClient;
|
||||||
|
Assert.IsTrue(isServer || isClient || isLocalClient);
|
||||||
|
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Init()
|
||||||
|
{
|
||||||
|
//welcomed = false;
|
||||||
|
//lastReceivedServerFrame = 0;
|
||||||
ServerTime = Time.GameTime;
|
ServerTime = Time.GameTime;
|
||||||
ClientTime = 0f;
|
//ClientTime = 0f;
|
||||||
|
|
||||||
players = new Dictionary<uint, PlayerActor>();
|
players = new Dictionary<uint, PlayerActor>();
|
||||||
playerConnections = new Dictionary<uint, NetworkConnection>();
|
playerConnections = new Dictionary<uint, NetworkConnection>();
|
||||||
@@ -80,7 +94,7 @@ namespace Game
|
|||||||
Scripting.LateFixedUpdate += OnLateUpdatePre;
|
Scripting.LateFixedUpdate += OnLateUpdatePre;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Cleanup()
|
public void Cleanup()
|
||||||
{
|
{
|
||||||
NetworkManager.OnMessage -= OnMessage;
|
NetworkManager.OnMessage -= OnMessage;
|
||||||
Level.SceneLoaded -= OnLevelLoaded;
|
Level.SceneLoaded -= OnLevelLoaded;
|
||||||
@@ -93,7 +107,7 @@ namespace Game
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static PlayerFrame GetPlayerFrame(uint playerIndex, ulong playerFrameIndex)
|
private PlayerFrame GetPlayerFrame(uint playerIndex, ulong playerFrameIndex)
|
||||||
{
|
{
|
||||||
WorldState worldState = NetworkManager.server != null ? serverWorldState : clientWorldState;
|
WorldState worldState = NetworkManager.server != null ? serverWorldState : clientWorldState;
|
||||||
PlayerFrame[] playerFrames = worldState.playerFrameHistory[playerIndex];
|
PlayerFrame[] playerFrames = worldState.playerFrameHistory[playerIndex];
|
||||||
@@ -105,13 +119,13 @@ namespace Game
|
|||||||
return playerFrame;
|
return playerFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void OnLevelLoaded(Scene scene, Guid assetGuid)
|
public void OnLevelLoaded(Scene scene, Guid assetGuid)
|
||||||
{
|
{
|
||||||
serverWorldState.frame = 0;
|
serverWorldState.frame = 0;
|
||||||
Console.Print("level loaded");
|
Console.Print("level loaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void OnLateUpdatePre()
|
public void OnLateUpdatePre()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -128,7 +142,7 @@ namespace Game
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void OnLateUpdate()
|
public void OnLateUpdate()
|
||||||
{
|
{
|
||||||
if (NetworkManager.IsServer)
|
if (NetworkManager.IsServer)
|
||||||
{
|
{
|
||||||
@@ -278,7 +292,17 @@ namespace Game
|
|||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool OnMessage(ref NetworkEvent networkEvent)
|
public bool OnMessageServer(ref NetworkEvent networkEvent)
|
||||||
|
{
|
||||||
|
return OnMessage(ref networkEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool OnMessageClient(ref NetworkEvent networkEvent)
|
||||||
|
{
|
||||||
|
return OnMessage(ref networkEvent /*NetworkMessage message, NetworkConnection sender*/);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool OnMessage(ref NetworkEvent networkEvent)
|
||||||
{
|
{
|
||||||
byte messageTypeByte = networkEvent.Message.ReadByte();
|
byte messageTypeByte = networkEvent.Message.ReadByte();
|
||||||
if (!Enum.IsDefined(typeof(GameModeMessageType), messageTypeByte))
|
if (!Enum.IsDefined(typeof(GameModeMessageType), messageTypeByte))
|
||||||
@@ -404,7 +428,7 @@ namespace Game
|
|||||||
//Console.Print($"packet wrong order, last received: {lastReceivedServerFrame}, new: {reportedFrame}");
|
//Console.Print($"packet wrong order, last received: {lastReceivedServerFrame}, new: {reportedFrame}");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NetworkManager.IsClient)
|
if (NetworkManager.IsClient)
|
||||||
{
|
{
|
||||||
if (reportedPlayerId == NetworkManager.LocalPlayerClientId)
|
if (reportedPlayerId == NetworkManager.LocalPlayerClientId)
|
||||||
@@ -447,7 +471,7 @@ namespace Game
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool OnClientConnecting(NetworkConnection connection)
|
public bool OnClientConnecting(NetworkConnection connection)
|
||||||
{
|
{
|
||||||
//if (connection.ConnectionId != NetworkManager.LocalPlayerClientId)
|
//if (connection.ConnectionId != NetworkManager.LocalPlayerClientId)
|
||||||
{
|
{
|
||||||
@@ -483,7 +507,7 @@ namespace Game
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool OnClientConnected(NetworkConnection connection)
|
public bool OnClientConnected(NetworkConnection connection)
|
||||||
{
|
{
|
||||||
uint playerId = connection.ConnectionId;
|
uint playerId = connection.ConnectionId;
|
||||||
if (NetworkManager.LocalPlayerClientId == 0)
|
if (NetworkManager.LocalPlayerClientId == 0)
|
||||||
@@ -494,7 +518,7 @@ namespace Game
|
|||||||
|
|
||||||
var randomSpawn = spawns.First();
|
var randomSpawn = spawns.First();
|
||||||
|
|
||||||
|
|
||||||
Float3 position = randomSpawn.Position + new Float3(0f, 4.1f, 0f);
|
Float3 position = randomSpawn.Position + new Float3(0f, 4.1f, 0f);
|
||||||
Float3 eulerAngles = randomSpawn.Orientation.EulerAngles;
|
Float3 eulerAngles = randomSpawn.Orientation.EulerAngles;
|
||||||
|
|
||||||
@@ -524,7 +548,7 @@ namespace Game
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SpawnPlayer(uint playerId, Float3 position, Vector3 eulerAngles)
|
private void SpawnPlayer(uint playerId, Float3 position, Vector3 eulerAngles)
|
||||||
{
|
{
|
||||||
if (NetworkManager.IsServer && !playerLastFrame.ContainsKey(playerId))
|
if (NetworkManager.IsServer && !playerLastFrame.ContainsKey(playerId))
|
||||||
playerLastFrame.Add(playerId, serverWorldState.frame);
|
playerLastFrame.Add(playerId, serverWorldState.frame);
|
||||||
@@ -556,7 +580,7 @@ namespace Game
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void UpdatePlayerInput(uint playerId, PlayerInputState inputState)
|
private void UpdatePlayerInput(uint playerId, PlayerInputState inputState)
|
||||||
{
|
{
|
||||||
if (playerId == NetworkManager.LocalPlayerClientId)
|
if (playerId == NetworkManager.LocalPlayerClientId)
|
||||||
{
|
{
|
||||||
@@ -590,7 +614,7 @@ namespace Game
|
|||||||
|
|
||||||
playerMovement.ApplyInputToCamera(lastInputState, true);
|
playerMovement.ApplyInputToCamera(lastInputState, true);
|
||||||
playerMovement.SimulatePlayerMovement(lastInputState);
|
playerMovement.SimulatePlayerMovement(lastInputState);
|
||||||
|
|
||||||
playerMovement.input.SetState(frame, lastInputState, new PlayerActorState()
|
playerMovement.input.SetState(frame, lastInputState, new PlayerActorState()
|
||||||
{
|
{
|
||||||
position = playerActor.Position,
|
position = playerActor.Position,
|
||||||
|
|||||||
@@ -106,7 +106,8 @@ namespace Game
|
|||||||
private readonly bool demoDeltasCorrect = true;
|
private readonly bool demoDeltasCorrect = true;
|
||||||
private readonly bool demoDeltasVerify = true;
|
private readonly bool demoDeltasVerify = true;
|
||||||
|
|
||||||
|
|
||||||
|
private WorldStateManager worldStateManager;
|
||||||
|
|
||||||
private bool predicting = false;
|
private bool predicting = false;
|
||||||
|
|
||||||
@@ -188,13 +189,15 @@ namespace Game
|
|||||||
//string demoPath = System.IO.Path.Combine(AssetManager.DemoPath, $"{DateTimeOffset.Now.UtcTicks}.gdem");
|
//string demoPath = System.IO.Path.Combine(AssetManager.DemoPath, $"{DateTimeOffset.Now.UtcTicks}.gdem");
|
||||||
//input = new PlayerInputLocal(playerActor, demoPath); // TODO: support recording
|
//input = new PlayerInputLocal(playerActor, demoPath); // TODO: support recording
|
||||||
input = new PlayerInputLocal(playerActor);
|
input = new PlayerInputLocal(playerActor);
|
||||||
|
worldStateManager = NetworkManager.serverWorldStateManager;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Console.Print("network player: " + playerId.ToString());
|
Console.Print("network player: " + playerId.ToString());
|
||||||
input = new PlayerInputNetwork();
|
input = new PlayerInputNetwork();
|
||||||
|
worldStateManager = NetworkManager.clientWorldStateManager;
|
||||||
}
|
}
|
||||||
|
Assert.IsTrue(worldStateManager != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetInput(string demoFile)
|
public void SetInput(string demoFile)
|
||||||
@@ -444,10 +447,10 @@ namespace Game
|
|||||||
|
|
||||||
//viewAngles = viewAnglesLastFrame;
|
//viewAngles = viewAnglesLastFrame;
|
||||||
bool canpredict = true;
|
bool canpredict = true;
|
||||||
if (true && input.Predict /*&& !NetworkManager.IsDemoPlaying*/ && WorldStateManager.ClientFrame > 0 && WorldStateManager.ServerFrame > 0)
|
if (true && input.Predict /*&& !NetworkManager.IsDemoPlaying*/ && worldStateManager.ClientFrame > 0 && worldStateManager.ServerFrame > 0)
|
||||||
{
|
{
|
||||||
ulong currentFrame = WorldStateManager.ServerFrame;
|
ulong currentFrame = worldStateManager.ServerFrame;
|
||||||
for (; currentFrame < WorldStateManager.ClientFrame; currentFrame++)
|
for (; currentFrame < worldStateManager.ClientFrame; currentFrame++)
|
||||||
{
|
{
|
||||||
if (!input.GetState(currentFrame, out var pastInputState, out var pastActorState))
|
if (!input.GetState(currentFrame, out var pastInputState, out var pastActorState))
|
||||||
{
|
{
|
||||||
@@ -469,7 +472,7 @@ namespace Game
|
|||||||
|
|
||||||
|
|
||||||
predicting = true;
|
predicting = true;
|
||||||
currentFrame = WorldStateManager.ServerFrame;
|
currentFrame = worldStateManager.ServerFrame;
|
||||||
for (; currentFrame < lastFrame; currentFrame++)
|
for (; currentFrame < lastFrame; currentFrame++)
|
||||||
{
|
{
|
||||||
if (!input.GetState(currentFrame, out var pastInputState, out var pastActorState))
|
if (!input.GetState(currentFrame, out var pastInputState, out var pastActorState))
|
||||||
@@ -481,7 +484,7 @@ namespace Game
|
|||||||
if (currentFrame == inputState.frame)
|
if (currentFrame == inputState.frame)
|
||||||
movementState.jumped = movementState.jumped;
|
movementState.jumped = movementState.jumped;
|
||||||
|
|
||||||
if (currentFrame == WorldStateManager.ServerFrame)
|
if (currentFrame == worldStateManager.ServerFrame)
|
||||||
{
|
{
|
||||||
movementState.position = pastActorState.position;
|
movementState.position = pastActorState.position;
|
||||||
movementState.currentVelocity = pastActorState.velocity;
|
movementState.currentVelocity = pastActorState.velocity;
|
||||||
@@ -891,8 +894,8 @@ namespace Game
|
|||||||
|
|
||||||
if (false)
|
if (false)
|
||||||
{
|
{
|
||||||
if (WorldStateManager.ServerFrame > 0 && WorldStateManager.ClientFrame > 0)
|
if (worldStateManager.ServerFrame > 0 && worldStateManager.ClientFrame > 0)
|
||||||
for (ulong frame = WorldStateManager.ServerFrame; frame < WorldStateManager.ClientFrame; frame++)
|
for (ulong frame = worldStateManager.ServerFrame; frame < worldStateManager.ClientFrame; frame++)
|
||||||
{
|
{
|
||||||
if (!input.GetState(frame, out var pastInputState, out var pastActorState))
|
if (!input.GetState(frame, out var pastInputState, out var pastActorState))
|
||||||
continue;
|
continue;
|
||||||
@@ -902,7 +905,7 @@ namespace Game
|
|||||||
|
|
||||||
Float4 color1 = new Float4(Color.Red.R, Color.Red.G, Color.Red.B, Color.Red.A);
|
Float4 color1 = new Float4(Color.Red.R, Color.Red.G, Color.Red.B, Color.Red.A);
|
||||||
Float4 color2 = new Float4(Color.Blue.R, Color.Blue.G, Color.Blue.B, Color.Blue.A);
|
Float4 color2 = new Float4(Color.Blue.R, Color.Blue.G, Color.Blue.B, Color.Blue.A);
|
||||||
Float4 color3 = Float4.Lerp(color1, color2, (float)(frame - WorldStateManager.ServerFrame) / (float)(WorldStateManager.ClientFrame - WorldStateManager.ServerFrame));
|
Float4 color3 = Float4.Lerp(color1, color2, (float)(frame - worldStateManager.ServerFrame) / (float)(worldStateManager.ClientFrame - worldStateManager.ServerFrame));
|
||||||
Color color = new Color(color3.X, color3.Y, color3.Z, color3.W);
|
Color color = new Color(color3.X, color3.Y, color3.Z, color3.W);
|
||||||
DebugDraw.DrawBox(bbox, color * 1f);
|
DebugDraw.DrawBox(bbox, color * 1f);
|
||||||
}
|
}
|
||||||
@@ -910,7 +913,7 @@ namespace Game
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
var serverBbox = boxCollider.OrientedBox.GetBoundingBox();
|
var serverBbox = boxCollider.OrientedBox.GetBoundingBox();
|
||||||
if (input.GetState(WorldStateManager.ServerFrame, out var serverInputState, out var serverActorState))
|
if (input.GetState(worldStateManager.ServerFrame, out var serverInputState, out var serverActorState))
|
||||||
serverBbox.Center = serverActorState.position;
|
serverBbox.Center = serverActorState.position;
|
||||||
|
|
||||||
if (serverBbox.Center == clientBbox.Center)
|
if (serverBbox.Center == clientBbox.Center)
|
||||||
@@ -1159,7 +1162,7 @@ namespace Game
|
|||||||
|
|
||||||
public void SimulatePlayerMovement(PlayerInputState inputState)
|
public void SimulatePlayerMovement(PlayerInputState inputState)
|
||||||
{
|
{
|
||||||
simulationTime = WorldStateManager.ClientTime + (inputState.frame * (1.0f / Time.PhysicsFPS));
|
simulationTime = worldStateManager.ClientTime + (inputState.frame * (1.0f / Time.PhysicsFPS));
|
||||||
|
|
||||||
Vector3 inputDirection =
|
Vector3 inputDirection =
|
||||||
new Float3(inputState.moveRight, 0.0f, inputState.moveForward);
|
new Float3(inputState.moveRight, 0.0f, inputState.moveForward);
|
||||||
|
|||||||
@@ -6,6 +6,13 @@
|
|||||||
"executablePath": "C:/dev/Flax/FlaxEngine/Binaries/Editor/Win64/Development/FlaxEditor.exe",
|
"executablePath": "C:/dev/Flax/FlaxEngine/Binaries/Editor/Win64/Development/FlaxEditor.exe",
|
||||||
"commandLineArgs": "-project \"C:/dev/GoakeFlax\"",
|
"commandLineArgs": "-project \"C:/dev/GoakeFlax\"",
|
||||||
"nativeDebugging": false
|
"nativeDebugging": false
|
||||||
|
},
|
||||||
|
"Game Debug": {
|
||||||
|
"commandName": "Executable",
|
||||||
|
"workingDirectory": "C:/dev/GoakeFlax",
|
||||||
|
"executablePath": "C:/dev/Flax/FlaxEngine/Binaries/Editor/Win64/Debug/FlaxEditor.exe",
|
||||||
|
"commandLineArgs": "-project \"C:/dev/GoakeFlax\"",
|
||||||
|
"nativeDebugging": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user