Skip to content

Instantly share code, notes, and snippets.

View notfood's full-sized avatar
🔥
Supernova!

Meru notfood

🔥
Supernova!
View GitHub Profile
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Xml;
using Harmony;
@notfood
notfood / PatchOperationLoadOnDemand.cs
Last active August 6, 2020 22:50
Given a set of mods and a set of folders, PatchOperationLoadOnDemand loads the defs found in the folders located inside Defs_OnDemand if the mods exist. Makes it easier to manage optional dependencies.
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml;
using Verse;
namespace PatchOperationLoadOnDemand
{
public class XML : PatchOperation
<?xml version="1.0" encoding="utf-8"?>
<ModsConfigData>
<buildNumber>1722</buildNumber>
<activeMods>
<li>Core</li>
<li>Z_Lib_HugsLib</li>
<li>X_Lib_JecsTools</li>
<li>Z_Pawn_AlienRaces</li>
<li>CombatExtended</li>
<li>Core_SK</li>
Computer Information:
Manufacturer: Unknown
Model: Unknown
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: GenuineIntel
CPU Brand: Intel(R) Core(TM) i5-6600 CPU @ 3.30GHz
CPU Family: 0x6
@notfood
notfood / BoostReLoad.cs
Created November 1, 2018 13:47
Caches the prepatched.xml to boost load times
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml;
using System.Linq;
using Harmony;
using RimWorld;
using Verse;
namespace BoostReLoad
@notfood
notfood / drawpile.diff
Created March 16, 2019 18:41
Changes for Drawpile Client to run on Debian stable
diff --git a/src/client/canvas/aclfilter.cpp b/src/client/canvas/aclfilter.cpp
index 92580a5f..a808bacc 100644
--- a/src/client/canvas/aclfilter.cpp
+++ b/src/client/canvas/aclfilter.cpp
@@ -27,6 +27,10 @@
#include "../shared/net/annotation.h"
#include "../shared/net/undo.h"
+#ifndef Q_FALLTHROUGH
+#define Q_FALLTHROUGH() (void)0
.method private hidebysig
instance void '<delegateMovement>b__9_0' () cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
)
// Method begins at RVA 0x27e0
// Code size 192 (0xc0)
.maxstack 4
.locals init (
### Patch Battlemounts.Utilities.EnemyMountUtility, Void mountAnimals(System.Collections.Generic.List`1[Verse.Pawn] ByRef, RimWorld.IncidentParms)
L_0000: Local var 0: System.Boolean
L_0000: Local var 1: System.Collections.Generic.List`1+Enumerator[[Verse.Pawn, Assembly-CSharp, Version=1.0.7087.21901, Culture=neutral, PublicKeyToken=null]]
L_0000: Local var 2: Verse.Pawn
L_0000: Local var 3: System.Boolean
L_0000: ldstr "Battlemounts.Utilities.EnemyMountUtility"
L_0005: ldc.i4 100663297
L_000a: ldnull
L_000b: ldc.i4 2
L_0010: newarr System.Object
@notfood
notfood / AddDebugActions.cs
Created September 7, 2019 19:29
Adds a button to the debug panel to dump the resulting xml into console.
using System;
using Verse;
using Harmony;
using System.Xml;
using System.IO;
namespace DebugActions
{
class DebugActions : Mod
{
@notfood
notfood / drawpile_centos8_install.sh
Last active March 17, 2023 21:15
Script to install Drawpile Server on Centos 8
#!/bin/sh
# Installs drawpile-server, drawpile-listserver and nginx
# You can change the hostname.domain here. Used by drawpile-server.
DPHOSTNAME=$(hostname -f)
# You can change the external ip address here. Default is Google's VPC external ip. Used by drawpile-server and nginx.
EXTERNALIP=$(curl -s -H "Metadata-Flavor: Google" http://metadata/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip)