OBT/1.2.0(Spring Update)

Sync with Upstream
This commit is contained in:
NotAlwaysTrue
2026-04-25 13:25:41 +08:00
committed by GitHub
parent 5207b381b7
commit 59bc21973a
421 changed files with 24090 additions and 11391 deletions
@@ -5,7 +5,7 @@ using System.Linq;
namespace Barotrauma.Networking
{
[NetworkSerialize]
readonly struct AccountInfo : INetSerializableStruct
public readonly struct AccountInfo : INetSerializableStruct
{
public static readonly AccountInfo None = new AccountInfo(Option<AccountId>.None());
@@ -48,4 +48,4 @@ namespace Barotrauma.Networking
public static bool operator !=(AccountInfo a, AccountInfo b) => !(a == b);
}
}
}
@@ -15,13 +15,18 @@ sealed class SteamAuthTicketForEosHostAuthenticator : Authenticator
{
string ticketData = ToolBoxCore.ByteArrayToHexString(ticket.Data);
var client = new RestClient(ServerUrl);
var request = new RestRequest(ServerFile, Method.GET);
var client = RestFactory.CreateClient(ServerUrl);
var request = RestFactory.CreateRequest(ServerFile);
request.AddParameter("authticket", ticketData);
request.AddParameter("request_version", RemoteRequestVersion);
var response = await client.ExecuteAsync(request, Method.GET);
if (response.ErrorException != null)
{
DebugConsole.AddWarning($"Connection error: Failed to verify Steam auth ticket for EOS host " +
$"({response.ErrorException.Message}).");
return AccountInfo.None;
}
if (!response.IsSuccessful) { return AccountInfo.None; }
try
@@ -2,7 +2,7 @@
namespace Barotrauma.Networking
{
abstract class Endpoint
public abstract class Endpoint
{
public abstract string StringRepresentation { get; }
@@ -4,7 +4,7 @@ using System.Text;
namespace Barotrauma.Networking
{
interface IReadMessage
public interface IReadMessage
{
bool ReadBoolean();
void ReadPadBits();
@@ -2,7 +2,7 @@
namespace Barotrauma.Networking
{
interface IWriteMessage
public interface IWriteMessage
{
void WriteBoolean(bool val);
void WritePadBits();
@@ -8,14 +8,14 @@ namespace Barotrauma.Networking
Disconnected = 0x2
}
abstract class NetworkConnection<T> : NetworkConnection where T : Endpoint
public abstract class NetworkConnection<T> : NetworkConnection where T : Endpoint
{
protected NetworkConnection(T endpoint) : base(endpoint) { }
public new T Endpoint => (base.Endpoint as T)!;
}
abstract class NetworkConnection
public abstract class NetworkConnection
{
public static double TimeoutThresholdNotInGame => GameMain.NetworkMember?.ServerSettings?.TimeoutThresholdNotInGame ?? 60.0; //full minute for timeout because loading screens can take quite a while
public static double TimeoutThresholdInGame => GameMain.NetworkMember?.ServerSettings?.TimeoutThresholdInGame ?? 10.0;