v1.6.17.0 (Unto the Breach update)
This commit is contained in:
@@ -716,9 +716,7 @@ namespace Barotrauma
|
||||
|
||||
ShowQuestionPrompt("Console command permissions to revoke from \"" + client.Name + "\"? You may enter multiple commands separated with a space.", (commandsStr) =>
|
||||
{
|
||||
Identifier[] splitCommands = commandsStr.Split(' ')
|
||||
.Select(s => s.Trim())
|
||||
.ToIdentifiers().ToArray();
|
||||
Identifier[] splitCommands = commandsStr.ToIdentifiers(separator: " ").ToArray();
|
||||
List<Command> revokedCommands = new List<Command>();
|
||||
bool revokeAll = splitCommands.Length > 0 && splitCommands[0] == "all";
|
||||
if (revokeAll)
|
||||
@@ -1351,14 +1349,14 @@ namespace Barotrauma
|
||||
|
||||
commands.Add(new Command("mission", "mission [name]: Select the mission type for the next round.", (string[] args) =>
|
||||
{
|
||||
GameMain.NetLobbyScreen.MissionTypeName = string.Join(" ", args);
|
||||
NewMessage("Set mission to " + GameMain.NetLobbyScreen.MissionTypeName, Color.Cyan);
|
||||
GameMain.NetLobbyScreen.MissionTypes = args.ToIdentifiers();
|
||||
NewMessage("Set mission to " + string.Join(",", GameMain.NetLobbyScreen.MissionTypes), Color.Cyan);
|
||||
},
|
||||
() =>
|
||||
{
|
||||
return new string[][]
|
||||
{
|
||||
Enum.GetNames(typeof(MissionType))
|
||||
MissionPrefab.GetAllMultiplayerSelectableMissionTypes().Select(id => id.Value).ToArray()
|
||||
};
|
||||
}));
|
||||
|
||||
@@ -1404,10 +1402,7 @@ namespace Barotrauma
|
||||
AssignOnExecute("respawnnow", (string[] args) =>
|
||||
{
|
||||
if (GameMain.Server?.RespawnManager == null) { return; }
|
||||
if (GameMain.Server.RespawnManager.CurrentState != RespawnManager.State.Transporting)
|
||||
{
|
||||
GameMain.Server.RespawnManager.ForceRespawn();
|
||||
}
|
||||
GameMain.Server.RespawnManager.ForceRespawn();
|
||||
});
|
||||
|
||||
commands.Add(new Command("startgame|startround|start", "start/startgame/startround: Start a new round.", (string[] args) =>
|
||||
@@ -1416,7 +1411,7 @@ namespace Barotrauma
|
||||
if (GameMain.GameSession?.GameMode is MultiPlayerCampaign mpCampaign &&
|
||||
GameMain.NetLobbyScreen.SelectedMode == GameModePreset.MultiPlayerCampaign)
|
||||
{
|
||||
MultiPlayerCampaign.LoadCampaign(GameMain.GameSession.SavePath, client: null);
|
||||
MultiPlayerCampaign.LoadCampaign(GameMain.GameSession.DataPath, client: null);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1425,7 +1420,9 @@ namespace Barotrauma
|
||||
MultiPlayerCampaign.StartCampaignSetup();
|
||||
return;
|
||||
}
|
||||
if (!GameMain.Server.TryStartGame()) { NewMessage("Failed to start a new round", Color.Yellow); }
|
||||
|
||||
var result = GameMain.Server.TryStartGame();
|
||||
if (result != GameServer.TryStartGameResult.Success) { NewMessage($"Failed to start a new round: {TextManager.Get($"TryStartGameError.{result}")}", Color.Yellow); }
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -1897,23 +1894,28 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
AssignOnClientRequestExecute(
|
||||
"healme",
|
||||
(Client client, Vector2 cursorWorldPos, string[] args) =>
|
||||
{
|
||||
bool healAll = args.Length > 0 && args[0].Equals("all", StringComparison.OrdinalIgnoreCase);
|
||||
if (client.Character != null)
|
||||
{
|
||||
HealCharacter(client.Character, healAll);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
AssignOnClientRequestExecute(
|
||||
"heal",
|
||||
(Client client, Vector2 cursorWorldPos, string[] args) =>
|
||||
{
|
||||
bool healAll = args.Length > 1 && args[1].Equals("all", StringComparison.OrdinalIgnoreCase);
|
||||
Character healedCharacter = (args.Length == 0) ? Character.Controlled : FindMatchingCharacter(healAll ? args.Take(args.Length - 1).ToArray() : args);
|
||||
Character healedCharacter = (args.Length == 0) ? client.Character : FindMatchingCharacter(healAll ? args.Take(args.Length - 1).ToArray() : args);
|
||||
if (healedCharacter != null)
|
||||
{
|
||||
healedCharacter.SetAllDamage(0.0f, 0.0f, 0.0f);
|
||||
healedCharacter.Oxygen = 100.0f;
|
||||
healedCharacter.Bloodloss = 0.0f;
|
||||
healedCharacter.SetStun(0.0f, true);
|
||||
if (healAll)
|
||||
{
|
||||
healedCharacter.CharacterHealth.RemoveAllAfflictions();
|
||||
}
|
||||
HealCharacter(healedCharacter, healAll);
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -1934,7 +1936,7 @@ namespace Barotrauma
|
||||
|
||||
// If killed in ironman mode, the character has been wiped from the save mid-round, so its
|
||||
// original data needs to be restored to the save file (without making a backup of the dead character)
|
||||
if (GameMain.Server.ServerSettings.IronmanMode && GameMain.GameSession?.Campaign is MultiPlayerCampaign mpCampaign)
|
||||
if (GameMain.Server.ServerSettings is { IronmanModeActive: true } && GameMain.GameSession?.Campaign is MultiPlayerCampaign mpCampaign)
|
||||
{
|
||||
if (mpCampaign.RestoreSingleCharacterFromBackup(c) is CharacterCampaignData characterToRestore)
|
||||
{
|
||||
@@ -2546,6 +2548,7 @@ namespace Barotrauma
|
||||
{
|
||||
foreach (Skill skill in character.Info.Job.GetSkills())
|
||||
{
|
||||
GameMain.NetworkMember.CreateEntityEvent(character, new Character.UpdateSkillsEventData(skill.Identifier, forceNotification: true));
|
||||
character.Info.SetSkillLevel(skill.Identifier, level);
|
||||
}
|
||||
GameMain.Server.SendConsoleMessage($"Set all {character.Name}'s skills to {level}", senderClient);
|
||||
@@ -2553,10 +2556,10 @@ namespace Barotrauma
|
||||
else
|
||||
{
|
||||
character.Info.SetSkillLevel(skillIdentifier, level);
|
||||
GameMain.NetworkMember.CreateEntityEvent(character, new Character.UpdateSkillsEventData(skillIdentifier, forceNotification: true));
|
||||
GameMain.Server.SendConsoleMessage($"Set {character.Name}'s {skillIdentifier} level to {level}", senderClient);
|
||||
}
|
||||
|
||||
GameMain.NetworkMember.CreateEntityEvent(character, new Character.UpdateSkillsEventData());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user