Atrinik Server 2.5
Data Structures | Defines | Typedefs | Variables
include/global.h File Reference
#include "includes.h"
#include "face.h"
#include "attack.h"
#include "material.h"
#include "living.h"
#include "object.h"
#include "arch.h"
#include "map.h"
#include "mempool.h"
#include "tod.h"
#include "pathfinder.h"
#include "newserver.h"
#include "skills.h"
#include "party.h"
#include "player.h"
#include "treasure.h"
#include "commands.h"
#include "artifact.h"
#include "god.h"
#include "race.h"
#include "sounds.h"
#include "recipe.h"
#include "spells.h"
#include "stringbuffer.h"
#include "random_map.h"
#include "proto.h"
#include "plugin.h"

Go to the source code of this file.

Data Structures

struct  _money_block
struct  linked_char
struct  Settings
struct  shstr_constants
struct  ban_struct
struct  cache_struct

Defines

#define EXTERN   extern
#define __attribute__(x)
#define UINT32_MAX   (4294967295U)
#define SINT32_MIN   (-2147483647 - 1)
#define SINT32_MAX   2147483647
#define UINT16_MAX   (65535U)
#define SINT16_MIN   (-32767 - 1)
#define SINT16_MAX   (32767)
#define UINT8_MAX   (255U)
#define SINT8_MIN   (-128)
#define SINT8_MAX   (127)
#define UINT64_MAX   (18446744073709551615LLU)
#define SINT64_MIN   (-9223372036854775807LL - 1)
#define SINT64_MAX   (9223372036854775807LL)
#define MONEYSTRING_NOTHING   0
#define MONEYSTRING_AMOUNT   1
#define MONEYSTRING_ALL   -1
#define BANK_SYNTAX_ERROR   -1
#define BANK_SUCCESS   0
#define BANK_WITHDRAW_HIGH   1
#define BANK_WITHDRAW_MISSING   2
#define BANK_WITHDRAW_OVERWEIGHT   3
#define BANK_DEPOSIT_COPPER   1
#define BANK_DEPOSIT_SILVER   2
#define BANK_DEPOSIT_GOLD   3
#define BANK_DEPOSIT_MITHRIL   4
#define POW2(x)   ((x) * (x))
#define MAP_INFO_NORMAL   12
#define MAP_INFO_ALL   9999
#define FREE_AND_COPY_HASH(_sv_, _nv_)
#define FREE_AND_ADD_REF_HASH(_sv_, _nv_)
#define FREE_AND_CLEAR_HASH(_nv_)
#define FREE_ONLY_HASH(_nv_)
#define ADD_REF_NOT_NULL_HASH(_nv_)
#define FREE_AND_CLEAR_HASH2(_nv_)
#define SPAWN_RANDOM_RANGE   10000
#define T_STYLE_UNSET   (-2)
#define ART_CHANCE_UNSET   (-1)
#define MIN_MON_RADIUS   2
#define MAX_AGGRO_RANGE   9
#define MAX_AGGRO_TIME   12
#define SEND_FACE_OK   0
#define SEND_FACE_OUT_OF_BOUNDS   1
#define SEND_FACE_NO_DATA   2
#define TILED_MAPS   8
#define EXP_AGILITY   1
#define EXP_MENTAL   2
#define EXP_MAGICAL   3
#define EXP_PERSONAL   4
#define EXP_PHYSICAL   5
#define EXP_WISDOM   6
#define MAX_EXP_CAT   7
#define EXP_NONE   0
#define MAXLEVEL   115
#define special_potion(__op_sp)   (__op_sp)->last_eat
#define move_object(__op, __dir)   move_ob(__op, __dir, __op)
#define is_magical(__op_)   QUERY_FLAG(__op_, FLAG_IS_MAGICAL)
#define NROF_COMPRESS_METHODS   4
#define ROUND_TAG   global_round_tag
#define STRING_SAFE(__string__)   (__string__ ? __string__ : ">NULL<")
#define STRING_ARCH_NAME(__arch__)   ((__arch__)->name ? (__arch__)->name : ">NULL<")
#define STRING_OBJ_NAME(__ob__)   ((__ob__) && (__ob__)->name ? (__ob__)->name : ">NULL<")
#define STRING_OBJ_ARCH_NAME(__ob__)   ((__ob__)->arch ? ((__ob__)->arch->name ? (__ob__)->arch->name : ">NULL<") : ">NULL<")
#define STRING_OBJ_SLAYING(__ob__)   ((__ob__)->slaying ? (__ob__)->slaying : ">NULL<")
#define SET_ANIMATION(ob, newanim)   ob->face = &new_faces[animations[ob->animation_id].faces[newanim]]
#define GET_ANIM_ID(ob)   (ob->animation_id)
#define GET_INV_ANIM_ID(ob)   (ob->inv_animation_id)
#define NUM_ANIMATIONS(ob)   (animations[ob->animation_id].num_animations)
#define NUM_FACINGS(ob)   (animations[ob->animation_id].facings)
#define FREE_AND_NULL_PTR(_xyz_)
#define CALLOC(x, y)   calloc(x, y)
#define CFREE(x)   free(x)
#define CACHE_FLAG_PYOBJ   1
#define CACHE_FLAG_AUTOFREE   2
#define CACHE_FLAG_GEVENT   4
#define tolower(C)   (((C) >= 'A' && (C) <= 'Z') ? (C) - 'A' + 'a': (C))
#define GETTIMEOFDAY(last_time)   gettimeofday(last_time, (struct timezone *) NULL);
#define SCRIPT_FIX_ACTIVATOR   2
#define SCRIPT_FIX_ALL   1
#define SCRIPT_FIX_NOTHING   0

