Hi everyone.
I think it’s necessary, after yesterday’s update, to add a new variable ulong userIDuL to BasePlayer. By using this variable, we will be able to call methods that expect a ulong without any issues (and without needing to use .Get()).
To achieve this, in addition to adding this variable to BasePlayer, it will be necessary to assign userIDuL = userID.Get(); right after UserIDString = userID.ToString(); in the following methods: BasePlayer.Load, BasePlayer.ServerInit, BasePlayer.PlayerInit, and Rust.Nexus.Handlers.RespawnAtBagHandler.Handle
Through the patcher, I created a new variable in BasePlayer and tried to add the line userIDuL = userID.Get();. However, I ran into an issue with configuring the constrained. It needs to be constrained. BasePlayer/EncryptedValue1 System.UInt64, but I’m getting constrained. BasePlayer/EncryptedValue1 instead.
Does anyone know how to fix this? Or am I using the wrong OpType?



{
"Name": "userIDuL",
"TargetDirectory": "C:\\rust_pr\\RustDedicated_Data\\Managed",
"Manifests": [
{
"AssemblyName": "Assembly-CSharp.dll",
"Hooks": [
{
"Type": "Modify",
"Hook": {
"InjectionIndex": 22,
"RemoveCount": 0,
"Instructions": [
{
"OpCode": "ldarg_0",
"OpType": "None"
},
{
"OpCode": "ldarg_0",
"OpType": "None"
},
{
"OpCode": "ldflda",
"OpType": "Field",
"Operand": "Assembly-CSharp|BasePlayer|userID"
},
{
"OpCode": "constrained",
"OpType": "Type",
"Operand": "Assembly-CSharp|BasePlayer/EncryptedValue`1"
},
{
"OpCode": "callvirt",
"OpType": "Method",
"Operand": "Assembly-CSharp|BasePlayer/EncryptedValue`1|Get"
},
{
"OpCode": "stfld",
"OpType": "Field",
"Operand": "Assembly-CSharp|BasePlayer|userIDuL"
}
],
"HookTypeName": "Modify",
"Name": "userIDuL [BasePlayer] [patch_Load]",
"HookName": "userIDuL_0",
"AssemblyName": "Assembly-CSharp.dll",
"TypeName": "BasePlayer",
"Flagged": false,
"Signature": {
"Exposure": 2,
"Name": "Load",
"ReturnType": "System.Void",
"Parameters": [
"BaseNetworkable/LoadInfo"
]
},
"MSILHash": "y14yo2JkZz+dAIFdLAiD4ZpjiaXs9HC8GOigSp24stE="
}
}
],
"Modifiers": [],
"Fields": [
{
"Name": "userIDuL",
"AssemblyName": "Assembly-CSharp.dll",
"TypeName": "BasePlayer",
"FieldType": "mscorlib|System.UInt64",
"Flagged": true
}
]
}
]
}