Planeshift
Classes | Namespaces | Defines | Typedefs | Enumerations | Functions | Variables

Common_util

Classes

struct  COMMAND
 This is a little class to store an array of commands and functions to call with each command. More...
class  ConsoleOut
 Simple static class for controlled user output. More...
class  Edge
 Represents the Edge in a PathNetwork. More...
class  EmptyMathStatement
 This holds an empty statement that shall not be executed but is used for control flow statements, e.g. More...
class  EventManager
 This class handles all queueing and invoking of timed events, such as combat, spells, NPC dialog responses, range weapons, or NPC respawning. More...
class  FileStat
class  FileUtil
class  GenericRefQueue< queuetype, refType >
 A queue of smart pointers with locking facilties for multi-threading. More...
class  Heap< T >
class  iCommandCatcher
 This defines an interface for intercepting commands instead of handling them locally in the server console. More...
class  iEffectIDAllocator
 Helper interface to allocate effect IDs. More...
class  iScriptableVar
class  Location
 A Location is a named place on the map, located dynamically by NPCs as scripted. More...
class  LocationManager
 Manager that manage all locations and location types. More...
class  LocationType
 This stores a vector of positions listing a set of points defining a common type of location, such as a list of burning fires or guard stations--whatever the NPCs need. More...
class  LogCSV
class  MathEnvironment
 A specific MathEnvironment to be used in a MathScript. More...
class  MathExpression
 The base expression class. More...
class  MathScript
 A MathScript is a mini-program to run. More...
class  MathScriptEngine
 This holds all the formulas loaded from the MathScript table and provides a container for them. More...
class  MathStatement
 This holds one line of a (potentially) multi-line script. More...
class  MathVar
 This holds information about a specific variable in a specific MathEnvironment to be used for MathScripts and allows setting/retrieving all data related to it. More...
class  NameGenerationSystem
class  NameGenerator
class  PhonicEntry
class  PoolAllocator< TEMPLATE_CLASS >
class  psCache
 psCache More...
class  psColours
class  psCSSetup
 A helper class to setup Crystal Space and mount some dirs. More...
class  psDatabase
class  psDBProfiles
 Statistics of time consumed by SQL statements. More...
class  psGameEvent
 All scheduled events must inherit from this class. More...
class  psImageRegion
 This class stores all required info for a particular region. More...
class  psLinearPath
class  psLocalization
 Localization class for languages. More...
