mirror of
https://github.com/oliverbooth/VpSharp
synced 2024-11-10 02:55:41 +00:00
Add modification timestamp
This commit is contained in:
parent
cb29ad10a4
commit
61bafac567
@ -37,6 +37,12 @@ public abstract class VirtualParadiseObject : IEquatable<VirtualParadiseObject>
|
||||
/// <value>The location of this object.</value>
|
||||
public Location Location { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the modification timestamp of this object.
|
||||
/// </summary>
|
||||
/// <value>The modification timestamp.</value>
|
||||
public DateTimeOffset ModificationTimestamp { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the owner of this object.
|
||||
/// </summary>
|
||||
@ -232,6 +238,7 @@ public abstract class VirtualParadiseObject : IEquatable<VirtualParadiseObject>
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(virtualParadiseObject);
|
||||
Location = virtualParadiseObject.Location;
|
||||
ModificationTimestamp = virtualParadiseObject.ModificationTimestamp;
|
||||
Owner = virtualParadiseObject.Owner;
|
||||
}
|
||||
|
||||
|
@ -168,6 +168,7 @@ public sealed partial class VirtualParadiseClient
|
||||
{
|
||||
ObjectType type;
|
||||
int id;
|
||||
int time;
|
||||
int owner;
|
||||
Quaternion rotation;
|
||||
Vector3d position;
|
||||
@ -197,6 +198,8 @@ public sealed partial class VirtualParadiseClient
|
||||
var axis = new Vector3(rotX, rotY, rotZ);
|
||||
rotation = Quaternion.CreateFromAxisAngle(axis, angle);
|
||||
}
|
||||
|
||||
time = vp_int(sender, IntegerAttribute.ObjectTime);
|
||||
}
|
||||
|
||||
VirtualParadiseObject virtualParadiseObject = type switch
|
||||
@ -211,6 +214,7 @@ public sealed partial class VirtualParadiseClient
|
||||
|
||||
var location = new Location(CurrentWorld!, position, rotation);
|
||||
virtualParadiseObject.Location = location;
|
||||
virtualParadiseObject.ModificationTimestamp = DateTimeOffset.FromUnixTimeSeconds(time);
|
||||
virtualParadiseObject.Owner = await GetUserAsync(owner).ConfigureAwait(false);
|
||||
return virtualParadiseObject;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user