Skip to content

Commit

Permalink
Switch to simple mod launch counter
Browse files Browse the repository at this point in the history
  • Loading branch information
pardeike committed Sep 24, 2018
1 parent 95617ba commit ba02003
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 43 deletions.
Binary file modified Assemblies/CameraPlus.dll
Binary file not shown.
Binary file removed Assemblies/Firebaser.dll
Binary file not shown.
5 changes: 1 addition & 4 deletions Source/CameraPlus.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="FireStats.cs" />
<Compile Include="ModCounter.cs" />
<Compile Include="Main.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Settings.cs" />
Expand All @@ -49,9 +49,6 @@
<HintPath>D:\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Firebaser, Version=0.9.6.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Firebaser.0.9.6\lib\net35\Firebaser.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="UnityEngine">
<HintPath>D:\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
Expand Down
36 changes: 0 additions & 36 deletions Source/FireStats.cs

This file was deleted.

3 changes: 1 addition & 2 deletions Source/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public CameraPlusMain(ModContentPack content) : base(content)

var harmony = HarmonyInstance.Create("net.pardeike.rimworld.mod.camera+");
harmony.PatchAll(Assembly.GetExecutingAssembly());
FireStats.Trigger(true);
}

public override void DoSettingsWindowContents(Rect inRect)
Expand All @@ -39,7 +38,7 @@ static class Game_FinalizeInit_Patch
{
static void Postfix()
{
FireStats.Trigger(false);
ModCounter.Trigger();
}
}

Expand Down
25 changes: 25 additions & 0 deletions Source/ModCounter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;

namespace CameraPlus
{
public class ModCounter
{
// a very simple and gdpr friendly mod launch counter.
// no personal information is transfered and firebase
// doesn't store the IP or any other traceable information

static readonly string baseUrl = "http://us-central1-brrainz-mod-stats.cloudfunctions.net/ping?";
public static void Trigger()
{
try
{
var uri = new Uri(baseUrl + "CameraPlus");
var client = new System.Net.WebClient();
client.DownloadStringAsync(uri);
}
catch (Exception)
{
}
}
}
}
1 change: 0 additions & 1 deletion Source/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Firebaser" version="0.9.6" targetFramework="net35" />
<package id="Lib.Harmony" version="1.2.0.1" targetFramework="net35" />
</packages>

0 comments on commit ba02003

Please sign in to comment.