class  psNamedProfiles
 Statistics of consumption by operations that are identified by names (strings) This is usable for most profilling purposes - some operations are identified using other means (e.g. More...
class  psOperProfile
 Statistics for one operation. More...
class  psOperProfileSet
 Statistics for all kinds of operations This class is abstract, you have to inherit from it to use it, for example add a method that will be called to collect statistics. More...
class  psPath
class  psPathAnchor
class  psPathNetwork
 A network of Waypoint and psPath objects. More...
class  psPathPoint
 Represents a point on a path between two waypoints. More...
struct  psPoint
struct  psScanline
 This struct just stores the left and right side of each line in a psRegion. More...
class  psServerConsoleCommand
class  psSkillCache
 The psSkillCache class implements the skill cache both on the server and on the client. More...
class  psSkillCacheItem
 psSkillCacheItem item is one stat or skill in the skill cache. More...
class  psStopWatch
 Used to measure time intervals. More...
class  psString
class  psStringArray
 A slightly improved version of csStringArray, sporting the handy FormatPush method. More...
struct  psStringTableItem
class  psTemplateRes
class  psTemplateResMngr
class  psTextureFactory
 This class reads in the xml file defining regions and maintains the preload list of textures. More...
class  psToggle
 Simple Toggle with callback functionality. More...
class  psXMLString
class  psXMLTag
class  RemoteDebug
 Keep track of remote debugging. More...
struct  Result
 This is a wrapper class for result sets which makes syntax for getting at the data easier and also uses dtors to make ResultSets safer from memory leaks. More...
class  ScopedTimer
 Check how long time it take to process a scope. More...
class  ScopedTimerCB
 Callback function for ScopedTimers. More...
class  ServerConsole
 This class is implements the user input and output console for the server. More...
class  Singleton< T >
class  SlotNameHash
 A hash map class that stores a name->ID of sockets. More...
class  Waypoint
 A waypoint is a specified circle on the map with a name, location, and a list of waypoints it is connected to. More...
class  WaypointAlias
 Class to hold information regarding aliases for waypoints. More...
class  WordArray
 WordArray is class that parses text command (e.g. More...

Namespaces

namespace  pslog
namespace  psMiniGame
 

Globals for minigames.


Defines

#define APPNAME   "PlaneShift Azure Spirit (" PS_VERSION ")"
#define BLUECODE   "\0330000ff0"
#define CHECK_FINAL_DECREF(obj, what)
#define CHECK_FINAL_DECREF_CONFIRM(obj, what)
#define CPrintf   ConsoleOut::Intern_Printf
 Allows other classes to print to the server console easily.
#define CPrintfLog   ConsoleOut::Intern_Printf_LogOnly
#define CPrompt   ConsoleOut::SetPrompt
#define CShift   ConsoleOut::Shift
#define CUnshift   ConsoleOut::Unshift
#define CVPrintf   ConsoleOut::Intern_VPrintf
#define CVPrintfLog   ConsoleOut::Intern_VPrintf_LogOnly
#define DeclareGenericEventHandler(handlerName, parentType, eventName)
 Declares a generic event handler for a class.
#define DEF_PROX_DIST   100
 100m is trial distance here
#define DEF_UPDATE_DIST   5
 30m is trial (default) delta to update
#define DEFAULT_ATTACK_NAME   "default"
 temporary constant
#define DEFAULT_ATTACKQUEUE_SIZE   5
 this is the default attack queue size of players, currently it is static among all players
#define DEFAULTCODE   "\0330000000"
#define ERRORHALT(msg)   errorhalt (__PRETTY_FUNCTION__,__FILE__, __LINE__, msg)
#define ERRORMSG(msg)   errormsg (__PRETTY_FUNCTION__,__FILE__, __LINE__, msg)
#define ESCAPECODE   '\033'
#define GREENCODE   "\03300ff000"
#define INFINITY_DISTANCE   9999999.99f
#define LENGTHCODE   8
#define MAKE_ID_TYPE(name)
 Make unique integer types for various types of IDs.
#define MAX_COMBAT_EVENT_RANGE   30
 This #define determines how far away people will get detailed combat events.(moved from combatmanager)
#define PHONIC_POSTJOINER   0x02
#define PHONIC_PREJOINER   0x01
#define POOLALLOC_DEFAULT_ALLOCATION_OBJECTS   1024
#define PROX_LIST_ANY_RANGE   0.0
 range of 0 means all members of proxlist in multicast.
#define PS_DBNAME   "planeshift"
#define PS_PASS   "planeshift"
#define PS_USER   "planeshift"
#define PS_VERSION   "0.6.5"
#define RDebug(debugEntity, debugLevel,...)   { if (debugEntity->IsDebugging()) { debugEntity->Printf(debugLevel, __VA_ARGS__); }}
 Remote debugging marcro.
#define REDCODE   "\033ff00000"
#define ShowID(id)   id.Show().GetData()
 Convenience wrapper so we don't have to write ugly things like actor->GetEID().Show().GetData() all over the place.
#define SIZET_NOT_FOUND   ((size_t)-1)
#define SOCKET_CLOSE_FORCED   true
#define WEATHER_MAX_RAIN_DROPS   8000
#define WEATHER_MAX_SNOW_FALKES   6000
#define WHITECODE   "\033ffffff0"
#define XML_CASE_INSENSITIVE   true
#define XML_CASE_SENSITIVE   false

Typedefs

typedef int cmdfuncptr (const char *)
typedef int32_t ContainerID
 Container IDs are either EIDs (if > 100) or inventory slot IDs.
typedef csList
< psSkillCacheItem * >
::Iterator 
psSkillCacheIter
 Skill cache iterator.
typedef csHash
< psStringTableItem
*, csString > 
psStringTableHash
typedef csHash< csRef
< psTemplateRes >, csString > 
psTemplateResourceHash

Enumerations

enum  {
  CSV_AUTHENT, CSV_EXCHANGES, CSV_PALADIN, CSV_STATUS,
  CSV_ADVICE, CSV_ECONOMY, CSV_STUCK, CSV_SQL,
  MAX_CSV
}
enum  { NAMEGENERATOR_FEMALE_FIRST_NAME = 0, NAMEGENERATOR_MALE_FIRST_NAME, NAMEGENERATOR_FAMILY_NAME, NAMEGENERATOR_MAX }
enum  ConsoleOutMsgClass {
  CON_NONE = 0, CON_CMDOUTPUT, CON_BUG, CON_ERROR,
  CON_WARNING, CON_NOTIFY, CON_DEBUG, CON_SPAM
}
 

Different message classes.

More...
enum  INVENTORY_SLOT_NUMBER {
  PSCHARACTER_SLOT_STORAGE = -2, PSCHARACTER_SLOT_NONE = -1, PSCHARACTER_SLOT_RIGHTHAND = 0, PSCHARACTER_SLOT_LEFTHAND = 1,
  PSCHARACTER_SLOT_BOTHHANDS = 2, PSCHARACTER_SLOT_RIGHTFINGER = 3, PSCHARACTER_SLOT_LEFTFINGER = 4, PSCHARACTER_SLOT_HELM = 5,
  PSCHARACTER_SLOT_NECK = 6, PSCHARACTER_SLOT_BACK = 7, PSCHARACTER_SLOT_ARMS = 8, PSCHARACTER_SLOT_GLOVES = 9,
  PSCHARACTER_SLOT_BOOTS = 10, PSCHARACTER_SLOT_LEGS = 11, PSCHARACTER_SLOT_BELT = 12, PSCHARACTER_SLOT_BRACERS = 13,
  PSCHARACTER_SLOT_TORSO = 14, PSCHARACTER_SLOT_MIND = 15, PSCHARACTER_SLOT_BULK1 = 16, PSCHARACTER_SLOT_BULK2 = 17,
  PSCHARACTER_SLOT_BULK3 = 18, PSCHARACTER_SLOT_BULK4 = 19, PSCHARACTER_SLOT_BULK5 = 20, PSCHARACTER_SLOT_BULK6 = 21,
  PSCHARACTER_SLOT_BULK7 = 22, PSCHARACTER_SLOT_BULK8 = 23, PSCHARACTER_SLOT_BULK9 = 24, PSCHARACTER_SLOT_BULK10 = 25,
  PSCHARACTER_SLOT_BULK11 = 26, PSCHARACTER_SLOT_BULK12 = 27, PSCHARACTER_SLOT_BULK13 = 28, PSCHARACTER_SLOT_BULK14 = 29,
  PSCHARACTER_SLOT_BULK15 = 30, PSCHARACTER_SLOT_BULK16 = 31, PSCHARACTER_SLOT_BULK17 = 32, PSCHARACTER_SLOT_BULK18 = 33,
  PSCHARACTER_SLOT_BULK19 = 34, PSCHARACTER_SLOT_BULK20 = 35, PSCHARACTER_SLOT_BULK21 = 36, PSCHARACTER_SLOT_BULK22 = 37,
  PSCHARACTER_SLOT_BULK23 = 38, PSCHARACTER_SLOT_BULK24 = 39, PSCHARACTER_SLOT_BULK25 = 40, PSCHARACTER_SLOT_BULK26 = 41,
  PSCHARACTER_SLOT_BULK27 = 42, PSCHARACTER_SLOT_BULK28 = 43, PSCHARACTER_SLOT_BULK29 = 44, PSCHARACTER_SLOT_BULK30 = 45,
  PSCHARACTER_SLOT_BULK31 = 46, PSCHARACTER_SLOT_BULK32 = 47, PSCHARACTER_SLOT_BULK_END = 48
}
 

Holds a list of the possible socket identifiers that items can be attached to.

More...
enum  LOG_TYPES {
  LOG_ANY, LOG_WEATHER, LOG_SPAWN, LOG_CELPERSIST,
  LOG_PAWS, LOG_GROUP, LOG_CHEAT, LOG_LINMOVE,
  LOG_SPELLS, LOG_NEWCHAR, LOG_SUPERCLIENT, LOG_EXCHANGES,
  LOG_ADMIN, LOG_STARTUP, LOG_CHARACTER, LOG_CONNECTIONS,
  LOG_CHAT, LOG_NET, LOG_LOAD, LOG_NPC,
  LOG_TRADE, LOG_SOUND, LOG_COMBAT, LOG_SKILLXP,
  LOG_QUESTS, LOG_SCRIPT, LOG_RELATIONSHIPS, LOG_MESSAGES,
  LOG_CACHE, LOG_PETS, LOG_USER, LOG_LOOT,
  LOG_MINIGAMES, LOG_DRDATA, LOG_ACTIONLOCATION, LOG_ITEM,
  LOG_HIRE, MAX_FLAGS
}
enum  MathType { VARTYPE_VALUE, VARTYPE_STR, VARTYPE_OBJ }
 

possible types of variables.

More...
enum  SPELL_TYPE { BUFF, DEBUFF }

Functions

void CopyXMLNode (iDocumentNode *source, iDocumentNode *target, int mode)
 Copies/merges children and attributes of 'source' to 'target'.
void errorhalt (const char *function, const char *file, int line, const char *msg)
void errormsg (const char *function, const char *file, int line, const char *msg)
csString EscpXML (const char *str)
 Escapes special XML characters in 'str'.
csString GetNodeXML (iDocumentNode *node, bool childrenOnly=false)
 Generates XML representing given node.
void GetTimeOfDay (csString &string)
 Get the time of day in GMT.
csString & GetWordNumber (const csString &str, int number, size_t *startpos=NULL)
 Return the given word number.
bool isFlagSet (const psString &flagstr, const char *flag)
 MAKE_ID_TYPE (EID)
 GEM Entity IDs.
 MAKE_ID_TYPE (PID)
 Player IDs.
 MAKE_ID_TYPE (AccountID)
 Account IDs.
csPtr< iDocument > ParseFile (iObjectRegistry *object_reg, const csString &name)
 Loads and parses a XML file, then returns its parsed XML document.
csPtr< iDocument > ParseString (const csString &str, bool notify=true)
 Parses a XML string, then returns the parsed document.
csPtr< iDocumentNode > ParseStringGetNode (const csString &str, const csString &topNodeName, bool notify=true)
 Parses a XML string, then returns the top node with name 'topNodeName'.
const char * PS_GetFileName (const char *path)
bool psContain (const csString &str, const csArray< csString > &strs)
float psGetRandom ()
 Returns a random number.
uint32 psGetRandom (uint32 limit)
 Returns a random number with a limit.
void psprintf (const char *arg,...)
bool psSentenceContain (const csString &sentence, const csString &word)
csArray< csString > psSplit (const char *str, char delimer)
csArray< csString > psSplit (csString &str, char delimer)
void Split (const csString &str, csArray< csString > &arr)
 Split a csString into an array of sctrings.
csArray< csString > splitTextInLines (csString inText, size_t maxLineLength, int &maxRowLen)
 Split text into multiple lines.
csString toString (const csVector3 &pos)
csString toString (const csVector2 &pos)
csString toString (const csVector4 &pos)
csString toString (const csTransform &trans)
csString toString (const csVector3 &pos, iSector *sector)
csString toString (const csMatrix3 &mat)

Variables

const COMMAND commands []
FILE * errorLog

Dynamic proxlist range settings.

The dynamic proxlist shrinks range in steps (maximum of 1 step per proxlist update) if the number of player entities on the proxlist exceeds PROX_LIST_SHRINK_THRESHOLD.When the number of entities is below PROX_LIST_REGROW_THRESHOLD and the range is below gemObject::prox_distance_desired, the range is increased.
typedef uint32 InstanceID
#define PROX_LIST_SHRINK_THRESHOLD   50
 50 players in range - start radius shrink
#define PROX_LIST_REGROW_THRESHOLD   30
 30 players in range - start radius grow
#define PROX_LIST_STEP_SIZE   10
 grow by this much each attempt
#define DEFAULT_INSTANCE   0
 Instance 0 is where 99% of things happen.
#define INSTANCE_ALL   0xffffffff
#define ASSIST_MAX_DIST   25
 Maximum distance that the /assist command will work.
#define EXCHANGE_SLOT_COUNT   9
#define INVENTORY_BULK_COUNT   32
#define INVENTORY_EQUIP_COUNT   16
#define GLYPH_WAYS   6
#define GLYPH_ASSEMBLER_SLOTS   4
#define MAX_NPC_DIALOG_DIST   10
#define RANGE_TO_SEE_ACTOR_LABELS   14
#define RANGE_TO_SEE_ITEM_LABELS   7
#define RANGE_TO_SELECT   5
#define RANGE_TO_LOOT   4
#define RANGE_TO_RECV_LOOT   100
#define RANGE_TO_USE   4
#define RANGE_TO_STACK   0.5
 Range to stack like items when dropping/creating in the world.
#define DROP_DISTANCE   0.55
 Distance in front of player to drop items (just more then RANGE_TO_STACK)
#define MAX_DROP_DISTANCE   5
 Maximum distance at which a player may drop an item.
#define RANGE_TO_GUARD   6
 Range in which you can guard an item - should be slightly bigger than drop range.
#define SKILL_MAX_RANK   5000
#define LONG_RANGE_PERCEPTION   30
#define SHORT_RANGE_PERCEPTION   10
#define PERSONAL_RANGE_PERCEPTION   4
#define IS_CONTAINER   true
#define GAME_MINUTE_IN_SECONDS   10
 Number of seconds for each game minute, 10sec real time for 1 minute game time.
#define GAME_MINUTE_IN_TICKS   (GAME_MINUTE_IN_SECONDS*1000)
 Number of ticks for each game minute, 10sec real time for 1 minute game time.

Minimum guild requirements

#define GUILD_FEE   20000
#define GUILD_MIN_MEMBERS   1
#define GUILD_KICK_GRACE   5
 minutes
#define GUILD_NAME_CHANGE_LIMIT   24 * 60 * 60000
 Minimum number of ticks between name change of guild.
#define MAX_GUILD_LEVEL   9
#define DEFAULT_MAX_GUILD_POINTS   100
#define MAX_GUILD_POINTS_LIMIT   99999

Define Documentation

#define APPNAME   "PlaneShift Azure Spirit (" PS_VERSION ")"

Definition at line 42 of file pscssetup.h.

#define ASSIST_MAX_DIST   25

Maximum distance that the /assist command will work.

Definition at line 67 of file psconst.h.

#define BLUECODE   "\0330000ff0"

Definition at line 43 of file psutil.h.

#define CHECK_FINAL_DECREF (   obj,
  what 
)
Value:
if (obj->GetRefCount() != 1)      \
    {                                 \
        printf("\n***Object is NOT being freed properly in %s:%d.  RefCount of %s is %d instead of 1.\n\n", \
           __FILE__,__LINE__,what, obj->GetRefCount() ); \
    }                               \

Definition at line 37 of file psscf.h.

#define CHECK_FINAL_DECREF_CONFIRM (   obj,
  what 
)
Value:
CHECK_FINAL_DECREF(obj,what)              \
    else                    \
    {                        \
    printf("\n***Object %s is being deleted correctly in %s:%d.\n\n",what,__FILE__,__LINE__);  \
    }                        \

