Definition in file service.h.
#include "nel/misc/types_nl.h"
#include "nel/misc/config_file.h"
#include "nel/misc/entity_id.h"
#include "nel/misc/variable.h"
#include "nel/misc/command.h"
#include "nel/net/unified_network.h"
#include <string>
#include <vector>
Go to the source code of this file.
Namespaces | |
namespace | NLMISC |
namespace | NLNET |
Defines | |
#define | NLNET_SERVICE_MAIN(__ServiceClassName, __ServiceShortName, __ServiceLongName, __ServicePort, __ServiceCallbackArray, __ConfigDir, __LogDir) |
|
Value: \ int main(int argc, const char **argv) \ { \ __ServiceClassName *scn = new __ServiceClassName; \ scn->setArgs (argc, argv); \ scn->setCallbackArray (__ServiceCallbackArray, sizeof(__ServiceCallbackArray)/sizeof(__ServiceCallbackArray[0])); \ sint retval = scn->main (__ServiceShortName, __ServiceLongName, __ServicePort, __ConfigDir, __LogDir, __DATE__" "__TIME__); \ delete scn; \ return retval; \ } If you don't want to give a callback array, just put EmptyCallbackArray in the last argument Example:
If you want the port to not be auto-assigned by the naming service, set the port to a number different than 0. Args used by service are always in lower case: -A followed by the path where to execute the service (it uses chdir()) -B followed by the IP address where the naming service is -C followed by the path where we can find the config file -D followed by the client listening address of the frontend for the login system (FS only) -I to start the service iconified -L followed by the directory where we have to log -N followed by the alias name (used by the admin system) -P followed by the listen port (ListenAddress) -Q to make the service quit immediately after the first update -S followed by the shard Id (sint32) (WS only) -W followed by the path where to save all shard data (SaveFilesDirectory) |