fixes for nexus v3
Some checks failed
Build / Compute Version (push) Successful in 6s
Build / Build Nuget package (push) Failing after 6s

This commit is contained in:
zznty
2025-07-28 03:58:25 +07:00
parent 32ae6569a8
commit aa323f1ff6
17 changed files with 1766 additions and 2392 deletions

View File

@@ -1,51 +1,41 @@
using Sandbox.Engine.Networking;
using Sandbox.Game.Multiplayer;
using SeamlessClientPlugin.Messages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SeamlessClientPlugin.Messages;
using VRage.GameServices;
namespace SeamlessClientPlugin.SeamlessTransfer
namespace SeamlessClientPlugin.SeamlessTransfer;
public class ServerPing
{
public class ServerPing
private static Transfer _transfer;
private static WorldRequest Request => _transfer.WorldRequest;
public static void StartServerPing(Transfer clientTransfer)
{
private static WorldRequest Request { get { return Transfer.WorldRequest; } }
private static Transfer Transfer;
// We need to first ping the server to make sure its running and so we can get a connection
_transfer = clientTransfer;
public static void StartServerPing(Transfer ClientTransfer)
if (_transfer.TargetServerId == 0)
{
// We need to first ping the server to make sure its running and so we can get a connection
Transfer = ClientTransfer;
if (Transfer.TargetServerID == 0)
{
SeamlessClient.TryShow("This is not a valid server!");
return;
}
MyGameServerItem E = new MyGameServerItem();
E.ConnectionString = Transfer.IPAdress;
E.SteamID = Transfer.TargetServerID;
E.Name = Transfer.ServerName;
SeamlessClient.TryShow("Beginning Redirect to server: " + Transfer.TargetServerID);
var world = Request.DeserializeWorldData();
SwitchServers Switcher = new SwitchServers(E, world);
Switcher.BeginSwitch();
SeamlessClient.TryShow("This is not a valid server!");
return;
}
var e = new MyGameServerItem();
e.ConnectionString = _transfer.IpAdress;
e.SteamID = _transfer.TargetServerId;
e.Name = _transfer.ServerName;
SeamlessClient.TryShow($"Beginning Redirect to server: {_transfer.TargetServerId}");
var world = Request.DeserializeWorldData();
var switcher = new SwitchServers(e, world);
switcher.BeginSwitch();
}
}
}