Definition at line 44 of file psscf.h.

#define CPrintf   ConsoleOut::Intern_Printf

Allows other classes to print to the server console easily.

Definition at line 130 of file consoleout.h.

#define CPrintfLog   ConsoleOut::Intern_Printf_LogOnly

Definition at line 132 of file consoleout.h.

#define CPrompt   ConsoleOut::SetPrompt

Definition at line 136 of file consoleout.h.

#define CShift   ConsoleOut::Shift

Definition at line 134 of file consoleout.h.

#define CUnshift   ConsoleOut::Unshift

Definition at line 135 of file consoleout.h.

#define CVPrintf   ConsoleOut::Intern_VPrintf

Definition at line 131 of file consoleout.h.

#define CVPrintfLog   ConsoleOut::Intern_VPrintf_LogOnly

Definition at line 133 of file consoleout.h.

#define DeclareGenericEventHandler (   handlerName,
  parentType,
  eventName 
)
Value:
class handlerName : public scfImplementation1<handlerName,iEventHandler>            \
{                                                                                   \
private:                                                                            \
    parentType* parent;                                                             \
                                                                                    \
public:                                                                             \
    handlerName(parentType* p)                                                      \
        : scfImplementationType(this), parent(p) {}                                 \
                                                                                    \
    virtual ~handlerName() {}                                                       \
                                                                                    \
    virtual bool HandleEvent(iEvent& event)                                         \
    {                                                                               \
        return parent->HandleEvent(event);                                          \
    }                                                                               \
                                                                                    \
    CS_EVENTHANDLER_NAMES(eventName);                                               \
    CS_EVENTHANDLER_NIL_CONSTRAINTS;                                                \
}

