...
 
Commits (8)
......@@ -12,6 +12,7 @@ using System.Collections.Generic;
using System.Linq;
using Glitterworld_Prime.Tools;
using RimWorld;
using UnityEngine;
using Verse;
using Verse.AI;
......@@ -58,15 +59,14 @@ namespace Glitterworld_Prime
}
floatMenuOptions = new List<FloatMenuOption>();
var tradeship = mapComponent.GetTradeShip();
var communicable = (ICommunicable) tradeship; // Cast trader as ICommunicable;
var tradeShip = mapComponent.GetTradeShip();
var communicable = (ICommunicable) tradeShip; // Cast trader as ICommunicable;
Action action = delegate
{
if (!Building_PrimeUplink.HasUplink(myPawn.Map))
{
Messages.Message("GWPNeedUplink".Translate(), this,
MessageTypeDefOf.RejectInput);
Messages.Message("GWPNeedUplink".Translate(), this, MessageTypeDefOf.RejectInput);
return;
}
......@@ -85,25 +85,38 @@ namespace Glitterworld_Prime
#if DEBUG
floatMenuOptions.Add(FloatMenuUtility.DecoratePrioritizedTask(
new FloatMenuOption("Dump Thing data", DumpThingData.DumpData, MenuOptionPriority.InitiateSocial, null,
new FloatMenuOption("Dump Thing data", DumpThingData.DumpData, MenuOptionPriority.Low, null,
null, 0f,
null, null), myPawn, this, "ReservedBy"));
floatMenuOptions.Add(FloatMenuUtility.DecoratePrioritizedTask(
new FloatMenuOption("Throw an error!", Utilities.SendTestException, MenuOptionPriority.High, null,
null, 0f,
null, null), myPawn, this, "ReservedBy"));
#endif
// Are they holding down shift?
if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift))
{
Action reactivateAction = delegate { Find.WindowStack.Add(new DialogPrimeReactivate()); };
floatMenuOptions.Add(FloatMenuUtility.DecoratePrioritizedTask(
new FloatMenuOption("Reactivate", reactivateAction, MenuOptionPriority.InitiateSocial, null, null, 0f,
null, null), myPawn, this, "ReservedBy"));
}
floatMenuOptions.Add(FloatMenuUtility.DecoratePrioritizedTask(
new FloatMenuOption(tradeship.TraderName, action, MenuOptionPriority.InitiateSocial, null, null, 0f,
new FloatMenuOption(tradeShip.TraderName, action, MenuOptionPriority.InitiateSocial, null, null, 0f,
null, null), myPawn, this, "ReservedBy"));
return floatMenuOptions;
}
public override void SpawnSetup(Map map, bool respawningAfterLoad)
{
base.SpawnSetup(map, respawningAfterLoad);
}
// public override void SpawnSetup(Map map, bool respawningAfterLoad)
// {
// base.SpawnSetup(map, respawningAfterLoad);
// }
#endregion
}
}
\ No newline at end of file
}
......@@ -24,7 +24,7 @@ namespace Glitterworld_Prime
private readonly GlitterWorld_MapComponent _mapComponent;
private readonly Pawn _player;
private readonly bool _shouldClose = false;
private bool _shouldClose = false;
private readonly ITrader _trader;
private Stopwatch _apiStopwatch;
......@@ -78,73 +78,84 @@ namespace Glitterworld_Prime
public override void DoWindowContents(Rect inRect)
{
GUI.color = Color.white;
if (_shouldClose)
try
{
Close();
return;
}
Text.Font = GameFont.Small;
GUI.color = Color.white;
switch (_status)
{
case DownloadStatus.Incomplete:
if (_previousStatus != DownloadStatus.Incomplete)
{
_previousStatus = DownloadStatus.Incomplete;
_downloadMessage = "GWPSendingThingList".Translate();
}
break;
case DownloadStatus.DoneSendingSupportedThings:
if (_previousStatus != DownloadStatus.DoneSendingSupportedThings)
{
// Now send the mods
_previousStatus = DownloadStatus.DoneSendingSupportedThings;
_downloadMessage = "GWPSendingModList".Translate();
_apiStopwatch = new Stopwatch();
LogWriter.WriteMessage("Starting request to server");
_apiStopwatch.Start();
GlitterWorldApi.PutModListAsync(_mapComponent, PutModListComplete_Callback);
}
break;
case DownloadStatus.DoneSendingMods:
if (_previousStatus != DownloadStatus.DoneSendingMods)
{
// Download Goods from Server
_previousStatus = DownloadStatus.DoneSendingMods;
_downloadMessage = "GWPGetMarketData".Translate();
_apiStopwatch = new Stopwatch();
LogWriter.WriteMessage("Starting request to server");
_apiStopwatch.Start();
GlitterWorldApi.GetServerGoodsAsync(_mapComponent, DownloadThingsComplete_Callback);
}
break;
case DownloadStatus.Complete:
// Mark that we've sent all the metadata, so not to do it again.
_mapComponent.HasSentThingListYet = true;
// We're done, close and go to the trade screen.
var dt = new DialogPrimeTrade(_player, _trader);
Find.WindowStack.Add(dt);
if (_shouldClose)
{
Close();
break;
return;
}
case DownloadStatus.Failed:
Messages.Message("GWPCantGetMarketData".Translate(), MessageTypeDefOf.NegativeEvent);
Close();
break;
Text.Font = GameFont.Small;
default:
throw new ArgumentOutOfRangeException();
switch (_status)
{
case DownloadStatus.Incomplete:
if (_previousStatus != DownloadStatus.Incomplete)
{
_previousStatus = DownloadStatus.Incomplete;
_downloadMessage = "GWPSendingThingList".Translate();
}
break;
case DownloadStatus.DoneSendingSupportedThings:
if (_previousStatus != DownloadStatus.DoneSendingSupportedThings)
{
// Now send the mods
_previousStatus = DownloadStatus.DoneSendingSupportedThings;
_downloadMessage = "GWPSendingModList".Translate();
_apiStopwatch = new Stopwatch();
LogWriter.WriteMessage("Starting request to server");
_apiStopwatch.Start();
GlitterWorldApi.PutModListAsync(_mapComponent, PutModListComplete_Callback);
}
break;
case DownloadStatus.DoneSendingMods:
if (_previousStatus != DownloadStatus.DoneSendingMods)
{
// Download Goods from Server
_previousStatus = DownloadStatus.DoneSendingMods;
_downloadMessage = "GWPGetMarketData".Translate();
_apiStopwatch = new Stopwatch();
LogWriter.WriteMessage("Starting request to server");
_apiStopwatch.Start();
GlitterWorldApi.GetServerGoodsAsync(_mapComponent, DownloadThingsComplete_Callback);
}
break;
case DownloadStatus.Complete:
// Mark that we've sent all the metadata, so not to do it again.
_mapComponent.HasSentThingListYet = true;
// We're done, close and go to the trade screen.
var dt = new DialogPrimeTrade(_player, _trader);
Find.WindowStack.Add(dt);
Close();
break;
case DownloadStatus.Failed:
Messages.Message("GWPCantGetMarketData".Translate(), MessageTypeDefOf.NegativeEvent);
Close();
break;
default:
throw new ArgumentOutOfRangeException();
}
}
catch (Exception exception)
{
Utilities.CaptureError(exception);
Close();
_shouldClose = true;
return;
}
var textWidth = Text.CalcSize(_downloadMessage);
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RimWorld;
using UnityEngine;
using Verse;
namespace Glitterworld_Prime
{
public class DialogPrimeReactivate : Window
{
protected string code;
private bool focusedRenameField;
public DialogPrimeReactivate()
{
this.forcePause = true;
this.doCloseX = true;
this.absorbInputAroundWindow = true;
this.closeOnAccept = false;
this.closeOnClickedOutside = true;
}
protected virtual int MaxCodeLength => 8;
public override Vector2 InitialSize => new Vector2(280f, 175f);
public override void DoWindowContents(Rect inRect)
{
Text.Font = GameFont.Small;
bool flag = false;
if (Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Return)
{
flag = true;
Event.current.Use();
}
GUI.SetNextControlName("CodeField");
string str = Widgets.TextField(new Rect(0.0f, 15f, inRect.width, 35f), this.code);
if (str.Length < (this.MaxCodeLength+1))
this.code = str;
if (!this.focusedRenameField)
{
UI.FocusControl("CodeField", (Window) this);
this.focusedRenameField = true;
}
if (!Widgets.ButtonText(
new Rect(15f, (float) ((double) inRect.height - 35.0 - 15.0), (float) ((double) inRect.width - 15.0 - 15.0),
35f), "OK", true, false, true) && !flag)
return;
AcceptanceReport acceptanceReport = this.CodeIsValid(this.code);
if (!acceptanceReport.Accepted)
{
Messages.Message(acceptanceReport.Reason, MessageTypeDefOf.RejectInput, false);
}
else
{
TryActivate(this.code);
Find.WindowStack.TryRemove((Window) this, true);
}
}
private AcceptanceReport CodeIsValid(string code)
{
if (code.Length != MaxCodeLength)
return new AcceptanceReport("GWPActivateIncorrect".Translate());
return (AcceptanceReport) true;
}
private static void TryActivate(string code)
{
// API Call to reactivate
GlitterWorldApi.ReactivateUserAccount(code);
}
}
}
This diff is collapsed.
......@@ -29,7 +29,7 @@ namespace Glitterworld_Prime
private static readonly float ClientVersion = 1.0f;
#if LOCALSERVER
private static readonly string BaseUrl = "http://127.0.0.1:5000";
private static readonly string BaseUrl = "https://prime-dev.thecodecache.net";
#else
private static readonly string BaseUrl = "https://prime.thecodecache.net";
#endif
......@@ -55,9 +55,7 @@ namespace Glitterworld_Prime
if (response.StatusCode == HttpStatusCode.OK)
if (ClientVersion < response.Data.Version)
{
var d = new Dialog_MessageBox(
"This mod version is out of date. Please update before trading.", title: "GlitterWorldPrime");
Find.WindowStack.Add(d);
Find.WindowStack.Add(new Dialog_MessageBox("GWPOutOfDate".Translate(), title: "GlitterWorldPrime"));
return false;
}
else
......@@ -66,14 +64,40 @@ namespace Glitterworld_Prime
}
{
var d = new Dialog_MessageBox(
"We received an invalid response, It might be down or you maybe out of date.\nPlease check the forum/workshop.",
title: "GlitterWorldPrime");
Find.WindowStack.Add(d);
Find.WindowStack.Add(new Dialog_MessageBox("GWPBadResponse".Translate(), title: "GlitterWorldPrime"));
return false;
}
}
internal static void ReactivateUserAccount(string token)
{
LogWriter.WriteMessage("Trying to reactivate");
var client = CreateRestClient();
var request = new RestRequest($"/v4/{MarketUrl}/user/reactivate", Method.POST);
var requestData = new GlitterWorldActivationRequest
{
Token = token, UserId = Utilities.GetUserId(), UserType = Utilities.GetUserType()
};
request.AddJsonBody(requestData);
var response = ExecuteRequestExpectData<GlitterWorldActivationRequestResponse>(client, request);
CheckResponseForErrors(response);
if (response.StatusCode == HttpStatusCode.OK)
{
var accepted = response.Data.Accepted ? "GWPActivateOK".Translate() : "GWPActivateFail".Translate();
var gameComponent = Current.Game.GetComponent<GlitterWorldGameComponent>();
gameComponent.HasSpawned = false;
Find.WindowStack.Add(new Dialog_MessageBox(accepted, title: "GlitterWorldPrime Reactivation"));
return;
}
Find.WindowStack.Add(new Dialog_MessageBox("GWPBadResponse".Translate(), title: "GlitterWorldPrime"));
}
internal static bool CheckIsOnline()
{
LogWriter.WriteMessage("Getting Server Status");
......@@ -92,13 +116,12 @@ namespace Glitterworld_Prime
case HttpStatusCode.Gone:
Find.WindowStack.Add(new Dialog_MessageBox(
"The server is in maintenance mode, Please try again later.", title: "GlitterWorldPrime"));
"GWPServerMaintenanceMode".Translate(), title: "GlitterWorldPrime"));
return false;
default:
Find.WindowStack.Add(new Dialog_MessageBox(
"We received an invalid response, It might be down or you maybe out of date.\nPlease check the forum/workshop.",
title: "GlitterWorldPrime"));
Find.WindowStack.Add(
new Dialog_MessageBox("GWPBadResponse".Translate(), title: "GlitterWorldPrime"));
return false;
}
}
......@@ -123,22 +146,17 @@ namespace Glitterworld_Prime
if (response.StatusCode == HttpStatusCode.OK)
{
if (response.Data.IsSet() && response.Data.IsSoon())
{
var d = new Dialog_MessageBox(
$"The server will be starting maintenance at {response.Data.StartTime().ToString(CultureInfo.CurrentCulture)} and will last {response.Data.DurationInHours()} hour(s).",
title: "GlitterWorldPrime");
Find.WindowStack.Add(d);
}
if (!response.Data.IsSet() || !response.Data.IsSoon()) return true;
var d = new Dialog_MessageBox(
$"The server will be starting maintenance at {response.Data.StartTime().ToString(CultureInfo.CurrentCulture)} and will last {response.Data.DurationInHours()} hour(s).",
title: "GlitterWorldPrime");
Find.WindowStack.Add(d);
return true;
}
{
var d = new Dialog_MessageBox(
"We received an invalid response, It might be down or you maybe out of date.\nPlease check the forum/workshop.",
title: "GlitterWorldPrime");
Find.WindowStack.Add(d);
Find.WindowStack.Add(new Dialog_MessageBox("GWPBadResponse".Translate(), title: "GlitterWorldPrime"));
return false;
}
}
......@@ -149,6 +167,15 @@ namespace Glitterworld_Prime
if (response.ResponseStatus == ResponseStatus.Completed) return;
try
{
throw new Exception($"Unexpected API response: {response.ResponseStatus}, {response.ErrorMessage}");
}
catch (Exception e)
{
Utilities.CaptureError(e);
}
LogWriter.DumpObjectToLog(response);
}
......@@ -348,7 +375,7 @@ namespace Glitterworld_Prime
LogWriter.WriteMessage("Sending Colony Metadata");
reason = 0;
var client = CreateRestClient();
var mapComponent = map.GetComponent<GlitterWorld_MapComponent>();
var gameComponent = Current.Game.GetComponent<GlitterWorldGameComponent>();
// Send colony metadata.
var cmd = new GlitterWorldColonyMetadata(
......@@ -357,7 +384,7 @@ namespace Glitterworld_Prime
Utilities.GetUserType(),
Utilities.GetUserId(),
Find.TickManager.TicksAbs,
mapComponent.HasSpawned
gameComponent.HasSpawned
);
......
......@@ -81,6 +81,29 @@ namespace Glitterworld_Prime.ApiStructs
#endregion
}
[Serializable]
internal class GlitterWorldActivationRequest
{
#region Properties
public string Token { get; set; }
public string UserId { get; set; }
public string UserType { get; set; }
#endregion
}
[Serializable]
internal class GlitterWorldActivationRequestResponse
{
#region Properties
public bool Accepted { get; set; }
#endregion
}
[Serializable]
internal class GlitterWorldIdResponse
{
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Verse;
namespace Glitterworld_Prime
{
class GlitterWorldGameComponent : GameComponent
{
public GlitterWorldGameComponent(Verse.Game game)
{
}
private string _hasSpawned = "false";
internal bool HasSpawned
{
get { return _hasSpawned == "true"; }
set { _hasSpawned = value ? "true" : "false"; }
}
}
}
\ No newline at end of file
......@@ -22,7 +22,7 @@ namespace Glitterworld_Prime
private string _colonyId = "";
private TraderPrime _currentTradeShip;
private string _hasSpawned = "false";
private bool _initComplete;
#endregion
......@@ -54,12 +54,6 @@ namespace Glitterworld_Prime
internal bool HasSentThingListYet { get; set; }
internal bool HasSpawned
{
get { return _hasSpawned == "true"; }
set { _hasSpawned = value ? "true" : "false"; }
}
#endregion
#region Methods
......@@ -69,7 +63,6 @@ namespace Glitterworld_Prime
LogWriter.WriteMessage("GlitterWorld Prime saving/loading Colony Metadata");
base.ExposeData();
Scribe_Values.Look(ref _colonyId, "GlitterWorldPrimeColonyID", "", false);
Scribe_Values.Look(ref _hasSpawned, "GlitterWorldPrimeCompatibleApi", "", false);
LogWriter.WriteMessage("GlitterWorld Prime (Save/Load) now using Colony ID: " + _colonyId);
}
......
......@@ -12,6 +12,7 @@
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<LangVersion>6</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......@@ -51,28 +52,33 @@
<HintPath>.\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>E:\Games\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
<HintPath>D:\Games\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>E:\Games\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
<HintPath>D:\Games\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MiniSentrySDK, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\..\MiniSentrySDK\MiniSentrySDK\bin\Debug\MiniSentrySDK.dll</HintPath>
</Reference>
<Reference Include="RestSharp">
<HintPath>F:\Code\C#\RestSharp\RestSharp\bin\Debug\RestSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine">
<HintPath>E:\Games\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
<HintPath>D:\Games\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Building_TradeWithPrime.cs" />
<Compile Include="DialogPrimeCheckSubscription.cs" />
<Compile Include="DialogPrimeReactivate.cs" />
<Compile Include="DialogPrimeTrade.cs" />
<Compile Include="DialogPrimeUpdateSubscription.cs" />
<Compile Include="GlitterWorldApi.cs" />
......@@ -80,6 +86,7 @@
<Compile Include="GlitterWorldAssets.cs" />
<Compile Include="GlitterWorldOrderItem.cs" />
<Compile Include="GlitterWorldItem.cs" />
<Compile Include="GlitterWorldGameComponent.cs" />
<Compile Include="GlitterWorld_MapComponent.cs" />
<Compile Include="GlitterWorldDelivery.cs" />
<Compile Include="GlitterWorldOrderTracker.cs" />
......@@ -97,7 +104,14 @@
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Content Include="..\build.cake">
<Link>build.cake</Link>
</Content>
<Content Include="..\build.ps1">
<Link>build.ps1</Link>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
......
......@@ -24,8 +24,8 @@ namespace Glitterworld_Prime.Patches
public static void Prefix(ThingDef def, IntVec3 c, int stackCount = -1, bool direct = false)
{
var mapComponent = Find.CurrentMap.GetComponent<GlitterWorld_MapComponent>();
mapComponent.HasSpawned = true;
var gameComponent = Current.Game.GetComponent<GlitterWorldGameComponent>();
gameComponent.HasSpawned = true;
}
#endregion
......@@ -33,4 +33,4 @@ namespace Glitterworld_Prime.Patches
#endregion
}
}
\ No newline at end of file
}
......@@ -40,5 +40,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.2.0")]
[assembly: AssemblyFileVersion("1.0.2.0")]
\ No newline at end of file
[assembly: AssemblyVersion("1.0.2.2")]
[assembly: AssemblyFileVersion("1.0.2.2")]
......@@ -20,6 +20,7 @@ using Steamworks;
using Verse;
using Verse.Steam;
using Version = System.Version;
using MiniSentrySDK;
namespace Glitterworld_Prime
{
......@@ -29,6 +30,10 @@ namespace Glitterworld_Prime
private static readonly Assembly Reference = typeof(Utilities).Assembly;
public static readonly Version Version = Reference.GetName().Version;
private static readonly MiniSentrySDK.Client sentry =
new MiniSentrySDK.Client("https://e428e7077f1c426893a3c27814014201@sentry.thecodecache.net/4");
private static string _steamId;
private static string _userId;
......@@ -39,6 +44,50 @@ namespace Glitterworld_Prime
#region Methods
internal static void CaptureError(Exception exception)
{
LogWriter.WriteMessage("Not forcing stacktrace");
var e = new SentryEvent(exception);
// Get User ID / Type
try
{
e.Tags.Add("UserID", GetUserId());
e.Tags.Add("UserType", GetUserType());
}
catch (Exception e1)
{
e.Breadcrumbs.Add(new Breadcrumb("Error") {message = "Unable to get User Data"});
}
// Get Colony ID if any
try
{
e.Tags.Add("ColonyID", GetMapComponent(Find.CurrentMap).ColonyId);
}
catch (Exception e1)
{
e.Breadcrumbs.Add(new Breadcrumb("Error") {message = "Unable to get Colony ID"});
}
sentry.Capture(e);
LogWriter.WriteMessage("An error occurred and has been reported.");
}
internal static void SendTestException()
{
try
{
throw new Exception("Test Exception!");
}
catch (Exception e)
{
CaptureError(e);
}
}
internal static string GetUserType()
{
#if DISABLESTEAM
......@@ -276,10 +325,14 @@ namespace Glitterworld_Prime
internal static GlitterWorld_MapComponent GetMapComponent(Map map)
{
foreach (var component in map.components)
if (component.GetType() == typeof(GlitterWorld_MapComponent))
return (GlitterWorld_MapComponent) component;
return null;
try
{
return map.GetComponent<GlitterWorld_MapComponent>();
}
catch (Exception)
{
return null;
}
}
internal static bool HasBaseNameBeenSet(Map m)
......@@ -416,13 +469,18 @@ namespace Glitterworld_Prime
// Then scan for Defs that can be traded.
foreach (var thing in things)
try
{
if (thing.tradeability == Tradeability.None) continue;
if (thing.category == ThingCategory.Item && thing.thingClass.Name != "MinifiedThing")
if (thing.tradeability != Tradeability.None &&
thing.GetStatValueAbstract(StatDefOf.MarketValue) > 0.0 &&
(thing.category == ThingCategory.Item || thing.category == ThingCategory.Building) &&
(thing.category != ThingCategory.Building || thing.Minifiable))
thingsToRequestFromMarket.AddRange(ComputeThingDef(thing, stuffCategories));
// Add support for Minifiable buildings
else if (thing.category == ThingCategory.Building && thing.Minifiable)
else if (thing.category == ThingCategory.Building && thing.Minifiable &&
thing.tradeability != Tradeability.None)
thingsToRequestFromMarket.AddRange(ComputeThingDef(thing, stuffCategories));
}
catch (Exception ex)
......@@ -452,4 +510,4 @@ namespace Glitterworld_Prime
#endregion
}
}
}
\ No newline at end of file
......@@ -20,9 +20,14 @@
<GWPDialogCantAffordSubscription2>But you cannot afford to renew, The cost is:</GWPDialogCantAffordSubscription2>
<GWPCurrency>Silver</GWPCurrency>
<GWPGiveItAway>We can't pay you for goods worth less than 1 Silver, Continue anyway?</GWPGiveItAway>
<GWPBanned>You are banned from using GlitterWorld Prime</GWPBanned>
<GWPBanned>You are banned from using GlitterWorld Prime OR Steam is in offline mode!</GWPBanned>
<GWPSendingThingList>Sending Supported Thing List</GWPSendingThingList>
<GWPSendingModList>Sending Supported Mods</GWPSendingModList>
<GWPGetMarketData>Getting Market Data</GWPGetMarketData>
<GWPBadResponse>The server did not respond or gave an invalid response, It might be down or you might be out of date.\n\nPlease check the Discord, the Ludeon forum or the Steam Workshop for updates and news.</GWPBadResponse>
<GWPActivateOK>The server accepted the token.\n\nPlease don't use Developer mode or you could end up banned again!</GWPActivateOK>
<GWPActivateFail>The server did not accepted the token, Please check your token was correct.</GWPActivateFail>
<GWPServerMaintenanceMode>The server is in maintenance mode, Please try again later.</GWPServerMaintenanceMode>
<GWPOutOfDate>This mod version is out of date. You'll need to update before trading.</GWPOutOfDate>
<GWPActivateIncorrect>The token should be 8 characters long.</GWPActivateIncorrect>
</LanguageData>
\ No newline at end of file
......@@ -15,7 +15,7 @@ var mod_base_path = "./mod_package";
var mod_path = $"./{mod_base_path}/{modname} [{version}]";
var git_hash = "";
var asm_version = "";
var steam_folder = @"E:\Games\Steam\steamapps\common\RimWorld\Mods";
var steam_folder = @"D:\Games\Steam\steamapps\common\RimWorld\Mods";
///////////////////////////////////////////////////////////////////////////////
// SETUP / TEARDOWN
......@@ -44,12 +44,21 @@ Task("CopyDataFolders")
CopyDirectory("./Defs", mod_path+"/Defs");
CopyDirectory("./Languages", mod_path+"/Languages");
CopyDirectory("./Textures", mod_path+"/Textures");
CreateDirectory(mod_path+"/Assemblies");
DeleteDirectory(mod_path+"/Assemblies", new DeleteDirectorySettings {
Recursive = true,
Force = true
});
CreateDirectory(mod_path+"/Assemblies");
});
Task("CopyDLLs")
.IsDependentOn("Compile")
.Does(() => {
CopyFiles("./Assemblies/*.dll", mod_path+"/Assemblies");
CopyFile("./Assemblies/0Harmony.dll", mod_path+"/Assemblies/0Harmony.dll");
CopyFile("./Assemblies/RestSharp.dll", mod_path+"/Assemblies/1RestSharp.dll");
CopyFile("./Assemblies/MiniSentrySDK.dll", mod_path+"/Assemblies/2MiniSentrySDK.dll");
CopyFile("./Assemblies/Glitterworld Prime.dll", mod_path+"/Assemblies/3GlitterWorldPrime.dll");
});
Task("GetGitVersion")
......@@ -107,6 +116,7 @@ Task("MakeZIP")
Task("CopyToSteam")
.Does(() => {
CreateDirectory($"{steam_folder}/{modname} [{version}]");
DeleteDirectory($"{steam_folder}/{modname} [{version}]", new DeleteDirectorySettings {
Recursive = true,
Force = true
......