TommySoucy / H3MP

A mod for Hotdogs, Horseshoes and Handgrenades that adds multiplayer to the game.
GNU General Public License v3.0
52 stars 7 forks source link

Friend's Player Object unable to Instantiate #131

Closed realfluffyuwu closed 1 year ago

realfluffyuwu commented 1 year ago

I am Hosting, on Alpha Mod Safe Branch, with H3MP 1.6.7 and it's dependency, BepInEx 5.4.21.0

My Friend is no where to be seen and nothing changes when we swap Scenes, He Simply Doesn't Exist. Upon my Friend Joining I receive the Below Error message. This was Tested in the Main Room Scene and Also in the Take and Hold Scene, the Errors were Identical

[Info   :      H3MP] Incoming connection from "Friend's IP"
[Info   :      H3MP] "Friend's IP" connected successfully and is now player 1
[Info   :      H3MP] Spawn player called with ID: 1
[Error  : Unity Log] ArgumentException: The Object you want to instantiate is null.
Stack trace:
UnityEngine.Object.CheckNullArgument (System.Object arg, System.String message)
UnityEngine.Object.Instantiate[GameObject] (UnityEngine.GameObject original)
H3MP.GameManager.SpawnPlayer (Int32 ID, System.String username, System.String scene, Int32 instance, Vector3 position, Quaternion rotation, Int32 IFF, Int32 colorIndex, Boolean join)
H3MP.Networking.ServerClient.SendIntoGame (System.String playerName, System.String scene, Int32 instance, Int32 IFF, Int32 colorIndex)
H3MP.Networking.ServerHandle.WelcomeReceived (Int32 clientID, H3MP.Networking.Packet packet)
H3MP.Networking.ServerClient+TCP+<>c__DisplayClass10_0.<HandleData>b__0 ()
H3MP.Networking.ThreadManager.UpdateMain ()
H3MP.Networking.ThreadManager.Update ()

My Friend has this in his Log

[Info   :      H3MP] Initialized client
[Info   :      H3MP] Making connection to "My IP and Port"
[Info   :      H3MP] connection begun
[Info   :      H3MP] UpdateMaxHealth: MainMenu3/0, to index: -2 with original: -1 and clientID: 0
[Info   :      H3MP]    Index -2, setting to value in our current scene/instance
[Info   :      H3MP]            No entry found
[Info   :      H3MP] Message from server: Welcome to the server

Added it anyway. The Only other Errors in the Log are Related to Harmony and are Quite Lengthy, I'm not sure if it's related but I can share that also.

realfluffyuwu commented 1 year ago

I decided to add the Harmony Error anyways just in case.

