SRL Archive - Development

The script manager for Simba.


CynicRus

2012-10-28 11:33:47

Hi. 10 days ago I started this work to create a script manager. After working thoroughly on it I'm almost through with the thing. The structures for data storage in xml tree both for the client and server have been designed. A class for working with such structures has been developed as well. It was originally planned to add up to the existing script manager, but after having examined its source code it was decided to start from scratch. At the moment the job is 95 per cent complete. In the framework of the developed class I have worked out several functions for loading and saving the information from the server side as well as loading, updating and synchronizing the client side with the server one. I have also designed a few types of data for working with the given tree structures based on class TCollection. The solution in question is a cross-platform one, it can work in both Windows and Linux. Now for the full completion of the project it's necessary to add a couple of functions and also test it all properly.

Below I attach the examples of the developed formats of the client and server sides with the necessary explanations.

<?xml version="1.0" encoding="UTF-8"?>
<Document>
<structure name="Agility">

<file filename="another_agility" date_modify="10.11.2012" author="san" email="what@mail.com" version="1.6" >
<description>great script</description>

<subfile filename="112211.png" filepath="C:/"/>
<subfile filename="lalala.simba" filepath="C:/"/>

</file>
</structure>
</Document>

Tags:
<?xml version="1.0" encoding="UTF-8"?> - the obligatory string for the document title validation

Structure:
Tag is used for the package description and has only one attribute &#8212; 'name' &#8212; which in its turn is the script category name. It owns the tag-file with attributes like:
- 'filename' &#8212; the name shown in script manager as 'script name'; also, on the basis of this attribute, url name for script package downloading is formed;
- 'date_modify' stands for the latest script package modification;
- 'author' &#8212; just the author of the script;
- 'email' &#8212; the author's e-mail;
- 'version' is the script package version on the server.
The tag-file includes the tag description with the value of the script description. Can consist of several strings.
Tag-subfile that has attributes 'filepath' and 'filename' is used in case of multifiles in a package, where 'filepath' stands for the path to extract the files and 'filename' &#8212; for the name of the file extracted.


The client side has a server structure, only with some attributes like 'update' and 'installed' added. 'Update' contains the script update availability flag, and 'installed' &#8212; the flag showing whether the script package is installed.

The up-to-date code is available on the official repository(tnx Dgby714): https://github.com/SRL/ScriptManager
You are welcome to criticise the code.

Thanks for your attention.

Cheers,
Cynic.

PS: a few screens:
Linux: http://s017.radikal.ru/i402/1210/20/02e6815b74ba.png
Windows:http://s60.radikal.ru/i169/1210/97/5507e6e813c3.jpg

Enslaved

2012-10-28 11:35:25

good job :)

Gu3st...

2012-10-28 11:40:32

Very nice! Great job, both of you :)

Brandon

2012-10-28 11:41:59

Uhh so wait. When you open the script from the script manager, does it actually show the script within Simba?

CynicRus

2012-10-28 11:44:26

No. When you open s&#1089;ript manager, you can see all the scripts are uploaded to the server. Script Repository. If you installed from there, it will be available from Simba.
Generally it is being developed as part of the Simba. I started a separate development, to make it easier to debug.

litoris

2012-10-28 11:50:56

So this basically lets people download script easily, without having to go through the sections? Nice :D
Would be even better if the server checked for updates every 24h or something.

CynicRus

2012-10-28 11:53:30

This function is already implemented. In the future, will auto-update manually adjustable parameter.

CynicRus

2012-10-28 12:21:41

Oh, i forgot. Pm me, if you want and can help me with this stuff. Together we will finish a script manager faster.

Ashaman88

2012-10-28 18:30:44

Dude this is awesome, keep it up man!

Sin

2012-10-28 18:35:51

Amazing, keep it up!

NKN

2012-10-28 18:37:15

This is awesome. :D
Keep up the good work.

Wizzup?

2012-10-28 18:42:07

Looking good!

Chris Reborn

2012-10-28 19:02:11

this looks pretty sick!

Ian

2012-10-28 19:16:36

You should definitely have the amazing newcomer cup :D

euphemism

2012-10-28 19:45:37

Wasn't ReadySteadyGo working on a script manager? Might want to compare between yours and his?

Dgby714

2012-10-28 19:57:40

This will be merged with Simba after it is complete and will open scripts in Simba (as well as download).

Currently Simba's source has RSGs ScriptManager in it, tho it is incomplete.

Daniel

2012-10-28 22:47:19

Feeling rather Synaptic? ;D

CynicRus

2012-10-28 23:27:09

From: Daniel
Feeling rather Synaptic? ;D

Yes, yes. Very similar to Synaptic. But if you do not like, I can make the interface like emerge or rpm:P

Benny

2012-10-29 06:45:47

Looks pretty amazing well done sir!

Master BAW

2012-10-29 06:59:38

I think this will be a great addon for simba :) Keep it up

J J

2012-10-29 07:27:51

Amazing work! Simba script manager + new landing page + lape + ogl in the near future! Epic.

litoris

2012-10-29 07:30:47

From: J J
Amazing work! Simba script manager + new landing page + lape + ogl in the near future! Epic.


Fix SRL Stats by then, and we are back on the track :)

Markus

2012-10-29 07:34:19

@ subfile, make paths relative! Put every script in it's own folder and check that it doesn't try to escape out of it! (path = '..\..\simba.exe', stuff like that)! Also one easy way to mitigate this is to put it all in a tarball, similar to how SRL updates work.
Otherwise looking good!

Daniel

2012-10-29 07:40:01