Typedefs

typedef unsigned int uint32
typedef signed int sint32
typedef unsigned short uint16
typedef signed short sint16
typedef unsigned char uint8
typedef signed char sint8
typedef unsigned short Fontindex
typedef unsigned int tag_t
typedef const char shstr
typedef struct _money_block _money_block
typedef struct linked_char linked_char
typedef struct Settings Settings
typedef struct ban_struct _ban_struct
typedef struct cache_struct cache_struct

Variables

uint64 new_levels [MAXLEVEL+2]
int arch_cmp
int arch_search
New_Facenew_faces
playerfirst_player
mapstructfirst_map
treasurelistfirst_treasurelist
artifactlistfirst_artifactlist
godlinkfirst_god
playerlast_player
EXTERN char * uncomp [NROF_COMPRESS_METHODS][3]
EXTERN long init_done
EXTERN long nroferrors
long pticks
EXTERN FILE * logfile
EXTERN long nroftreasures
EXTERN long nrofartifacts
EXTERN long nrofallowedstr
object void_container
EXTERN char first_map_path [MAX_BUF]
EXTERN long ob_count
EXTERN uint32 global_round_tag
EXTERN int global_race_counter
EXTERN struct timeval last_time
EXTERN Animationsanimations
EXTERN int num_animations
EXTERN int animations_allocated
int freearr_x [SIZEOFFREE]
int freearr_y [SIZEOFFREE]
int maxfree [SIZEOFFREE]
int freedir [SIZEOFFREE]
New_Faceblank_face
New_Facenext_item_face
New_Faceprev_item_face
long max_time
socket_structinit_sockets
unsigned long todtick
int world_darkness
EXTERN archetypewp_archetype
EXTERN archetypeempty_archetype
EXTERN archetypebase_info_archetype
EXTERN archetypelevel_up_arch
Settings settings
EXTERN struct shstr_constants shstr_cons
EXTERN void(* object_initializers [256])(object *)

Detailed Description

Global definitions, u/sint8, things like that.

Definition in file global.h.


Define Documentation

#define EXP_NONE   0

Null experience object.

Definition at line 323 of file global.h.

#define FREE_AND_NULL_PTR (   _xyz_)
Value:
{                                \
    if (_xyz_)                   \
    {                            \
        free(_xyz_);             \
    }                            \
                                 \
    _xyz_ = NULL;                \
}

Free and NULL a pointer.

Definition at line 483 of file global.h.

#define GET_ANIM_ID (   ob)    (ob->animation_id)

Get object's animation ID.

Definition at line 456 of file global.h.

#define GET_INV_ANIM_ID (   ob)    (ob->inv_animation_id)

Get object's inventory animation ID.

Definition at line 458 of file global.h.

#define is_magical (   __op_)    QUERY_FLAG(__op_, FLAG_IS_MAGICAL)

Is the object magical?

Definition at line 376 of file global.h.

#define MAX_AGGRO_RANGE   9

If target of mob is out of this range (or stats.Wis if higher).

Definition at line 293 of file global.h.

#define MAX_AGGRO_TIME   12

Until this time - then it skip target

Definition at line 295 of file global.h.

#define MAX_EXP_CAT   7

Number of experience categories.

Definition at line 320 of file global.h.

#define MAXLEVEL   115

The maximum level.

Definition at line 326 of file global.h.

#define MIN_MON_RADIUS   2

Minimum monster detection radius

Definition at line 291 of file global.h.

#define move_object (   __op,
  __dir 
)    move_ob(__op, __dir, __op)

Move an object.

Definition at line 374 of file global.h.

#define NUM_ANIMATIONS (   ob)    (animations[ob->animation_id].num_animations)

Get the number of possible animations for an object.

Definition at line 460 of file global.h.

#define NUM_FACINGS (   ob)    (animations[ob->animation_id].facings)

Get the number of possible facings for object's animation.

Definition at line 462 of file global.h.

#define SET_ANIMATION (   ob,
  newanim 
)    ob->face = &new_faces[animations[ob->animation_id].faces[newanim]]

Set object's face by its animation ID.

Parameters:
obObject.
newanimAnimation ID to set.

Definition at line 454 of file global.h.

#define special_potion (   __op_sp)    (__op_sp)->last_eat

Special potions are identified by the last_eat value. last_eat == 0 is no special potion - means they are used as spell effect carrier.

Definition at line 368 of file global.h.

#define STRING_ARCH_NAME (   __arch__)    ((__arch__)->name ? (__arch__)->name : ">NULL<")

