This is a collection of functions that deal with various aspects of the game.
More...
|
| LIST_HEAD (aion_player_list, aion_player) |
|
static void | aion_player_init (struct aion_player *player, char *name) |
|
static struct aion_player * | aion_player_alloc (char *charname) |
|
static struct aion_player * | aion_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) |
|
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:
- Tracking of group members
- Processing looted items
- Updating AP statistics
- The language translator
- Probably lots more
#define AION_APLOOT_FORMAT_LONG "/ROLL:/ @name[@ap]/ | PASS:/ @name[@ap]/ | INV FULL:/ @name/" |
#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" |
#define AION_NAME_DEFAULT "You" |
Default name for the player's character
#define AION_NAME_FR_DEFAULT "Vous" |
#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
Not used, but it would be funny it was
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] | aplimit | The 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
-
- Return values
-
true | If fmt was successfully parsed |
false | If 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] | str | String that will be used to replace apooot keywords with real data |
[in] | strsz | Size of str |
[in] | name | Player name, this will replace @name |
[in] | apval | AP 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] | fmt | Aploot format, descriptive |
- Return values
-
true | If setting the format was successfull |
false | If 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] | stats | Statistics character buffer |
[in] | stats_sz | Maximum size of the buffer |
- Return values
-
- 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] | stats | Statistics character buffer |
[in] | stats_sz | Maximum size of the buffer |
- Return values
-
- 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
-
true | If chatlog was successfully enabled |
false | If an error occurred |
bool aion_chatlog_is_enabled |
( |
bool * |
isenabled) | |
|
Check if the chatlog feature of the Aion game client is enabled.
- Parameters
-
[out] | isenabled | True if the chatlog is enabled, false otherwise |
- Return values
-
true | On success (this doesn't mean that the chatlog is enabled) |
false | Error, 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] | text | Text 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] | charname | Character name |
[in] | apval | Abyss points |
- Return values
-
true | On success |
false | If 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] | charname | Character name |
[in] | apval | Abyss points |
- Return values
-
true | On success |
false | If 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
Checks if the current iterator reached end of the list
param[in] iter Group iterator
- Return values
-
true | If end of list was reached |
false | If 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] | charname | Character name |
- Returns
- Returns the associated aion_player structure or NULL if
charname
was not found in the current group list.
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] | iter | Group iterator |
Example code:
{
printf("%s %d %s\n", iter.agi_name, iter.agi_apvalue, iter.agi_invfull ? "INVFULL" : "");
}
- See Also
- 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] | charname | Character name |
- Return values
-
true | On success |
false | On 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] | charname | Character name |
- Return values
-
true | On success |
false | On 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] | charname | The player that looted the item |
[in] | itemid | The itemID as parsed from the chatlog |
Initialize the AION sub-system. This must be called before any other functions
- Return values
-
true | on error |
false | on 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
-
true | If exclude policy enabled |
false | If 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] | enable | True 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] | charname | Character name |
- Return values
-
true | If inventory full flag is set |
false | If 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] | charname | Character name |
[in] | isfull | Full inventory flag |
- Return values
-
true | On success |
false | If 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
-
- 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] | charname | Character name |
[in] | chat | Chat 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] | charname | Character name |
[in] | msgnum | Chat line number in reverse order (0 = most recent, 1 second most recent) |
[out] | dst | Destination buffer |
[out] | dst_sz | Size of the destinatin buffer |
- Return values
-
true | On success |
false | On error |
void aion_player_init |
( |
struct aion_player * |
player, |
|
|
char * |
charname |
|
) |
| |
|
static |
Initialize a aion_player
structure with default values
- Parameters
-
[in] | charname | Player name |
[out] | player | The 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] | charname | Character name |
- Return values
-
true | If charname is the player |
false | If charname is not the current palyer |
void aion_player_name_set |
( |
char * |
charname) | |
|
Set the current player name
- Parameters
-
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] | txt | Input/Output text to translate |
[in] | langid | Language 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:
- Note
- This is used by the ?relyos and ?rasmo commands
- Parameters
-
[in,out] | txt | Input/Output text |
[in] | langid | Language ID |
- See Also
- aion_rtranslate()
Create the definition of the HEAD structure for the linked list of aion_player structures
uint32_t aion_ap_limit = 0 |
|
static |
struct { ... } aion_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_list aion_players_cached |
Cached list of players, mainly used for chat history