fix projects and compile errors
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<Import Project="..\BarotraumaShared\LuaCsDependencies.props" />
|
||||
<ItemGroup>
|
||||
<None Include="..\BarotraumaShared\LuaCsDependencies.props" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
@@ -14,6 +19,7 @@
|
||||
<Configurations>Debug;Release;Unstable</Configurations>
|
||||
<InvariantGlobalization>true</InvariantGlobalization>
|
||||
<WarningsAsErrors>;NU1605;CS0114;CS0108CS8597;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8606;CS8607;CS8608;CS8609;CS8610;CS8611;CS8612;CS8613;CS8614;CS8615;CS8616;CS8617;CS8618;CS8619;CS8620;CS8621;CS8622;CS8624;CS8625;CS8626;CS8629;CS8631;CS8632;CS8633;CS8634;CS8638;CS8643;CS8644;CS8645;CS8653;CS8654;CS8655;CS8667;CS8669;CS8670;CS8714;CS8717;CS8765</WarningsAsErrors>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<Import Project="..\BarotraumaShared\LuaCsDependencies.props" />
|
||||
<ItemGroup>
|
||||
<None Include="..\BarotraumaShared\LuaCsDependencies.props" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
@@ -14,6 +19,7 @@
|
||||
<Configurations>Debug;Release;Unstable</Configurations>
|
||||
<InvariantGlobalization>true</InvariantGlobalization>
|
||||
<WarningsAsErrors>;NU1605;CS0114;CS0108CS8597;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8606;CS8607;CS8608;CS8609;CS8610;CS8611;CS8612;CS8613;CS8614;CS8615;CS8616;CS8617;CS8618;CS8619;CS8620;CS8621;CS8622;CS8624;CS8625;CS8626;CS8629;CS8631;CS8632;CS8633;CS8634;CS8638;CS8643;CS8644;CS8645;CS8653;CS8654;CS8655;CS8667;CS8669;CS8670;CS8714;CS8717;CS8765</WarningsAsErrors>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
|
||||
@@ -16,32 +16,32 @@ namespace Barotrauma.Networking
|
||||
GameMain.Server.KickClient(this.Connection, reason);
|
||||
}
|
||||
|
||||
public void Ban(string reason = "", bool range = false, float seconds = -1)
|
||||
public void Ban(string reason = "", float seconds = -1)
|
||||
{
|
||||
if (seconds == -1)
|
||||
{
|
||||
GameMain.Server.BanClient(this, reason, range, null);
|
||||
GameMain.Server.BanClient(this, reason, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameMain.Server.BanClient(this, reason, range, TimeSpan.FromSeconds(seconds));
|
||||
GameMain.Server.BanClient(this, reason, TimeSpan.FromSeconds(seconds));
|
||||
}
|
||||
}
|
||||
|
||||
public static void Unban(string player, string endpoint)
|
||||
public static void UnbanPlayer(string playerName)
|
||||
{
|
||||
GameMain.Server.UnbanPlayer(player, endpoint);
|
||||
GameMain.Server.UnbanPlayer(playerName);
|
||||
}
|
||||
|
||||
public static void Ban(string player, string reason, bool range = false, float seconds = -1)
|
||||
public static void BanPlayer(string player, string reason, bool range = false, float seconds = -1)
|
||||
{
|
||||
if (seconds == -1)
|
||||
{
|
||||
GameMain.Server.BanPlayer(player, reason, range, null);
|
||||
GameMain.Server.BanPlayer(player, reason, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameMain.Server.BanPlayer(player, reason, range, TimeSpan.FromSeconds(seconds));
|
||||
GameMain.Server.BanPlayer(player, reason, TimeSpan.FromSeconds(seconds));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,8 @@ namespace Barotrauma.Networking
|
||||
AutoExpandMTU = false,
|
||||
MaximumConnections = NetConfig.MaxPlayers * 2,
|
||||
EnableUPnP = serverSettings.EnableUPnP,
|
||||
Port = serverSettings.Port
|
||||
Port = serverSettings.Port,
|
||||
LocalAddress = serverSettings.ListenIPAddress,
|
||||
};
|
||||
|
||||
netPeerConfiguration.DisableMessageType(
|
||||
@@ -489,4 +490,4 @@ namespace Barotrauma.Networking
|
||||
return netServer.SendMessage(msg.ToLidgren(netServer), conn.NetConnection, deliveryMethod.ToLidgren());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Barotrauma.Networking
|
||||
public abstract void Close();
|
||||
public abstract void Update(float deltaTime);
|
||||
|
||||
protected sealed class PendingClient
|
||||
public sealed class PendingClient
|
||||
{
|
||||
public string? Name;
|
||||
public Option<int> OwnerKey;
|
||||
@@ -285,7 +285,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
protected virtual void CheckOwnership(PendingClient pendingClient) { }
|
||||
|
||||
protected void RemovePendingClient(PendingClient pendingClient, PeerDisconnectPacket peerDisconnectPacket)
|
||||
public void RemovePendingClient(PendingClient pendingClient, PeerDisconnectPacket peerDisconnectPacket)
|
||||
{
|
||||
if (pendingClients.Contains(pendingClient))
|
||||
{
|
||||
@@ -305,4 +305,4 @@ namespace Barotrauma.Networking
|
||||
public abstract void Send(IWriteMessage msg, NetworkConnection conn, DeliveryMethod deliveryMethod, bool compressPastThreshold = true);
|
||||
public abstract void Disconnect(NetworkConnection conn, PeerDisconnectPacket peerDisconnectPacket);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<Import Project="..\BarotraumaShared\LuaCsDependencies.props" />
|
||||
<ItemGroup>
|
||||
<None Include="..\BarotraumaShared\LuaCsDependencies.props" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
@@ -14,6 +19,8 @@
|
||||
<Configurations>Debug;Release;Unstable</Configurations>
|
||||
<InvariantGlobalization>true</InvariantGlobalization>
|
||||
<WarningsAsErrors>;NU1605;CS0114;CS0108CS8597;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8606;CS8607;CS8608;CS8609;CS8610;CS8611;CS8612;CS8613;CS8614;CS8615;CS8616;CS8617;CS8618;CS8619;CS8620;CS8621;CS8622;CS8624;CS8625;CS8626;CS8629;CS8631;CS8632;CS8633;CS8634;CS8638;CS8643;CS8644;CS8645;CS8653;CS8654;CS8655;CS8667;CS8669;CS8670;CS8714;CS8717;CS8765</WarningsAsErrors>
|
||||
<DocumentationFile>Doc\BuildDocServer.xml</DocumentationFile>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
|
||||
@@ -78,6 +78,9 @@ RegisterBarotrauma("FabricationRecipe+RequiredItemByTag")
|
||||
RegisterBarotrauma("Submarine")
|
||||
|
||||
RegisterBarotrauma("INetSerializableStruct")
|
||||
RegisterBarotrauma("Networking.AccountInfo")
|
||||
RegisterBarotrauma("Networking.AccountId")
|
||||
RegisterBarotrauma("Networking.SteamId")
|
||||
RegisterBarotrauma("Networking.Client")
|
||||
RegisterBarotrauma("Networking.TempClient")
|
||||
RegisterBarotrauma("Networking.NetworkConnection")
|
||||
|
||||
@@ -3,12 +3,13 @@ using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using MoonSharp.Interpreter;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Barotrauma.Networking;
|
||||
|
||||
namespace Barotrauma.Networking
|
||||
{
|
||||
partial class Client
|
||||
{
|
||||
public static List<Client> ClientList
|
||||
public static IReadOnlyList<Client> ClientList
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -20,6 +21,21 @@ namespace Barotrauma.Networking
|
||||
}
|
||||
}
|
||||
|
||||
public ulong SteamID
|
||||
{
|
||||
get
|
||||
{
|
||||
if (AccountId.TryUnwrap(out AccountId outValue) && outValue is SteamId steamId)
|
||||
{
|
||||
return steamId.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,12 +25,11 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
public bool? ForceVoice = null;
|
||||
public bool? ForceLocalVoice = null;
|
||||
|
||||
public bool Paused => GameMain.Instance?.Paused == true;
|
||||
public byte MyID => GameMain.Client.ID;
|
||||
public ChatMode ActiveChatMode => GameMain.ActiveChatMode;
|
||||
public byte SessionId => GameMain.Client.SessionId;
|
||||
public byte MyID => SessionId; // compatibility
|
||||
|
||||
public ChatMode ActiveChatMode => GameMain.ActiveChatMode;
|
||||
|
||||
public ChatBox ChatBox
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.IO;
|
||||
@@ -142,12 +142,12 @@ namespace Barotrauma
|
||||
{
|
||||
var message = new WriteOnlyMessage();
|
||||
#if SERVER
|
||||
message.Write((byte)ServerPacketHeader.LUA_NET_MESSAGE);
|
||||
message.WriteByte((byte)ServerPacketHeader.LUA_NET_MESSAGE);
|
||||
#else
|
||||
message.Write((byte)ClientPacketHeader.LUA_NET_MESSAGE);
|
||||
message.WriteByte((byte)ClientPacketHeader.LUA_NET_MESSAGE);
|
||||
#endif
|
||||
message.Write(netMessageName);
|
||||
return ((IWriteMessage)message);
|
||||
message.WriteString(netMessageName);
|
||||
return message;
|
||||
}
|
||||
|
||||
public IWriteMessage Start()
|
||||
@@ -274,9 +274,9 @@ namespace Barotrauma
|
||||
GameMain.Server.UpdateClientPermissions(client);
|
||||
}
|
||||
|
||||
public void RemovePendingClient(ServerPeer.PendingClient pendingClient, DisconnectReason reason, string msg)
|
||||
public void RemovePendingClient(ServerPeer.PendingClient pendingClient, PeerDisconnectPacket peerDisconnectPacket)
|
||||
{
|
||||
GameMain.Server.ServerPeer.RemovePendingClient(pendingClient, reason, msg);
|
||||
GameMain.Server.ServerPeer.RemovePendingClient(pendingClient, peerDisconnectPacket);
|
||||
}
|
||||
|
||||
public int FileSenderMaxPacketsPerUpdate
|
||||
@@ -293,4 +293,4 @@ namespace Barotrauma
|
||||
set { GameMain.NetworkMember.LastClientListUpdateID = value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Barotrauma
|
||||
#else
|
||||
//"C:/Users/*user*/AppData/Local/Daedalic Entertainment GmbH/" on Windows
|
||||
//"/home/*user*/.local/share/Daedalic Entertainment GmbH/" on Linux
|
||||
public static readonly string SaveFolder = Path.Combine(
|
||||
public static string SaveFolder = Path.Combine(
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
|
||||
"Daedalic Entertainment GmbH",
|
||||
"Barotrauma");
|
||||
|
||||
@@ -44,7 +44,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowsTest", "Barotrauma\B
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MoonSharp.Interpreter", "Libraries\moonsharp\MoonSharp.Interpreter\MoonSharp.Interpreter.csproj", "{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeployAll", "Deploy\DeployAll\DeployAll.csproj", "{C98FE0D0-BC7D-4806-B592-734B53016FD8}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeployAll", "Deploy\DeployAll\DeployAll.csproj", "{C98FE0D0-BC7D-4806-B592-734B53016FD8}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
||||
@@ -203,10 +203,28 @@ Global
|
||||
{C7212AE2-A925-4225-A639-AE0653EF65B0}.Unstable|Any CPU.Build.0 = Release|Any CPU
|
||||
{C7212AE2-A925-4225-A639-AE0653EF65B0}.Unstable|x64.ActiveCfg = Debug|Any CPU
|
||||
{C7212AE2-A925-4225-A639-AE0653EF65B0}.Unstable|x64.Build.0 = Debug|Any CPU
|
||||
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Release|x64.Build.0 = Release|Any CPU
|
||||
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Unstable|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Unstable|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Unstable|x64.ActiveCfg = Debug|Any CPU
|
||||
{2EEF2610-64A3-4E5D-95ED-0E181C1A34ED}.Unstable|x64.Build.0 = Debug|Any CPU
|
||||
{C98FE0D0-BC7D-4806-B592-734B53016FD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C98FE0D0-BC7D-4806-B592-734B53016FD8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C98FE0D0-BC7D-4806-B592-734B53016FD8}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{C98FE0D0-BC7D-4806-B592-734B53016FD8}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{C98FE0D0-BC7D-4806-B592-734B53016FD8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C98FE0D0-BC7D-4806-B592-734B53016FD8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C98FE0D0-BC7D-4806-B592-734B53016FD8}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{C98FE0D0-BC7D-4806-B592-734B53016FD8}.Release|x64.Build.0 = Release|Any CPU
|
||||
{C98FE0D0-BC7D-4806-B592-734B53016FD8}.Unstable|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C98FE0D0-BC7D-4806-B592-734B53016FD8}.Unstable|Any CPU.Build.0 = Release|Any CPU
|
||||
{C98FE0D0-BC7D-4806-B592-734B53016FD8}.Unstable|x64.ActiveCfg = Debug|Any CPU
|
||||
{C98FE0D0-BC7D-4806-B592-734B53016FD8}.Unstable|x64.Build.0 = Debug|Any CPU
|
||||
EndGlobalSection
|
||||
|
||||
Reference in New Issue
Block a user