Use to get a safe name of arch, even if the arch name is NULL.

Definition at line 442 of file global.h.

#define STRING_OBJ_ARCH_NAME (   __ob__)    ((__ob__)->arch ? ((__ob__)->arch->name ? (__ob__)->arch->name : ">NULL<") : ">NULL<")

Use to get a safe arch name of object, even if the object arch name is NULL.

Definition at line 446 of file global.h.

#define STRING_OBJ_NAME (   __ob__)    ((__ob__) && (__ob__)->name ? (__ob__)->name : ">NULL<")

Use to get a safe name of object, even if the object name is NULL.

Definition at line 444 of file global.h.

#define STRING_OBJ_SLAYING (   __ob__)    ((__ob__)->slaying ? (__ob__)->slaying : ">NULL<")

Use to get a safe slaying value of an object, even if the slaying value is NULL.

Definition at line 448 of file global.h.

#define STRING_SAFE (   __string__)    (__string__ ? __string__ : ">NULL<")

Use to get a safe string, even if the string is NULL.

Definition at line 440 of file global.h.

#define TILED_MAPS   8

Number of connected maps from a tiled map

Definition at line 311 of file global.h.


Typedef Documentation

typedef struct ban_struct _ban_struct

Ban structure.

typedef struct _money_block _money_block

Used for depositing/withdrawing money from bank, and using string to get information about how much money to deposit/withdraw.

typedef struct cache_struct cache_struct

One cache entry.

typedef unsigned short Fontindex

Used for faces.

Definition at line 92 of file global.h.

typedef struct linked_char linked_char

Used to link together shared strings.

typedef struct Settings Settings

Settings structure

typedef const char shstr

This should be used to differentiate shared strings from normal strings.

Definition at line 98 of file global.h.

typedef signed short sint16

sint16

Definition at line 76 of file global.h.

typedef signed int sint32

sint32

Definition at line 65 of file global.h.

typedef signed char sint8

sint8

Definition at line 87 of file global.h.

typedef unsigned int tag_t

Object unique IDs.

Definition at line 95 of file global.h.

typedef unsigned short uint16

uint16

Definition at line 70 of file global.h.

typedef unsigned int uint32

uint32

Definition at line 59 of file global.h.

typedef unsigned char uint8

uint8

Definition at line 81 of file global.h.


Variable Documentation

int arch_cmp

How many strcmp's

Definition at line 39 of file arch.c.

How many searches

Definition at line 41 of file arch.c.

Pointer to base_info archetype.

Definition at line 479 of file global.h.

Following can just as easily be pointers, but it is easier to keep them like this.

Definition at line 61 of file image.c.

Pointer to empty_archetype archetype.

Definition at line 477 of file global.h.

EXTERN char first_map_path[MAX_BUF]

The starting map.

Definition at line 421 of file global.h.

int freearr_x[SIZEOFFREE]

X offset when searching around a spot.

Definition at line 246 of file object.c.

int freearr_y[SIZEOFFREE]

Y offset when searching around a spot.

Definition at line 253 of file object.c.

int freedir[SIZEOFFREE]

Direction we're pointing on this spot.

Definition at line 267 of file object.c.

EXTERN int global_race_counter

Global race counter.

Definition at line 432 of file global.h.

Round ticker.

Definition at line 428 of file global.h.

EXTERN long init_done

Ignores signals until init_done is true.

Definition at line 402 of file global.h.

Established connections for clients not yet playing.

Definition at line 39 of file init.c.

Last player.

Definition at line 396 of file global.h.

EXTERN struct timeval last_time

Used for main loop timing.

Definition at line 435 of file global.h.

EXTERN FILE* logfile

Log file to use.

Definition at line 410 of file global.h.

int maxfree[SIZEOFFREE]

Number of spots around a location, including that location (except for 0)

Definition at line 260 of file object.c.

uint64 new_levels[MAXLEVEL+2]

Experience needed for each level.

Around level 11 you need to kill 38 + (2 * (your_level - 11)) yellow monsters with a base exp of 125 to level up.

Definition at line 37 of file exp.c.

EXTERN long nrofallowedstr

Number of allowed treasure combinations.

Definition at line 416 of file global.h.

EXTERN long nrofartifacts

Number of artifacts.

Definition at line 414 of file global.h.

EXTERN long nroferrors

If this exceeds MAX_ERRORS, the server will shut down.

Definition at line 404 of file global.h.

EXTERN long nroftreasures

Number of treasures.

Definition at line 412 of file global.h.

EXTERN long ob_count

Progressive object counter (every new object will increase this, even if that object is later removed).

Definition at line 425 of file global.h.

long pticks

Used by various function to determine how often to save the character.

Definition at line 46 of file time.c.

You unfortunately need to looking in include/global.h to see what these correspond to.

Definition at line 39 of file init.c.

unsigned long todtick

Time of day tick.

Definition at line 75 of file init.c.

Container for objects without real maps or envs

Definition at line 47 of file object.c.

World's darkness value.

Definition at line 72 of file init.c.

Pointer to waypoint archetype.

Definition at line 475 of file global.h.