[Info   :      H3MP] H3MP Started
[Info   :      H3MP] H3MP Init called
[Info   :      H3MP] H3MP path found: E:\H3VR Modman\H3VR\profiles\MP\BepInEx\plugins\VIP-H3MP
[Warning:  HarmonyX] AccessTools.Field: Could not find field for type FistVR.TNH_EncryptionTarget and name agileStartPos
[Error  :  HarmonyX] Failed to patch void FistVR.TNH_EncryptionTarget::Start(): System.ArgumentException: No such field defined in class FistVR.TNH_EncryptionTarget
Parameter name: agileStartPos
  at HarmonyLib.Public.Patching.HarmonyManipulator.EmitCallParameter (System.Reflection.MethodInfo patch, Boolean allowFirsParamPassthrough, Mono.Cecil.Cil.VariableDefinition& tmpObjectVar, System.Collections.Generic.List`1& tmpBoxVars) [0x00000] in <filename unknown>:0 
  at HarmonyLib.Public.Patching.HarmonyManipulator.WritePrefixes (HarmonyLib.Internal.Util.Label returnLabel) [0x00000] in <filename unknown>:0 
  at HarmonyLib.Public.Patching.HarmonyManipulator.WriteImpl () [0x00000] in <filename unknown>:0 
[Error  : Unity Log] ArgumentException: No such field defined in class FistVR.TNH_EncryptionTarget
Parameter name: agileStartPos
Stack trace:
HarmonyLib.Public.Patching.HarmonyManipulator.EmitCallParameter (System.Reflection.MethodInfo patch, Boolean allowFirsParamPassthrough, Mono.Cecil.Cil.VariableDefinition& tmpObjectVar, System.Collections.Generic.List`1& tmpBoxVars)
HarmonyLib.Public.Patching.HarmonyManipulator.WritePrefixes (HarmonyLib.Internal.Util.Label returnLabel)
HarmonyLib.Public.Patching.HarmonyManipulator.WriteImpl ()
Rethrow as HarmonyException: IL Compile Error (unknown location)
HarmonyLib.Public.Patching.HarmonyManipulator.WriteImpl () <0x00f12>
HarmonyLib.Public.Patching.HarmonyManipulator.Process (MonoMod.Cil.ILContext,System.Reflection.MethodBase) <0x00104>
HarmonyLib.Public.Patching.HarmonyManipulator.Manipulate (System.Reflection.MethodBase,HarmonyLib.PatchInfo,MonoMod.Cil.ILContext) <0x00070>
HarmonyLib.Public.Patching.HarmonyManipulator.Manipulate (System.Reflection.MethodBase,MonoMod.Cil.ILContext) <0x0003f>
HarmonyLib.Public.Patching.ManagedMethodPatcher.Manipulator (MonoMod.Cil.ILContext) <0x00042>
MonoMod.Cil.ILContext.Invoke (MonoMod.Cil.ILContext/Manipulator) <0x002f1>
MonoMod.RuntimeDetour.ILHook/Context.InvokeManipulator (Mono.Cecil.MethodDefinition,MonoMod.Cil.ILContext/Manipulator) <0x00076>
(wrapper dynamic-method) MonoMod.RuntimeDetour.ILHook/Context.DMD<MonoMod.RuntimeDetour.ILHook+Context..Refresh> (MonoMod.RuntimeDetour.ILHook/Context) <0x00452>
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition.Trampoline<MonoMod.RuntimeDetour.ILHook+Context..Refresh>?405460736 (object) <0x0001c>
HarmonyLib.Internal.RuntimeFixes.StackTraceFixes.OnILChainRefresh (object) <0x0002e>
MonoMod.RuntimeDetour.ILHook.Apply () <0x0013a>
HarmonyLib.Public.Patching.ManagedMethodPatcher.DetourTo (System.Reflection.MethodBase) <0x001bf>
Rethrow as HarmonyException: IL Compile Error (unknown location)
HarmonyLib.Public.Patching.ManagedMethodPatcher.DetourTo (System.Reflection.MethodBase replacement)
HarmonyLib.PatchFunctions.UpdateWrapper (System.Reflection.MethodBase original, HarmonyLib.PatchInfo patchInfo)
Rethrow as HarmonyException: IL Compile Error (unknown location)
HarmonyLib.PatchFunctions.UpdateWrapper (System.Reflection.MethodBase original, HarmonyLib.PatchInfo patchInfo)
HarmonyLib.PatchProcessor.Patch ()
HarmonyLib.Harmony.Patch (System.Reflection.MethodBase original, HarmonyLib.HarmonyMethod prefix, HarmonyLib.HarmonyMethod postfix, HarmonyLib.HarmonyMethod transpiler, HarmonyLib.HarmonyMethod finalizer, HarmonyLib.HarmonyMethod ilmanipulator)
H3MP.Patches.ActionPatches.DoPatching (HarmonyLib.Harmony harmony)
H3MP.Patches.PatchController.DoPatching ()
H3MP.Mod.Init ()
H3MP.Mod.Start ()
TommySoucy commented 1 year ago

The game has updated. The mod is out of date until I release the next update.

realfluffyuwu commented 1 year ago

@TommySoucy

Exact Same Scenario, Hosting on the Alpha - Mod Safe Branch running H3MP 1.6.8 and it's dependency, BepInEx 5.4.21.0 My Errors are Exactly the Same as the Previous Comments. Full Log Attached with my Friends IP Removed. LogOutputIPRemoved.log

I do hope I am doing something Wrong on my Side, I did try using the Previous Version of BepInEx 5.4.1700 unsurprisingly to no Avail.

EDIT We swapped back to the Main Branch and managed to see each other in the main screen, we have yet to play a Hold yet, Will update when we complete our play session.

TommySoucy commented 1 year ago

As the readme says and as I mentioned in the homebrew discord server: 1.6.8 is for H3 main branch, not alpha

realfluffyuwu commented 1 year ago

My Apologies the Readme.md states specifically towards the Alpha - Mod Safe branch being the correct one and the Release Info on the 1.6.8 Release was not easy to Infer being only a couple Words. Readme.md Line 10 Will most probably work with the Main version of the game, but currently only guaranteed to work with "alpha - Mod Safe".

I am unsure which discord you are referring (I found the discord you are referring to and have Found the message) we did in fact get it working on the Main branch just as you say it should. Sorry for wasting your Time, Awesome Job bringing Multiplayer to a Singleplayer Game, Keep it up Chief.

TommySoucy commented 1 year ago

No problem stuff broke with the update and everything's a mess, glad you got it working.