Today I started to develop on DModule. Concepts and architecture was already ready but today started the implementation.
Check out the dmodule official wiki page at dev.dracoblue.net
Today I started to develop on DModule. Concepts and architecture was already ready but today started the implementation.
Check out the dmodule official wiki page at dev.dracoblue.net
Today I have a little update for the DCallbacks library. Its been about one year since it was updated last time, so 0.2 of samp is released and the user [em]NeedAName[/em] found an issue, while using the library.
So I took some minutes, fixed that issue, and released DCallbacks 1.1.
How to add the Hellgate:London-Server Status to your Website? Thats quite easy!
Default icons: The image: results in:
Custom icons: Add that little html+javascript code to your website and it will load the on.png or off.png in your webfolder! Of course you can change this source snippet so it fits your needs!
All you need to use is the correct Server-ID:
[ol]Shulgoth US Sydonai EU Alliance Command Korea Test Center [/ol]
XML for the geeks: I have also finished an xml-feed at [em]http://hglondon.net/server/list.xml[/em] so if you are expirienced in xml-encoding you can write a interpreter for it in any language you want!
I had the problem, that I wanted to sort an array of builds by name, but names could be 1.1 or, 2.10.0.1 or even 2.0.9.
Thatswhy I made the following sort alogrithm in PHP by using usort and an own compare function.
function builds_sort($a, $b) {
if ($a['name']==$b['name']) {
return 0;
}
$ap=explode('.',$a['name']);
$bp=explode('.',$b['name']);
foreach ($ap as $pos => $number) {
if (!isset($bp[$pos])) {
return 1;
} elseif ($number > $bp[$pos]) {
return 1;
} elseif ($number < $bp[$pos]) {
return -1;
}
}
return -1;
}
// Testarray
$builds=array(
array("name"=>"2.1.0","id"=>"210","suite_id"=>1),
array("name"=>"2.1.1","id"=>"211","suite_id"=>1),
array("name"=>"3.0.0","id"=>"3","suite_id"=>1),
array("name"=>"10","id"=>"3","suite_id"=>1),
array("name"=>"2.1.10","id"=>"2110","suite_id"=>1),
array("name"=>"2.1.2","id"=>"212","suite_id"=>1)
);
usort ($builds,"builds_sort");
This function sorts each element by "name" with DESC.