dotnet7 compat, DLSS, network manager rewrite and other fixes
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using FlaxEngine;
|
||||
using FlaxEngine.Networking;
|
||||
using Console = Game.Console;
|
||||
|
||||
namespace Game
|
||||
@@ -22,7 +23,7 @@ namespace Game
|
||||
//public Float3 maxEndPosition;
|
||||
}
|
||||
|
||||
[Networked]
|
||||
//[Networked]
|
||||
public class PlayerMovement : Script
|
||||
{
|
||||
// FIXME, should be much smaller but needed to avoid issues with box collider edges against brush edges diagonally
|
||||
@@ -161,20 +162,20 @@ namespace Game
|
||||
|
||||
public void SetInput(uint playerId)
|
||||
{
|
||||
if (playerId == 0)
|
||||
input = new PlayerInput();
|
||||
else if (playerId == NetworkManager.LocalPlayerClientId)
|
||||
//if (playerId == 0)
|
||||
// input = new PlayerInput();
|
||||
PlayerId = playerId;
|
||||
if (NetworkReplicator.GetObjectRole(this.Parent) == NetworkObjectRole.OwnedAuthoritative)// if (playerId == NetworkManager.LocalPlayerClientId)
|
||||
{
|
||||
Console.Print("local player: " + playerId.ToString());
|
||||
string demoPath = System.IO.Path.Combine(AssetManager.DemoPath, $"{DateTimeOffset.Now.UtcTicks}.gdem");
|
||||
input = new PlayerInputLocal(demoPath); // TODO: support recording
|
||||
PlayerId = playerId;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Print("network player: " + playerId.ToString());
|
||||
input = new PlayerInputNetwork();
|
||||
PlayerId = playerId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,6 +192,9 @@ namespace Game
|
||||
SetCameraEulerAngles(input.GetCurrentInputState().verificationViewAngles);
|
||||
}
|
||||
|
||||
public override void OnEnable()
|
||||
{
|
||||
}
|
||||
public override void OnDisable()
|
||||
{
|
||||
base.OnDisable();
|
||||
@@ -283,8 +287,8 @@ namespace Game
|
||||
input.OnUpdate();
|
||||
|
||||
float deltadif = Time.DeltaTime - 1.0f / Time.PhysicsFPS;
|
||||
if (Math.Abs(deltadif) > 0.0001f)
|
||||
Console.Print("drift: " + deltadif);
|
||||
//if (Math.Abs(deltadif) > 0.0001f)
|
||||
// Console.Print("drift: " + deltadif);
|
||||
|
||||
input.OnFixedUpdate();
|
||||
PlayerInputState inputState = input.GetCurrentInputState();
|
||||
|
||||
Reference in New Issue
Block a user