mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-25 19:22:27 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d6bdaa5c6e | |||
| 593127fb7e |
-276
@@ -1,279 +1,3 @@
|
||||
## [22.9.1] - 04/03/2023
|
||||
|
||||
### Code
|
||||
|
||||
* Add client pointer validation to Zone::GetClosestZonePoint() ([#3173](https://github.com/EQEmu/Server/pull/3173)) @Kinglykrab 2023-04-01
|
||||
* Change level to bot_level in Bot::DoClassAttacks() to not overlap member variable ([#3239](https://github.com/EQEmu/Server/pull/3239)) @Kinglykrab 2023-04-03
|
||||
* Cleanup unnecessary string -> char* -> string conversions in eqemu_config.cpp ([#3207](https://github.com/EQEmu/Server/pull/3207)) @Kinglykrab 2023-04-03
|
||||
* Cleanup uses of insert/push_back when a temp object is used. ([#3170](https://github.com/EQEmu/Server/pull/3170)) @Aeadoin 2023-04-03
|
||||
* Cleanup variable names in Bot::AddSpellToBotList() ([#3248](https://github.com/EQEmu/Server/pull/3248)) @Kinglykrab 2023-04-03
|
||||
* Explicitly cast to float for more precision in Bot::GenerateBastHitPoints() ([#3238](https://github.com/EQEmu/Server/pull/3238)) @Kinglykrab 2023-04-03
|
||||
* Fix SEResist array settings duplicate code ([#3225](https://github.com/EQEmu/Server/pull/3225)) @Kinglykrab 2023-04-03
|
||||
* Fix loop and code duplication for SE_ProcOnKillShot ([#3224](https://github.com/EQEmu/Server/pull/3224)) @Kinglykrab 2023-04-03
|
||||
* Fix possible dereferencing of invalid iterator in constants ([#3181](https://github.com/EQEmu/Server/pull/3181)) @Kinglykrab 2023-04-03
|
||||
* Fix typo where itembonuses should have been used instead of spellbonuses ([#3221](https://github.com/EQEmu/Server/pull/3221)) @Kinglykrab 2023-04-03
|
||||
* Further bot.cpp nullptr checks ([#3240](https://github.com/EQEmu/Server/pull/3240)) @Kinglykrab 2023-04-03
|
||||
* Move cases in Bot::AICastSpell() ([#3247](https://github.com/EQEmu/Server/pull/3247)) @Kinglykrab 2023-04-03
|
||||
* Multiple cases same outcome and set skip variable to same value ([#3216](https://github.com/EQEmu/Server/pull/3216)) @Kinglykrab 2023-04-03
|
||||
* Multiple cases with same outcome in GetGMSayColorFromCategory() ([#3182](https://github.com/EQEmu/Server/pull/3182)) @Kinglykrab 2023-04-03
|
||||
* Remove extraneous loottable_id setting in WakeTheDead in aa.cpp ([#3215](https://github.com/EQEmu/Server/pull/3215)) @Kinglykrab 2023-04-03
|
||||
* Remove possible dereferenced nullptrs in bot.cpp ([#3241](https://github.com/EQEmu/Server/pull/3241)) @Kinglykrab 2023-04-03
|
||||
* Remove unnecessary >= 0 checks for procs in botspellsai.cpp ([#3242](https://github.com/EQEmu/Server/pull/3242)) @Kinglykrab 2023-04-03
|
||||
* Remove unnecessary botCaster check in Bot::GetDebuffBotSpell() ([#3246](https://github.com/EQEmu/Server/pull/3246)) @Kinglykrab 2023-04-03
|
||||
* Remove unnecessary group validation in Bot::Death() ([#3235](https://github.com/EQEmu/Server/pull/3235)) @Kinglykrab 2023-04-03
|
||||
* Remove unnecessary hpr checks in Bot::BotCastHeal() ([#3245](https://github.com/EQEmu/Server/pull/3245)) @Kinglykrab 2023-04-03
|
||||
* Remove unnecessary setting of spell_type_index in Bot::GetChanceToCastBySpellType() ([#3243](https://github.com/EQEmu/Server/pull/3243)) @Kinglykrab 2023-04-03
|
||||
* Remove unnecessary skill_to_use check in Bot::DoClassAttacks() ([#3236](https://github.com/EQEmu/Server/pull/3236)) @Kinglykrab 2023-04-03
|
||||
* Remove unnecessary spell_list validation check in botspellsai.cpp ([#3244](https://github.com/EQEmu/Server/pull/3244)) @Kinglykrab 2023-04-03
|
||||
* Remove unnecessary validation check in Zone::ClearBlockedSpells() ([#3172](https://github.com/EQEmu/Server/pull/3172)) @Kinglykrab 2023-04-01
|
||||
* Remove unused Includes under zone files ([#3162](https://github.com/EQEmu/Server/pull/3162)) @Aeadoin 2023-04-02
|
||||
* Remove unused query variable in Database::DeleteInstance() ([#3202](https://github.com/EQEmu/Server/pull/3202)) @Kinglykrab 2023-04-03
|
||||
* Unconditional return in for loop in GetRaidByCharID() ([#3179](https://github.com/EQEmu/Server/pull/3179)) @Kinglykrab 2023-04-03
|
||||
* Use a constant reference for content_flags in SetContentFlags() ([#3196](https://github.com/EQEmu/Server/pull/3196)) @Kinglykrab 2023-04-03
|
||||
* Wake The Dead argument was named the same as a member variable in Mob ([#3214](https://github.com/EQEmu/Server/pull/3214)) @Kinglykrab 2023-04-03
|
||||
* gid is assigned 2 values simultaneously in bot.cpp ([#3234](https://github.com/EQEmu/Server/pull/3234)) @Kinglykrab 2023-04-03
|
||||
* summon_count > MAX_SWARM_PETS is always false in aa.cpp ([#3212](https://github.com/EQEmu/Server/pull/3212)) @Kinglykrab 2023-04-03
|
||||
|
||||
### Fixes
|
||||
|
||||
* Correct Forward Declaration compilation warning ([#3176](https://github.com/EQEmu/Server/pull/3176)) @Aeadoin 2023-04-02
|
||||
* Fix issue with Bot Raid invites not working. ([#3249](https://github.com/EQEmu/Server/pull/3249)) @Aeadoin 2023-04-03
|
||||
|
||||
### Performance
|
||||
|
||||
* Change to use Pass by reference where valid. ([#3163](https://github.com/EQEmu/Server/pull/3163)) @Aeadoin 2023-04-02
|
||||
|
||||
## [22.9.0] - 04/01/2023
|
||||
|
||||
### Bots
|
||||
|
||||
* Remove Bot Groups Functionality ([#3165](https://github.com/EQEmu/Server/pull/3165)) @Aeadoin 2023-04-01
|
||||
|
||||
### Code
|
||||
|
||||
* Cleanup excessive type casting: string -> char * -> string ([#3169](https://github.com/EQEmu/Server/pull/3169)) @Aeadoin 2023-04-01
|
||||
|
||||
### Crash
|
||||
|
||||
* Add Checks for valid pointers or fix existing. ([#3164](https://github.com/EQEmu/Server/pull/3164)) @Aeadoin 2023-04-01
|
||||
* Fix out of bound arrays, other potential crashes ([#3166](https://github.com/EQEmu/Server/pull/3166)) @Aeadoin 2023-04-01
|
||||
|
||||
### Fixes
|
||||
|
||||
* Correct SE_SlayUndead & SE_HeadShotLevel limit Value when applied. ([#3171](https://github.com/EQEmu/Server/pull/3171)) @Aeadoin 2023-04-01
|
||||
* Prevent VerifyGroup from setting OOZ membername to Null character. ([#3168](https://github.com/EQEmu/Server/pull/3168)) @Aeadoin 2023-04-01
|
||||
|
||||
### Quest API
|
||||
|
||||
* Add missing Luabind definitions to lua_general.cpp ([#3167](https://github.com/EQEmu/Server/pull/3167)) @Kinglykrab 2023-04-01
|
||||
|
||||
## [22.8.2] - 03/30/2023
|
||||
|
||||
### Code
|
||||
|
||||
* "equipped" not "equiped", "dual" not "duel". ([#3149](https://github.com/EQEmu/Server/pull/3149)) @Kinglykrab 2023-03-27
|
||||
|
||||
### Crash
|
||||
|
||||
* Add Checks for out of bounds & dereferencing nullptrs ([#3151](https://github.com/EQEmu/Server/pull/3151)) @Aeadoin 2023-03-28
|
||||
|
||||
### Fixes
|
||||
|
||||
* Check Rule "Bots Enabled" to prevent bot database calls on connect ([#3154](https://github.com/EQEmu/Server/pull/3154)) @Aeadoin 2023-03-29
|
||||
* Correct logic checks for Bot rule AllowOwnerOptionAltCombat ([#3158](https://github.com/EQEmu/Server/pull/3158)) @Aeadoin 2023-03-30
|
||||
* Fix an issue with EVENT_DISCONNECT not firing on regular /camp ([#3153](https://github.com/EQEmu/Server/pull/3153)) @Kinglykrab 2023-03-28
|
||||
* Fix bot_raid_members.sql for MYSQL. ([#3155](https://github.com/EQEmu/Server/pull/3155)) @Aeadoin 2023-03-28
|
||||
* Fix for OOZ Group updates when removing/inviting Bots ([#3159](https://github.com/EQEmu/Server/pull/3159)) @Aeadoin 2023-03-30
|
||||
* Fix issues with Lua tables not starting at index 1 ([#3160](https://github.com/EQEmu/Server/pull/3160)) @Kinglykrab 2023-03-30
|
||||
* Fix strcpy-param-overlap ([#3157](https://github.com/EQEmu/Server/pull/3157)) @Aeadoin 2023-03-29
|
||||
|
||||
### Rules
|
||||
|
||||
* Remove Guild Bank Zone ID Rule ([#3156](https://github.com/EQEmu/Server/pull/3156)) @Kinglykrab 2023-03-29
|
||||
|
||||
## [22.8.1] - 03/27/2023
|
||||
|
||||
### Fixes
|
||||
|
||||
* Fix for NPCs having spells interrupted. ([#3150](https://github.com/EQEmu/Server/pull/3150)) @Aeadoin 2023-03-27
|
||||
|
||||
## [22.8.0] - 03/25/2023
|
||||
|
||||
### Code
|
||||
|
||||
* Cleanup Strings::ToInt uses. ([#3142](https://github.com/EQEmu/Server/pull/3142)) @Aeadoin 2023-03-26
|
||||
* Remove extern bool Critical ([#3146](https://github.com/EQEmu/Server/pull/3146)) @Kinglykrab 2023-03-25
|
||||
|
||||
### Crash
|
||||
|
||||
* Fix for crash in Raid::QueuePacket ([#3145](https://github.com/EQEmu/Server/pull/3145)) @Aeadoin 2023-03-25
|
||||
|
||||
### Feature
|
||||
|
||||
* Add support for -1 extradmgskill to allow all skills to be scaled. ([#3136](https://github.com/EQEmu/Server/pull/3136)) @Kinglykrab 2023-03-26
|
||||
|
||||
### Fixes
|
||||
|
||||
* Fix for Items looted from corpses. ([#3147](https://github.com/EQEmu/Server/pull/3147)) @Aeadoin 2023-03-26
|
||||
* Fix for SQL Query in npc_scale_global_base ([#3144](https://github.com/EQEmu/Server/pull/3144)) @Aeadoin 2023-03-26
|
||||
|
||||
## [22.7.0] - 03/24/2023
|
||||
|
||||
### Bots
|
||||
|
||||
* Place BOT_COMMAND_CHAR inside messages ([#3027](https://github.com/EQEmu/Server/pull/3027)) @trentdm 2023-03-05
|
||||
* Prevent interrupt spam when OOM ([#3011](https://github.com/EQEmu/Server/pull/3011)) @nytmyr 2023-03-07
|
||||
|
||||
### Code
|
||||
|
||||
* Cleaning up Raid.cpp ([#3125](https://github.com/EQEmu/Server/pull/3125)) @Aeadoin 2023-03-20
|
||||
* Cleanup unused methods and variables in world/main.cpp and world/main.h ([#3105](https://github.com/EQEmu/Server/pull/3105)) @Kinglykrab 2023-03-17
|
||||
* Cleanup uses of Strings::ToInt to match correct type. ([#3054](https://github.com/EQEmu/Server/pull/3054)) @Aeadoin 2023-03-22
|
||||
* Delete deprecated/perlxs folder ([#3110](https://github.com/EQEmu/Server/pull/3110)) @Kinglykrab 2023-03-17
|
||||
* Delete queues.h ([#3089](https://github.com/EQEmu/Server/pull/3089)) @Kinglykrab 2023-03-17
|
||||
* Delete world/console.old.cpp ([#3099](https://github.com/EQEmu/Server/pull/3099)) @Kinglykrab 2023-03-17
|
||||
* Delete zone_numbers.h ([#3129](https://github.com/EQEmu/Server/pull/3129)) @Kinglykrab 2023-03-20
|
||||
* Remove AllConnected(), CanUpdate(), and SendInfo() from login_server_list.cpp and login_server_list.h ([#3104](https://github.com/EQEmu/Server/pull/3104)) @Kinglykrab 2023-03-17
|
||||
* Remove CLIENT_TIMEOUT from world/client.h and zone/client.h ([#3071](https://github.com/EQEmu/Server/pull/3071)) @Kinglykrab 2023-03-17
|
||||
* Remove ChangeHP() from mob.h ([#3128](https://github.com/EQEmu/Server/pull/3128)) @Kinglykrab 2023-03-19
|
||||
* Remove CheckAuth(), SetOnline(), and pMD5Pass from cliententry.h ([#3095](https://github.com/EQEmu/Server/pull/3095)) @Kinglykrab 2023-03-17
|
||||
* Remove CommandRequirement() from zonedb.h ([#3094](https://github.com/EQEmu/Server/pull/3094)) @Kinglykrab 2023-03-17
|
||||
* Remove CountZones() from launcher_link.h ([#3100](https://github.com/EQEmu/Server/pull/3100)) @Kinglykrab 2023-03-17
|
||||
* Remove DBInitVars() and HandleMysqlError() from queryserv/database.h ([#3114](https://github.com/EQEmu/Server/pull/3114)) @Kinglykrab 2023-03-17
|
||||
* Remove DBInitVars(), HandleMysqlError(), and IsChatChannelInDB() in ucs/database.h ([#3113](https://github.com/EQEmu/Server/pull/3113)) @Kinglykrab 2023-03-17
|
||||
* Remove DisableStats(), EnableStats(), DisableLoginserver(), and EnableLoginserver() from world_config.h ([#3107](https://github.com/EQEmu/Server/pull/3107)) @Kinglykrab 2023-03-17
|
||||
* Remove DoBuffWearOffEffect() from mob.h ([#3062](https://github.com/EQEmu/Server/pull/3062)) @Kinglykrab 2023-03-17
|
||||
* Remove FindByName(charname) from clientlist.h ([#3096](https://github.com/EQEmu/Server/pull/3096)) @Kinglykrab 2023-03-17
|
||||
* Remove FindCLEByLSID(), GetCLE(), GetCLEIPCount(), and RemoveCLEByLSID() from clientlist.h ([#3098](https://github.com/EQEmu/Server/pull/3098)) @Kinglykrab 2023-03-17
|
||||
* Remove FindPatch() from struct_category.cpp and struct_category.h ([#3130](https://github.com/EQEmu/Server/pull/3130)) @Kinglykrab 2023-03-20
|
||||
* Remove FlushLootStats() from npc.h ([#3079](https://github.com/EQEmu/Server/pull/3079)) @Kinglykrab 2023-03-17
|
||||
* Remove GetAILevel() from npc.h ([#3080](https://github.com/EQEmu/Server/pull/3080)) @Kinglykrab 2023-03-17
|
||||
* Remove GetDestination() from doors.h ([#3078](https://github.com/EQEmu/Server/pull/3078)) @Kinglykrab 2023-03-17
|
||||
* Remove GetServerByAddress() from server_manager.h ([#3119](https://github.com/EQEmu/Server/pull/3119)) @Kinglykrab 2023-03-17
|
||||
* Remove GetStartCount() and InitStartTimer() from zone_launch.cpp and zone_launch.h ([#3121](https://github.com/EQEmu/Server/pull/3121)) @Kinglykrab 2023-03-17
|
||||
* Remove GetTransformation() and GetInvertedTransformation() from oriented_bounding_box.h ([#3084](https://github.com/EQEmu/Server/pull/3084)) @Kinglykrab 2023-03-17
|
||||
* Remove IsAffectedByBuff() ([#3068](https://github.com/EQEmu/Server/pull/3068)) @Kinglykrab 2023-03-17
|
||||
* Remove IsConnected() from loginserver/database.h ([#3117](https://github.com/EQEmu/Server/pull/3117)) @Kinglykrab 2023-03-17
|
||||
* Remove IsOrigin(glm::vec2) from position.h ([#3088](https://github.com/EQEmu/Server/pull/3088)) @Kinglykrab 2023-03-17
|
||||
* Remove MakeGuildMembers() from wguild_mgr.h ([#3106](https://github.com/EQEmu/Server/pull/3106)) @Kinglykrab 2023-03-17
|
||||
* Remove PlayerLogin_Struct from login_types.h ([#3118](https://github.com/EQEmu/Server/pull/3118)) @Kinglykrab 2023-03-17
|
||||
* Remove RemoveSpawnGroup() from spawngroup.h ([#3090](https://github.com/EQEmu/Server/pull/3090)) @Kinglykrab 2023-03-17
|
||||
* Remove SendGuildPacket() from clientlist.cpp, clientlist.h, and wguild_mgr.cpp ([#3097](https://github.com/EQEmu/Server/pull/3097)) @Kinglykrab 2023-03-17
|
||||
* Remove SetConnection() from loginserver/world_server.h ([#3120](https://github.com/EQEmu/Server/pull/3120)) @Kinglykrab 2023-03-17
|
||||
* Remove SetDBID() from object.h ([#3082](https://github.com/EQEmu/Server/pull/3082)) @Kinglykrab 2023-03-17
|
||||
* Remove SetSentTime2 in petitions.h ([#3086](https://github.com/EQEmu/Server/pull/3086)) @Kinglykrab 2023-03-17
|
||||
* Remove StoreCharacter() from worlddb.h ([#3108](https://github.com/EQEmu/Server/pull/3108)) @Kinglykrab 2023-03-17
|
||||
* Remove UpdateLoginserverWorldAdminAccountPasswordById() from account_management.cpp ([#3115](https://github.com/EQEmu/Server/pull/3115)) @Kinglykrab 2023-03-17
|
||||
* Remove _baseBotStance from bot.h ([#3076](https://github.com/EQEmu/Server/pull/3076)) @Kinglykrab 2023-03-17
|
||||
* Remove _botRole from bot.h ([#3075](https://github.com/EQEmu/Server/pull/3075)) @Kinglykrab 2023-03-17
|
||||
* Remove _previousTarget from bot.h ([#3074](https://github.com/EQEmu/Server/pull/3074)) @Kinglykrab 2023-03-17
|
||||
* Remove authenticated from launcher_link.cpp and launcher_link.h ([#3101](https://github.com/EQEmu/Server/pull/3101)) @Kinglykrab 2023-03-17
|
||||
* Remove can_corpse_be_rezzed from corpse.h ([#3077](https://github.com/EQEmu/Server/pull/3077)) @Kinglykrab 2023-03-17
|
||||
* Remove casting_spell_type from mob.h ([#3064](https://github.com/EQEmu/Server/pull/3064)) @Kinglykrab 2023-03-17
|
||||
* Remove class EQStream from client.h ([#3070](https://github.com/EQEmu/Server/pull/3070)) @Kinglykrab 2023-03-17
|
||||
* Remove current_buff_count ([#3067](https://github.com/EQEmu/Server/pull/3067)) @Kinglykrab 2023-03-17
|
||||
* Remove firstlogin and realfirstlogin from world/client.h ([#3072](https://github.com/EQEmu/Server/pull/3072)) @Kinglykrab 2023-03-17
|
||||
* Remove fixedZ from mob.h ([#3065](https://github.com/EQEmu/Server/pull/3065)) @Kinglykrab 2023-03-17
|
||||
* Remove inWater from mob.h ([#3069](https://github.com/EQEmu/Server/pull/3069)) @Kinglykrab 2023-03-17
|
||||
* Remove is_authenticatd, LSShutDownUpdate(), and SetInstanceID() from zoneserver.h ([#3109](https://github.com/EQEmu/Server/pull/3109)) @Kinglykrab 2023-03-17
|
||||
* Remove last_insert_id from petitions.h ([#3087](https://github.com/EQEmu/Server/pull/3087)) @Kinglykrab 2023-03-17
|
||||
* Remove last_max_hp from mob.h ([#3063](https://github.com/EQEmu/Server/pull/3063)) @Kinglykrab 2023-03-17
|
||||
* Remove m_inuse, m_z, and m_heading from object.h ([#3083](https://github.com/EQEmu/Server/pull/3083)) @Kinglykrab 2023-03-17
|
||||
* Remove npc_ai.cpp/npc_ai.cpp ([#3081](https://github.com/EQEmu/Server/pull/3081)) @Kinglykrab 2023-03-17
|
||||
* Remove ownHiddenTrigger from trap.cpp and trap.h ([#3092](https://github.com/EQEmu/Server/pull/3092)) @Kinglykrab 2023-03-17
|
||||
* Remove perlparser.h ([#3085](https://github.com/EQEmu/Server/pull/3085)) @Kinglykrab 2023-03-17
|
||||
* Remove unused AbilityTimer variable in client.h ([#3035](https://github.com/EQEmu/Server/pull/3035)) @Kinglykrab 2023-03-05
|
||||
* Remove unused BotAA struct in bot_structs.h ([#3038](https://github.com/EQEmu/Server/pull/3038)) @Kinglykrab 2023-03-05
|
||||
* Remove unused HandleUpdateTasksOnKill in client.h ([#3032](https://github.com/EQEmu/Server/pull/3032)) @Kinglykrab 2023-03-05
|
||||
* Remove unused SaveBackup in client.h ([#3030](https://github.com/EQEmu/Server/pull/3030)) @Kinglykrab 2023-03-05
|
||||
* Remove unused ^evacuate and ^succor subcommands from bot_command.h ([#3039](https://github.com/EQEmu/Server/pull/3039)) @Kinglykrab 2023-03-05
|
||||
* Remove unused bot structs in bot_structs.h ([#3037](https://github.com/EQEmu/Server/pull/3037)) @Kinglykrab 2023-03-05
|
||||
* Remove unused client queued work variable in client.cpp/client.h ([#3034](https://github.com/EQEmu/Server/pull/3034)) @Kinglykrab 2023-03-05
|
||||
* Remove unused command variables in client.cpp ([#3031](https://github.com/EQEmu/Server/pull/3031)) @Kinglykrab 2023-03-05
|
||||
* Remove unused lua_hate_entry.cpp ([#3057](https://github.com/EQEmu/Server/pull/3057)) @Kinglykrab 2023-03-12
|
||||
* Remove unused methods in eql_config.cpp, eql_config.h, launcher_list.cpp, and launcher_list.h ([#3103](https://github.com/EQEmu/Server/pull/3103)) @Kinglykrab 2023-03-17
|
||||
* Remove unused methods in loginserver/client.h ([#3116](https://github.com/EQEmu/Server/pull/3116)) @Kinglykrab 2023-03-17
|
||||
* Remove unused player update variables in client.cpp/client.h ([#3033](https://github.com/EQEmu/Server/pull/3033)) @Kinglykrab 2023-03-05
|
||||
* Utilize GetPlayerState() in mob methods ([#3066](https://github.com/EQEmu/Server/pull/3066)) @Kinglykrab 2023-03-17
|
||||
* Utilize GetScheduler() in zone/worldserver.cpp ([#3093](https://github.com/EQEmu/Server/pull/3093)) @Kinglykrab 2023-03-17
|
||||
* Utilize SetFilter in client.cpp ([#3036](https://github.com/EQEmu/Server/pull/3036)) @Kinglykrab 2023-03-05
|
||||
* Utilize SetHiddenTrigger in trap.cpp ([#3091](https://github.com/EQEmu/Server/pull/3091)) @Kinglykrab 2023-03-17
|
||||
* remove _botOrderAttack from bot.h ([#3073](https://github.com/EQEmu/Server/pull/3073)) @Kinglykrab 2023-03-17
|
||||
|
||||
### Commands
|
||||
|
||||
* Cleanup #haste Command ([#3042](https://github.com/EQEmu/Server/pull/3042)) @Kinglykrab 2023-03-06
|
||||
* Cleanup #hideme Command ([#3043](https://github.com/EQEmu/Server/pull/3043)) @Kinglykrab 2023-03-06
|
||||
* Cleanup #interrupt Command ([#3044](https://github.com/EQEmu/Server/pull/3044)) @Kinglykrab 2023-03-06
|
||||
* Cleanup #level Command ([#3045](https://github.com/EQEmu/Server/pull/3045)) @Kinglykrab 2023-03-06
|
||||
* Cleanup #picklock Command ([#3046](https://github.com/EQEmu/Server/pull/3046)) @Kinglykrab 2023-03-06
|
||||
* Cleanup #resetaa and #resetaa_timer ([#3047](https://github.com/EQEmu/Server/pull/3047)) @Kinglykrab 2023-03-06
|
||||
* Cleanup #wc Command ([#3049](https://github.com/EQEmu/Server/pull/3049)) @Kinglykrab 2023-03-06
|
||||
* Remove #equipitem Command ([#3040](https://github.com/EQEmu/Server/pull/3040)) @Kinglykrab 2023-03-06
|
||||
|
||||
### Console
|
||||
|
||||
* Add IS_TTY to force terminal coloring output ([#3021](https://github.com/EQEmu/Server/pull/3021)) @Akkadius 2023-03-04
|
||||
|
||||
### Crash
|
||||
|
||||
* Fix dangling Group member pointers for Bots. ([#3134](https://github.com/EQEmu/Server/pull/3134)) @Aeadoin 2023-03-21
|
||||
* Fixes Crash when Zoning with XTarget when Bots are in group. ([#3126](https://github.com/EQEmu/Server/pull/3126)) @Aeadoin 2023-03-19
|
||||
|
||||
### Feature
|
||||
|
||||
* Add Basic Bot Raiding Functionality ([#2782](https://github.com/EQEmu/Server/pull/2782)) @neckkola 2023-03-17
|
||||
* Add Data Bucket support for scaling of Heroic Stats. ([#3058](https://github.com/EQEmu/Server/pull/3058)) @Aeadoin 2023-03-24
|
||||
* Add Item Extra Skill Damage Percent Modifier ([#3127](https://github.com/EQEmu/Server/pull/3127)) @Kinglykrab 2023-03-19
|
||||
|
||||
### Fixes
|
||||
|
||||
* Add Avoidance and HP Regen Per Second too NPC Scaling. ([#3050](https://github.com/EQEmu/Server/pull/3050)) @Aeadoin 2023-03-09
|
||||
* Add Heroic Strikethrough & HP Regen Per Second to GM Entity Info ([#3055](https://github.com/EQEmu/Server/pull/3055)) @Aeadoin 2023-03-12
|
||||
* Add Heroic Strikethrough to NPC Scaling ([#3028](https://github.com/EQEmu/Server/pull/3028)) @Kinglykrab 2023-03-06
|
||||
* Change SPA 193 Weapon Damage to allow values over 65,535 ([#3138](https://github.com/EQEmu/Server/pull/3138)) @Aeadoin 2023-03-23
|
||||
* Checkmarks and X characters in popup messages ([#3041](https://github.com/EQEmu/Server/pull/3041)) @Kinglykrab 2023-03-06
|
||||
* Cursor Coin Upon Death ([#3020](https://github.com/EQEmu/Server/pull/3020)) @cybernine186 2023-03-04
|
||||
* Ensure synchronization of pet taunt state with UI ([#3025](https://github.com/EQEmu/Server/pull/3025)) @catapultam-habeo 2023-03-04
|
||||
* Fix Bard Bot Casting ([#3122](https://github.com/EQEmu/Server/pull/3122)) @Aeadoin 2023-03-17
|
||||
* Fix Discovered Items with Alternate Currency and LDoN Adventure Merchants ([#3026](https://github.com/EQEmu/Server/pull/3026)) @Kinglykrab 2023-03-04
|
||||
* Fix Heal Scale and Spell Scale in NPC Scaling ([#3051](https://github.com/EQEmu/Server/pull/3051)) @Kinglykrab 2023-03-10
|
||||
* Fix Raid Invites causing client desync issues ([#3053](https://github.com/EQEmu/Server/pull/3053)) @Aeadoin 2023-03-11
|
||||
* Fix Raid methods that could cause crashes with Bots in raid ([#3111](https://github.com/EQEmu/Server/pull/3111)) @Aeadoin 2023-03-17
|
||||
* Fix edge cases where camped bots would be left in a raid ([#3139](https://github.com/EQEmu/Server/pull/3139)) @Aeadoin 2023-03-23
|
||||
* Fix for Raid Disband if leader not in same zone. ([#3135](https://github.com/EQEmu/Server/pull/3135)) @Aeadoin 2023-03-21
|
||||
* Fix for incorrect bindpoint x,y,z,headings ([#3141](https://github.com/EQEmu/Server/pull/3141)) @Aeadoin 2023-03-23
|
||||
* Fix for transferring Raid Leader ([#3140](https://github.com/EQEmu/Server/pull/3140)) @Aeadoin 2023-03-23
|
||||
* Fix issue with overflow on min/max hit dmg in npc scaling calculations ([#3052](https://github.com/EQEmu/Server/pull/3052)) @Aeadoin 2023-03-10
|
||||
* Fix typo for bot_id raid_members column in db_update_manifest.txt ([#3132](https://github.com/EQEmu/Server/pull/3132)) @Kinglykrab 2023-03-20
|
||||
* Fixes for corpses not properly saving some item instance data correctly. ([#3123](https://github.com/EQEmu/Server/pull/3123)) @KimLS 2023-03-23
|
||||
|
||||
### Illusions
|
||||
|
||||
* Fix bug where spells like Ignite Bones left NPC size incorrect. ([#3061](https://github.com/EQEmu/Server/pull/3061)) @noudess 2023-03-16
|
||||
|
||||
### Quest API
|
||||
|
||||
* Add SendIllusion overloads/parameters to Perl/Lua ([#3059](https://github.com/EQEmu/Server/pull/3059)) @Kinglykrab 2023-03-16
|
||||
* Add Spell GetActX methods to Perl/Lua ([#3056](https://github.com/EQEmu/Server/pull/3056)) @Kinglykrab 2023-03-12
|
||||
* Add Timer related methods to Mobs in Perl/Lua ([#3133](https://github.com/EQEmu/Server/pull/3133)) @Kinglykrab 2023-03-20
|
||||
|
||||
### Rules
|
||||
|
||||
* Add Multiplier for Heroic Stats. ([#3014](https://github.com/EQEmu/Server/pull/3014)) @Aeadoin 2023-03-04
|
||||
* Add ResurrectionEffectsBlock ([#2990](https://github.com/EQEmu/Server/pull/2990)) @nytmyr 2023-03-04
|
||||
* Add Rule to allow ExtraDmgSkill/SPA 220 to effect Spell Skills ([#3124](https://github.com/EQEmu/Server/pull/3124)) @Aeadoin 2023-03-19
|
||||
* Add Task System Rule ExpRewardsIgnoreLevelBasedEXPMods ([#3112](https://github.com/EQEmu/Server/pull/3112)) @Aeadoin 2023-03-17
|
||||
|
||||
### Scaling
|
||||
|
||||
* Add support for pipe-separated zone IDs and versions ([#3015](https://github.com/EQEmu/Server/pull/3015)) @Kinglykrab 2023-03-04
|
||||
|
||||
### Strings
|
||||
|
||||
* Add exception handling to converters themselves ([#3029](https://github.com/EQEmu/Server/pull/3029)) @Akkadius 2023-03-05
|
||||
* Add more number formatters ([#2873](https://github.com/EQEmu/Server/pull/2873)) @Kinglykrab 2023-03-04
|
||||
|
||||
## [22.4.5] - 03/03/2023
|
||||
|
||||
### Bots
|
||||
|
||||
@@ -608,6 +608,7 @@ SET(common_headers
|
||||
unix.h
|
||||
useperl.h
|
||||
version.h
|
||||
zone_numbers.h
|
||||
zone_store.h
|
||||
event/event_loop.h
|
||||
event/task.h
|
||||
|
||||
@@ -120,7 +120,7 @@ std::vector<std::string> WorldContentService::GetContentFlagsDisabled()
|
||||
/**
|
||||
* @param content_flags
|
||||
*/
|
||||
void WorldContentService::SetContentFlags(const std::vector<ContentFlagsRepository::ContentFlags>& content_flags)
|
||||
void WorldContentService::SetContentFlags(std::vector<ContentFlagsRepository::ContentFlags> content_flags)
|
||||
{
|
||||
WorldContentService::content_flags = content_flags;
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ public:
|
||||
std::vector<std::string> GetContentFlagsDisabled();
|
||||
bool IsContentFlagEnabled(const std::string& content_flag);
|
||||
bool IsContentFlagDisabled(const std::string& content_flag);
|
||||
void SetContentFlags(const std::vector<ContentFlagsRepository::ContentFlags>& content_flags);
|
||||
void SetContentFlags(std::vector<ContentFlagsRepository::ContentFlags> content_flags);
|
||||
void ReloadContentFlags();
|
||||
WorldContentService * SetExpansionContext();
|
||||
|
||||
|
||||
+1
-1
@@ -125,7 +125,7 @@ public:
|
||||
StackWalker::OnOutput(szText);
|
||||
}
|
||||
|
||||
const std::vector<std::string>& GetLines() { return _lines; }
|
||||
const std::vector<std::string>& const GetLines() { return _lines; }
|
||||
private:
|
||||
std::vector<std::string> _lines;
|
||||
};
|
||||
|
||||
+44
-46
@@ -387,7 +387,7 @@ bool Database::DeleteCharacter(char *character_name)
|
||||
std::string query = StringFormat("SELECT `id` from `character_data` WHERE `name` = '%s'", character_name);
|
||||
auto results = QueryDatabase(query);
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
character_id = Strings::ToUnsignedInt(row[0]);
|
||||
character_id = Strings::ToInt(row[0]);
|
||||
}
|
||||
|
||||
if (character_id <= 0) {
|
||||
@@ -787,7 +787,7 @@ uint32 Database::GetCharacterID(const char *name) {
|
||||
auto row = results.begin();
|
||||
if (results.RowCount() == 1)
|
||||
{
|
||||
return Strings::ToUnsignedInt(row[0]);
|
||||
return Strings::ToInt(row[0]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -812,10 +812,10 @@ uint32 Database::GetAccountIDByChar(const char* charname, uint32* oCharID) {
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
uint32 accountId = Strings::ToUnsignedInt(row[0]);
|
||||
uint32 accountId = Strings::ToInt(row[0]);
|
||||
|
||||
if (oCharID)
|
||||
*oCharID = Strings::ToUnsignedInt(row[1]);
|
||||
*oCharID = Strings::ToInt(row[1]);
|
||||
|
||||
return accountId;
|
||||
}
|
||||
@@ -832,7 +832,7 @@ uint32 Database::GetAccountIDByChar(uint32 char_id) {
|
||||
return 0;
|
||||
|
||||
auto row = results.begin();
|
||||
return Strings::ToUnsignedInt(row[0]);
|
||||
return Strings::ToInt(row[0]);
|
||||
}
|
||||
|
||||
uint32 Database::GetAccountIDByName(std::string account_name, std::string loginserver, int16* status, uint32* lsid) {
|
||||
@@ -880,7 +880,7 @@ void Database::GetAccountName(uint32 accountid, char* name, uint32* oLSAccountID
|
||||
|
||||
strcpy(name, row[0]);
|
||||
if (row[1] && oLSAccountID) {
|
||||
*oLSAccountID = Strings::ToUnsignedInt(row[1]);
|
||||
*oLSAccountID = Strings::ToInt(row[1]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -968,7 +968,7 @@ bool Database::LoadVariables() {
|
||||
|
||||
std::string key, value;
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
varcache.last_update = Strings::ToUnsignedInt(row[2]); // ahh should we be comparing if this is newer?
|
||||
varcache.last_update = Strings::ToInt(row[2]); // ahh should we be comparing if this is newer?
|
||||
key = row[0];
|
||||
value = row[1];
|
||||
std::transform(std::begin(key), std::end(key), std::begin(key), ::tolower); // keys are lower case, DB doesn't have to be
|
||||
@@ -999,7 +999,7 @@ bool Database::GetVariable(std::string varname, std::string &varvalue)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Database::SetVariable(const std::string& varname, const std::string &varvalue)
|
||||
bool Database::SetVariable(const std::string varname, const std::string &varvalue)
|
||||
{
|
||||
std::string escaped_name = Strings::Escape(varname);
|
||||
std::string escaped_value = Strings::Escape(varvalue);
|
||||
@@ -1052,7 +1052,7 @@ bool Database::GetZoneGraveyard(const uint32 graveyard_id, uint32* graveyard_zon
|
||||
auto row = results.begin();
|
||||
|
||||
if(graveyard_zoneid != nullptr)
|
||||
*graveyard_zoneid = Strings::ToUnsignedInt(row[0]);
|
||||
*graveyard_zoneid = Strings::ToInt(row[0]);
|
||||
if(graveyard_x != nullptr)
|
||||
*graveyard_x = Strings::ToFloat(row[1]);
|
||||
if(graveyard_y != nullptr)
|
||||
@@ -1168,7 +1168,7 @@ uint32 Database::GetAccountIDFromLSID(
|
||||
}
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
account_id = Strings::ToUnsignedInt(row[0]);
|
||||
account_id = Strings::ToInt(row[0]);
|
||||
|
||||
if (in_account_name) {
|
||||
strcpy(in_account_name, row[1]);
|
||||
@@ -1244,7 +1244,7 @@ uint8 Database::GetServerType() {
|
||||
return 0;
|
||||
|
||||
auto row = results.begin();
|
||||
return Strings::ToUnsignedInt(row[0]);
|
||||
return Strings::ToInt(row[0]);
|
||||
}
|
||||
|
||||
bool Database::MoveCharacterToZone(uint32 character_id, uint32 zone_id)
|
||||
@@ -1296,7 +1296,7 @@ uint8 Database::GetRaceSkill(uint8 skillid, uint8 in_race)
|
||||
return 0;
|
||||
|
||||
auto row = results.begin();
|
||||
return Strings::ToUnsignedInt(row[0]);
|
||||
return Strings::ToInt(row[0]);
|
||||
}
|
||||
|
||||
uint8 Database::GetSkillCap(uint8 skillid, uint8 in_race, uint8 in_class, uint16 in_level)
|
||||
@@ -1312,12 +1312,12 @@ uint8 Database::GetSkillCap(uint8 skillid, uint8 in_race, uint8 in_class, uint16
|
||||
if (results.Success() && results.RowsAffected() != 0)
|
||||
{
|
||||
auto row = results.begin();
|
||||
skill_level = Strings::ToUnsignedInt(row[0]);
|
||||
skill_formula = Strings::ToUnsignedInt(row[1]);
|
||||
skill_cap = Strings::ToUnsignedInt(row[2]);
|
||||
if (Strings::ToUnsignedInt(row[3]) > skill_cap)
|
||||
skill_cap2 = (Strings::ToUnsignedInt(row[3])-skill_cap)/10; //Split the post-50 skill cap into difference between pre-50 cap and post-50 cap / 10 to determine amount of points per level.
|
||||
skill_cap3 = Strings::ToUnsignedInt(row[4]);
|
||||
skill_level = Strings::ToInt(row[0]);
|
||||
skill_formula = Strings::ToInt(row[1]);
|
||||
skill_cap = Strings::ToInt(row[2]);
|
||||
if (Strings::ToInt(row[3]) > skill_cap)
|
||||
skill_cap2 = (Strings::ToInt(row[3])-skill_cap)/10; //Split the post-50 skill cap into difference between pre-50 cap and post-50 cap / 10 to determine amount of points per level.
|
||||
skill_cap3 = Strings::ToInt(row[4]);
|
||||
}
|
||||
|
||||
int race_skill = GetRaceSkill(skillid,in_race);
|
||||
@@ -1488,7 +1488,7 @@ uint32 Database::GetGroupID(const char* name){
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
return Strings::ToUnsignedInt(row[0]);
|
||||
return Strings::ToInt(row[0]);
|
||||
}
|
||||
|
||||
std::string Database::GetGroupLeaderForLogin(std::string character_name) {
|
||||
@@ -1638,7 +1638,7 @@ uint8 Database::GetAgreementFlag(uint32 acctid) {
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
return Strings::ToUnsignedInt(row[0]);
|
||||
return Strings::ToInt(row[0]);
|
||||
}
|
||||
|
||||
void Database::SetAgreementFlag(uint32 acctid) {
|
||||
@@ -1724,7 +1724,7 @@ uint32 Database::GetRaidID(const char* name)
|
||||
}
|
||||
|
||||
if (row[0]) // would it ever be possible to have a null here?
|
||||
return Strings::ToUnsignedInt(row[0]);
|
||||
return Strings::ToInt(row[0]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1980,16 +1980,16 @@ bool Database::GetAdventureStats(uint32 char_id, AdventureStats_Struct *as)
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
as->success.guk = Strings::ToUnsignedInt(row[0]);
|
||||
as->success.mir = Strings::ToUnsignedInt(row[1]);
|
||||
as->success.mmc = Strings::ToUnsignedInt(row[2]);
|
||||
as->success.ruj = Strings::ToUnsignedInt(row[3]);
|
||||
as->success.tak = Strings::ToUnsignedInt(row[4]);
|
||||
as->failure.guk = Strings::ToUnsignedInt(row[5]);
|
||||
as->failure.mir = Strings::ToUnsignedInt(row[6]);
|
||||
as->failure.mmc = Strings::ToUnsignedInt(row[7]);
|
||||
as->failure.ruj = Strings::ToUnsignedInt(row[8]);
|
||||
as->failure.tak = Strings::ToUnsignedInt(row[9]);
|
||||
as->success.guk = Strings::ToInt(row[0]);
|
||||
as->success.mir = Strings::ToInt(row[1]);
|
||||
as->success.mmc = Strings::ToInt(row[2]);
|
||||
as->success.ruj = Strings::ToInt(row[3]);
|
||||
as->success.tak = Strings::ToInt(row[4]);
|
||||
as->failure.guk = Strings::ToInt(row[5]);
|
||||
as->failure.mir = Strings::ToInt(row[6]);
|
||||
as->failure.mmc = Strings::ToInt(row[7]);
|
||||
as->failure.ruj = Strings::ToInt(row[8]);
|
||||
as->failure.tak = Strings::ToInt(row[9]);
|
||||
as->failure.total = as->failure.guk + as->failure.mir + as->failure.mmc + as->failure.ruj + as->failure.tak;
|
||||
as->success.total = as->success.guk + as->success.mir + as->success.mmc + as->success.ruj + as->success.tak;
|
||||
|
||||
@@ -2008,7 +2008,7 @@ uint32 Database::GetGuildIDByCharID(uint32 character_id)
|
||||
return 0;
|
||||
|
||||
auto row = results.begin();
|
||||
return Strings::ToUnsignedInt(row[0]);
|
||||
return Strings::ToInt(row[0]);
|
||||
}
|
||||
|
||||
uint32 Database::GetGroupIDByCharID(uint32 character_id)
|
||||
@@ -2030,7 +2030,7 @@ uint32 Database::GetGroupIDByCharID(uint32 character_id)
|
||||
return 0;
|
||||
|
||||
auto row = results.begin();
|
||||
return Strings::ToUnsignedInt(row[0]);
|
||||
return Strings::ToInt(row[0]);
|
||||
}
|
||||
|
||||
uint32 Database::GetRaidIDByCharID(uint32 character_id) {
|
||||
@@ -2043,12 +2043,10 @@ uint32 Database::GetRaidIDByCharID(uint32 character_id) {
|
||||
character_id
|
||||
);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success() || !results.RowCount()) {
|
||||
return 0;
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
return Strings::ToInt(row[0]);
|
||||
}
|
||||
|
||||
auto row = results.begin();
|
||||
return Strings::ToUnsignedInt(row[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Database::CountInvSnapshots() {
|
||||
@@ -2091,17 +2089,17 @@ struct TimeOfDay_Struct Database::LoadTime(time_t &realtime)
|
||||
eqTime.day = 1;
|
||||
eqTime.month = 1;
|
||||
eqTime.year = 3100;
|
||||
realtime = time(nullptr);
|
||||
realtime = time(0);
|
||||
}
|
||||
else{
|
||||
auto row = results.begin();
|
||||
|
||||
eqTime.minute = Strings::ToUnsignedInt(row[0]);
|
||||
eqTime.hour = Strings::ToUnsignedInt(row[1]);
|
||||
eqTime.day = Strings::ToUnsignedInt(row[2]);
|
||||
eqTime.month = Strings::ToUnsignedInt(row[3]);
|
||||
eqTime.year = Strings::ToUnsignedInt(row[4]);
|
||||
realtime = Strings::ToBigInt(row[5]);
|
||||
eqTime.minute = Strings::ToInt(row[0]);
|
||||
eqTime.hour = Strings::ToInt(row[1]);
|
||||
eqTime.day = Strings::ToInt(row[2]);
|
||||
eqTime.month = Strings::ToInt(row[3]);
|
||||
eqTime.year = Strings::ToInt(row[4]);
|
||||
realtime = Strings::ToInt(row[5]);
|
||||
}
|
||||
|
||||
return eqTime;
|
||||
@@ -2347,7 +2345,7 @@ void Database::SourceDatabaseTableFromUrl(std::string table_name, std::string ur
|
||||
|
||||
int sourced_queries = 0;
|
||||
|
||||
if (auto res = cli.Get(request_uri.get_path())) {
|
||||
if (auto res = cli.Get(request_uri.get_path().c_str())) {
|
||||
if (res->status == 200) {
|
||||
for (auto &s: Strings::Split(res->body, ';')) {
|
||||
if (!Strings::Trim(s).empty()) {
|
||||
|
||||
+1
-1
@@ -235,7 +235,7 @@ public:
|
||||
/* Database Variables */
|
||||
|
||||
bool GetVariable(std::string varname, std::string &varvalue);
|
||||
bool SetVariable(const std::string& varname, const std::string &varvalue);
|
||||
bool SetVariable(const std::string varname, const std::string &varvalue);
|
||||
bool LoadVariables();
|
||||
|
||||
/* General Queries */
|
||||
|
||||
@@ -499,7 +499,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){
|
||||
ExtendedProfile_Struct* e_pp;
|
||||
uint32 pplen = 0;
|
||||
uint32 i;
|
||||
uint32 character_id = 0;
|
||||
int character_id = 0;
|
||||
int account_id = 0;
|
||||
int number_of_characters = 0;
|
||||
int printppdebug = 0; /* Prints Player Profile */
|
||||
@@ -929,19 +929,19 @@ bool Database::CheckDatabaseConvertPPDeblob(){
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
char_iter_count++;
|
||||
squery = StringFormat("SELECT `id`, `profile`, `name`, `level`, `account_id`, `firstlogon`, `lfg`, `lfp`, `mailkey`, `xtargets`, `inspectmessage`, `extprofile` FROM `character_` WHERE `id` = %i", Strings::ToUnsignedInt(row[0]));
|
||||
squery = StringFormat("SELECT `id`, `profile`, `name`, `level`, `account_id`, `firstlogon`, `lfg`, `lfp`, `mailkey`, `xtargets`, `inspectmessage`, `extprofile` FROM `character_` WHERE `id` = %i", Strings::ToInt(row[0]));
|
||||
auto results2 = QueryDatabase(squery);
|
||||
auto row2 = results2.begin();
|
||||
pp = (Convert::PlayerProfile_Struct*)row2[1];
|
||||
e_pp = (ExtendedProfile_Struct*)row2[11];
|
||||
character_id = Strings::ToUnsignedInt(row[0]);
|
||||
character_id = Strings::ToInt(row[0]);
|
||||
account_id = Strings::ToInt(row2[4]);
|
||||
/* Convert some data from the character_ table that is still relevant */
|
||||
firstlogon = Strings::ToUnsignedInt(row2[5]);
|
||||
lfg = Strings::ToUnsignedInt(row2[6]);
|
||||
lfp = Strings::ToUnsignedInt(row2[7]);
|
||||
firstlogon = Strings::ToInt(row2[5]);
|
||||
lfg = Strings::ToInt(row2[6]);
|
||||
lfp = Strings::ToInt(row2[7]);
|
||||
mailkey = row2[8];
|
||||
xtargets = Strings::ToUnsignedInt(row2[9]);
|
||||
xtargets = Strings::ToInt(row2[9]);
|
||||
inspectmessage = row2[10];
|
||||
|
||||
/* Verify PP Integrity */
|
||||
@@ -1567,7 +1567,7 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){
|
||||
rquery = StringFormat("SELECT DISTINCT charid FROM character_corpses");
|
||||
results = QueryDatabase(rquery);
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
std::string squery = StringFormat("SELECT id, charname, data, time_of_death, is_rezzed FROM character_corpses WHERE `charid` = %i", Strings::ToUnsignedInt(row[0]));
|
||||
std::string squery = StringFormat("SELECT id, charname, data, time_of_death, is_rezzed FROM character_corpses WHERE `charid` = %i", Strings::ToInt(row[0]));
|
||||
auto results2 = QueryDatabase(squery);
|
||||
for (auto row2 = results2.begin(); row2 != results2.end(); ++row2) {
|
||||
in_datasize = results2.LengthOfColumn(2);
|
||||
@@ -1599,7 +1599,7 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){
|
||||
c_type = "NULL";
|
||||
continue;
|
||||
}
|
||||
std::cout << "Converting Corpse: [OK] [" << c_type << "]: " << "ID: " << Strings::ToUnsignedInt(row2[0]) << std::endl;
|
||||
std::cout << "Converting Corpse: [OK] [" << c_type << "]: " << "ID: " << Strings::ToInt(row2[0]) << std::endl;
|
||||
|
||||
if (is_sof){
|
||||
scquery = StringFormat("UPDATE `character_corpses` SET \n"
|
||||
@@ -1670,7 +1670,7 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){
|
||||
dbpc->item_tint[6].color,
|
||||
dbpc->item_tint[7].color,
|
||||
dbpc->item_tint[8].color,
|
||||
Strings::ToUnsignedInt(row2[0])
|
||||
Strings::ToInt(row2[0])
|
||||
);
|
||||
if (scquery != ""){ auto sc_results = QueryDatabase(scquery); }
|
||||
|
||||
@@ -1682,7 +1682,7 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){
|
||||
scquery = StringFormat("REPLACE INTO `character_corpse_items` \n"
|
||||
" (corpse_id, equip_slot, item_id, charges, aug_1, aug_2, aug_3, aug_4, aug_5, aug_6, attuned) \n"
|
||||
" VALUES (%u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u) \n",
|
||||
Strings::ToUnsignedInt(row2[0]),
|
||||
Strings::ToInt(row2[0]),
|
||||
dbpc->items[i].equipSlot,
|
||||
dbpc->items[i].item_id,
|
||||
dbpc->items[i].charges,
|
||||
@@ -1698,7 +1698,7 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){
|
||||
}
|
||||
else{
|
||||
scquery = scquery + StringFormat(", (%u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u) \n",
|
||||
Strings::ToUnsignedInt(row2[0]),
|
||||
Strings::ToInt(row2[0]),
|
||||
dbpc->items[i].equipSlot,
|
||||
dbpc->items[i].item_id,
|
||||
dbpc->items[i].charges,
|
||||
@@ -1778,7 +1778,7 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){
|
||||
dbpc_c->item_tint[6].color,
|
||||
dbpc_c->item_tint[7].color,
|
||||
dbpc_c->item_tint[8].color,
|
||||
Strings::ToUnsignedInt(row2[0])
|
||||
Strings::ToInt(row2[0])
|
||||
);
|
||||
if (scquery != ""){ auto sc_results = QueryDatabase(scquery); }
|
||||
|
||||
@@ -1791,7 +1791,7 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){
|
||||
scquery = StringFormat("REPLACE INTO `character_corpse_items` \n"
|
||||
" (corpse_id, equip_slot, item_id, charges, aug_1, aug_2, aug_3, aug_4, aug_5, aug_6, attuned) \n"
|
||||
" VALUES (%u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u) \n",
|
||||
Strings::ToUnsignedInt(row2[0]),
|
||||
Strings::ToInt(row2[0]),
|
||||
dbpc_c->items[i].equipSlot,
|
||||
dbpc_c->items[i].item_id,
|
||||
dbpc_c->items[i].charges,
|
||||
@@ -1807,7 +1807,7 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){
|
||||
}
|
||||
else{
|
||||
scquery = scquery + StringFormat(", (%u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u) \n",
|
||||
Strings::ToUnsignedInt(row2[0]),
|
||||
Strings::ToInt(row2[0]),
|
||||
dbpc_c->items[i].equipSlot,
|
||||
dbpc_c->items[i].item_id,
|
||||
dbpc_c->items[i].charges,
|
||||
|
||||
@@ -429,6 +429,8 @@ void Database::AssignRaidToInstance(uint32 raid_id, uint32 instance_id)
|
||||
|
||||
void Database::DeleteInstance(uint16 instance_id)
|
||||
{
|
||||
std::string query;
|
||||
|
||||
InstanceListPlayerRepository::DeleteWhere(*this, fmt::format("id = {}", instance_id));
|
||||
|
||||
RespawnTimesRepository::DeleteWhere(*this, fmt::format("instance_id = {}", instance_id));
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ void DBcore::ping()
|
||||
m_mutex->unlock();
|
||||
}
|
||||
|
||||
MySQLRequestResult DBcore::QueryDatabase(const std::string& query, bool retryOnFailureOnce)
|
||||
MySQLRequestResult DBcore::QueryDatabase(std::string query, bool retryOnFailureOnce)
|
||||
{
|
||||
auto r = QueryDatabase(query.c_str(), query.length(), retryOnFailureOnce);
|
||||
return r;
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ public:
|
||||
~DBcore();
|
||||
eStatus GetStatus() { return pStatus; }
|
||||
MySQLRequestResult QueryDatabase(const char *query, uint32 querylen, bool retryOnFailureOnce = true);
|
||||
MySQLRequestResult QueryDatabase(const std::string& query, bool retryOnFailureOnce = true);
|
||||
MySQLRequestResult QueryDatabase(std::string query, bool retryOnFailureOnce = true);
|
||||
void TransactionBegin();
|
||||
void TransactionCommit();
|
||||
void TransactionRollback();
|
||||
|
||||
+33
-34
@@ -197,11 +197,11 @@ const std::map<int, std::string>& EQ::constants::GetLanguageMap()
|
||||
|
||||
std::string EQ::constants::GetLanguageName(int language_id)
|
||||
{
|
||||
if (!EQ::ValueWithin(language_id, LANG_COMMON_TONGUE, LANG_UNKNOWN)) {
|
||||
return std::string();
|
||||
if (EQ::ValueWithin(language_id, LANG_COMMON_TONGUE, LANG_UNKNOWN)) {
|
||||
return EQ::constants::GetLanguageMap().find(language_id)->second;
|
||||
}
|
||||
|
||||
return EQ::constants::GetLanguageMap().find(language_id)->second;
|
||||
return std::string();
|
||||
}
|
||||
|
||||
const std::map<uint32, std::string>& EQ::constants::GetLDoNThemeMap()
|
||||
@@ -220,11 +220,11 @@ const std::map<uint32, std::string>& EQ::constants::GetLDoNThemeMap()
|
||||
|
||||
std::string EQ::constants::GetLDoNThemeName(uint32 theme_id)
|
||||
{
|
||||
if (!EQ::ValueWithin(theme_id, LDoNThemes::Unused, LDoNThemes::TAK)) {
|
||||
return std::string();
|
||||
if (EQ::ValueWithin(theme_id, LDoNThemes::Unused, LDoNThemes::TAK)) {
|
||||
return EQ::constants::GetLDoNThemeMap().find(theme_id)->second;
|
||||
}
|
||||
|
||||
return EQ::constants::GetLDoNThemeMap().find(theme_id)->second;
|
||||
return std::string();
|
||||
}
|
||||
|
||||
const std::map<int8, std::string>& EQ::constants::GetFlyModeMap()
|
||||
@@ -243,11 +243,11 @@ const std::map<int8, std::string>& EQ::constants::GetFlyModeMap()
|
||||
|
||||
std::string EQ::constants::GetFlyModeName(int8 flymode_id)
|
||||
{
|
||||
if (!EQ::ValueWithin(flymode_id, GravityBehavior::Ground, GravityBehavior::LevitateWhileRunning)) {
|
||||
return std::string();
|
||||
if (EQ::ValueWithin(flymode_id, GravityBehavior::Ground, GravityBehavior::LevitateWhileRunning)) {
|
||||
return EQ::constants::GetFlyModeMap().find(flymode_id)->second;
|
||||
}
|
||||
|
||||
return EQ::constants::GetFlyModeMap().find(flymode_id)->second;
|
||||
return std::string();
|
||||
}
|
||||
|
||||
const std::map<bodyType, std::string>& EQ::constants::GetBodyTypeMap()
|
||||
@@ -365,11 +365,11 @@ const std::map<uint8, std::string>& EQ::constants::GetConsiderLevelMap()
|
||||
|
||||
std::string EQ::constants::GetConsiderLevelName(uint8 faction_consider_level)
|
||||
{
|
||||
if (!EQ::ValueWithin(faction_consider_level, ConsiderLevel::Ally, ConsiderLevel::Scowls)) {
|
||||
return std::string();;
|
||||
if (EQ::constants::GetConsiderLevelMap().find(faction_consider_level) != EQ::constants::GetConsiderLevelMap().end()) {
|
||||
return EQ::constants::GetConsiderLevelMap().find(faction_consider_level)->second;
|
||||
}
|
||||
|
||||
return EQ::constants::GetConsiderLevelMap().find(faction_consider_level)->second;
|
||||
return std::string();
|
||||
}
|
||||
|
||||
const std::map<uint8, std::string>& EQ::constants::GetEnvironmentalDamageMap()
|
||||
@@ -386,11 +386,11 @@ const std::map<uint8, std::string>& EQ::constants::GetEnvironmentalDamageMap()
|
||||
|
||||
std::string EQ::constants::GetEnvironmentalDamageName(uint8 damage_type)
|
||||
{
|
||||
if (!EQ::ValueWithin(damage_type, EnvironmentalDamage::Lava, EnvironmentalDamage::Trap)) {
|
||||
return std::string();
|
||||
if (EQ::ValueWithin(damage_type, EnvironmentalDamage::Lava, EnvironmentalDamage::Trap)) {
|
||||
return EQ::constants::GetEnvironmentalDamageMap().find(damage_type)->second;
|
||||
}
|
||||
|
||||
return EQ::constants::GetEnvironmentalDamageMap().find(damage_type)->second;
|
||||
return std::string();
|
||||
}
|
||||
|
||||
const std::map<uint8, std::string>& EQ::constants::GetStuckBehaviorMap()
|
||||
@@ -407,11 +407,11 @@ const std::map<uint8, std::string>& EQ::constants::GetStuckBehaviorMap()
|
||||
|
||||
std::string EQ::constants::GetStuckBehaviorName(uint8 behavior_id)
|
||||
{
|
||||
if (!EQ::ValueWithin(behavior_id, StuckBehavior::RunToTarget, StuckBehavior::EvadeCombat)) {
|
||||
return std::string();
|
||||
if (EQ::ValueWithin(behavior_id, StuckBehavior::RunToTarget, StuckBehavior::EvadeCombat)) {
|
||||
return EQ::constants::GetStuckBehaviorMap().find(behavior_id)->second;
|
||||
}
|
||||
|
||||
return EQ::constants::GetStuckBehaviorMap().find(behavior_id)->second;
|
||||
return std::string();
|
||||
}
|
||||
|
||||
const std::map<uint8, std::string>& EQ::constants::GetSpawnAnimationMap()
|
||||
@@ -429,11 +429,11 @@ const std::map<uint8, std::string>& EQ::constants::GetSpawnAnimationMap()
|
||||
|
||||
std::string EQ::constants::GetSpawnAnimationName(uint8 animation_id)
|
||||
{
|
||||
if (!EQ::ValueWithin(animation_id, SpawnAnimations::Standing, SpawnAnimations::Looting)) {
|
||||
return std::string();
|
||||
if (EQ::ValueWithin(animation_id, SpawnAnimations::Standing, SpawnAnimations::Looting)) {
|
||||
return EQ::constants::GetSpawnAnimationMap().find(animation_id)->second;
|
||||
}
|
||||
|
||||
return EQ::constants::GetSpawnAnimationMap().find(animation_id)->second;
|
||||
return std::string();
|
||||
}
|
||||
|
||||
const std::map<int, std::string>& EQ::constants::GetObjectTypeMap()
|
||||
@@ -507,12 +507,11 @@ const std::map<int, std::string>& EQ::constants::GetObjectTypeMap()
|
||||
|
||||
std::string EQ::constants::GetObjectTypeName(int object_type)
|
||||
{
|
||||
if (!EQ::ValueWithin(object_type, ObjectTypes::SmallBag, ObjectTypes::NoDeposit)) {
|
||||
return std::string();
|
||||
|
||||
if (EQ::ValueWithin(object_type, ObjectTypes::SmallBag, ObjectTypes::NoDeposit)) {
|
||||
return EQ::constants::GetObjectTypeMap().find(object_type)->second;
|
||||
}
|
||||
|
||||
return EQ::constants::GetObjectTypeMap().find(object_type)->second;
|
||||
return std::string();
|
||||
}
|
||||
|
||||
const std::map<uint8, std::string> &EQ::constants::GetWeatherTypeMap()
|
||||
@@ -528,11 +527,11 @@ const std::map<uint8, std::string> &EQ::constants::GetWeatherTypeMap()
|
||||
|
||||
std::string EQ::constants::GetWeatherTypeName(uint8 weather_type)
|
||||
{
|
||||
if (!EQ::ValueWithin(weather_type, WeatherTypes::None, WeatherTypes::Snowing)) {
|
||||
return std::string();
|
||||
if (EQ::ValueWithin(weather_type, WeatherTypes::None, WeatherTypes::Snowing)) {
|
||||
return EQ::constants::GetWeatherTypeMap().find(weather_type)->second;
|
||||
}
|
||||
|
||||
return EQ::constants::GetWeatherTypeMap().find(weather_type)->second;
|
||||
return std::string();
|
||||
}
|
||||
|
||||
const std::map<uint8, std::string> &EQ::constants::GetEmoteEventTypeMap()
|
||||
@@ -554,11 +553,11 @@ const std::map<uint8, std::string> &EQ::constants::GetEmoteEventTypeMap()
|
||||
|
||||
std::string EQ::constants::GetEmoteEventTypeName(uint8 emote_event_type)
|
||||
{
|
||||
if (!EQ::ValueWithin(emote_event_type, EmoteEventTypes::LeaveCombat, EmoteEventTypes::OnDespawn)) {
|
||||
return std::string();
|
||||
if (EQ::ValueWithin(emote_event_type, EmoteEventTypes::LeaveCombat, EmoteEventTypes::OnDespawn)) {
|
||||
return EQ::constants::GetEmoteEventTypeMap().find(emote_event_type)->second;
|
||||
}
|
||||
|
||||
return EQ::constants::GetEmoteEventTypeMap().find(emote_event_type)->second;
|
||||
return std::string();
|
||||
}
|
||||
|
||||
const std::map<uint8, std::string> &EQ::constants::GetEmoteTypeMap()
|
||||
@@ -574,9 +573,9 @@ const std::map<uint8, std::string> &EQ::constants::GetEmoteTypeMap()
|
||||
|
||||
std::string EQ::constants::GetEmoteTypeName(uint8 emote_type)
|
||||
{
|
||||
if (!EQ::ValueWithin(emote_type, EmoteTypes::Emote, EmoteTypes::Proximity)) {
|
||||
return std::string();
|
||||
if (EQ::ValueWithin(emote_type, EmoteTypes::Emote, EmoteTypes::Proximity)) {
|
||||
return EQ::constants::GetEmoteTypeMap().find(emote_type)->second;
|
||||
}
|
||||
|
||||
return EQ::constants::GetEmoteTypeMap().find(emote_type)->second;
|
||||
return std::string();
|
||||
}
|
||||
|
||||
@@ -593,29 +593,4 @@ enum class ApplySpellType {
|
||||
Raid
|
||||
};
|
||||
|
||||
|
||||
namespace HeroicBonusBucket
|
||||
{
|
||||
const std::string WisMaxMana = "HWIS-MaxMana";
|
||||
const std::string WisManaRegen = "HWIS-ManaRegen";
|
||||
const std::string WisHealAmt = "HWIS-HealAmt";
|
||||
const std::string IntMaxMana = "HINT-MaxMana";
|
||||
const std::string IntManaRegen = "HINT-ManaRegen";
|
||||
const std::string IntSpellDmg = "HINT-SpellDmg";
|
||||
const std::string StrMeleeDamage = "HSTR-MeleeDamage";
|
||||
const std::string StrShieldAC = "HSTR-ShieldAC";
|
||||
const std::string StrMaxEndurance = "HSTR-MaxEndurance";
|
||||
const std::string StrEnduranceRegen = "HSTR-EnduranceRegen";
|
||||
const std::string StaMaxHP = "HSTA-MaxHP";
|
||||
const std::string StaHPRegen = "HSTA-HPRegen";
|
||||
const std::string StaMaxEndurance = "HSTA-MaxEndurance";
|
||||
const std::string StaEnduranceRegen = "HSTA-EnduranceRegen";
|
||||
const std::string AgiAvoidance = "HAGI-Avoidance";
|
||||
const std::string AgiMaxEndurance = "HAGI-MaxEndurance";
|
||||
const std::string AgiEnduranceRegen = "HAGI-EnduranceRegen";
|
||||
const std::string DexRangedDamage = "HDEX-RangedDamage";
|
||||
const std::string DexMaxEndurance = "HDEX-MaxEndurance";
|
||||
const std::string DexEnduranceRegen = "HDEX-EnduranceRegen";
|
||||
}
|
||||
|
||||
#endif /*COMMON_EMU_CONSTANTS_H*/
|
||||
|
||||
+1
-1
@@ -129,7 +129,7 @@ namespace EQ
|
||||
|
||||
LookupEntry(const LookupEntry *lookup_entry) { }
|
||||
LookupEntry(
|
||||
const InventoryTypeSize_Struct& InventoryTypeSize,
|
||||
InventoryTypeSize_Struct InventoryTypeSize,
|
||||
uint64 EquipmentBitmask,
|
||||
uint64 GeneralBitmask,
|
||||
uint64 CursorBitmask,
|
||||
|
||||
@@ -5522,11 +5522,7 @@ struct ServerLootItem_Struct {
|
||||
uint32 aug_4; // uint32 aug_4;
|
||||
uint32 aug_5; // uint32 aug_5;
|
||||
uint32 aug_6; // uint32 aug_5;
|
||||
bool attuned;
|
||||
std::string custom_data;
|
||||
uint32 ornamenticon {};
|
||||
uint32 ornamentidfile {};
|
||||
uint32 ornament_hero_model {};
|
||||
uint8 attuned;
|
||||
uint16 trivial_min_level;
|
||||
uint16 trivial_max_level;
|
||||
uint16 npc_min_level;
|
||||
|
||||
@@ -145,7 +145,7 @@ void EQStreamIdentifier::Process() {
|
||||
}
|
||||
|
||||
void EQStreamIdentifier::AddStream(std::shared_ptr<EQStreamInterface> eqs) {
|
||||
m_streams.emplace_back(Record(eqs));
|
||||
m_streams.push_back(Record(eqs));
|
||||
eqs = nullptr;
|
||||
}
|
||||
|
||||
|
||||
+18
-18
@@ -34,13 +34,13 @@ void EQEmuConfig::parse_config()
|
||||
LongName = _root["server"]["world"].get("longname", "").asString();
|
||||
WorldAddress = _root["server"]["world"].get("address", "").asString();
|
||||
LocalAddress = _root["server"]["world"].get("localaddress", "").asString();
|
||||
MaxClients = Strings::ToInt(_root["server"]["world"].get("maxclients", "-1").asString());
|
||||
MaxClients = Strings::ToInt(_root["server"]["world"].get("maxclients", "-1").asString().c_str());
|
||||
SharedKey = _root["server"]["world"].get("key", "").asString();
|
||||
LoginCount = 0;
|
||||
|
||||
if (_root["server"]["world"]["loginserver"].isObject()) {
|
||||
LoginHost = _root["server"]["world"]["loginserver"].get("host", "login.eqemulator.net").asString();
|
||||
LoginPort = Strings::ToUnsignedInt(_root["server"]["world"]["loginserver"].get("port", "5998").asString());
|
||||
LoginPort = Strings::ToInt(_root["server"]["world"]["loginserver"].get("port", "5998").asString().c_str());
|
||||
LoginLegacy = false;
|
||||
if (_root["server"]["world"]["loginserver"].get("legacy", "0").asString() == "1") { LoginLegacy = true; }
|
||||
LoginAccount = _root["server"]["world"]["loginserver"].get("account", "").asString();
|
||||
@@ -63,7 +63,7 @@ void EQEmuConfig::parse_config()
|
||||
|
||||
auto loginconfig = new LoginConfig;
|
||||
loginconfig->LoginHost = _root["server"]["world"][str].get("host", "login.eqemulator.net").asString();
|
||||
loginconfig->LoginPort = Strings::ToUnsignedInt(_root["server"]["world"][str].get("port", "5998").asString());
|
||||
loginconfig->LoginPort = Strings::ToInt(_root["server"]["world"][str].get("port", "5998").asString().c_str());
|
||||
loginconfig->LoginAccount = _root["server"]["world"][str].get("account", "").asString();
|
||||
loginconfig->LoginPassword = _root["server"]["world"][str].get("password", "").asString();
|
||||
|
||||
@@ -86,15 +86,15 @@ void EQEmuConfig::parse_config()
|
||||
Locked = false;
|
||||
if (_root["server"]["world"].get("locked", "false").asString() == "true") { Locked = true; }
|
||||
WorldIP = _root["server"]["world"]["tcp"].get("host", "127.0.0.1").asString();
|
||||
WorldTCPPort = Strings::ToUnsignedInt(_root["server"]["world"]["tcp"].get("port", "9000").asString());
|
||||
WorldTCPPort = Strings::ToInt(_root["server"]["world"]["tcp"].get("port", "9000").asString().c_str());
|
||||
|
||||
TelnetIP = _root["server"]["world"]["telnet"].get("ip", "127.0.0.1").asString();
|
||||
TelnetTCPPort = Strings::ToUnsignedInt(_root["server"]["world"]["telnet"].get("port", "9001").asString());
|
||||
TelnetTCPPort = Strings::ToInt(_root["server"]["world"]["telnet"].get("port", "9001").asString().c_str());
|
||||
TelnetEnabled = false;
|
||||
if (_root["server"]["world"]["telnet"].get("enabled", "false").asString() == "true") { TelnetEnabled = true; }
|
||||
|
||||
WorldHTTPMimeFile = _root["server"]["world"]["http"].get("mimefile", "mime.types").asString();
|
||||
WorldHTTPPort = Strings::ToUnsignedInt(_root["server"]["world"]["http"].get("port", "9080").asString());
|
||||
WorldHTTPPort = Strings::ToInt(_root["server"]["world"]["http"].get("port", "9080").asString().c_str());
|
||||
WorldHTTPEnabled = false;
|
||||
|
||||
if (_root["server"]["world"]["http"].get("enabled", "false").asString() == "true") {
|
||||
@@ -109,9 +109,9 @@ void EQEmuConfig::parse_config()
|
||||
* UCS
|
||||
*/
|
||||
ChatHost = _root["server"]["chatserver"].get("host", "eqchat.eqemulator.net").asString();
|
||||
ChatPort = Strings::ToUnsignedInt(_root["server"]["chatserver"].get("port", "7778").asString());
|
||||
ChatPort = Strings::ToInt(_root["server"]["chatserver"].get("port", "7778").asString().c_str());
|
||||
MailHost = _root["server"]["mailserver"].get("host", "eqmail.eqemulator.net").asString();
|
||||
MailPort = Strings::ToUnsignedInt(_root["server"]["mailserver"].get("port", "7778").asString());
|
||||
MailPort = Strings::ToInt(_root["server"]["mailserver"].get("port", "7778").asString().c_str());
|
||||
|
||||
/**
|
||||
* Database
|
||||
@@ -119,7 +119,7 @@ void EQEmuConfig::parse_config()
|
||||
DatabaseUsername = _root["server"]["database"].get("username", "eq").asString();
|
||||
DatabasePassword = _root["server"]["database"].get("password", "eq").asString();
|
||||
DatabaseHost = _root["server"]["database"].get("host", "localhost").asString();
|
||||
DatabasePort = Strings::ToUnsignedInt(_root["server"]["database"].get("port", "3306").asString());
|
||||
DatabasePort = Strings::ToInt(_root["server"]["database"].get("port", "3306").asString().c_str());
|
||||
DatabaseDB = _root["server"]["database"].get("db", "eq").asString();
|
||||
|
||||
/**
|
||||
@@ -128,14 +128,14 @@ void EQEmuConfig::parse_config()
|
||||
ContentDbUsername = _root["server"]["content_database"].get("username", "").asString();
|
||||
ContentDbPassword = _root["server"]["content_database"].get("password", "").asString();
|
||||
ContentDbHost = _root["server"]["content_database"].get("host", "").asString();
|
||||
ContentDbPort = Strings::ToUnsignedInt(_root["server"]["content_database"].get("port", 0).asString());
|
||||
ContentDbPort = Strings::ToInt(_root["server"]["content_database"].get("port", 0).asString().c_str());
|
||||
ContentDbName = _root["server"]["content_database"].get("db", "").asString();
|
||||
|
||||
/**
|
||||
* QS
|
||||
*/
|
||||
QSDatabaseHost = _root["server"]["qsdatabase"].get("host", "localhost").asString();
|
||||
QSDatabasePort = Strings::ToUnsignedInt(_root["server"]["qsdatabase"].get("port", "3306").asString());
|
||||
QSDatabasePort = Strings::ToInt(_root["server"]["qsdatabase"].get("port", "3306").asString().c_str());
|
||||
QSDatabaseUsername = _root["server"]["qsdatabase"].get("username", "eq").asString();
|
||||
QSDatabasePassword = _root["server"]["qsdatabase"].get("password", "eq").asString();
|
||||
QSDatabaseDB = _root["server"]["qsdatabase"].get("db", "eq").asString();
|
||||
@@ -143,9 +143,9 @@ void EQEmuConfig::parse_config()
|
||||
/**
|
||||
* Zones
|
||||
*/
|
||||
DefaultStatus = Strings::ToUnsignedInt(_root["server"]["zones"].get("defaultstatus", 0).asString());
|
||||
ZonePortLow = Strings::ToUnsignedInt(_root["server"]["zones"]["ports"].get("low", "7000").asString());
|
||||
ZonePortHigh = Strings::ToUnsignedInt(_root["server"]["zones"]["ports"].get("high", "7999").asString());
|
||||
DefaultStatus = Strings::ToInt(_root["server"]["zones"].get("defaultstatus", 0).asString().c_str());
|
||||
ZonePortLow = Strings::ToInt(_root["server"]["zones"]["ports"].get("low", "7000").asString().c_str());
|
||||
ZonePortHigh = Strings::ToInt(_root["server"]["zones"]["ports"].get("high", "7999").asString().c_str());
|
||||
|
||||
/**
|
||||
* Files
|
||||
@@ -175,10 +175,10 @@ void EQEmuConfig::parse_config()
|
||||
/**
|
||||
* Launcher
|
||||
*/
|
||||
RestartWait = Strings::ToInt(_root["server"]["launcher"]["timers"].get("restart", "10000").asString());
|
||||
TerminateWait = Strings::ToInt(_root["server"]["launcher"]["timers"].get("reterminate", "10000").asString());
|
||||
InitialBootWait = Strings::ToInt(_root["server"]["launcher"]["timers"].get("initial", "20000").asString());
|
||||
ZoneBootInterval = Strings::ToInt(_root["server"]["launcher"]["timers"].get("interval", "2000").asString());
|
||||
RestartWait = Strings::ToInt(_root["server"]["launcher"]["timers"].get("restart", "10000").asString().c_str());
|
||||
TerminateWait = Strings::ToInt(_root["server"]["launcher"]["timers"].get("reterminate", "10000").asString().c_str());
|
||||
InitialBootWait = Strings::ToInt(_root["server"]["launcher"]["timers"].get("initial", "20000").asString().c_str());
|
||||
ZoneBootInterval = Strings::ToInt(_root["server"]["launcher"]["timers"].get("interval", "2000").asString().c_str());
|
||||
#ifdef WIN32
|
||||
ZoneExe = _root["server"]["launcher"].get("exe", "zone.exe").asString();
|
||||
#else
|
||||
|
||||
@@ -187,10 +187,9 @@ void EQEmuLogSys::ProcessLogWrite(
|
||||
uint16 EQEmuLogSys::GetGMSayColorFromCategory(uint16 log_category)
|
||||
{
|
||||
switch (log_category) {
|
||||
case Logs::Crash:
|
||||
case Logs::Error:
|
||||
case Logs::MySQLError:
|
||||
case Logs::QuestErrors:
|
||||
case Logs::Error:
|
||||
return Chat::Red;
|
||||
case Logs::MySQLQuery:
|
||||
case Logs::Debug:
|
||||
@@ -200,6 +199,8 @@ uint16 EQEmuLogSys::GetGMSayColorFromCategory(uint16 log_category)
|
||||
case Logs::Commands:
|
||||
case Logs::Mercenaries:
|
||||
return Chat::Magenta;
|
||||
case Logs::Crash:
|
||||
return Chat::Red;
|
||||
default:
|
||||
return Chat::Yellow;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace EQ
|
||||
_running = true;
|
||||
|
||||
for (size_t i = 0; i < threads; ++i) {
|
||||
_threads.emplace_back(std::thread(std::bind(&TaskScheduler::ProcessWork, this)));
|
||||
_threads.push_back(std::thread(std::bind(&TaskScheduler::ProcessWork, this)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -384,7 +384,7 @@ namespace PlayerEvent {
|
||||
};
|
||||
|
||||
struct AAPurchasedEvent {
|
||||
uint32 aa_id;
|
||||
int32 aa_id;
|
||||
int32 aa_cost;
|
||||
int32 aa_previous_id;
|
||||
int32 aa_next_id;
|
||||
|
||||
+18
-14
@@ -61,7 +61,7 @@ bool BaseGuildManager::LoadGuilds() {
|
||||
}
|
||||
|
||||
for (auto row=results.begin();row!=results.end();++row)
|
||||
_CreateGuild(Strings::ToUnsignedInt(row[0]), row[1], Strings::ToUnsignedInt(row[2]), Strings::ToUnsignedInt(row[3]), row[4], row[5], row[6], row[7]);
|
||||
_CreateGuild(Strings::ToInt(row[0]), row[1], Strings::ToInt(row[2]), Strings::ToInt(row[3]), row[4], row[5], row[6], row[7]);
|
||||
|
||||
LogInfo("Loaded [{}] Guilds", Strings::Commify(std::to_string(results.RowCount())));
|
||||
|
||||
@@ -75,8 +75,8 @@ bool BaseGuildManager::LoadGuilds() {
|
||||
|
||||
for (auto row=results.begin();row!=results.end();++row)
|
||||
{
|
||||
uint32 guild_id = Strings::ToUnsignedInt(row[0]);
|
||||
uint8 rankn = Strings::ToUnsignedInt(row[1]);
|
||||
uint32 guild_id = Strings::ToInt(row[0]);
|
||||
uint8 rankn = Strings::ToInt(row[1]);
|
||||
|
||||
if(rankn > GUILD_MAX_RANK) {
|
||||
LogGuilds("Found invalid (too high) rank [{}] for guild [{}], skipping", rankn, guild_id);
|
||||
@@ -131,7 +131,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) {
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
info = _CreateGuild(guild_id, row[0], Strings::ToUnsignedInt(row[1]), Strings::ToUnsignedInt(row[2]), row[3], row[4], row[5], row[6]);
|
||||
info = _CreateGuild(guild_id, row[0], Strings::ToInt(row[1]), Strings::ToInt(row[2]), row[3], row[4], row[5], row[6]);
|
||||
|
||||
query = StringFormat("SELECT guild_id, `rank`, title, can_hear, can_speak, can_invite, can_remove, can_promote, can_demote, can_motd, can_warpeace "
|
||||
"FROM guild_ranks WHERE guild_id=%lu", (unsigned long)guild_id);
|
||||
@@ -144,7 +144,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) {
|
||||
|
||||
for (auto row=results.begin();row!=results.end();++row)
|
||||
{
|
||||
uint8 rankn = Strings::ToUnsignedInt(row[1]);
|
||||
uint8 rankn = Strings::ToInt(row[1]);
|
||||
|
||||
if(rankn > GUILD_MAX_RANK) {
|
||||
LogGuilds("Found invalid (too high) rank [{}] for guild [{}], skipping", rankn, guild_id);
|
||||
@@ -787,7 +787,9 @@ bool BaseGuildManager::GetBankerFlag(uint32 CharID)
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
return Strings::ToBool(row[0]);
|
||||
bool IsBanker = Strings::ToInt(row[0]);
|
||||
|
||||
return IsBanker;
|
||||
}
|
||||
|
||||
bool BaseGuildManager::DBSetAltFlag(uint32 charid, bool is_alt)
|
||||
@@ -815,7 +817,9 @@ bool BaseGuildManager::GetAltFlag(uint32 CharID)
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
return Strings::ToBool(row[0]);
|
||||
bool IsAlt = Strings::ToInt(row[0]);
|
||||
|
||||
return IsAlt;
|
||||
}
|
||||
|
||||
bool BaseGuildManager::DBSetTributeFlag(uint32 charid, bool enabled) {
|
||||
@@ -869,18 +873,18 @@ bool BaseGuildManager::QueryWithLogging(std::string query, const char *errmsg) {
|
||||
" FROM `character_data` AS c LEFT JOIN `guild_members` AS g ON c.`id` = g.`char_id` "
|
||||
static void ProcessGuildMember(MySQLRequestRow row, CharGuildInfo &into) {
|
||||
//fields from `characer_`
|
||||
into.char_id = Strings::ToUnsignedInt(row[0]);
|
||||
into.char_id = Strings::ToInt(row[0]);
|
||||
into.char_name = row[1];
|
||||
into.class_ = Strings::ToUnsignedInt(row[2]);
|
||||
into.level = Strings::ToUnsignedInt(row[3]);
|
||||
into.class_ = Strings::ToInt(row[2]);
|
||||
into.level = Strings::ToInt(row[3]);
|
||||
into.time_last_on = Strings::ToUnsignedInt(row[4]);
|
||||
into.zone_id = Strings::ToUnsignedInt(row[5]);
|
||||
into.zone_id = Strings::ToInt(row[5]);
|
||||
|
||||
//fields from `guild_members`, leave at defaults if missing
|
||||
into.guild_id = row[6] ? Strings::ToUnsignedInt(row[6]) : GUILD_NONE;
|
||||
into.rank = row[7] ? Strings::ToUnsignedInt(row[7]) : (GUILD_MAX_RANK+1);
|
||||
into.guild_id = row[6] ? Strings::ToInt(row[6]) : GUILD_NONE;
|
||||
into.rank = row[7] ? Strings::ToInt(row[7]) : (GUILD_MAX_RANK+1);
|
||||
into.tribute_enable = row[8] ? (row[8][0] == '0'?false:true) : false;
|
||||
into.total_tribute = row[9] ? Strings::ToUnsignedInt(row[9]) : 0;
|
||||
into.total_tribute = row[9] ? Strings::ToInt(row[9]) : 0;
|
||||
into.last_tribute = row[10]? Strings::ToUnsignedInt(row[10]) : 0; //timestamp
|
||||
into.banker = row[11]? (row[11][0] == '0'?false:true) : false;
|
||||
into.public_note = row[12]? row[12] : "";
|
||||
|
||||
@@ -6690,7 +6690,7 @@ static WSInit wsinit_;
|
||||
if (params.empty()) { return Get(path, headers); }
|
||||
|
||||
std::string path_with_query = append_query_params(path, params);
|
||||
return Get(path_with_query, headers, progress);
|
||||
return Get(path_with_query.c_str(), headers, progress);
|
||||
}
|
||||
|
||||
inline Result ClientImpl::Get(const std::string &path, const Params ¶ms,
|
||||
@@ -6710,7 +6710,7 @@ static WSInit wsinit_;
|
||||
}
|
||||
|
||||
std::string path_with_query = append_query_params(path, params);
|
||||
return Get(path_with_query, headers, response_handler,
|
||||
return Get(path_with_query.c_str(), headers, response_handler,
|
||||
content_receiver, progress);
|
||||
}
|
||||
|
||||
@@ -6807,7 +6807,7 @@ static WSInit wsinit_;
|
||||
std::string content_type;
|
||||
const auto &body = detail::serialize_multipart_formdata(
|
||||
items, detail::make_multipart_data_boundary(), content_type);
|
||||
return Post(path, headers, body, content_type);
|
||||
return Post(path, headers, body, content_type.c_str());
|
||||
}
|
||||
|
||||
inline Result ClientImpl::Post(const std::string &path, const Headers &headers,
|
||||
@@ -6820,7 +6820,7 @@ static WSInit wsinit_;
|
||||
std::string content_type;
|
||||
const auto &body =
|
||||
detail::serialize_multipart_formdata(items, boundary, content_type);
|
||||
return Post(path, headers, body, content_type);
|
||||
return Post(path, headers, body, content_type.c_str());
|
||||
}
|
||||
|
||||
inline Result ClientImpl::Put(const std::string &path) {
|
||||
|
||||
@@ -203,12 +203,12 @@ namespace EQ
|
||||
void dumpBankItems();
|
||||
void dumpSharedBankItems();
|
||||
|
||||
void SetCustomItemData(uint32 character_id, int16 slot_id, const std::string &identifier, const std::string& value);
|
||||
void SetCustomItemData(uint32 character_id, int16 slot_id, const std::string &identifier, int value);
|
||||
void SetCustomItemData(uint32 character_id, int16 slot_id, const std::string &identifier, float value);
|
||||
void SetCustomItemData(uint32 character_id, int16 slot_id, const std::string &identifier, bool value);
|
||||
std::string GetCustomItemData(int16 slot_id, const std::string& identifier);
|
||||
static const int GetItemStatValue(uint32 item_id, const std::string& identifier);
|
||||
void SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, std::string value);
|
||||
void SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, int value);
|
||||
void SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, float value);
|
||||
void SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, bool value);
|
||||
std::string GetCustomItemData(int16 slot_id, std::string identifier);
|
||||
static const int GetItemStatValue(uint32 item_id, std::string identifier);
|
||||
protected:
|
||||
///////////////////////////////
|
||||
// Protected Methods
|
||||
|
||||
+3
-3
@@ -131,7 +131,7 @@ namespace EQ
|
||||
Mounts?
|
||||
Ornamentations?
|
||||
GuildBanners?
|
||||
Collectible?
|
||||
Collectible?
|
||||
Placeable?
|
||||
(others?)
|
||||
*/
|
||||
@@ -449,8 +449,8 @@ namespace EQ
|
||||
int8 Shielding; // PoP: Shielding %
|
||||
int8 StunResist; // PoP: Stun Resist %
|
||||
int8 StrikeThrough; // PoP: Strike Through %
|
||||
int32 ExtraDmgSkill;
|
||||
int32 ExtraDmgAmt;
|
||||
uint32 ExtraDmgSkill;
|
||||
uint32 ExtraDmgAmt;
|
||||
int8 SpellShield; // PoP: Spell Shield %
|
||||
int8 Avoidance; // PoP: Avoidance +
|
||||
int8 Accuracy; // PoP: Accuracy +
|
||||
|
||||
+39
-30
@@ -24,16 +24,16 @@
|
||||
#include "rulesys.h"
|
||||
#include "shareddb.h"
|
||||
#include "strings.h"
|
||||
|
||||
#include "util/uuid.h"
|
||||
//#include "../common/light_source.h"
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
//#include <iostream>
|
||||
|
||||
int32 NextItemInstSerialNumber = 1;
|
||||
uint32 NextItemInstSerialNumber = 1;
|
||||
|
||||
static inline int32 GetNextItemInstSerialNumber() {
|
||||
static inline uint32 GetNextItemInstSerialNumber() {
|
||||
|
||||
// The Bazaar relies on each item a client has up for Trade having a unique
|
||||
// identifier. This 'SerialNumber' is sent in Serialized item packets and
|
||||
@@ -45,7 +45,7 @@ static inline int32 GetNextItemInstSerialNumber() {
|
||||
// NextItemInstSerialNumber is the next one to hand out.
|
||||
//
|
||||
// It is very unlikely to reach 2,147,483,647. Maybe we should call abort(), rather than wrapping back to 1.
|
||||
if(NextItemInstSerialNumber >= INT_MAX)
|
||||
if(NextItemInstSerialNumber >= UINT_MAX)
|
||||
NextItemInstSerialNumber = 1;
|
||||
else
|
||||
NextItemInstSerialNumber++;
|
||||
@@ -56,13 +56,21 @@ static inline int32 GetNextItemInstSerialNumber() {
|
||||
//
|
||||
// class EQ::ItemInstance
|
||||
//
|
||||
EQ::ItemInstance::ItemInstance(const ItemData* item, int16 charges) {
|
||||
EQ::ItemInstance::ItemInstance(const ItemData* item, const std::string& guid, int16 charges) {
|
||||
m_use_type = ItemInstNormal;
|
||||
if(item) {
|
||||
m_item = new ItemData(*item);
|
||||
} else {
|
||||
m_item = nullptr;
|
||||
}
|
||||
|
||||
if (guid.empty()) {
|
||||
m_guid = EQ::Util::UUID::Generate().ToString();
|
||||
}
|
||||
else {
|
||||
m_guid = guid;
|
||||
}
|
||||
|
||||
m_charges = charges;
|
||||
m_price = 0;
|
||||
m_attuned = false;
|
||||
@@ -72,7 +80,7 @@ EQ::ItemInstance::ItemInstance(const ItemData* item, int16 charges) {
|
||||
else
|
||||
m_color = 0;
|
||||
m_merchantcount = 1;
|
||||
m_SerialNumber = GetNextItemInstSerialNumber();
|
||||
m_serial_number = GetNextItemInstSerialNumber();
|
||||
|
||||
m_exp = 0;
|
||||
m_evolveLvl = 0;
|
||||
@@ -85,9 +93,10 @@ EQ::ItemInstance::ItemInstance(const ItemData* item, int16 charges) {
|
||||
m_ornament_hero_model = 0;
|
||||
m_recast_timestamp = 0;
|
||||
m_new_id_file = 0;
|
||||
m_currentslot = 0;
|
||||
}
|
||||
|
||||
EQ::ItemInstance::ItemInstance(SharedDatabase *db, uint32 item_id, int16 charges) {
|
||||
EQ::ItemInstance::ItemInstance(SharedDatabase *db, uint32 item_id, const std::string& guid, int16 charges) {
|
||||
m_use_type = ItemInstNormal;
|
||||
m_item = db->GetItem(item_id);
|
||||
if(m_item) {
|
||||
@@ -97,6 +106,13 @@ EQ::ItemInstance::ItemInstance(SharedDatabase *db, uint32 item_id, int16 charges
|
||||
m_item = nullptr;
|
||||
}
|
||||
|
||||
if (guid.empty()) {
|
||||
m_guid = EQ::Util::UUID::Generate().ToString();
|
||||
}
|
||||
else {
|
||||
m_guid = guid;
|
||||
}
|
||||
|
||||
m_charges = charges;
|
||||
m_price = 0;
|
||||
m_merchantslot = 0;
|
||||
@@ -106,7 +122,7 @@ EQ::ItemInstance::ItemInstance(SharedDatabase *db, uint32 item_id, int16 charges
|
||||
else
|
||||
m_color = 0;
|
||||
m_merchantcount = 1;
|
||||
m_SerialNumber = GetNextItemInstSerialNumber();
|
||||
m_serial_number = GetNextItemInstSerialNumber();
|
||||
|
||||
m_exp = 0;
|
||||
m_evolveLvl = 0;
|
||||
@@ -119,17 +135,20 @@ EQ::ItemInstance::ItemInstance(SharedDatabase *db, uint32 item_id, int16 charges
|
||||
m_ornament_hero_model = 0;
|
||||
m_recast_timestamp = 0;
|
||||
m_new_id_file = 0;
|
||||
m_currentslot = 0;
|
||||
}
|
||||
|
||||
EQ::ItemInstance::ItemInstance(ItemInstTypes use_type) {
|
||||
m_use_type = use_type;
|
||||
|
||||
m_guid = EQ::Util::UUID::Generate().ToString();
|
||||
m_item = nullptr;
|
||||
m_charges = 0;
|
||||
m_price = 0;
|
||||
m_attuned = false;
|
||||
m_merchantslot = 0;
|
||||
m_color = 0;
|
||||
|
||||
m_serial_number = 0;
|
||||
m_exp = 0;
|
||||
m_evolveLvl = 0;
|
||||
m_activated = false;
|
||||
@@ -141,6 +160,8 @@ EQ::ItemInstance::ItemInstance(ItemInstTypes use_type) {
|
||||
m_ornament_hero_model = 0;
|
||||
m_recast_timestamp = 0;
|
||||
m_new_id_file = 0;
|
||||
m_currentslot = 0;
|
||||
m_merchantcount = 0;
|
||||
}
|
||||
|
||||
// Make a copy of an EQ::ItemInstance object
|
||||
@@ -152,6 +173,7 @@ EQ::ItemInstance::ItemInstance(const ItemInstance& copy)
|
||||
else
|
||||
m_item = nullptr;
|
||||
|
||||
m_guid = copy.m_guid;
|
||||
m_charges=copy.m_charges;
|
||||
m_price=copy.m_price;
|
||||
m_color=copy.m_color;
|
||||
@@ -176,7 +198,7 @@ EQ::ItemInstance::ItemInstance(const ItemInstance& copy)
|
||||
for (iter = copy.m_custom_data.begin(); iter != copy.m_custom_data.end(); ++iter) {
|
||||
m_custom_data[iter->first] = iter->second;
|
||||
}
|
||||
m_SerialNumber = copy.m_SerialNumber;
|
||||
m_serial_number = copy.m_serial_number;
|
||||
m_custom_data = copy.m_custom_data;
|
||||
m_timers = copy.m_timers;
|
||||
|
||||
@@ -610,7 +632,7 @@ bool EQ::ItemInstance::UpdateOrnamentationInfo() {
|
||||
SetOrnamentHeroModel(ornamentItem->HerosForgeModel);
|
||||
if (strlen(ornamentItem->IDFile) > 2)
|
||||
{
|
||||
SetOrnamentationIDFile(Strings::ToUnsignedInt(&ornamentItem->IDFile[2]));
|
||||
SetOrnamentationIDFile(Strings::ToInt(&ornamentItem->IDFile[2]));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -840,20 +862,7 @@ std::string EQ::ItemInstance::GetCustomDataString() const {
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
void EQ::ItemInstance::SetCustomDataString(const std::string& str)
|
||||
{
|
||||
auto components = Strings::Split(str, "^");
|
||||
auto value_count = components.size() / 2;
|
||||
|
||||
for (auto i = 0; i < value_count; i++) {
|
||||
auto identifier = components[i * 2];
|
||||
auto value = components[(i * 2) + 1];
|
||||
|
||||
SetCustomData(identifier, value);
|
||||
}
|
||||
}
|
||||
|
||||
std::string EQ::ItemInstance::GetCustomData(const std::string& identifier) {
|
||||
std::string EQ::ItemInstance::GetCustomData(std::string identifier) {
|
||||
std::map<std::string, std::string>::const_iterator iter = m_custom_data.find(identifier);
|
||||
if (iter != m_custom_data.end()) {
|
||||
return iter->second;
|
||||
@@ -862,33 +871,33 @@ std::string EQ::ItemInstance::GetCustomData(const std::string& identifier) {
|
||||
return "";
|
||||
}
|
||||
|
||||
void EQ::ItemInstance::SetCustomData(const std::string& identifier, const std::string& value) {
|
||||
void EQ::ItemInstance::SetCustomData(std::string identifier, std::string value) {
|
||||
DeleteCustomData(identifier);
|
||||
m_custom_data[identifier] = value;
|
||||
}
|
||||
|
||||
void EQ::ItemInstance::SetCustomData(const std::string& identifier, int value) {
|
||||
void EQ::ItemInstance::SetCustomData(std::string identifier, int value) {
|
||||
DeleteCustomData(identifier);
|
||||
std::stringstream ss;
|
||||
ss << value;
|
||||
m_custom_data[identifier] = ss.str();
|
||||
}
|
||||
|
||||
void EQ::ItemInstance::SetCustomData(const std::string& identifier, float value) {
|
||||
void EQ::ItemInstance::SetCustomData(std::string identifier, float value) {
|
||||
DeleteCustomData(identifier);
|
||||
std::stringstream ss;
|
||||
ss << value;
|
||||
m_custom_data[identifier] = ss.str();
|
||||
}
|
||||
|
||||
void EQ::ItemInstance::SetCustomData(const std::string& identifier, bool value) {
|
||||
void EQ::ItemInstance::SetCustomData(std::string identifier, bool value) {
|
||||
DeleteCustomData(identifier);
|
||||
std::stringstream ss;
|
||||
ss << value;
|
||||
m_custom_data[identifier] = ss.str();
|
||||
}
|
||||
|
||||
void EQ::ItemInstance::DeleteCustomData(const std::string& identifier) {
|
||||
void EQ::ItemInstance::DeleteCustomData(std::string identifier) {
|
||||
auto iter = m_custom_data.find(identifier);
|
||||
if (iter != m_custom_data.end()) {
|
||||
m_custom_data.erase(iter);
|
||||
|
||||
+14
-12
@@ -69,9 +69,9 @@ namespace EQ
|
||||
/////////////////////////
|
||||
|
||||
// Constructors/Destructor
|
||||
ItemInstance(const ItemData* item = nullptr, int16 charges = 0);
|
||||
ItemInstance(const ItemData* item, const std::string& guid, int16 charges);
|
||||
|
||||
ItemInstance(SharedDatabase *db, uint32 item_id, int16 charges = 0);
|
||||
ItemInstance(SharedDatabase *db, uint32 item_id, const std::string &guid, int16 charges);
|
||||
|
||||
ItemInstance(ItemInstTypes use_type);
|
||||
|
||||
@@ -79,6 +79,8 @@ namespace EQ
|
||||
|
||||
~ItemInstance();
|
||||
|
||||
inline std::string GetGuid() const { return m_guid; }
|
||||
|
||||
// Query item type
|
||||
bool IsType(item::ItemClass item_class) const;
|
||||
|
||||
@@ -175,13 +177,12 @@ namespace EQ
|
||||
void SetAttuned(bool flag) { m_attuned = flag; }
|
||||
|
||||
std::string GetCustomDataString() const;
|
||||
std::string GetCustomData(const std::string &identifier);
|
||||
void SetCustomDataString(const std::string& str);
|
||||
void SetCustomData(const std::string &identifier, const std::string& value);
|
||||
void SetCustomData(const std::string &identifier, int value);
|
||||
void SetCustomData(const std::string &identifier, float value);
|
||||
void SetCustomData(const std::string &identifier, bool value);
|
||||
void DeleteCustomData(const std::string& identifier);
|
||||
std::string GetCustomData(std::string identifier);
|
||||
void SetCustomData(std::string identifier, std::string value);
|
||||
void SetCustomData(std::string identifier, int value);
|
||||
void SetCustomData(std::string identifier, float value);
|
||||
void SetCustomData(std::string identifier, bool value);
|
||||
void DeleteCustomData(std::string identifier);
|
||||
|
||||
// Allows treatment of this object as though it were a pointer to m_item
|
||||
operator bool() const { return (m_item != nullptr); }
|
||||
@@ -226,8 +227,8 @@ namespace EQ
|
||||
std::string Serialize(int16 slot_id) const { InternalSerializedItem_Struct s; s.slot_id = slot_id; s.inst = (const void*)this; std::string ser; ser.assign((char*)&s, sizeof(InternalSerializedItem_Struct)); return ser; }
|
||||
void Serialize(OutBuffer& ob, int16 slot_id) const { InternalSerializedItem_Struct isi; isi.slot_id = slot_id; isi.inst = (const void*)this; ob.write((const char*)&isi, sizeof(isi)); }
|
||||
|
||||
inline int32 GetSerialNumber() const { return m_SerialNumber; }
|
||||
inline void SetSerialNumber(int32 id) { m_SerialNumber = id; }
|
||||
inline int32 GetSerialNumber() const { return m_serial_number; }
|
||||
inline void SetSerialNumber(int32 id) { m_serial_number = id; }
|
||||
|
||||
std::map<std::string, ::Timer>& GetTimers() { return m_timers; }
|
||||
void SetTimer(std::string name, uint32 time);
|
||||
@@ -304,6 +305,7 @@ namespace EQ
|
||||
|
||||
void _PutItem(uint8 index, ItemInstance* inst) { m_contents[index] = inst; }
|
||||
|
||||
std::string m_guid;
|
||||
ItemInstTypes m_use_type; // Usage type for item
|
||||
const ItemData* m_item; // Ptr to item data
|
||||
int16 m_charges; // # of charges for chargeable items
|
||||
@@ -313,7 +315,7 @@ namespace EQ
|
||||
int16 m_currentslot;
|
||||
bool m_attuned;
|
||||
int32 m_merchantcount; //number avaliable on the merchant, -1=unlimited
|
||||
int32 m_SerialNumber; // Unique identifier for this instance of an item. Needed for Bazaar.
|
||||
uint32 m_serial_number; // Unique identifier for this instance of an item. Needed for Bazaar.
|
||||
uint32 m_exp;
|
||||
int8 m_evolveLvl;
|
||||
bool m_activated;
|
||||
|
||||
+1
-1
@@ -151,7 +151,7 @@ static char *temp=nullptr;
|
||||
return false;
|
||||
}
|
||||
ptr++;
|
||||
uint32 id = Strings::ToUnsignedInt(field[id_pos]);
|
||||
uint32 id = Strings::ToInt(field[id_pos].c_str());
|
||||
items[id]=field;
|
||||
|
||||
for(i=0;i<10;i++) {
|
||||
|
||||
@@ -131,7 +131,7 @@ bool ParseAddress(const char* iAddress, uint32* oIP, uint16* oPort, char* errbuf
|
||||
if (*oIP == 0)
|
||||
return false;
|
||||
if (oPort)
|
||||
*oPort = Strings::ToUnsignedInt(sep.arg[1]);
|
||||
*oPort = Strings::ToInt(sep.arg[1]);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -7,7 +7,7 @@ EQ::Net::ConsoleServer::ConsoleServer(const std::string &addr, int port)
|
||||
m_server = std::make_unique<EQ::Net::TCPServer>();
|
||||
m_server->Listen(addr, port, false, [this](std::shared_ptr<EQ::Net::TCPConnection> connection) {
|
||||
ConsoleServerConnection *c = new ConsoleServerConnection(this, connection);
|
||||
m_connections.emplace(std::make_pair(c->GetUUID(), std::unique_ptr<ConsoleServerConnection>(c)));
|
||||
m_connections.insert(std::make_pair(c->GetUUID(), std::unique_ptr<ConsoleServerConnection>(c)));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ void EQ::Net::DaybreakConnectionManager::Connect(const std::string &addr, int po
|
||||
m_on_new_connection(connection);
|
||||
}
|
||||
|
||||
m_connections.emplace(std::make_pair(std::make_pair(addr, port), connection));
|
||||
m_connections.insert(std::make_pair(std::make_pair(addr, port), connection));
|
||||
}
|
||||
|
||||
void EQ::Net::DaybreakConnectionManager::Process()
|
||||
@@ -234,7 +234,7 @@ void EQ::Net::DaybreakConnectionManager::ProcessPacket(const std::string &endpoi
|
||||
if (m_on_new_connection) {
|
||||
m_on_new_connection(connection);
|
||||
}
|
||||
m_connections.emplace(std::make_pair(std::make_pair(endpoint, port), connection));
|
||||
m_connections.insert(std::make_pair(std::make_pair(endpoint, port), connection));
|
||||
connection->ProcessPacket(p);
|
||||
}
|
||||
else if (data[1] != OP_OutOfSession) {
|
||||
@@ -527,7 +527,7 @@ void EQ::Net::DaybreakConnection::AddToQueue(int stream, uint16_t seq, const Pac
|
||||
DynamicPacket *out = new DynamicPacket();
|
||||
out->PutPacket(0, p);
|
||||
|
||||
s->packet_queue.emplace(std::make_pair(seq, out));
|
||||
s->packet_queue.insert(std::make_pair(seq, out));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1427,7 +1427,7 @@ void EQ::Net::DaybreakConnection::InternalQueuePacket(Packet &p, int stream_id,
|
||||
static_cast<size_t>((m_rolling_ping * m_owner->m_options.resend_delay_factor) + m_owner->m_options.resend_delay_ms),
|
||||
m_owner->m_options.resend_delay_min,
|
||||
m_owner->m_options.resend_delay_max);
|
||||
stream->sent_packets.emplace(std::make_pair(stream->sequence_out, sent));
|
||||
stream->sent_packets.insert(std::make_pair(stream->sequence_out, sent));
|
||||
stream->sequence_out++;
|
||||
|
||||
InternalBufferedSend(first_packet);
|
||||
@@ -1459,7 +1459,7 @@ void EQ::Net::DaybreakConnection::InternalQueuePacket(Packet &p, int stream_id,
|
||||
static_cast<size_t>((m_rolling_ping * m_owner->m_options.resend_delay_factor) + m_owner->m_options.resend_delay_ms),
|
||||
m_owner->m_options.resend_delay_min,
|
||||
m_owner->m_options.resend_delay_max);
|
||||
stream->sent_packets.emplace(std::make_pair(stream->sequence_out, sent));
|
||||
stream->sent_packets.insert(std::make_pair(stream->sequence_out, sent));
|
||||
stream->sequence_out++;
|
||||
|
||||
InternalBufferedSend(packet);
|
||||
@@ -1483,7 +1483,7 @@ void EQ::Net::DaybreakConnection::InternalQueuePacket(Packet &p, int stream_id,
|
||||
static_cast<size_t>((m_rolling_ping * m_owner->m_options.resend_delay_factor) + m_owner->m_options.resend_delay_ms),
|
||||
m_owner->m_options.resend_delay_min,
|
||||
m_owner->m_options.resend_delay_max);
|
||||
stream->sent_packets.emplace(std::make_pair(stream->sequence_out, sent));
|
||||
stream->sent_packets.insert(std::make_pair(stream->sequence_out, sent));
|
||||
stream->sequence_out++;
|
||||
|
||||
InternalBufferedSend(packet);
|
||||
|
||||
@@ -22,7 +22,7 @@ void EQ::Net::EQStreamManager::SetOptions(const EQStreamManagerInterfaceOptions
|
||||
void EQ::Net::EQStreamManager::DaybreakNewConnection(std::shared_ptr<DaybreakConnection> connection)
|
||||
{
|
||||
std::shared_ptr<EQStream> stream(new EQStream(this, connection));
|
||||
m_streams.emplace(std::make_pair(connection, stream));
|
||||
m_streams.insert(std::make_pair(connection, stream));
|
||||
if (m_on_new_connection) {
|
||||
m_on_new_connection(stream);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ void EQ::Net::ServertalkClient::SendPacket(ServerPacket *p)
|
||||
|
||||
void EQ::Net::ServertalkClient::OnMessage(uint16_t opcode, std::function<void(uint16_t, EQ::Net::Packet&)> cb)
|
||||
{
|
||||
m_message_callbacks.emplace(std::make_pair(opcode, cb));
|
||||
m_message_callbacks.insert(std::make_pair(opcode, cb));
|
||||
}
|
||||
|
||||
void EQ::Net::ServertalkClient::OnMessage(std::function<void(uint16_t, EQ::Net::Packet&)> cb)
|
||||
|
||||
@@ -41,7 +41,7 @@ void EQ::Net::ServertalkLegacyClient::SendPacket(ServerPacket *p)
|
||||
|
||||
void EQ::Net::ServertalkLegacyClient::OnMessage(uint16_t opcode, std::function<void(uint16_t, EQ::Net::Packet&)> cb)
|
||||
{
|
||||
m_message_callbacks.emplace(std::make_pair(opcode, cb));
|
||||
m_message_callbacks.insert(std::make_pair(opcode, cb));
|
||||
}
|
||||
|
||||
void EQ::Net::ServertalkLegacyClient::OnMessage(std::function<void(uint16_t, EQ::Net::Packet&)> cb)
|
||||
|
||||
@@ -19,12 +19,12 @@ void EQ::Net::ServertalkServer::Listen(const ServertalkServerOptions& opts)
|
||||
|
||||
void EQ::Net::ServertalkServer::OnConnectionIdentified(const std::string &type, std::function<void(std::shared_ptr<ServertalkServerConnection>)> cb)
|
||||
{
|
||||
m_on_ident.emplace(std::make_pair(type, cb));
|
||||
m_on_ident.insert(std::make_pair(type, cb));
|
||||
}
|
||||
|
||||
void EQ::Net::ServertalkServer::OnConnectionRemoved(const std::string &type, std::function<void(std::shared_ptr<ServertalkServerConnection>)> cb)
|
||||
{
|
||||
m_on_disc.emplace(std::make_pair(type, cb));
|
||||
m_on_disc.insert(std::make_pair(type, cb));
|
||||
}
|
||||
|
||||
void EQ::Net::ServertalkServer::ConnectionDisconnected(ServertalkServerConnection *conn)
|
||||
@@ -75,7 +75,7 @@ void EQ::Net::ServertalkServer::ConnectionIdentified(ServertalkServerConnection
|
||||
else {
|
||||
std::vector<std::shared_ptr<EQ::Net::ServertalkServerConnection>> vec;
|
||||
vec.push_back(*iter);
|
||||
m_ident_connections.emplace(std::make_pair(conn->GetIdentifier(), vec));
|
||||
m_ident_connections.insert(std::make_pair(conn->GetIdentifier(), vec));
|
||||
}
|
||||
|
||||
m_unident_connections.erase(iter);
|
||||
|
||||
@@ -100,7 +100,7 @@ void EQ::Net::ServertalkServerConnection::SendPacket(ServerPacket *p)
|
||||
|
||||
void EQ::Net::ServertalkServerConnection::OnMessage(uint16_t opcode, std::function<void(uint16_t, EQ::Net::Packet&)> cb)
|
||||
{
|
||||
m_message_callbacks.emplace(std::make_pair(opcode, cb));
|
||||
m_message_callbacks.insert(std::make_pair(opcode, cb));
|
||||
}
|
||||
|
||||
void EQ::Net::ServertalkServerConnection::OnMessage(std::function<void(uint16_t, EQ::Net::Packet&)> cb)
|
||||
|
||||
@@ -1050,7 +1050,7 @@ namespace RoF
|
||||
{
|
||||
if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername))
|
||||
{
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||
|
||||
auto outapp =
|
||||
new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct));
|
||||
@@ -1069,7 +1069,7 @@ namespace RoF
|
||||
return;
|
||||
}
|
||||
//if(gjs->action == groupActLeave)
|
||||
// Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
|
||||
// Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||
|
||||
auto outapp =
|
||||
new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct));
|
||||
@@ -1099,7 +1099,7 @@ namespace RoF
|
||||
|
||||
for (int i = 0; i < 5; ++i)
|
||||
{
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->member_name[i]);
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]);
|
||||
if (gu2->membername[i][0] != '\0')
|
||||
{
|
||||
PacketLength += (22 + strlen(gu2->membername[i]) + 1);
|
||||
@@ -1169,7 +1169,7 @@ namespace RoF
|
||||
return;
|
||||
|
||||
}
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||
ENCODE_LENGTH_EXACT(GroupJoin_Struct);
|
||||
SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct);
|
||||
|
||||
|
||||
@@ -1101,7 +1101,7 @@ namespace RoF2
|
||||
{
|
||||
if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername))
|
||||
{
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||
|
||||
auto outapp =
|
||||
new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct));
|
||||
@@ -1120,7 +1120,7 @@ namespace RoF2
|
||||
return;
|
||||
}
|
||||
//if(gjs->action == groupActLeave)
|
||||
// Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
|
||||
// Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||
|
||||
auto outapp =
|
||||
new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct));
|
||||
@@ -1150,7 +1150,7 @@ namespace RoF2
|
||||
|
||||
for (int i = 0; i < 5; ++i)
|
||||
{
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->member_name[i]);
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]);
|
||||
if (gu2->membername[i][0] != '\0')
|
||||
{
|
||||
PacketLength += (22 + strlen(gu2->membername[i]) + 1);
|
||||
@@ -1220,7 +1220,7 @@ namespace RoF2
|
||||
return;
|
||||
|
||||
}
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||
ENCODE_LENGTH_EXACT(GroupJoin_Struct);
|
||||
SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct);
|
||||
|
||||
|
||||
@@ -2590,7 +2590,7 @@ struct GroupUpdate_Struct_Live { // New for Live
|
||||
|
||||
struct GroupMembers_Struct { // New for Live
|
||||
/*0000*/ uint32 membernumber; // Guess - number of member in the group (0 to 5?)
|
||||
/*0000*/ //char member_name[0]; // Member Name Null Terminated
|
||||
/*0000*/ //char membername[0]; // Member Name Null Terminated
|
||||
/*0000*/ uint8 unknown001[3]; // Seen 0
|
||||
/*0000*/ uint32 memberlevel; // Guess
|
||||
/*0000*/ uint8 unknown002[11]; // Seen 0
|
||||
@@ -2600,7 +2600,7 @@ struct GroupJoin_Struct_Live { // New for Live
|
||||
/*0000*/ uint32 unknown0000; // Matches unknown0136 from GroupFollow_Struct
|
||||
/*0004*/ uint32 action;
|
||||
/*0008*/ uint8 unknown0008[5]; // Seen 0
|
||||
/*0013*/ //char member_name[0]; // Null Terminated?
|
||||
/*0013*/ //char membername[0]; // Null Terminated?
|
||||
/*0000*/ uint8 unknown0013[3]; // Seen 0
|
||||
/*0000*/ uint32 unknown0016; // Matches unknown0132 from GroupFollow_Struct
|
||||
/*0000*/ uint8 unknown0020[11]; // Seen 0
|
||||
|
||||
@@ -2566,7 +2566,7 @@ struct GroupUpdate_Struct_Live { // New for Live
|
||||
|
||||
struct GroupMembers_Struct { // New for Live
|
||||
/*0000*/ uint32 membernumber; // Guess - number of member in the group (0 to 5?)
|
||||
/*0000*/ //char member_name[0]; // Member Name Null Terminated
|
||||
/*0000*/ //char membername[0]; // Member Name Null Terminated
|
||||
/*0000*/ uint8 unknown001[3]; // Seen 0
|
||||
/*0000*/ uint32 memberlevel; // Guess
|
||||
/*0000*/ uint8 unknown002[11]; // Seen 0
|
||||
@@ -2576,7 +2576,7 @@ struct GroupJoin_Struct_Live { // New for Live
|
||||
/*0000*/ uint32 unknown0000; // Matches unknown0136 from GroupFollow_Struct
|
||||
/*0004*/ uint32 action;
|
||||
/*0008*/ uint8 unknown0008[5]; // Seen 0
|
||||
/*0013*/ //char member_name[0]; // Null Terminated?
|
||||
/*0013*/ //char membername[0]; // Null Terminated?
|
||||
/*0000*/ uint8 unknown0013[3]; // Seen 0
|
||||
/*0000*/ uint32 unknown0016; // Matches unknown0132 from GroupFollow_Struct
|
||||
/*0000*/ uint8 unknown0020[11]; // Seen 0
|
||||
|
||||
@@ -785,7 +785,7 @@ namespace SoD
|
||||
{
|
||||
if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername))
|
||||
{
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||
|
||||
auto outapp =
|
||||
new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct));
|
||||
@@ -804,7 +804,7 @@ namespace SoD
|
||||
return;
|
||||
}
|
||||
//if(gjs->action == groupActLeave)
|
||||
// Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
|
||||
// Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||
|
||||
auto outapp =
|
||||
new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct));
|
||||
@@ -834,7 +834,7 @@ namespace SoD
|
||||
|
||||
for (int i = 0; i < 5; ++i)
|
||||
{
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->member_name[i]);
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]);
|
||||
if (gu2->membername[i][0] != '\0')
|
||||
{
|
||||
PacketLength += (22 + strlen(gu2->membername[i]) + 1);
|
||||
@@ -902,7 +902,7 @@ namespace SoD
|
||||
return;
|
||||
}
|
||||
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||
ENCODE_LENGTH_EXACT(GroupJoin_Struct);
|
||||
SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct);
|
||||
|
||||
|
||||
@@ -2085,7 +2085,7 @@ struct GroupUpdate_Struct_SoD { // New for SoD
|
||||
|
||||
struct GroupMembers_Struct { // New for SoD
|
||||
/*0000*/ uint32 membernumber; // Guess - number of member in the group (0 to 5?)
|
||||
/*0000*/ //char member_name[0]; // Member Name Null Terminated
|
||||
/*0000*/ //char membername[0]; // Member Name Null Terminated
|
||||
/*0000*/ uint8 unknown001[3]; // Seen 0
|
||||
/*0000*/ uint32 memberlevel; // Guess
|
||||
/*0000*/ uint8 unknown002[11]; // Seen 0
|
||||
@@ -2095,7 +2095,7 @@ struct GroupJoin_Struct_SoD { // New for SoD
|
||||
/*0000*/ uint32 unknown0000; // Matches unknown0136 from GroupFollow_Struct
|
||||
/*0004*/ uint32 action;
|
||||
/*0008*/ uint8 unknown0008[5]; // Seen 0
|
||||
/*0013*/ //char member_name[0]; // Null Terminated?
|
||||
/*0013*/ //char membername[0]; // Null Terminated?
|
||||
/*0000*/ uint8 unknown0013[3]; // Seen 0
|
||||
/*0000*/ uint32 unknown0016; // Matches unknown0132 from GroupFollow_Struct
|
||||
/*0000*/ uint8 unknown0020[11]; // Seen 0
|
||||
|
||||
@@ -927,7 +927,7 @@ namespace UF
|
||||
{
|
||||
if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername))
|
||||
{
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||
|
||||
auto outapp =
|
||||
new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct));
|
||||
@@ -947,7 +947,7 @@ namespace UF
|
||||
return;
|
||||
}
|
||||
//if(gjs->action == groupActLeave)
|
||||
// Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
|
||||
// Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||
|
||||
auto outapp =
|
||||
new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct));
|
||||
@@ -977,7 +977,7 @@ namespace UF
|
||||
|
||||
for (int i = 0; i < 5; ++i)
|
||||
{
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->member_name[i]);
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]);
|
||||
if (gu2->membername[i][0] != '\0')
|
||||
{
|
||||
PacketLength += (22 + strlen(gu2->membername[i]) + 1);
|
||||
@@ -1045,7 +1045,7 @@ namespace UF
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||
ENCODE_LENGTH_EXACT(GroupJoin_Struct);
|
||||
SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct);
|
||||
|
||||
|
||||
@@ -2128,7 +2128,7 @@ struct GroupUpdate_Struct_Underfoot { // New for Underfoot
|
||||
|
||||
struct GroupMembers_Struct { // New for Underfoot
|
||||
/*0000*/ uint32 membernumber; // Guess - number of member in the group (0 to 5?)
|
||||
/*0000*/ //char member_name[0]; // Member Name Null Terminated
|
||||
/*0000*/ //char membername[0]; // Member Name Null Terminated
|
||||
/*0000*/ uint8 unknown001[3]; // Seen 0
|
||||
/*0000*/ uint32 memberlevel; // Guess
|
||||
/*0000*/ uint8 unknown002[11]; // Seen 0
|
||||
@@ -2138,7 +2138,7 @@ struct GroupJoin_Struct_Underfoot { // New for Underfoot
|
||||
/*0000*/ uint32 unknown0000; // Matches unknown0136 from GroupFollow_Struct
|
||||
/*0004*/ uint32 action;
|
||||
/*0008*/ uint8 unknown0008[5]; // Seen 0
|
||||
/*0013*/ //char member_name[0]; // Null Terminated?
|
||||
/*0013*/ //char membername[0]; // Null Terminated?
|
||||
/*0000*/ uint8 unknown0013[3]; // Seen 0
|
||||
/*0000*/ uint32 unknown0016; // Matches unknown0132 from GroupFollow_Struct
|
||||
/*0000*/ uint8 unknown0020[11]; // Seen 0
|
||||
|
||||
@@ -64,7 +64,7 @@ void ProcLauncher::Process() {
|
||||
if(GetExitCodeProcess(cur->second->proc_info.hProcess, &res)) {
|
||||
//got exit code, see if its still running...
|
||||
if(res == STILL_ACTIVE) {
|
||||
++cur;
|
||||
cur++;
|
||||
continue;
|
||||
}
|
||||
//else, it died, handle properly
|
||||
@@ -76,7 +76,7 @@ void ProcLauncher::Process() {
|
||||
|
||||
//if we get here, the current process died.
|
||||
tmp = cur;
|
||||
++tmp;
|
||||
tmp++;
|
||||
ProcessTerminated(cur);
|
||||
cur = tmp;
|
||||
}
|
||||
@@ -174,7 +174,7 @@ ProcLauncher::ProcRef ProcLauncher::Launch(Spec *&to_launch) {
|
||||
std::vector<std::string>::iterator cur, end;
|
||||
cur = it->args.begin();
|
||||
end = it->args.end();
|
||||
for(; cur != end; ++cur) {
|
||||
for(; cur != end; cur++) {
|
||||
args += " ";
|
||||
args += *cur;
|
||||
}
|
||||
@@ -306,7 +306,7 @@ void ProcLauncher::TerminateAll(bool final) {
|
||||
std::map<ProcRef, Spec *>::iterator cur, end;
|
||||
cur = m_running.begin();
|
||||
end = m_running.end();
|
||||
for(; cur != end; ++cur) {
|
||||
for(; cur != end; cur++) {
|
||||
Terminate(cur->first, true);
|
||||
}
|
||||
} else {
|
||||
@@ -317,7 +317,7 @@ void ProcLauncher::TerminateAll(bool final) {
|
||||
std::map<ProcRef, Spec *>::iterator cur, end;
|
||||
cur = running.begin();
|
||||
end = running.end();
|
||||
for(; cur != end; ++cur) {
|
||||
for(; cur != end; cur++) {
|
||||
Terminate(cur->first, true);
|
||||
safe_delete(cur->second);
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ bool EQ::ProfanityManager::clear_database_entries(DBcore *db) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EQ::ProfanityManager::check_for_existing_entry(const std::string& profanity) {
|
||||
bool EQ::ProfanityManager::check_for_existing_entry(std::string profanity) {
|
||||
if (profanity.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace EQ
|
||||
private:
|
||||
static bool load_database_entries(DBcore *db);
|
||||
static bool clear_database_entries(DBcore *db);
|
||||
static bool check_for_existing_entry(const std::string& profanity);
|
||||
static bool check_for_existing_entry(std::string profanity);
|
||||
|
||||
};
|
||||
|
||||
|
||||
+3
-3
@@ -288,9 +288,9 @@ bool PTimerList::Load(Database *db) {
|
||||
PersistentTimer *cur;
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
type = Strings::ToUnsignedInt(row[0]);
|
||||
start_time = Strings::ToUnsignedInt(row[1]);
|
||||
timer_time = Strings::ToUnsignedInt(row[2]);
|
||||
type = Strings::ToInt(row[0]);
|
||||
start_time = strtoul(row[1], nullptr, 10);
|
||||
timer_time = strtoul(row[2], nullptr, 10);
|
||||
enabled = (row[3][0] == '1');
|
||||
|
||||
//if it expired allready, dont bother.
|
||||
|
||||
@@ -16,12 +16,11 @@
|
||||
#include "../../strings.h"
|
||||
#include <ctime>
|
||||
|
||||
|
||||
class BaseDataBucketsRepository {
|
||||
public:
|
||||
struct DataBuckets {
|
||||
uint64_t id;
|
||||
std::string key_;
|
||||
std::string key;
|
||||
std::string value;
|
||||
uint32_t expires;
|
||||
};
|
||||
@@ -35,7 +34,7 @@ public:
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"`key`",
|
||||
"key",
|
||||
"value",
|
||||
"expires",
|
||||
};
|
||||
@@ -45,7 +44,7 @@ public:
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"`key`",
|
||||
"key",
|
||||
"value",
|
||||
"expires",
|
||||
};
|
||||
@@ -89,7 +88,7 @@ public:
|
||||
DataBuckets e{};
|
||||
|
||||
e.id = 0;
|
||||
e.key_ = "";
|
||||
e.key = "";
|
||||
e.value = "";
|
||||
e.expires = 0;
|
||||
|
||||
@@ -117,9 +116,8 @@ public:
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
data_buckets_id
|
||||
)
|
||||
);
|
||||
@@ -129,7 +127,7 @@ public:
|
||||
DataBuckets e{};
|
||||
|
||||
e.id = strtoull(row[0], nullptr, 10);
|
||||
e.key_ = row[1] ? row[1] : "";
|
||||
e.key = row[1] ? row[1] : "";
|
||||
e.value = row[2] ? row[2] : "";
|
||||
e.expires = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
|
||||
@@ -165,7 +163,7 @@ public:
|
||||
|
||||
auto columns = Columns();
|
||||
|
||||
v.push_back(columns[1] + " = '" + Strings::Escape(e.key_) + "'");
|
||||
v.push_back(columns[1] + " = '" + Strings::Escape(e.key) + "'");
|
||||
v.push_back(columns[2] + " = '" + Strings::Escape(e.value) + "'");
|
||||
v.push_back(columns[3] + " = " + std::to_string(e.expires));
|
||||
|
||||
@@ -190,7 +188,7 @@ public:
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back("'" + Strings::Escape(e.key_) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.key) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.value) + "'");
|
||||
v.push_back(std::to_string(e.expires));
|
||||
|
||||
@@ -223,7 +221,7 @@ public:
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back("'" + Strings::Escape(e.key_) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.key) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.value) + "'");
|
||||
v.push_back(std::to_string(e.expires));
|
||||
|
||||
@@ -260,7 +258,7 @@ public:
|
||||
DataBuckets e{};
|
||||
|
||||
e.id = strtoull(row[0], nullptr, 10);
|
||||
e.key_ = row[1] ? row[1] : "";
|
||||
e.key = row[1] ? row[1] : "";
|
||||
e.value = row[2] ? row[2] : "";
|
||||
e.expires = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
|
||||
@@ -288,7 +286,7 @@ public:
|
||||
DataBuckets e{};
|
||||
|
||||
e.id = strtoull(row[0], nullptr, 10);
|
||||
e.key_ = row[1] ? row[1] : "";
|
||||
e.key = row[1] ? row[1] : "";
|
||||
e.value = row[2] ? row[2] : "";
|
||||
e.expires = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ public:
|
||||
std::string zone_id_list;
|
||||
std::string instance_version_list;
|
||||
int32_t ac;
|
||||
int64_t hp;
|
||||
int32_t hp;
|
||||
int32_t accuracy;
|
||||
int32_t slow_mitigation;
|
||||
int32_t attack;
|
||||
@@ -45,13 +45,10 @@ public:
|
||||
int32_t physical_resist;
|
||||
int32_t min_dmg;
|
||||
int32_t max_dmg;
|
||||
int64_t hp_regen_rate;
|
||||
int64_t hp_regen_per_second;
|
||||
int32_t hp_regen_rate;
|
||||
int32_t attack_delay;
|
||||
int32_t spell_scale;
|
||||
int32_t heal_scale;
|
||||
uint32_t avoidance;
|
||||
int32_t heroic_strikethrough;
|
||||
std::string special_abilities;
|
||||
};
|
||||
|
||||
@@ -89,12 +86,9 @@ public:
|
||||
"min_dmg",
|
||||
"max_dmg",
|
||||
"hp_regen_rate",
|
||||
"hp_regen_per_second",
|
||||
"attack_delay",
|
||||
"spell_scale",
|
||||
"heal_scale",
|
||||
"avoidance",
|
||||
"heroic_strikethrough",
|
||||
"special_abilities",
|
||||
};
|
||||
}
|
||||
@@ -128,12 +122,9 @@ public:
|
||||
"min_dmg",
|
||||
"max_dmg",
|
||||
"hp_regen_rate",
|
||||
"hp_regen_per_second",
|
||||
"attack_delay",
|
||||
"spell_scale",
|
||||
"heal_scale",
|
||||
"avoidance",
|
||||
"heroic_strikethrough",
|
||||
"special_abilities",
|
||||
};
|
||||
}
|
||||
@@ -201,12 +192,9 @@ public:
|
||||
e.min_dmg = 0;
|
||||
e.max_dmg = 0;
|
||||
e.hp_regen_rate = 0;
|
||||
e.hp_regen_per_second = 0;
|
||||
e.attack_delay = 0;
|
||||
e.spell_scale = 100;
|
||||
e.heal_scale = 100;
|
||||
e.avoidance = 0;
|
||||
e.heroic_strikethrough = 0;
|
||||
e.special_abilities = "";
|
||||
|
||||
return e;
|
||||
@@ -249,7 +237,7 @@ public:
|
||||
e.zone_id_list = row[2] ? row[2] : "";
|
||||
e.instance_version_list = row[3] ? row[3] : "";
|
||||
e.ac = static_cast<int32_t>(atoi(row[4]));
|
||||
e.hp = strtoll(row[5], nullptr, 10);
|
||||
e.hp = static_cast<int32_t>(atoi(row[5]));
|
||||
e.accuracy = static_cast<int32_t>(atoi(row[6]));
|
||||
e.slow_mitigation = static_cast<int32_t>(atoi(row[7]));
|
||||
e.attack = static_cast<int32_t>(atoi(row[8]));
|
||||
@@ -269,14 +257,11 @@ public:
|
||||
e.physical_resist = static_cast<int32_t>(atoi(row[22]));
|
||||
e.min_dmg = static_cast<int32_t>(atoi(row[23]));
|
||||
e.max_dmg = static_cast<int32_t>(atoi(row[24]));
|
||||
e.hp_regen_rate = strtoll(row[25], nullptr, 10);
|
||||
e.hp_regen_per_second = strtoll(row[26], nullptr, 10);
|
||||
e.attack_delay = static_cast<int32_t>(atoi(row[27]));
|
||||
e.spell_scale = static_cast<int32_t>(atoi(row[28]));
|
||||
e.heal_scale = static_cast<int32_t>(atoi(row[29]));
|
||||
e.avoidance = static_cast<uint32_t>(strtoul(row[30], nullptr, 10));
|
||||
e.heroic_strikethrough = static_cast<int32_t>(atoi(row[31]));
|
||||
e.special_abilities = row[32] ? row[32] : "";
|
||||
e.hp_regen_rate = static_cast<int32_t>(atoi(row[25]));
|
||||
e.attack_delay = static_cast<int32_t>(atoi(row[26]));
|
||||
e.spell_scale = static_cast<int32_t>(atoi(row[27]));
|
||||
e.heal_scale = static_cast<int32_t>(atoi(row[28]));
|
||||
e.special_abilities = row[29] ? row[29] : "";
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -336,13 +321,10 @@ public:
|
||||
v.push_back(columns[23] + " = " + std::to_string(e.min_dmg));
|
||||
v.push_back(columns[24] + " = " + std::to_string(e.max_dmg));
|
||||
v.push_back(columns[25] + " = " + std::to_string(e.hp_regen_rate));
|
||||
v.push_back(columns[26] + " = " + std::to_string(e.hp_regen_per_second));
|
||||
v.push_back(columns[27] + " = " + std::to_string(e.attack_delay));
|
||||
v.push_back(columns[28] + " = " + std::to_string(e.spell_scale));
|
||||
v.push_back(columns[29] + " = " + std::to_string(e.heal_scale));
|
||||
v.push_back(columns[30] + " = " + std::to_string(e.avoidance));
|
||||
v.push_back(columns[31] + " = " + std::to_string(e.heroic_strikethrough));
|
||||
v.push_back(columns[32] + " = '" + Strings::Escape(e.special_abilities) + "'");
|
||||
v.push_back(columns[26] + " = " + std::to_string(e.attack_delay));
|
||||
v.push_back(columns[27] + " = " + std::to_string(e.spell_scale));
|
||||
v.push_back(columns[28] + " = " + std::to_string(e.heal_scale));
|
||||
v.push_back(columns[29] + " = '" + Strings::Escape(e.special_abilities) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -390,12 +372,9 @@ public:
|
||||
v.push_back(std::to_string(e.min_dmg));
|
||||
v.push_back(std::to_string(e.max_dmg));
|
||||
v.push_back(std::to_string(e.hp_regen_rate));
|
||||
v.push_back(std::to_string(e.hp_regen_per_second));
|
||||
v.push_back(std::to_string(e.attack_delay));
|
||||
v.push_back(std::to_string(e.spell_scale));
|
||||
v.push_back(std::to_string(e.heal_scale));
|
||||
v.push_back(std::to_string(e.avoidance));
|
||||
v.push_back(std::to_string(e.heroic_strikethrough));
|
||||
v.push_back("'" + Strings::Escape(e.special_abilities) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
@@ -452,12 +431,9 @@ public:
|
||||
v.push_back(std::to_string(e.min_dmg));
|
||||
v.push_back(std::to_string(e.max_dmg));
|
||||
v.push_back(std::to_string(e.hp_regen_rate));
|
||||
v.push_back(std::to_string(e.hp_regen_per_second));
|
||||
v.push_back(std::to_string(e.attack_delay));
|
||||
v.push_back(std::to_string(e.spell_scale));
|
||||
v.push_back(std::to_string(e.heal_scale));
|
||||
v.push_back(std::to_string(e.avoidance));
|
||||
v.push_back(std::to_string(e.heroic_strikethrough));
|
||||
v.push_back("'" + Strings::Escape(e.special_abilities) + "'");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
@@ -497,7 +473,7 @@ public:
|
||||
e.zone_id_list = row[2] ? row[2] : "";
|
||||
e.instance_version_list = row[3] ? row[3] : "";
|
||||
e.ac = static_cast<int32_t>(atoi(row[4]));
|
||||
e.hp = strtoll(row[5], nullptr, 10);
|
||||
e.hp = static_cast<int32_t>(atoi(row[5]));
|
||||
e.accuracy = static_cast<int32_t>(atoi(row[6]));
|
||||
e.slow_mitigation = static_cast<int32_t>(atoi(row[7]));
|
||||
e.attack = static_cast<int32_t>(atoi(row[8]));
|
||||
@@ -517,14 +493,11 @@ public:
|
||||
e.physical_resist = static_cast<int32_t>(atoi(row[22]));
|
||||
e.min_dmg = static_cast<int32_t>(atoi(row[23]));
|
||||
e.max_dmg = static_cast<int32_t>(atoi(row[24]));
|
||||
e.hp_regen_rate = strtoll(row[25], nullptr, 10);
|
||||
e.hp_regen_per_second = strtoll(row[26], nullptr, 10);
|
||||
e.attack_delay = static_cast<int32_t>(atoi(row[27]));
|
||||
e.spell_scale = static_cast<int32_t>(atoi(row[28]));
|
||||
e.heal_scale = static_cast<int32_t>(atoi(row[29]));
|
||||
e.avoidance = static_cast<uint32_t>(strtoul(row[30], nullptr, 10));
|
||||
e.heroic_strikethrough = static_cast<int32_t>(atoi(row[31]));
|
||||
e.special_abilities = row[32] ? row[32] : "";
|
||||
e.hp_regen_rate = static_cast<int32_t>(atoi(row[25]));
|
||||
e.attack_delay = static_cast<int32_t>(atoi(row[26]));
|
||||
e.spell_scale = static_cast<int32_t>(atoi(row[27]));
|
||||
e.heal_scale = static_cast<int32_t>(atoi(row[28]));
|
||||
e.special_abilities = row[29] ? row[29] : "";
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -554,7 +527,7 @@ public:
|
||||
e.zone_id_list = row[2] ? row[2] : "";
|
||||
e.instance_version_list = row[3] ? row[3] : "";
|
||||
e.ac = static_cast<int32_t>(atoi(row[4]));
|
||||
e.hp = strtoll(row[5], nullptr, 10);
|
||||
e.hp = static_cast<int32_t>(atoi(row[5]));
|
||||
e.accuracy = static_cast<int32_t>(atoi(row[6]));
|
||||
e.slow_mitigation = static_cast<int32_t>(atoi(row[7]));
|
||||
e.attack = static_cast<int32_t>(atoi(row[8]));
|
||||
@@ -574,14 +547,11 @@ public:
|
||||
e.physical_resist = static_cast<int32_t>(atoi(row[22]));
|
||||
e.min_dmg = static_cast<int32_t>(atoi(row[23]));
|
||||
e.max_dmg = static_cast<int32_t>(atoi(row[24]));
|
||||
e.hp_regen_rate = strtoll(row[25], nullptr, 10);
|
||||
e.hp_regen_per_second = strtoll(row[26], nullptr, 10);
|
||||
e.attack_delay = static_cast<int32_t>(atoi(row[27]));
|
||||
e.spell_scale = static_cast<int32_t>(atoi(row[28]));
|
||||
e.heal_scale = static_cast<int32_t>(atoi(row[29]));
|
||||
e.avoidance = static_cast<uint32_t>(strtoul(row[30], nullptr, 10));
|
||||
e.heroic_strikethrough = static_cast<int32_t>(atoi(row[31]));
|
||||
e.special_abilities = row[32] ? row[32] : "";
|
||||
e.hp_regen_rate = static_cast<int32_t>(atoi(row[25]));
|
||||
e.attack_delay = static_cast<int32_t>(atoi(row[26]));
|
||||
e.spell_scale = static_cast<int32_t>(atoi(row[27]));
|
||||
e.heal_scale = static_cast<int32_t>(atoi(row[28]));
|
||||
e.special_abilities = row[29] ? row[29] : "";
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
|
||||
@@ -16,14 +16,11 @@
|
||||
#include "../../strings.h"
|
||||
#include <ctime>
|
||||
|
||||
|
||||
class BaseRaidMembersRepository {
|
||||
public:
|
||||
struct RaidMembers {
|
||||
uint64_t id;
|
||||
int32_t raidid;
|
||||
int32_t charid;
|
||||
int32_t bot_id;
|
||||
uint32_t groupid;
|
||||
int8_t _class;
|
||||
int8_t level;
|
||||
@@ -35,16 +32,14 @@ public:
|
||||
|
||||
static std::string PrimaryKey()
|
||||
{
|
||||
return std::string("id");
|
||||
return std::string("charid");
|
||||
}
|
||||
|
||||
static std::vector<std::string> Columns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"raidid",
|
||||
"charid",
|
||||
"bot_id",
|
||||
"groupid",
|
||||
"_class",
|
||||
"level",
|
||||
@@ -58,10 +53,8 @@ public:
|
||||
static std::vector<std::string> SelectColumns()
|
||||
{
|
||||
return {
|
||||
"id",
|
||||
"raidid",
|
||||
"charid",
|
||||
"bot_id",
|
||||
"groupid",
|
||||
"_class",
|
||||
"level",
|
||||
@@ -109,10 +102,8 @@ public:
|
||||
{
|
||||
RaidMembers e{};
|
||||
|
||||
e.id = 0;
|
||||
e.raidid = 0;
|
||||
e.charid = 0;
|
||||
e.bot_id = 0;
|
||||
e.groupid = 0;
|
||||
e._class = 0;
|
||||
e.level = 0;
|
||||
@@ -130,7 +121,7 @@ public:
|
||||
)
|
||||
{
|
||||
for (auto &raid_members : raid_memberss) {
|
||||
if (raid_members.id == raid_members_id) {
|
||||
if (raid_members.charid == raid_members_id) {
|
||||
return raid_members;
|
||||
}
|
||||
}
|
||||
@@ -145,9 +136,8 @@ public:
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
raid_members_id
|
||||
)
|
||||
);
|
||||
@@ -156,17 +146,15 @@ public:
|
||||
if (results.RowCount() == 1) {
|
||||
RaidMembers e{};
|
||||
|
||||
e.id = strtoull(row[0], nullptr, 10);
|
||||
e.raidid = static_cast<int32_t>(atoi(row[1]));
|
||||
e.charid = static_cast<int32_t>(atoi(row[2]));
|
||||
e.bot_id = static_cast<int32_t>(atoi(row[3]));
|
||||
e.groupid = static_cast<uint32_t>(strtoul(row[4], nullptr, 10));
|
||||
e._class = static_cast<int8_t>(atoi(row[5]));
|
||||
e.level = static_cast<int8_t>(atoi(row[6]));
|
||||
e.name = row[7] ? row[7] : "";
|
||||
e.isgroupleader = static_cast<int8_t>(atoi(row[8]));
|
||||
e.israidleader = static_cast<int8_t>(atoi(row[9]));
|
||||
e.islooter = static_cast<int8_t>(atoi(row[10]));
|
||||
e.raidid = static_cast<int32_t>(atoi(row[0]));
|
||||
e.charid = static_cast<int32_t>(atoi(row[1]));
|
||||
e.groupid = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e._class = static_cast<int8_t>(atoi(row[3]));
|
||||
e.level = static_cast<int8_t>(atoi(row[4]));
|
||||
e.name = row[5] ? row[5] : "";
|
||||
e.isgroupleader = static_cast<int8_t>(atoi(row[6]));
|
||||
e.israidleader = static_cast<int8_t>(atoi(row[7]));
|
||||
e.islooter = static_cast<int8_t>(atoi(row[8]));
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -200,16 +188,15 @@ public:
|
||||
|
||||
auto columns = Columns();
|
||||
|
||||
v.push_back(columns[1] + " = " + std::to_string(e.raidid));
|
||||
v.push_back(columns[2] + " = " + std::to_string(e.charid));
|
||||
v.push_back(columns[3] + " = " + std::to_string(e.bot_id));
|
||||
v.push_back(columns[4] + " = " + std::to_string(e.groupid));
|
||||
v.push_back(columns[5] + " = " + std::to_string(e._class));
|
||||
v.push_back(columns[6] + " = " + std::to_string(e.level));
|
||||
v.push_back(columns[7] + " = '" + Strings::Escape(e.name) + "'");
|
||||
v.push_back(columns[8] + " = " + std::to_string(e.isgroupleader));
|
||||
v.push_back(columns[9] + " = " + std::to_string(e.israidleader));
|
||||
v.push_back(columns[10] + " = " + std::to_string(e.islooter));
|
||||
v.push_back(columns[0] + " = " + std::to_string(e.raidid));
|
||||
v.push_back(columns[1] + " = " + std::to_string(e.charid));
|
||||
v.push_back(columns[2] + " = " + std::to_string(e.groupid));
|
||||
v.push_back(columns[3] + " = " + std::to_string(e._class));
|
||||
v.push_back(columns[4] + " = " + std::to_string(e.level));
|
||||
v.push_back(columns[5] + " = '" + Strings::Escape(e.name) + "'");
|
||||
v.push_back(columns[6] + " = " + std::to_string(e.isgroupleader));
|
||||
v.push_back(columns[7] + " = " + std::to_string(e.israidleader));
|
||||
v.push_back(columns[8] + " = " + std::to_string(e.islooter));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -217,7 +204,7 @@ public:
|
||||
TableName(),
|
||||
Strings::Implode(", ", v),
|
||||
PrimaryKey(),
|
||||
e.id
|
||||
e.charid
|
||||
)
|
||||
);
|
||||
|
||||
@@ -231,10 +218,8 @@ public:
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.raidid));
|
||||
v.push_back(std::to_string(e.charid));
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back(std::to_string(e.groupid));
|
||||
v.push_back(std::to_string(e._class));
|
||||
v.push_back(std::to_string(e.level));
|
||||
@@ -252,7 +237,7 @@ public:
|
||||
);
|
||||
|
||||
if (results.Success()) {
|
||||
e.id = results.LastInsertedID();
|
||||
e.charid = results.LastInsertedID();
|
||||
return e;
|
||||
}
|
||||
|
||||
@@ -271,10 +256,8 @@ public:
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.raidid));
|
||||
v.push_back(std::to_string(e.charid));
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back(std::to_string(e.groupid));
|
||||
v.push_back(std::to_string(e._class));
|
||||
v.push_back(std::to_string(e.level));
|
||||
@@ -315,17 +298,15 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
RaidMembers e{};
|
||||
|
||||
e.id = strtoull(row[0], nullptr, 10);
|
||||
e.raidid = static_cast<int32_t>(atoi(row[1]));
|
||||
e.charid = static_cast<int32_t>(atoi(row[2]));
|
||||
e.bot_id = static_cast<int32_t>(atoi(row[3]));
|
||||
e.groupid = static_cast<uint32_t>(strtoul(row[4], nullptr, 10));
|
||||
e._class = static_cast<int8_t>(atoi(row[5]));
|
||||
e.level = static_cast<int8_t>(atoi(row[6]));
|
||||
e.name = row[7] ? row[7] : "";
|
||||
e.isgroupleader = static_cast<int8_t>(atoi(row[8]));
|
||||
e.israidleader = static_cast<int8_t>(atoi(row[9]));
|
||||
e.islooter = static_cast<int8_t>(atoi(row[10]));
|
||||
e.raidid = static_cast<int32_t>(atoi(row[0]));
|
||||
e.charid = static_cast<int32_t>(atoi(row[1]));
|
||||
e.groupid = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e._class = static_cast<int8_t>(atoi(row[3]));
|
||||
e.level = static_cast<int8_t>(atoi(row[4]));
|
||||
e.name = row[5] ? row[5] : "";
|
||||
e.isgroupleader = static_cast<int8_t>(atoi(row[6]));
|
||||
e.israidleader = static_cast<int8_t>(atoi(row[7]));
|
||||
e.islooter = static_cast<int8_t>(atoi(row[8]));
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -350,17 +331,15 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
RaidMembers e{};
|
||||
|
||||
e.id = strtoull(row[0], nullptr, 10);
|
||||
e.raidid = static_cast<int32_t>(atoi(row[1]));
|
||||
e.charid = static_cast<int32_t>(atoi(row[2]));
|
||||
e.bot_id = static_cast<int32_t>(atoi(row[3]));
|
||||
e.groupid = static_cast<uint32_t>(strtoul(row[4], nullptr, 10));
|
||||
e._class = static_cast<int8_t>(atoi(row[5]));
|
||||
e.level = static_cast<int8_t>(atoi(row[6]));
|
||||
e.name = row[7] ? row[7] : "";
|
||||
e.isgroupleader = static_cast<int8_t>(atoi(row[8]));
|
||||
e.israidleader = static_cast<int8_t>(atoi(row[9]));
|
||||
e.islooter = static_cast<int8_t>(atoi(row[10]));
|
||||
e.raidid = static_cast<int32_t>(atoi(row[0]));
|
||||
e.charid = static_cast<int32_t>(atoi(row[1]));
|
||||
e.groupid = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e._class = static_cast<int8_t>(atoi(row[3]));
|
||||
e.level = static_cast<int8_t>(atoi(row[4]));
|
||||
e.name = row[5] ? row[5] : "";
|
||||
e.isgroupleader = static_cast<int8_t>(atoi(row[6]));
|
||||
e.israidleader = static_cast<int8_t>(atoi(row[7]));
|
||||
e.islooter = static_cast<int8_t>(atoi(row[8]));
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
|
||||
+3
-3
@@ -141,11 +141,11 @@ bool RuleManager::SetRule(const std::string &rule_name, const std::string &rule_
|
||||
|
||||
switch (type) {
|
||||
case IntRule:
|
||||
m_RuleIntValues[index] = Strings::ToInt(rule_value);
|
||||
m_RuleIntValues[index] = Strings::ToInt(rule_value.c_str());
|
||||
LogRules("Set rule [{}] to value [{}]", rule_name, m_RuleIntValues[index]);
|
||||
break;
|
||||
case RealRule:
|
||||
m_RuleRealValues[index] = Strings::ToFloat(rule_value);
|
||||
m_RuleRealValues[index] = Strings::ToFloat(rule_value.c_str());
|
||||
LogRules("Set rule [{}] to value [{:.2f}]", rule_name, m_RuleRealValues[index]);
|
||||
break;
|
||||
case BoolRule:
|
||||
@@ -369,7 +369,7 @@ void RuleManager::_SaveRule(Database *db, RuleType type, uint16 index) {
|
||||
break;
|
||||
}
|
||||
|
||||
const auto& rule_notes = _GetRuleNotes(type, index);
|
||||
const auto rule_notes = _GetRuleNotes(type, index);
|
||||
|
||||
const auto& l = RuleValuesRepository::GetWhere(
|
||||
*db,
|
||||
|
||||
+1
-6
@@ -93,9 +93,6 @@ RULE_INT(Character, ItemEnduranceRegenCap, 15, "Limit on endurance regeneration
|
||||
RULE_INT(Character, ItemExtraDmgCap, 150, "Cap for bonuses to melee skills like Bash, Frenzy, etc.")
|
||||
RULE_INT(Character, HasteCap, 100, "Haste cap for non-v3(over haste) haste")
|
||||
RULE_INT(Character, Hastev3Cap, 25, "Haste cap for v3(over haste) haste")
|
||||
RULE_BOOL(Character, HeroicStatsUseDataBucketsToScale, false, "Allows scaling the benefits a character receives from Heroic Stats using Data Buckets. Stacks with other Heroic Stats Mulitplier Rules.")
|
||||
RULE_REAL(Character, HeroicIntelligenceIncreaseSpellDmgMultiplier, 0.00, "Allows Heroic Intelligence to increase a Players Worn Spell Damage Stat from Equipment, for example, setting this rule to 1.00 will always grant 1 Spell Damage per 1 Heroic Intelligence")
|
||||
RULE_REAL(Character, HeroicWisdomIncreaseHealAmtMultiplier, 0.00, "Allows Heroic Wisdom to increase a Players Worn Heal Amount Stat from Equipment, for example, setting this rule to 1.00 will always grant 1 Heal Amount per 1 Heroic Wisdom")
|
||||
RULE_REAL(Character, HeroicStrengthMultiplier, 1.00, "Multplier scales benefits from Heroic Strength. Grants 25 Base Endurance, 0.05 Endurance Regen, 1 Melee Damage each Hit, and 1 Shield AC per 10 Heroic Strength.")
|
||||
RULE_REAL(Character, HeroicStaminaMultiplier, 1.00, "Multplier scales benefits from Heroic Stamina. Grants 25 Base Endurance, 0.05 Endurance Regen, 100 Base HP, and 0.5 HP Regen per 10 Heroic Stamina.")
|
||||
RULE_REAL(Character, HeroicAgilityMultiplier, 1.00, "Multplier scales benefits from Heroic Agility. Grants 25 Base Endurance, 0.05 Endurance Regen, and 1 Avoidance AC per 10 Heroic Agility. (Rule does not change Dodge Chance)")
|
||||
@@ -214,7 +211,6 @@ RULE_BOOL(Character, IgnoreLevelBasedHasteCaps, false, "Ignores hard coded level
|
||||
RULE_BOOL(Character, EnableRaidEXPModifier, true, "Enable or disable the raid experience modifier, default is true")
|
||||
RULE_BOOL(Character, EnableRaidMemberEXPModifier, true, "Enable or disable the raid experience modifier based on members in raid, default is true")
|
||||
RULE_BOOL(Character, LeaveCursorMoneyOnCorpse, false, "Enable or disable leaving cursor money on player corpses")
|
||||
RULE_BOOL(Character, ItemExtraSkillDamageCalcAsPercent, false, "If enabled, apply Item Extra Skill Damage as Percentage-based modifiers")
|
||||
RULE_CATEGORY_END()
|
||||
|
||||
RULE_CATEGORY(Mercs)
|
||||
@@ -274,6 +270,7 @@ RULE_BOOL(World, EnableTutorialButton, true, "Setting whether the Tutorial butto
|
||||
RULE_BOOL(World, EnableReturnHomeButton, true, "Setting whether the Return Home button should be active")
|
||||
RULE_INT(World, MaxLevelForTutorial, 10, "The highest level with which you can enter the tutorial")
|
||||
RULE_INT(World, TutorialZoneID, 189, "Zone ID of the tutorial")
|
||||
RULE_INT(World, GuildBankZoneID, 345, "Zone ID of the guild bank")
|
||||
RULE_INT(World, MinOfflineTimeToReturnHome, 21600, "Minimum offline time to activate the Return Home button. 21600 seconds is 6 Hours")
|
||||
RULE_INT(World, MaxClientsPerIP, -1, "Maximum number of clients allowed to connect per IP address if account status is < AddMaxClientsStatus. Default value: -1 (feature disabled)")
|
||||
RULE_INT(World, ExemptMaxClientsStatus, -1, "Exempt accounts from the MaxClientsPerIP and AddMaxClientsStatus rules, if their status is >= this value. Default value: -1 (feature disabled)")
|
||||
@@ -353,7 +350,6 @@ RULE_REAL(Watermap, FishingLineStepSize, 1, "Basic step size for fishing calc, t
|
||||
RULE_CATEGORY_END()
|
||||
|
||||
RULE_CATEGORY(Spells)
|
||||
RULE_BOOL(Spells, AllowExtraDmgSkill, false, "Allow ExtraDmgSkill from Items, Spells, and AAs to apply ExtraDmgAmt when the ExtraDmgSkill matches the casted Spells Skill Type.")
|
||||
RULE_INT(Spells, BaseCritChance, 0, "Base percentage chance that everyone has to crit a spell")
|
||||
RULE_INT(Spells, BaseCritRatio, 100, "Base percentage bonus to damage on a successful spell crit. 100=2xdamage")
|
||||
RULE_INT(Spells, WizCritLevel, 12, "Level wizards first get spell crits")
|
||||
@@ -582,7 +578,6 @@ RULE_BOOL(TaskSystem, RecordCompletedOptionalActivities, false, "Record complete
|
||||
RULE_BOOL(TaskSystem, KeepOneRecordPerCompletedTask, true, "Keep only one record per completed task")
|
||||
RULE_BOOL(TaskSystem, EnableTaskProximity, true, "Enable task proximity system")
|
||||
RULE_INT(TaskSystem, RequestCooldownTimerSeconds, 15, "Seconds between allowing characters to request tasks (live-like default: 15 seconds)")
|
||||
RULE_BOOL(TaskSystem, ExpRewardsIgnoreLevelBasedEXPMods, false, "Rewarding Level Based Exp will ignore Rule LevelBasedEXPMods if true")
|
||||
RULE_INT(TaskSystem, SharedTasksWorldProcessRate, 6000, "Timer interval (milliseconds) that shared tasks are processed in world")
|
||||
RULE_INT(TaskSystem, SharedTasksTerminateTimerMS, 120000, "Delay (milliseconds) until a shared task is terminated if requirements are no longer met after member removal (default: 2 minutes)")
|
||||
RULE_BOOL(TaskSystem, UpdateOneElementPerTask, true, "If true (live-like) task updates only increment the first matching activity. If false all matching elements will be incremented.")
|
||||
|
||||
+1
-1
@@ -294,7 +294,7 @@ void EQ::SayLinkEngine::generate_text()
|
||||
m_LinkText = "null";
|
||||
}
|
||||
|
||||
std::string EQ::SayLinkEngine::GenerateQuestSaylink(const std::string& saylink_text, bool silent, const std::string& link_name)
|
||||
std::string EQ::SayLinkEngine::GenerateQuestSaylink(std::string saylink_text, bool silent, std::string link_name)
|
||||
{
|
||||
uint32 saylink_id = 0;
|
||||
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ namespace EQ
|
||||
const std::string& LinkBody() { return m_LinkBody; } // contains string format: '<LinkBody>'
|
||||
const std::string& LinkText() { return m_LinkText; } // contains string format: '<LinkText>'
|
||||
|
||||
static std::string GenerateQuestSaylink(const std::string& saylink_text, bool silent, const std::string& link_name);
|
||||
static std::string GenerateQuestSaylink(std::string saylink_text, bool silent, std::string link_name);
|
||||
|
||||
void Reset();
|
||||
|
||||
|
||||
+1
-2
@@ -99,9 +99,8 @@ public:
|
||||
}
|
||||
}
|
||||
~Seperator() {
|
||||
for (int i=0; i<=maxargnum; i++) {
|
||||
for (int i=0; i<=maxargnum; i++)
|
||||
safe_delete_array(arg[i]);
|
||||
}
|
||||
safe_delete_array(arg);
|
||||
safe_delete_array(argplus);
|
||||
safe_delete_array(msg);
|
||||
|
||||
+214
-163
@@ -126,7 +126,7 @@ uint32 SharedDatabase::GetTotalTimeEntitledOnAccount(uint32 AccountID) {
|
||||
const std::string query = StringFormat("SELECT `time_played` FROM `character_data` WHERE `account_id` = %u", AccountID);
|
||||
auto results = QueryDatabase(query);
|
||||
for (auto& row = results.begin(); row != results.end(); ++row) {
|
||||
EntitledTime += Strings::ToUnsignedInt(row[0]);
|
||||
EntitledTime += Strings::ToInt(row[0]);
|
||||
}
|
||||
return EntitledTime;
|
||||
}
|
||||
@@ -228,8 +228,8 @@ bool SharedDatabase::VerifyInventory(uint32 account_id, int16 slot_id, const EQ:
|
||||
|
||||
auto& row = results.begin();
|
||||
|
||||
const uint32 id = Strings::ToUnsignedInt(row[0]);
|
||||
const uint16 charges = Strings::ToUnsignedInt(row[1]);
|
||||
const uint32 id = Strings::ToInt(row[0]);
|
||||
const uint16 charges = Strings::ToInt(row[1]);
|
||||
|
||||
uint16 expect_charges;
|
||||
|
||||
@@ -295,11 +295,11 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const EQ::ItemInstance*
|
||||
|
||||
// Update/Insert item
|
||||
const std::string query = StringFormat("REPLACE INTO inventory "
|
||||
"(charid, slotid, itemid, charges, instnodrop, custom_data, color, "
|
||||
"(guid, charid, slotid, itemid, charges, instnodrop, custom_data, color, "
|
||||
"augslot1, augslot2, augslot3, augslot4, augslot5, augslot6, ornamenticon, ornamentidfile, ornament_hero_model) "
|
||||
"VALUES( %lu, %lu, %lu, %lu, %lu, '%s', %lu, "
|
||||
"VALUES( '%s', %lu, %lu, %lu, %lu, %lu, '%s', %lu, "
|
||||
"%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu)",
|
||||
static_cast<unsigned long>(char_id), static_cast<unsigned long>(slot_id), static_cast<unsigned long>(inst->GetItem()->ID),
|
||||
inst->GetGuid().c_str(), static_cast<unsigned long>(char_id), static_cast<unsigned long>(slot_id), static_cast<unsigned long>(inst->GetItem()->ID),
|
||||
static_cast<unsigned long>(charges), static_cast<unsigned long>(inst->IsAttuned() ? 1 : 0),
|
||||
inst->GetCustomDataString().c_str(), static_cast<unsigned long>(inst->GetColor()),
|
||||
static_cast<unsigned long>(augslot[0]), static_cast<unsigned long>(augslot[1]), static_cast<unsigned long>(augslot[2]),
|
||||
@@ -343,11 +343,11 @@ bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const EQ::ItemInstance
|
||||
charges = 0x7FFF;
|
||||
|
||||
const std::string query = StringFormat("REPLACE INTO sharedbank "
|
||||
"(acctid, slotid, itemid, charges, custom_data, "
|
||||
"(guid, acctid, slotid, itemid, charges, custom_data, "
|
||||
"augslot1, augslot2, augslot3, augslot4, augslot5, augslot6) "
|
||||
"VALUES( %lu, %lu, %lu, %lu, '%s', "
|
||||
"VALUES( '%s', %lu, %lu, %lu, %lu, '%s', "
|
||||
"%lu, %lu, %lu, %lu, %lu, %lu)",
|
||||
static_cast<unsigned long>(account_id), static_cast<unsigned long>(slot_id), static_cast<unsigned long>(inst->GetItem()->ID),
|
||||
inst->GetGuid().c_str(), static_cast<unsigned long>(account_id), static_cast<unsigned long>(slot_id), static_cast<unsigned long>(inst->GetItem()->ID),
|
||||
static_cast<unsigned long>(charges), inst->GetCustomDataString().c_str(), static_cast<unsigned long>(augslot[0]),
|
||||
static_cast<unsigned long>(augslot[1]), static_cast<unsigned long>(augslot[2]), static_cast<unsigned long>(augslot[3]), static_cast<unsigned long>(augslot[4]),
|
||||
static_cast<unsigned long>(augslot[5]));
|
||||
@@ -481,7 +481,7 @@ bool SharedDatabase::SetStartingItems(PlayerProfile_Struct* pp, EQ::InventoryPro
|
||||
if(!myitem)
|
||||
continue;
|
||||
|
||||
const EQ::ItemInstance* myinst = CreateBaseItem(myitem, charges);
|
||||
const EQ::ItemInstance* myinst = CreateBaseItem(myitem, "", charges);
|
||||
|
||||
if(slot < 0)
|
||||
slot = inv->FindFreeSlot(0, 0);
|
||||
@@ -502,14 +502,14 @@ bool SharedDatabase::GetSharedBank(uint32 id, EQ::InventoryProfile *inv, bool is
|
||||
if (is_charid)
|
||||
query = StringFormat("SELECT sb.slotid, sb.itemid, sb.charges, "
|
||||
"sb.augslot1, sb.augslot2, sb.augslot3, "
|
||||
"sb.augslot4, sb.augslot5, sb.augslot6, sb.custom_data "
|
||||
"sb.augslot4, sb.augslot5, sb.augslot6, sb.custom_data, sb.guid "
|
||||
"FROM sharedbank sb INNER JOIN character_data ch "
|
||||
"ON ch.account_id=sb.acctid WHERE ch.id = %i ORDER BY sb.slotid",
|
||||
id);
|
||||
else
|
||||
query = StringFormat("SELECT slotid, itemid, charges, "
|
||||
"augslot1, augslot2, augslot3, "
|
||||
"augslot4, augslot5, augslot6, custom_data "
|
||||
"augslot4, augslot5, augslot6, custom_data, guid "
|
||||
"FROM sharedbank WHERE acctid=%i ORDER BY slotid",
|
||||
id);
|
||||
auto results = QueryDatabase(query);
|
||||
@@ -519,16 +519,16 @@ bool SharedDatabase::GetSharedBank(uint32 id, EQ::InventoryProfile *inv, bool is
|
||||
|
||||
for (auto& row = results.begin(); row != results.end(); ++row) {
|
||||
int16 slot_id = static_cast<int16>(Strings::ToInt(row[0]));
|
||||
uint32 item_id = Strings::ToUnsignedInt(row[1]);
|
||||
uint32 item_id = static_cast<uint32>(Strings::ToInt(row[1]));
|
||||
const int16 charges = static_cast<int16>(Strings::ToInt(row[2]));
|
||||
|
||||
uint32 aug[EQ::invaug::SOCKET_COUNT];
|
||||
aug[0] = Strings::ToUnsignedInt(row[3]);
|
||||
aug[1] = Strings::ToUnsignedInt(row[4]);
|
||||
aug[2] = Strings::ToUnsignedInt(row[5]);
|
||||
aug[3] = Strings::ToUnsignedInt(row[6]);
|
||||
aug[4] = Strings::ToUnsignedInt(row[7]);
|
||||
aug[5] = Strings::ToUnsignedInt(row[8]);
|
||||
aug[0] = static_cast<uint32>(Strings::ToInt(row[3]));
|
||||
aug[1] = static_cast<uint32>(Strings::ToInt(row[4]));
|
||||
aug[2] = static_cast<uint32>(Strings::ToInt(row[5]));
|
||||
aug[3] = static_cast<uint32>(Strings::ToInt(row[6]));
|
||||
aug[4] = static_cast<uint32>(Strings::ToInt(row[7]));
|
||||
aug[5] = static_cast<uint32>(Strings::ToInt(row[8]));
|
||||
|
||||
const EQ::ItemData *item = GetItem(item_id);
|
||||
|
||||
@@ -538,7 +538,9 @@ bool SharedDatabase::GetSharedBank(uint32 id, EQ::InventoryProfile *inv, bool is
|
||||
continue;
|
||||
}
|
||||
|
||||
EQ::ItemInstance *inst = CreateBaseItem(item, charges);
|
||||
std::string guid = row[10];
|
||||
|
||||
EQ::ItemInstance *inst = CreateBaseItem(item, guid, charges);
|
||||
if (inst && item->IsClassCommon()) {
|
||||
for (int i = EQ::invaug::SOCKET_BEGIN; i <= EQ::invaug::SOCKET_END; i++) {
|
||||
if (aug[i])
|
||||
@@ -548,7 +550,27 @@ bool SharedDatabase::GetSharedBank(uint32 id, EQ::InventoryProfile *inv, bool is
|
||||
|
||||
if (inst && row[9]) {
|
||||
std::string data_str(row[9]);
|
||||
inst->SetCustomDataString(data_str);
|
||||
std::string idAsString;
|
||||
std::string value;
|
||||
bool use_id = true;
|
||||
|
||||
for (int i = 0; i < data_str.length(); ++i) {
|
||||
if (data_str[i] == '^') {
|
||||
if (!use_id) {
|
||||
inst->SetCustomData(idAsString, value);
|
||||
idAsString.clear();
|
||||
value.clear();
|
||||
}
|
||||
use_id = !use_id;
|
||||
continue;
|
||||
}
|
||||
|
||||
const char v = data_str[i];
|
||||
if (use_id)
|
||||
idAsString.push_back(v);
|
||||
else
|
||||
value.push_back(v);
|
||||
}
|
||||
}
|
||||
|
||||
// theoretically inst can be nullptr ... this would be very bad ...
|
||||
@@ -578,7 +600,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQ::InventoryProfile *inv)
|
||||
// Retrieve character inventory
|
||||
const std::string query =
|
||||
StringFormat("SELECT slotid, itemid, charges, color, augslot1, augslot2, augslot3, augslot4, augslot5, "
|
||||
"augslot6, instnodrop, custom_data, ornamenticon, ornamentidfile, ornament_hero_model FROM "
|
||||
"augslot6, instnodrop, custom_data, ornamenticon, ornamentidfile, ornament_hero_model, guid FROM "
|
||||
"inventory WHERE charid = %i ORDER BY slotid",
|
||||
char_id);
|
||||
auto results = QueryDatabase(query);
|
||||
@@ -625,8 +647,8 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQ::InventoryProfile *inv)
|
||||
}
|
||||
}
|
||||
|
||||
uint32 item_id = Strings::ToUnsignedInt(row[1]);
|
||||
const uint16 charges = Strings::ToUnsignedInt(row[2]);
|
||||
uint32 item_id = Strings::ToInt(row[1]);
|
||||
const uint16 charges = Strings::ToInt(row[2]);
|
||||
const uint32 color = Strings::ToUnsignedInt(row[3]);
|
||||
|
||||
uint32 aug[EQ::invaug::SOCKET_COUNT];
|
||||
@@ -638,7 +660,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQ::InventoryProfile *inv)
|
||||
aug[4] = Strings::ToUnsignedInt(row[8]);
|
||||
aug[5] = Strings::ToUnsignedInt(row[9]);
|
||||
|
||||
const bool instnodrop = (row[10] && static_cast<uint16>(Strings::ToUnsignedInt(row[10])));
|
||||
const bool instnodrop = (row[10] && static_cast<uint16>(Strings::ToInt(row[10]))) ? true : false;
|
||||
|
||||
const uint32 ornament_icon = Strings::ToUnsignedInt(row[12]);
|
||||
const uint32 ornament_idfile = Strings::ToUnsignedInt(row[13]);
|
||||
@@ -652,14 +674,36 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQ::InventoryProfile *inv)
|
||||
continue;
|
||||
}
|
||||
|
||||
EQ::ItemInstance *inst = CreateBaseItem(item, charges);
|
||||
std::string guid = row[15];
|
||||
EQ::ItemInstance *inst = CreateBaseItem(item, guid, charges);
|
||||
|
||||
if (inst == nullptr)
|
||||
continue;
|
||||
|
||||
if (row[11]) {
|
||||
std::string data_str(row[11]);
|
||||
inst->SetCustomDataString(data_str);
|
||||
std::string idAsString;
|
||||
std::string value;
|
||||
bool use_id = true;
|
||||
|
||||
for (int i = 0; i < data_str.length(); ++i) {
|
||||
if (data_str[i] == '^') {
|
||||
if (!use_id) {
|
||||
inst->SetCustomData(idAsString, value);
|
||||
idAsString.clear();
|
||||
value.clear();
|
||||
}
|
||||
|
||||
use_id = !use_id;
|
||||
continue;
|
||||
}
|
||||
|
||||
const char v = data_str[i];
|
||||
if (use_id)
|
||||
idAsString.push_back(v);
|
||||
else
|
||||
value.push_back(v);
|
||||
}
|
||||
}
|
||||
|
||||
inst->SetOrnamentIcon(ornament_icon);
|
||||
@@ -740,7 +784,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, EQ::InventoryPr
|
||||
const std::string query =
|
||||
StringFormat("SELECT slotid, itemid, charges, color, augslot1, "
|
||||
"augslot2, augslot3, augslot4, augslot5, augslot6, instnodrop, custom_data, ornamenticon, "
|
||||
"ornamentidfile, ornament_hero_model "
|
||||
"ornamentidfile, ornament_hero_model, guid "
|
||||
"FROM inventory INNER JOIN character_data ch "
|
||||
"ON ch.id = charid WHERE ch.name = '%s' AND ch.account_id = %i ORDER BY slotid",
|
||||
name, account_id);
|
||||
@@ -754,19 +798,19 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, EQ::InventoryPr
|
||||
|
||||
for (auto& row = results.begin(); row != results.end(); ++row) {
|
||||
int16 slot_id = Strings::ToInt(row[0]);
|
||||
uint32 item_id = Strings::ToUnsignedInt(row[1]);
|
||||
uint32 item_id = Strings::ToInt(row[1]);
|
||||
const int8 charges = Strings::ToInt(row[2]);
|
||||
const uint32 color = Strings::ToUnsignedInt(row[3]);
|
||||
|
||||
uint32 aug[EQ::invaug::SOCKET_COUNT];
|
||||
aug[0] = Strings::ToUnsignedInt(row[4]);
|
||||
aug[1] = Strings::ToUnsignedInt(row[5]);
|
||||
aug[2] = Strings::ToUnsignedInt(row[6]);
|
||||
aug[3] = Strings::ToUnsignedInt(row[7]);
|
||||
aug[4] = Strings::ToUnsignedInt(row[8]);
|
||||
aug[5] = Strings::ToUnsignedInt(row[9]);
|
||||
aug[0] = static_cast<uint32>(Strings::ToInt(row[4]));
|
||||
aug[1] = static_cast<uint32>(Strings::ToInt(row[5]));
|
||||
aug[2] = static_cast<uint32>(Strings::ToInt(row[6]));
|
||||
aug[3] = static_cast<uint32>(Strings::ToInt(row[7]));
|
||||
aug[4] = static_cast<uint32>(Strings::ToInt(row[8]));
|
||||
aug[5] = static_cast<uint32>(Strings::ToInt(row[9]));
|
||||
|
||||
const bool instnodrop = (row[10] && static_cast<uint16>(Strings::ToUnsignedInt(row[10])));
|
||||
const bool instnodrop = (row[10] && static_cast<uint16>(Strings::ToInt(row[10]))) ? true : false;
|
||||
const uint32 ornament_icon = Strings::ToUnsignedInt(row[12]);
|
||||
const uint32 ornament_idfile = Strings::ToUnsignedInt(row[13]);
|
||||
uint32 ornament_hero_model = Strings::ToUnsignedInt(row[14]);
|
||||
@@ -775,7 +819,9 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, EQ::InventoryPr
|
||||
if (!item)
|
||||
continue;
|
||||
|
||||
EQ::ItemInstance *inst = CreateBaseItem(item, charges);
|
||||
std::string guid = row[15];
|
||||
|
||||
EQ::ItemInstance *inst = CreateBaseItem(item, guid, charges);
|
||||
|
||||
if (inst == nullptr)
|
||||
continue;
|
||||
@@ -784,7 +830,28 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, EQ::InventoryPr
|
||||
|
||||
if (row[11]) {
|
||||
std::string data_str(row[11]);
|
||||
inst->SetCustomDataString(data_str);
|
||||
std::string idAsString;
|
||||
std::string value;
|
||||
bool use_id = true;
|
||||
|
||||
for (int i = 0; i < data_str.length(); ++i) {
|
||||
if (data_str[i] == '^') {
|
||||
if (!use_id) {
|
||||
inst->SetCustomData(idAsString, value);
|
||||
idAsString.clear();
|
||||
value.clear();
|
||||
}
|
||||
|
||||
use_id = !use_id;
|
||||
continue;
|
||||
}
|
||||
|
||||
const char v = data_str[i];
|
||||
if (use_id)
|
||||
idAsString.push_back(v);
|
||||
else
|
||||
value.push_back(v);
|
||||
}
|
||||
}
|
||||
|
||||
inst->SetOrnamentIcon(ornament_icon);
|
||||
@@ -843,7 +910,7 @@ uint32 SharedDatabase::GetItemRecastTimestamp(uint32 char_id, uint32 recast_type
|
||||
return 0;
|
||||
|
||||
auto& row = results.begin();
|
||||
return Strings::ToUnsignedInt(row[0]);
|
||||
return static_cast<uint32>(Strings::ToUnsignedInt(row[0]));
|
||||
}
|
||||
|
||||
void SharedDatabase::ClearOldRecastTimestamps(uint32 char_id)
|
||||
@@ -871,10 +938,10 @@ void SharedDatabase::GetItemsCount(int32 &item_count, uint32 &max_id)
|
||||
auto& row = results.begin();
|
||||
|
||||
if (row[0])
|
||||
max_id = Strings::ToUnsignedInt(row[0]);
|
||||
max_id = Strings::ToInt(row[0]);
|
||||
|
||||
if (row[1])
|
||||
item_count = Strings::ToUnsignedInt(row[1]);
|
||||
item_count = Strings::ToInt(row[1]);
|
||||
}
|
||||
|
||||
bool SharedDatabase::LoadItems(const std::string &prefix) {
|
||||
@@ -963,24 +1030,24 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
||||
strn0cpy(item.Lore, row[ItemField::lore], sizeof(item.Lore));
|
||||
|
||||
// Flags
|
||||
item.ArtifactFlag = Strings::ToBool(row[ItemField::artifactflag]);
|
||||
item.Attuneable = !disable_attuneable && Strings::ToBool(row[ItemField::attuneable]);
|
||||
item.BenefitFlag = Strings::ToBool(row[ItemField::benefitflag]);
|
||||
item.FVNoDrop = Strings::ToBool(row[ItemField::fvnodrop]);
|
||||
item.Magic = Strings::ToBool(row[ItemField::magic]);
|
||||
item.ArtifactFlag = Strings::ToInt(row[ItemField::artifactflag]) ? true : false;
|
||||
item.Attuneable = disable_attuneable ? false : Strings::ToInt(row[ItemField::attuneable]) ? true : false;
|
||||
item.BenefitFlag = Strings::ToInt(row[ItemField::benefitflag]) ? true : false;
|
||||
item.FVNoDrop = Strings::ToInt(row[ItemField::fvnodrop]) ? true : false;
|
||||
item.Magic = Strings::ToInt(row[ItemField::magic]) ? true : false;
|
||||
item.NoDrop = disable_no_drop ? static_cast<uint8>(255) : static_cast<uint8>(Strings::ToUnsignedInt(row[ItemField::nodrop]));
|
||||
item.NoPet = !disable_no_pet && Strings::ToBool(row[ItemField::nopet]);
|
||||
item.NoPet = disable_no_pet ? false : Strings::ToInt(row[ItemField::nopet]) ? true : false;
|
||||
item.NoRent = disable_no_rent ? static_cast<uint8>(255) : static_cast<uint8>(Strings::ToUnsignedInt(row[ItemField::norent]));
|
||||
item.NoTransfer = !disable_no_transfer && Strings::ToBool(row[ItemField::notransfer]);
|
||||
item.PendingLoreFlag = Strings::ToBool(row[ItemField::pendingloreflag]);
|
||||
item.QuestItemFlag = Strings::ToBool(row[ItemField::questitemflag]);
|
||||
item.Stackable = Strings::ToBool(row[ItemField::stackable]);
|
||||
item.Tradeskills = Strings::ToBool(row[ItemField::tradeskills]);
|
||||
item.SummonedFlag = Strings::ToBool(row[ItemField::summonedflag]);
|
||||
item.NoTransfer = disable_no_transfer ? false : Strings::ToInt(row[ItemField::notransfer]) ? true : false;
|
||||
item.PendingLoreFlag = Strings::ToInt(row[ItemField::pendingloreflag]) ? true : false;
|
||||
item.QuestItemFlag = Strings::ToInt(row[ItemField::questitemflag]) ? true : false;
|
||||
item.Stackable = Strings::ToInt(row[ItemField::stackable]) ? true : false;
|
||||
item.Tradeskills = Strings::ToInt(row[ItemField::tradeskills]) ? true : false;
|
||||
item.SummonedFlag = Strings::ToInt(row[ItemField::summonedflag]) ? true : false;
|
||||
|
||||
// Lore
|
||||
item.LoreGroup = disable_lore ? 0 : Strings::ToInt(row[ItemField::loregroup]);
|
||||
item.LoreFlag = !disable_lore && item.LoreGroup != 0;
|
||||
item.LoreFlag = disable_lore ? false : item.LoreGroup != 0;
|
||||
|
||||
// Type
|
||||
item.AugType = Strings::ToUnsignedInt(row[ItemField::augtype]);
|
||||
@@ -996,7 +1063,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
||||
item.Weight = Strings::ToInt(row[ItemField::weight]);
|
||||
|
||||
// Potion Belt
|
||||
item.PotionBelt = !disable_potion_belt && Strings::ToBool(row[ItemField::potionbelt]);
|
||||
item.PotionBelt = disable_potion_belt ? false : Strings::ToInt(row[ItemField::potionbelt]) ? true : false;
|
||||
item.PotionBeltSlots = disable_potion_belt ? 0 : static_cast<uint8>(Strings::ToUnsignedInt(row[ItemField::potionbeltslots]));
|
||||
|
||||
// Merchant
|
||||
@@ -1107,8 +1174,8 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
||||
item.SkillModType = Strings::ToUnsignedInt(row[ItemField::skillmodtype]);
|
||||
|
||||
// Extra Damage Skill
|
||||
item.ExtraDmgSkill = Strings::ToInt(row[ItemField::extradmgskill]);
|
||||
item.ExtraDmgAmt = Strings::ToInt(row[ItemField::extradmgamt]);
|
||||
item.ExtraDmgSkill = Strings::ToUnsignedInt(row[ItemField::extradmgskill]);
|
||||
item.ExtraDmgAmt = Strings::ToUnsignedInt(row[ItemField::extradmgamt]);
|
||||
|
||||
// Bard
|
||||
item.BardType = Strings::ToUnsignedInt(row[ItemField::bardtype]);
|
||||
@@ -1307,8 +1374,8 @@ void SharedDatabase::GetFactionListInfo(uint32 &list_count, uint32 &max_lists) {
|
||||
|
||||
auto& row = results.begin();
|
||||
|
||||
list_count = Strings::ToUnsignedInt(row[0]);
|
||||
max_lists = Strings::ToUnsignedInt(row[1] ? row[1] : "0");
|
||||
list_count = static_cast<uint32>(Strings::ToUnsignedInt(row[0]));
|
||||
max_lists = static_cast<uint32>(Strings::ToUnsignedInt(row[1] ? row[1] : "0"));
|
||||
}
|
||||
|
||||
const NPCFactionList* SharedDatabase::GetNPCFactionEntry(uint32 id) const
|
||||
@@ -1341,7 +1408,7 @@ void SharedDatabase::LoadNPCFactionLists(void *data, uint32 size, uint32 list_co
|
||||
uint32 current_entry = 0;
|
||||
|
||||
for(auto& row = results.begin(); row != results.end(); ++row) {
|
||||
const uint32 id = Strings::ToUnsignedInt(row[0]);
|
||||
const uint32 id = static_cast<uint32>(Strings::ToUnsignedInt(row[0]));
|
||||
if(id != current_id) {
|
||||
if(current_id != 0) {
|
||||
hash.insert(current_id, faction);
|
||||
@@ -1351,7 +1418,7 @@ void SharedDatabase::LoadNPCFactionLists(void *data, uint32 size, uint32 list_co
|
||||
current_entry = 0;
|
||||
current_id = id;
|
||||
faction.id = id;
|
||||
faction.primaryfaction = Strings::ToUnsignedInt(row[1]);
|
||||
faction.primaryfaction = static_cast<uint32>(Strings::ToUnsignedInt(row[1]));
|
||||
faction.assistprimaryfaction = (Strings::ToInt(row[2]) == 0);
|
||||
}
|
||||
|
||||
@@ -1361,10 +1428,10 @@ void SharedDatabase::LoadNPCFactionLists(void *data, uint32 size, uint32 list_co
|
||||
if(current_entry >= MAX_NPC_FACTIONS)
|
||||
continue;
|
||||
|
||||
faction.factionid[current_entry] = Strings::ToUnsignedInt(row[3]);
|
||||
faction.factionvalue[current_entry] = Strings::ToInt(row[4]);
|
||||
faction.factionid[current_entry] = static_cast<uint32>(Strings::ToUnsignedInt(row[3]));
|
||||
faction.factionvalue[current_entry] = static_cast<int32>(Strings::ToInt(row[4]));
|
||||
faction.factionnpcvalue[current_entry] = static_cast<int8>(Strings::ToInt(row[5]));
|
||||
faction.factiontemp[current_entry] = static_cast<uint8>(Strings::ToUnsignedInt(row[6]));
|
||||
faction.factiontemp[current_entry] = static_cast<uint8>(Strings::ToInt(row[6]));
|
||||
++current_entry;
|
||||
}
|
||||
|
||||
@@ -1482,17 +1549,13 @@ EQ::ItemInstance* SharedDatabase::CreateItem(
|
||||
uint32 aug4,
|
||||
uint32 aug5,
|
||||
uint32 aug6,
|
||||
bool attuned,
|
||||
const std::string& custom_data,
|
||||
uint32 ornamenticon,
|
||||
uint32 ornamentidfile,
|
||||
uint32 ornament_hero_model
|
||||
bool attuned
|
||||
) {
|
||||
EQ::ItemInstance* inst = nullptr;
|
||||
|
||||
const EQ::ItemData* item = GetItem(item_id);
|
||||
if (item) {
|
||||
inst = CreateBaseItem(item, charges);
|
||||
inst = CreateBaseItem(item, "", charges);
|
||||
|
||||
if (!inst) {
|
||||
LogError("Error: valid item data returned a null reference for EQ::ItemInstance creation in SharedDatabase::CreateItem()");
|
||||
@@ -1507,10 +1570,6 @@ EQ::ItemInstance* SharedDatabase::CreateItem(
|
||||
inst->PutAugment(this, 4, aug5);
|
||||
inst->PutAugment(this, 5, aug6);
|
||||
inst->SetAttuned(attuned);
|
||||
inst->SetCustomDataString(custom_data);
|
||||
inst->SetOrnamentIcon(ornamenticon);
|
||||
inst->SetOrnamentationIDFile(ornamentidfile);
|
||||
inst->SetOrnamentHeroModel(ornament_hero_model);
|
||||
}
|
||||
|
||||
return inst;
|
||||
@@ -1527,15 +1586,11 @@ EQ::ItemInstance* SharedDatabase::CreateItem(
|
||||
uint32 aug4,
|
||||
uint32 aug5,
|
||||
uint32 aug6,
|
||||
bool attuned,
|
||||
const std::string& custom_data,
|
||||
uint32 ornamenticon,
|
||||
uint32 ornamentidfile,
|
||||
uint32 ornament_hero_model
|
||||
bool attuned
|
||||
) {
|
||||
EQ::ItemInstance* inst = nullptr;
|
||||
if (item) {
|
||||
inst = CreateBaseItem(item, charges);
|
||||
inst = CreateBaseItem(item, "", charges);
|
||||
|
||||
if (!inst) {
|
||||
LogError("Error: valid item data returned a null reference for EQ::ItemInstance creation in SharedDatabase::CreateItem()");
|
||||
@@ -1550,16 +1605,12 @@ EQ::ItemInstance* SharedDatabase::CreateItem(
|
||||
inst->PutAugment(this, 4, aug5);
|
||||
inst->PutAugment(this, 5, aug6);
|
||||
inst->SetAttuned(attuned);
|
||||
inst->SetCustomDataString(custom_data);
|
||||
inst->SetOrnamentIcon(ornamenticon);
|
||||
inst->SetOrnamentationIDFile(ornamentidfile);
|
||||
inst->SetOrnamentHeroModel(ornament_hero_model);
|
||||
}
|
||||
|
||||
return inst;
|
||||
}
|
||||
|
||||
EQ::ItemInstance* SharedDatabase::CreateBaseItem(const EQ::ItemData* item, int16 charges) {
|
||||
EQ::ItemInstance* SharedDatabase::CreateBaseItem(const EQ::ItemData* item, const std::string& guid, int16 charges) {
|
||||
EQ::ItemInstance* inst = nullptr;
|
||||
if (item) {
|
||||
// if maxcharges is -1 that means it is an unlimited use item.
|
||||
@@ -1570,7 +1621,7 @@ EQ::ItemInstance* SharedDatabase::CreateBaseItem(const EQ::ItemData* item, int16
|
||||
if(charges <= 0 && item->Stackable)
|
||||
charges = 1;
|
||||
|
||||
inst = new EQ::ItemInstance(item, charges);
|
||||
inst = new EQ::ItemInstance(item, guid, charges);
|
||||
|
||||
if (inst == nullptr) {
|
||||
LogError("Error: valid item data returned a null reference for EQ::ItemInstance creation in SharedDatabase::CreateBaseItem()");
|
||||
@@ -1618,7 +1669,7 @@ bool SharedDatabase::GetCommandSettings(std::map<std::string, std::pair<uint8, s
|
||||
return false;
|
||||
|
||||
for (auto& row = results.begin(); row != results.end(); ++row) {
|
||||
command_settings[row[0]].first = Strings::ToUnsignedInt(row[1]);
|
||||
command_settings[row[0]].first = Strings::ToInt(row[1]);
|
||||
if (row[2][0] == 0)
|
||||
continue;
|
||||
|
||||
@@ -1716,10 +1767,10 @@ void SharedDatabase::LoadSkillCaps(void *data) {
|
||||
}
|
||||
|
||||
for(auto& row = results.begin(); row != results.end(); ++row) {
|
||||
const uint8 skillID = Strings::ToUnsignedInt(row[0]);
|
||||
const uint8 class_ = Strings::ToUnsignedInt(row[1]) - 1;
|
||||
const uint8 level = Strings::ToUnsignedInt(row[2]);
|
||||
const uint16 cap = Strings::ToUnsignedInt(row[3]);
|
||||
const uint8 skillID = Strings::ToInt(row[0]);
|
||||
const uint8 class_ = Strings::ToInt(row[1]) - 1;
|
||||
const uint8 level = Strings::ToInt(row[2]);
|
||||
const uint16 cap = Strings::ToInt(row[3]);
|
||||
|
||||
if(skillID >= skill_count || class_ >= class_count || level >= level_count)
|
||||
continue;
|
||||
@@ -1820,7 +1871,7 @@ void SharedDatabase::LoadDamageShieldTypes(SPDat_Spell_Struct* sp, int32 iMaxSpe
|
||||
for(auto& row = results.begin(); row != results.end(); ++row) {
|
||||
const int spellID = Strings::ToInt(row[0]);
|
||||
if((spellID > 0) && (spellID <= iMaxSpellID))
|
||||
sp[spellID].damage_shield_type = Strings::ToUnsignedInt(row[1]);
|
||||
sp[spellID].damage_shield_type = Strings::ToInt(row[1]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1901,16 +1952,16 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) {
|
||||
strn0cpy(sp[tempid].cast_on_other, row[7], sizeof(sp[tempid].cast_on_other));
|
||||
strn0cpy(sp[tempid].spell_fades, row[8], sizeof(sp[tempid].spell_fades));
|
||||
|
||||
sp[tempid].range = Strings::ToFloat(row[9]);
|
||||
sp[tempid].aoe_range = Strings::ToFloat(row[10]);
|
||||
sp[tempid].push_back = Strings::ToFloat(row[11]);
|
||||
sp[tempid].push_up = Strings::ToFloat(row[12]);
|
||||
sp[tempid].cast_time=Strings::ToUnsignedInt(row[13]);
|
||||
sp[tempid].recovery_time=Strings::ToUnsignedInt(row[14]);
|
||||
sp[tempid].recast_time=Strings::ToUnsignedInt(row[15]);
|
||||
sp[tempid].buff_duration_formula=Strings::ToUnsignedInt(row[16]);
|
||||
sp[tempid].buff_duration=Strings::ToUnsignedInt(row[17]);
|
||||
sp[tempid].aoe_duration=Strings::ToUnsignedInt(row[18]);
|
||||
sp[tempid].range=static_cast<float>(Strings::ToFloat(row[9]));
|
||||
sp[tempid].aoe_range=static_cast<float>(Strings::ToFloat(row[10]));
|
||||
sp[tempid].push_back=static_cast<float>(Strings::ToFloat(row[11]));
|
||||
sp[tempid].push_up=static_cast<float>(Strings::ToFloat(row[12]));
|
||||
sp[tempid].cast_time=Strings::ToInt(row[13]);
|
||||
sp[tempid].recovery_time=Strings::ToInt(row[14]);
|
||||
sp[tempid].recast_time=Strings::ToInt(row[15]);
|
||||
sp[tempid].buff_duration_formula=Strings::ToInt(row[16]);
|
||||
sp[tempid].buff_duration=Strings::ToInt(row[17]);
|
||||
sp[tempid].aoe_duration=Strings::ToInt(row[18]);
|
||||
sp[tempid].mana=Strings::ToInt(row[19]);
|
||||
|
||||
int y=0;
|
||||
@@ -1933,7 +1984,7 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) {
|
||||
sp[tempid].no_expend_reagent[y]=Strings::ToInt(row[66+y]);
|
||||
|
||||
for(y=0; y< EFFECT_COUNT;y++)
|
||||
sp[tempid].formula[y]=Strings::ToUnsignedInt(row[70+y]);
|
||||
sp[tempid].formula[y]=Strings::ToInt(row[70+y]);
|
||||
|
||||
sp[tempid].good_effect=Strings::ToInt(row[83]);
|
||||
sp[tempid].activated=Strings::ToInt(row[84]);
|
||||
@@ -1968,51 +2019,51 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) {
|
||||
sp[tempid].deities[y]=Strings::ToInt(row[126+y]);
|
||||
|
||||
sp[tempid].new_icon=Strings::ToInt(row[144]);
|
||||
sp[tempid].uninterruptable=Strings::ToBool(row[146]);
|
||||
sp[tempid].uninterruptable=Strings::ToInt(row[146]) != 0;
|
||||
sp[tempid].resist_difficulty=Strings::ToInt(row[147]);
|
||||
sp[tempid].unstackable_dot = Strings::ToBool(row[148]);
|
||||
sp[tempid].recourse_link = Strings::ToUnsignedInt(row[150]);
|
||||
sp[tempid].no_partial_resist = Strings::ToBool(row[151]);
|
||||
sp[tempid].unstackable_dot = Strings::ToInt(row[148]) != 0;
|
||||
sp[tempid].recourse_link = Strings::ToInt(row[150]);
|
||||
sp[tempid].no_partial_resist = Strings::ToInt(row[151]) != 0;
|
||||
|
||||
sp[tempid].short_buff_box = Strings::ToInt(row[154]);
|
||||
sp[tempid].description_id = Strings::ToInt(row[155]);
|
||||
sp[tempid].type_description_id = Strings::ToInt(row[156]);
|
||||
sp[tempid].effect_description_id = Strings::ToInt(row[157]);
|
||||
|
||||
sp[tempid].npc_no_los = Strings::ToBool(row[159]);
|
||||
sp[tempid].feedbackable = Strings::ToBool(row[160]);
|
||||
sp[tempid].reflectable = Strings::ToBool(row[161]);
|
||||
sp[tempid].npc_no_los = Strings::ToInt(row[159]) != 0;
|
||||
sp[tempid].feedbackable = Strings::ToInt(row[160]) != 0;
|
||||
sp[tempid].reflectable = Strings::ToInt(row[161]) != 0;
|
||||
sp[tempid].bonus_hate=Strings::ToInt(row[162]);
|
||||
|
||||
sp[tempid].ldon_trap = Strings::ToBool(row[165]);
|
||||
sp[tempid].endurance_cost= Strings::ToInt(row[166]);
|
||||
sp[tempid].timer_id= Strings::ToInt(row[167]);
|
||||
sp[tempid].is_discipline = Strings::ToBool(row[168]);
|
||||
sp[tempid].hate_added= Strings::ToInt(row[173]);
|
||||
sp[tempid].ldon_trap = Strings::ToInt(row[165]) != 0;
|
||||
sp[tempid].endurance_cost=Strings::ToInt(row[166]);
|
||||
sp[tempid].timer_id=Strings::ToInt(row[167]);
|
||||
sp[tempid].is_discipline = Strings::ToInt(row[168]) != 0;
|
||||
sp[tempid].hate_added=Strings::ToInt(row[173]);
|
||||
sp[tempid].endurance_upkeep=Strings::ToInt(row[174]);
|
||||
sp[tempid].hit_number_type = Strings::ToInt(row[175]);
|
||||
sp[tempid].hit_number = Strings::ToInt(row[176]);
|
||||
sp[tempid].pvp_resist_base= Strings::ToInt(row[177]);
|
||||
sp[tempid].pvp_resist_per_level= Strings::ToInt(row[178]);
|
||||
sp[tempid].pvp_resist_cap= Strings::ToInt(row[179]);
|
||||
sp[tempid].spell_category= Strings::ToInt(row[180]);
|
||||
sp[tempid].pvp_resist_base=Strings::ToInt(row[177]);
|
||||
sp[tempid].pvp_resist_per_level=Strings::ToInt(row[178]);
|
||||
sp[tempid].pvp_resist_cap=Strings::ToInt(row[179]);
|
||||
sp[tempid].spell_category=Strings::ToInt(row[180]);
|
||||
sp[tempid].pvp_duration = Strings::ToInt(row[181]);
|
||||
sp[tempid].pvp_duration_cap = Strings::ToInt(row[182]);
|
||||
sp[tempid].pcnpc_only_flag= Strings::ToInt(row[183]);
|
||||
sp[tempid].pcnpc_only_flag=Strings::ToInt(row[183]);
|
||||
sp[tempid].cast_not_standing = Strings::ToInt(row[184]) != 0;
|
||||
sp[tempid].can_mgb= Strings::ToBool(row[185]);
|
||||
sp[tempid].can_mgb=Strings::ToInt(row[185]);
|
||||
sp[tempid].dispel_flag = Strings::ToInt(row[186]);
|
||||
sp[tempid].min_resist = Strings::ToInt(row[189]);
|
||||
sp[tempid].max_resist = Strings::ToInt(row[190]);
|
||||
sp[tempid].viral_targets = Strings::ToInt(row[191]);
|
||||
sp[tempid].viral_timer = Strings::ToInt(row[192]);
|
||||
sp[tempid].nimbus_effect = Strings::ToInt(row[193]);
|
||||
sp[tempid].directional_start = Strings::ToFloat(row[194]);
|
||||
sp[tempid].directional_end = Strings::ToFloat(row[195]);
|
||||
sp[tempid].sneak = Strings::ToBool(row[196]);
|
||||
sp[tempid].not_focusable = Strings::ToBool(row[197]);
|
||||
sp[tempid].no_detrimental_spell_aggro = Strings::ToBool(row[198]);
|
||||
sp[tempid].suspendable = Strings::ToBool(row[200]);
|
||||
sp[tempid].directional_start = static_cast<float>(Strings::ToInt(row[194]));
|
||||
sp[tempid].directional_end = static_cast<float>(Strings::ToInt(row[195]));
|
||||
sp[tempid].sneak = Strings::ToInt(row[196]) != 0;
|
||||
sp[tempid].not_focusable = Strings::ToInt(row[197]) != 0;
|
||||
sp[tempid].no_detrimental_spell_aggro = Strings::ToInt(row[198]) != 0;
|
||||
sp[tempid].suspendable = Strings::ToInt(row[200]) != 0;
|
||||
sp[tempid].viral_range = Strings::ToInt(row[201]);
|
||||
sp[tempid].song_cap = Strings::ToInt(row[202]);
|
||||
sp[tempid].no_block = Strings::ToInt(row[205]);
|
||||
@@ -2020,22 +2071,22 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) {
|
||||
sp[tempid].rank = Strings::ToInt(row[208]);
|
||||
sp[tempid].no_resist=Strings::ToInt(row[209]);
|
||||
sp[tempid].cast_restriction = Strings::ToInt(row[211]);
|
||||
sp[tempid].allow_rest = Strings::ToBool(row[212]);
|
||||
sp[tempid].can_cast_in_combat = Strings::ToBool(row[213]);
|
||||
sp[tempid].can_cast_out_of_combat = Strings::ToBool(row[214]);
|
||||
sp[tempid].allow_rest = Strings::ToInt(row[212]) != 0;
|
||||
sp[tempid].can_cast_in_combat = Strings::ToInt(row[213]) != 0;
|
||||
sp[tempid].can_cast_out_of_combat = Strings::ToInt(row[214]) != 0;
|
||||
sp[tempid].override_crit_chance = Strings::ToInt(row[217]);
|
||||
sp[tempid].aoe_max_targets = Strings::ToInt(row[218]);
|
||||
sp[tempid].no_heal_damage_item_mod = Strings::ToInt(row[219]);
|
||||
sp[tempid].caster_requirement_id = Strings::ToInt(row[220]);
|
||||
sp[tempid].spell_class = Strings::ToInt(row[221]);
|
||||
sp[tempid].spell_subclass = Strings::ToInt(row[222]);
|
||||
sp[tempid].persist_death = Strings::ToBool(row[224]);
|
||||
sp[tempid].min_distance = Strings::ToFloat(row[227]);
|
||||
sp[tempid].min_distance_mod = Strings::ToFloat(row[228]);
|
||||
sp[tempid].max_distance = Strings::ToFloat(row[229]);
|
||||
sp[tempid].max_distance_mod = Strings::ToFloat(row[230]);
|
||||
sp[tempid].min_range = Strings::ToFloat(row[231]);
|
||||
sp[tempid].no_remove = Strings::ToBool(row[232]);
|
||||
sp[tempid].persist_death = Strings::ToInt(row[224]) != 0;
|
||||
sp[tempid].min_distance = static_cast<float>(Strings::ToFloat(row[227]));
|
||||
sp[tempid].min_distance_mod = static_cast<float>(Strings::ToFloat(row[228]));
|
||||
sp[tempid].max_distance = static_cast<float>(Strings::ToFloat(row[229]));
|
||||
sp[tempid].max_distance_mod = static_cast<float>(Strings::ToFloat(row[230]));
|
||||
sp[tempid].min_range = static_cast<float>(Strings::ToInt(row[231]));
|
||||
sp[tempid].no_remove = Strings::ToInt(row[232]) != 0;
|
||||
sp[tempid].damage_shield_type = 0;
|
||||
}
|
||||
|
||||
@@ -2172,9 +2223,9 @@ void SharedDatabase::GetLootTableInfo(uint32 &loot_table_count, uint32 &max_loot
|
||||
|
||||
auto& row = results.begin();
|
||||
|
||||
loot_table_count = Strings::ToUnsignedInt(row[0]);
|
||||
max_loot_table = Strings::ToUnsignedInt(row[1] ? row[1] : "0");
|
||||
loot_table_entries = Strings::ToUnsignedInt(row[2]);
|
||||
loot_table_count = static_cast<uint32>(Strings::ToUnsignedInt(row[0]));
|
||||
max_loot_table = static_cast<uint32>(Strings::ToUnsignedInt(row[1] ? row[1] : "0"));
|
||||
loot_table_entries = static_cast<uint32>(Strings::ToUnsignedInt(row[2]));
|
||||
}
|
||||
|
||||
void SharedDatabase::GetLootDropInfo(uint32 &loot_drop_count, uint32 &max_loot_drop, uint32 &loot_drop_entries) {
|
||||
@@ -2197,9 +2248,9 @@ void SharedDatabase::GetLootDropInfo(uint32 &loot_drop_count, uint32 &max_loot_d
|
||||
|
||||
auto& row =results.begin();
|
||||
|
||||
loot_drop_count = Strings::ToUnsignedInt(row[0]);
|
||||
max_loot_drop = Strings::ToUnsignedInt(row[1] ? row[1] : "0");
|
||||
loot_drop_entries = Strings::ToUnsignedInt(row[2]);
|
||||
loot_drop_count = static_cast<uint32>(Strings::ToUnsignedInt(row[0]));
|
||||
max_loot_drop = static_cast<uint32>(Strings::ToUnsignedInt(row[1] ? row[1] : "0"));
|
||||
loot_drop_entries = static_cast<uint32>(Strings::ToUnsignedInt(row[2]));
|
||||
}
|
||||
|
||||
void SharedDatabase::LoadLootTables(void *data, uint32 size) {
|
||||
@@ -2243,7 +2294,7 @@ void SharedDatabase::LoadLootTables(void *data, uint32 size) {
|
||||
uint32 current_entry = 0;
|
||||
|
||||
for (auto& row = results.begin(); row != results.end(); ++row) {
|
||||
const uint32 id = Strings::ToUnsignedInt(row[0]);
|
||||
const uint32 id = static_cast<uint32>(Strings::ToUnsignedInt(row[0]));
|
||||
if (id != current_id) {
|
||||
if (current_id != 0) {
|
||||
hash.insert(
|
||||
@@ -2255,9 +2306,9 @@ void SharedDatabase::LoadLootTables(void *data, uint32 size) {
|
||||
memset(loot_table, 0, sizeof(LootTable_Struct) + (sizeof(LootTableEntries_Struct) * 128));
|
||||
current_entry = 0;
|
||||
current_id = id;
|
||||
lt->mincash = Strings::ToUnsignedInt(row[1]);
|
||||
lt->maxcash = Strings::ToUnsignedInt(row[2]);
|
||||
lt->avgcoin = Strings::ToUnsignedInt(row[3]);
|
||||
lt->mincash = static_cast<uint32>(Strings::ToUnsignedInt(row[1]));
|
||||
lt->maxcash = static_cast<uint32>(Strings::ToUnsignedInt(row[2]));
|
||||
lt->avgcoin = static_cast<uint32>(Strings::ToUnsignedInt(row[3]));
|
||||
|
||||
lt->content_flags.min_expansion = static_cast<int16>(Strings::ToInt(row[9]));
|
||||
lt->content_flags.max_expansion = static_cast<int16>(Strings::ToInt(row[10]));
|
||||
@@ -2274,11 +2325,11 @@ void SharedDatabase::LoadLootTables(void *data, uint32 size) {
|
||||
continue;
|
||||
}
|
||||
|
||||
lt->Entries[current_entry].lootdrop_id = Strings::ToUnsignedInt(row[4]);
|
||||
lt->Entries[current_entry].multiplier = static_cast<uint8>(Strings::ToUnsignedInt(row[5]));
|
||||
lt->Entries[current_entry].droplimit = static_cast<uint8>(Strings::ToUnsignedInt(row[6]));
|
||||
lt->Entries[current_entry].mindrop = static_cast<uint8>(Strings::ToUnsignedInt(row[7]));
|
||||
lt->Entries[current_entry].probability = Strings::ToFloat(row[8]);
|
||||
lt->Entries[current_entry].lootdrop_id = static_cast<uint32>(Strings::ToUnsignedInt(row[4]));
|
||||
lt->Entries[current_entry].multiplier = static_cast<uint8>(Strings::ToInt(row[5]));
|
||||
lt->Entries[current_entry].droplimit = static_cast<uint8>(Strings::ToInt(row[6]));
|
||||
lt->Entries[current_entry].mindrop = static_cast<uint8>(Strings::ToInt(row[7]));
|
||||
lt->Entries[current_entry].probability = static_cast<float>(Strings::ToFloat(row[8]));
|
||||
|
||||
++(lt->NumEntries);
|
||||
++current_entry;
|
||||
@@ -2337,7 +2388,7 @@ void SharedDatabase::LoadLootDrops(void *data, uint32 size) {
|
||||
uint32 current_entry = 0;
|
||||
|
||||
for (auto& row = results.begin(); row != results.end(); ++row) {
|
||||
const auto id = Strings::ToUnsignedInt(row[0]);
|
||||
const auto id = static_cast<uint32>(Strings::ToUnsignedInt(row[0]));
|
||||
if (id != current_id) {
|
||||
if (current_id != 0) {
|
||||
hash.insert(
|
||||
@@ -2351,7 +2402,7 @@ void SharedDatabase::LoadLootDrops(void *data, uint32 size) {
|
||||
current_id = id;
|
||||
|
||||
p_loot_drop_struct->content_flags.min_expansion = static_cast<int16>(Strings::ToInt(row[10]));
|
||||
p_loot_drop_struct->content_flags.max_expansion = static_cast<int16>(Strings::ToUnsignedInt(row[11]));
|
||||
p_loot_drop_struct->content_flags.max_expansion = static_cast<int16>(Strings::ToInt(row[11]));
|
||||
|
||||
strn0cpy(p_loot_drop_struct->content_flags.content_flags, row[12], sizeof(p_loot_drop_struct->content_flags.content_flags));
|
||||
strn0cpy(p_loot_drop_struct->content_flags.content_flags_disabled, row[13], sizeof(p_loot_drop_struct->content_flags.content_flags_disabled));
|
||||
@@ -2361,15 +2412,15 @@ void SharedDatabase::LoadLootDrops(void *data, uint32 size) {
|
||||
continue;
|
||||
}
|
||||
|
||||
p_loot_drop_struct->Entries[current_entry].item_id = Strings::ToUnsignedInt(row[1]);
|
||||
p_loot_drop_struct->Entries[current_entry].item_charges = static_cast<int8>(Strings::ToUnsignedInt(row[2]));
|
||||
p_loot_drop_struct->Entries[current_entry].equip_item = static_cast<uint8>(Strings::ToUnsignedInt(row[3]));
|
||||
p_loot_drop_struct->Entries[current_entry].chance = Strings::ToFloat(row[4]);
|
||||
p_loot_drop_struct->Entries[current_entry].trivial_min_level = static_cast<uint16>(Strings::ToUnsignedInt(row[5]));
|
||||
p_loot_drop_struct->Entries[current_entry].trivial_max_level = static_cast<uint16>(Strings::ToUnsignedInt(row[6]));
|
||||
p_loot_drop_struct->Entries[current_entry].npc_min_level = static_cast<uint16>(Strings::ToUnsignedInt(row[7]));
|
||||
p_loot_drop_struct->Entries[current_entry].npc_max_level = static_cast<uint16>(Strings::ToUnsignedInt(row[8]));
|
||||
p_loot_drop_struct->Entries[current_entry].multiplier = static_cast<uint8>(Strings::ToUnsignedInt(row[9]));
|
||||
p_loot_drop_struct->Entries[current_entry].item_id = static_cast<uint32>(Strings::ToUnsignedInt(row[1]));
|
||||
p_loot_drop_struct->Entries[current_entry].item_charges = static_cast<int8>(Strings::ToInt(row[2]));
|
||||
p_loot_drop_struct->Entries[current_entry].equip_item = static_cast<uint8>(Strings::ToInt(row[3]));
|
||||
p_loot_drop_struct->Entries[current_entry].chance = static_cast<float>(Strings::ToFloat(row[4]));
|
||||
p_loot_drop_struct->Entries[current_entry].trivial_min_level = static_cast<uint16>(Strings::ToInt(row[5]));
|
||||
p_loot_drop_struct->Entries[current_entry].trivial_max_level = static_cast<uint16>(Strings::ToInt(row[6]));
|
||||
p_loot_drop_struct->Entries[current_entry].npc_min_level = static_cast<uint16>(Strings::ToInt(row[7]));
|
||||
p_loot_drop_struct->Entries[current_entry].npc_max_level = static_cast<uint16>(Strings::ToInt(row[8]));
|
||||
p_loot_drop_struct->Entries[current_entry].multiplier = static_cast<uint8>(Strings::ToInt(row[9]));
|
||||
|
||||
++(p_loot_drop_struct->NumEntries);
|
||||
++current_entry;
|
||||
|
||||
+3
-11
@@ -126,11 +126,7 @@ public:
|
||||
uint32 aug4 = 0,
|
||||
uint32 aug5 = 0,
|
||||
uint32 aug6 = 0,
|
||||
bool attuned = false,
|
||||
const std::string& custom_data = "",
|
||||
uint32 ornamenticon = 0,
|
||||
uint32 ornamentidfile = 0,
|
||||
uint32 ornament_hero_model = 0
|
||||
bool attuned = 0
|
||||
);
|
||||
EQ::ItemInstance *CreateItem(
|
||||
const EQ::ItemData *item,
|
||||
@@ -141,13 +137,9 @@ public:
|
||||
uint32 aug4 = 0,
|
||||
uint32 aug5 = 0,
|
||||
uint32 aug6 = 0,
|
||||
bool attuned = false,
|
||||
const std::string &custom_data = "",
|
||||
uint32 ornamenticon = 0,
|
||||
uint32 ornamentidfile = 0,
|
||||
uint32 ornament_hero_model = 0
|
||||
bool attuned = 0
|
||||
);
|
||||
EQ::ItemInstance *CreateBaseItem(const EQ::ItemData *item, int16 charges = 0);
|
||||
EQ::ItemInstance *CreateBaseItem(const EQ::ItemData *item, const std::string &guid, int16 charges);
|
||||
|
||||
void GetItemsCount(int32 &item_count, uint32 &max_id);
|
||||
void LoadItems(void *data, uint32 size, int32 items, uint32 max_item_id);
|
||||
|
||||
+2
-20
@@ -1,5 +1,5 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
|
||||
|
||||
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -260,31 +260,13 @@ const std::map<EQ::skills::SkillType, std::string>& EQ::skills::GetSkillTypeMap(
|
||||
return skill_type_map;
|
||||
}
|
||||
|
||||
const std::vector<EQ::skills::SkillType>& EQ::skills::GetExtraDamageSkills()
|
||||
{
|
||||
static const std::vector<EQ::skills::SkillType> v = {
|
||||
EQ::skills::SkillBackstab,
|
||||
EQ::skills::SkillBash,
|
||||
EQ::skills::SkillDragonPunch, // Same ID as Tail Rake
|
||||
EQ::skills::SkillEagleStrike,
|
||||
EQ::skills::SkillFlyingKick,
|
||||
EQ::skills::SkillKick,
|
||||
EQ::skills::SkillRoundKick,
|
||||
EQ::skills::SkillRoundKick,
|
||||
EQ::skills::SkillTigerClaw,
|
||||
EQ::skills::SkillFrenzy
|
||||
};
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
std::string EQ::skills::GetSkillName(SkillType skill)
|
||||
{
|
||||
if (skill >= Skill1HBlunt && skill <= Skill2HPiercing) {
|
||||
auto skills = GetSkillTypeMap();
|
||||
return skills[skill];
|
||||
}
|
||||
return {};
|
||||
return std::string();
|
||||
}
|
||||
|
||||
EQ::SkillProfile::SkillProfile()
|
||||
|
||||
+2
-4
@@ -1,5 +1,5 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
|
||||
|
||||
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
|
||||
namespace EQ
|
||||
@@ -171,7 +170,6 @@ namespace EQ
|
||||
bool IsMeleeDmg(SkillType skill);
|
||||
|
||||
extern const std::map<SkillType, std::string>& GetSkillTypeMap();
|
||||
extern const std::vector<SkillType>& GetExtraDamageSkills();
|
||||
|
||||
std::string GetSkillName(SkillType skill);
|
||||
} /*skills*/
|
||||
@@ -307,7 +305,7 @@ namespace EQ
|
||||
|
||||
uint32 operator[](int skill_id) const { return const_cast<SkillProfile*>(this)->GetSkill(skill_id); }
|
||||
};
|
||||
|
||||
|
||||
} /*EQEmu*/
|
||||
|
||||
#endif /*COMMON_SKILLS_H*/
|
||||
|
||||
+2
-2
@@ -504,7 +504,7 @@ enum SpellRestriction
|
||||
HAS_NO_ILLUSIONS_OF_GRANDEUR_BUFF = 12519, //
|
||||
IS_HP_ABOVE_50_PCT = 16010, //
|
||||
IS_HP_UNDER_50_PCT = 16031, //
|
||||
IS_OFF_HAND_EQUIPPED = 27672, // You must be wielding a weapon or shield in your offhand to use this ability.
|
||||
IS_OFF_HAND_EQUIPED = 27672, // You must be wielding a weapon or shield in your offhand to use this ability.
|
||||
HAS_NO_PACT_OF_FATE_RECOURSE_BUFF = 29556, // This spell will not work while Pact of Fate Recourse is active. | caster restriction |
|
||||
HAS_NO_SHROUD_OF_PRAYER_BUFF = 32339, // Your target cannot receive another Quiet Prayer this soon.
|
||||
IS_MANA_BELOW_20_PCT = 38311, // This ability requires you to be at or below 20% of your maximum mana.
|
||||
@@ -1211,7 +1211,7 @@ typedef enum {
|
||||
#define SE_Double_Backstab_Front 473 // implemented - Chance to double backstab from front
|
||||
#define SE_Pet_Crit_Melee_Damage_Pct_Owner 474 // implemenetd - Critical damage mod applied to pets from owner
|
||||
#define SE_Trigger_Spell_Non_Item 475 // implemented - Trigger spell on cast only if not from item click.
|
||||
#define SE_Weapon_Stance 476 // implemented, @Misc, Apply a specific spell buffs automatically depending 2Hander, Shield or Dual Wield is equipped, base: spellid, base: 0=2H 1=Shield 2=DW, max: none
|
||||
#define SE_Weapon_Stance 476 // implemented, @Misc, Apply a specific spell buffs automatically depending 2Hander, Shield or Duel Wield is equiped, base: spellid, base: 0=2H 1=Shield 2=DW, max: none
|
||||
#define SE_Hatelist_To_Top_Index 477 // Implemented - Chance to be set to top of rampage list
|
||||
#define SE_Hatelist_To_Tail_Index 478 // Implemented - Chance to be set to bottom of rampage list
|
||||
#define SE_Ff_Value_Min 479 // implemented, @Ff, Minimum base value of a spell that can be focused, base: spells to be focused base1 value
|
||||
|
||||
@@ -658,11 +658,11 @@ typedef pdb_symbol current;
|
||||
size_t next = 0;
|
||||
size_t delimiter_size = sizeof(kBackwardPathDelimiter) - 1;
|
||||
while ((next = s.find(kBackwardPathDelimiter, last)) != std::string::npos) {
|
||||
out.emplace_back(s.substr(last, next - last));
|
||||
out.push_back(s.substr(last, next - last));
|
||||
last = next + delimiter_size;
|
||||
}
|
||||
if (last <= s.length()) {
|
||||
out.emplace_back(s.substr(last));
|
||||
out.push_back(s.substr(last));
|
||||
}
|
||||
return out;
|
||||
}
|
||||
@@ -3760,7 +3760,7 @@ private:
|
||||
continue;
|
||||
started = true;
|
||||
}
|
||||
lines.emplace_back(make_pair(line_idx, line));
|
||||
lines.push_back(make_pair(line_idx, line));
|
||||
}
|
||||
|
||||
lines.erase(
|
||||
|
||||
+9
-9
@@ -76,7 +76,7 @@ std::vector<std::string> Strings::Split(const std::string& s, const std::string&
|
||||
res.push_back(token);
|
||||
}
|
||||
|
||||
res.emplace_back(s.substr(pos_start));
|
||||
res.push_back(s.substr(pos_start));
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ Strings::SearchDelim(const std::string &haystack, const std::string &needle, con
|
||||
}
|
||||
|
||||
|
||||
std::string Strings::Implode(const std::string& glue, std::vector<std::string> src)
|
||||
std::string Strings::Implode(std::string glue, std::vector<std::string> src)
|
||||
{
|
||||
if (src.empty()) {
|
||||
return {};
|
||||
@@ -272,7 +272,7 @@ std::string Strings::Repeat(std::string s, int n)
|
||||
return s;
|
||||
}
|
||||
|
||||
bool Strings::Contains(std::vector<std::string> container, const std::string& element)
|
||||
bool Strings::Contains(std::vector<std::string> container, std::string element)
|
||||
{
|
||||
return std::find(container.begin(), container.end(), element) != container.end();
|
||||
}
|
||||
@@ -316,7 +316,7 @@ const std::string Strings::ToUpper(std::string s)
|
||||
);
|
||||
return s;
|
||||
}
|
||||
const std::string Strings::UcFirst(const std::string& s)
|
||||
const std::string Strings::UcFirst(std::string s)
|
||||
{
|
||||
std::string output = s;
|
||||
if (!s.empty()) {
|
||||
@@ -327,7 +327,7 @@ const std::string Strings::UcFirst(const std::string& s)
|
||||
}
|
||||
|
||||
|
||||
std::vector<std::string> Strings::Wrap(std::vector<std::string> &src, const std::string& character)
|
||||
std::vector<std::string> Strings::Wrap(std::vector<std::string> &src, std::string character)
|
||||
{
|
||||
std::vector<std::string> new_vector;
|
||||
new_vector.reserve(src.size());
|
||||
@@ -659,7 +659,7 @@ std::string Strings::SecondsToTime(int duration, bool is_milliseconds)
|
||||
return time_string;
|
||||
}
|
||||
|
||||
std::string &Strings::LTrim(std::string &str, std::string_view chars)
|
||||
std::string &Strings::LTrim(std::string &str, const std::string &chars)
|
||||
{
|
||||
str.erase(0, str.find_first_not_of(chars));
|
||||
return str;
|
||||
@@ -670,7 +670,7 @@ std::string Strings::MillisecondsToTime(int duration)
|
||||
return SecondsToTime(duration, true);
|
||||
}
|
||||
|
||||
std::string &Strings::RTrim(std::string &str, std::string_view chars)
|
||||
std::string &Strings::RTrim(std::string &str, const std::string &chars)
|
||||
{
|
||||
str.erase(str.find_last_not_of(chars) + 1);
|
||||
return str;
|
||||
@@ -682,7 +682,7 @@ std::string &Strings::Trim(std::string &str, const std::string &chars)
|
||||
}
|
||||
|
||||
// Function to convert single digit or two digit number into words
|
||||
std::string Strings::ConvertToDigit(int n, const std::string& suffix)
|
||||
std::string Strings::ConvertToDigit(int n, std::string suffix)
|
||||
{
|
||||
// if n is zero
|
||||
if (n == 0) {
|
||||
@@ -745,7 +745,7 @@ uint32 Strings::TimeToSeconds(std::string time_string)
|
||||
return duration;
|
||||
}
|
||||
|
||||
bool Strings::ToBool(const std::string& bool_string)
|
||||
bool Strings::ToBool(std::string bool_string)
|
||||
{
|
||||
if (
|
||||
Strings::Contains(bool_string, "true") ||
|
||||
|
||||
+10
-10
@@ -84,7 +84,7 @@ namespace EQ {
|
||||
|
||||
class Strings {
|
||||
public:
|
||||
static bool Contains(std::vector<std::string> container, const std::string& element);
|
||||
static bool Contains(std::vector<std::string> container, std::string element);
|
||||
static bool Contains(const std::string& subject, const std::string& search);
|
||||
static int ToInt(const std::string &s, int fallback = 0);
|
||||
static int64 ToBigInt(const std::string &s, int64 fallback = 0);
|
||||
@@ -96,9 +96,9 @@ public:
|
||||
static bool IsFloat(const std::string &s);
|
||||
static const std::string ToLower(std::string s);
|
||||
static const std::string ToUpper(std::string s);
|
||||
static const std::string UcFirst(const std::string& s);
|
||||
static std::string <rim(std::string &str, std::string_view chars = "\t\n\v\f\r ");
|
||||
static std::string &RTrim(std::string &str, std::string_view chars = "\t\n\v\f\r ");
|
||||
static const std::string UcFirst(std::string s);
|
||||
static std::string <rim(std::string &str, const std::string &chars = "\t\n\v\f\r ");
|
||||
static std::string &RTrim(std::string &str, const std::string &chars = "\t\n\v\f\r ");
|
||||
static std::string &Trim(std::string &str, const std::string &chars = "\t\n\v\f\r ");
|
||||
static std::string Commify(const std::string &number);
|
||||
static std::string Commify(uint16 number) { return Strings::Commify(std::to_string(number)); };
|
||||
@@ -107,10 +107,10 @@ public:
|
||||
static std::string Commify(int16 number) { return Strings::Commify(std::to_string(number)); };
|
||||
static std::string Commify(int32 number) { return Strings::Commify(std::to_string(number)); };
|
||||
static std::string Commify(int64 number) { return Strings::Commify(std::to_string(number)); };
|
||||
static std::string ConvertToDigit(int n, const std::string& suffix);
|
||||
static std::string ConvertToDigit(int n, std::string suffix);
|
||||
static std::string Escape(const std::string &s);
|
||||
static std::string GetBetween(const std::string &s, std::string start_delim, std::string stop_delim);
|
||||
static std::string Implode(const std::string& glue, std::vector<std::string> src);
|
||||
static std::string Implode(std::string glue, std::vector<std::string> src);
|
||||
static std::string Join(const std::vector<std::string> &ar, const std::string &delim);
|
||||
static std::string Join(const std::vector<uint32_t> &ar, const std::string &delim);
|
||||
static std::string MillisecondsToTime(int duration);
|
||||
@@ -122,10 +122,10 @@ public:
|
||||
static std::string::size_type SearchDelim(const std::string &haystack, const std::string &needle, const char deliminator = ',');
|
||||
static std::vector<std::string> Split(const std::string &s, const char delim = ',');
|
||||
static std::vector<std::string> Split(const std::string& s, const std::string& delimiter);
|
||||
static std::vector<std::string> Wrap(std::vector<std::string> &src, const std::string& character);
|
||||
static std::vector<std::string> Wrap(std::vector<std::string> &src, std::string character);
|
||||
static void FindReplace(std::string &string_subject, const std::string &search_string, const std::string &replace_string);
|
||||
static uint32 TimeToSeconds(std::string time_string);
|
||||
static bool ToBool(const std::string& bool_string);
|
||||
static bool ToBool(std::string bool_string);
|
||||
static inline bool EqualFold(const std::string &string_one, const std::string &string_two) { return strcasecmp(string_one.c_str(), string_two.c_str()) == 0; }
|
||||
static std::string Random(size_t length);
|
||||
|
||||
@@ -219,7 +219,7 @@ std::vector<std::string> join_pair(
|
||||
std::vector<std::string> output;
|
||||
|
||||
for (const std::pair<T1, T2> &src_iter: src) {
|
||||
output.emplace_back(
|
||||
output.push_back(
|
||||
|
||||
fmt::format(
|
||||
"{}{}{}{}{}{}{}",
|
||||
@@ -253,7 +253,7 @@ std::vector<std::string> join_tuple(
|
||||
|
||||
for (const std::tuple<T1, T2, T3, T4> &src_iter: src) {
|
||||
|
||||
output.emplace_back(
|
||||
output.push_back(
|
||||
|
||||
fmt::format(
|
||||
"{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
|
||||
|
||||
@@ -71,6 +71,14 @@ namespace StructStrategyFactory {
|
||||
strategies[first_opcode] = structs;
|
||||
}
|
||||
|
||||
const StructStrategy *FindPatch(EmuOpcode first_opcode) {
|
||||
std::map<EmuOpcode, const StructStrategy *>::const_iterator res;
|
||||
res = strategies.find(first_opcode);
|
||||
if(res == strategies.end())
|
||||
return(nullptr);
|
||||
return(res->second);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -43,6 +43,9 @@ protected:
|
||||
//effectively a singleton, but I decided to do it this way for no apparent reason.
|
||||
namespace StructStrategyFactory {
|
||||
void RegisterPatch(EmuOpcode first_opcode, const StructStrategy *structs);
|
||||
|
||||
//does NOT return ownership of the strategy.
|
||||
const StructStrategy *FindPatch(EmuOpcode first_opcode);
|
||||
};
|
||||
|
||||
|
||||
|
||||
+3
-4
@@ -25,7 +25,7 @@
|
||||
|
||||
// Build variables
|
||||
// these get injected during the build pipeline
|
||||
#define CURRENT_VERSION "22.9.1-dev" // always append -dev to the current version for custom-builds
|
||||
#define CURRENT_VERSION "22.4.5-dev" // always append -dev to the current version for custom-builds
|
||||
#define LOGIN_VERSION "0.8.0"
|
||||
#define COMPILE_DATE __DATE__
|
||||
#define COMPILE_TIME __TIME__
|
||||
@@ -42,9 +42,8 @@
|
||||
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
||||
*/
|
||||
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9227
|
||||
|
||||
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9039
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9222
|
||||
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9038
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,490 @@
|
||||
#include "../common/types.h"
|
||||
|
||||
inline const char* StaticGetZoneName(uint32 zoneID) {
|
||||
// @merth: I did the following query to retrieve these (following by a simple find/replace)
|
||||
// select concat('case ', zoneidnumber), concat(short_name, '";') from zone order by zoneidnumber;
|
||||
switch (zoneID) {
|
||||
case 1: return "qeynos";
|
||||
case 2: return "qeynos2";
|
||||
case 3: return "qrg";
|
||||
case 4: return "qeytoqrg";
|
||||
case 5: return "highpass";
|
||||
case 6: return "highkeep";
|
||||
case 8: return "freportn";
|
||||
case 9: return "freportw";
|
||||
case 10: return "freporte";
|
||||
case 11: return "runnyeye";
|
||||
case 12: return "qey2hh1";
|
||||
case 13: return "northkarana";
|
||||
case 14: return "southkarana";
|
||||
case 15: return "eastkarana";
|
||||
case 16: return "beholder";
|
||||
case 17: return "blackburrow";
|
||||
case 18: return "paw";
|
||||
case 19: return "rivervale";
|
||||
case 20: return "kithicor";
|
||||
case 21: return "commons";
|
||||
case 22: return "ecommons";
|
||||
case 23: return "erudnint";
|
||||
case 24: return "erudnext";
|
||||
case 25: return "nektulos";
|
||||
case 26: return "cshome";
|
||||
case 27: return "lavastorm";
|
||||
case 28: return "nektropos";
|
||||
case 29: return "halas";
|
||||
case 30: return "everfrost";
|
||||
case 31: return "soldunga";
|
||||
case 32: return "soldungb";
|
||||
case 33: return "misty";
|
||||
case 34: return "nro";
|
||||
case 35: return "sro";
|
||||
case 36: return "befallen";
|
||||
case 37: return "oasis";
|
||||
case 38: return "tox";
|
||||
case 39: return "hole";
|
||||
case 40: return "neriaka";
|
||||
case 41: return "neriakb";
|
||||
case 42: return "neriakc";
|
||||
case 43: return "neriakd";
|
||||
case 44: return "najena";
|
||||
case 45: return "qcat";
|
||||
case 46: return "innothule";
|
||||
case 47: return "feerrott";
|
||||
case 48: return "cazicthule";
|
||||
case 49: return "oggok";
|
||||
case 50: return "rathemtn";
|
||||
case 51: return "lakerathe";
|
||||
case 52: return "grobb";
|
||||
case 53: return "aviak";
|
||||
case 54: return "gfaydark";
|
||||
case 55: return "akanon";
|
||||
case 56: return "steamfont";
|
||||
case 57: return "lfaydark";
|
||||
case 58: return "crushbone";
|
||||
case 59: return "mistmoore";
|
||||
case 60: return "kaladima";
|
||||
case 61: return "felwithea";
|
||||
case 62: return "felwitheb";
|
||||
case 63: return "unrest";
|
||||
case 64: return "kedge";
|
||||
case 65: return "guktop";
|
||||
case 66: return "gukbottom";
|
||||
case 67: return "kaladimb";
|
||||
case 68: return "butcher";
|
||||
case 69: return "oot";
|
||||
case 70: return "cauldron";
|
||||
case 71: return "airplane";
|
||||
case 72: return "fearplane";
|
||||
case 73: return "permafrost";
|
||||
case 74: return "kerraridge";
|
||||
case 75: return "paineel";
|
||||
case 76: return "hateplane";
|
||||
case 77: return "arena";
|
||||
case 78: return "fieldofbone";
|
||||
case 79: return "warslikswood";
|
||||
case 80: return "soltemple";
|
||||
case 81: return "droga";
|
||||
case 82: return "cabwest";
|
||||
case 83: return "swampofnohope";
|
||||
case 84: return "firiona";
|
||||
case 85: return "lakeofillomen";
|
||||
case 86: return "dreadlands";
|
||||
case 87: return "burningwood";
|
||||
case 88: return "kaesora";
|
||||
case 89: return "sebilis";
|
||||
case 90: return "citymist";
|
||||
case 91: return "skyfire";
|
||||
case 92: return "frontiermtns";
|
||||
case 93: return "overthere";
|
||||
case 94: return "emeraldjungle";
|
||||
case 95: return "trakanon";
|
||||
case 96: return "timorous";
|
||||
case 97: return "kurn";
|
||||
case 98: return "erudsxing";
|
||||
case 100: return "stonebrunt";
|
||||
case 101: return "warrens";
|
||||
case 102: return "karnor";
|
||||
case 103: return "chardok";
|
||||
case 104: return "dalnir";
|
||||
case 105: return "charasis";
|
||||
case 106: return "cabeast";
|
||||
case 107: return "nurga";
|
||||
case 108: return "veeshan";
|
||||
case 109: return "veksar";
|
||||
case 110: return "iceclad";
|
||||
case 111: return "frozenshadow";
|
||||
case 112: return "velketor";
|
||||
case 113: return "kael";
|
||||
case 114: return "skyshrine";
|
||||
case 115: return "thurgadina";
|
||||
case 116: return "eastwastes";
|
||||
case 117: return "cobaltscar";
|
||||
case 118: return "greatdivide";
|
||||
case 119: return "wakening";
|
||||
case 120: return "westwastes";
|
||||
case 121: return "crystal";
|
||||
case 123: return "necropolis";
|
||||
case 124: return "templeveeshan";
|
||||
case 125: return "sirens";
|
||||
case 126: return "mischiefplane";
|
||||
case 127: return "growthplane";
|
||||
case 128: return "sleeper";
|
||||
case 129: return "thurgadinb";
|
||||
case 130: return "erudsxing2";
|
||||
case 150: return "shadowhaven";
|
||||
case 151: return "bazaar";
|
||||
case 152: return "nexus";
|
||||
case 153: return "echo";
|
||||
case 154: return "acrylia";
|
||||
case 155: return "sharvahl";
|
||||
case 156: return "paludal";
|
||||
case 157: return "fungusgrove";
|
||||
case 158: return "vexthal";
|
||||
case 159: return "sseru";
|
||||
case 160: return "katta";
|
||||
case 161: return "netherbian";
|
||||
case 162: return "ssratemple";
|
||||
case 163: return "griegsend";
|
||||
case 164: return "thedeep";
|
||||
case 165: return "shadeweaver";
|
||||
case 166: return "hollowshade";
|
||||
case 167: return "grimling";
|
||||
case 168: return "mseru";
|
||||
case 169: return "letalis";
|
||||
case 170: return "twilight";
|
||||
case 171: return "thegrey";
|
||||
case 172: return "tenebrous";
|
||||
case 173: return "maiden";
|
||||
case 174: return "dawnshroud";
|
||||
case 175: return "scarlet";
|
||||
case 176: return "umbral";
|
||||
case 179: return "akheva";
|
||||
case 180: return "arena2";
|
||||
case 181: return "jaggedpine";
|
||||
case 182: return "nedaria";
|
||||
case 183: return "tutorial";
|
||||
case 184: return "load";
|
||||
case 185: return "load2";
|
||||
case 186: return "hateplaneb";
|
||||
case 187: return "shadowrest";
|
||||
case 188: return "tutoriala";
|
||||
case 189: return "tutorialb";
|
||||
case 190: return "clz";
|
||||
case 200: return "codecay";
|
||||
case 201: return "pojustice";
|
||||
case 202: return "poknowledge";
|
||||
case 203: return "potranquility";
|
||||
case 204: return "ponightmare";
|
||||
case 205: return "podisease";
|
||||
case 206: return "poinnovation";
|
||||
case 207: return "potorment";
|
||||
case 208: return "povalor";
|
||||
case 209: return "bothunder";
|
||||
case 210: return "postorms";
|
||||
case 211: return "hohonora";
|
||||
case 212: return "solrotower";
|
||||
case 213: return "powar";
|
||||
case 214: return "potactics";
|
||||
case 215: return "poair";
|
||||
case 216: return "powater";
|
||||
case 217: return "pofire";
|
||||
case 218: return "poeartha";
|
||||
case 219: return "potimea";
|
||||
case 220: return "hohonorb";
|
||||
case 221: return "nightmareb";
|
||||
case 222: return "poearthb";
|
||||
case 223: return "potimeb";
|
||||
case 224: return "gunthak";
|
||||
case 225: return "dulak";
|
||||
case 226: return "torgiran";
|
||||
case 227: return "nadox";
|
||||
case 228: return "hatesfury";
|
||||
case 229: return "guka";
|
||||
case 230: return "ruja";
|
||||
case 231: return "taka";
|
||||
case 232: return "mira";
|
||||
case 233: return "mmca";
|
||||
case 234: return "gukb";
|
||||
case 235: return "rujb";
|
||||
case 236: return "takb";
|
||||
case 237: return "mirb";
|
||||
case 238: return "mmcb";
|
||||
case 239: return "gukc";
|
||||
case 240: return "rujc";
|
||||
case 241: return "takc";
|
||||
case 242: return "mirc";
|
||||
case 243: return "mmcc";
|
||||
case 244: return "gukd";
|
||||
case 245: return "rujd";
|
||||
case 246: return "takd";
|
||||
case 247: return "mird";
|
||||
case 248: return "mmcd";
|
||||
case 249: return "guke";
|
||||
case 250: return "ruje";
|
||||
case 251: return "take";
|
||||
case 252: return "mire";
|
||||
case 253: return "mmce";
|
||||
case 254: return "gukf";
|
||||
case 255: return "rujf";
|
||||
case 256: return "takf";
|
||||
case 257: return "mirf";
|
||||
case 258: return "mmcf";
|
||||
case 259: return "gukg";
|
||||
case 260: return "rujg";
|
||||
case 261: return "takg";
|
||||
case 262: return "mirg";
|
||||
case 263: return "mmcg";
|
||||
case 264: return "gukh";
|
||||
case 265: return "rujh";
|
||||
case 266: return "takh";
|
||||
case 267: return "mirh";
|
||||
case 268: return "mmch";
|
||||
case 269: return "ruji";
|
||||
case 270: return "taki";
|
||||
case 271: return "miri";
|
||||
case 272: return "mmci";
|
||||
case 273: return "rujj";
|
||||
case 274: return "takj";
|
||||
case 275: return "mirj";
|
||||
case 276: return "mmcj";
|
||||
case 277: return "chardokb";
|
||||
case 278: return "soldungc";
|
||||
case 279: return "abysmal";
|
||||
case 280: return "natimbi";
|
||||
case 281: return "qinimi";
|
||||
case 282: return "riwwi";
|
||||
case 283: return "barindu";
|
||||
case 284: return "ferubi";
|
||||
case 285: return "snpool";
|
||||
case 286: return "snlair";
|
||||
case 287: return "snplant";
|
||||
case 288: return "sncrematory";
|
||||
case 289: return "tipt";
|
||||
case 290: return "vxed";
|
||||
case 291: return "yxtta";
|
||||
case 292: return "uqua";
|
||||
case 293: return "kodtaz";
|
||||
case 294: return "ikkinz";
|
||||
case 295: return "qvic";
|
||||
case 296: return "inktuta";
|
||||
case 297: return "txevu";
|
||||
case 298: return "tacvi";
|
||||
case 299: return "qvicb";
|
||||
case 300: return "wallofslaughter";
|
||||
case 301: return "bloodfields";
|
||||
case 302: return "draniksscar";
|
||||
case 303: return "causeway";
|
||||
case 304: return "chambersa";
|
||||
case 305: return "chambersb";
|
||||
case 306: return "chambersc";
|
||||
case 307: return "chambersd";
|
||||
case 308: return "chamberse";
|
||||
case 309: return "chambersf";
|
||||
case 316: return "provinggrounds";
|
||||
case 317: return "anguish";
|
||||
case 318: return "dranikhollowsa";
|
||||
case 319: return "dranikhollowsb";
|
||||
case 320: return "dranikhollowsc";
|
||||
case 328: return "dranikcatacombsa";
|
||||
case 329: return "dranikcatacombsb";
|
||||
case 330: return "dranikcatacombsc";
|
||||
case 331: return "draniksewersa";
|
||||
case 332: return "draniksewersb";
|
||||
case 333: return "draniksewersc";
|
||||
case 334: return "riftseekers";
|
||||
case 335: return "harbingers";
|
||||
case 336: return "dranik";
|
||||
case 337: return "broodlands";
|
||||
case 338: return "stillmoona";
|
||||
case 339: return "stillmoonb";
|
||||
case 340: return "thundercrest";
|
||||
case 341: return "delvea";
|
||||
case 342: return "delveb";
|
||||
case 343: return "thenest";
|
||||
case 344: return "guildlobby";
|
||||
case 345: return "guildhall";
|
||||
case 346: return "barter";
|
||||
case 347: return "illsalin";
|
||||
case 348: return "illsalina";
|
||||
case 349: return "illsalinb";
|
||||
case 350: return "illsalinc";
|
||||
case 351: return "dreadspire";
|
||||
case 354: return "drachnidhive";
|
||||
case 355: return "drachnidhivea";
|
||||
case 356: return "drachnidhiveb";
|
||||
case 357: return "drachnidhivec";
|
||||
case 358: return "westkorlach";
|
||||
case 359: return "westkorlacha";
|
||||
case 360: return "westkorlachb";
|
||||
case 361: return "westkorlachc";
|
||||
case 362: return "eastkorlach";
|
||||
case 363: return "eastkorlacha";
|
||||
case 364: return "shadowspine";
|
||||
case 365: return "corathus";
|
||||
case 366: return "corathusa";
|
||||
case 367: return "corathusb";
|
||||
case 368: return "nektulosa";
|
||||
case 369: return "arcstone";
|
||||
case 370: return "relic";
|
||||
case 371: return "skylance";
|
||||
case 372: return "devastation";
|
||||
case 373: return "devastationa";
|
||||
case 374: return "rage";
|
||||
case 375: return "ragea";
|
||||
case 376: return "takishruins";
|
||||
case 377: return "takishruinsa";
|
||||
case 378: return "elddar";
|
||||
case 379: return "elddara";
|
||||
case 380: return "theater";
|
||||
case 381: return "theatera";
|
||||
case 382: return "freeporteast";
|
||||
case 383: return "freeportwest";
|
||||
case 384: return "freeportsewers";
|
||||
case 385: return "freeportacademy";
|
||||
case 386: return "freeporttemple";
|
||||
case 387: return "freeportmilitia";
|
||||
case 388: return "freeportarena";
|
||||
case 389: return "freeportcityhall";
|
||||
case 390: return "freeporttheater";
|
||||
case 391: return "freeporthall";
|
||||
case 392: return "northro";
|
||||
case 393: return "southro";
|
||||
case 394: return "crescent";
|
||||
case 395: return "moors";
|
||||
case 396: return "stonehive";
|
||||
case 397: return "mesa";
|
||||
case 398: return "roost";
|
||||
case 399: return "steppes";
|
||||
case 400: return "icefall";
|
||||
case 401: return "valdeholm";
|
||||
case 402: return "frostcrypt";
|
||||
case 403: return "sunderock";
|
||||
case 404: return "vergalid";
|
||||
case 405: return "direwind";
|
||||
case 406: return "ashengate";
|
||||
case 407: return "highpasshold";
|
||||
case 408: return "commonlands";
|
||||
case 409: return "oceanoftears";
|
||||
case 410: return "kithforest";
|
||||
case 411: return "befallenb";
|
||||
case 412: return "highpasskeep";
|
||||
case 413: return "innothuleb";
|
||||
case 414: return "toxxulia";
|
||||
case 415: return "mistythicket";
|
||||
case 416: return "kattacastrum";
|
||||
case 417: return "thalassius";
|
||||
case 418: return "atiiki";
|
||||
case 419: return "zhisza";
|
||||
case 420: return "silyssar";
|
||||
case 421: return "solteris";
|
||||
case 422: return "barren";
|
||||
case 423: return "buriedsea";
|
||||
case 424: return "jardelshook";
|
||||
case 425: return "monkeyrock";
|
||||
case 426: return "suncrest";
|
||||
case 427: return "deadbone";
|
||||
case 428: return "blacksail";
|
||||
case 429: return "maidensgrave";
|
||||
case 430: return "redfeather";
|
||||
case 431: return "shipmvp";
|
||||
case 432: return "shipmvu";
|
||||
case 433: return "shippvu";
|
||||
case 434: return "shipuvu";
|
||||
case 435: return "shipmvm";
|
||||
case 436: return "mechanotus";
|
||||
case 437: return "mansion";
|
||||
case 438: return "steamfactory";
|
||||
case 439: return "shipworkshop";
|
||||
case 440: return "gyrospireb";
|
||||
case 441: return "gyrospirez";
|
||||
case 442: return "dragonscale";
|
||||
case 443: return "lopingplains";
|
||||
case 444: return "hillsofshade";
|
||||
case 445: return "bloodmoon";
|
||||
case 446: return "crystallos";
|
||||
case 447: return "guardian";
|
||||
case 448: return "steamfontmts";
|
||||
case 449: return "cryptofshade";
|
||||
case 451: return "dragonscaleb";
|
||||
case 452: return "oldfieldofbone";
|
||||
case 453: return "oldkaesoraa";
|
||||
case 454: return "oldkaesorab";
|
||||
case 455: return "oldkurn";
|
||||
case 456: return "oldkithicor";
|
||||
case 457: return "oldcommons";
|
||||
case 458: return "oldhighpass";
|
||||
case 459: return "thevoida";
|
||||
case 460: return "thevoidb";
|
||||
case 461: return "thevoidc";
|
||||
case 462: return "thevoidd";
|
||||
case 463: return "thevoide";
|
||||
case 464: return "thevoidf";
|
||||
case 465: return "thevoidg";
|
||||
case 466: return "oceangreenhills";
|
||||
case 467: return "oceangreenvillage";
|
||||
case 468: return "oldblackburrow";
|
||||
case 469: return "bertoxtemple";
|
||||
case 470: return "discord";
|
||||
case 471: return "discordtower";
|
||||
case 472: return "oldbloodfield";
|
||||
case 473: return "precipiceofwar";
|
||||
case 474: return "olddranik";
|
||||
case 475: return "toskirakk";
|
||||
case 476: return "korascian";
|
||||
case 477: return "rathechamber";
|
||||
case 480: return "brellsrest";
|
||||
case 481: return "fungalforest";
|
||||
case 482: return "underquarry";
|
||||
case 483: return "coolingchamber";
|
||||
case 484: return "shiningcity";
|
||||
case 485: return "arthicrex";
|
||||
case 486: return "foundation";
|
||||
case 487: return "lichencreep";
|
||||
case 488: return "pellucid";
|
||||
case 489: return "stonesnake";
|
||||
case 490: return "brellstemple";
|
||||
case 491: return "convorteum";
|
||||
case 492: return "brellsarena";
|
||||
case 493: return "weddingchapel";
|
||||
case 494: return "weddingchapeldark";
|
||||
case 495: return "dragoncrypt";
|
||||
case 700: return "feerrott2";
|
||||
case 701: return "thulehouse1";
|
||||
case 702: return "thulehouse2";
|
||||
case 703: return "housegarden";
|
||||
case 704: return "thulelibrary";
|
||||
case 705: return "well";
|
||||
case 706: return "fallen";
|
||||
case 707: return "morellcastle";
|
||||
case 708: return "somnium";
|
||||
case 709: return "alkabormare";
|
||||
case 710: return "miragulmare";
|
||||
case 711: return "thuledream";
|
||||
case 712: return "neighborhood";
|
||||
case 724: return "argath";
|
||||
case 725: return "arelis";
|
||||
case 726: return "sarithcity";
|
||||
case 727: return "rubak";
|
||||
case 728: return "beastdomain";
|
||||
case 729: return "resplendent";
|
||||
case 730: return "pillarsalra";
|
||||
case 731: return "windsong";
|
||||
case 732: return "cityofbronze";
|
||||
case 733: return "sepulcher";
|
||||
case 734: return "eastsepulcher";
|
||||
case 735: return "westsepulcher";
|
||||
case 752: return "shardslanding";
|
||||
case 753: return "xorbb";
|
||||
case 754: return "kaelshard";
|
||||
case 755: return "eastwastesshard";
|
||||
case 756: return "crystalshard";
|
||||
case 757: return "breedinggrounds";
|
||||
case 758: return "eviltree";
|
||||
case 759: return "grelleth";
|
||||
case 760: return "chapterhouse";
|
||||
case 996: return "arttest";
|
||||
case 998: return "fhalls";
|
||||
case 999: return "apprentice";
|
||||
}
|
||||
return "UNKNWN";
|
||||
}
|
||||
@@ -174,7 +174,7 @@ ZoneRepository::Zone *ZoneStore::GetZone(const char *in_zone_name)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ZoneRepository::Zone *ZoneStore::GetZone(const std::string& in_zone_name)
|
||||
ZoneRepository::Zone *ZoneStore::GetZone(std::string in_zone_name)
|
||||
{
|
||||
for (auto &z: m_zones) {
|
||||
if (z.short_name == in_zone_name) {
|
||||
|
||||
+2
-2
@@ -35,7 +35,7 @@ public:
|
||||
|
||||
ZoneRepository::Zone *GetZone(uint32 zone_id, int version = 0);
|
||||
ZoneRepository::Zone *GetZone(const char *in_zone_name);
|
||||
ZoneRepository::Zone *GetZone(const std::string& in_zone_name);
|
||||
ZoneRepository::Zone *GetZone(std::string in_zone_name);
|
||||
uint32 GetZoneID(const char *in_zone_name);
|
||||
uint32 GetZoneID(std::string zone_name);
|
||||
std::string GetZoneName(uint32 zone_id);
|
||||
@@ -53,7 +53,7 @@ extern ZoneStore zone_store;
|
||||
* Global helpers
|
||||
*/
|
||||
inline uint32 ZoneID(const char *in_zone_name) { return zone_store.GetZoneID(in_zone_name); }
|
||||
inline uint32 ZoneID(const std::string& zone_name) { return zone_store.GetZoneID(zone_name); }
|
||||
inline uint32 ZoneID(std::string zone_name) { return zone_store.GetZoneID(zone_name); }
|
||||
inline const char *ZoneName(uint32 zone_id, bool error_unknown = false)
|
||||
{
|
||||
return zone_store.GetZoneName(
|
||||
|
||||
@@ -28,6 +28,11 @@
|
||||
int ZoneLaunch::s_running = 0; //the number of zones running under this launcher
|
||||
Timer ZoneLaunch::s_startTimer(1); //I do not trust this things state after static initialization
|
||||
|
||||
void ZoneLaunch::InitStartTimer() {
|
||||
s_startTimer.Start(1);
|
||||
s_startTimer.Trigger();
|
||||
}
|
||||
|
||||
ZoneLaunch::ZoneLaunch(WorldServer *world, const char *launcher_name,
|
||||
const char *zone_name, uint16 port, const EQEmuConfig *config)
|
||||
: m_state(StateStartPending),
|
||||
|
||||
@@ -39,6 +39,10 @@ public:
|
||||
void SendStatus() const;
|
||||
|
||||
const char *GetZone() const { return(m_zone.c_str()); }
|
||||
uint32 GetStartCount() const { return(m_startCount); }
|
||||
|
||||
//should only be called during process init to setup the start timer.
|
||||
static void InitStartTimer();
|
||||
|
||||
protected:
|
||||
bool IsRunning() const { return(m_state == StateStarted || m_state == StateStopPending || m_state == StateRestartPending); }
|
||||
|
||||
@@ -260,6 +260,27 @@ bool AccountManagement::UpdateLoginserverWorldAdminAccountPasswordByName(
|
||||
return updated_account;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param in_account_id
|
||||
* @param in_account_password_hash
|
||||
*/
|
||||
bool AccountManagement::UpdateLoginserverWorldAdminAccountPasswordById(
|
||||
uint32 in_account_id,
|
||||
const std::string &in_account_password_hash
|
||||
)
|
||||
{
|
||||
bool updated_account = server.db->UpdateLoginWorldAdminAccountPassword(in_account_id, in_account_password_hash);
|
||||
|
||||
LogInfo(
|
||||
"[{}] account_name [{}] status [{}]",
|
||||
__func__,
|
||||
in_account_id,
|
||||
(updated_account ? "success" : "failed")
|
||||
);
|
||||
|
||||
return updated_account;
|
||||
}
|
||||
|
||||
constexpr int REQUEST_TIMEOUT_MS = 1500;
|
||||
|
||||
/**
|
||||
|
||||
@@ -80,6 +80,16 @@ public:
|
||||
const std::string &in_account_password
|
||||
);
|
||||
|
||||
/**
|
||||
* @param in_account_id
|
||||
* @param in_account_password_hash
|
||||
* @return
|
||||
*/
|
||||
static bool UpdateLoginserverWorldAdminAccountPasswordById(
|
||||
uint32 in_account_id,
|
||||
const std::string &in_account_password_hash
|
||||
);
|
||||
|
||||
static uint32 HealthCheckUserLogin();
|
||||
};
|
||||
|
||||
|
||||
+141
-1
@@ -489,7 +489,7 @@ bool Client::VerifyLoginHash(
|
||||
* @param db_loginserver
|
||||
*/
|
||||
void Client::DoSuccessfulLogin(
|
||||
const std::string& in_account_name,
|
||||
const std::string in_account_name,
|
||||
int db_account_id,
|
||||
const std::string &db_loginserver
|
||||
)
|
||||
@@ -658,6 +658,146 @@ void Client::CreateEQEmuAccount(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param connection
|
||||
*/
|
||||
void Client::LoginOnNewConnection(std::shared_ptr<EQ::Net::DaybreakConnection> connection)
|
||||
{
|
||||
m_login_connection = connection;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param conn
|
||||
* @param from
|
||||
* @param to
|
||||
*/
|
||||
void Client::LoginOnStatusChange(
|
||||
std::shared_ptr<EQ::Net::DaybreakConnection> conn,
|
||||
EQ::Net::DbProtocolStatus from,
|
||||
EQ::Net::DbProtocolStatus to
|
||||
)
|
||||
{
|
||||
if (to == EQ::Net::StatusConnected) {
|
||||
LogDebug("EQ::Net::StatusConnected");
|
||||
LoginSendSessionReady();
|
||||
}
|
||||
|
||||
if (to == EQ::Net::StatusDisconnecting || to == EQ::Net::StatusDisconnected) {
|
||||
LogDebug("EQ::Net::StatusDisconnecting || EQ::Net::StatusDisconnected");
|
||||
|
||||
DoFailedLogin();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param conn
|
||||
* @param from
|
||||
* @param to
|
||||
*/
|
||||
void Client::LoginOnStatusChangeIgnored(
|
||||
std::shared_ptr<EQ::Net::DaybreakConnection> conn,
|
||||
EQ::Net::DbProtocolStatus from,
|
||||
EQ::Net::DbProtocolStatus to
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param conn
|
||||
* @param p
|
||||
*/
|
||||
void Client::LoginOnPacketRecv(std::shared_ptr<EQ::Net::DaybreakConnection> conn, const EQ::Net::Packet &p)
|
||||
{
|
||||
auto opcode = p.GetUInt16(0);
|
||||
switch (opcode) {
|
||||
case 0x0017: //OP_ChatMessage
|
||||
LoginSendLogin();
|
||||
break;
|
||||
case 0x0018:
|
||||
LoginProcessLoginResponse(p);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Client::LoginSendSessionReady()
|
||||
{
|
||||
EQ::Net::DynamicPacket p;
|
||||
p.PutUInt16(0, 1); //OP_SessionReady
|
||||
p.PutUInt32(2, 2);
|
||||
|
||||
m_login_connection->QueuePacket(p);
|
||||
}
|
||||
|
||||
void Client::LoginSendLogin()
|
||||
{
|
||||
size_t buffer_len = m_stored_user.length() + m_stored_pass.length() + 2;
|
||||
std::unique_ptr<char[]> buffer(new char[buffer_len]);
|
||||
|
||||
strcpy(&buffer[0], m_stored_user.c_str());
|
||||
strcpy(&buffer[m_stored_user.length() + 1], m_stored_pass.c_str());
|
||||
|
||||
size_t encrypted_len = buffer_len;
|
||||
|
||||
if (encrypted_len % 8 > 0) {
|
||||
encrypted_len = ((encrypted_len / 8) + 1) * 8;
|
||||
}
|
||||
|
||||
EQ::Net::DynamicPacket p;
|
||||
p.Resize(12 + encrypted_len);
|
||||
p.PutUInt16(0, 2); //OP_Login
|
||||
p.PutUInt32(2, 3);
|
||||
|
||||
eqcrypt_block(&buffer[0], buffer_len, (char *) p.Data() + 12, true);
|
||||
|
||||
m_login_connection->QueuePacket(p);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param p
|
||||
*/
|
||||
void Client::LoginProcessLoginResponse(const EQ::Net::Packet &p)
|
||||
{
|
||||
auto encrypt_size = p.Length() - 12;
|
||||
|
||||
if (encrypt_size % 8 > 0) {
|
||||
encrypt_size = (encrypt_size / 8) * 8;
|
||||
}
|
||||
|
||||
std::unique_ptr<char[]> decrypted(new char[encrypt_size]);
|
||||
|
||||
eqcrypt_block((char *) p.Data() + 12, encrypt_size, &decrypted[0], false);
|
||||
|
||||
EQ::Net::StaticPacket sp(&decrypted[0], encrypt_size);
|
||||
auto response_error = sp.GetUInt16(1);
|
||||
|
||||
m_login_connection_manager->OnConnectionStateChange(
|
||||
std::bind(
|
||||
&Client::LoginOnStatusChangeIgnored,
|
||||
this,
|
||||
std::placeholders::_1,
|
||||
std::placeholders::_2,
|
||||
std::placeholders::_3
|
||||
)
|
||||
);
|
||||
|
||||
if (response_error > 101) {
|
||||
LogDebug("response [{0}] failed login", response_error);
|
||||
DoFailedLogin();
|
||||
m_login_connection->Close();
|
||||
}
|
||||
else {
|
||||
LogDebug(
|
||||
"response [{0}] login succeeded user [{1}]",
|
||||
response_error,
|
||||
m_stored_user
|
||||
);
|
||||
|
||||
auto m_dbid = sp.GetUInt32(8);
|
||||
|
||||
CreateEQEmuAccount(m_stored_user, m_stored_pass, m_dbid);
|
||||
m_login_connection->Close();
|
||||
}
|
||||
}
|
||||
bool Client::ProcessHealthCheck(std::string username)
|
||||
{
|
||||
if (username == "healthcheckuser") {
|
||||
|
||||
+16
-1
@@ -175,7 +175,7 @@ public:
|
||||
const std::string &password_hash
|
||||
);
|
||||
|
||||
void DoSuccessfulLogin(const std::string& in_account_name, int db_account_id, const std::string &db_loginserver);
|
||||
void DoSuccessfulLogin(const std::string in_account_name, int db_account_id, const std::string &db_loginserver);
|
||||
void CreateLocalAccount(const std::string &username, const std::string &password);
|
||||
void CreateEQEmuAccount(const std::string &in_account_name, const std::string &in_account_password, unsigned int loginserver_account_id);
|
||||
|
||||
@@ -198,6 +198,21 @@ private:
|
||||
|
||||
std::string m_stored_user;
|
||||
std::string m_stored_pass;
|
||||
void LoginOnNewConnection(std::shared_ptr<EQ::Net::DaybreakConnection> connection);
|
||||
void LoginOnStatusChange(
|
||||
std::shared_ptr<EQ::Net::DaybreakConnection> conn,
|
||||
EQ::Net::DbProtocolStatus from,
|
||||
EQ::Net::DbProtocolStatus to
|
||||
);
|
||||
void LoginOnStatusChangeIgnored(
|
||||
std::shared_ptr<EQ::Net::DaybreakConnection> conn,
|
||||
EQ::Net::DbProtocolStatus from,
|
||||
EQ::Net::DbProtocolStatus to
|
||||
);
|
||||
void LoginOnPacketRecv(std::shared_ptr<EQ::Net::DaybreakConnection> conn, const EQ::Net::Packet &p);
|
||||
void LoginSendSessionReady();
|
||||
void LoginSendLogin();
|
||||
void LoginProcessLoginResponse(const EQ::Net::Packet &p);
|
||||
static bool ProcessHealthCheck(std::string username);
|
||||
};
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ Database::Database(
|
||||
user.c_str(),
|
||||
pass.c_str(),
|
||||
name.c_str(),
|
||||
Strings::ToUnsignedInt(port),
|
||||
Strings::ToInt(port),
|
||||
&errnum,
|
||||
errbuf
|
||||
)
|
||||
@@ -93,7 +93,7 @@ bool Database::GetLoginDataFromAccountInfo(
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
id = Strings::ToUnsignedInt(row[0]);
|
||||
id = Strings::ToInt(row[0]);
|
||||
password = row[1];
|
||||
|
||||
LogDebug(
|
||||
@@ -145,7 +145,7 @@ bool Database::GetLoginTokenDataFromToken(
|
||||
}
|
||||
|
||||
if (strcmp(row[2], "login_server_id") == 0) {
|
||||
db_account_id = Strings::ToUnsignedInt(row[3]);
|
||||
db_account_id = Strings::ToInt(row[3]);
|
||||
found_login_id = true;
|
||||
continue;
|
||||
}
|
||||
@@ -178,7 +178,7 @@ unsigned int Database::GetFreeID(const std::string &loginserver)
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
return Strings::ToUnsignedInt(row[0]);
|
||||
return Strings::ToInt(row[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -373,7 +373,7 @@ Database::DbWorldRegistration Database::GetWorldRegistration(
|
||||
r.server_list_type = Strings::ToInt(row[3]);
|
||||
r.is_server_trusted = Strings::ToInt(row[2]) > 0;
|
||||
r.server_list_description = row[4];
|
||||
r.server_admin_id = Strings::ToUnsignedInt(row[5]);
|
||||
r.server_admin_id = Strings::ToInt(row[5]);
|
||||
|
||||
if (r.server_admin_id <= 0) {
|
||||
return r;
|
||||
@@ -513,7 +513,7 @@ bool Database::CreateWorldRegistration(
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
id = Strings::ToUnsignedInt(row[0]);
|
||||
id = Strings::ToInt(row[0]);
|
||||
auto insert_query = fmt::format(
|
||||
"INSERT INTO login_world_servers SET id = {0}, long_name = '{1}', short_name = '{2}', last_ip_address = '{3}', \n"
|
||||
"login_server_list_type_id = 3, login_server_admin_id = {4}, is_server_trusted = 0, tag_description = ''",
|
||||
@@ -647,7 +647,7 @@ Database::DbLoginServerAdmin Database::GetLoginServerAdmin(const std::string &ac
|
||||
if (results.RowCount() == 1) {
|
||||
auto row = results.begin();
|
||||
r.loaded = true;
|
||||
r.id = Strings::ToUnsignedInt(row[0]);
|
||||
r.id = Strings::ToInt(row[0]);
|
||||
r.account_name = row[1];
|
||||
r.account_password = row[2];
|
||||
r.first_name = row[3];
|
||||
@@ -683,7 +683,7 @@ Database::DbLoginServerAccount Database::GetLoginServerAccountByAccountName(
|
||||
if (results.RowCount() == 1) {
|
||||
auto row = results.begin();
|
||||
r.loaded = true;
|
||||
r.id = Strings::ToUnsignedInt(row[0]);
|
||||
r.id = Strings::ToInt(row[0]);
|
||||
r.account_name = row[1];
|
||||
r.account_password = row[2];
|
||||
r.account_email = row[3];
|
||||
|
||||
@@ -29,6 +29,7 @@ public:
|
||||
* Destructor, frees our database if needed.
|
||||
*/
|
||||
~Database();
|
||||
bool IsConnected() { return (m_database != nullptr); }
|
||||
|
||||
/**
|
||||
* Retrieves the login data (password hash and account id) from the account name provided needed for client login procedure.
|
||||
|
||||
@@ -23,6 +23,13 @@ struct LoginHandShakeReply_Struct {
|
||||
char unknown[1]; // variable length string
|
||||
};
|
||||
|
||||
// for reference, login buffer is variable (minimum size 8 due to encryption)
|
||||
struct PlayerLogin_Struct {
|
||||
LoginBaseMessage_Struct base_header;
|
||||
char username[1];
|
||||
char password[1];
|
||||
};
|
||||
|
||||
// variable length, can use directly if not serializing strings
|
||||
struct PlayerLoginReply_Struct {
|
||||
// base header excluded to make struct data easier to encrypt
|
||||
|
||||
@@ -490,7 +490,7 @@ namespace LoginserverWebserver {
|
||||
token_data.can_write
|
||||
);
|
||||
|
||||
server.token_manager->loaded_api_tokens.emplace(
|
||||
server.token_manager->loaded_api_tokens.insert(
|
||||
std::make_pair(
|
||||
token_data.token,
|
||||
token_data
|
||||
|
||||
@@ -71,10 +71,10 @@ public:
|
||||
inline void AutoLinkAccounts(bool b) { auto_link_accounts = b; }
|
||||
inline bool CanAutoLinkAccounts() const { return auto_link_accounts; }
|
||||
|
||||
inline void EQEmuLoginServerAddress(const std::string& v) { eqemu_loginserver_address = v; }
|
||||
inline void EQEmuLoginServerAddress(std::string v) { eqemu_loginserver_address = v; }
|
||||
inline std::string GetEQEmuLoginServerAddress() const { return eqemu_loginserver_address; }
|
||||
|
||||
inline void DefaultLoginServerName(const std::string& v) { default_loginserver_name = v; }
|
||||
inline void DefaultLoginServerName(std::string v) { default_loginserver_name = v; }
|
||||
inline std::string GetDefaultLoginServerName() const { return default_loginserver_name; }
|
||||
|
||||
inline void UpdateInsecurePasswords(bool b) { update_insecure_passwords = b; }
|
||||
|
||||
@@ -73,6 +73,25 @@ ServerManager::ServerManager()
|
||||
|
||||
ServerManager::~ServerManager() = default;
|
||||
|
||||
/**
|
||||
* @param ip_address
|
||||
* @param port
|
||||
* @return
|
||||
*/
|
||||
WorldServer *ServerManager::GetServerByAddress(const std::string &ip_address, int port)
|
||||
{
|
||||
auto iter = m_world_servers.begin();
|
||||
while (iter != m_world_servers.end()) {
|
||||
if ((*iter)->GetConnection()->Handle()->RemoteIP() == ip_address &&
|
||||
(*iter)->GetConnection()->Handle()->RemotePort()) {
|
||||
return (*iter).get();
|
||||
}
|
||||
++iter;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param client
|
||||
* @param sequence
|
||||
|
||||
@@ -72,6 +72,17 @@ public:
|
||||
const std::list<std::unique_ptr<WorldServer>> &getWorldServers() const;
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
* Retrieves a server(if exists) by ip address
|
||||
* Useful utility for the reconnect process
|
||||
*
|
||||
* @param ip_address
|
||||
* @param port
|
||||
* @return
|
||||
*/
|
||||
WorldServer *GetServerByAddress(const std::string &ip_address, int port);
|
||||
|
||||
std::unique_ptr<EQ::Net::ServertalkServer> m_server_connection;
|
||||
std::list<std::unique_ptr<WorldServer>> m_world_servers;
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ public:
|
||||
* Accesses connection, it is intentional that this is not const (trust me).
|
||||
*/
|
||||
std::shared_ptr<EQ::Net::ServertalkServerConnection> GetConnection() { return m_connection; }
|
||||
void SetConnection(std::shared_ptr<EQ::Net::ServertalkServerConnection> c) { m_connection = c; }
|
||||
|
||||
/**
|
||||
* @return
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "eqemu-server",
|
||||
"version": "22.9.1",
|
||||
"version": "22.4.5",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/EQEmu/Server.git"
|
||||
|
||||
@@ -45,6 +45,12 @@ public:
|
||||
void LogPlayerMove(QSPlayerLogMove_Struct* QS, uint32 Items);
|
||||
void LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint32 Items);
|
||||
void GeneralQueryReceive(ServerPacket *pack);
|
||||
|
||||
protected:
|
||||
void HandleMysqlError(uint32 errnum);
|
||||
private:
|
||||
void DBInitVars();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+7
-9
@@ -32,7 +32,7 @@ void ServerToClient45SayLink(std::string& clientSayLink, const std::string& serv
|
||||
void ServerToClient50SayLink(std::string& clientSayLink, const std::string& serverSayLink);
|
||||
void ServerToClient55SayLink(std::string& clientSayLink, const std::string& serverSayLink);
|
||||
|
||||
ChatChannel::ChatChannel(const std::string& inName, const std::string& inOwner, const std::string& inPassword, bool inPermanent, int inMinimumStatus) :
|
||||
ChatChannel::ChatChannel(std::string inName, std::string inOwner, std::string inPassword, bool inPermanent, int inMinimumStatus) :
|
||||
m_delete_timer(0) {
|
||||
|
||||
m_name = inName;
|
||||
@@ -137,7 +137,7 @@ ChatChannel *ChatChannelList::CreateChannel(
|
||||
return new_channel;
|
||||
}
|
||||
|
||||
ChatChannel* ChatChannelList::FindChannel(const std::string& Name) {
|
||||
ChatChannel* ChatChannelList::FindChannel(std::string Name) {
|
||||
|
||||
std::string normalized_name = CapitaliseName(Name);
|
||||
|
||||
@@ -283,7 +283,7 @@ void ChatChannel::SetPassword(const std::string& in_password) {
|
||||
}
|
||||
}
|
||||
|
||||
void ChatChannel::SetOwner(const std::string& in_owner) {
|
||||
void ChatChannel::SetOwner(std::string& in_owner) {
|
||||
|
||||
m_owner = in_owner;
|
||||
|
||||
@@ -393,15 +393,13 @@ bool ChatChannel::RemoveClient(Client *c) {
|
||||
|
||||
void ChatChannel::SendOPList(Client *c)
|
||||
{
|
||||
if (!c) {
|
||||
if (!c)
|
||||
return;
|
||||
}
|
||||
|
||||
c->GeneralChannelMessage("Channel " + m_name + " op-list: (Owner=" + m_owner + ")");
|
||||
|
||||
for (auto &&m : m_moderators) {
|
||||
for (auto &&m : m_moderators)
|
||||
c->GeneralChannelMessage(m);
|
||||
}
|
||||
}
|
||||
|
||||
void ChatChannel::SendChannelMembers(Client *c) {
|
||||
@@ -659,7 +657,7 @@ ChatChannel *ChatChannelList::RemoveClientFromChannel(const std::string& in_chan
|
||||
std::string channel_name = in_channel_name;
|
||||
|
||||
if (in_channel_name.length() > 0 && isdigit(channel_name[0])) {
|
||||
channel_name = c->ChannelSlotName(Strings::ToInt(in_channel_name));
|
||||
channel_name = c->ChannelSlotName(Strings::ToInt(in_channel_name.c_str()));
|
||||
}
|
||||
|
||||
auto *required_channel = FindChannel(channel_name);
|
||||
@@ -784,7 +782,7 @@ bool ChatChannel::HasVoice(std::string inVoiced)
|
||||
return std::find(std::begin(m_voiced), std::end(m_voiced), inVoiced) != std::end(m_voiced);
|
||||
}
|
||||
|
||||
std::string CapitaliseName(const std::string& inString) {
|
||||
std::string CapitaliseName(std::string inString) {
|
||||
|
||||
std::string NormalisedName = inString;
|
||||
|
||||
|
||||
+6
-6
@@ -15,7 +15,7 @@ class ChatChannel {
|
||||
|
||||
public:
|
||||
|
||||
ChatChannel(const std::string& inName, const std::string& inOwner, const std::string& inPassword, bool inPermanent, int inMinimumStatus = 0);
|
||||
ChatChannel(std::string inName, std::string inOwner, std::string inPassword, bool inPermanent, int inMinimumStatus = 0);
|
||||
~ChatChannel();
|
||||
|
||||
void AddClient(Client *c);
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
void SetPassword(const std::string& in_password);
|
||||
bool IsOwner(const std::string& name) { return (m_owner == name); }
|
||||
const std::string& GetPassword() { return m_password; }
|
||||
void SetOwner(const std::string& in_owner);
|
||||
void SetOwner(std::string& inOwner);
|
||||
std::string& GetOwnerName();
|
||||
void SetTemporary();
|
||||
void SetPermanent();
|
||||
@@ -76,7 +76,7 @@ class ChatChannelList {
|
||||
|
||||
public:
|
||||
ChatChannel* CreateChannel(const std::string& name, const std::string& owner, const std::string& password, bool permanent, int minimum_status, bool save_to_database = false);
|
||||
ChatChannel* FindChannel(const std::string& name);
|
||||
ChatChannel* FindChannel(std::string name);
|
||||
ChatChannel* AddClientToChannel(std::string channel_name, Client* c, bool command_directed = false);
|
||||
ChatChannel* RemoveClientFromChannel(const std::string& in_channel_name, Client* c, bool command_directed = false);
|
||||
void RemoveChannel(ChatChannel *Channel);
|
||||
@@ -91,8 +91,8 @@ public:
|
||||
static void AddToFilteredNames(const std::string& name);
|
||||
static bool IsOnChannelBlockList(const std::string& channel_name);
|
||||
static bool IsOnFilteredNameList(const std::string& channel_name);
|
||||
static inline void SetChannelBlockList(const std::vector<std::string>& new_list) { m_blocked_channel_names = new_list; }
|
||||
static inline void SetFilteredNameList(const std::vector<std::string>& new_list) { m_filtered_names = new_list; }
|
||||
static inline void SetChannelBlockList(std::vector<std::string> new_list) { m_blocked_channel_names = new_list; }
|
||||
static inline void SetFilteredNameList(std::vector<std::string> new_list) { m_filtered_names = new_list; }
|
||||
private:
|
||||
|
||||
LinkedList<ChatChannel*> ChatChannels;
|
||||
@@ -101,6 +101,6 @@ private:
|
||||
|
||||
};
|
||||
|
||||
std::string CapitaliseName(const std::string& inString);
|
||||
std::string CapitaliseName(std::string inString);
|
||||
|
||||
#endif
|
||||
|
||||
+26
-28
@@ -122,11 +122,11 @@ std::vector<std::string> ParseRecipients(std::string RecipientString) {
|
||||
|
||||
if (Comma == std::string::npos) {
|
||||
|
||||
RecipientList.emplace_back(RecipientString.substr(CurrentPos));
|
||||
RecipientList.push_back(RecipientString.substr(CurrentPos));
|
||||
|
||||
break;
|
||||
}
|
||||
RecipientList.emplace_back(RecipientString.substr(CurrentPos, Comma - CurrentPos));
|
||||
RecipientList.push_back(RecipientString.substr(CurrentPos, Comma - CurrentPos));
|
||||
|
||||
CurrentPos = Comma + 2;
|
||||
}
|
||||
@@ -348,7 +348,7 @@ static void ProcessMailTo(Client *c, std::string MailMessage) {
|
||||
}
|
||||
}
|
||||
|
||||
static void ProcessMailTo(Client *c, const std::string& from, const std::string& subject, const std::string& message) {
|
||||
static void ProcessMailTo(Client *c, std::string from, std::string subject, std::string message) {
|
||||
}
|
||||
|
||||
static void ProcessSetMessageStatus(std::string SetMessageCommand) {
|
||||
@@ -379,14 +379,14 @@ static void ProcessSetMessageStatus(std::string SetMessageCommand) {
|
||||
|
||||
if (NumEnd == std::string::npos) {
|
||||
|
||||
MessageNumber = Strings::ToInt(SetMessageCommand.substr(NumStart));
|
||||
MessageNumber = Strings::ToInt(SetMessageCommand.substr(NumStart).c_str());
|
||||
|
||||
database.SetMessageStatus(MessageNumber, Status);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
MessageNumber = Strings::ToInt(SetMessageCommand.substr(NumStart, NumEnd - NumStart));
|
||||
MessageNumber = Strings::ToInt(SetMessageCommand.substr(NumStart, NumEnd - NumStart).c_str());
|
||||
|
||||
database.SetMessageStatus(MessageNumber, Status);
|
||||
|
||||
@@ -571,9 +571,7 @@ void Clientlist::CheckForStaleConnectionsAll()
|
||||
|
||||
void Clientlist::CheckForStaleConnections(Client *c) {
|
||||
|
||||
if (!c) {
|
||||
return;
|
||||
}
|
||||
if (!c) return;
|
||||
|
||||
std::list<Client*>::iterator Iterator;
|
||||
|
||||
@@ -878,7 +876,7 @@ void Clientlist::ProcessOPMailCommand(Client *c, std::string command_string, boo
|
||||
break;
|
||||
|
||||
case CommandGetBody:
|
||||
database.SendBody(c, Strings::ToInt(parameters));
|
||||
database.SendBody(c, Strings::ToInt(parameters.c_str()));
|
||||
break;
|
||||
|
||||
case CommandMailTo:
|
||||
@@ -893,7 +891,7 @@ void Clientlist::ProcessOPMailCommand(Client *c, std::string command_string, boo
|
||||
case CommandSelectMailBox:
|
||||
{
|
||||
std::string::size_type NumStart = parameters.find_first_of("0123456789");
|
||||
c->ChangeMailBox(Strings::ToInt(parameters.substr(NumStart)));
|
||||
c->ChangeMailBox(Strings::ToInt(parameters.substr(NumStart).c_str()));
|
||||
break;
|
||||
}
|
||||
case CommandSetMailForwarding:
|
||||
@@ -983,7 +981,7 @@ void Client::SendMailBoxes() {
|
||||
safe_delete(outapp);
|
||||
}
|
||||
|
||||
Client *Clientlist::FindCharacter(const std::string& CharacterName) {
|
||||
Client *Clientlist::FindCharacter(std::string CharacterName) {
|
||||
|
||||
std::list<Client*>::iterator Iterator;
|
||||
|
||||
@@ -1243,7 +1241,7 @@ void Client::LeaveAllChannels(bool send_updated_channel_list, bool command_direc
|
||||
}
|
||||
|
||||
|
||||
void Client::ProcessChannelList(const std::string& Input) {
|
||||
void Client::ProcessChannelList(std::string Input) {
|
||||
|
||||
if (Input.length() == 0) {
|
||||
|
||||
@@ -1255,7 +1253,7 @@ void Client::ProcessChannelList(const std::string& Input) {
|
||||
std::string ChannelName = Input;
|
||||
|
||||
if (isdigit(ChannelName[0]))
|
||||
ChannelName = ChannelSlotName(Strings::ToInt(ChannelName));
|
||||
ChannelName = ChannelSlotName(Strings::ToInt(ChannelName.c_str()));
|
||||
|
||||
ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName);
|
||||
|
||||
@@ -1416,7 +1414,7 @@ void Client::SendChannelMessageByNumber(std::string Message) {
|
||||
if (MessageStart == std::string::npos)
|
||||
return;
|
||||
|
||||
int ChannelNumber = Strings::ToInt(Message.substr(0, MessageStart));
|
||||
int ChannelNumber = Strings::ToInt(Message.substr(0, MessageStart).c_str());
|
||||
|
||||
if ((ChannelNumber < 1) || (ChannelNumber > MAX_JOINED_CHANNELS)) {
|
||||
|
||||
@@ -1521,7 +1519,7 @@ void Client::SendChannelMessageByNumber(std::string Message) {
|
||||
|
||||
}
|
||||
|
||||
void Client::SendChannelMessage(const std::string& ChannelName, const std::string& Message, Client *Sender) {
|
||||
void Client::SendChannelMessage(std::string ChannelName, std::string Message, Client *Sender) {
|
||||
|
||||
if (!Sender) return;
|
||||
|
||||
@@ -1548,7 +1546,7 @@ void Client::SendChannelMessage(const std::string& ChannelName, const std::strin
|
||||
safe_delete(outapp);
|
||||
}
|
||||
|
||||
void Client::ToggleAnnounce(const std::string& State)
|
||||
void Client::ToggleAnnounce(std::string State)
|
||||
{
|
||||
if (State == "")
|
||||
Announce = !Announce;
|
||||
@@ -1615,7 +1613,7 @@ void Client::GeneralChannelMessage(const char *Characters) {
|
||||
|
||||
}
|
||||
|
||||
void Client::GeneralChannelMessage(const std::string& Message) {
|
||||
void Client::GeneralChannelMessage(std::string Message) {
|
||||
|
||||
auto outapp = new EQApplicationPacket(OP_ChannelMessage, Message.length() + 3);
|
||||
char *PacketBuffer = (char *)outapp->pBuffer;
|
||||
@@ -1659,7 +1657,7 @@ void Client::SetChannelPassword(std::string ChannelPassword) {
|
||||
std::string ChannelName = ChannelPassword.substr(ChannelStart);
|
||||
|
||||
if ((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
||||
ChannelName = ChannelSlotName(Strings::ToInt(ChannelName));
|
||||
ChannelName = ChannelSlotName(Strings::ToInt(ChannelName.c_str()));
|
||||
|
||||
std::string Message;
|
||||
|
||||
@@ -1724,7 +1722,7 @@ void Client::SetChannelOwner(std::string CommandString) {
|
||||
std::string ChannelName = CapitaliseName(CommandString.substr(ChannelStart));
|
||||
|
||||
if ((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
||||
ChannelName = ChannelSlotName(Strings::ToInt(ChannelName));
|
||||
ChannelName = ChannelSlotName(Strings::ToInt(ChannelName.c_str()));
|
||||
|
||||
LogInfo("Set owner of channel [[{}]] to [[{}]]", ChannelName.c_str(), NewOwner.c_str());
|
||||
|
||||
@@ -1770,7 +1768,7 @@ void Client::OPList(std::string CommandString) {
|
||||
std::string ChannelName = CapitaliseName(CommandString.substr(ChannelStart));
|
||||
|
||||
if ((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
||||
ChannelName = ChannelSlotName(Strings::ToInt(ChannelName));
|
||||
ChannelName = ChannelSlotName(Strings::ToInt(ChannelName.c_str()));
|
||||
|
||||
ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName);
|
||||
|
||||
@@ -1813,7 +1811,7 @@ void Client::ChannelInvite(std::string CommandString) {
|
||||
std::string ChannelName = CapitaliseName(CommandString.substr(ChannelStart));
|
||||
|
||||
if ((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
||||
ChannelName = ChannelSlotName(Strings::ToInt(ChannelName));
|
||||
ChannelName = ChannelSlotName(Strings::ToInt(ChannelName.c_str()));
|
||||
|
||||
LogInfo("[[{}]] invites [[{}]] to channel [[{}]]", GetName().c_str(), Invitee.c_str(), ChannelName.c_str());
|
||||
|
||||
@@ -1883,7 +1881,7 @@ void Client::ChannelModerate(std::string CommandString) {
|
||||
std::string ChannelName = CapitaliseName(CommandString.substr(ChannelStart));
|
||||
|
||||
if ((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
||||
ChannelName = ChannelSlotName(Strings::ToInt(ChannelName));
|
||||
ChannelName = ChannelSlotName(Strings::ToInt(ChannelName.c_str()));
|
||||
|
||||
ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName);
|
||||
|
||||
@@ -1941,7 +1939,7 @@ void Client::ChannelGrantModerator(std::string CommandString) {
|
||||
std::string ChannelName = CapitaliseName(CommandString.substr(ChannelStart));
|
||||
|
||||
if ((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
||||
ChannelName = ChannelSlotName(Strings::ToInt(ChannelName));
|
||||
ChannelName = ChannelSlotName(Strings::ToInt(ChannelName.c_str()));
|
||||
|
||||
LogInfo("[[{}]] gives [[{}]] moderator rights to channel [[{}]]", GetName().c_str(), Moderator.c_str(), ChannelName.c_str());
|
||||
|
||||
@@ -2022,7 +2020,7 @@ void Client::ChannelGrantVoice(std::string CommandString) {
|
||||
std::string ChannelName = CapitaliseName(CommandString.substr(ChannelStart));
|
||||
|
||||
if ((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
||||
ChannelName = ChannelSlotName(Strings::ToInt(ChannelName));
|
||||
ChannelName = ChannelSlotName(Strings::ToInt(ChannelName.c_str()));
|
||||
|
||||
LogInfo("[[{}]] gives [[{}]] voice to channel [[{}]]", GetName().c_str(), Voicee.c_str(), ChannelName.c_str());
|
||||
|
||||
@@ -2110,7 +2108,7 @@ void Client::ChannelKick(std::string CommandString) {
|
||||
std::string ChannelName = CapitaliseName(CommandString.substr(ChannelStart));
|
||||
|
||||
if ((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
||||
ChannelName = ChannelSlotName(Strings::ToInt(ChannelName));
|
||||
ChannelName = ChannelSlotName(Strings::ToInt(ChannelName.c_str()));
|
||||
|
||||
LogInfo("[[{}]] kicks [[{}]] from channel [[{}]]", GetName().c_str(), Kickee.c_str(), ChannelName.c_str());
|
||||
|
||||
@@ -2279,7 +2277,7 @@ void Client::SetConnectionType(char c) {
|
||||
}
|
||||
}
|
||||
|
||||
Client *Clientlist::IsCharacterOnline(const std::string& CharacterName) {
|
||||
Client *Clientlist::IsCharacterOnline(std::string CharacterName) {
|
||||
|
||||
// This method is used to determine if the character we are a sending an email to is connected to the mailserver,
|
||||
// so we can send them a new email notification.
|
||||
@@ -2307,7 +2305,7 @@ Client *Clientlist::IsCharacterOnline(const std::string& CharacterName) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int Client::GetMailBoxNumber(const std::string& CharacterName) {
|
||||
int Client::GetMailBoxNumber(std::string CharacterName) {
|
||||
|
||||
for (unsigned int i = 0; i < Characters.size(); i++)
|
||||
if (Characters[i].Name == CharacterName)
|
||||
@@ -2316,7 +2314,7 @@ int Client::GetMailBoxNumber(const std::string& CharacterName) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
void Client::SendNotification(int MailBoxNumber, const std::string& Subject, const std::string& From, int MessageID) {
|
||||
void Client::SendNotification(int MailBoxNumber, std::string Subject, std::string From, int MessageID) {
|
||||
|
||||
char TimeStamp[100];
|
||||
|
||||
|
||||
+8
-8
@@ -98,18 +98,18 @@ public:
|
||||
void AddToChannelList(ChatChannel *JoinedChannel);
|
||||
void RemoveFromChannelList(ChatChannel *JoinedChannel);
|
||||
void SendChannelMessage(std::string Message);
|
||||
void SendChannelMessage(const std::string& ChannelName, const std::string& Message, Client *Sender);
|
||||
void SendChannelMessage(std::string ChannelName, std::string Message, Client *Sender);
|
||||
void SendChannelMessageByNumber(std::string Message);
|
||||
void SendChannelList();
|
||||
void CloseConnection();
|
||||
void ToggleAnnounce(const std::string& State);
|
||||
void ToggleAnnounce(std::string State);
|
||||
bool IsAnnounceOn() { return (Announce == true); }
|
||||
void AnnounceJoin(ChatChannel *Channel, Client *c);
|
||||
void AnnounceLeave(ChatChannel *Channel, Client *c);
|
||||
void GeneralChannelMessage(const std::string& Message);
|
||||
void GeneralChannelMessage(std::string Message);
|
||||
void GeneralChannelMessage(const char *Characters);
|
||||
void SetChannelPassword(std::string ChannelPassword);
|
||||
void ProcessChannelList(const std::string& Input);
|
||||
void ProcessChannelList(std::string CommandString);
|
||||
void AccountUpdate();
|
||||
int ChannelCount();
|
||||
std::string RemoveDuplicateChannels(std::string& in_channels);
|
||||
@@ -139,14 +139,14 @@ public:
|
||||
inline bool GetForceDisconnect() { return ForceDisconnect; }
|
||||
std::string MailBoxName();
|
||||
int GetMailBoxNumber() { return CurrentMailBox; }
|
||||
int GetMailBoxNumber(const std::string& CharacterName);
|
||||
int GetMailBoxNumber(std::string CharacterName);
|
||||
|
||||
void SetConnectionType(char c);
|
||||
ConnectionType GetConnectionType() { return TypeOfConnection; }
|
||||
EQ::versions::ClientVersion GetClientVersion() { return ClientVersion_; }
|
||||
|
||||
inline bool IsMailConnection() { return (TypeOfConnection == ConnectionTypeMail) || (TypeOfConnection == ConnectionTypeCombined); }
|
||||
void SendNotification(int MailBoxNumber, const std::string& Subject, const std::string& From, int MessageID);
|
||||
void SendNotification(int MailBoxNumber, std::string From, std::string Subject, int MessageID);
|
||||
void ChangeMailBox(int NewMailBox);
|
||||
inline void SetMailBox(int NewMailBox) { CurrentMailBox = NewMailBox; }
|
||||
void SendFriends();
|
||||
@@ -184,10 +184,10 @@ public:
|
||||
Clientlist(int MailPort);
|
||||
void Process();
|
||||
void CloseAllConnections();
|
||||
Client *FindCharacter(const std::string& CharacterName);
|
||||
Client *FindCharacter(std::string CharacterName);
|
||||
void CheckForStaleConnectionsAll();
|
||||
void CheckForStaleConnections(Client *c);
|
||||
Client *IsCharacterOnline(const std::string& CharacterName);
|
||||
Client *IsCharacterOnline(std::string CharacterName);
|
||||
void ProcessOPMailCommand(Client* c, std::string command_string, bool command_directed = false);
|
||||
|
||||
private:
|
||||
|
||||
+13
-1
@@ -142,7 +142,7 @@ int UCSDatabase::FindAccount(const char *characterName, Client *client)
|
||||
return accountID;
|
||||
}
|
||||
|
||||
bool UCSDatabase::VerifyMailKey(const std::string& characterName, int IPAddress, const std::string& MailKey)
|
||||
bool UCSDatabase::VerifyMailKey(std::string characterName, int IPAddress, std::string MailKey)
|
||||
{
|
||||
|
||||
std::string query = StringFormat(
|
||||
@@ -283,6 +283,18 @@ void UCSDatabase::LoadFilteredNamesFromDB()
|
||||
LogInfo("Loaded [{}] filtered channel name(s)", names.size());
|
||||
}
|
||||
|
||||
bool UCSDatabase::IsChatChannelInDB(const std::string& channel_name)
|
||||
{
|
||||
auto r = ChatchannelsRepository::Count(
|
||||
*this,
|
||||
fmt::format(
|
||||
"name = {}", Strings::Escape(channel_name)
|
||||
)
|
||||
);
|
||||
|
||||
return r > 0;
|
||||
}
|
||||
|
||||
void UCSDatabase::SaveChatChannel(
|
||||
const std::string& channel_name,
|
||||
const std::string& channel_owner,
|
||||
|
||||
+8
-1
@@ -40,11 +40,12 @@ class UCSDatabase : public Database {
|
||||
public:
|
||||
int FindAccount(const char *CharacterName, Client *c);
|
||||
int FindCharacter(const char *CharacterName);
|
||||
bool VerifyMailKey(const std::string& characterName, int IPAddress, const std::string& MailKey);
|
||||
bool VerifyMailKey(std::string CharacterName, int IPAddress, std::string MailKey);
|
||||
bool GetVariable(const char* varname, char* varvalue, uint16 varvalue_len);
|
||||
bool LoadChatChannels();
|
||||
void LoadReservedNamesFromDB();
|
||||
void LoadFilteredNamesFromDB();
|
||||
bool IsChatChannelInDB(const std::string& channel_name);
|
||||
bool CheckChannelNameFilter(const std::string& channel_name);
|
||||
void SaveChatChannel(const std::string& channel_name, const std::string& channel_owner, const std::string& channel_password, const uint16& min_status);
|
||||
void DeleteChatChannel(const std::string& channel_name);
|
||||
@@ -61,6 +62,12 @@ public:
|
||||
void AddFriendOrIgnore(const int& char_id, const int& type, const std::string& name);
|
||||
void RemoveFriendOrIgnore(const int& char_id, const int& type, const std::string& name);
|
||||
void GetFriendsAndIgnore(const int& char_id, std::vector<std::string> &Friends, std::vector<std::string> &Ignorees);
|
||||
|
||||
protected:
|
||||
void HandleMysqlError(uint32 errnum);
|
||||
private:
|
||||
void DBInitVars();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+3
-2
@@ -43,7 +43,7 @@ extern const ucsconfig *Config;
|
||||
extern UCSDatabase database;
|
||||
extern DiscordManager discord_manager;
|
||||
|
||||
void ProcessMailTo(Client *c, const std::string& from, const std::string& subject, const std::string& message);
|
||||
void ProcessMailTo(Client *c, std::string from, std::string subject, std::string message);
|
||||
|
||||
void Client45ToServerSayLink(std::string& serverSayLink, const std::string& clientSayLink);
|
||||
void Client50ToServerSayLink(std::string& serverSayLink, const std::string& clientSayLink);
|
||||
@@ -120,7 +120,8 @@ void WorldServer::ProcessMessage(uint16 opcode, EQ::Net::Packet &p)
|
||||
if (Message.length() < 2)
|
||||
break;
|
||||
|
||||
if (!c) {
|
||||
if (!c)
|
||||
{
|
||||
LogInfo("Client not found");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
//NOTE: you must have a space after the * of a return value
|
||||
|
||||
unsigned int field_count();
|
||||
unsigned long affected_rows();
|
||||
unsigned long insert_id();
|
||||
unsigned int get_errno();
|
||||
Const_char * error();
|
||||
EQDBRes * query(Const_char *q);
|
||||
Const_char * escape_string(Const_char *from); //NOT THREAD SAFE! (m_escapeBuffer)
|
||||
@@ -0,0 +1,37 @@
|
||||
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
are required to give you total support for your newly bought product;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
typedef const char Const_char;
|
||||
|
||||
#ifdef EMBPERL
|
||||
#include "../common/debug.h"
|
||||
#include "../common/useperl.h"
|
||||
#include "EQDB.h"
|
||||
|
||||
#ifdef THIS /* this macro seems to leak out on some systems */
|
||||
#undef THIS
|
||||
#endif
|
||||
|
||||
|
||||
MODULE = EQDB PACKAGE = EQDB
|
||||
|
||||
PROTOTYPES: ENABLE
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
unsigned long num_rows() { return (res) ? mysql_num_rows(res) : 0; }
|
||||
unsigned long num_fields() { return (res) ? mysql_num_fields(res) : 0; }
|
||||
void DESTROY() { }
|
||||
void finish() { if (res) mysql_free_result(res); res=NULL; };
|
||||
vector<string> fetch_row_array();
|
||||
map<string,string> fetch_row_hash();
|
||||
unsigned long * fetch_lengths() { return (res) ? mysql_fetch_lengths(res) : 0; }
|
||||
@@ -0,0 +1,33 @@
|
||||
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
are required to give you total support for your newly bought product;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
typedef const char Const_char;
|
||||
|
||||
#ifdef EMBPERL
|
||||
#include "../common/debug.h"
|
||||
#include "../common/useperl.h"
|
||||
#include "EQDBRes.h"
|
||||
|
||||
|
||||
MODULE = EQDBRes PACKAGE = EQDBRes
|
||||
|
||||
PROTOTYPES: ENABLE
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
Const_char * GetName() const { return(m_name.c_str()); }
|
||||
int GetStaticCount() const { return(m_zones.size()); }
|
||||
bool IsConnected() const; //is this launcher connected to world
|
||||
|
||||
void DeleteLauncher(); //kill this launcher and all its zones.
|
||||
|
||||
void RestartZone(Const_char *zone_ref);
|
||||
void StopZone(Const_char *zone_ref);
|
||||
void StartZone(Const_char *zone_ref);
|
||||
|
||||
bool BootStaticZone(Const_char *short_name, uint16 port);
|
||||
bool ChangeStaticZone(Const_char *short_name, uint16 port);
|
||||
bool DeleteStaticZone(Const_char *short_name);
|
||||
|
||||
bool SetDynamicCount(int count);
|
||||
int GetDynamicCount() const;
|
||||
|
||||
vector<string> ListZones(); //returns an array of zone refs
|
||||
map<string,string> GetZoneDetails(Const_char *zone_ref);
|
||||
@@ -0,0 +1,37 @@
|
||||
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
are required to give you total support for your newly bought product;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
typedef const char Const_char;
|
||||
|
||||
#ifdef EMBPERL
|
||||
#include "../common/debug.h"
|
||||
#include "EQWParser.h"
|
||||
#include "EQLConfig.h"
|
||||
|
||||
#ifdef THIS /* this macro seems to leak out on some systems */
|
||||
#undef THIS
|
||||
#endif
|
||||
|
||||
|
||||
MODULE = EQLConfig PACKAGE = EQLConfig
|
||||
|
||||
PROTOTYPES: ENABLE
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
//NOTE: you must have a space after the * of a return value
|
||||
Const_char * GetConfig(Const_char *var_name);
|
||||
void LockWorld();
|
||||
void UnlockWorld();
|
||||
|
||||
bool LSConnected();
|
||||
void LSReconnect();
|
||||
|
||||
int CountZones();
|
||||
vector<string> ListBootedZones(); //returns an array of zone_refs (opaque)
|
||||
map<string,string> GetZoneDetails(Const_char *zone_ref); //returns a hash ref of details
|
||||
|
||||
int CountPlayers();
|
||||
vector<string> ListPlayers(Const_char *zone_name = ""); //returns an array of player refs (opaque)
|
||||
map<string,string> GetPlayerDetails(Const_char *player_ref); //returns a hash ref of details
|
||||
|
||||
int CountLaunchers(bool active_only);
|
||||
// vector<string> ListActiveLaunchers(); //returns an array of launcher names
|
||||
vector<string> ListLaunchers(); //returns an array of launcher names
|
||||
EQLConfig * GetLauncher(Const_char *launcher_name); //returns the EQLConfig object for the specified launcher.
|
||||
void CreateLauncher(Const_char *launcher_name, int dynamic_count);
|
||||
// EQLConfig * FindLauncher(Const_char *zone_ref);
|
||||
|
||||
//Guild routines, mostly wrappers around guild_mgr
|
||||
int32 CreateGuild(const char* name, int32 leader_char_id);
|
||||
bool DeleteGuild(int32 guild_id);
|
||||
bool RenameGuild(int32 guild_id, const char* name);
|
||||
bool SetGuildMOTD(int32 guild_id, const char* motd, const char *setter);
|
||||
bool SetGuildLeader(int32 guild_id, int32 leader_char_id);
|
||||
bool SetGuild(int32 charid, int32 guild_id, int8 rank);
|
||||
bool SetGuildRank(int32 charid, int8 rank);
|
||||
bool SetBankerFlag(int32 charid, bool is_banker);
|
||||
bool SetTributeFlag(int32 charid, bool enabled);
|
||||
bool SetPublicNote(int32 charid, const char *note);
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
are required to give you total support for your newly bought product;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
typedef const char Const_char;
|
||||
|
||||
#ifdef EMBPERL
|
||||
#include "../common/debug.h"
|
||||
#include "EQWParser.h"
|
||||
#include "EQW.h"
|
||||
|
||||
#ifdef THIS /* this macro seems to leak out on some systems */
|
||||
#undef THIS
|
||||
#endif
|
||||
|
||||
|
||||
MODULE = EQW PACKAGE = EQW
|
||||
|
||||
PROTOTYPES: ENABLE
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user