1. Hmm well maybe im confused by the english words ^^
    "Where u want to inject the code (the hook) after"

    Problably ur not German or? :D
    Anyway thanks for your long support till now :)
     
  2. Wulf

    Wulf Community Admin

    The line = the index. The hook goes after this line you pick.
     
  3. It seams that your talking about a "bigger thing".
    What you do you exactly mean by "Hook"?

    its always: "index is there where u want to put your hook, so you search the correct line for putting ur hook in"
    what exactly im putting in there?

    Is there really not a single Tutorial (maybe vid) available for using OxidePatcher? (And i dont mean the 5 Steps on the Github ^^)
     
  4. Wulf

    Wulf Community Admin

    A hook is what you are trying to add. No, there are no videos.
     
  5. I try to ask the right questions to understand this :/

    OnPlayerConnected
    Code:
    IL_0000: ldarg.1
    IL_0001: callvirt System.Int32 System.String::get_Length()
    IL_0006: ldc.i4.s 32
    IL_0008: ble IL_0014
    IL_000d: ldstr "My name is too long"
    IL_0012: starg.s clientName
    IL_0014: ldarg.1
    IL_0015: call System.String ChatManagerServer::Cleanup(System.String)
    IL_001a: starg.s clientName
    IL_001c: ldarg.0
    IL_001d: ldarg.0
    IL_001e: ldarg.1
    IL_001f: ldarg.2
    IL_0020: call System.Collections.IEnumerator GameManager::ClientReadyAsync(System.String,uLink.NetworkMessageInfo)
    IL_0025: call UnityEngine.Coroutine UnityEngine.MonoBehaviour::StartCoroutine(System.Collections.IEnumerator)
    IL_002a: pop
    IL_002b: ret
    Why u are injecting in Line 9 (IL_001a: starg.s clientName)
    and not on the Last line (IL_002b: ret)



    OnPlayerDisconnected
    Code:
    IL_0000: call T Singleton`1<NetworkManager>::get_Instance()
    IL_0005: ldarg.1
    IL_0006: callvirt System.Void NetworkManager::BeginDestroyPlayerObjects(uLink.NetworkPlayer)
    IL_000b: leave IL_0036
    IL_0010: stloc.1
    IL_0011: ldstr "Exception in DestroyPlayerObjects"
    IL_0016: ldloc.1
    IL_0017: callvirt System.String System.Exception::get_Message()
    IL_001c: ldstr " "
    IL_0021: ldloc.1
    IL_0022: callvirt System.String System.Exception::get_StackTrace()
    IL_0027: call System.String System.String::Concat(System.String,System.String,System.String,System.String)
    IL_002c: call System.Void UnityEngine.Debug::Log(System.Object)
    IL_0031: leave IL_0036
    IL_0036: ldarg.0
    IL_0037: ldfld System.Collections.Generic.Dictionary`2<uLink.NetworkPlayer,PlayerSession> GameManager::_playerSessions
    IL_003c: ldarg.1
    IL_003d: ldloca.s V_0
    IL_003f: callvirt System.Boolean System.Collections.Generic.Dictionary`2<uLink.NetworkPlayer,PlayerSession>::TryGetValue(!0,!1&)
    IL_0044: brtrue IL_004a
    IL_0049: ret
    IL_004a: ldarg.0
    IL_004b: ldfld EasyAntiCheat.Server.EasyAntiCheatServer GameManager::EACServer
    IL_0050: ldloc.0
    IL_0051: ldfld System.Byte[] PlayerSession::AuthTicketBuffer
    IL_0056: callvirt System.Void EasyAntiCheat.Server.EasyAntiCheatServer::UnregisterUser(System.Byte[])
    IL_005b: leave IL_0086
    IL_0060: stloc.2
    IL_0061: ldstr "Exception in EAC Teardown"
    IL_0066: ldloc.2
    IL_0067: callvirt System.String System.Exception::get_Message()
    IL_006c: ldstr " "
    IL_0071: ldloc.2
    IL_0072: callvirt System.String System.Exception::get_StackTrace()
    IL_0077: call System.String System.String::Concat(System.String,System.String,System.String,System.String)
    IL_007c: call System.Void UnityEngine.Debug::Log(System.Object)
    IL_0081: leave IL_0086
    IL_0086: ldarg.0
    IL_0087: ldfld System.Collections.Generic.Dictionary`2<Steamworks.CSteamID,PlayerSession> GameManager::_steamIdSession
    IL_008c: ldloc.0
    IL_008d: ldfld Steamworks.CSteamID PlayerSession::SteamId
    IL_0092: callvirt System.Boolean System.Collections.Generic.Dictionary`2<Steamworks.CSteamID,PlayerSession>::Remove(!0)
    IL_0097: pop
    IL_0098: ldarg.0
    IL_0099: ldfld System.Collections.Generic.Dictionary`2<System.Int32,PlayerSession> GameManager::_userTokenMap
    IL_009e: ldloc.0
    IL_009f: ldfld System.Byte[] PlayerSession::AuthTicketBuffer
    IL_00a4: call System.Int32 GameObjectExtensions::ComputeHash(System.Byte[])
    IL_00a9: callvirt System.Boolean System.Collections.Generic.Dictionary`2<System.Int32,PlayerSession>::Remove(!0)
    IL_00ae: pop
    IL_00af: ldarg.0
    IL_00b0: ldfld System.Collections.Generic.Dictionary`2<uLink.NetworkPlayer,PlayerSession> GameManager::_playerSessions
    IL_00b5: ldarg.1
    IL_00b6: callvirt System.Boolean System.Collections.Generic.Dictionary`2<uLink.NetworkPlayer,PlayerSession>::Remove(!0)
    IL_00bb: pop
    IL_00bc: leave IL_00e7
    IL_00c1: stloc.3
    IL_00c2: ldstr "Exception in Player Teardown"
    IL_00c7: ldloc.3
    IL_00c8: callvirt System.String System.Exception::get_Message()
    IL_00cd: ldstr " "
    IL_00d2: ldloc.3
    IL_00d3: callvirt System.String System.Exception::get_StackTrace()
    IL_00d8: call System.String System.String::Concat(System.String,System.String,System.String,System.String)
    IL_00dd: call System.Void UnityEngine.Debug::Log(System.Object)
    IL_00e2: leave IL_00e7
    IL_00e7: ldloc.0
    IL_00e8: ldfld PlayerIdentity PlayerSession::Identity
    IL_00ed: ldfld PlayerSession PlayerIdentity::ConnectedSession
    IL_00f2: ldloc.0
    IL_00f3: bne.un IL_0126
    IL_00f8: ldloc.0
    IL_00f9: ldfld PlayerIdentity PlayerSession::Identity
    IL_00fe: callvirt System.Void PlayerIdentity::WriteFromEntity()
    IL_0103: ldarg.0
    IL_0104: ldarg.0
    IL_0105: ldloc.0
    IL_0106: call System.Collections.IEnumerator GameManager::RemovePlayerWorldEntity(PlayerSession)
    IL_010b: call UnityEngine.Coroutine UnityEngine.MonoBehaviour::StartCoroutine(System.Collections.IEnumerator)
    IL_0110: pop
    IL_0111: call T Singleton`1<ChatManagerServer>::get_Instance()
    IL_0116: ldloc.0
    IL_0117: ldfld System.String PlayerSession::Name
    IL_011c: callvirt System.Void ChatManagerServer::AppendDisconnectionNoticeAll(System.String)
    IL_0121: br IL_0131
    IL_0126: call T Singleton`1<NetworkManager>::get_Instance()
    IL_012b: ldarg.1
    IL_012c: callvirt System.Void NetworkManager::FinalDestroyPlayerObjects(uLink.NetworkPlayer)
    IL_0131: ldarg.0
    IL_0132: ldfld GameManager/PlayerSessionEvent GameManager::OnPlayerDisconnected
    IL_0137: brfalse IL_0148
    IL_013c: ldarg.0
    IL_013d: ldfld GameManager/PlayerSessionEvent GameManager::OnPlayerDisconnected
    IL_0142: ldloc.0
    IL_0143: callvirt System.Void GameManager/PlayerSessionEvent::Invoke(PlayerSession)
    IL_0148: ldarg.0
    IL_0149: ldstr "Player disconnected - "
    IL_014e: ldloc.0
    IL_014f: ldfld System.String PlayerSession::Name
    IL_0154: call System.String System.String::Concat(System.String,System.String)
    IL_0159: call System.Void GameManager::SendLog(System.String)
    IL_015e: ret
    

    Why ur using here line 21 (IL_0049: ret) and not the Last return? or any other line just like OnPlayerConnected.

    Im not sure WHAT a guy have to look for.
     
  6. Wulf

    Wulf Community Admin

    They are injected there because that is the location the hook needs to be. Like I said, if you aren't familiar with MSIL/IL patching, then you'll likely need to either read up more on it, or experiment.
     
  7. what to do if the button "Hook this Method" are inactive ?
    http://joxi.ru/a2XYQ9oT8QOLAg?d=1
     
  8. Wulf

    Wulf Community Admin

  9. The button `Goto Hook Definition` is active which means there is already a hook in that method, if you want to add another hook, go to that hook definition and use the clone button to create another hook in that method.
     
  10. How to reset changes to the settings? tried to download again the project and the patcher - did not help.
     
  11. Wulf

    Wulf Community Admin

    Which settings?