Unstable v0.1300.0.2

This commit is contained in:
Markus Isberg
2021-03-12 15:57:04 +02:00
parent 0f6de8ada9
commit 874616027b
145 changed files with 1897 additions and 939 deletions
@@ -533,6 +533,13 @@ namespace Barotrauma
NewMessage(perm + " is not a valid permission!", Color.Red);
return;
}
if (permission == ClientPermissions.None)
{
NewMessage($"No permissions were given to {client.Name}. Did you mean \"revokeperm {client.Name} All\"?");
return;
}
client.GivePermission(permission);
GameMain.Server.UpdateClientPermissions(client);
NewMessage("Granted " + perm + " permissions to " + client.Name + ".", Color.White);
@@ -736,7 +743,6 @@ namespace Barotrauma
{
NewMessage("Revoked \"" + client.Name + "\"'s permission to use the console commands " + string.Join(", ", revokedCommands.Select(c => c.names[0])) + ".", Color.White);
}
}, args, 1);
});
@@ -1822,6 +1828,14 @@ namespace Barotrauma
GameMain.Server.SendConsoleMessage(perm + " is not a valid permission!", senderClient);
return;
}
if (permission == ClientPermissions.None)
{
GameMain.Server.SendConsoleMessage($"No permissions were given to {client.Name}. Did you mean \"revokeperm {client.Name} All\"?", senderClient);
NewMessage($"No permissions were given to {client.Name}. Did you mean \"revokeperm {client.Name} All\"?");
return;
}
client.GivePermission(permission);
GameMain.Server.UpdateClientPermissions(client);
GameMain.Server.SendConsoleMessage("Granted " + perm + " permissions to " + client.Name + ".", senderClient);
@@ -1975,7 +1989,6 @@ namespace Barotrauma
if (revokeAll)
{
revokedCommands.AddRange(commands);
client.RemovePermission(ClientPermissions.ConsoleCommands);
}
else
{
@@ -1992,10 +2005,13 @@ namespace Barotrauma
revokedCommands.Add(matchingCommand);
}
}
client.GivePermission(ClientPermissions.ConsoleCommands);
}
client.SetPermissions(client.Permissions, client.PermittedConsoleCommands.Except(revokedCommands).ToList());
if (client.PermittedConsoleCommands.Count == 0)
{
client.RemovePermission(ClientPermissions.ConsoleCommands);
}
GameMain.Server.UpdateClientPermissions(client);
GameMain.Server.SendConsoleMessage("Revoked \"" + client.Name + "\"'s permission to use the console commands " + string.Join(", ", revokedCommands.Select(c => c.names[0])) + ".", senderClient);
if (revokeAll)
@@ -51,7 +51,7 @@ namespace Barotrauma.Items.Components
if (dockingButtonClicked)
{
item.SendSignal(0, "1", "toggle_docking", sender: null);
item.SendSignal("1", "toggle_docking");
GameMain.Server.CreateEntityEvent(item, new object[] { NetEntityEvent.Type.ComponentState, item.GetComponentIndex(this), true });
}
@@ -20,7 +20,7 @@ namespace Barotrauma.Items.Components
ServerLog.MessageType.ItemInteraction);
OutputValue = newOutputValue;
ShowOnDisplay(newOutputValue);
item.SendSignal(0, newOutputValue, "signal_out", null);
item.SendSignal(newOutputValue, "signal_out");
item.CreateServerEvent(this);
}
}
@@ -163,7 +163,7 @@ namespace Barotrauma.Networking
public void RemovePermission(ClientPermissions permission)
{
if (this.Permissions.HasFlag(permission)) this.Permissions &= ~permission;
this.Permissions &= ~permission;
}
public bool HasPermission(ClientPermissions permission)
@@ -302,7 +302,7 @@ namespace Barotrauma.Networking
LastClientListUpdateID++;
if (newClient.Connection == OwnerConnection)
if (newClient.Connection == OwnerConnection && OwnerConnection != null)
{
newClient.GivePermission(ClientPermissions.All);
newClient.PermittedConsoleCommands.AddRange(DebugConsole.Commands);
@@ -450,12 +450,12 @@ namespace Barotrauma.Networking
//or very close and someone from the crew made it inside the outpost
subAtLevelEnd =
Submarine.MainSub.DockedTo.Contains(Level.Loaded.EndOutpost) ||
(Submarine.MainSub.AtEndPosition && charactersInsideOutpost > 0) ||
(Submarine.MainSub.AtEndExit && charactersInsideOutpost > 0) ||
(charactersInsideOutpost > charactersOutsideOutpost);
}
else
{
subAtLevelEnd = Submarine.MainSub.AtEndPosition;
subAtLevelEnd = Submarine.MainSub.AtEndExit;
}
}
@@ -2405,6 +2405,7 @@ namespace Barotrauma.Networking
msg.Write(serverSettings.AllowRespawn && (missionAllowRespawn || outpostAllowRespawn));
msg.Write(serverSettings.AllowDisguises);
msg.Write(serverSettings.AllowRewiring);
msg.Write(serverSettings.LockAllDefaultWires);
msg.Write(serverSettings.AllowRagdollButton);
msg.Write(serverSettings.UseRespawnShuttle);
msg.Write((byte)GameMain.Config.LosMode);
@@ -3036,7 +3037,8 @@ namespace Barotrauma.Networking
else if (type == ChatMessageType.Radio)
{
//send to chat-linked wifi components
senderRadio.TransmitSignal(0, message, senderRadio.Item, senderCharacter, sentFromChat: true);
Signal s = new Signal(message, sender: senderCharacter, source: senderRadio.Item);
senderRadio.TransmitSignal(s, sentFromChat: true);
}
//check which clients can receive the message and apply distance effects
@@ -444,8 +444,16 @@ namespace Barotrauma.Networking
Steamworks.BeginAuthResult authSessionStartState = Steam.SteamManager.StartAuthSession(ticket, steamId);
if (authSessionStartState != Steamworks.BeginAuthResult.OK)
{
RemovePendingClient(pendingClient, DisconnectReason.SteamAuthenticationFailed, "Steam auth session failed to start: " + authSessionStartState.ToString());
return;
if (requireSteamAuth)
{
RemovePendingClient(pendingClient, DisconnectReason.SteamAuthenticationFailed, "Steam auth session failed to start: " + authSessionStartState.ToString());
return;
}
else
{
steamId = 0;
pendingClient.InitializationStep = serverSettings.HasPassword ? ConnectionInitialization.Password : ConnectionInitialization.ContentPackageOrder;
}
}
pendingClient.SteamID = steamId;
pendingClient.Connection.Name = name;
@@ -18,7 +18,7 @@ namespace Barotrauma
if (Math.Abs(FarseerBody.LinearVelocity.X) > MaxVel ||
Math.Abs(FarseerBody.LinearVelocity.Y) > MaxVel)
{
DebugConsole.ThrowError("Item velocity out of range (" + FarseerBody.LinearVelocity + ")");
DebugConsole.ThrowError($"Entity velocity out of range ({(UserData?.ToString() ?? "null")}, {FarseerBody.LinearVelocity})");
}
#endif