mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-22 12:39:51 +00:00
Merge branch 'dev' of https://github.com/misternebula/quantum-space-buddies into dev
This commit is contained in:
commit
caad8eefb2
1
.gitignore
vendored
1
.gitignore
vendored
@ -405,3 +405,4 @@ qsb-unityproject
|
|||||||
|
|
||||||
# User specific locations
|
# User specific locations
|
||||||
DevEnv.targets
|
DevEnv.targets
|
||||||
|
QSB/debugsettings.json
|
@ -46,12 +46,12 @@ namespace QSB.EchoesOfTheEye.LightSensorSync.Patches
|
|||||||
{
|
{
|
||||||
case LightSourceType.UNDEFINED:
|
case LightSourceType.UNDEFINED:
|
||||||
{
|
{
|
||||||
var owlight = source as OWLight2;
|
var light = source as OWLight2;
|
||||||
var occludableLight = owlight.GetLight().shadows != LightShadows.None
|
var occludableLight = light.GetLight().shadows != LightShadows.None
|
||||||
&& owlight.GetLight().shadowStrength > 0.5f;
|
&& light.GetLight().shadowStrength > 0.5f;
|
||||||
|
|
||||||
if (owlight.CheckIlluminationAtPoint(vector, __instance._sensorRadius, __instance._maxDistance)
|
if (light.CheckIlluminationAtPoint(vector, __instance._sensorRadius, __instance._maxDistance)
|
||||||
&& !__instance.CheckOcclusion(owlight.transform.position, vector, sensorWorldDir, occludableLight))
|
&& !__instance.CheckOcclusion(light.transform.position, vector, sensorWorldDir, occludableLight))
|
||||||
{
|
{
|
||||||
__instance._illuminated = true;
|
__instance._illuminated = true;
|
||||||
}
|
}
|
||||||
@ -60,7 +60,7 @@ namespace QSB.EchoesOfTheEye.LightSensorSync.Patches
|
|||||||
}
|
}
|
||||||
case LightSourceType.FLASHLIGHT:
|
case LightSourceType.FLASHLIGHT:
|
||||||
{
|
{
|
||||||
if (source is Flashlight && (source as Flashlight) == Locator.GetFlashlight())
|
if (source is Flashlight light && light == Locator.GetFlashlight())
|
||||||
{
|
{
|
||||||
var position = Locator.GetPlayerCamera().transform.position;
|
var position = Locator.GetPlayerCamera().transform.position;
|
||||||
var to = __instance.transform.position - position;
|
var to = __instance.transform.position - position;
|
||||||
@ -119,12 +119,12 @@ namespace QSB.EchoesOfTheEye.LightSensorSync.Patches
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LightSourceType.SIMPLE_LANTERN:
|
case LightSourceType.SIMPLE_LANTERN:
|
||||||
foreach (var owlight in __instance._lightSources[i].GetLights())
|
foreach (var light in __instance._lightSources[i].GetLights())
|
||||||
{
|
{
|
||||||
var occludableLight = owlight.GetLight().shadows != LightShadows.None
|
var occludableLight = light.GetLight().shadows != LightShadows.None
|
||||||
&& owlight.GetLight().shadowStrength > 0.5f;
|
&& light.GetLight().shadowStrength > 0.5f;
|
||||||
var maxDistance = Mathf.Min(__instance._maxSimpleLanternDistance, __instance._maxDistance);
|
var maxDistance = Mathf.Min(__instance._maxSimpleLanternDistance, __instance._maxDistance);
|
||||||
if (owlight.CheckIlluminationAtPoint(vector, __instance._sensorRadius, maxDistance) && !__instance.CheckOcclusion(owlight.transform.position, vector, sensorWorldDir, occludableLight))
|
if (light.CheckIlluminationAtPoint(vector, __instance._sensorRadius, maxDistance) && !__instance.CheckOcclusion(light.transform.position, vector, sensorWorldDir, occludableLight))
|
||||||
{
|
{
|
||||||
__instance._illuminated = true;
|
__instance._illuminated = true;
|
||||||
break;
|
break;
|
||||||
|
@ -35,7 +35,7 @@ namespace QSB.ItemSync.Messages
|
|||||||
player.AnimationSync.VisibleAnimator.SetTrigger("HoldScroll");
|
player.AnimationSync.VisibleAnimator.SetTrigger("HoldScroll");
|
||||||
break;
|
break;
|
||||||
case ItemType.WarpCore:
|
case ItemType.WarpCore:
|
||||||
if ((WorldObject as QSBWarpCoreItem).IsVesselCoreType())
|
if (((QSBWarpCoreItem)WorldObject).IsVesselCoreType())
|
||||||
{
|
{
|
||||||
DebugLog.DebugWrite($"HOLD VESSEL CORE");
|
DebugLog.DebugWrite($"HOLD VESSEL CORE");
|
||||||
player.AnimationSync.VisibleAnimator.SetTrigger("HoldAdvWarpCore");
|
player.AnimationSync.VisibleAnimator.SetTrigger("HoldAdvWarpCore");
|
||||||
|
@ -61,10 +61,12 @@ namespace QSB.ShipSync
|
|||||||
{
|
{
|
||||||
transform.position = Locator.GetPlayerTransform().position;
|
transform.position = Locator.GetPlayerTransform().position;
|
||||||
_playerAttachPoint.AttachPlayer();
|
_playerAttachPoint.AttachPlayer();
|
||||||
|
ShipManager.Instance.CockpitController._shipAudioController.PlayBuckle();
|
||||||
}
|
}
|
||||||
else if (attachedToUs && OWInput.IsNewlyPressed(InputLibrary.cancel, InputMode.Character))
|
else if (attachedToUs && OWInput.IsNewlyPressed(InputLibrary.cancel, InputMode.Character))
|
||||||
{
|
{
|
||||||
_playerAttachPoint.DetachPlayer();
|
_playerAttachPoint.DetachPlayer();
|
||||||
|
ShipManager.Instance.CockpitController._shipAudioController.PlayUnbuckle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,9 @@ namespace QSB.Utility
|
|||||||
[JsonProperty("dumpWorldObjects")]
|
[JsonProperty("dumpWorldObjects")]
|
||||||
public bool DumpWorldObjects;
|
public bool DumpWorldObjects;
|
||||||
|
|
||||||
|
[JsonProperty("playerIdInLogs")]
|
||||||
|
public bool PlayerIdInLogs;
|
||||||
|
|
||||||
[JsonProperty("debugMode")]
|
[JsonProperty("debugMode")]
|
||||||
public bool DebugMode;
|
public bool DebugMode;
|
||||||
|
|
||||||
@ -43,9 +46,5 @@ namespace QSB.Utility
|
|||||||
[JsonProperty("greySkybox")]
|
[JsonProperty("greySkybox")]
|
||||||
private bool _greySkybox;
|
private bool _greySkybox;
|
||||||
public bool GreySkybox => DebugMode && _greySkybox;
|
public bool GreySkybox => DebugMode && _greySkybox;
|
||||||
|
|
||||||
[JsonProperty("playerIdInLogs")]
|
|
||||||
private bool _playerIdInLogs;
|
|
||||||
public bool PlayerIdInLogs => DebugMode && _playerIdInLogs;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,33 @@ namespace QSB.Utility
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SendInitialState(uint to)
|
||||||
|
{
|
||||||
|
if (!isClient)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hasAuthority)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!NetworkClient.ready)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_lastSendTime = NetworkTime.localTime;
|
||||||
|
|
||||||
|
using var writer = NetworkWriterPool.GetWriter();
|
||||||
|
Serialize(writer);
|
||||||
|
UpdatePrevData();
|
||||||
|
|
||||||
|
var data = writer.ToArraySegment();
|
||||||
|
CmdSendInitialData(to, data);
|
||||||
|
}
|
||||||
|
|
||||||
[Command(channel = Channels.Reliable, requiresAuthority = true)]
|
[Command(channel = Channels.Reliable, requiresAuthority = true)]
|
||||||
private void CmdSendDataReliable(ArraySegment<byte> data) => RpcSendDataReliable(data);
|
private void CmdSendDataReliable(ArraySegment<byte> data) => RpcSendDataReliable(data);
|
||||||
|
|
||||||
@ -69,6 +96,12 @@ namespace QSB.Utility
|
|||||||
[ClientRpc(channel = Channels.Unreliable, includeOwner = false)]
|
[ClientRpc(channel = Channels.Unreliable, includeOwner = false)]
|
||||||
private void RpcSendDataUnreliable(ArraySegment<byte> data) => OnData(data);
|
private void RpcSendDataUnreliable(ArraySegment<byte> data) => OnData(data);
|
||||||
|
|
||||||
|
[Command(channel = Channels.Reliable, requiresAuthority = true)]
|
||||||
|
private void CmdSendInitialData(uint to, ArraySegment<byte> data) => TargetSendInitialData(to.GetNetworkConnection(), data);
|
||||||
|
|
||||||
|
[TargetRpc(channel = Channels.Reliable)]
|
||||||
|
private void TargetSendInitialData(NetworkConnection target, ArraySegment<byte> data) => OnData(data);
|
||||||
|
|
||||||
private void OnData(ArraySegment<byte> data)
|
private void OnData(ArraySegment<byte> data)
|
||||||
{
|
{
|
||||||
using var reader = NetworkReaderPool.GetReader(data);
|
using var reader = NetworkReaderPool.GetReader(data);
|
||||||
|
@ -31,6 +31,11 @@ namespace QSB.WorldSync
|
|||||||
{
|
{
|
||||||
worldObject.SendInitialState(to);
|
worldObject.SendInitialState(to);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var qsbNetworkBehaviour in QSBWorldSync.GetUnityObjects<QSBNetworkBehaviour>())
|
||||||
|
{
|
||||||
|
qsbNetworkBehaviour.SendInitialState(to);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
{
|
{
|
||||||
"useKcpTransport": true,
|
"useKcpTransport": false,
|
||||||
"overrideAppId": -1,
|
"overrideAppId": -1,
|
||||||
"dumpWorldObjects": false,
|
"dumpWorldObjects": false,
|
||||||
"debugMode": true,
|
"playerIdInLogs": false
|
||||||
"drawGui": true,
|
"debugMode": false,
|
||||||
"drawLines": true,
|
"drawGui": false,
|
||||||
|
"drawLines": false,
|
||||||
"drawLabels": false,
|
"drawLabels": false,
|
||||||
"drawQuantumVisibilityObjects": false,
|
"drawQuantumVisibilityObjects": false,
|
||||||
"avoidTimeSync": false,
|
"avoidTimeSync": false,
|
||||||
"skipTitleScreen": true,
|
"skipTitleScreen": false,
|
||||||
"greySkybox": false,
|
"greySkybox": false,
|
||||||
"playerIdInLogs": false
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user