Author Topic: Place categorization. (Have a server.cs file for testing.)  (Read 1929 times)

Oh, I forgot that this is different than client submission.

Still, you're wasting time.

Oh, I forgot that this is different than client submission.

Exactly, one submission per IP and it will check if you have really a server or not. Not to mention you'll need an encrypted randomly generated key to post a heartbeat, and if you don't the record gets deleted in 5 minutes automatically.

Still, you're wasting time.

This is quite possible, then again, my time isn't all that valuable.

Wait... I still needed help passing two GET arguments though HTTPObject's get function.

IP spoofing time.

Wait... I still needed help passing two GET arguments though HTTPObject's get function.
Lol. Google it, it's not that hard to think up of ways to go about doing things. Though I do I prefer Perl over PHP :/

IP spoofing time.
It checks to see if that IP is hosting a server.

Lol. Google it, it's not that hard to think up of ways to go about doing things. Though I do I prefer Perl over PHP :/

Nah, I figured out a way around it, put both arguments into one GET variable and separate them with a | then just have the website figure out what is before and after the | and split it into two variables.

Here's what I got for a server.cs.
Note that old entries are deleted automatically, so the client (blockland server) dosn't need to send any kind of shutdown/disconnect packet.

Code: [Select]
echo("Azjherben 'place types - server side' script loaded.");

$azjservertype = 1;
$azjkey = "";

function setupazjherbenrating(%servertheme)
{
echo("Posting existance and server type to Azjherbeniex servers.");
%sname = localclientconnection.getplayername();
%azjarg = "placetype=" @ %servertheme @ "|" @ %sname;
if(!isObject($azjhpost))
{
$azjhpost = new HTTPObject(azjhpost);
}
$azjhpost.get("regestar.blockland.azjhv.org:80","/placetypes/formulate.php",%azjarg);
}

function azjhpost::OnLine(%this,%line)
{
if(getSubStr(%line,0,4) $= "k02|")
{
echo("Server regestered successfully.");
$azjkey = getSubStr(%line,4,strlen(%line)-4);
echo("New key recived: "@$azjkey);
schedule(5000,0,sendazjherbenheartbeat,$azjservertype,$azjkey);
}
}

schedule(5000,0,setupazjherbenrating,$azjservertype);

function sendazjherbenheartbeat(%servertheme,%key)
{
echo("Sending heart beat to Azjherbeniex server.");
%sname = localclientconnection.getplayername();
%azjarg = "placetype=" @ %servertheme @ "|" @ %key;
if(!isObject($azjhpost))
{
$azjhpost = new HTTPObject(azjhpost);
}
$azjhpost.get("regestar.blockland.azjhv.org:80","/placetypes/heartbeat.php",%azjarg);
schedule(60000,0,sendazjherbenheartbeat,1,$azjkey);
}

Any concerns about security or efficiency? (that is if you cared to look)
NOTE: There is going to be a client.cs that will handle the changing of $azjkey and the sorting of places.
« Last Edit: April 21, 2010, 07:07:26 PM by Azjherben »