mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-21 18:40:03 +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
|
||||
DevEnv.targets
|
||||
QSB/debugsettings.json
|
@ -46,12 +46,12 @@ namespace QSB.EchoesOfTheEye.LightSensorSync.Patches
|
||||
{
|
||||
case LightSourceType.UNDEFINED:
|
||||
{
|
||||
var owlight = source as OWLight2;
|
||||
var occludableLight = owlight.GetLight().shadows != LightShadows.None
|
||||
&& owlight.GetLight().shadowStrength > 0.5f;
|
||||
var light = source as OWLight2;
|
||||
var occludableLight = light.GetLight().shadows != LightShadows.None
|
||||
&& light.GetLight().shadowStrength > 0.5f;
|
||||
|
||||
if (owlight.CheckIlluminationAtPoint(vector, __instance._sensorRadius, __instance._maxDistance)
|
||||
&& !__instance.CheckOcclusion(owlight.transform.position, vector, sensorWorldDir, occludableLight))
|
||||
if (light.CheckIlluminationAtPoint(vector, __instance._sensorRadius, __instance._maxDistance)
|
||||
&& !__instance.CheckOcclusion(light.transform.position, vector, sensorWorldDir, occludableLight))
|
||||
{
|
||||
__instance._illuminated = true;
|
||||
}
|
||||
@ -60,7 +60,7 @@ namespace QSB.EchoesOfTheEye.LightSensorSync.Patches
|
||||
}
|
||||
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 to = __instance.transform.position - position;
|
||||
@ -119,12 +119,12 @@ namespace QSB.EchoesOfTheEye.LightSensorSync.Patches
|
||||
break;
|
||||
}
|
||||
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
|
||||
&& owlight.GetLight().shadowStrength > 0.5f;
|
||||
var occludableLight = light.GetLight().shadows != LightShadows.None
|
||||
&& light.GetLight().shadowStrength > 0.5f;
|
||||
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;
|
||||
break;
|
||||
|
@ -35,7 +35,7 @@ namespace QSB.ItemSync.Messages
|
||||
player.AnimationSync.VisibleAnimator.SetTrigger("HoldScroll");
|
||||
break;
|
||||
case ItemType.WarpCore:
|
||||
if ((WorldObject as QSBWarpCoreItem).IsVesselCoreType())
|
||||
if (((QSBWarpCoreItem)WorldObject).IsVesselCoreType())
|
||||
{
|
||||
DebugLog.DebugWrite($"HOLD VESSEL CORE");
|
||||
player.AnimationSync.VisibleAnimator.SetTrigger("HoldAdvWarpCore");
|
||||
|
@ -61,10 +61,12 @@ namespace QSB.ShipSync
|
||||
{
|
||||
transform.position = Locator.GetPlayerTransform().position;
|
||||
_playerAttachPoint.AttachPlayer();
|
||||
ShipManager.Instance.CockpitController._shipAudioController.PlayBuckle();
|
||||
}
|
||||
else if (attachedToUs && OWInput.IsNewlyPressed(InputLibrary.cancel, InputMode.Character))
|
||||
{
|
||||
_playerAttachPoint.DetachPlayer();
|
||||
ShipManager.Instance.CockpitController._shipAudioController.PlayUnbuckle();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,9 @@ namespace QSB.Utility
|
||||
[JsonProperty("dumpWorldObjects")]
|
||||
public bool DumpWorldObjects;
|
||||
|
||||
[JsonProperty("playerIdInLogs")]
|
||||
public bool PlayerIdInLogs;
|
||||
|
||||
[JsonProperty("debugMode")]
|
||||
public bool DebugMode;
|
||||
|
||||
@ -43,9 +46,5 @@ namespace QSB.Utility
|
||||
[JsonProperty("greySkybox")]
|
||||
private bool _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)]
|
||||
private void CmdSendDataReliable(ArraySegment<byte> data) => RpcSendDataReliable(data);
|
||||
|
||||
@ -69,6 +96,12 @@ namespace QSB.Utility
|
||||
[ClientRpc(channel = Channels.Unreliable, includeOwner = false)]
|
||||
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)
|
||||
{
|
||||
using var reader = NetworkReaderPool.GetReader(data);
|
||||
|
@ -31,6 +31,11 @@ namespace QSB.WorldSync
|
||||
{
|
||||
worldObject.SendInitialState(to);
|
||||
}
|
||||
|
||||
foreach (var qsbNetworkBehaviour in QSBWorldSync.GetUnityObjects<QSBNetworkBehaviour>())
|
||||
{
|
||||
qsbNetworkBehaviour.SendInitialState(to);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +1,14 @@
|
||||
{
|
||||
"useKcpTransport": true,
|
||||
"useKcpTransport": false,
|
||||
"overrideAppId": -1,
|
||||
"dumpWorldObjects": false,
|
||||
"debugMode": true,
|
||||
"drawGui": true,
|
||||
"drawLines": true,
|
||||
"playerIdInLogs": false
|
||||
"debugMode": false,
|
||||
"drawGui": false,
|
||||
"drawLines": false,
|
||||
"drawLabels": false,
|
||||
"drawQuantumVisibilityObjects": false,
|
||||
"avoidTimeSync": false,
|
||||
"skipTitleScreen": true,
|
||||
"skipTitleScreen": false,
|
||||
"greySkybox": false,
|
||||
"playerIdInLogs": false
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user