All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Files | Classes | Macros | Functions | Variables
Aion Subsystem

This is a collection of functions that deal with various aspects of the game. More...

Files

file  aion.h
 

Classes

struct  aion_player
 
struct  aion_group_iter
 

Macros

#define AION_NAME_DEFAULT   "You"
 
#define AION_NAME_FR_DEFAULT   "Vous"
 
#define AION_NAME_DE_DEFAULT   "Ihr"
 
#define AION_CHAT_SZ   CHATLOG_CHAT_SZ
 
#define AION_NAME_SZ   CHATLOG_NAME_SZ
 
#define AION_SYSOVR_FILE   "system.ovr"
 
#define AION_SYSOVR_CHATLOG   "g_chatlog"
 
#define AION_CLIPBOARD_MAX   255
 
#define AION_APLOOT_FORMAT_SHORT   "/ROLL (@ap AP):/ @name/" "/" "/ | INV FULL:/ @name/"
 
#define AION_APLOOT_FORMAT_MED   "/ROLL (@ap AP):/ @name/ | PASS/ @name/ | INV FULL:/ @name/"
 
#define AION_APLOOT_FORMAT_LONG   "/ROLL:/ @name[@ap]/ | PASS:/ @name[@ap]/ | INV FULL:/ @name/"
 
#define AION_APLOOT_FORMAT_DEFAULT   AION_APLOOT_FORMAT_SHORT
 
#define LANG_ELYOS   1
 
#define LANG_ASMODIAN   2
 
#define LANG_KRALL   3
 
#define LANG_MAU   4
 
#define LANG_BALAUR   5
 

Functions

 LIST_HEAD (aion_player_list, aion_player)
 
static void aion_player_init (struct aion_player *player, char *name)
 
static struct aion_playeraion_player_alloc (char *charname)
 
static struct aion_playeraion_group_find (char *charname)
 
static void aion_group_dump (void)
 
static void aion_group_iter_fill (struct aion_group_iter *iter, struct aion_player *player)
 
bool aion_init (void)
 
bool aion_clipboard_set (char *text)
 
bool aion_player_is_self (char *charname)
 
void aion_player_name_set (char *charname)
 
bool aion_player_chat_cache (char *charname, char *chat)
 
bool aion_player_chat_get (char *charname, int msgnum, char *dst, size_t dst_sz)
 
bool aion_group_join (char *charname)
 
bool aion_group_leave (char *charname)
 
void aion_group_disband (void)
 
void aion_group_loot (char *charname, uint32_t itemid)
 
bool aion_group_apvalue_update (char *charname, uint32_t apval)
 
bool aion_group_apvalue_set (char *charname, uint32_t apval)
 
void aion_apvalue_reset (void)
 
uint32_t aion_group_apvalue_lowest (void)
 
bool aion_invfull_set (char *charname, bool isfull)
 
bool aion_invfull_get (char *charname)
 
void aion_invfull_excl_set (bool enable)
 
bool aion_invfull_excl_get (void)
 
void aion_invfull_clear (void)
 
void aion_aplimit_set (uint32_t aplimit)
 
uint32_t aion_aplimit_get (void)
 
bool aion_aploot_stats (char *stats, size_t stats_sz)
 
bool aion_aploot_fmt_set (char *fmt)
 
bool aion_aploot_fmt_parse (char *fmt)
 
void aion_aploot_fmt_print (char *str, size_t strsz, char *name, uint32_t apval)
 
bool aion_aploot_rights (char *stats, size_t stats_sz)
 
void aion_group_first (struct aion_group_iter *iter)
 
void aion_group_next (struct aion_group_iter *iter)
 
bool aion_group_end (struct aion_group_iter *iter)
 
void aion_translate (char *txt, uint32_t language)
 
void aion_rtranslate (char *txt, uint32_t language)
 
char * aion_default_install_path (void)
 
bool aion_chatlog_is_enabled (bool *isenabled)
 
bool aion_chatlog_enable (void)
 

Variables

struct aion_player aion_player_self
 
struct aion_player_list aion_players_cached
 
struct aion_player_list aion_group
 
static bool aion_invfull_exclude = false
 
static uint32_t aion_ap_limit = 0
 
struct {
   char   roll_header [AION_CHAT_SZ]
 
   char   roll_list [AION_CHAT_SZ]
 
   char   pass_header [AION_CHAT_SZ]
 
   char   pass_list [AION_CHAT_SZ]
 
   char   invfull_header [AION_CHAT_SZ]
 
