* [Repositories] Cleanup and Convert Character Creation to Repositories
# Notes
- Converts `Database::GetCharacterID()`, `Database::SaveCharacterCreate()`, and `Client::OPCharCreate` to repositories.
- Cleanup a spot we were doing a queries in a loop.
* Cleanup
* Update database.cpp
* Update database.cpp
# Notes
- Add `eq.cast_spell(spell_id)` and `eq.self_cast(spell_id)` to Lua.
- Lua did not have a `quest::castspell(spell_id)` or `quest::selfcast(spell_id)` equivalent, so this adds them.
* [Bots] Cleanup empty `bot_commands` files
# Notes
- These files were part of the conversion of bot commands to individual files, these commands are part of overarching commands and therefore do not have their own files.
- These were not removed when initially committed.
* Update bot_command.cpp
* Update bot_command.cpp
This adds an error msg handler for lua calls to add a stack trace to
error messages. Lua 5.1 does not have luaL_traceback like luajit and lua
5.2+ so debug.traceback() is used directly as the msg handler.
The traceback will add more detail to errors than just logging package
and event names. Exceptions in C++ binds and luabind errors will now
show script context instead of just the error message.
e.g., for a luabind overload error:
No matching overload found, candidates:
void signal(int,int,int)
void signal(int,int)
stack traceback:
[C]: in function 'signal'
quests/arena/player.lua:10: in function 'somefn'
quests/arena/player.lua:27: in function <quests/arena/player.lua:17>
# Perl
- Add `$client->IsInAGuild()`.
# Lua
- Add `client:IsInAGuild()`.
# Notes
- Allows operators to more accurately tell if a player is in a group.
- `GuildID()` returns `uint32` max value if the player isn't in a guild so conditions using it must check for a value over a certain point, this is just a bool that simplifies that logic.
* [Bots] Remove Alt Combat Functionality
# Notes
- This functionality needlessly complicates bot targeting logic and causes crashes and unintended behavior for players when accidentally enabled or enabled by default.
* Cleanup
* [Database] Fix default value for `time_of_death` in `character_corpses`
* Extra `NULL`
* Update repository
* Repositories with updated structure this time
* [Feature] Add additional Guild Features
This adds the following guild features and design pattern
- the existing guild system was used
- guild features are based on RoF2 within source with translaters used to converted between client differences
- backward compatible with Ti and UF, and allows for mixed client servers
- Guild Back for Ti and UF is based on RoF2 Permissions for banking if Guild Leader does not use Ti/UF
- Guild Ranks and Permissions are enabled.
- Guild Tributes are enabled.
- Event logging via rules for donating tribute items and plat
- Rules to limit Guild Tributes based on max level of server
- Rewrote guild communications to client using specific opcodes
-- Server no longer sends a guild member list on each zone
-- Guild window is updated when a member levels, rank changes, zone changes, banker/alt status using individual opcodes
-- When a member is removed or added to a guild, a single opcode is sent to each guild member
-- This reduces network traffic considerably
Known issues:
- Visual bug only. Guild Tributes window will display a 0 for level if tribute is above max level rule setting.
- Visual bug only. Guild Mgmt Window will not display an online member if the player has 'show offline' unchecked and a guild member zones within the Notes/Tribute tab. This is resolved by selecting and de-selecting the 'Show Offline' checkbox.
* Updated RoF2 Guild Comms
Updated RoF2 Guild Comms
Update RoF2 Opcodes
Rewrote RoF2 Guild Communications using specific opcodes.
Added database changes - they are irreversible
* Formatting
* Update base_guild_members_repository.h
* Format GuildInfo
* Format GuildAction enum
* Formatting in clientlist
* quantity vs quantity
* desc vs description
* Format structs
* Inline struct values
* Formatting
* Formatting
* Formatting fixes
* Formatting items
* Formatting
* Formatting
* struct formatting updates
* Updated formatting
* Updated
- std:string items
- naming conventions
- magic numbers
* Repo refactors
Other formatting updates
* Remove test guild commands
* Updated #guild info command
* Add new repo methods for Neckolla ReplaceOne and ReplaceMany
* Fix guild_tributes repo
* Update database_update_manifest.cpp
* Phase 1 of final testing with RoF2 -> RoF2.
Next phase will be inter compatibility review
* Remove #guild testing commands
* Fix uf translator error
Rewrite LoadGuilds
* Use extended repository
* FIx guild window on member add
* LoadGuild Changes
* Update guild_base.cpp
* Few small fixes for display issue with UF
* Update guild_base.cpp
* Update guild_members_repository.h
* Update zoneserver.cpp
* Update guild.cpp
* Update entity.h
* Switch formatting
* Formatting
* Update worldserver.cpp
* Switch formatting
* Formatting switch statement
* Update guild.cpp
* Formatting in guild_base
* We don't need to validate m_db everywhere
* More formatting / spacing issues
* Switch format
* Update guild_base.cpp
* Fix an UF issue displaying incorrect guildtag as <>
* Updated several constants, fixed a few issues with Ti/UF and guild tributes not being removed or sent when a member is removed/disbands from a guild.
* Formatting and logging updates
* Fix for Loadguilds and permissions after repo updates.
* Cleanup unnecessary m_db checks
* Updated logging to use player_event_logs
* Updated to use the single opcodes for guild traffic for Ti/UF/RoF2. Several enhancements for guild functionality for more reusable code and readability.
* Update to fix Demote Self and guild invites declining when option set to not accept guild invites
* Potential fix for guild notes/tribute display issues when client has 'Show Offline' unchecked.
* Updates to fox recent master changes
Updates to fix recent master changes
* Updates in response to comments
* Further Updates in response to comments
* Comment updates and refactor for SendAppearance functions
* Comment updates
* Update client spawn process for show guild name
Add show guild tag to default spawn process
* Update to use zone spawn packets for RoF2
Removed several unused functions as a result
Updated MemberRankUpdate to properly update guild_show on rank change.
Updated OP_GuildURLAndChannel opcode for UF/RoF2
* Cleanup of world changes
Created function for repetitive zonelist sendpackets to only booted zones
Re-Inserted accidental delete of scanclosemobs
* Fixes
* Further world cleanup
* Fix a few test guild bank cases for backward compat
Removed a duplicate db call
Fixed a fallthrough issue
* Update guild_mgr.cpp
* Cleanup
---------
Co-authored-by: Akkadius <akkadius1@gmail.com>
If a task was deleted or had new elements added to it without updating
character states to match changes, client state for the task was not
loaded into memory and a "contact a GM" warning was sent to the client.
This caused an issue if a client later accepted a new task because it
could be placed in the same client state slot as a non-loaded task. The
table does not have constraints so this was also inserted into the db.
The next time client task state was reloaded after zoning, the new task
would not be loaded since it occupied a used slot, even though that used
slot was also not being loaded. The client could not remove or reacquire
the original task without GM intervention and an entry was left in the
db for the new task.
This makes the following changes to client task state loading:
- If a task id no longer exists it is deleted from client state tables
instead of only being removed from memory.
- If a task occupies the same client state slot as another task, it is
deleted from client state tables instead of being ignored.
- If new elements have been added to a task, client state will keep the
task in memory. The new activity states will be inserted into the db
when necessary for updates (may not be immediate).
These changes also fix two smaller bugs as a consequence:
- If a character was at the 20 quest limit the last quest wasn't being
processed for activity count changes. The task would continue to show
to clients but any added new elements couldn't be completed.
- Deleted tasks that occupied slot 0 in client state would fallback to
loading it as a solo task of type 0. This prevented a client's real
solo task from being loaded if the deleted task was processed first.
Note clients may receive or lose credit for completed elements if new
ones are added in the middle of tasks. Server ops will still need to
update character state tables manually on task changes to prevent this.
Only the first element was being serialized to show the start zone of
tasks. This was resulting in a blank description for tasks that only
have element descriptions.
Live sends all initial active elements for the task when sending this
packet. Any bracket text with these elements as a requirement will be
appended to the description.
* DRAFT - Classic Taunt (Pre 2006) style of taunt
RULE: ClassicTauntSystem
Completely seperate logic for each system. Could potentially be re-writte to be more inline but there are a good bit of minor differences.
* Consolidate Logic
Still needs in-game testing
* Feedback Request
* Updates per feedback
# Corpse Overhaul
Changelog:
- Player corpses now have two timers, one specific to the rezability of the corpse and the other to cover the overall rot timer of the player corpse.
- The rezability timer is based on the online presence of the player/account and is not affected by being offline.
- The rot timer is not affected by offline/online status and will count to the rot status of the corpse.
- Corpses can be rezzed multiple times, however only the first rez that yeilds returned xp will be counted. Not other rez will return any xp. This allows for a "Poor mans COTH" as was used many times in the early eras.
- All Corpse class private/protected member variables are all now prefixed with m_
- Added Corpses logging category along with many debug logs
- Removed LoadCharacterCorpseData
- Removed LoadCharacterCorpseEntity
- Added LoadCharacterCorpse(const CharacterCorpsesRepository::CharacterCorpses, const glm::vec4 &position) which simplifies areas of consumption and reduces double queries from removing LoadCharacterCorpseData and replacing LoadCharacterCorpseEntity
- All parameters that were prefixed with in_ have been dropped
- Removed two queries from CheckIsOwnerOnline and have it query the world's CLE by account_id since that is how live works
- Regenerated repository character_corpses
- Cleaned up many list iterators to use range based for loops
- Rate limit Corpse::Process m_is_rezzable with a 1 second check timer
- General code cleanup
- Added a Server Up check to bury all corpses in instances to prevent lost corpses if an instance is released during server down. This facilitates player recovery via shadowrest or priests of luclin.
This PR also now fixes a long standing issue with HasItem performance in our script plugins. It is significantly faster, we will need to coordinate quest changes and comms with operators.
```lua
if ($client->HasItemOnCorpse($item_id)) {
return 1;
}
```
```lua
--corpse
if self:HasItemOnCorpse(itemid) then
return true
end
```
Testing Completed:
- Create a Corpse
- Standard rezzing
- Ghetto Coth (No Extra XP)
- Rezzing after graveyard move
- Divine Rez works as intended
- No XP Rez (Corpse Call) does not give XP
- Corpse Burying
- Cross Instance Graveyard Corpse movement/Rezzing
- DZ End/Quit Corpse Movement/Rezzing
- Server Shutdown/Reinit DZ Corpse Movement/Rezzing
---------
Co-authored-by: Akkadius <akkadius1@gmail.com>