From: Markus
Also one easy way to mitigate this is to put it all in a tarball

AFAIK, that's exactly how he's approaching it ;)

CynicRus

2012-10-29 08:21:44

From: Markus
@ subfile, make paths relative! Put every script in it's own folder and check that it doesn't try to escape out of it! (path = '..\..\simba.exe', stuff like that)! Also one easy way to mitigate this is to put it all in a tarball, similar to how SRL updates work.
Otherwise looking good!


At the moment you plan to use this structure:

packagename.tar.bz2 contains packagename.simba(head script) and FileList (SubFile) - .png, .dll or .simba. And the path to a file looks like "{$SIMBA_SPS}\RUNESCAPE_OTHER" or "{$SIMBA_PLUGIN}" or something like this.

Markus

2012-10-29 08:41:09

Yea, but what's the use of the file list then? Looks useless to me because it's already enclosed in the tarball.

CynicRus

2012-10-29 08:46:13

From: Markus
Yea, but what's the use of the file list then? Looks useless to me because it's already enclosed in the tarball.

Definitely. The archive itself does not know where to unpack. Therefore, he needs to specify where to unpack the custom map, plugin or custom include file. And this information is stored in the package description. But this is by design, I'm always open to good ideas.

CynicRus

2012-10-31 03:12:57

Report: Completed by 99 percent.

IMPLEMENTED:
1) The script packages routine(install, uninstall, update);
2) Path syntax for subfiles
example:

<structure name="Mining">
<file filename="Varrok Miner" date_modify="10.29.2012" author="Cynic" email="CynicRus@gmail.com" version="1,2">
<description>another great script</description>
<subfile filename="varrokminer.png" filepath="{$SIMBA_SPS}img\runescape_other\"/>

</file>
</structure>
(The available options for a 'filepath' attribute:

ReservedWords : array[0..5] of string[20] = ('{$SIMBA}','{$SIMBA_SCRIPTS}','{$SIMBA_SPS}','{$SIMBA_SRL}','{$SIMBA_FONTS}','{$SIMBA_PLUGINS}');
)
As extra look at the sm_utils.pas code.
3) Synchonizing the client side by server side;
4) Gui like a Synaptic
5) Autoupdate algorithm
And many other

Current work:
binding the script management logic with GUI.
Also GUI development.

Next stage:
Testing with local webserver(i will use apache 2.2 + php 5.2)

ToDo:
More failsafe,the script package bug reporting system, the script manager bug reporting system.

J J

2012-10-31 03:17:24

Good job :D Looking at the code it will automatically download custom maps if they are used?

CynicRus

2012-10-31 03:19:46

From: J J
Good job :D Looking at the code it will automatically download custom maps if they are used?


Yes. And also automatically download any additional necessary for the script, if they are registered in 'subfile' node on the server side.

J J

2012-10-31 03:24:21

From: CynicRus
Yes. And also automatically download any additional necessary for the script, if they are registered in 'subfile' node on the server side.

Nice :) I'm using a custom dll in my new gop script :P Thanks for the hard work.

CynicRus

2012-10-31 05:01:04

Current state:

CynicRus

2012-10-31 08:16:50

Gentelmens. I've done a great job and I am glad to tell you that at the moment it is made. The program is logically complete and running at 100 percent. Waiting for your criticism of code. Tested it on a local web server.

ToDo:
1) create the local script repository
2) Wrote code for integration that to Simba
3) fixes, fixes, fixes…

Ashaman88

2012-10-31 09:41:39

From: CynicRus
Gentelmens. I've done a great job and I am glad to tell you that at the moment it is made. The program is logically complete and running at 100 percent. Waiting for your criticism of code. Tested it on a local web server.

ToDo:
1) create the local script repository
2) Wrote code for integration that to Simba
3) fixes, fixes, fixes…


You are the bomb.com!

Dgby714

2012-10-31 11:59:45

From: CynicRus
Gentelmens. I've done a great job and I am glad to tell you that at the moment it is made. The program is logically complete and running at 100 percent. Waiting for your criticism of code. Tested it on a local web server.

ToDo:
1) create the local script repository
2) Wrote code for integration that to Simba
3) fixes, fixes, fixes…


I've got integration =)

Do 1 and 3 =P

xtrapsp

2012-10-31 12:03:49

I've never messed with stuff like this haha, would you mind sending me in the right direction on how to run it? I downloaded all the files in the GIT inside a zip file :3

edit: ahh its just not compiled and i'd need an editor i take it :L

CynicRus

2012-11-01 01:04:04

From: xtrapsp
I've never messed with stuff like this haha, would you mind sending me in the right direction on how to run it? I downloaded all the files in the GIT inside a zip file :3

edit: ahh its just not compiled and i'd need an editor i take it :L


To compile this stuff you need Lazarus => 0.9.30.4 and FPC 2.4.4 or 2.6.0 .

Source code navigator:

SM_Web.pas - contatins functions for file downloading and archive decompression

sm_types.pas - data types for the script manager

sm_client_base.pas - the client side stuff

sm_srv_base.pas - the server side stuff

sm_control.pas - contains the functions for script control stuff(install, uninstall, update etc.)

sm_utils.pas - Additional internal functions

sm_main.pas - GUI.

sm_settings.pas - data type and stuff for app settings

mastaraymond

2012-12-12 12:16:31

So where are we at? After two years finally the Script Manager?

CynicRus

2012-12-17 01:47:51

Well. I've finished the script manager client. It has been tested and Me with Dgby714 has been integrate that to Simba now. But it's can't work without http server side.