   char   invfull_list [AION_CHAT_SZ]
 
aion_aploot_format
 

Detailed Description

This is a collection of functions that deal with various aspects of the game.

Before you can use this sub-system, aion_init() must be called.

This module is responsible for:

Macro Definition Documentation

#define AION_APLOOT_FORMAT_DEFAULT   AION_APLOOT_FORMAT_SHORT

Default format

#define AION_APLOOT_FORMAT_LONG   "/ROLL:/ @name[@ap]/ | PASS:/ @name[@ap]/ | INV FULL:/ @name/"

Long format

#define AION_APLOOT_FORMAT_MED   "/ROLL (@ap AP):/ @name/ | PASS/ @name/ | INV FULL:/ @name/"

Medium aploot format, show pass list, without individual AP value

#define AION_APLOOT_FORMAT_SHORT   "/ROLL (@ap AP):/ @name/" "/" "/ | INV FULL:/ @name/"

Short aploot format, the multiple "" are a workaround for Doxygen madness

#define AION_CHAT_SZ   CHATLOG_CHAT_SZ

Maximum chat line size in bytes

#define AION_CLIPBOARD_MAX   255

This is the number characters that Aion allowts to be paste

#define AION_NAME_DE_DEFAULT   "Ihr"

Default German name

#define AION_NAME_DEFAULT   "You"

Default name for the player's character

#define AION_NAME_FR_DEFAULT   "Vous"

Default French name

#define AION_NAME_SZ   CHATLOG_NAME_SZ

Maximum character name size

#define AION_SYSOVR_CHATLOG   "g_chatlog"

Name of the chatlog variable in the system.ovr file

#define AION_SYSOVR_FILE   "system.ovr"

Name of the system.ovr file

#define LANG_ASMODIAN   2

Asmodian language ID, see aion_translate()

#define LANG_BALAUR   5

Not used, but it would be funny it was

#define LANG_ELYOS   1

Elyos language ID, see aion_translate()

#define LANG_KRALL   3

Not used

#define LANG_MAU   4

Not used

Function Documentation

uint32_t aion_aplimit_get ( void  )

Return the upper AP limit

Returns
The AP upper limit value.
See Also
aion_aplimit_set
void aion_aplimit_set ( uint32_t  aplimit)

Set the upper AP limit.

After the AP limit was reached the player will be excluded from the loot rotation. When all players reach the limit, the loot should be FFA.

Parameters
[in]aplimitThe upper limit of AP (0 means unlimited, default)
Note
This is a user requested feature, some players just prefer to add some randomness in their loots
bool aion_aploot_fmt_parse ( char *  fmt)

Parse the aploot format string and set the global structures to use it

This function accepts a aploot format string, parses it and initialies the aion_aploot_format structure.

The aploot format string is as follows:

/ROLL_HDR/ROLL_LIST/PASS_HDR/PASS_LIST/INVFULL_HDR/INVFULL_LIST/

This is how the aion_aploot_format members are initialized:

  • ROLL_HDR -> aion_aploot_format.roll_header
  • ROLL_LIST -> aion_aploot_format.roll_list
  • PASS_HDR -> aion_aploot_format.pass_header
  • PASS_LIST -> aion_aploot_format.pass_list
  • INVFULL_HDR -> aion_aploot_format.invfull_header
  • INVFULL_LIST -> aion_aploot_format.invfull_list
Parameters
[in]fmtAploot format
Return values
trueIf fmt was successfully parsed
falseIf fmt is invalid
void aion_aploot_fmt_print ( char *  str,
size_t  strsz,
char *  name,
uint32_t  apval 
)

Format the string str and replace the aploot keywords with real values

  • @ap is replaced with apval
  • @name is replaced with name
  • @/ is replaced with a "/"
Parameters
[in,out]strString that will be used to replace apooot keywords with real data
[in]strszSize of str
[in]namePlayer name, this will replace @name
[in]apvalAP value, this will replace @ap
bool aion_aploot_fmt_set ( char *  fmt)

Set the aploot format

The fmt parameter accepts several values:

