SRL Archive - S.M.A.R.T. Questions and Answers.

SmartSpawnClient 'params' parameter


riwu

2015-01-11 06:57:48


SMARTClient* spawnClient(char *java_exec, char* remote_path, char *root, char *params, int width, int height, char *initseq, char *useragent, char* javaargs, char* plugins)
What's the purpose of the params parameter in SmartSpawnClient()? I could pass any non-null string to it and RS will still spawn. So what effect does it have on the spawned client?

Brandon

2015-01-11 09:06:11

Root is the hosting site.. The params argument is the page hosted at that site that contains the information for loading the applet.


Self.__Target := SmartSpawnClient('C:/Program Files (x86)/Java/jre1.8.0_25/bin/java.exe', Replace(PluginPath, '\', '/', [rfReplaceAll]), 'file:///C:/Users/Kira/Desktop/', 'AppletTest.html', Width, Height, InitSequence, '', '-XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=30', Implode(',', Plugins));

My desktop in this case is the host and the AppletTest.html is the page that contains:


<html>
<head>
<title>Test Applet</title>
<style>
body {background-color:lightgrey}
</style>
</head>
<body>
<div>
<applet code="applettest.MyApplet.class" codebase="applet_code_base" archive="AppletTest.jar" width="500" height="500">
Please Install Java.
</applet>
</div>
</body>
</html>


Aka information to load the requested applet. In this case, SMART will send a socket request to 127.0.0.1 for the above file.

https://github.com/BenLand100/SMART/blob/master/src/Client.java#L651


You can see it does: downloadHTML(root + params); after that it does: archive = root + archive;

So it's just easier for it rather than finding the host and the page and separating them just to get the root to affix it to the beginning of the archive (jar).

riwu

2015-01-11 20:13:11

From: Brandon

So it's just easier for it rather than finding the host and the page and separating them just to get the root to affix it to the beginning of the archive (jar).

Ah so basically inputting the correct param instead of a random one will make it easier/faster to spawn the client?

Btw, why SRL get the page from http://www.runescape.com/game.ws?j=1 (https://github.com/SRL/SRL-6/blob/685006b4a51733a7f51195f2ae500acb26347a9a/lib/misc/smart.simba#L27), even though when u click play on the official site it goes to http://www.runescape.com/game?jptg=ia&jptv=navbar?

The GetParams returned for these 2 addresses are also slightly different,
SRL's returned http://world11.runescape.com/,f644886703540233668
while the other one returned http://world5.runescape.com/,j0,f4824684705659971653
There's an extra 'j0' for the other one, so should we actually pass that to the 'params' parameter?

Brandon

2015-01-11 22:47:04

From: riwu
Ah so basically inputting the correct param instead of a random one will make it easier/faster to spawn the client?

Btw, why SRL get the page from http://www.runescape.com/game.ws?j=1 (https://github.com/SRL/SRL-6/blob/685006b4a51733a7f51195f2ae500acb26347a9a/lib/misc/smart.simba#L27), even though when u click play on the official site it goes to http://www.runescape.com/game?jptg=ia&jptv=navbar?

The GetParams returned for these 2 addresses are also slightly different,
SRL's returned http://world11.runescape.com/,f644886703540233668
while the other one returned http://world5.runescape.com/,j0,f4824684705659971653
There's an extra 'j0' for the other one, so should we actually pass that to the 'params' parameter?



I've mentioned this before.. No one listens to me so why bother..




It looks like it just determines if the game is loaded in an iframe or not. If it is, it passes j0 as part of the url and if not, it passes j1.. I'm guessing though.. Not actually sure what it's there for though.. Or why they need it in the URL..

riwu

2015-01-12 00:47:47

From: Brandon
I've mentioned this before.. No one listens to me so why bother..




It looks like it just determines if the game is loaded in an iframe or not. If it is, it passes j0 as part of the url and if not, it passes j1.. I'm guessing though.. Not actually sure what it's there for though.. Or why they need it in the URL..

It's not that no one listens to you, most of us didn't know about these stuffs and just leave them to people like you who have a better idea of what's going on :D

Since SMART simulate loading RS in a firefox browser, the applet should be loaded in an iframe, so adding the ',j0' to params would be our best bet?

Olly

2015-01-12 03:42:14

From: riwu

Since SMART simulate loading RS in a firefox browser, the applet should be loaded in an iframe, so adding the ',j0' to params would be our best bet?


IDK if you can really call it simulating it loading in a firefox browser, all it does it load some oldish firefox user agent… which you should properly be changing anyway.

and e:

@Brandon

I did ask bland about the params, because iirc you said you weren't sure.. and his reply was something along the lines of 'IDK'.

the bank

2015-01-16 11:08:23

j0/j1 used to be for determining using Default Java or Sun Java but afaik it stopped serving that purpose a long time ago. Later, for a short while, it seemed to be the deciding factor between loading the client in a browser or in the official downloadable client. Once again, I strongly doubt this is the case anymore.

Sorry i couldn't provide any more information.