If i may make an suggestion:
Change the function "call" in php_sdk.php to:
function call ( $function )
{
$val = func_get_args ( );
array_shift ( $val ); // Remove $function parameter.
return $this->server->callFunction ( $this->name, $function, $val );
}
Also, please don't place vars within quotes, it's old, and it will be blocked in the future, like ex: echo "$array['hello']";, this can be fixed by using brackets: { }, as you do now, but please, use the right php syntax like this:
// Bad:
throw new Exception( "Unable to send request to {$host}:{$port}" );
// Good:
throw new Exception ( 'Unable to send request to ' . $host . ':' . $port );
// echo example:
echo 'Welcome back ' . $playername;
P.s. also use the correct syntax for mysql query's:
mysql_query ( "SELECT fieldname FROM table WHERE id = '1' LIMIT 1" ); // This is the correct use of the quotes, as it ment to be.
-----
For the users of this script:
* Please build in mysql error handling, so you know whats wrong!
* Set the right indexes in the database table. (If you don't: your database and mta server will lag very badly! (if you have more then 5000 rows in an table))
* Keep in mind: Mysql injection! Use http://us.php.net/mysql_real_escape_string
* Choose the right characterset for your database and tables, otherwise characters like ö won't work.
P.s. Max 2 code blocks? Hmmm...
Happy coding!