Skip to content
Draft

v1.3 #139

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
3967b7c
Minor stuff
johnklipi Jun 9, 2025
8176701
Merge branch 'main' into dev1.3
Artemis21 Aug 12, 2025
8bc3eb0
Merge
johnklipi Mar 15, 2026
e77df1f
Added dystopia stuff
johnklipi Mar 15, 2026
21b16a1
Added bool which lets u disable gld mods
johnklipi Mar 15, 2026
fc1d549
Started implementing client side creation of GameState
johnklipi Mar 24, 2026
3db6ce2
fixed malformed player account id
johnklipi Mar 24, 2026
03498e8
Moved stuff a bit and finished implementing client side creation of g…
johnklipi Mar 25, 2026
06ba9b2
unhardcoded backend url
johnklipi Mar 27, 2026
8080356
Merge branch 'main' into dev1.3
johnklipi Apr 5, 2026
9a9f213
added half working modded games
johnklipi Apr 5, 2026
f556cc8
first android multiplayer edits
Demonofpower Apr 12, 2026
f09d591
merge
johnklipi May 2, 2026
e67a728
Implemented working online battles with mods
johnklipi May 3, 2026
209adf2
merge
johnklipi Jun 19, 2026
12bf062
removed all references to old start screen
johnklipi Jun 19, 2026
9b5d3ae
minor stuff
johnklipi Jul 6, 2026
50ab1ed
updated to 2.17.2
johnklipi Jul 6, 2026
d103aed
ui2 multiplayer part update
Demonofpower Jul 6, 2026
56c1f11
minor button arrange fix
Demonofpower Jul 6, 2026
dc1d176
minor android refactoring
Demonofpower Jul 9, 2026
b70e321
added default values to class vars to fix pipeline
Demonofpower Jul 9, 2026
19ac56e
more firebase fixes
Demonofpower Jul 9, 2026
a76a103
bumped version to see in logs on android
Demonofpower Jul 9, 2026
f43a1c8
multiplayer refactoring + added client only helper
Demonofpower Jul 22, 2026
1d09078
linux crash fix
Demonofpower Aug 8, 2026
0fbafab
added dystopia server changer
Demonofpower Aug 8, 2026
459b574
minor refactoring
Demonofpower Aug 8, 2026
2b78e8d
added mod lobby creation flags in createlobby backend call
Demonofpower Aug 8, 2026
dd7ee10
modded multiplayer??
Demonofpower Aug 10, 2026
5c433c9
minor fix
Demonofpower Aug 10, 2026
e26b5d8
minor fix + version bump
Demonofpower Aug 10, 2026
f870ea4
moved dystopia button into section in multiplayer tab
Demonofpower Aug 10, 2026
ac7056a
fixed pipeline
Demonofpower Aug 11, 2026
07ccd88
Merge branch 'dev1.3' into dev1.3-multiplayer
johnklipi Sep 19, 2026
c6dfc2f
Revert "Merge branch 'dev1.3' into dev1.3-multiplayer"
johnklipi Sep 19, 2026
b019241
Merge pull request #147 from PolyModdingTeam/dev1.3-multiplayer
johnklipi Sep 19, 2026
fed1962
feat: removed autoupdate
johnklipi Sep 19, 2026
2494586
Merge branch 'main' into dev1.3
johnklipi Sep 19, 2026
7344e2e
feat: added named pipe stuff and popup on invalid install
johnklipi Sep 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -406,4 +406,6 @@ dist/

# End of https://www.toptal.com/developers/gitignore/api/csharp

run.bat
run.bat

.idea/
4 changes: 2 additions & 2 deletions PolyMod.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</RestoreAdditionalProjectSources>
<Configurations>IL2CPP</Configurations>
<RootNamespace>PolyMod</RootNamespace>
<Version>1.2.18</Version>
<Version>1.3.0-pre</Version>
<PolytopiaVersion>2.17.3.16375</PolytopiaVersion>
<Authors>PolyModdingTeam</Authors>
<Description>The Battle of Polytopia's mod loader.</Description>
Expand All @@ -23,7 +23,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.785" />
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.788" />
<PackageReference Include="Costura.Fody" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Binary file added resources/dystopia_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions resources/localization.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,44 @@
{
"polymod_dystopia": {
"English": "Dystopia",
"German (Germany)": "Dystopia"
},
"polymod_dystopia_server": {
"English": "Server",
"German (Germany)": "Server"
},
"polymod_dystopia_connected": {
"English": "connected",
"German (Germany)": "verbunden"
},
"polymod_dystopia_disconnected": {
"English": "disconnected",
"German (Germany)": "getrennt"
},
"polymod_dystopia_modded": {
"English": "modded",
"German (Germany)": "gemoddet"
},
"polymod_dystopia_vanilla": {
"English": "vanilla",
"German (Germany)": "vanilla"
},
"polymod_dystopia_modded_description": {
"English": "Gameplay Mods active\nChecksum: {0}\n\nOnly players with the exact same mods can join your games. The official backend is unavailable while gameplay mods are loaded.",
"German (Germany)": "Gameplay-Mods aktiv\nPrüfsumme: {0}\n\nNur Spieler mit exakt denselben Mods können deinen Spielen beitreten. Der offizielle Server ist mit geladenen Gameplay-Mods nicht verfügbar."
},
"polymod_dystopia_vanilla_description": {
"English": "No gameplay mods loaded — vanilla multiplayer.",
"German (Germany)": "Keine Gameplay-Mods geladen — Vanilla-Multiplayer."
},
"polymod_dystopia_connect": {
"English": "Connect to {0}",
"German (Germany)": "Mit {0} verbinden"
},
"polymod_dystopia_custom": {
"English": "Custom server...",
"German (Germany)": "Eigener Server..."
},
"polymod_hub": {
"English": "PolyMod Hub",
"Russian": "Центр PolyMod",
Expand Down Expand Up @@ -242,5 +282,17 @@
"English": "PROCEED",
"Russian": "ПРОДОЛЖИТЬ",
"Elyrion": "πrȱ#∑∑Δ"
},
"polymod_title_invalid": {
"English": "Invalid Launch",
"Russian": "Неверный Запуск"
},
"polymod_description_invalid": {
"English": "PolyMod launch was invalid. Please, open the game via the PolyMod Launcher or proceed to our site to install it :)",
"Russian": "PolyMod запущен неккоректно. Пожалуйста, откройте игру через PolyMod Launcher или перейдите на наш сайт и установите его :)"
},
"buttons_download_launcher": {
"English": "OUR SITE",
"Russian": "НАШ САЙТ"
}
}
90 changes: 90 additions & 0 deletions src/Android/AndroidHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
using HarmonyLib;
using PolytopiaBackendBase;
using PolytopiaBackendBase.Auth;
using UnityEngine;

