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 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);
|
public PlayerInfo Player => QSBPlayerManager.GetPlayer(PlayerId);
|
||||||
|
|
||||||
private bool _baseIsReady
|
private bool _baseIsReady
|
||||||
@ -79,10 +79,12 @@ namespace QSB.Syncs
|
|||||||
{
|
{
|
||||||
if (IsPlayerObject)
|
if (IsPlayerObject)
|
||||||
{
|
{
|
||||||
var lowestBound = QSBWorldSync.GetUnityObjects<PlayerTransformSync>()
|
// get player objects spawned before this object (or is this one)
|
||||||
.Where(x => x.NetId.Value <= NetId.Value)
|
// and use the most recently spawned one
|
||||||
.OrderBy(x => x.NetId.Value).Last();
|
PlayerId = QSBWorldSync.GetUnityObjects<PlayerTransformSync>()
|
||||||
NetIdentity.PlayerIdentity = lowestBound.NetIdentity;
|
.Select(x => x.NetId.Value)
|
||||||
|
.Where(x => x <= NetId.Value)
|
||||||
|
.Max();
|
||||||
}
|
}
|
||||||
|
|
||||||
DontDestroyOnLoad(gameObject);
|
DontDestroyOnLoad(gameObject);
|
||||||
|
@ -21,7 +21,6 @@ namespace QuantumUNET.Components
|
|||||||
public short PlayerControllerId { get; private set; } = -1;
|
public short PlayerControllerId { get; private set; } = -1;
|
||||||
public QNetworkConnection ConnectionToServer { get; private set; }
|
public QNetworkConnection ConnectionToServer { get; private set; }
|
||||||
public QNetworkConnection ConnectionToClient { get; private set; }
|
public QNetworkConnection ConnectionToClient { get; private set; }
|
||||||
public QNetworkIdentity PlayerIdentity { get; set; }
|
|
||||||
|
|
||||||
public bool ServerOnly
|
public bool ServerOnly
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user