Merge branch 'playtest' of https://github.com/TorchAPI/Torch into survival

This commit is contained in:
Brant Martin
2019-02-25 15:27:14 -05:00
13 changed files with 38 additions and 26 deletions

View File

@@ -1,6 +1,6 @@
pushd
$steamData = "C:/Steam/Data/"
$steamData = "C:/Steam/Data-playtest/"
$steamCMDPath = "C:/Steam/steamcmd/"
$steamCMDZip = "C:/Steam/steamcmd.zip"
@@ -17,6 +17,6 @@ if (!(Test-Path $steamCMDPath)) {
}
cd "$steamData"
& "$steamCMDPath/steamcmd.exe" "+login anonymous" "+force_install_dir $steamData" "+app_update 298740" "+quit"
& "$steamCMDPath/steamcmd.exe" "+login anonymous" "+force_install_dir $steamData" "+app_update 298740 -beta playtest -betapassword nt8WuDw9kdvE validate" "+quit"
popd

2
Jenkinsfile vendored
View File

@@ -22,7 +22,7 @@ node {
stage('Acquire SE') {
bat 'powershell -File Jenkins/jenkins-grab-se.ps1'
bat 'IF EXIST GameBinaries RMDIR GameBinaries'
bat 'mklink /J GameBinaries "C:/Steam/Data/DedicatedServer64/"'
bat 'mklink /J GameBinaries "C:/Steam/Data-playtest/DedicatedServer64/"'
}
stage('Acquire NuGet Packages') {

View File

@@ -31,6 +31,7 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<DocumentationFile>$(SolutionDir)\bin\x64\Release\Torch.API.xml</DocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="HavokWrapper, Version=1.0.6278.22649, Culture=neutral, processorArchitecture=AMD64">

View File

@@ -36,6 +36,7 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
<DocumentationFile>$(SolutionDir)\bin\x64\Release\Torch.Client.xml</DocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>torchicon.ico</ApplicationIcon>

View File

@@ -31,7 +31,7 @@ namespace Torch.Server
private const string RUNSCRIPT = @"force_install_dir ../
login anonymous
app_update 298740
app_update 298740 -beta playtest -betapassword nt8WuDw9kdvE
quit";
private TorchConfig _config;

View File

@@ -87,7 +87,15 @@ namespace Torch.Server.Managers
public void SelectWorld(string worldPath, bool modsOnly = true)
{
DedicatedConfig.LoadWorld = worldPath;
DedicatedConfig.SelectedWorld = DedicatedConfig.Worlds.FirstOrDefault(x => x.WorldPath == worldPath);
var worldInfo = DedicatedConfig.Worlds.FirstOrDefault(x => x.WorldPath == worldPath);
if (worldInfo?.Checkpoint == null)
{
worldInfo = new WorldViewModel(worldPath);
DedicatedConfig.Worlds.Add(worldInfo);
}
DedicatedConfig.SelectedWorld = worldInfo;
if (DedicatedConfig.SelectedWorld?.Checkpoint != null)
{
DedicatedConfig.Mods.Clear();

View File

@@ -51,6 +51,7 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
<DocumentationFile>$(SolutionDir)\bin\x64\Release\Torch.Server.xml</DocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup>
<StartupObject>Torch.Server.Program</StartupObject>

View File

@@ -120,7 +120,13 @@ namespace Torch.Server.ViewModels
public bool EnableSaving { get => _settings.EnableSaving; set => SetValue(ref _settings.EnableSaving, value); }
[Torch.Views.Display(Description = "Enables respawn screen.", Name = "Enable Respawn Screen in the Game", GroupName = "Players")]
public bool EnableRespawnScreen { get => _settings.EnableRespawnScreen; set => SetValue(ref _settings.EnableRespawnScreen, value); }
public bool StartInRespawnScreen { get => _settings.StartInRespawnScreen; set => SetValue(ref _settings.StartInRespawnScreen, value); }
[Torch.Views.Display(Description = "Enables research.", Name = "Enable Research", GroupName = "Players")]
public bool EnableResearch { get => _settings.EnableResearch; set => SetValue(ref _settings.EnableResearch, value); }
[Torch.Views.Display(Description = "Enables Good.bot hints.", Name = "Enable Good.bot hints", GroupName = "Players")]
public bool EnableGoodBotHints { get => _settings.EnableGoodBotHints; set => SetValue(ref _settings.EnableGoodBotHints, value); }
[Torch.Views.Display(Description = "Enables infinite ammunition in survival game mode.", Name = "Enable Infinite Ammunition in Survival", GroupName = "Others")]
public bool InfiniteAmmo { get => _settings.InfiniteAmmo; set => SetValue(ref _settings.InfiniteAmmo, value); }

View File

@@ -93,7 +93,6 @@ namespace Torch.Server
_instanceManager.SelectWorld(worldPath, false);
_instanceManager.LoadInstance(worldPath);
_instanceManager.ImportSelectedWorldConfig();
Close();
}

View File

@@ -48,7 +48,8 @@ namespace Torch.Managers.ChatManager
MyMultiplayerBase.SendScriptedChatMessage(ref scripted);
}
else
MyMultiplayer.Static.SendChatMessage(message);
throw new NotImplementedException("Chat system changes broke this");
//MyMultiplayer.Static.SendChatMessage(message);
}
else if (HasHud)
MyHud.Chat.ShowMessage(MySession.Static.LocalHumanPlayer?.DisplayName ?? "Player", message);
@@ -59,12 +60,6 @@ namespace Torch.Managers.ChatManager
{
if (HasHud)
MyHud.Chat?.ShowMessage(author, message, font);
MySession.Static.GlobalChatHistory.GlobalChatHistory.Chat.Enqueue(new MyGlobalChatItem()
{
Author = author,
AuthorFont = font,
Text = message
});
}
/// <inheritdoc/>
@@ -76,7 +71,7 @@ namespace Torch.Managers.ChatManager
{
_chatMessageRecievedReplacer = _chatMessageReceivedFactory.Invoke();
_scriptedChatMessageRecievedReplacer = _scriptedChatMessageReceivedFactory.Invoke();
_chatMessageRecievedReplacer.Replace(new Action<ulong, string>(Multiplayer_ChatMessageReceived),
_chatMessageRecievedReplacer.Replace(new Action<ulong, string, ChatChannel, long, string>(Multiplayer_ChatMessageReceived),
MyMultiplayer.Static);
_scriptedChatMessageRecievedReplacer.Replace(
new Action<string, string, string>(Multiplayer_ScriptedChatMessageReceived), MyMultiplayer.Static);
@@ -130,12 +125,12 @@ namespace Torch.Managers.ChatManager
}
private void Multiplayer_ChatMessageReceived(ulong steamUserId, string message)
private void Multiplayer_ChatMessageReceived(ulong steamUserId, string messageText, ChatChannel channel, long targetId, string customAuthorName)
{
var torchMsg = new TorchChatMessage(steamUserId, message,
var torchMsg = new TorchChatMessage(steamUserId, $"[{channel}] {messageText}",
(steamUserId == MyGameService.UserId) ? MyFontEnum.DarkBlue : MyFontEnum.Blue);
if (!RaiseMessageRecieved(torchMsg) && HasHud)
_hudChatMessageReceived.Invoke(MyHud.Chat, steamUserId, message);
_hudChatMessageReceived.Invoke(MyHud.Chat, steamUserId, $"[{channel}] {messageText}");
}
private void Multiplayer_ScriptedChatMessageReceived(string message, string author, string font)

View File

@@ -137,13 +137,13 @@ namespace Torch.Managers.ChatManager
return consumed;
}
private void MpStaticChatMessageReceived(ulong a, string b)
private void MpStaticChatMessageReceived(ulong steamUserId, string messageText, ChatChannel channel, long targetId, string customAuthorName)
{
var tmp = false;
RaiseMessageRecieved(new ChatMsg()
RaiseMessageRecieved(new ChatMsg
{
Author = a,
Text = b
Author = steamUserId,
Text = messageText
}, ref tmp);
}

View File

@@ -116,7 +116,7 @@ namespace Torch.Managers
protected void RaiseClientJoined(ulong steamId)
{
var vm = new PlayerViewModel(steamId) { State = ConnectionState.Connected };
_log.Info($"Player {vm.Name} joined ({vm.SteamId}");
_log.Info($"Player {vm.Name} joined ({vm.SteamId})");
Players.Add(steamId, vm);
PlayerJoined?.Invoke(vm);
}

View File

@@ -33,6 +33,7 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<DocumentationFile>$(SolutionDir)\bin\x64\Release\Torch.xml</DocumentationFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="ControlzEx, Version=3.0.2.4, Culture=neutral, processorArchitecture=MSIL">