This is a webserver I've made with the 39dll. I didn't make real graphics in it yet, but that will come later.
Downloading files from webserver (doesn't work perfect yet)
Display a webpage
Server side scriptinglanguage (in GML)
Allow the downloading of larger files by threads
(green = done, orange = buisy working on, red = coming later)
If you think there should be something else in the server, please post it here.
Pictures are never displayed the first time a page loads. (does anyone know why?)
To large images or files don't work. (try to keep the total file size under 50 KB)
Files that are compatible:
.gmwc (This is the GML code that the server executes, explanation is further down)
(gmwc stands for: GameMaker Web Code)
.jpg / .jpeg
* = didn't test it yet, but i'm 95% sure it will work.
Download: Click (.rar, 1MB, Alpha v0.7)
Explanation about the scripting language:
The scripting language is just GML. Only I've added a few extra scripts.
This is a simple script that displays "Hello world!" to the browser.
echo("<html> <body> Hello world! </body> </html>");
This is a simple code that calculates a number and displays it to the browser:
var number; number = 5; echo("<html> <body> The number is now: " + string(number)); number *= 10; // multiply the number by 10 echo("<br/> If you multiply the number by 10 it becomes: " + string(number)); echo("</body> </html>");
There are a few variables and scripts that you can use in the .gmwc scripts:
scr: echo( string )
Ths script echoes a string to the browser
scr: set_cookie( name, value )
With this script you can set a cookie with the name <name> to value <value>
scr: get_cookie( name )
With this script you can get the value of cookie <name>
scr: get_get( naam )
With this script you can get a GET variable sent by the browser
The language of the browser. This can be either EN, NL or an empty string
This is the address of the host that the browser requests
This is the name of the software of the browser, this can be:
or an empty string
Edited by hellfly, 21 June 2011 - 03:08 PM.