Skip to content

Commit

Permalink
feat: add invsim_file ConVar
Browse files Browse the repository at this point in the history
  • Loading branch information
ianlucas committed Sep 22, 2024
1 parent 79bbbfd commit 315553b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/InventorySimulator/InventorySimulator.Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public void LoadPlayerInventories()
{
try
{
var path = Path.Combine(Server.GameDirectory, InventoryFilePath);
var path = Path.Combine(Server.GameDirectory, InventoryFileDir, invsim_file.Value);
if (!File.Exists(path))
return;

Expand Down
3 changes: 2 additions & 1 deletion source/InventorySimulator/InventorySimulator.State.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public partial class InventorySimulator
public readonly FakeConVar<string> invsim_apikey = new("invsim_apikey", "Inventory Simulator API's key.", "");
public readonly FakeConVar<string> invsim_hostname = new("invsim_hostname", "Inventory Simulator API's hostname.", "inventory.cstrike.app");
public readonly FakeConVar<string> invsim_protocol = new("invsim_protocol", "Inventory Simulator API's protocol.", "https");
public readonly FakeConVar<string> invsim_file = new("invsim_file", "File to load when plugin is loaded.", "inventories.json");

public readonly HashSet<ulong> FetchingPlayerInventory = [];
public readonly HashSet<ulong> LoadedPlayerInventory = [];
Expand All @@ -33,7 +34,7 @@ public partial class InventorySimulator

public readonly PlayerInventory EmptyInventory = new();

public static readonly string InventoryFilePath = "csgo/addons/counterstrikesharp/configs/plugins/InventorySimulator/inventories.json";
public static readonly string InventoryFileDir = "csgo/addons/counterstrikesharp/configs/plugins/InventorySimulator";
public static readonly ulong MinimumCustomItemID = 68719476736;

public ulong NextItemId = MinimumCustomItemID;
Expand Down

0 comments on commit 315553b

Please sign in to comment.