record demos as packets
This commit is contained in:
@@ -27,9 +27,11 @@ namespace Game
|
||||
|
||||
public override bool Predict => true;
|
||||
|
||||
public PlayerInputLocal(PlayerActor playerActor, string demoPath)
|
||||
public PlayerInputLocal(PlayerActor playerActor, string demoPath = null)
|
||||
{
|
||||
this.playerActor = playerActor;
|
||||
if (demoPath == null)
|
||||
return;
|
||||
var demoFolder = Directory.GetParent(demoPath);
|
||||
if (!demoFolder.Exists)
|
||||
Directory.CreateDirectory(demoFolder.FullName);
|
||||
@@ -72,6 +74,7 @@ namespace Game
|
||||
|
||||
public override void OnEndFrame()
|
||||
{
|
||||
currentState.input.frame = frame;
|
||||
if (IsRecording)
|
||||
{
|
||||
currentState.input.verificationPosition = currentState.actor.position;
|
||||
@@ -79,7 +82,6 @@ namespace Game
|
||||
currentState.input.verificationViewAngles = currentState.actor.viewAngles;
|
||||
currentState.input.verificationOrientation = currentState.actor.orientation;
|
||||
|
||||
currentState.input.frame = frame;
|
||||
buffer.Add(currentState.input);
|
||||
}
|
||||
|
||||
@@ -111,14 +113,6 @@ namespace Game
|
||||
currentState.input.viewDeltaY = 0;
|
||||
}
|
||||
|
||||
public override void RecordCurrentActorState(PlayerActorState actorState)
|
||||
{
|
||||
if (!IsRecording)
|
||||
return;
|
||||
|
||||
base.RecordCurrentActorState(actorState);
|
||||
}
|
||||
|
||||
public void FlushDemo()
|
||||
{
|
||||
if (!IsRecording)
|
||||
|
||||
Reference in New Issue
Block a user