Declares a generic event handler for a class.

Use this within the body of the parent class you wish to receive events.

Parameters:
handlerNameThe name to give to this new class declaration
parentTypeThe class name of the parent class for this
eventNameThe event name to use for this handler

Definition at line 37 of file genericevent.h.

#define DEF_PROX_DIST   100

100m is trial distance here

Definition at line 47 of file psconst.h.

#define DEF_UPDATE_DIST   5

30m is trial (default) delta to update

Definition at line 48 of file psconst.h.

#define DEFAULT_ATTACK_NAME   "default"

temporary constant

Definition at line 46 of file psconst.h.

#define DEFAULT_ATTACKQUEUE_SIZE   5

this is the default attack queue size of players, currently it is static among all players

Definition at line 40 of file psconst.h.

#define DEFAULT_INSTANCE   0

Instance 0 is where 99% of things happen.

Definition at line 63 of file psconst.h.

#define DEFAULT_MAX_GUILD_POINTS   100

Definition at line 112 of file psconst.h.

#define DEFAULTCODE   "\0330000000"

Definition at line 45 of file psutil.h.

#define DROP_DISTANCE   0.55

Distance in front of player to drop items (just more then RANGE_TO_STACK)

Definition at line 84 of file psconst.h.

#define ERRORHALT (   msg)    errorhalt (__PRETTY_FUNCTION__,__FILE__, __LINE__, msg)

