Back to legacygamers.net
WARPGATE

Attendance

CCheckAttendanceMgr, CAdventureGuideMgr

Functions 23Code 4 KBAddresses 0x00663470 to 0x00671A20Group Systems
23 functions
AddressSizeNameDescription
0x00663470334CAdventureGuideMgr__lua_callback_validateCAdventureGuideMgr Lua callback validator. Calls Lua function by name, expects (boolean, string) return. If boolean is false, shows MessageBox with the string as error. Returns 1 on success, 0 on failure. Uses 'CAdventureGuideMgr' as MessageBox caption.
0x00670B70123CCheckAttendanceMgr__destroy_tree_nodes_recursiveRecursively destroys RB-tree nodes. Traverses left and right children, resets each node's vtable pointer to PTR__scalar_deleting_destructor, then frees the 0x20-byte node. Stops at sentinel nodes (is_nil flag set).
0x00670BF075CCheckAttendanceMgr__rbtree_lower_boundPerforms lower_bound search in the achievement RB-tree. Traverses from root, comparing keys. Returns a result struct with the found node pointer, comparison flag, and parent/bound pointers for potential insertion.
0x00670C40146CCheckAttendanceMgr__ctorConstructor for CAchievementMgr. Sets vtable, initializes fields (count=0, stride=0, total=0, initialized flag=0), allocates a 0x20-byte RB-tree sentinel node with self-referencing pointers and is_nil flags set.
0x00670CE067CCheckAttendanceMgr__free_sentinelFrees the RB-tree sentinel node (at this+4) if it's not NULL. Frees 0x20 bytes.
0x00670D3076CCheckAttendanceMgr__destroy_treeDestroys the full RB-tree. Recursively destroys all child nodes via destroy_tree_nodes_recursive, then frees the sentinel/header node (0x20 bytes).
0x00670D90111CCheckAttendanceMgr__reset_and_free_sentinelResets the vtable pointer on a tree node to PTR__scalar_deleting_destructor, then frees the sentinel node (0x20 bytes) if non-null.
0x00670E0078CCheckAttendanceMgr__free_sentinel_simpleSimple sentinel node free. Frees the 0x20-byte node at this+4 if non-null. Simpler version without vtable reset.
0x00670E5087CCheckAttendanceMgr__destroy_tree_and_sentinelDestroys RB-tree and frees sentinel. Recursively destroys all child nodes via destroy_tree_nodes_recursive, then frees the 0x20-byte sentinel/header node.
0x00670EB067CCheckAttendanceMgr__set_node_vtableSets the vtable pointer on a tree node (at this+4 offset 0x14) to PTR__scalar_deleting_destructor. Used during tree node initialization or cleanup.
0x00670F00108CCheckAttendanceMgr__dtorCCheckAttendanceMgr destructor. Sets vtable, recursively destroys rbtree nodes, frees sentinel node.
0x00670F80133CCheckAttendanceMgr__scalar_deleting_dtorCCheckAttendanceMgr scalar deleting destructor. Calls dtor logic then optionally frees the 0x18-byte object.
0x00671040266CCheckAttendanceMgr__get_or_create_singletonSingleton accessor for CCheckAttendanceMgr (stored in DAT_0138cf38). Creates instance if null, initializes rbtree sentinel, then loads Lua config via load_lua_config. Returns 1 on success, 0 on failure.
0x0067115027CCheckAttendanceMgr__destroy_singletonDestroys CCheckAttendanceMgr singleton (DAT_0138cf38). Calls virtual destructor then sets pointer to null.
0x0067117094CCheckAttendanceMgr__find_config_by_keyLooks up attendance config by integer key in the rbtree. Uses rbtree_lower_bound, returns the 8-byte value pair at offset +0x18/+0x1c if found, or zeroes if not.
0x006711E028CCheckAttendanceMgr__is_key_in_rangeChecks if param_2 is within the range [this+8, this+0xc]. Returns 1 if in range, 0 otherwise. Used to validate attendance day/key bounds.
0x00671200422CCheckAttendanceMgr__load_lua_configLoads attendance config from Lua. Creates CLuaHost, registers InsertCheckAttendanceConfig and InsertCheckAttendanceReward callbacks, loads System_CheckAttendance.lub, calls main(). Shows MessageBox on error. Returns 1 on success.
0x006713B0543CCheckAttendanceMgr__reload_lua_configReloads attendance config for a specific .lub file (path from string param). Clears existing rbtree data first, then loads the specified Lua file with InsertCheckAttendanceConfig/InsertCheckAttendanceReward callbacks. Shows MessageBox on error.
0x006715D013CCheckAttendanceMgr__set_max_reward_countSets max reward count field at this+0xc.
0x006715E0349CCheckAttendanceMgr__insert_reward_entryInserts a reward entry into the attendance rbtree. Key is param_2, value is (param_3, param_4). Uses rbtree_lower_bound to check for existing key; if not found, allocates a 0x20-byte node and inserts via Insert_node.
0x0067174013CCheckAttendanceMgr__set_start_daySets the start day field at this+8.
0x00671960184CCheckAttendanceMgr__lua_insert_configLua callback for InsertCheckAttendanceConfig. Takes 2 numeric args from Lua stack: start day and max reward count. Stores them in the singleton at offsets +8 and +0xc. Returns (true, "OK") or (false, error_msg).
0x00671A20710CCheckAttendanceMgr__lua_insert_rewardLua callback for InsertCheckAttendanceReward. Takes 3 args: day (number), check type (string), reward item ID (number). Validates args, inserts into singleton rbtree via insert_reward_entry. Returns (true, "OK") or (false, error_msg).