mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-15 22:50:56 +00:00
remove QNetworkIdentity.PlayerIdentity
This commit is contained in:
parent
62f7b4e1f1
commit
d6c391d2ec
@ -17,7 +17,7 @@ namespace QSB.Syncs
|
||||
|
||||
public abstract class SyncBase<T> : QNetworkTransform where T : Component
|
||||
{
|
||||
public uint PlayerId => IsPlayerObject ? NetIdentity.PlayerIdentity.NetId.Value : uint.MaxValue;
|
||||
public uint PlayerId { get; private set; } = uint.MaxValue;
|
||||
public PlayerInfo Player => QSBPlayerManager.GetPlayer(PlayerId);
|
||||
|
||||
private bool _baseIsReady
|
||||
@ -79,10 +79,12 @@ namespace QSB.Syncs
|
||||
{
|
||||
if (IsPlayerObject)
|
||||
{
|
||||
var lowestBound = QSBWorldSync.GetUnityObjects<PlayerTransformSync>()
|
||||
.Where(x => x.NetId.Value <= NetId.Value)
|
||||
.OrderBy(x => x.NetId.Value).Last();
|
||||
NetIdentity.PlayerIdentity = lowestBound.NetIdentity;
|
||||
// get player objects spawned before this object (or is this one)
|
||||
// and use the most recently spawned one
|
||||
PlayerId = QSBWorldSync.GetUnityObjects<PlayerTransformSync>()
|
||||
.Select(x => x.NetId.Value)
|
||||
.Where(x => x <= NetId.Value)
|
||||
.Max();
|
||||
}
|
||||
|
||||
DontDestroyOnLoad(gameObject);
|
||||
|
@ -21,7 +21,6 @@ namespace QuantumUNET.Components
|
||||
public short PlayerControllerId { get; private set; } = -1;
|
||||
public QNetworkConnection ConnectionToServer { get; private set; }
|
||||
public QNetworkConnection ConnectionToClient { get; private set; }
|
||||
public QNetworkIdentity PlayerIdentity { get; set; }
|
||||
|
||||
public bool ServerOnly
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user