Definition at line 20 of file pserror.h.

#define ERRORMSG (   msg)    errormsg (__PRETTY_FUNCTION__,__FILE__, __LINE__, msg)

Definition at line 21 of file pserror.h.

#define ESCAPECODE   '\033'

Definition at line 46 of file psutil.h.

#define EXCHANGE_SLOT_COUNT   9

Definition at line 69 of file psconst.h.

#define GAME_MINUTE_IN_SECONDS   10

Number of seconds for each game minute, 10sec real time for 1 minute game time.

Definition at line 100 of file psconst.h.

#define GAME_MINUTE_IN_TICKS   (GAME_MINUTE_IN_SECONDS*1000)

Number of ticks for each game minute, 10sec real time for 1 minute game time.

Definition at line 101 of file psconst.h.

#define GLYPH_ASSEMBLER_SLOTS   4

Definition at line 74 of file psconst.h.

#define GLYPH_WAYS   6

Definition at line 73 of file psconst.h.

#define GREENCODE   "\03300ff000"

Definition at line 42 of file psutil.h.

#define GUILD_FEE   20000

Definition at line 106 of file psconst.h.

#define GUILD_KICK_GRACE   5

minutes

Definition at line 108 of file psconst.h.

#define GUILD_MIN_MEMBERS   1

Definition at line 107 of file psconst.h.

#define GUILD_NAME_CHANGE_LIMIT   24 * 60 * 60000

Minimum number of ticks between name change of guild.

Definition at line 110 of file psconst.h.

#define INFINITY_DISTANCE   9999999.99f

Definition at line 186 of file psconst.h.

#define INSTANCE_ALL   0xffffffff

Definition at line 65 of file psconst.h.

#define INVENTORY_BULK_COUNT   32

Definition at line 70 of file psconst.h.

#define INVENTORY_EQUIP_COUNT   16

Definition at line 71 of file psconst.h.

#define IS_CONTAINER   true

Definition at line 98 of file psconst.h.

#define LENGTHCODE   8

Definition at line 47 of file psutil.h.

#define LONG_RANGE_PERCEPTION   30

Definition at line 92 of file psconst.h.

