Removed GPS time of flight cause someone complained, fixed nexus lobby respawn button, and fixed gps hud points duplicating
This commit is contained in:
62
Components/MyGUIScreenMedicalsPatch.cs
Normal file
62
Components/MyGUIScreenMedicalsPatch.cs
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
using HarmonyLib;
|
||||||
|
using Sandbox.Game.GUI.HudViewers;
|
||||||
|
using Sandbox.Game.Localization;
|
||||||
|
using Sandbox.Graphics.GUI;
|
||||||
|
using SeamlessClient.Utilities;
|
||||||
|
using SpaceEngineers.Game.GUI;
|
||||||
|
using SpaceEngineers.Game.World;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using VRage;
|
||||||
|
using VRage.Collections;
|
||||||
|
|
||||||
|
namespace SeamlessClient.Components
|
||||||
|
{
|
||||||
|
public class MyGUIScreenMedicalsPatch : ComponentBase
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public override void Patch(Harmony patcher)
|
||||||
|
{
|
||||||
|
//var addSuit = PatchUtils.GetMethod(typeof(MyGuiScreenMedicals), "<RefreshMedicalRooms>g__AddSuitRespawn|86_4");
|
||||||
|
|
||||||
|
var spawninsuit = PatchUtils.GetMethod(typeof(MyGuiScreenMedicals), "RefreshMedicalRooms");
|
||||||
|
patcher.Patch(spawninsuit, postfix: new HarmonyMethod(Get(typeof(MyGUIScreenMedicalsPatch), nameof(RefreshMedicals))));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
base.Patch(patcher);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void RefreshMedicals(MyGuiScreenMedicals __instance, ListReader<MySpaceRespawnComponent.MyRespawnPointInfo> medicalRooms, object planetInfos)
|
||||||
|
{
|
||||||
|
if (!Seamless.isSeamlessServer)
|
||||||
|
return;
|
||||||
|
|
||||||
|
MyGuiControlTable myGuiControlTable = (MyGuiControlTable)typeof(MyGuiScreenMedicals).GetField("m_respawnsTable", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(__instance);
|
||||||
|
string s = MyTexts.GetString(MySpaceTexts.SpawnInSpaceSuit);
|
||||||
|
foreach (var item in myGuiControlTable.Rows)
|
||||||
|
{
|
||||||
|
if (item.GetCell(0) == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (item.GetCell(0).Text.ToString().Contains(s))
|
||||||
|
{
|
||||||
|
item.GetCell(0).Text.Clear();
|
||||||
|
item.GetCell(0).Text.Append("Nexus Lobby");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@@ -16,9 +16,12 @@ namespace SeamlessClient.Components
|
|||||||
{
|
{
|
||||||
public class MyHudTimeTracker : ComponentBase
|
public class MyHudTimeTracker : ComponentBase
|
||||||
{
|
{
|
||||||
|
|
||||||
public override void Patch(Harmony patcher)
|
public override void Patch(Harmony patcher)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
var AppendDistance = PatchUtils.GetMethod(typeof(MyHudMarkerRender), "AppendDistance");
|
var AppendDistance = PatchUtils.GetMethod(typeof(MyHudMarkerRender), "AppendDistance");
|
||||||
|
|
||||||
patcher.Patch(AppendDistance, postfix: new HarmonyMethod(Get(typeof(MyHudTimeTracker), nameof(ApplyTimeToTarget))));
|
patcher.Patch(AppendDistance, postfix: new HarmonyMethod(Get(typeof(MyHudTimeTracker), nameof(ApplyTimeToTarget))));
|
||||||
@@ -58,9 +61,6 @@ namespace SeamlessClient.Components
|
|||||||
stringBuilder.AppendLine($" [T-{FormatDuration(t)}]");
|
stringBuilder.AppendLine($" [T-{FormatDuration(t)}]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static string FormatDuration(double durationInSeconds)
|
static string FormatDuration(double durationInSeconds)
|
||||||
{
|
{
|
||||||
if (durationInSeconds < 60)
|
if (durationInSeconds < 60)
|
||||||
@@ -98,9 +98,5 @@ namespace SeamlessClient.Components
|
|||||||
|
|
||||||
return distance / velocity;
|
return distance / velocity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -25,10 +25,17 @@ namespace SeamlessClient.OnlinePlayersWindow
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public override void Initilized()
|
public override void Update()
|
||||||
|
{
|
||||||
|
if (!Seamless.isSeamlessServer)
|
||||||
|
{
|
||||||
|
MyPerGameSettings.GUI.PlayersScreen = typeof(MyGuiScreenPlayers);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
MyPerGameSettings.GUI.PlayersScreen = typeof(OnlineNexusPlayersWindow);
|
MyPerGameSettings.GUI.PlayersScreen = typeof(OnlineNexusPlayersWindow);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void ApplyRecievedPlayers(List<OnlineClientServer> servers, int CurrentServer)
|
public static void ApplyRecievedPlayers(List<OnlineClientServer> servers, int CurrentServer)
|
||||||
{
|
{
|
||||||
|
@@ -8,6 +8,7 @@ using Sandbox.Game.Entities;
|
|||||||
using Sandbox.Game.Entities.Character;
|
using Sandbox.Game.Entities.Character;
|
||||||
using Sandbox.Game.Gui;
|
using Sandbox.Game.Gui;
|
||||||
using Sandbox.Game.GUI;
|
using Sandbox.Game.GUI;
|
||||||
|
using Sandbox.Game.GUI.HudViewers;
|
||||||
using Sandbox.Game.Multiplayer;
|
using Sandbox.Game.Multiplayer;
|
||||||
using Sandbox.Game.Replication;
|
using Sandbox.Game.Replication;
|
||||||
using Sandbox.Game.SessionComponents;
|
using Sandbox.Game.SessionComponents;
|
||||||
@@ -375,6 +376,10 @@ namespace SeamlessClient.ServerSwitching
|
|||||||
|
|
||||||
ResetReplicationTime(false);
|
ResetReplicationTime(false);
|
||||||
|
|
||||||
|
//Remove old signals
|
||||||
|
MyHud.GpsMarkers.Clear();
|
||||||
|
|
||||||
|
|
||||||
Seamless.TryShow($"2 Streaming: {clienta.HasPendingStreamingReplicables} - LastMessage: {clienta.LastMessageFromServer}");
|
Seamless.TryShow($"2 Streaming: {clienta.HasPendingStreamingReplicables} - LastMessage: {clienta.LastMessageFromServer}");
|
||||||
Seamless.TryShow($"2 NexusMajor: {Seamless.NexusVersion.Major} - ConrolledEntity {MySession.Static.ControlledEntity == null} - HumanPlayer {MySession.Static.LocalHumanPlayer == null} - Character {MySession.Static.LocalCharacter == null}");
|
Seamless.TryShow($"2 NexusMajor: {Seamless.NexusVersion.Major} - ConrolledEntity {MySession.Static.ControlledEntity == null} - HumanPlayer {MySession.Static.LocalHumanPlayer == null} - Character {MySession.Static.LocalCharacter == null}");
|
||||||
}
|
}
|
||||||
@@ -504,8 +509,14 @@ namespace SeamlessClient.ServerSwitching
|
|||||||
|
|
||||||
SetWorldSettings();
|
SetWorldSettings();
|
||||||
InitComponents();
|
InitComponents();
|
||||||
|
|
||||||
|
// Allow the game to start proccessing incoming messages in the buffer
|
||||||
|
MyMultiplayer.Static.StartProcessingClientMessages();
|
||||||
|
|
||||||
StartEntitySync();
|
StartEntitySync();
|
||||||
|
|
||||||
|
//MyGuiSandbox.RemoveScreen(MyGuiScreenHudSpace.Static);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -517,8 +528,13 @@ namespace SeamlessClient.ServerSwitching
|
|||||||
MyHud.Chat.RegisterChat(MyMultiplayer.Static);
|
MyHud.Chat.RegisterChat(MyMultiplayer.Static);
|
||||||
//GpsRegisterChat.Invoke(MySession.Static.Gpss, new object[] { MyMultiplayer.Static });
|
//GpsRegisterChat.Invoke(MySession.Static.Gpss, new object[] { MyMultiplayer.Static });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Recreate all controls... Will fix weird gui/paint/crap
|
//Recreate all controls... Will fix weird gui/paint/crap
|
||||||
MyGuiScreenHudSpace.Static?.RecreateControls(false);
|
//MyGuiScreenHudSpace.Static?.RecreateControls(true);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Seamless.TryShow($"6 NexusMajor: {Seamless.NexusVersion.Major} - ConrolledEntity {MySession.Static.ControlledEntity == null} - HumanPlayer {MySession.Static.LocalHumanPlayer == null} - Character {MySession.Static.LocalCharacter == null}");
|
Seamless.TryShow($"6 NexusMajor: {Seamless.NexusVersion.Major} - ConrolledEntity {MySession.Static.ControlledEntity == null} - HumanPlayer {MySession.Static.LocalHumanPlayer == null} - Character {MySession.Static.LocalCharacter == null}");
|
||||||
Seamless.TryShow($"6 Streaming: {clienta.HasPendingStreamingReplicables} - LastMessage: {clienta.LastMessageFromServer}");
|
Seamless.TryShow($"6 Streaming: {clienta.HasPendingStreamingReplicables} - LastMessage: {clienta.LastMessageFromServer}");
|
||||||
@@ -528,8 +544,6 @@ namespace SeamlessClient.ServerSwitching
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Allow the game to start proccessing incoming messages in the buffer
|
|
||||||
MyMultiplayer.Static.StartProcessingClientMessages();
|
|
||||||
|
|
||||||
//Send Client Ready
|
//Send Client Ready
|
||||||
ClientReadyDataMsg clientReadyDataMsg = default(ClientReadyDataMsg);
|
ClientReadyDataMsg clientReadyDataMsg = default(ClientReadyDataMsg);
|
||||||
@@ -540,8 +554,16 @@ namespace SeamlessClient.ServerSwitching
|
|||||||
ClientReadyDataMsg msg = clientReadyDataMsg;
|
ClientReadyDataMsg msg = clientReadyDataMsg;
|
||||||
clienta.SendClientReady(ref msg);
|
clienta.SendClientReady(ref msg);
|
||||||
|
|
||||||
|
Seamless.SendSeamlessVersion();
|
||||||
|
|
||||||
|
FieldInfo hudPoints = typeof(MyHudMarkerRender).GetField("m_pointsOfInterest", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||||
|
IList points = (IList)hudPoints.GetValue(MyGuiScreenHudSpace.Static.MarkerRender);
|
||||||
|
|
||||||
|
|
||||||
|
//Sync.Players.RequestNewPlayer(Sync.MyId, 0, MyGameService.UserName, null, true, true);
|
||||||
PauseClient.Invoke(MyMultiplayer.Static, new object[] { false });
|
PauseClient.Invoke(MyMultiplayer.Static, new object[] { false });
|
||||||
|
|
||||||
|
|
||||||
isSwitch = false;
|
isSwitch = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -588,7 +610,7 @@ namespace SeamlessClient.ServerSwitching
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MyRenderProxy.RebuildCullingStructure();
|
//MyRenderProxy.RebuildCullingStructure();
|
||||||
//MySession.Static.Toolbars.LoadToolbars(checkpoint);
|
//MySession.Static.Toolbars.LoadToolbars(checkpoint);
|
||||||
|
|
||||||
Sync.Players.RespawnComponent.InitFromCheckpoint(TargetWorld.Checkpoint);
|
Sync.Players.RespawnComponent.InitFromCheckpoint(TargetWorld.Checkpoint);
|
||||||
@@ -659,8 +681,6 @@ namespace SeamlessClient.ServerSwitching
|
|||||||
{
|
{
|
||||||
UpdateWorldGenerator();
|
UpdateWorldGenerator();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void UpdateWorldGenerator()
|
private void UpdateWorldGenerator()
|
||||||
{
|
{
|
||||||
//This will re-init the MyProceduralWorldGenerator. (Not doing this will result in asteroids not rendering in properly)
|
//This will re-init the MyProceduralWorldGenerator. (Not doing this will result in asteroids not rendering in properly)
|
||||||
@@ -787,5 +807,10 @@ namespace SeamlessClient.ServerSwitching
|
|||||||
Seamless.TryShow("Saving PlayerID: " + savingPlayerId.ToString());
|
Seamless.TryShow("Saving PlayerID: " + savingPlayerId.ToString());
|
||||||
Seamless.TryShow($"AFTER {MySession.Static.LocalHumanPlayer == null} - {MySession.Static.LocalCharacter == null}");
|
Seamless.TryShow($"AFTER {MySession.Static.LocalHumanPlayer == null} - {MySession.Static.LocalCharacter == null}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
25
Seamless.cs
25
Seamless.cs
@@ -1,5 +1,6 @@
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using NLog.Fluent;
|
using NLog.Fluent;
|
||||||
|
using Sandbox.Game.Localization;
|
||||||
using Sandbox.Game.World;
|
using Sandbox.Game.World;
|
||||||
using Sandbox.ModAPI;
|
using Sandbox.ModAPI;
|
||||||
using SeamlessClient.Messages;
|
using SeamlessClient.Messages;
|
||||||
@@ -31,12 +32,12 @@ namespace SeamlessClient
|
|||||||
private List<ComponentBase> allComps = new List<ComponentBase>();
|
private List<ComponentBase> allComps = new List<ComponentBase>();
|
||||||
private Assembly thisAssembly => typeof(Seamless).Assembly;
|
private Assembly thisAssembly => typeof(Seamless).Assembly;
|
||||||
private bool Initilized = false;
|
private bool Initilized = false;
|
||||||
public static bool isSeamlessServer = false;
|
public static bool isSeamlessServer { get; private set; } = false;
|
||||||
|
|
||||||
public static bool isDebug = false;
|
public static bool isDebug = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void Init(object gameInstance)
|
public void Init(object gameInstance)
|
||||||
{
|
{
|
||||||
TryShow($"Running Seamless Client Plugin v[{SeamlessVersion}]");
|
TryShow($"Running Seamless Client Plugin v[{SeamlessVersion}]");
|
||||||
@@ -121,13 +122,12 @@ namespace SeamlessClient
|
|||||||
if (!string.IsNullOrEmpty(msg.NexusVersion))
|
if (!string.IsNullOrEmpty(msg.NexusVersion))
|
||||||
NexusVersion = Version.Parse(msg.NexusVersion);
|
NexusVersion = Version.Parse(msg.NexusVersion);
|
||||||
|
|
||||||
|
isSeamlessServer = true;
|
||||||
switch (msg.MessageType)
|
switch (msg.MessageType)
|
||||||
{
|
{
|
||||||
case ClientMessageType.FirstJoin:
|
case ClientMessageType.FirstJoin:
|
||||||
Seamless.TryShow("Sending First Join!");
|
Seamless.TryShow("Sending First Join!");
|
||||||
ClientMessage response = new ClientMessage(SeamlessVersion.ToString());
|
SendSeamlessVersion();
|
||||||
MyAPIGateway.Multiplayer?.SendMessageToServer(SeamlessClientNetId, MessageUtils.Serialize(response));
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ClientMessageType.TransferServer:
|
case ClientMessageType.TransferServer:
|
||||||
@@ -142,6 +142,15 @@ namespace SeamlessClient
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void SendSeamlessVersion()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
ClientMessage response = new ClientMessage(SeamlessVersion.ToString());
|
||||||
|
MyAPIGateway.Multiplayer?.SendMessageToServer(SeamlessClientNetId, MessageUtils.Serialize(response));
|
||||||
|
Seamless.TryShow("Sending Seamless request...");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
@@ -154,7 +163,11 @@ namespace SeamlessClient
|
|||||||
public void Update()
|
public void Update()
|
||||||
{
|
{
|
||||||
if (MyAPIGateway.Multiplayer == null)
|
if (MyAPIGateway.Multiplayer == null)
|
||||||
|
{
|
||||||
|
isSeamlessServer = false;
|
||||||
|
Initilized = false;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!Initilized)
|
if (!Initilized)
|
||||||
{
|
{
|
||||||
@@ -163,6 +176,8 @@ namespace SeamlessClient
|
|||||||
|
|
||||||
Initilized = true;
|
Initilized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
allComps.ForEach(x => x.Update());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -97,6 +97,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Components\EntityPerformanceImprovements.cs" />
|
<Compile Include="Components\EntityPerformanceImprovements.cs" />
|
||||||
<Compile Include="Components\LoadingScreenComponent.cs" />
|
<Compile Include="Components\LoadingScreenComponent.cs" />
|
||||||
|
<Compile Include="Components\MyGUIScreenMedicalsPatch.cs" />
|
||||||
<Compile Include="Components\MyHudTimeTracker.cs" />
|
<Compile Include="Components\MyHudTimeTracker.cs" />
|
||||||
<Compile Include="Messages\OnlinePlayerData.cs" />
|
<Compile Include="Messages\OnlinePlayerData.cs" />
|
||||||
<Compile Include="Utilities\UtilExtensions.cs" />
|
<Compile Include="Utilities\UtilExtensions.cs" />
|
||||||
|
Reference in New Issue
Block a user