├── .gitignore ├── LICENSE ├── plugin ├── GWSafeFile_Patches.cs ├── Patches.cs ├── Plugin.cs ├── WebServer.cs └── plugin.csproj ├── readme.md └── tetoco.sln /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | ## Ignore Visual Studio temporary files, build results, and 3 | ## files generated by popular Visual Studio add-ons. 4 | ## 5 | ## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore 6 | 7 | # User-specific files 8 | *.rsuser 9 | *.suo 10 | *.user 11 | *.userosscache 12 | *.sln.docstates 13 | 14 | # User-specific files (MonoDevelop/Xamarin Studio) 15 | *.userprefs 16 | 17 | # Mono auto generated files 18 | mono_crash.* 19 | 20 | # Build results 21 | [Dd]ebug/ 22 | [Dd]ebugPublic/ 23 | [Rr]elease/ 24 | [Rr]eleases/ 25 | x64/ 26 | x86/ 27 | [Ww][Ii][Nn]32/ 28 | [Aa][Rr][Mm]/ 29 | [Aa][Rr][Mm]64/ 30 | bld/ 31 | [Bb]in/ 32 | [Oo]bj/ 33 | [Ll]og/ 34 | [Ll]ogs/ 35 | 36 | # Visual Studio 2015/2017 cache/options directory 37 | .vs/ 38 | # Uncomment if you have tasks that create the project's static files in wwwroot 39 | #wwwroot/ 40 | 41 | # Visual Studio 2017 auto generated files 42 | Generated\ Files/ 43 | 44 | # MSTest test Results 45 | [Tt]est[Rr]esult*/ 46 | [Bb]uild[Ll]og.* 47 | 48 | # NUnit 49 | *.VisualState.xml 50 | TestResult.xml 51 | nunit-*.xml 52 | 53 | # Build Results of an ATL Project 54 | [Dd]ebugPS/ 55 | [Rr]eleasePS/ 56 | dlldata.c 57 | 58 | # Benchmark Results 59 | BenchmarkDotNet.Artifacts/ 60 | 61 | # .NET Core 62 | project.lock.json 63 | project.fragment.lock.json 64 | artifacts/ 65 | 66 | # ASP.NET Scaffolding 67 | ScaffoldingReadMe.txt 68 | 69 | # StyleCop 70 | StyleCopReport.xml 71 | 72 | # Files built by Visual Studio 73 | *_i.c 74 | *_p.c 75 | *_h.h 76 | *.ilk 77 | *.meta 78 | *.obj 79 | *.iobj 80 | *.pch 81 | *.pdb 82 | *.ipdb 83 | *.pgc 84 | *.pgd 85 | *.rsp 86 | # but not Directory.Build.rsp, as it configures directory-level build defaults 87 | !Directory.Build.rsp 88 | *.sbr 89 | *.tlb 90 | *.tli 91 | *.tlh 92 | *.tmp 93 | *.tmp_proj 94 | *_wpftmp.csproj 95 | *.log 96 | *.tlog 97 | *.vspscc 98 | *.vssscc 99 | .builds 100 | *.pidb 101 | *.svclog 102 | *.scc 103 | 104 | # Chutzpah Test files 105 | _Chutzpah* 106 | 107 | # Visual C++ cache files 108 | ipch/ 109 | *.aps 110 | *.ncb 111 | *.opendb 112 | *.opensdf 113 | *.sdf 114 | *.cachefile 115 | *.VC.db 116 | *.VC.VC.opendb 117 | 118 | # Visual Studio profiler 119 | *.psess 120 | *.vsp 121 | *.vspx 122 | *.sap 123 | 124 | # Visual Studio Trace Files 125 | *.e2e 126 | 127 | # TFS 2012 Local Workspace 128 | $tf/ 129 | 130 | # Guidance Automation Toolkit 131 | *.gpState 132 | 133 | # ReSharper is a .NET coding add-in 134 | _ReSharper*/ 135 | *.[Rr]e[Ss]harper 136 | *.DotSettings.user 137 | 138 | # TeamCity is a build add-in 139 | _TeamCity* 140 | 141 | # DotCover is a Code Coverage Tool 142 | *.dotCover 143 | 144 | # AxoCover is a Code Coverage Tool 145 | .axoCover/* 146 | !.axoCover/settings.json 147 | 148 | # Coverlet is a free, cross platform Code Coverage Tool 149 | coverage*.json 150 | coverage*.xml 151 | coverage*.info 152 | 153 | # Visual Studio code coverage results 154 | *.coverage 155 | *.coveragexml 156 | 157 | # NCrunch 158 | _NCrunch_* 159 | .*crunch*.local.xml 160 | nCrunchTemp_* 161 | 162 | # MightyMoose 163 | *.mm.* 164 | AutoTest.Net/ 165 | 166 | # Web workbench (sass) 167 | .sass-cache/ 168 | 169 | # Installshield output folder 170 | [Ee]xpress/ 171 | 172 | # DocProject is a documentation generator add-in 173 | DocProject/buildhelp/ 174 | DocProject/Help/*.HxT 175 | DocProject/Help/*.HxC 176 | DocProject/Help/*.hhc 177 | DocProject/Help/*.hhk 178 | DocProject/Help/*.hhp 179 | DocProject/Help/Html2 180 | DocProject/Help/html 181 | 182 | # Click-Once directory 183 | publish/ 184 | 185 | # Publish Web Output 186 | *.[Pp]ublish.xml 187 | *.azurePubxml 188 | # Note: Comment the next line if you want to checkin your web deploy settings, 189 | # but database connection strings (with potential passwords) will be unencrypted 190 | *.pubxml 191 | *.publishproj 192 | 193 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 194 | # checkin your Azure Web App publish settings, but sensitive information contained 195 | # in these scripts will be unencrypted 196 | PublishScripts/ 197 | 198 | # NuGet Packages 199 | *.nupkg 200 | # NuGet Symbol Packages 201 | *.snupkg 202 | # The packages folder can be ignored because of Package Restore 203 | **/[Pp]ackages/* 204 | # except build/, which is used as an MSBuild target. 205 | !**/[Pp]ackages/build/ 206 | # Uncomment if necessary however generally it will be regenerated when needed 207 | #!**/[Pp]ackages/repositories.config 208 | # NuGet v3's project.json files produces more ignorable files 209 | *.nuget.props 210 | *.nuget.targets 211 | 212 | # Microsoft Azure Build Output 213 | csx/ 214 | *.build.csdef 215 | 216 | # Microsoft Azure Emulator 217 | ecf/ 218 | rcf/ 219 | 220 | # Windows Store app package directories and files 221 | AppPackages/ 222 | BundleArtifacts/ 223 | Package.StoreAssociation.xml 224 | _pkginfo.txt 225 | *.appx 226 | *.appxbundle 227 | *.appxupload 228 | 229 | # Visual Studio cache files 230 | # files ending in .cache can be ignored 231 | *.[Cc]ache 232 | # but keep track of directories ending in .cache 233 | !?*.[Cc]ache/ 234 | 235 | # Others 236 | ClientBin/ 237 | ~$* 238 | *~ 239 | *.dbmdl 240 | *.dbproj.schemaview 241 | *.jfm 242 | *.pfx 243 | *.publishsettings 244 | orleans.codegen.cs 245 | 246 | # Including strong name files can present a security risk 247 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 248 | #*.snk 249 | 250 | # Since there are multiple workflows, uncomment next line to ignore bower_components 251 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 252 | #bower_components/ 253 | 254 | # RIA/Silverlight projects 255 | Generated_Code/ 256 | 257 | # Backup & report files from converting an old project file 258 | # to a newer Visual Studio version. Backup files are not needed, 259 | # because we have git ;-) 260 | _UpgradeReport_Files/ 261 | Backup*/ 262 | UpgradeLog*.XML 263 | UpgradeLog*.htm 264 | ServiceFabricBackup/ 265 | *.rptproj.bak 266 | 267 | # SQL Server files 268 | *.mdf 269 | *.ldf 270 | *.ndf 271 | 272 | # Business Intelligence projects 273 | *.rdl.data 274 | *.bim.layout 275 | *.bim_*.settings 276 | *.rptproj.rsuser 277 | *- [Bb]ackup.rdl 278 | *- [Bb]ackup ([0-9]).rdl 279 | *- [Bb]ackup ([0-9][0-9]).rdl 280 | 281 | # Microsoft Fakes 282 | FakesAssemblies/ 283 | 284 | # GhostDoc plugin setting file 285 | *.GhostDoc.xml 286 | 287 | # Node.js Tools for Visual Studio 288 | .ntvs_analysis.dat 289 | node_modules/ 290 | 291 | # Visual Studio 6 build log 292 | *.plg 293 | 294 | # Visual Studio 6 workspace options file 295 | *.opt 296 | 297 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 298 | *.vbw 299 | 300 | # Visual Studio 6 auto-generated project file (contains which files were open etc.) 301 | *.vbp 302 | 303 | # Visual Studio 6 workspace and project file (working project files containing files to include in project) 304 | *.dsw 305 | *.dsp 306 | 307 | # Visual Studio 6 technical files 308 | *.ncb 309 | *.aps 310 | 311 | # Visual Studio LightSwitch build output 312 | **/*.HTMLClient/GeneratedArtifacts 313 | **/*.DesktopClient/GeneratedArtifacts 314 | **/*.DesktopClient/ModelManifest.xml 315 | **/*.Server/GeneratedArtifacts 316 | **/*.Server/ModelManifest.xml 317 | _Pvt_Extensions 318 | 319 | # Paket dependency manager 320 | .paket/paket.exe 321 | paket-files/ 322 | 323 | # FAKE - F# Make 324 | .fake/ 325 | 326 | # CodeRush personal settings 327 | .cr/personal 328 | 329 | # Python Tools for Visual Studio (PTVS) 330 | __pycache__/ 331 | *.pyc 332 | 333 | # Cake - Uncomment if you are using it 334 | # tools/** 335 | # !tools/packages.config 336 | 337 | # Tabs Studio 338 | *.tss 339 | 340 | # Telerik's JustMock configuration file 341 | *.jmconfig 342 | 343 | # BizTalk build output 344 | *.btp.cs 345 | *.btm.cs 346 | *.odx.cs 347 | *.xsd.cs 348 | 349 | # OpenCover UI analysis results 350 | OpenCover/ 351 | 352 | # Azure Stream Analytics local run output 353 | ASALocalRun/ 354 | 355 | # MSBuild Binary and Structured Log 356 | *.binlog 357 | 358 | # NVidia Nsight GPU debugger configuration file 359 | *.nvuser 360 | 361 | # MFractors (Xamarin productivity tool) working folder 362 | .mfractor/ 363 | 364 | # Local History for Visual Studio 365 | .localhistory/ 366 | 367 | # Visual Studio History (VSHistory) files 368 | .vshistory/ 369 | 370 | # BeatPulse healthcheck temp database 371 | healthchecksdb 372 | 373 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 374 | MigrationBackup/ 375 | 376 | # Ionide (cross platform F# VS Code tools) working folder 377 | .ionide/ 378 | 379 | # Fody - auto-generated XML schema 380 | FodyWeavers.xsd 381 | 382 | # VS Code files for those working on multiple tools 383 | .vscode/* 384 | !.vscode/settings.json 385 | !.vscode/tasks.json 386 | !.vscode/launch.json 387 | !.vscode/extensions.json 388 | *.code-workspace 389 | 390 | # Local History for Visual Studio Code 391 | .history/ 392 | 393 | # Windows Installer files from build outputs 394 | *.cab 395 | *.msi 396 | *.msix 397 | *.msm 398 | *.msp 399 | 400 | # JetBrains Rider 401 | *.sln.iml 402 | 403 | .vscode/* 404 | !.vscode/settings.json 405 | !.vscode/tasks.json 406 | !.vscode/launch.json 407 | !.vscode/extensions.json 408 | !.vscode/*.code-snippets 409 | 410 | # Local History for Visual Studio Code 411 | .history/ 412 | 413 | # Built Visual Studio Code Extensions 414 | *.vsix 415 | 416 | Assembly-CSharp.dll 417 | Assembly-CSharp-firstpass.dll 418 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 Red 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /plugin/GWSafeFile_Patches.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using Lod.TypeX4; 3 | using System.Collections.Generic; 4 | using System.Runtime.InteropServices; 5 | using static Lod.TypeX4.GWSafeFile; 6 | using Utf8Json; 7 | using System.IO; 8 | 9 | namespace tetoco; 10 | 11 | // GWSafeFile would normally access an encrypted usb drive 12 | internal class GWSafeFile_Patches { 13 | internal static Dictionary storage = new(); 14 | 15 | static GWSafeFile_Patches() { 16 | if(File.Exists("settings.json")) { 17 | storage = JsonSerializer.Deserialize>(File.ReadAllText("settings.json")); 18 | } 19 | } 20 | 21 | [HarmonyPatch(typeof(GWSafeFile), "WriteStr"), HarmonyPrefix] 22 | public static bool WriteStr(string _targetStr, string _baseName, int _MaxLog, [MarshalAs(UnmanagedType.Bool)] bool _bUseCommit = false) { 23 | storage[_baseName] = _targetStr; 24 | File.WriteAllText("settings.json", JsonSerializer.ToJsonString(storage)); 25 | return false; 26 | } 27 | 28 | [HarmonyPatch(typeof(GWSafeFile), "ReadStr"), HarmonyPrefix] 29 | public static bool ReadStr(string _baseName, ref string __result) { 30 | storage.TryGetValue(_baseName, out __result); 31 | return false; 32 | } 33 | 34 | [HarmonyPatch(typeof(GWSafeFile), "GetError"), HarmonyPrefix] 35 | public static bool GetError(ref FILE_ERROR __result) { 36 | __result = FILE_ERROR.ERROR_NONE; 37 | return false; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /plugin/Patches.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using Lod; 3 | using Lod.Dialog; 4 | using Lod.ImageRecognition; 5 | using Lod.Net; 6 | using Lod.TypeX4; 7 | using System.Collections.Generic; 8 | using UnityEngine; 9 | using VisionUSBIO; 10 | 11 | namespace tetoco; 12 | 13 | public class Patches { 14 | #region fix boot checks 15 | [HarmonyPatch(typeof(ArcadeIOManager), "isServiceSWError", MethodType.Getter), HarmonyPrefix] 16 | public static bool isServiceSWError(ref bool __result) { 17 | __result = false; 18 | return false; 19 | } 20 | 21 | [HarmonyPatch(typeof(DepthCamera), "hasCameraProblems", MethodType.Getter), HarmonyPrefix] 22 | public static bool hasCameraProblems(ref bool __result) { 23 | __result = false; 24 | return false; 25 | } 26 | 27 | [HarmonyPatch(typeof(DeviceCheck), "IsTouchPanelEnable"), HarmonyPrefix] 28 | public static bool IsTouchPanelEnable(ref bool __result) { 29 | __result = true; 30 | return false; 31 | } 32 | 33 | [HarmonyPatch(typeof(GameInstance), "DummyNesysOnline", MethodType.Getter), HarmonyPrefix] 34 | public static bool DummyNesysOnline(ref bool __result) { 35 | __result = true; 36 | return false; 37 | } 38 | 39 | [HarmonyPatch(typeof(VisionUSBIODll), "VisionUSBIOGetStatus"), HarmonyPrefix] 40 | public static bool VisionUSBIOGetStatus(ref int __result) { 41 | __result = 512; // ready 42 | return false; 43 | } 44 | #endregion 45 | 46 | [HarmonyPatch(typeof(GameServer), "DebugGetEndpointUrl", MethodType.Getter), HarmonyPrefix] 47 | public static bool DebugGetEndpointUrl(ref string __result) { 48 | if(Plugin.useLocalServer.Value) { 49 | __result = "http://localhost:38817"; 50 | } else { 51 | __result = Plugin.remoteServer.Value; 52 | } 53 | return false; 54 | } 55 | 56 | // block screen rotation/resize 57 | [HarmonyPatch(typeof(ScreenObserver), "Update"), HarmonyPrefix] 58 | public static bool ScreenObserver_Update() { 59 | return false; 60 | } 61 | 62 | [HarmonyPatch(typeof(MachineLocalSettingManager), "IsEnableLanguageSelect", MethodType.Getter), HarmonyPrefix] 63 | public static bool IsEnableLanguageSelect(ref bool __result) { 64 | __result = true; 65 | return false; 66 | } 67 | 68 | [HarmonyPatch(typeof(MachineLocalSettingManager), "isFreePlay", MethodType.Getter), HarmonyPrefix] 69 | public static bool isFreePlay(ref bool __result) { 70 | __result = true; 71 | return false; 72 | } 73 | 74 | #region Disable CountDownTimer 75 | [HarmonyPatch(typeof(CountDownTimer), "CountDownMode", MethodType.Getter), HarmonyPrefix] 76 | public static bool CountDownMode(ref CountDownMode __result) { 77 | __result = Lod.CountDownMode.Disabled; 78 | return false; 79 | } 80 | 81 | [HarmonyPatch(typeof(UIPlayerInfoController), "SetCounterShowState"), HarmonyPrefix] 82 | public static bool SetCounterShowState(ref bool isShow) { 83 | isShow = false; 84 | return true; 85 | } 86 | /*[HarmonyPatch(typeof(UIPlayerInfoController), "SetExternalCounterActivation"), HarmonyPrefix] 87 | public static bool SetExternalCounterActivation() { 88 | return false; 89 | }*/ 90 | 91 | [HarmonyPatch(typeof(DialogBase), "Update"), HarmonyPrefix] 92 | public static bool DialogBase_Update(ref Context ___m_Context) { 93 | ___m_Context.data.timeout = -1; // remove timeout 94 | return true; 95 | } 96 | 97 | [HarmonyPatch(typeof(ResultContinueView), "CreditAdded", MethodType.Getter), HarmonyPrefix] 98 | public static bool CreditAdded(ref bool __result) { 99 | __result = true; // prevent time from running out by always adding credits 100 | return false; 101 | } 102 | #endregion 103 | 104 | [HarmonyPatch(typeof(AeroBootCheck), "CheckAndReset"), HarmonyPrefix] 105 | public static bool CheckAndReset(ref bool __result) { 106 | __result = false; 107 | return false; 108 | } 109 | 110 | [HarmonyPatch(typeof(Lod.Input), "GetKeyDown"), HarmonyPrefix] 111 | public static bool GetKeyDown(ref bool __result, KeyCode key) { 112 | __result = UnityEngine.Input.GetKeyDown(key); 113 | return false; 114 | } 115 | 116 | [HarmonyPatch(typeof(UIEntryController), "Update"), HarmonyPrefix] 117 | public static void UIEntryController_Update(UIEntryController __instance) { 118 | if(GameObject.Find("GuestLoginButton(Clone)") != null) 119 | return; 120 | 121 | var button = GameObject.Find("GuestLoginButton"); // make copy 122 | if(button == null) 123 | return; 124 | var copy = Object.Instantiate(button); 125 | copy.transform.SetParent(button.transform.parent, false); 126 | 127 | var pos = button.transform.localPosition; 128 | button.transform.localPosition = new Vector3(-183, pos.y, pos.z); 129 | copy.transform.localPosition = new Vector3(183, pos.y, pos.z); 130 | 131 | var text = copy.GetComponentInChildren(); 132 | text.textId = ""; 133 | text.text = "Login as\nLocal"; 134 | 135 | var btn = copy.GetComponent(); 136 | btn.interactable = true; 137 | 138 | btn.onClick.m_PersistentCalls.Clear(); 139 | btn.onClick.AddListener(() => { 140 | var login = __instance.GetType().GetMethod("Login", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); 141 | login.Invoke(__instance, [Plugin.useLocalServer.Value ? "1234567890" : Plugin.cardId.Value]); 142 | }); 143 | } 144 | 145 | [HarmonyPatch(typeof(StageInfo), "CheckPermission"), HarmonyPrefix] 146 | public static bool CheckPermission(ref bool __result) { 147 | __result = true; 148 | return false; 149 | } 150 | 151 | #region Hatsune Miku Partner Unlock 152 | [HarmonyPatch(typeof(PartnerUtil), "CanUse", typeof(Lod.CharacterInfo)), HarmonyPrefix] 153 | public static bool CanUse(ref bool __result) { 154 | __result = true; 155 | return false; 156 | } 157 | 158 | [HarmonyPatch(typeof(PartnerUtil), "HasDearness", typeof(Lod.CharacterInfo)), HarmonyPrefix] 159 | public static bool HasDearness(ref bool __result) { 160 | __result = true; 161 | return false; 162 | } 163 | 164 | [HarmonyPatch(typeof(UIEntryController), "GoToNextScene"), HarmonyPostfix] 165 | public static void GoToNextScene(UIEntryController __instance) { 166 | GameInstance.Instance.ActiveCharacterInfos = CharacterMaster.GetInstance().SortedAllCharacterInfos; 167 | } 168 | 169 | [HarmonyPatch(typeof(PartnerSelectController), "Start"), HarmonyPrefix] 170 | public static bool PartnerSelectController_Start(ref PartnerSelectCharaIcon[] ___charaButtonList, ref List ___dearnessGauge) { 171 | { // character icon 172 | var button = GameObject.Find("ButtonSet/CHR_C_02"); 173 | var copy = Object.Instantiate(button); 174 | 175 | copy.transform.SetParent(button.transform.parent, false); 176 | copy.transform.localPosition = new Vector3(50, -145, 0); 177 | 178 | var comp = copy.GetComponent(); 179 | typeof(PartnerSelectCharaIcon).GetField("CharacterIndex", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).SetValue(comp, 10); 180 | ___charaButtonList = ___charaButtonList.AddToArray(comp); 181 | } 182 | 183 | { // dearness display 184 | var el = GameObject.Find("DearnessVisibleControlObject").transform.Find("CHR_C_02").gameObject; 185 | var copy = Object.Instantiate(el); 186 | 187 | copy.transform.SetParent(el.transform.parent, false); 188 | ___dearnessGauge.Add(new PartnerSelectController.DearnessGauge { 189 | root = copy, 190 | heart = copy.GetComponentInChildren(), 191 | level = copy.transform.Find("DearDegreeLevelText").gameObject.GetComponent() 192 | }); 193 | } 194 | 195 | return true; 196 | } 197 | 198 | [HarmonyPatch(typeof(PartnerSelectCharaIcon), "InitCharaIcons"), HarmonyPrefix] 199 | public static bool InitCharaIcons(ref PartnerSelectCharaIcon __instance, UIImage ____charaIconOn, UIImage ____charaIconOff) { 200 | if(____charaIconOn == null || ____charaIconOff == null) return false; 201 | 202 | var regularCharacterInfos = CharacterMaster.GetInstance().SortedAllCharacterInfos; 203 | var characterInfo = regularCharacterInfos[__instance.myIndex]; 204 | __instance.gameObject.SetActive(true); 205 | 206 | // if(GameInstance.Instance.CollaborationManager.ActiveCollaborationInfo != null && characterInfo.id == GameInstance.Instance.CollaborationManager.ActiveCollaborationInfo.CharacterId && __instance.gameObject.name != "Button_Collaboration") 207 | // __instance.gameObject.SetActive(false); 208 | 209 | ____charaIconOn.Init(string.Format(characterInfo.partnerSelectIconAssetPath, "ON")); 210 | ____charaIconOff.Init(string.Format(characterInfo.partnerSelectIconAssetPath, "OFF")); 211 | 212 | return false; 213 | } 214 | #endregion 215 | } 216 | -------------------------------------------------------------------------------- /plugin/Plugin.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepInEx.Configuration; 3 | using HarmonyLib; 4 | 5 | namespace tetoco; 6 | 7 | [BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)] 8 | public class Plugin : BaseUnityPlugin { 9 | internal static ConfigEntry useLocalServer; 10 | internal static ConfigEntry remoteServer; 11 | internal static ConfigEntry cardId; 12 | 13 | private WebServer server; 14 | 15 | #pragma warning disable IDE0051 // Remove unused private members 16 | private void Awake() { 17 | LoadConfig(); 18 | 19 | Harmony.CreateAndPatchAll(typeof(GWSafeFile_Patches)); 20 | Harmony.CreateAndPatchAll(typeof(Patches)); 21 | 22 | if(useLocalServer.Value) { 23 | server = new WebServer(); 24 | server.Start(); 25 | } 26 | 27 | Logger.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} is loaded!"); 28 | } 29 | #pragma warning restore IDE0051 // Remove unused private members 30 | 31 | public void LoadConfig() { 32 | useLocalServer = Config.Bind("General", "UseLocalServer", true, "Host server for local play"); 33 | remoteServer = Config.Bind("General", "RemoteServer", "", "Remote server URL"); 34 | cardId = Config.Bind("General", "CardId", "", "Used to authenticate with a remote server"); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /plugin/WebServer.cs: -------------------------------------------------------------------------------- 1 | using BepInEx.Logging; 2 | using Lod; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Net; 8 | using System.Threading.Tasks; 9 | using Utf8Json; 10 | 11 | namespace tetoco; 12 | 13 | public class WebServer { 14 | private ManualLogSource logger = BepInEx.Logging.Logger.CreateLogSource("Server"); 15 | private HttpListener listener; 16 | private PlayerSaveData saveData; 17 | 18 | public void Start() { 19 | Task.Run(WebLoop); 20 | } 21 | 22 | private async Task WebLoop() { 23 | listener = new HttpListener(); 24 | listener.Prefixes.Add("http://localhost:38817/"); 25 | listener.Start(); 26 | 27 | while(true) { 28 | var ctx = await listener.GetContextAsync(); 29 | logger.LogInfo($"{ctx.Request.HttpMethod} {ctx.Request.Url}"); 30 | 31 | try { 32 | var res = Handle(ctx); 33 | 34 | ctx.Response.StatusCode = 200; 35 | if(res != null) { 36 | var json = JsonSerializer.Serialize(res); 37 | ctx.Response.ContentType = "application/json"; 38 | ctx.Response.ContentLength64 = json.Length; 39 | ctx.Response.OutputStream.Write(json, 0, json.Length); 40 | } 41 | } catch(Exception e) { 42 | logger.LogError(e); 43 | ctx.Response.StatusCode = 500; 44 | } 45 | ctx.Response.Close(); 46 | } 47 | } 48 | 49 | private object Handle(HttpListenerContext ctx) { 50 | string body = null; 51 | // Logger.LogInfo(ctx.Request.Headers); 52 | if(ctx.Request.HasEntityBody) { 53 | using var reader = new StreamReader(ctx.Request.InputStream); 54 | body = reader.ReadToEnd(); 55 | logger.LogInfo(body); 56 | } 57 | 58 | var m = ctx.Request.HttpMethod; 59 | var p = ctx.Request.Url.AbsolutePath; 60 | 61 | if(m == "GET" && p == "/env") { } 62 | if(m == "POST" && p == "/ngwords") { 63 | // var param = JsonSerializer.Deserialize(body); 64 | return new Lod.Net.GameServerRequests.NGWords.Response { result = true }; 65 | } 66 | 67 | if(m == "POST" && p == "/login") { 68 | Load(); // have to delay load to here cause InitForNESiCA would throw errors 69 | 70 | return new Lod.Net.GameServerRequests.Login.Response { 71 | accessToken = "1234567890", 72 | tokenType = "", 73 | expiresIn = 9999999 74 | }; 75 | } 76 | 77 | if(m == "GET" && p == "/savedata") { 78 | // var auth = ctx.Request.Headers.Get("Authorization"); // for real server use auth to get correct save 79 | return new Lod.Net.GameServerRequests.LoadPlayerSaveData.Response { savedata = saveData }; 80 | } 81 | 82 | if(m == "POST" && p == "/savedata" && body != null) { 83 | var data = JsonSerializer.Deserialize(body); 84 | ApplyDiff(data.savedata); 85 | } 86 | if(m == "POST" && p == "/game/end" && body != null) { 87 | var data = JsonSerializer.Deserialize(body); 88 | ApplyDiff(data.savedata); 89 | 90 | File.AppendAllLines("results.txt", [ 91 | DateTime.Now.ToString("o"), 92 | JsonSerializer.ToJsonString(data.result), 93 | JsonSerializer.ToJsonString(data.notelogs), 94 | ]); 95 | } 96 | 97 | return null; 98 | } 99 | 100 | private void ApplyDiff(PlayerSaveData diff) { 101 | saveData.playerData = diff.playerData; 102 | saveData.systemSettingData = diff.systemSettingData; 103 | saveData.poseRecordData = diff.poseRecordData; 104 | saveData.loginBonusProgressData = diff.loginBonusProgressData; 105 | saveData.collaborationData = diff.collaborationData; 106 | saveData.poseCardInventoryData = diff.poseCardInventoryData; 107 | saveData.consumableItemInventoryData = diff.consumableItemInventoryData; 108 | saveData.shopPreviewHistoryData = diff.shopPreviewHistoryData; 109 | saveData.reactionHistoryData = diff.reactionHistoryData; 110 | saveData.outgameTutorialHistoryData = diff.outgameTutorialHistoryData; 111 | 112 | foreach(var item in diff.musicRecordData.records) 113 | saveData.musicRecordData.records[item.Key] = item.Value; 114 | saveData.musicRecordData.multiBonusCount = diff.musicRecordData.multiBonusCount; 115 | 116 | Apply(ref saveData.partnerData.partners, diff.partnerData.partners, x => x.characterInfoId); 117 | Apply(ref saveData.missionProgressData.progresses, diff.missionProgressData.progresses, x => x.MissionInfoId); 118 | Apply(ref saveData.eventProgressData.progresses, diff.eventProgressData.progresses, x => x.EventId); 119 | Apply(ref saveData.accessoryInventoryData.contents, diff.accessoryInventoryData.contents, x => x.id); 120 | Apply(ref saveData.costumeInventoryData.contents, diff.costumeInventoryData.contents, x => x.id); 121 | Apply(ref saveData.degreeInventoryData.contents, diff.degreeInventoryData.contents, x => x.id); 122 | Apply(ref saveData.coinInventoryData.contents, diff.coinInventoryData.contents, x => x.id); 123 | Apply(ref saveData.iconInventoryData.contents, diff.iconInventoryData.contents, x => x.id); 124 | 125 | Save(); 126 | } 127 | 128 | private void Apply(ref List to, List diff, Func keySelector) { 129 | var dict = to.ToDictionary(keySelector); 130 | foreach(var item in diff) { 131 | dict[keySelector(item)] = item; 132 | } 133 | to = dict.Values.ToList(); 134 | } 135 | 136 | private void Load() { 137 | if(saveData != null) 138 | return; 139 | 140 | if(File.Exists("save.json")) { 141 | saveData = JsonSerializer.Deserialize(File.ReadAllText("save.json")); 142 | } else { 143 | saveData = new PlayerSaveData(); 144 | saveData.InitForNESiCA(); 145 | saveData.playerData.playerName = ""; // empty for first login 146 | Save(); 147 | } 148 | } 149 | 150 | private void Save() { 151 | File.WriteAllBytes("save.json", JsonSerializer.Serialize(saveData)); 152 | } 153 | } -------------------------------------------------------------------------------- /plugin/plugin.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net46 5 | tetoco 6 | tetoco 7 | 1.0.4 8 | true 9 | latest 10 | 11 | https://api.nuget.org/v3/index.json; 12 | https://nuget.bepinex.dev/v3/index.json; 13 | https://nuget.samboy.dev/v3/index.json 14 | 15 | tetoco 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | Assembly-CSharp.dll 32 | 33 | 34 | Assembly-CSharp-firstpass.dll 35 | 36 | 37 | UnityEngine.UI.dll 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # tetoco 2 | 3 | This project is a BepInEx 5 plugin designed to restore functionality to **Tetote x Connect**, making it playable again. 4 | 5 | ## Features 6 | - Restores game functionality to allow offline/local play with persistant save data. 7 | - Unlocks test mode (press T in game) 8 | - Removes menu timeouts 9 | - Unlocks all songs 10 | - Makes Hatsune Miku playable 11 | 12 | ## Installation 13 | - Download [BepInEx](https://github.com/BepInEx/BepInEx/releases/download/v5.4.23.2/BepInEx_win_x64_5.4.23.2.zip) and extract the contents into the game root. 14 | - Do a first run to generate configuration files. This should generate a BepInEx configuration file into BepInEx/config folder and an initial log file BepInEx/LogOutput.log. 15 | - Download the [latest release](https://github.com/Redcrafter/tetoco/releases) of the plugin and place the dll in the `BepInEx/plugins` folder. 16 | - Launch Tetote x Connect as usual. BepInEx should automatically load the plugin. 17 | 18 | ## Configuration 19 | After running the game for the first time, a configuration file will be generated in: 20 | ``` 21 | BepInEx/config/tetoco.cfg 22 | ``` 23 | Modify this file to tweak various settings (e.g., enabling remote server connection). 24 | -------------------------------------------------------------------------------- /tetoco.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.12.35514.174 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "plugin", "plugin\plugin.csproj", "{E8495036-F510-463C-801D-62171C3C6E04}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {E8495036-F510-463C-801D-62171C3C6E04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {E8495036-F510-463C-801D-62171C3C6E04}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {E8495036-F510-463C-801D-62171C3C6E04}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {E8495036-F510-463C-801D-62171C3C6E04}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | --------------------------------------------------------------------------------