namespace PolyMod.Android;

public static class AndroidHandler
{
internal static void Init()
{
if (Application.platform != RuntimePlatform.Android) return;

Harmony.CreateAndPatchAll(typeof(AndroidHandler));
}

/// <summary>
/// On Android, bypass multiplayer requirements that depend on
/// Google Play login, push notifications, and purchases — none of which work
/// when running as a wrapper app with a different package identity.
/// </summary>
[HarmonyPrefix]
[HarmonyPatch(typeof(GameManager), nameof(GameManager.IsMultiplayerEnabled), MethodType.Getter)]
public static bool GameManager_IsMultiplayerEnabled(ref bool __result)
{
__result = true;
return false;
}

/// <summary>
/// Replace the Android login flow to skip Google Play Games SDK entirely.
/// Uses deviceUniqueIdentifier as the auth code for the Polydystopia backend.
/// </summary>
[HarmonyPrefix]
[HarmonyPatch(typeof(PolytopiaBackendAdapter), "LoginPlatformAndroid")]
public static bool LoginPlatformAndroid_Prefix(
ref Il2CppSystem.Threading.Tasks.Task<ServerResponse<PolytopiaToken>> __result,
PolytopiaBackendAdapter __instance)
{
// Mark social login as cached so the post-login flow doesn't bail out
__instance.HasSocialLoginCached = true;

var model = new LoginGooglePlayBindingModel();
model.AuthCode = SystemInfo.deviceUniqueIdentifier;
model.DeviceId = SystemInfo.deviceUniqueIdentifier;
model.GameVersion = new Il2CppSystem.Nullable<int>(VersionManager.GameVersion);

Plugin.logger.LogInfo($"Multiplayer> Android login with DeviceId: {model.DeviceId}");
__result = __instance.LoginGooglePlay(model);
return false;
}

/// <summary>
/// On android Firebase cannot initialize inside the launcher process (its config lives in the game APK's resources, and the native lib may be unreachable there).
/// We try to skip Firebase completely.
/// </summary>
[HarmonyPrefix]
[HarmonyPatch(typeof(AnalyticsManager), nameof(AnalyticsManager.IsAnalyticsEnabled))]
private static bool AnalyticsManager_IsAnalyticsEnabled(ref bool __result)
{
__result = false;
return false;
}

/// <summary>
/// On android Firebase cannot initialize inside the launcher process (its config lives in the game APK's resources, and the native lib may be unreachable there).
/// We try to skip Firebase completely. isFirebaseInitialized deliberately stays false:
/// pretending Firebase is up could wake isFirebaseInitialized-guarded code paths
/// (e.g. HandleOpenedThroughNotification on every app resume).
/// </summary>
[HarmonyPrefix]
[HarmonyPatch(typeof(FirebaseMessagingManager), nameof(FirebaseMessagingManager.Init))]
private static bool FirebaseMessagingManager_Init()
{
return false;
}

/// <summary>
/// RequestPushNotificationPermissions (the push-notification row in LoginDetails) calls
/// InitAsync directly, bypassing Init — with isFirebaseInitialized kept false that would
/// still reach Firebase, so hand back a completed task instead.
/// </summary>
[HarmonyPrefix]
[HarmonyPatch(typeof(FirebaseMessagingManager), nameof(FirebaseMessagingManager.InitAsync))]
private static bool FirebaseMessagingManager_InitAsync(ref Il2CppSystem.Threading.Tasks.Task __result)
{
__result = Il2CppSystem.Threading.Tasks.Task.CompletedTask;
return false;
}
}
5 changes: 5 additions & 0 deletions src/Loader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,11 @@ ref manifest
Plugin.logger.LogError($"Mod id {manifest.id} is invalid in {modContainer}");
continue;
}
if (Plugin.config.disabledMods.Contains(manifest.id))
{
Plugin.logger.LogError($"Mod {manifest.id} is disabled, skipping");
continue;
}
if (manifest.version == null)
{
Plugin.logger.LogError($"Mod version not found in {modContainer}");
Expand Down
182 changes: 0 additions & 182 deletions src/Managers/AutoUpdate.cs

This file was deleted.

Loading
Loading