  • "short" or "s"; this will use the AION_APLOOT_FORMAT_SHORT format
  • "default" or "d"; this will use the AION_APLOOT_FORMAT_DEFAULT format
  • "long" or "l"; this will use the AION_APLOOT_FORMAT_LONG format
  • "medium" or "m"; this will use the AION_APLOOT_FORMAT_MED format
  • Alternatively, if fmt starts with a '/' the user can define a custom format
Parameters
[in]fmtAploot format, descriptive
Return values
trueIf setting the format was successfull
falseIf fmt was invalid
bool aion_aploot_rights ( char *  stats,
size_t  stats_sz 
)

Get the current AP loot rights in text format.

Note
This is ued by ?aploot
Parameters
[out]statsStatistics character buffer
[in]stats_szMaximum size of the buffer
Return values
trueOn success
Bug:
This function never returns false, should it be void?
bool aion_aploot_stats ( char *  stats,
size_t  stats_sz 
)

Get statistics for the current group in text format.

Note
This is used for ?apstat
Parameters
[out]statsStatistics character buffer
[in]stats_szMaximum size of the buffer
Return values
trueOn success
Bug:
This function never returns false, should it be void?
void aion_apvalue_reset ( void  )

Reset the accumulated abyss points for all known characters including the player

Note
This function will update the application's main screen.
bool aion_chatlog_enable ( void  )

Enable the chatlog feature of the Aion game client

This function enables the chatlog feature of the Aion game client by writing "g_chatlog=1" in the system.ovr file. If system.ovr does not exist it is created, otherwise the string is appended at the end of the file.

Return values
trueIf chatlog was successfully enabled
falseIf an error occurred
bool aion_chatlog_is_enabled ( bool *  isenabled)

Check if the chatlog feature of the Aion game client is enabled.

Parameters
[out]isenabledTrue if the chatlog is enabled, false otherwise
Return values
trueOn success (this doesn't mean that the chatlog is enabled)
falseError, unable to verify if the chatlog is enabled.
bool aion_clipboard_set ( char *  text)

"paste" text to the clipboard, this is how we send data to the user via the game chat.

Parameters
[in]textText to copy to the clipboard
Returns
This function just forwards the error from clipboard_set_text()
char* aion_default_install_path ( void  )

Retrieve the Aion default installation path

If APME_AION_PATH is set, it is used as the default installation path for Aion. Otherwise the registry is scanned for known registry keys used by the game client.

Returns
Installation path or NULL on error.
uint32_t aion_group_apvalue_lowest ( void  )

Scan the current group list and find out the lowest amount of abyss points between the characters

Returns
The lowest value of Abyss Points
bool aion_group_apvalue_set ( char *  charname,
uint32_t  apval 
)

Set the accumulated abyss points for charname to a specific value

Parameters
[in]charnameCharacter name
[in]apvalAbyss points
Return values
trueOn success
falseIf the character was not found in the current group list
Note
This function will update the application's main screen.
bool aion_group_apvalue_update ( char *  charname,
uint32_t  apval 
)

Update the AP statistics for charname

Parameters
[in]charnameCharacter name
[in]apvalAbyss points
Return values
trueOn success
falseIf the character was not found in the current group list
Note
This function will update the application's main screen.
void aion_group_disband ( void  )

Disband the group.

This function removes all characters from the current group list, except the player itself.

void aion_group_dump ( void  )
static

Debug function that dumps the current group info to the console

bool aion_group_end ( struct aion_group_iter iter)

Checks if the current iterator reached end of the list

param[in] iter Group iterator

Return values
trueIf end of list was reached
falseIf end of list not reached yet
struct aion_player * aion_group_find ( char *  charname)
static

Search the current group for a character with the name of charname

Parameters
[in]charnameCharacter name
Returns
Returns the associated aion_player structure or NULL if charname was not found in the current group list.
void aion_group_first ( struct aion_group_iter iter)

Group iterator initializer. This function must be called before any other iterator functions.

The iterator functions traverse the group list and fill the itertator with data accordingly. The aion_player structure is not exposed outside this module.

Parameters
[in,out]iterGroup iterator

Example code:

struct aion_group_iter iter;
for (aion_group_first(&iter); !aion_group_end(&iter); aion_group_next(&iter))
{
printf("%s %d %s\n", iter.agi_name, iter.agi_apvalue, iter.agi_invfull ? "INVFULL" : "");
}
See Also
aion_group_next
aion_group_end
void aion_group_iter_fill ( struct aion_group_iter iter,
struct aion_player player 
)
static

Initialize a aion_group_iter structure from an aion_player structure

This is used for iterating the current group

Parameters
[out]iteraion_group_iter structure that will be filled with data from player
[in]playeraion_player structure that will be used to fill the iter structure
See Also
aion_group_first
aion_group_next
aion_group_end
bool aion_group_join ( char *  charname)

Add the character with charname to the current group list.

If the character is already on the list, do nothing.

Parameters
[in]charnameCharacter name
Return values
trueOn success
falseOn error
bool aion_group_leave ( char *  charname)

Remove the character charname from the group list.

If charname is the player itself, disband the group – we're alone again :(

Parameters
[in]charnameCharacter name
Return values
trueOn success
falseOn error
Bug:
Always returns true?
void aion_group_loot ( char *  charname,
uint32_t  itemid 
)

Process group/alliance item loot

If the item looted is an AP relic, update AP statistics for the player charname

If the player acuqired the item it also means it has room in the inventory, therefore we should clear the inventory full flag.

Note
This function will also update the application main screen.
Parameters
[in]charnameThe player that looted the item
[in]itemidThe itemID as parsed from the chatlog
void aion_group_next ( struct aion_group_iter iter)

Move to the next character in the group

iter should be initialized with aion_group_first()

Parameters
[in,out]iterCurrent/Next player data
See Also
aion_group_first
aion_group_end
bool aion_init ( void  )

Initialize the AION sub-system. This must be called before any other functions

Return values
trueon error
falseon error
void aion_invfull_clear ( void  )

Clear the "inventory full" flag for all players

Note
This will update the application's main screen.
bool aion_invfull_excl_get ( void  )

Rerurn the status of the "inventory full" exclude policy:

Return values
trueIf exclude policy enabled
falseIf exclude policy disabled (default)
See Also
aion_invfull_excl_set
void aion_invfull_excl_set ( bool  enable)

Enable or disable enforcment of "inventory full" exclude policy

Parameters
[in]enableTrue if clean inventory should be enforced, otherwise false
Note
The default behavior is "false"
See Also
aion_invfull_excl_get
bool aion_invfull_get ( char *  charname)

Get the inventory full flag for charname

Parameters
[in]charnameCharacter name
Return values
trueIf inventory full flag is set
falseIf inventory flag not set or error
Bug:
Inventory not full and error both return false and is not possible to differentiate between the two.
bool aion_invfull_set ( char *  charname,
bool  isfull 
)

Set the intentory full flag for charname

Parameters
[in]charnameCharacter name
[in]isfullFull inventory flag
Return values
trueOn success
falseIf the character was not found in the current group list
Note
This function will update the application's main screen.
struct aion_player * aion_player_alloc ( char *  charname)
static

Allocate a aion_player structure.

If a player with charname alraedy exists in the cached list, move the structure to the head of the list and return it.

If not, allocate a new structure, register it on the head of the cached list and return it.

Parameters
[in]charnamePlayer name
Returns
Always returns a valid aion_player structure
bool aion_player_chat_cache ( char *  charname,
char *  chat 
)

Cache a chat line from character charname

Parameters
[in]charnameCharacter name
[in]chatChat line
Returns
Returns false on error, but that shouldn't happen.
bool aion_player_chat_get ( char *  charname,
int  msgnum,
char *  dst,
size_t  dst_sz 
)

Retrieve a previously cached chat line for character charname

Parameters
[in]charnameCharacter name
[in]msgnumChat line number in reverse order (0 = most recent, 1 second most recent)
[out]dstDestination buffer
[out]dst_szSize of the destinatin buffer
Return values
trueOn success
falseOn error
void aion_player_init ( struct aion_player player,
char *  charname 
)
static

Initialize a aion_player structure with default values

Parameters
[in]charnamePlayer name
[out]playerThe aion_player structure
bool aion_player_is_self ( char *  charname)

Test if the given charname is ourselves, the player.

If charname is NULL, "You" or Player's name, then we're dealing with ourselves

Parameters
[in]charnameCharacter name
Return values
trueIf charname is the player
falseIf charname is not the current palyer
void aion_player_name_set ( char *  charname)

Set the current player name

Parameters
[in]charnamePlayer name
void aion_rtranslate ( char *  txt,
uint32_t  langid 
)

Reverse translator. This uses the translation formula to reverse a translated a text back to normal language.

This function does the opposite of aion_translate().

Note
This is used by the ?relyos and ?rasmo commands
Parameters
[in,out]txtInput/Output text to translate
[in]langidLanguage ID. Either LANG_ASMODIAN or LANG_ELYOS
See Also
aion_translate()
void aion_translate ( char *  txt,
uint32_t  langid 
)

Translate text to a language. Currently only the Asmodian and Elyos language are supported. If somebody wants to add support for Mau or Krall, feel free to send patches :P

Supported language IDs:

  • LANG_ASMODIAN
  • LANG_ELYOS
Note
This is used by the ?relyos and ?rasmo commands
Parameters
[in,out]txtInput/Output text
[in]langidLanguage ID
See Also
aion_rtranslate()
LIST_HEAD ( aion_player_list  ,
aion_player   
)

Create the definition of the HEAD structure for the linked list of aion_player structures

Variable Documentation

uint32_t aion_ap_limit = 0
static

Maximum AP a palyer may accumulate before it is free-for-all. 0 means there's no limit.

See Also
aion_aplimit_set
aion_aplimit_get
struct { ... } aion_aploot_format

The aploot format

struct aion_player_list aion_group

List of players in the current group. This list cannot be empty so it is assumed that the players itself is always on this list

bool aion_invfull_exclude = false
static

If true, exclude the player if it has full invenvtory from the AP fair system. This is confusing for some palyers so it is turned OFF by default.

struct aion_player aion_player_self

This is us, the player!

struct aion_player_list aion_players_cached

Cached list of players, mainly used for chat history