How does syncmods actually work?

BlitzMax Forums/BlitzMax Programming/How does syncmods actually work?

Fabian.(Posted 2006) [#1]
Is there a documentation for this or does anyone know how syncmods connects to the modserver? I guess it's using tcp/ip, but which port is it using and which protocol is onto the tcp/ip-stream? Is it using http? or ftp? I'd need this information if I were writting my own syncmods-tool or my own modserver.


FlameDuck(Posted 2006) [#2]
Is there a documentation for this or does anyone know how syncmods connects to the modserver?
Using http. You can use a packetsniffer (like Ethereal) to reverse engineer it, if you want.

I'd need this information if I were writting my own syncmods-tool or my own modserver.
IMHO you'd be better off using a custom tool that checksout your files from a svn repository.

Syncmods would be good, because it's integrated in the default MaxIDE, however the program is much too limited to do what I think you're trying to do.


Leiden(Posted 2006) [#3]
I'd say it would just use a TCP stream, read an index file, compare it with a local index, then get whatever's new. It could also be packed, ie brl.audio.module and when received locally its unpacked. Authough I'm probably really really wrong. Thats the way I'd do it anyway. Open a stream, get an index, download packed modules, unpack locally, update local index.

Or, if you wanted previous versions of modules you could pack them with some sort of filename convention, ie, brl.audio.1.04.module, you could easily implement that in a program.


Fabian.(Posted 2006) [#4]
I wrote a simple tool which creates a tcp-server-socket and then redirects every connection to blitzbasic.com, but logges all posted data. Then I run the tool and told bmk syncmods to connect to localhost. It seems like bmk syncmods creates a http stream to the server and sends a http-get to:
/modserver122/status.php?mod=brl&cfg=win32.x86&user=Fabian&pass=the_password
The server simply returned:
OK: status
ModServer: BRL
ServerUrl: www.blitzbasic.com/modserver122
ServerPrivs: read
But I couldn't log what the client did next, because there were problems with the "Host:" attribute in the http-header (it was set to localhost though it had to be set to blitzbasic.com by bmk)

Doesn't BRL support a documentation about this?


Picklesworth(Posted 2006) [#5]
The way this is sounds a tad messy, but I think the choice would make perfect sense if it was made very easy to set up modservers.

From the looks of it, this makes it easily possible to set up a modserver without much more than your regular FTP program...

Anyway, if you navigate to that URL with a web browser, you get what Fabian found.
Hard to tell what the program does from there, though.

I'm a bit bothered by sending the username and password in plain text, though!
Couldn't it be sent as a form return or something?


xlsior(Posted 2006) [#6]
Another option:

You could just launch the actual syncmod command line tool from within your IDE.

Syncing the BRL and PUB modules:

c:\program files\blitzmax\bin\syncmods -u username -p password brl
c:\program files\blitzmax\bin\syncmods -u username -p password pub


and the optional ones:
c:\program files\blitzmax\bin\syncmods -u username -p password birdie
c:\program files\blitzmax\bin\syncmods -u username -p password gman
c:\program files\blitzmax\bin\syncmods -u username -p password axe

Using the actual syncmods tool means that it's more likely that your IDE should remain compatible without changes if the syncmod mechanism itself changes at some point in the future.


Fabian.(Posted 2006) [#7]
I could find out this:
After the syncmods tool received the "OK: status" message it requests another url:
GET /modserver122/listmods.php?mod=modulescope&cfg=win32.x86&user=username&pass=password HTTP/1.0
then the server returns "OK: listmods", followed by this info for each module:
ModPrivs: read
Module: modulescope.modulename
a list of all ModuleInfo statements
Then the syncmods tool compares the "Version"-field from the moduleinfo statement with the currently installed version of the module. If the version is greather than the currently installed version, it requests
GET /modserver122/getmod.php?mod=modulescope.modulename&cfg=win32.x86&user=username&pass=password HTTP/1.0
The server returns
Module: modulescope.modulename
followed by a list of all ModuleInfo-statements in the module. Then it returns the module content in a binary format followed by "OK: getmod modulescope.modulename".
I couldn't find out more because I didn't know that binary format...

I searched the website and the forum, but I didn't found any documentation on this:-(