#define MAKE_ID_TYPE (   name)
Value:
class name                                                               \
{                                                                        \
public:                                                                  \
    name()           : id(0) {}                                          \
    name(uint32_t i) : id(i) {}                                          \
    uint32_t Unbox() const { return id; }                                \
    bool IsValid() const { return id != 0; }                             \
    csString Show() const                                                \
    {                                                                    \
        csString str(#name":");                                          \
        str.Append((unsigned int) id);                                         \
        return str;                                                      \
    }                                                                    \
    bool operator==(const name & other) const { return id == other.id; } \
    bool operator!=(const name & other) const { return id != other.id; } \
    bool operator< (const name & other) const { return id <  other.id; } \
private:                                                                 \
    uint32_t id;                                                         \
};                                                                       \
template<>                                                               \
class csHashComputer<name>                                               \
{                                                                        \
public:                                                                  \
    static uint ComputeHash(name key)                                    \
    {                                                                    \
        return key.Unbox();                                              \
    }                                                                    \
}

Make unique integer types for various types of IDs.

This allows the compiler to statically check for the right kind of ID, preventing various kinds of mistakes. It also documents which kind of ID is required.

Definition at line 136 of file psconst.h.

#define MAX_COMBAT_EVENT_RANGE   30

This #define determines how far away people will get detailed combat events.(moved from combatmanager)

Definition at line 44 of file psconst.h.

#define MAX_DROP_DISTANCE   5

Maximum distance at which a player may drop an item.

Definition at line 85 of file psconst.h.

#define MAX_GUILD_LEVEL   9

Definition at line 111 of file psconst.h.

#define MAX_GUILD_POINTS_LIMIT   99999

Definition at line 113 of file psconst.h.

#define MAX_NPC_DIALOG_DIST   10

Definition at line 76 of file psconst.h.

#define PERSONAL_RANGE_PERCEPTION   4

Definition at line 96 of file psconst.h.

#define PHONIC_POSTJOINER   0x02

Definition at line 91 of file namegenerator.h.

#define PHONIC_PREJOINER   0x01

Definition at line 90 of file namegenerator.h.

#define POOLALLOC_DEFAULT_ALLOCATION_OBJECTS   1024

Definition at line 75 of file poolallocator.h.

#define PROX_LIST_ANY_RANGE   0.0

range of 0 means all members of proxlist in multicast.

Definition at line 49 of file psconst.h.

#define PROX_LIST_REGROW_THRESHOLD   30

30 players in range - start radius grow

Definition at line 58 of file psconst.h.

#define PROX_LIST_SHRINK_THRESHOLD   50

50 players in range - start radius shrink

Definition at line 57 of file psconst.h.

#define PROX_LIST_STEP_SIZE   10

grow by this much each attempt

Definition at line 59 of file psconst.h.

#define PS_DBNAME   "planeshift"

Definition at line 41 of file psdatabase.h.

#define PS_PASS   "planeshift"

Definition at line 43 of file psdatabase.h.

#define PS_USER   "planeshift"

Definition at line 42 of file psdatabase.h.

#define PS_VERSION   "0.6.5"

Definition at line 38 of file pscssetup.h.

#define RANGE_TO_GUARD   6

Range in which you can guard an item - should be slightly bigger than drop range.

Definition at line 86 of file psconst.h.

#define RANGE_TO_LOOT   4

Definition at line 80 of file psconst.h.

#define RANGE_TO_RECV_LOOT   100

Definition at line 81 of file psconst.h.

#define RANGE_TO_SEE_ACTOR_LABELS   14

Definition at line 77 of file psconst.h.

#define RANGE_TO_SEE_ITEM_LABELS   7

Definition at line 78 of file psconst.h.

#define RANGE_TO_SELECT   5

Definition at line 79 of file psconst.h.

#define RANGE_TO_STACK   0.5

Range to stack like items when dropping/creating in the world.

Definition at line 83 of file psconst.h.

#define RANGE_TO_USE   4

Definition at line 82 of file psconst.h.

#define RDebug (   debugEntity,
  debugLevel,
  ... 
)    { if (debugEntity->IsDebugging()) { debugEntity->Printf(debugLevel, __VA_ARGS__); }}

Remote debugging marcro.

Define a variadic macro for debugging prints for Remote debugging. In this way only the check IsDebugging is executed for unless debugging is turned on. Using the Printf functions will cause all args to be resolved and that will result in a lot off spilled CPU.

Definition at line 48 of file remotedebug.h.

#define REDCODE   "\033ff00000"

Definition at line 41 of file psutil.h.

#define SHORT_RANGE_PERCEPTION   10

Definition at line 94 of file psconst.h.

#define ShowID (   id)    id.Show().GetData()

Convenience wrapper so we don't have to write ugly things like actor->GetEID().Show().GetData() all over the place.

Definition at line 171 of file psconst.h.

#define SIZET_NOT_FOUND   ((size_t)-1)

Definition at line 116 of file psconst.h.

#define SKILL_MAX_RANK   5000

Definition at line 89 of file psconst.h.

