Cheddy
2013-10-31 09:39:23
Having issues porting the old api as there is no function currently for "SmartGetFieldString", please help :D
2013-10-31 09:39:23
2013-10-31 12:51:13
2013-10-31 15:46:57
From: tls
If you look through the old code, you can find that we used a include-side function to get strings, because String is an object and needs to be converted. First rule of porting, understand the code completely before trying to reproduce it.
function: https://github.com/tlsdude/SRL-Reflection-2/blob/master/lib/core/core.simba#L76
use: https://github.com/tlsdude/SRL-Reflection-2/blob/master/lib/core/interfaces.simba#L362
2013-10-31 22:53:37
Function R_getPlayerName: String;
var
Me,NameBytes: Integer;
begin
Me := OS_SMART.getFieldObject(0, HOOK_LOCAL_PLAYER);
NameBytes := OS_SMART.getFieldObject(Me, HOOK_PLAYER_NAME);
SetLength(Result, 512);
SetLength(Result, OS_SMART.StringFromString(NameBytes, Result));
Result := Replace(Result, 'Â', '', [rfReplaceAll]);
Result := Replace(Result, #160, #32, [rfReplaceAll]);
OS_SMART.freeObject(NameBytes); // Need to be freed?
end;
2013-11-01 13:48:12
From: Flight
Borrowing the methods from Reflection 2 I whipped this up as an example of getting a simple string. You'll need to provide the most recent hooks as well as my custom SRL-OSR with the correct SMART-handling.
Function R_getPlayerName: String;
var
Me,NameBytes: Integer;
begin
Me := OS_SMART.getFieldObject(0, HOOK_LOCAL_PLAYER);
NameBytes := OS_SMART.getFieldObject(Me, HOOK_PLAYER_NAME);
SetLength(Result, 512);
SetLength(Result, OS_SMART.StringFromString(NameBytes, Result));
Result := Replace(Result, 'Â', '', [rfReplaceAll]);
Result := Replace(Result, #160, #32, [rfReplaceAll]);
OS_SMART.freeObject(NameBytes); // Need to be freed?
end;
Untested but I don't see any problems with that.
2013-11-01 19:44:37
From: tls
You need to free Me aswell. Anytime an object is loaded it needs to be freed.
2014-03-09 17:57:28
2014-03-09 18:06:35
From: fish1328
Ok, I may return to the simba community now that I have made my own reflection/injection bot and give you guys a hand with the reflection if you want? You got an hook updater (ASM/BCEL) yet?
2014-03-09 18:07:29
From: fish1328
Ok, I may return to the simba community now that I have made my own reflection/injection bot and give you guys a hand with the reflection if you want? You got an hook updater (ASM/BCEL) yet?
2014-03-23 18:18:42
2014-04-28 14:20:05
From: elfyyy
Watch the grave digging man. You can check out the link in my sig for our current include and if you have any questions you can pm me or talk to me on skype.
EDIT:Damn…. Ninja'd… :'(