Just a quick note, that I made one of my web-scripts available to everyone at TidyPawn.
I use TidyPawn usally to autoindent loosly formated pawn code.
Just a quick note, that I made one of my web-scripts available to everyone at TidyPawn.
I use TidyPawn usally to autoindent loosly formated pawn code.
The dfairplay main servers, have a http-GET-based query system, which can be used by servers to check for unfair players. <!--more--> This article is pretty technically, because it's about the API.
If you want to access the API directly (without using one of the interfaces, like e.g.
filterscript for samp servers) you will have to query the following url:
http://dfairplay-query.webdevberlin.com
this is the root, and should be prepended to all following examples.
All calls are made in the following scheme:
/[strong]function_name[/strong]/param1/param2/.../
In the following documentation I'll use some wildcards:
Free functions (no token required):
Restricted functions (token required):
Usage You'll mostly find your self using adduser to check if the player has dfairplay installed and deleteuser to remove it. If you do that on every connect/disconnect you can safely use get_incidents to find all players which have reported incidents while dfairplay installed!
Error-Codes
All functions may return these error codes:
1 = true
0 = false
-1 = function not found
-2 = incorrect parameter count
-3 = invalid parameter
-4 = session expired
If you are using windows as operating system and want to access files available on unix-based remote file systems, you have only limited amount of options. In case you are using Eclipse as development environment, we'll have a look at an alternative, which does not use samba-shares.
A nice option is the plugin
Target Management (RSE). It allows you to add any remote systems to the remote file system explorer.
Once RSE is installed, you are able to add a folder (like you did before) but link it to local or RSE location. Select RSE and choose the path on your remote system!
Jan Kneschke maintains lighttpd and posted a simple FCGI for lua. This magnet.c should be easily compiled with
gcc -Wall -O2 -g -o magnet magnet.c -llua5.1 -lfcgi -ldl -lm
This may not work if your lua-include is not in the path for compiling.
And you'll run into such error messages:
magnet.c:3:20: error: lualib.h: No such file or directory
magnet.c:4:21: error: lauxlib.h: No such file or directory
magnet.c:11: Error: expected »)« before »*« token
magnet.c:19: Error: expected »)« before »*« token
magnet.c:59: Error: expected »)« before »*« token
Since you may not be used to compiling, I think it might be good to post a reason for that and a solution.
The reason is, that lualib.h is not in include path. To add it specific folder for the compiling to the include path you may use the
-I /path/name/ parameter.
gcc -Wall -O2 -g -o magnet magnet.c [strong]-I/usr/include/lua5.1/[/strong] -llua5.1 -lfcgi -ldl -lm
Have fun compiling!
For each executed Module/Action(+View) there is an ExecutionContainer (AgaviExecutionContainer). So if you want to retrieve the current executed action, module or view, best is to do
$action = $this->getContext()->getActionName();
$view = $this->getContext()->getViewName();
$module = $container->getModuleName();
But what if you want to retrieve the "real" action, the one and only for the request? That's a little bit more difficult, so here a short introduction how to deal with that.
Whenever the routing of agavi does the work for you, by turning the input data and webbrowser call of a user, into a action and validated data, it triggers an action, executes the view for the outputtype and fills the template. But Slots can be used from the view and trigger then again validation+action+view for their parameters.
This is why the real request route can not be found in the execution container and must be found somewhere else. In the Request.
$route_names = $this->getContext()->getRequest()->getAttribute(
'matched_routes', 'org.agavi.routing'
);
The route_names is nothing but an array, for instance:
array(
'product.edit'
// because our current route is named "product.edit"
// in routing.xml
)
This information does help us indirectly to determine the action, which got called! Since the WebRouting has also a getRoute-method, which expects just a route_name, we can retrieve the info now easily:
// we want to have just the first one,
// thatswhy list($first) = $array style
[strong]list($route_name)[/strong] = $this->getContext()->getRequest()->getAttribute(
'matched_routes', 'org.agavi.routing'
);
$route = $this->getContext()->getRouting()->getRoute($route_name);
The new $route-Variable now holds an array of all information about the route. In our case, just some are interesting.
$module = $route['opt']['module'];
$action = $route['opt']['action'];
One really should use that
only in case of a default slot, which is used directly in the output_types.xml or used on serveral different pages and has to determine on its own and by using module+action where it's actually embedded.