#define SOCKET_CLOSE_FORCED   true

Definition at line 37 of file psconst.h.

#define WEATHER_MAX_RAIN_DROPS   8000

Definition at line 123 of file psconst.h.

#define WEATHER_MAX_SNOW_FALKES   6000

Definition at line 124 of file psconst.h.

#define WHITECODE   "\033ffffff0"

Definition at line 44 of file psutil.h.

#define XML_CASE_INSENSITIVE   true

Definition at line 34 of file psstring.h.

#define XML_CASE_SENSITIVE   false

Definition at line 35 of file psstring.h.


Typedef Documentation

typedef int cmdfuncptr(const char *)

Definition at line 31 of file command.h.

typedef int32_t ContainerID

Container IDs are either EIDs (if > 100) or inventory slot IDs.

This is quite ugly; we don't try to add proper typing.

Definition at line 180 of file psconst.h.

typedef uint32 InstanceID

Definition at line 64 of file psconst.h.

typedef csList<psSkillCacheItem *>::Iterator psSkillCacheIter

Skill cache iterator.

Definition at line 151 of file skillcache.h.

typedef csHash<psStringTableItem*,csString> psStringTableHash

Definition at line 41 of file localization.h.

typedef csHash<csRef<psTemplateRes>, csString> psTemplateResourceHash

Definition at line 12 of file psresmngr.h.


Enumeration Type Documentation

anonymous enum
Enumerator:
CSV_AUTHENT 
CSV_EXCHANGES 
CSV_PALADIN 
CSV_STATUS 
CSV_ADVICE 
CSV_ECONOMY 
CSV_STUCK 
CSV_SQL 
MAX_CSV 

Definition at line 150 of file log.h.

anonymous enum
Enumerator:
NAMEGENERATOR_FEMALE_FIRST_NAME 
NAMEGENERATOR_MALE_FIRST_NAME 
NAMEGENERATOR_FAMILY_NAME 
NAMEGENERATOR_MAX 

Definition at line 82 of file namegenerator.h.

Different message classes.

Enumerator:
CON_NONE 
CON_CMDOUTPUT 
CON_BUG 
CON_ERROR 
CON_WARNING 
CON_NOTIFY 
CON_DEBUG 
CON_SPAM 

Definition at line 35 of file consoleout.h.

Holds a list of the possible socket identifiers that items can be attached to.

Enumerator:
PSCHARACTER_SLOT_STORAGE 
PSCHARACTER_SLOT_NONE 
PSCHARACTER_SLOT_RIGHTHAND 
PSCHARACTER_SLOT_LEFTHAND 
PSCHARACTER_SLOT_BOTHHANDS 
PSCHARACTER_SLOT_RIGHTFINGER 
PSCHARACTER_SLOT_LEFTFINGER 
PSCHARACTER_SLOT_HELM 
PSCHARACTER_SLOT_NECK 
PSCHARACTER_SLOT_BACK 
PSCHARACTER_SLOT_ARMS 
PSCHARACTER_SLOT_GLOVES 
PSCHARACTER_SLOT_BOOTS 
PSCHARACTER_SLOT_LEGS 
PSCHARACTER_SLOT_BELT 
PSCHARACTER_SLOT_BRACERS 
PSCHARACTER_SLOT_TORSO 
PSCHARACTER_SLOT_MIND 
PSCHARACTER_SLOT_BULK1 
PSCHARACTER_SLOT_BULK2 
PSCHARACTER_SLOT_BULK3 
PSCHARACTER_SLOT_BULK4 
PSCHARACTER_SLOT_BULK5 
PSCHARACTER_SLOT_BULK6 
PSCHARACTER_SLOT_BULK7 
PSCHARACTER_SLOT_BULK8 
PSCHARACTER_SLOT_BULK9 
PSCHARACTER_SLOT_BULK10 
PSCHARACTER_SLOT_BULK11 
PSCHARACTER_SLOT_BULK12 
PSCHARACTER_SLOT_BULK13 
PSCHARACTER_SLOT_BULK14 
PSCHARACTER_SLOT_BULK15 
PSCHARACTER_SLOT_BULK16 
PSCHARACTER_SLOT_BULK17 
PSCHARACTER_SLOT_BULK18 
PSCHARACTER_SLOT_BULK19 
PSCHARACTER_SLOT_BULK20 
PSCHARACTER_SLOT_BULK21 
PSCHARACTER_SLOT_BULK22 
PSCHARACTER_SLOT_BULK23 
PSCHARACTER_SLOT_BULK24 
PSCHARACTER_SLOT_BULK25 
PSCHARACTER_SLOT_BULK26 
PSCHARACTER_SLOT_BULK27 
PSCHARACTER_SLOT_BULK28 
PSCHARACTER_SLOT_BULK29 
PSCHARACTER_SLOT_BULK30 
PSCHARACTER_SLOT_BULK31 
PSCHARACTER_SLOT_BULK32 
PSCHARACTER_SLOT_BULK_END 

Definition at line 32 of file slots.h.

