Atrinik Server  4.0
Functions | Variables
main.c File Reference
#include <global.h>
#include <toolkit/gitversion.h>
#include <toolkit/string.h>
#include <plugin.h>
#include <arch.h>
#include <player.h>
#include <object.h>
#include <object_methods.h>
#include <waypoint.h>
#include <server.h>
#include <toolkit/process.h>
#include <toolkit/console.h>

Go to the source code of this file.

Functions

static void dequeue_path_requests (void)
 
static void do_specials (void)
 
void version (object *op)
 
void leave_map (object *op)
 
void set_map_timeout (mapstruct *map)
 
void process_events (void)
 
void clean_tmp_files (void)
 
void server_shutdown (void)
 
int swap_apartments (const char *mapold, const char *mapnew, int x, int y, object *op)
 
void shutdown_timer_start (long secs)
 
void shutdown_timer_stop (void)
 
static int shutdown_timer_check (void)
 
void main_process (void)
 
int main (int argc, char **argv)
 

Variables

static object marker
 
playerfirst_player
 
mapstructfirst_map
 
treasure_list_tfirst_treasurelist
 
struct artifact_listfirst_artifactlist
 
playerlast_player
 
uint32_t global_round_tag
 
int process_delay
 
static long shutdown_time
 
static uint8_t shutdown_active = 0
 

Detailed Description

Server main related functions.

Definition in file main.c.

Function Documentation

void clean_tmp_files ( void  )

Clean temporary map files.

Definition at line 300 of file main.c.

static void dequeue_path_requests ( void  )
static

Dequeue path requests.

Todo:
Only compute time if there is something more in the queue, something like if (path_request_queue_empty()) { break; }

Definition at line 341 of file main.c.

static void do_specials ( void  )
static

Collection of functions to call from time to time.

Definition at line 497 of file main.c.

void leave_map ( object op)

All this really is is a glorified object_removeject that also updates the counts on the map if needed and sets map timeout if needed.

Parameters
opThe object leaving the map.

Definition at line 107 of file main.c.

int main ( int  argc,
char **  argv 
)

The main function.

Parameters
argcNumber of arguments.
argvArguments.
Returns
0.

Definition at line 588 of file main.c.

void main_process ( void  )

Main processing function, called from main().

Definition at line 561 of file main.c.

void process_events ( void  )

Process objects with speed, like teleporters, players, etc.

Definition at line 148 of file main.c.

void server_shutdown ( void  )

Shut down the server, saving and freeing all data.

Definition at line 329 of file main.c.

void set_map_timeout ( mapstruct map)

Sets map timeout value.

Parameters
mapThe map to set the timeout for.

Definition at line 124 of file main.c.

int swap_apartments ( const char *  mapold,
const char *  mapnew,
int  x,
int  y,
object op 
)

Swap one apartment (unique) map for another.

Parameters
mapoldOld map path.
mapnewMap to switch for.
xX position where player's items from old map will go to.
yY position where player's items from old map will go to.
opPlayer we're doing the switching for.
Returns
1 on success, 0 on failure.

Definition at line 395 of file main.c.

void version ( object op)

Shows version information.

Parameters
opIf NULL the version is logged using LOG(), otherwise it is shown to the player object using draw_info_format().

Definition at line 84 of file main.c.

Variable Documentation

player* last_player

Last player.

Definition at line 67 of file main.c.

object marker
static

Object used in process_events().

Definition at line 51 of file main.c.