PDA

View Full Version : Pro_InitSocket



Sh4d0wf0x
01-07-2016, 09:59 PM
Hi everyone,

I downloaded the latest Reflection update today but somehow I get an error message now:

Error: Unknown declaration "Pro_InitSocket" at line 86

I redownloaded AeroLib, Aerolib includes, Reflection, almost everything for OSRS but I can't resolve the problem. Any ideas?

honeyhoney
01-07-2016, 10:04 PM
Update your ProSocks plugin!

Replace Prosocks.dll found in ./Simba/Plugins/ with the latest .dll found here: https://github.com/Brandon-T/ProSocks/releases/download/v0.5/Prosocks.dll

Sh4d0wf0x
01-07-2016, 10:06 PM
Update your ProSocks plugin!

Replace Prosocks.dll found in ./Simba/Plugins/ with the latest .dll found here: https://github.com/Brandon-T/ProSocks/releases/download/v0.5/Prosocks.dll

Nay, no results. Tried that few hours ago, tried it again now but nothing :(

honeyhoney
01-07-2016, 10:11 PM
Nay, no results. Tried that few hours ago, tried it again now but nothing :(

Ohh!!! My bad! Just re-read the error message.

The script you're using is trying to call the "Pro_InitSocket" method. In the latest plugin (which you have updated to) this has been refactored to the "Init" method that applies to the SSLSocket type.

You'll have to update your script to comply with the latest ProSocks plugin - if you share it we might be able to help out :)

AFools
01-07-2016, 10:34 PM
Ohh!!! My bad! Just re-read the error message.

The script you're using is trying to call the "Pro_InitSocket" method. In the latest plugin (which you have updated to) this has been refactored to the "Init" method that applies to the SSLSocket type.

You'll have to update your script to comply with the latest ProSocks plugin - if you share it we might be able to help out :)

Explain how one would "your script to comply with the latest ProSocks plugin" because prosocks is called through


{$DEFINE SMART}
{$i AeroLib/AeroLib.Simba}
{$i Reflection/Reflection.Simba}

Now i know there were clashes between libraries. Try remove one of the includes see what happens? I know when i updated my prosocks for Ezform, i ran into the exact same problem.

honeyhoney
01-07-2016, 10:46 PM
Explain how one would "your script to comply with the latest ProSocks plugin" because prosocks is called through


{$DEFINE SMART}
{$i AeroLib/AeroLib.Simba}
{$i Reflection/Reflection.Simba}

Now i know there were clashes between libraries. Try remove one of the includes see what happens? I know when i updated my prosocks for Ezform, i ran into the exact same problem.

When you get the error message it should take you to the line where ProSocks is being used. Possibly in the function TReflectionMisc.GetPage().

Essentially wherever you see the Pro_InitSocket method, you need to replace it with the new Init method.

Sh4d0wf0x
01-07-2016, 10:51 PM
It's in the misc file of the reflection include:


{$IFNDEF Aerolib}
{$include reflection/lib/misc/prosocks.simba}
{$ENDIF}

Function TReflectionMisc.GetPage(Url: string): string;
var
S: SSLSocket;
Res: ProMemoryStruct;
begin
Pro_InitSocket(S, nil, nil, nil, nil);
Pro_CreateSocket(S, '');
Pro_SetSSL(S, false, false, true);
Pro_SetURL(S, URL);
Pro_DoGetEx(S, Res);
SetLength(Result, Res.size);
MemMove(Res.Memory^, Result[1], Res.Size);
Pro_FreeSocket(S);
end;

AFools
01-07-2016, 10:52 PM
When you get the error message it should take you to the line where ProSocks is being used. Possibly in the function TReflectionMisc.GetPage().

Essentially wherever you see the Pro_InitSocket method, you need to replace it with the new Init method.

Correct; there is a thread for correct this somewhere. You are correct. =D

It been a living nightmare getting simba to work on somebody else computer. For mine i have just taken a back up of my C:/ Simba/files. So i simply install simba, delete the simba file and drag and drop. =D

AFools
01-07-2016, 10:55 PM
************* Edit Not Needed; Solution Below

honeyhoney
01-07-2016, 10:55 PM
It's in the misc file of the reflection include:


{$IFNDEF Aerolib}
{$include reflection/lib/misc/prosocks.simba}
{$ENDIF}

Function TReflectionMisc.GetPage(Url: string): string;
var
S: SSLSocket;
Res: ProMemoryStruct;
begin
Pro_InitSocket(S, nil, nil, nil, nil);
Pro_CreateSocket(S, '');
Pro_SetSSL(S, false, false, true);
Pro_SetURL(S, URL);
Pro_DoGetEx(S, Res);
SetLength(Result, Res.size);
MemMove(Res.Memory^, Result[1], Res.Size);
Pro_FreeSocket(S);
end;

Replace that method with:


Function TReflectionMisc.GetPage(Url: string): string;
var
S: SSLSocket;
Res: ProMemoryStruct;
begin
S.init();
S.setURLFollow(true);
S.setURL(URL);
S.doGet(Res);
SetLength(Result, Res.size);
MemMove(Res.Memory^, Result[1], Res.Size);
S.free;
end;

Source: https://villavu.com/forum/showthread.php?t=115356

Sh4d0wf0x
01-07-2016, 11:05 PM
Replace that method with:


Function TReflectionMisc.GetPage(Url: string): string;
var
S: SSLSocket;
Res: ProMemoryStruct;
begin
S.init();
S.setURLFollow(true);
S.setURL(URL);
S.doGet(Res);
SetLength(Result, Res.size);
MemMove(Res.Memory^, Result[1], Res.Size);
S.free;
end;

Source: https://villavu.com/forum/showthread.php?t=115356

Hero!

Thank you everone!

Kyle
01-08-2016, 01:12 PM
I'll update the include to that version of ProSocks in a bit, once I push the new antiban methods.. I really hope that stops people from using Aerolib with reflection, as it is completely unnecessary and I always get stuck with fixing the compatibility issues..

EDIT: Done, do note that you now must have the latest version of Prosocks found here (https://github.com/Brandon-T/ProSocks/releases/download/v0.5/Prosocks.dll)..

Flight
01-09-2016, 12:23 PM
I'll update the include to that version of ProSocks in a bit, once I push the new antiban methods.. I really hope that stops people from using Aerolib with reflection, as it is completely unnecessary and I always get stuck with fixing the compatibility issues..

EDIT: Done, do note that you now must have the latest version of Prosocks found here (https://github.com/Brandon-T/ProSocks/releases/download/v0.5/Prosocks.dll)..

The compile issues were due to users having the newest ProSocks plugin and the Reflection include only compatible outdated version. With or without AeroLib, people using the up-to-date plugin would have issues. This is all part of maintaining a library...

Kyle
01-09-2016, 02:43 PM
The compile issues were due to users having the newest ProSocks plugin and the Reflection include only compatible outdated version. With or without AeroLib, people using the up-to-date plugin would have issues. This is all part of maintaining a library...

Yes, I wasn't speaking to the compatibility as it pertains to prosocks, as that would get changed one way or another. I was more so speaking of all the naming conventions and IfDef/IfnDef's that I have throughout the include that keep it compatible, which inevitable must be changed each time AL gets updated. That is why I really hope we can stop scripter's from using both and just AL only or Reflection only. It gets annoying not only having to keep my updater updated and the include updated, but also to have to worry about the next time I will have to fix a compatibility issue with AL.

I'll try and learn how to maintain a library properly I suppose? Iunno..

sk80rdie76
01-10-2016, 02:19 AM
Keep getting this error after updating plugin and treflectionmisc


Error: Unknown declaration "Pro_InitSocket" at line 623

honeyhoney
01-10-2016, 02:32 AM
Keep getting this error after updating plugin and treflectionmisc


Error: Unknown declaration "Pro_InitSocket" at line 623

You're using AeroLib as well. You'll need to update that so it also uses the latest version of ProSocks. :)

BigRedJapan
07-12-2016, 01:34 AM
I have updated the aerolib plug in as well as ProSocks and still nothing but error at line 623