enum LOG_TYPES
Enumerator:
LOG_ANY 
LOG_WEATHER 
LOG_SPAWN 
LOG_CELPERSIST 
LOG_PAWS 
LOG_GROUP 
LOG_CHEAT 
LOG_LINMOVE 
LOG_SPELLS 
LOG_NEWCHAR 
LOG_SUPERCLIENT 
LOG_EXCHANGES 
LOG_ADMIN 
LOG_STARTUP 
LOG_CHARACTER 
LOG_CONNECTIONS 
LOG_CHAT 
LOG_NET 
LOG_LOAD 
LOG_NPC 
LOG_TRADE 
LOG_SOUND 
LOG_COMBAT 
LOG_SKILLXP 
LOG_QUESTS 
LOG_SCRIPT 
LOG_RELATIONSHIPS 
LOG_MESSAGES 
LOG_CACHE 
LOG_PETS 
LOG_USER 
LOG_LOOT 
LOG_MINIGAMES 
LOG_DRDATA 
LOG_ACTIONLOCATION 
LOG_ITEM 
LOG_HIRE 
MAX_FLAGS 

Definition at line 34 of file log.h.

enum MathType

possible types of variables.

Enumerator:
VARTYPE_VALUE 
VARTYPE_STR 
VARTYPE_OBJ 

Definition at line 258 of file mathscript.h.

enum SPELL_TYPE
Enumerator:
BUFF 
DEBUFF 

Definition at line 126 of file psconst.h.


Function Documentation

void CopyXMLNode ( iDocumentNode *  source,
iDocumentNode *  target,
int  mode 
)

Copies/merges children and attributes of 'source' to 'target'.

Mode : 0=clear target first (i.e. exact copy) 1=don't clear but overwrite those attributes in 'target' that are in 'source' 2=don't clear and don't overwrite existing attributes, add new only

void errorhalt ( const char *  function,
const char *  file,
int  line,
const char *  msg 
)
void errormsg ( const char *  function,
const char *  file,
int  line,
const char *  msg 
)
csString EscpXML ( const char *  str)

Escapes special XML characters in 'str'.

csString GetNodeXML ( iDocumentNode *  node,
bool  childrenOnly = false 
)

Generates XML representing given node.

If 'childrenOnly' is true, only XML of child nodes will be returned

void GetTimeOfDay ( csString &  string)

Get the time of day in GMT.

Parameters:
stringThe string to place the time of day.
csString& GetWordNumber ( const csString &  str,
int  number,
size_t *  startpos = NULL 
)

Return the given word number.

Return word at the position number in the input string str. If a pointer to startpos is given the position of the found word would be return.

Parameters:
strThe string that are to be search for the word
numberThe position of the the word to be found
startposA pointer that if non zero will get the position in the string where word where found.
Returns:
Return the word at position number in the string.
bool isFlagSet ( const psString flagstr,
const char *  flag 
)
MAKE_ID_TYPE ( EID  )

GEM Entity IDs.

MAKE_ID_TYPE ( PID  )

Player IDs.

MAKE_ID_TYPE ( AccountID  )

Account IDs.

csPtr<iDocument> ParseFile ( iObjectRegistry *  object_reg,
const csString &  name 
)

Loads and parses a XML file, then returns its parsed XML document.

csPtr<iDocument> ParseString ( const csString &  str,
bool  notify = true 
)

Parses a XML string, then returns the parsed document.

csPtr<iDocumentNode> ParseStringGetNode ( const csString &  str,
const csString &  topNodeName,
bool  notify = true 
)

Parses a XML string, then returns the top node with name 'topNodeName'.

const char* PS_GetFileName ( const char *  path)
bool psContain ( const csString &  str,
const csArray< csString > &  strs 
)
float psGetRandom ( )

Returns a random number.

Returns:
Returns a random number between 0.0 and 1.0.
uint32 psGetRandom ( uint32  limit)

Returns a random number with a limit.

Returns:
Returns a random number between 0 and limit.
void psprintf ( const char *  arg,
  ... 
)
bool psSentenceContain ( const csString &  sentence,
const csString &  word 
)
csArray<csString> psSplit ( const char *  str,
char  delimer 
)
csArray<csString> psSplit ( csString &  str,
char  delimer 
)
void Split ( const csString &  str,
csArray< csString > &  arr 
)

Split a csString into an array of sctrings.

csArray<csString> splitTextInLines ( csString  inText,
size_t  maxLineLength,
int maxRowLen 
)

Split text into multiple lines.

Used by chat bubbles

Parameters:
inTexttext to split
maxLineLengthmax length you want the rows to be created
maxRowLenthe resulting max length after the split
csString toString ( const csVector3 &  pos)
csString toString ( const csVector2 &  pos)
csString toString ( const csVector4 &  pos)
csString toString ( const csTransform &  trans)
csString toString ( const csVector3 &  pos,
iSector *  sector 
)
csString toString ( const csMatrix3 &  mat)

Variable Documentation

const COMMAND commands[]
FILE* errorLog