player id hack

This commit is contained in:
Aleksander Waage 2020-08-14 20:47:03 +02:00
parent 991e4bd33e
commit d88be7bc5f
7 changed files with 8 additions and 9 deletions

View File

@ -72,7 +72,8 @@ namespace QSB.Events
private void OnClientReceive(T message)
{
if (message.SenderId == PlayerTransformSync.LocalInstance?.netId.Value)
if (message.SenderId == PlayerTransformSync.LocalInstance?.netId.Value ||
PlayerRegistry.GetTransformSync(message.SenderId).PlayerId == PlayerTransformSync.LocalInstance?.netId.Value)
{
OnReceiveLocal(message);
return;

View File

@ -13,7 +13,7 @@ namespace QSB.TransformSync
LocalInstance = this;
}
protected override uint PlayerId => netId.Value - 2;
public override uint PlayerId => netId.Value - 2;
protected override Transform InitLocalTransform()
{

View File

@ -14,7 +14,7 @@ namespace QSB.TransformSync
LocalInstance = this;
}
protected override uint PlayerId => netId.Value - 3;
public override uint PlayerId => netId.Value - 3;
private Transform GetProbe()
{

View File

@ -1,8 +1,6 @@
using QSB.Events;
using QSB.Messaging;
using QSB.Utility;
using System;
using System.Runtime.InteropServices;
namespace QSB.TransformSync
{
@ -43,6 +41,6 @@ namespace QSB.TransformSync
transformSync.SectorName = message.SectorName;
}
public override void OnReceiveLocal(SectorMessage message) => OnReceiveRemote(message);
//public override void OnReceiveLocal(SectorMessage message) => OnReceiveRemote(message);
}
}

View File

@ -17,7 +17,7 @@ namespace QSB.TransformSync
LocalInstance = this;
}
protected override uint PlayerId => netId.Value - 0;
public override uint PlayerId => netId.Value - 0;
private Transform GetPlayerModel()
{

View File

@ -11,7 +11,7 @@ namespace QSB.TransformSync
LocalInstance = this;
}
protected override uint PlayerId => netId.Value - 1;
public override uint PlayerId => netId.Value - 1;
private Transform GetShipModel()
{

View File

@ -36,7 +36,7 @@ namespace QSB.TransformSync
protected abstract Transform InitLocalTransform();
protected abstract Transform InitRemoteTransform();
protected abstract bool IsReady { get; }
protected abstract uint PlayerId { get; }
public abstract uint PlayerId { get; }
protected void Init()
{