Compare commits

..

100 Commits

Author SHA1 Message Date
Aeadoin dc475a1bd7 [Release] 22.7.0 (#3143) 2023-03-24 15:11:42 -05:00
Aeadoin 59ad91a140 [Feature] Add Data Bucket support for scaling of Heroic Stats. (#3058)
* [Feature] Add Data Bucket support for scaling of Heroic Stats.

* update

* fixes, still reworking logic

* fixes, still reworking logic

* logic done

* logic done

* fixes

* Cleanup

* Cleanup

* Cleanup naming, verify behaviors

* formatting

* formatting

* fix issue with endurance and mana.

* update rule desc

* cleanup

* DataBucket Struct

* Cleanup data_bucket.cpp and add constants

* cleanup

* changes

* formatting

* fix from merge

* escape keyword `key`

* Add `key` to generator, run repository-generator.pl

* fix for change to key

* cleanup

* formatting

* formatting

* typo
2023-03-23 21:42:13 -04:00
Aeadoin abc27ab423 [Bug Fix] Fix edge cases where camped bots would be left in a raid (#3139)
* [Bug Fix] Fix edge cases where camped bots would be left in a raid

* formatting
2023-03-23 19:23:34 -04:00
Aeadoin c975dc2412 [Bug Fix] Fix for transferring Raid Leader (#3140) 2023-03-23 19:04:59 -04:00
Aeadoin e085f271f5 [Bug Fix] Fix for incorrect bindpoint x,y,z,headings (#3141) 2023-03-23 18:55:56 -04:00
Alex 5a6314e1a9 [Fix] Fixes for corpses not properly saving some item instance data correctly. (#3123)
* Convert ZoneDb::LoadCharacterCorpseData to use a cleaner api that has a better layout.

* Update corpse save methods to use a new cleaner api.

* Add item to corpse will use a few new fields that don't yet save.

* Fix for some issues moving data to corpses.

* Make CreateItem more explicit to avoid overlooking places it's used and add more arguments.

* DB changes

* Revert of the changes to the database.CreateItem api change.

* Missed one.

* Fixes for mr Krab

* Small formatting

---------

Co-authored-by: KimLS <KimLS@peqtgc.com>
Co-authored-by: Akkadius <akkadius1@gmail.com>
2023-03-23 01:16:52 -05:00
Aeadoin dc45e0d280 [Fix] Change SPA 193 Weapon Damage to allow values over 65,535 (#3138) 2023-03-23 01:06:51 -05:00
Aeadoin 2e2c4d64fe [Cleanup] Cleanup uses of Strings::ToInt to match correct type. (#3054)
* [Cleanup] Cleanup uses of Strings::ToInt to match correct type.

* cleanup
2023-03-22 12:22:03 -04:00
Aeadoin c5add503ab [Bug Fix] Fix for Raid Disband if leader not in same zone. (#3135) 2023-03-21 19:16:01 -04:00
Aeadoin fe2dcb6544 [Crash] Fix dangling Group member pointers for Bots. (#3134)
* [Crash] Fix dangling Group member pointers for Bots.

* fixes for edge cases
2023-03-21 11:57:04 -04:00
Alex King 4fe44f4cb6 [Quest API] Add Timer related methods to Mobs in Perl/Lua (#3133)
* [Quest API] Add Timer related methods to Mobs in Perl/Lua

# Perl
- Add `quest::ispausedtimer(timer_name)`.
- Add `quest::pausetimer(timer_name)`.
- Add `quest::resumetimer(timer_name)`.
- Add `$mob->GetRemainingTimeMS(timer_name)`.
- Add `$mob->GetTimerDurationMS(timer_name)`.
- Add `$mob->HasTimer(timer_name)`.
- Add `$mob->IsPausedTimer(timer_name)`.
- Add `$mob->PauseTimer(timer_name)`.
- Add `$mob->ResumeTimer(timer_name)`.
- Add `$mob->SetTimer(timer_name)`.
- Add `$mob->SetTimerMS(timer_name)`.
- Add `$mob->StopTimer(timer_name)`.

# Lua
- Add `mob:GetRemainingTimeMS(timer_name)`.
- Add `mob:GetTimerDurationMS(timer_name)`.
- Add `mob:HasTimer(timer_name)`.
- Add `mob:IsPausedTimer(timer_name)`.
- Add `mob:PauseTimer(timer_name)`.
- Add `mob:ResumeTimer(timer_name)`.
- Add `mob:SetTimer(timer_name)`.
- Add `mob:SetTimerMS(timer_name)`.
- Add `mob:StopTimer(timer_name)`.

# Notes
- The mob-based methods allow operators to loop entity list or whatever to set, stop, resume, pause, etc for timers.

* StopAllTimers()

* Update questmgr.cpp
2023-03-20 16:18:51 -04:00
Alex King 63a8d2d641 [Cleanup] Delete zone_numbers.h (#3129)
* [Cleanup] Delete zone_numbers.h

# Notes
- This is unused.

* Update client_packet.cpp

* Update client_packet.cpp
2023-03-20 12:06:40 -04:00
Alex King abcb5d069f [Cleanup] Remove FindPatch() from struct_category.cpp and struct_category.h (#3130)
# Notes
- This is unused.
2023-03-20 12:06:10 -04:00
Aeadoin d6b954a4b9 [Cleanup] Cleaning up Raid.cpp (#3125)
* [Cleanup] Cleanup Raid.cpp

* cleanup

* fix is_bot instances

* bracket cleanup

* bracket cleanup

* rename variables in struct

* fix for merge
2023-03-20 11:39:14 -04:00
Alex King 2415645b86 [Fix] Fix typo for bot_id raid_members column in db_update_manifest.txt (#3132)
# Notes
- This was causing this query to run over and over.
2023-03-19 22:32:35 -04:00
Aeadoin e77a83f8c3 [Rule] Add Rule to allow ExtraDmgSkill/SPA 220 to effect Spell Skills (#3124)
* [Rule] Add Rule to allow ExtraDmgSkill/SPA 220 to effect Spell Skills

* add support for rule "ItemExtraSkillDamageCalcAsPercent"
2023-03-19 12:16:32 -04:00
Alex King a5d564a6fb [Cleanup] Remove ChangeHP() from mob.h (#3128)
# Notes
- This is unused.
2023-03-19 10:18:31 -04:00
Alex King 2f4c91824e [Feature] Add Item Extra Skill Damage Percent Modifier (#3127)
* [Feature] Add Item Extra Skill Damage Percent Modifier

# Notes
- Allows `Character:ItemExtraDmgCap` to be disabled if set to `-1` or lower.
- Allows operators to set `Character:ItemExtraSkillDamageCalcAsPercent` to `true` to allow skill damage for Frenzy, Backstab, Bash, Slam, Kick, and all Monk attacks to scale with a percentage based on `extradmgamt` values from items and spells.

* > 0
2023-03-19 09:59:13 -04:00
Aeadoin 53e6f931c9 [Crash] Fixes Crash when Zoning with XTarget when Bots are in group. (#3126) 2023-03-19 08:26:16 -04:00
Alex King a6efb1e8b5 [Cleanup] Remove GetStartCount() and InitStartTimer() from zone_launch.cpp and zone_launch.h (#3121)
# Notes
- These are unused.
2023-03-17 19:21:50 -04:00
Alex King b2757143a8 [Cleanup] Remove SetConnection() from loginserver/world_server.h (#3120)
# Notes
- This is unused.
2023-03-17 19:21:44 -04:00
Alex King 6e5da0e558 [Cleanup] Remove GetServerByAddress() from server_manager.h (#3119)
# Notes
- This is unused.
2023-03-17 19:21:38 -04:00
Alex King 6b8e74a29f [Cleanup] Remove PlayerLogin_Struct from login_types.h (#3118)
# Notes
- This is unused.
2023-03-17 19:21:30 -04:00
Alex King 203e63101a [Cleanup] Remove IsConnected() from loginserver/database.h (#3117)
# Notes
- This is unused.
2023-03-17 19:21:18 -04:00
Alex King 91257d599b [Cleanup] Remove unused methods in loginserver/client.h (#3116)
* [Cleanup] Remove LoginOnNewConnection(), LoginOnPacketRecv(), and LoginOnStatusChange() from loginserver/client.h

# Notes
- These are unused.

* Cleanup.
2023-03-17 19:21:08 -04:00
Alex King 491b358e28 [Cleanup] Remove UpdateLoginserverWorldAdminAccountPasswordById() from account_management.cpp (#3115)
# Notes
- This is unused.
2023-03-17 19:20:56 -04:00
Alex King 180c3088ca [Cleanup] Remove DBInitVars() and HandleMysqlError() from queryserv/database.h (#3114)
# Notes
- These are unused.
2023-03-17 19:20:47 -04:00
Alex King 97e4547192 [Cleanup] Remove DBInitVars(), HandleMysqlError(), and IsChatChannelInDB() in ucs/database.h (#3113)
# Notes
- These are unused.
2023-03-17 19:20:41 -04:00
Aeadoin 0caee9026a [Rule] Add Task System Rule ExpRewardsIgnoreLevelBasedEXPMods (#3112)
* [Rule] Add Task System Rule ExpRewardsIgnoreLevelBasedEXPMods

* description
2023-03-17 19:15:02 -04:00
Aeadoin 0be7ead1d1 [Bug Fix] Fix Bard Bot Casting (#3122) 2023-03-17 19:07:54 -04:00
Aeadoin 950489bc34 [Bug Fix] Fix Raid methods that could cause crashes with Bots in raid (#3111) 2023-03-17 16:19:29 -04:00
Mitch Freeman 45da8cab61 [Bots] Add Basic Bot Raiding Functionality (#2782)
* Fix for GENERIC_9_STRINGS

* Add Bot Heal Message Display

Creates a new rule to display Bot heal messages to the Bot Owner

* 2021-03-25 11L04pm

Spell and Heal Rule added to allow for Bot spell and heal damage to be sent to the Bot Owner's Group.  Also added a check to remove duplicate message for #damage on self.

* Update .gitignore

* BOT work

Added BOT logging damage/heals to owner
Added BOT message to owner for harmony fails
Made var Critical global to remove duplicate crit messages
Added a NULL check to Mob:GetCleanname()

* Bot Group Work

Fixed botid=charid spawn on zone issue
Added a group_list update on zone to refresh from database to fix a dangling pointer to a Bot object that was camped but was previously in a group within the zone being entered.
Modified Bot::ProcessBotGroupInvite to use the client of the bot when doing the Bot initialization so that a leader can invite another owner's Bot

* Jan 4

Basic structure in place for Raid::AddBot though not working

* Basement Jan 5

* End of day Jan 5
Working Raid Invite to a Bot.

* Update to Client::QueuePacket to not attempt to send a packet to a BoT.  Not clean, but a broad solution.

* Updated Raid::VerifyRaid

* Some Bot Raid working

* Before VS Crash

* Use Case 1, 2, 3,4,7 working.
Need to fix 5, 6, 8

* Work on usecase 5

* A few more use cases working

* New work on Raid invite with a invitor having a group

* Bot Raid inviting working for all use cases

* A few changes

* end of day jan 10

* Jan 11

* end of day Jan 11

* Bot Invite/Accept cleanup

* Start of moving raid bot functions to their own methods

* More bot raid changes

* More raid spell work

* end of day Jan 16

* spawn work

* Spawn on login working

* End of Day Jan 18

* Raid leader and mana/hp updates fixed

* Spell Tracking

* Issue with Bot Death in raid when casted upon.  1741 raid.cpp

* Bot Death fixed and few other crashes

* Working on botgroup removal

* Bot Disbanding Work 90%

* Looks like BOTs are working

* Fixed a bot crash

* bug tracing on entity list mismatch

* safe_delete resoves problem.  No to track down leak

* seems to be working

* Memory corruption found - sending packets to BoTs using Client class

* added Raid::IsRaidMemberBot()

* Update p_raid_instance

* g3

* Final - Bot Raid Working

* Fixed IsRaidMemberBot to remove memory leak
Fixed altcombat crash though RaidMainAssist (428) needs fixing

* add RaidMember.IsBot

* Repaired IsBot function to be more preformant.  Now works on standard performance machine

* Fixed Bard AE Target Spells
Removed assert for buffs

* updated based on Feb 2022 master updates

* Added bot_db_updates and version increment

* Cleanup of bot raid work and inclusion of bot_raid in cmake

* Delete .gitignore

* Revert "Delete .gitignore"

This reverts commit 8523658d3b.

* Fixed a packet issue

* Merged upstream/master

Merged upstream/master and removed ifdef BOTS as per recent dev approach for BOTS.  Functionality is there, compiles and tests ok.  A few problems to be resolved though this is a good baseline.

* Added sql update for raid_members to add isbot

* Updated Bot Follow Function

Bot will now follow the Group Leader if IsClient, otherwise follows the Bot Owner

* Updates to Bot Raid System

When camping a client, remove them from the raid.  If they are leader, place leadership to the next client.
Update a few crash checks in bot_raid.cpp

* [BOTS] Added RuleB Enabled checks and updated base repo for raid_members

Updated several RuleB(Bots, Enabled) checks
Updated the base repo to be autogenerated.
Raid functionality should work with a non-bots enabled database.

* Few quick updates

* Updates

Corrected a number of comments.  Compiled and tested against bot and non-bot database though requires the isbot column in raid_members for both.
Moved the db update out of the bot stream to make bot check code easier.

* Formatting and other small updates

* A few more RuleB(Bots, Enabled) additions

* Fix issue with conflict of bot ID versus character ID.

* Delete CMakeSettings.json

* Comment Updates and other

Several updates including
- fixed comments from PR
- added id to raid_members and unique index on name to avoid botid and charid conflicts
- updated a few raid functions for iterators
- reordered several raid operations to ensure send leader packet to be the last item to ensure proper updating on the client
- update sql to use Replace instead of Insert for botid conflicting with charid

* Exploit fix for Raid Bots

Added item from @Nite to disallow spawning or camping bots if Raid is engaged.  Avoids abusive situations.

* Initial Commit

* fix Raid Window after zoning

The raid window was not fully updating for clients not in the zone.

* Cleanup

* Update

Fixed comments

* Resolve crash for MOTD

Fixed a crash situation sending a raid MOTD to BOTS.

* Update ruletypes.h

* Updated to resolve a few recent comments

Fixed some comments within attack.cpp

* fix sql query

* update repository

* prevent duplicate entries in raid after group invite, and cleanup

* fixes for botgroups not following, and add already in raid messages.

* fix messagestring

* fixes

* Cleanup, and resolving issues with disbanding

* refactoring

* more cleanup/fixing.

* fixes for removing from ground in raid

* Refactoring/fixing multiple clients

* fix for compiling

* Bugs from refactoring fixed

* Testing completed, cleaning up unwanted items/duplicate code.

* Cleaned up AICastSpell

* fix typos

* Refactoring

* Adding Raid checks to AI_Process/cleanup

* Fix a typo

Was getting a SQL error on BOT spawn.  Fixed typo.

* fix for crash

* Fixed crash when inviting player, more refactoring

* AI_Process Refactoring work

* More Refactoring/fixes for follow

* Finish Refactoring AI_Process

* cleanup

* cleanup

* cleanup

* cleanup

* fix melee attack loop

* fix for leashowner.

* fix for leashowner.

* Bots persist in raid after client death/LD/Camp

* Fix Bot Groups when zoning after death.

* Fix Bots in group following after client death

* remove unnecessary query

* Allow Raid members to invite Bots if owner is in raid. cleanup

* optimization of raid verification

* remove this

* Code Cleanup

* formatting

* formatting

* formatting

* fix for macro

* add return for TryClassAttacks

* fix query

* fix for crash

* restrict camping/spawn in combat.

* Fix other crash issue.

* update learnmembers to use Strings::To, cleanup magic numbers

* fix for merge.

---------

Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
Co-authored-by: Alex King <89047260+Kinglykrab@users.noreply.github.com>
Co-authored-by: Aeadoin <109764533+Aeadoin@users.noreply.github.com>
2023-03-17 11:19:59 -04:00
Alex King e778041198 [Cleanup] Remove ownHiddenTrigger from trap.cpp and trap.h (#3092)
# Notes
- This is unsued.
2023-03-17 08:37:36 -04:00
Alex King 97e50ced93 [Cleanup] Delete deprecated/perlxs folder (#3110)
# Notes
- This entire folder is unused.
2023-03-17 06:23:30 -04:00
Alex King 4491bb9a70 [Cleanup] Remove is_authenticatd, LSShutDownUpdate(), and SetInstanceID() from zoneserver.h (#3109)
# Notes
- These are unsued.
2023-03-17 06:23:19 -04:00
Alex King 04fba27467 [Cleanup] Remove StoreCharacter() from worlddb.h (#3108)
# Notes
- This is unused.
2023-03-17 06:23:10 -04:00
Alex King fa47dd7f93 [Cleanup] Remove DisableStats(), EnableStats(), DisableLoginserver(), and EnableLoginserver() from world_config.h (#3107)
# Notes
- These are unused.
2023-03-17 06:23:01 -04:00
Alex King b3fb5f00ab [Cleanup] Remove MakeGuildMembers() from wguild_mgr.h (#3106)
# Notes
- This is unused.
2023-03-17 06:22:51 -04:00
Alex King e17fad9ae0 [Cleanup] Cleanup unused methods and variables in world/main.cpp and world/main.h (#3105)
# Notes
- These are unused.
2023-03-17 06:22:41 -04:00
Alex King bbdaacd3b0 [Cleanup] Remove AllConnected(), CanUpdate(), and SendInfo() from login_server_list.cpp and login_server_list.h (#3104)
# Notes
- These are unused.
2023-03-17 06:22:34 -04:00
Alex King 61bd485449 [Cleanup] Remove unused methods in eql_config.cpp, eql_config.h, launcher_list.cpp, and launcher_list.h (#3103)
# Notes
- These are unused.
2023-03-17 06:22:01 -04:00
Alex King 4b405fe9fe [Cleanup] Remove authenticated from launcher_link.cpp and launcher_link.h (#3101)
# Notes
- This is unused.
2023-03-17 06:21:51 -04:00
Alex King d5aaf7cee5 [Cleanup] Remove CountZones() from launcher_link.h (#3100)
# Notes
- This is unused.
2023-03-17 06:21:41 -04:00
Alex King 12e9e0f71d [Cleanup] Delete world/console.old.cpp (#3099)
# Notes
- This is unused.
2023-03-17 06:21:23 -04:00
Alex King 0a64e26672 [Cleanup] Remove FindCLEByLSID(), GetCLE(), GetCLEIPCount(), and RemoveCLEByLSID() from clientlist.h (#3098)
# Notes
- These are unused.
2023-03-17 06:21:14 -04:00
Alex King 11fc5a9e93 [Cleanup] Remove SendGuildPacket() from clientlist.cpp, clientlist.h, and wguild_mgr.cpp (#3097)
# Notes
- This is unused.
2023-03-17 06:21:00 -04:00
Alex King 7bbcdfb479 [Cleanup] Remove FindByName(charname) from clientlist.h (#3096)
# Notes
- This is unused.
2023-03-17 06:20:46 -04:00
Alex King 3a530eb43b [Cleanup] Remove CheckAuth(), SetOnline(), and pMD5Pass from cliententry.h (#3095)
# Notes
- These are unused.
2023-03-17 06:20:36 -04:00
Alex King 48a60114b7 [Cleanup] Remove CommandRequirement() from zonedb.h (#3094)
# Notes
- This is unused.
2023-03-17 06:20:25 -04:00
Alex King 06f1f36c95 [Cleanup] Utilize GetScheduler() in zone/worldserver.cpp (#3093)
# Notes
- This was unused.
2023-03-17 06:20:13 -04:00
Alex King ccd9bd7d4c [Cleanup] Utilize SetHiddenTrigger in trap.cpp (#3091)
# Notes
- This was unused.
2023-03-17 06:17:53 -04:00
Alex King fea6cbf633 [Cleanup] Remove RemoveSpawnGroup() from spawngroup.h (#3090)
# Notes
- This is unused.
2023-03-17 06:17:44 -04:00
Alex King 460739d35c [Cleanup] Delete queues.h (#3089)
# Notes
- This is unsued.
2023-03-17 06:17:32 -04:00
Alex King 11e1edc99f [Cleanup] Remove IsOrigin(glm::vec2) from position.h (#3088)
# Notes
- This is unused.
2023-03-17 06:17:20 -04:00
Alex King 7374660045 [Cleanup] Remove last_insert_id from petitions.h (#3087)
# Notes
- This is unused.
2023-03-17 06:17:10 -04:00
Alex King 9e8d365ca7 [Cleanup] Remove SetSentTime2 in petitions.h (#3086)
# Notes
- This is unused.
2023-03-17 06:17:00 -04:00
Alex King 14d69a0a14 [Cleanup] Remove perlparser.h (#3085)
# Notes
- This is unused.
2023-03-17 06:16:51 -04:00
Alex King fe063637e9 [Cleanup] Remove GetTransformation() and GetInvertedTransformation() from oriented_bounding_box.h (#3084)
# Notes
- These are unused.
2023-03-17 06:16:40 -04:00
Alex King 232b1028d7 [Cleanup] Remove m_inuse, m_z, and m_heading from object.h (#3083)
# Notes
- These are unsued.
2023-03-16 21:47:27 -04:00
Alex King 3624307385 [Cleanup] Remove SetDBID() from object.h (#3082)
# Notes
- This is unused.
2023-03-16 21:36:03 -04:00
Alex King c0055cf357 [Cleanup] Remove npc_ai.cpp/npc_ai.cpp (#3081)
# Notes
- These files were unused.
2023-03-16 21:17:23 -04:00
Alex King f9c1683d36 [Cleanup] Remove GetAILevel() from npc.h (#3080)
# Notes
- This is unused.
2023-03-16 21:06:24 -04:00
Alex King 64df993c10 [Cleanup] Remove FlushLootStats() from npc.h (#3079)
# Notes
- This is unused.
2023-03-16 21:06:10 -04:00
Alex King 890ef696fe [Cleanup] Remove GetDestination() from doors.h (#3078)
# Notes
- This is unused.
2023-03-16 20:47:40 -04:00
Alex King 3f1848b01a [Cleanup] Remove can_corpse_be_rezzed from corpse.h (#3077)
# Notes
- This is unused.
2023-03-16 20:47:25 -04:00
Alex King f7c4f1ff75 [Cleanup] Remove _baseBotStance from bot.h (#3076)
# Notes
- This is unused.
2023-03-16 20:25:45 -04:00
Alex King dcb127f4b6 [Cleanup] Remove _botRole from bot.h (#3075)
# Notes
- This is unused.
2023-03-16 20:25:35 -04:00
Alex King 669b068978 [Cleanup] Remove _previousTarget from bot.h (#3074)
# Notes
- This is unused.
2023-03-16 20:25:25 -04:00
Alex King db2aeca38f [Cleanup] remove _botOrderAttack from bot.h (#3073)
# Notes
- This is unused.
2023-03-16 20:25:16 -04:00
Alex King 1b3ca95f8c [Cleanup] Remove firstlogin and realfirstlogin from world/client.h (#3072)
# Notes
- These are unused.
2023-03-16 20:25:03 -04:00
Alex King c05baac551 [Cleanup] Remove CLIENT_TIMEOUT from world/client.h and zone/client.h (#3071)
# Notes
- This is unused.
2023-03-16 20:24:53 -04:00
Alex King 939fc79d19 [Cleanup] Remove IsAffectedByBuff() (#3068)
# Notes
- This is unused.
2023-03-16 20:24:44 -04:00
Alex King a0e6fce057 [Cleanup] Remove fixedZ from mob.h (#3065)
# Notes
- This is unused.
2023-03-16 20:24:35 -04:00
Alex King 452389b7a5 [Cleanup] Remove class EQStream from client.h (#3070)
# Notes
- This is unused.
2023-03-16 20:24:08 -04:00
Alex King dd184fa8b6 [Cleanup] Remove inWater from mob.h (#3069)
# Notes
- This is unused.
2023-03-16 20:23:56 -04:00
Alex King 4a3e6b5edc [Cleanup] Remove current_buff_count (#3067)
# Notes
- This was unused.
2023-03-16 20:23:41 -04:00
Alex King 7961d7afa8 [Cleanup] Utilize GetPlayerState() in mob methods (#3066)
# Notes
- This method was unused, make use of it.
2023-03-16 20:23:34 -04:00
Alex King cc6bcf3295 [Cleanup] Remove casting_spell_type from mob.h (#3064)
# Notes
- This is unused.
2023-03-16 20:23:21 -04:00
Alex King b73c2016cf [Cleanup] Remove last_max_hp from mob.h (#3063)
# Notes
- This is unused.
2023-03-16 20:23:11 -04:00
Alex King db7e8241ac [Cleanup] Remove DoBuffWearOffEffect() from mob.h (#3062)
# Notes
- This is unused.
2023-03-16 20:12:01 -04:00
Paul Coene b7747b07db [Illusions] Fix bug where spells like Ignite Bones left NPC size incorrect. (#3061) 2023-03-16 18:59:09 -04:00
Alex King 02ada0e496 [Quest API] Add SendIllusion overloads/parameters to Perl/Lua (#3059)
* [Quest API] Add SendIllusion methods to Perl.

# Perl
- Add `$mob->SendIllusion(race, gender, texture, helmtexture, face, hairstyle, haircolor, beard, beardcolor, drakkin_heritage, drakkin_tattoo, drakkin_details, size, target)`.
- Add `$mob->SendIllusionPacket(illusion_table_ref)`.

* Change defaults.

* Remove debug message

* Cleanup.

* Cleanup

* Update perl_mob.cpp
2023-03-15 20:37:37 -04:00
Alex King 7c819539c8 [Quest API] Add Spell GetActX methods to Perl/Lua (#3056)
# Perl
- Add `$mob->GetActDoTDamage(spell_id, value, target)`.
- Add `$mob->GetActDoTDamage(spell_id, value, target, from_buff_tic)`.
- Add `$mob->GetActReflectedSpellDamage(spell_id, value, effectiveness)`.
- Add `$mob->GetActSpellDamage(spell_id, value, target)`.
- Add `$mob->GetActSpellHealing(spell_id, value, target)`.
- Add `$mob->GetActSpellHealing(spell_id, value, target, from_buff_tic)`.

# Lua
- Add `mob:GetActDoTDamage(spell_id, value, target)`.
- Add `mob:GetActDoTDamage(spell_id, value, target, from_buff_tic)`.
- Add `mob:GetActReflectedSpellDamage(spell_id, value, effectiveness)`.
- Add `mob:GetActSpellCasttime(spell_id, cast_time)`.
- Add `mob:GetActSpellCost(spell_id, cost)`.
- Add `mob:GetActSpellDamage(spell_id, value)`.
- Add `mob:GetActSpellDamage(spell_id, value, target)`.
- Add `mob:GetActSpellDuration(spell_id, duration)`.
- Add `mob:GetActSpellHealing(spell_id, value)`.
- Add `mob:GetActSpellHealing(spell_id, value, target)`.
- Add `mob:GetActSpellHealing(spell_id, value, target, from_buff_tic)`.
- Add `mob:GetActSpellRange(spell_id, range)`.

 # Notes
- Allows operators to get various spell related values.
2023-03-12 15:36:43 -04:00
Alex King e670c89163 [Cleanup] Remove unused lua_hate_entry.cpp (#3057)
# Notes
- This is unused and causes duplication of these methods in Spire Quest API Explorer.
2023-03-12 15:36:20 -04:00
Aeadoin 9ecdf057db [Feature] Add Heroic Strikethrough & HP Regen Per Second to GM Entity Info (#3055)
* [Feature] Add Heroic Strikethrough to GM Entity Info

* [Feature] Add Heroic Strikethrough to GM Entity Info

* typo
2023-03-11 20:46:31 -05:00
Aeadoin b6448c840f [Bug Fix] Fix Raid Invites causing client desync issues (#3053) 2023-03-11 11:42:52 -05:00
Aeadoin 0ba90df1f1 [Bug Fix] Fix issue with overflow on min/max hit dmg in npc scaling calculations (#3052)
* [Cleanup] Cleanup npc.cpp and npc scaling

* fix issue with min/max damage overflows

* formatting
2023-03-10 09:36:59 -05:00
Alex King 12dcbd0871 [Bug Fix] Fix Heal Scale and Spell Scale in NPC Scaling (#3051)
# Notes
- These had typos and didn't work.
2023-03-09 22:32:47 -05:00
Aeadoin b0be4ca8bd [Feature] Add Avoidance and HP Regen Per Second too NPC Scaling. (#3050) 2023-03-09 11:07:03 -05:00
nytmyr 412eb5deaa [Bots] Prevent interrupt spam when OOM (#3011)
Notes:

Bots currently do not do a mana check until the spell cast has already been started which results in an interrupt immediately after. If it is the last spell for a bot to cast, it tends to result in interrupt spam until the bot has enough mana. This will block the interrupt spam if the spell is invalid.
2023-03-07 18:17:09 -05:00
Alex King f030461bc7 [Feature] Add Heroic Strikethrough to NPC Scaling (#3028)
* [Feature] Add Heroic Strikethrough to NPC Scaling

# Notes
- Adds Heroic Strikethrough support to NPC scaling.
- Cleans up `std::stoul` to use `Strings::ToUnsignedInt` since recent changes.
- Sets default values to sane values and removes support for `NULL` values.

* Update 2023_03_04_npc_scale_global_base_heroic_strikethrough.sql
2023-03-05 22:36:53 -05:00
Alex King 8f5e7978ab [Commands] Remove #equipitem Command (#3040)
* [Commands] Remove #equipitem Command

# Notes
- This command causes issues with cursor and inventory slot desynchronizations and seems to largely be unused/unnecessary.

* Remove from command files.
2023-03-05 22:36:04 -05:00
Alex King 2e55da2b2d [Fix] Checkmarks and X characters in popup messages (#3041)
# Notes
- Due to changing the popups to use strings, these show as squares, instead of the proper character.
2023-03-05 22:35:52 -05:00
Alex King 16a8f88ae5 [Commands] Cleanup #haste Command (#3042)
* [Commands] Cleanup #haste Command

# Notes
- Cleanup messages and logic.
- No longer requires you to re-equip your weapon for the haste to take effect.
- Can now use on targeted client if you have `#gm on` enabled.

* Update haste.cpp
2023-03-05 22:35:42 -05:00
Alex King 22d7ef6763 [Commands] Cleanup #hideme Command (#3043)
# Notes
- Cleanup messages and logic.
2023-03-05 22:35:30 -05:00
Alex King 457e800c73 [Commands] Cleanup #interrupt Command (#3044)
* [Commands] Cleanup #interrupt Command

# Notes
- Cleanup messages and logic.

* Update command.cpp
2023-03-05 22:35:23 -05:00
Alex King 8393e50aa8 [Commands] Cleanup #level Command (#3045)
# Notes
- Cleanup messages and logic.
- Defaults target to GM so that you don't have to target yourself to use the command.
2023-03-05 22:34:33 -05:00
Alex King b6497cdd6a [Commands] Cleanup #resetaa and #resetaa_timer (#3047)
# Notes
- Cleanup messages and logic.
2023-03-05 22:34:21 -05:00
Alex King 218ef80f96 [Commands] Cleanup #picklock Command (#3046)
* [Commands] Cleanup #picklock Command

# Notes
- Cleanup messages and logic.

* Update picklock.cpp
2023-03-05 22:34:05 -05:00
Alex King a90d41480a [Commands] Cleanup #wc Command (#3049)
# Notes
- Cleanup messages and logic.
2023-03-05 22:18:35 -05:00
214 changed files with 8868 additions and 11639 deletions
+157
View File
@@ -1,3 +1,160 @@
## [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
-1
View File
@@ -608,7 +608,6 @@ SET(common_headers
unix.h
useperl.h
version.h
zone_numbers.h
zone_store.h
event/event_loop.h
event/task.h
+39 -39
View File
@@ -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::ToInt(row[0]);
character_id = Strings::ToUnsignedInt(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::ToInt(row[0]);
return Strings::ToUnsignedInt(row[0]);
}
return 0;
}
@@ -815,7 +815,7 @@ uint32 Database::GetAccountIDByChar(const char* charname, uint32* oCharID) {
uint32 accountId = Strings::ToInt(row[0]);
if (oCharID)
*oCharID = Strings::ToInt(row[1]);
*oCharID = Strings::ToUnsignedInt(row[1]);
return accountId;
}
@@ -832,7 +832,7 @@ uint32 Database::GetAccountIDByChar(uint32 char_id) {
return 0;
auto row = results.begin();
return Strings::ToInt(row[0]);
return Strings::ToUnsignedInt(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::ToInt(row[1]);
*oLSAccountID = Strings::ToUnsignedInt(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::ToInt(row[2]); // ahh should we be comparing if this is newer?
varcache.last_update = Strings::ToUnsignedInt(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
@@ -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::ToInt(row[0]);
*graveyard_zoneid = Strings::ToUnsignedInt(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::ToInt(row[0]);
account_id = Strings::ToUnsignedInt(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::ToInt(row[0]);
return Strings::ToUnsignedInt(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::ToInt(row[0]);
return Strings::ToUnsignedInt(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::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]);
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]);
}
int race_skill = GetRaceSkill(skillid,in_race);
@@ -1488,7 +1488,7 @@ uint32 Database::GetGroupID(const char* name){
auto row = results.begin();
return Strings::ToInt(row[0]);
return Strings::ToUnsignedInt(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::ToInt(row[0]);
return Strings::ToUnsignedInt(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::ToInt(row[0]);
return Strings::ToUnsignedInt(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::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->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->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::ToInt(row[0]);
return Strings::ToUnsignedInt(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::ToInt(row[0]);
return Strings::ToUnsignedInt(row[0]);
}
uint32 Database::GetRaidIDByCharID(uint32 character_id) {
@@ -2044,7 +2044,7 @@ uint32 Database::GetRaidIDByCharID(uint32 character_id) {
);
auto results = QueryDatabase(query);
for (auto row = results.begin(); row != results.end(); ++row) {
return Strings::ToInt(row[0]);
return Strings::ToUnsignedInt(row[0]);
}
return 0;
}
@@ -2089,17 +2089,17 @@ struct TimeOfDay_Struct Database::LoadTime(time_t &realtime)
eqTime.day = 1;
eqTime.month = 1;
eqTime.year = 3100;
realtime = time(0);
realtime = time(nullptr);
}
else{
auto row = results.begin();
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]);
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]);
}
return eqTime;
+12 -12
View File
@@ -937,11 +937,11 @@ bool Database::CheckDatabaseConvertPPDeblob(){
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::ToInt(row2[5]);
lfg = Strings::ToInt(row2[6]);
lfp = Strings::ToInt(row2[7]);
firstlogon = Strings::ToUnsignedInt(row2[5]);
lfg = Strings::ToUnsignedInt(row2[6]);
lfp = Strings::ToUnsignedInt(row2[7]);
mailkey = row2[8];
xtargets = Strings::ToInt(row2[9]);
xtargets = Strings::ToUnsignedInt(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::ToInt(row[0]));
std::string squery = StringFormat("SELECT id, charname, data, time_of_death, is_rezzed FROM character_corpses WHERE `charid` = %i", Strings::ToUnsignedInt(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::ToInt(row2[0]) << std::endl;
std::cout << "Converting Corpse: [OK] [" << c_type << "]: " << "ID: " << Strings::ToUnsignedInt(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::ToInt(row2[0])
Strings::ToUnsignedInt(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::ToInt(row2[0]),
Strings::ToUnsignedInt(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::ToInt(row2[0]),
Strings::ToUnsignedInt(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::ToInt(row2[0])
Strings::ToUnsignedInt(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::ToInt(row2[0]),
Strings::ToUnsignedInt(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::ToInt(row2[0]),
Strings::ToUnsignedInt(row2[0]),
dbpc_c->items[i].equipSlot,
dbpc_c->items[i].item_id,
dbpc_c->items[i].charges,
+25
View File
@@ -593,4 +593,29 @@ 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*/
+5 -1
View File
@@ -5522,7 +5522,11 @@ struct ServerLootItem_Struct {
uint32 aug_4; // uint32 aug_4;
uint32 aug_5; // uint32 aug_5;
uint32 aug_6; // uint32 aug_5;
uint8 attuned;
bool attuned;
std::string custom_data;
uint32 ornamenticon;
uint32 ornamentidfile;
uint32 ornament_hero_model;
uint16 trivial_min_level;
uint16 trivial_max_level;
uint16 npc_min_level;
+13 -13
View File
@@ -40,7 +40,7 @@ void EQEmuConfig::parse_config()
if (_root["server"]["world"]["loginserver"].isObject()) {
LoginHost = _root["server"]["world"]["loginserver"].get("host", "login.eqemulator.net").asString();
LoginPort = Strings::ToInt(_root["server"]["world"]["loginserver"].get("port", "5998").asString().c_str());
LoginPort = Strings::ToUnsignedInt(_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::ToInt(_root["server"]["world"][str].get("port", "5998").asString().c_str());
loginconfig->LoginPort = Strings::ToUnsignedInt(_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::ToInt(_root["server"]["world"]["tcp"].get("port", "9000").asString().c_str());
WorldTCPPort = Strings::ToUnsignedInt(_root["server"]["world"]["tcp"].get("port", "9000").asString().c_str());
TelnetIP = _root["server"]["world"]["telnet"].get("ip", "127.0.0.1").asString();
TelnetTCPPort = Strings::ToInt(_root["server"]["world"]["telnet"].get("port", "9001").asString().c_str());
TelnetTCPPort = Strings::ToUnsignedInt(_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::ToInt(_root["server"]["world"]["http"].get("port", "9080").asString().c_str());
WorldHTTPPort = Strings::ToUnsignedInt(_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::ToInt(_root["server"]["chatserver"].get("port", "7778").asString().c_str());
ChatPort = Strings::ToUnsignedInt(_root["server"]["chatserver"].get("port", "7778").asString().c_str());
MailHost = _root["server"]["mailserver"].get("host", "eqmail.eqemulator.net").asString();
MailPort = Strings::ToInt(_root["server"]["mailserver"].get("port", "7778").asString().c_str());
MailPort = Strings::ToUnsignedInt(_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::ToInt(_root["server"]["database"].get("port", "3306").asString().c_str());
DatabasePort = Strings::ToUnsignedInt(_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::ToInt(_root["server"]["content_database"].get("port", 0).asString().c_str());
ContentDbPort = Strings::ToUnsignedInt(_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::ToInt(_root["server"]["qsdatabase"].get("port", "3306").asString().c_str());
QSDatabasePort = Strings::ToUnsignedInt(_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::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());
DefaultStatus = Strings::ToUnsignedInt(_root["server"]["zones"].get("defaultstatus", 0).asString().c_str());
ZonePortLow = Strings::ToUnsignedInt(_root["server"]["zones"]["ports"].get("low", "7000").asString().c_str());
ZonePortHigh = Strings::ToUnsignedInt(_root["server"]["zones"]["ports"].get("high", "7999").asString().c_str());
/**
* Files
+14 -18
View File
@@ -61,7 +61,7 @@ bool BaseGuildManager::LoadGuilds() {
}
for (auto row=results.begin();row!=results.end();++row)
_CreateGuild(Strings::ToInt(row[0]), row[1], Strings::ToInt(row[2]), Strings::ToInt(row[3]), row[4], row[5], row[6], row[7]);
_CreateGuild(Strings::ToUnsignedInt(row[0]), row[1], Strings::ToUnsignedInt(row[2]), Strings::ToUnsignedInt(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::ToInt(row[0]);
uint8 rankn = Strings::ToInt(row[1]);
uint32 guild_id = Strings::ToUnsignedInt(row[0]);
uint8 rankn = Strings::ToUnsignedInt(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::ToInt(row[1]), Strings::ToInt(row[2]), row[3], row[4], row[5], row[6]);
info = _CreateGuild(guild_id, row[0], Strings::ToUnsignedInt(row[1]), Strings::ToUnsignedInt(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::ToInt(row[1]);
uint8 rankn = Strings::ToUnsignedInt(row[1]);
if(rankn > GUILD_MAX_RANK) {
LogGuilds("Found invalid (too high) rank [{}] for guild [{}], skipping", rankn, guild_id);
@@ -787,9 +787,7 @@ bool BaseGuildManager::GetBankerFlag(uint32 CharID)
auto row = results.begin();
bool IsBanker = Strings::ToInt(row[0]);
return IsBanker;
return Strings::ToBool(row[0]);
}
bool BaseGuildManager::DBSetAltFlag(uint32 charid, bool is_alt)
@@ -817,9 +815,7 @@ bool BaseGuildManager::GetAltFlag(uint32 CharID)
auto row = results.begin();
bool IsAlt = Strings::ToInt(row[0]);
return IsAlt;
return Strings::ToBool(row[0]);
}
bool BaseGuildManager::DBSetTributeFlag(uint32 charid, bool enabled) {
@@ -873,18 +869,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::ToInt(row[0]);
into.char_id = Strings::ToUnsignedInt(row[0]);
into.char_name = row[1];
into.class_ = Strings::ToInt(row[2]);
into.level = Strings::ToInt(row[3]);
into.class_ = Strings::ToUnsignedInt(row[2]);
into.level = Strings::ToUnsignedInt(row[3]);
into.time_last_on = Strings::ToUnsignedInt(row[4]);
into.zone_id = Strings::ToInt(row[5]);
into.zone_id = Strings::ToUnsignedInt(row[5]);
//fields from `guild_members`, leave at defaults if missing
into.guild_id = row[6] ? Strings::ToInt(row[6]) : GUILD_NONE;
into.rank = row[7] ? Strings::ToInt(row[7]) : (GUILD_MAX_RANK+1);
into.guild_id = row[6] ? Strings::ToUnsignedInt(row[6]) : GUILD_NONE;
into.rank = row[7] ? Strings::ToUnsignedInt(row[7]) : (GUILD_MAX_RANK+1);
into.tribute_enable = row[8] ? (row[8][0] == '0'?false:true) : false;
into.total_tribute = row[9] ? Strings::ToInt(row[9]) : 0;
into.total_tribute = row[9] ? Strings::ToUnsignedInt(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] : "";
+6 -6
View File
@@ -203,12 +203,12 @@ namespace EQ
void dumpBankItems();
void dumpSharedBankItems();
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);
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);
protected:
///////////////////////////////
// Protected Methods
+30 -39
View File
@@ -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>
uint32 NextItemInstSerialNumber = 1;
int32 NextItemInstSerialNumber = 1;
static inline uint32 GetNextItemInstSerialNumber() {
static inline int32 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 uint32 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 >= UINT_MAX)
if(NextItemInstSerialNumber >= INT_MAX)
NextItemInstSerialNumber = 1;
else
NextItemInstSerialNumber++;
@@ -56,21 +56,13 @@ static inline uint32 GetNextItemInstSerialNumber() {
//
// class EQ::ItemInstance
//
EQ::ItemInstance::ItemInstance(const ItemData* item, const std::string& guid, int16 charges) {
EQ::ItemInstance::ItemInstance(const ItemData* item, 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;
@@ -80,7 +72,7 @@ EQ::ItemInstance::ItemInstance(const ItemData* item, const std::string& guid, in
else
m_color = 0;
m_merchantcount = 1;
m_serial_number = GetNextItemInstSerialNumber();
m_SerialNumber = GetNextItemInstSerialNumber();
m_exp = 0;
m_evolveLvl = 0;
@@ -93,10 +85,9 @@ EQ::ItemInstance::ItemInstance(const ItemData* item, const std::string& guid, in
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, const std::string& guid, int16 charges) {
EQ::ItemInstance::ItemInstance(SharedDatabase *db, uint32 item_id, int16 charges) {
m_use_type = ItemInstNormal;
m_item = db->GetItem(item_id);
if(m_item) {
@@ -106,13 +97,6 @@ EQ::ItemInstance::ItemInstance(SharedDatabase *db, uint32 item_id, const std::st
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;
@@ -122,7 +106,7 @@ EQ::ItemInstance::ItemInstance(SharedDatabase *db, uint32 item_id, const std::st
else
m_color = 0;
m_merchantcount = 1;
m_serial_number = GetNextItemInstSerialNumber();
m_SerialNumber = GetNextItemInstSerialNumber();
m_exp = 0;
m_evolveLvl = 0;
@@ -135,20 +119,17 @@ EQ::ItemInstance::ItemInstance(SharedDatabase *db, uint32 item_id, const std::st
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;
@@ -160,8 +141,6 @@ 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
@@ -173,7 +152,6 @@ 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;
@@ -198,7 +176,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_serial_number = copy.m_serial_number;
m_SerialNumber = copy.m_SerialNumber;
m_custom_data = copy.m_custom_data;
m_timers = copy.m_timers;
@@ -632,7 +610,7 @@ bool EQ::ItemInstance::UpdateOrnamentationInfo() {
SetOrnamentHeroModel(ornamentItem->HerosForgeModel);
if (strlen(ornamentItem->IDFile) > 2)
{
SetOrnamentationIDFile(Strings::ToInt(&ornamentItem->IDFile[2]));
SetOrnamentationIDFile(Strings::ToUnsignedInt(&ornamentItem->IDFile[2]));
}
else
{
@@ -862,7 +840,20 @@ std::string EQ::ItemInstance::GetCustomDataString() const {
return ret_val;
}
std::string EQ::ItemInstance::GetCustomData(std::string identifier) {
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::map<std::string, std::string>::const_iterator iter = m_custom_data.find(identifier);
if (iter != m_custom_data.end()) {
return iter->second;
@@ -871,33 +862,33 @@ std::string EQ::ItemInstance::GetCustomData(std::string identifier) {
return "";
}
void EQ::ItemInstance::SetCustomData(std::string identifier, std::string value) {
void EQ::ItemInstance::SetCustomData(const std::string& identifier, const std::string& value) {
DeleteCustomData(identifier);
m_custom_data[identifier] = value;
}
void EQ::ItemInstance::SetCustomData(std::string identifier, int value) {
void EQ::ItemInstance::SetCustomData(const std::string& identifier, int value) {
DeleteCustomData(identifier);
std::stringstream ss;
ss << value;
m_custom_data[identifier] = ss.str();
}
void EQ::ItemInstance::SetCustomData(std::string identifier, float value) {
void EQ::ItemInstance::SetCustomData(const std::string& identifier, float value) {
DeleteCustomData(identifier);
std::stringstream ss;
ss << value;
m_custom_data[identifier] = ss.str();
}
void EQ::ItemInstance::SetCustomData(std::string identifier, bool value) {
void EQ::ItemInstance::SetCustomData(const std::string& identifier, bool value) {
DeleteCustomData(identifier);
std::stringstream ss;
ss << value;
m_custom_data[identifier] = ss.str();
}
void EQ::ItemInstance::DeleteCustomData(std::string identifier) {
void EQ::ItemInstance::DeleteCustomData(const std::string& identifier) {
auto iter = m_custom_data.find(identifier);
if (iter != m_custom_data.end()) {
m_custom_data.erase(iter);
+12 -14
View File
@@ -69,9 +69,9 @@ namespace EQ
/////////////////////////
// Constructors/Destructor
ItemInstance(const ItemData* item, const std::string& guid, int16 charges);
ItemInstance(const ItemData* item = nullptr, int16 charges = 0);
ItemInstance(SharedDatabase *db, uint32 item_id, const std::string &guid, int16 charges);
ItemInstance(SharedDatabase *db, uint32 item_id, int16 charges = 0);
ItemInstance(ItemInstTypes use_type);
@@ -79,8 +79,6 @@ namespace EQ
~ItemInstance();
inline std::string GetGuid() const { return m_guid; }
// Query item type
bool IsType(item::ItemClass item_class) const;
@@ -177,12 +175,13 @@ namespace EQ
void SetAttuned(bool flag) { m_attuned = flag; }
std::string GetCustomDataString() const;
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);
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);
// Allows treatment of this object as though it were a pointer to m_item
operator bool() const { return (m_item != nullptr); }
@@ -227,8 +226,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_serial_number; }
inline void SetSerialNumber(int32 id) { m_serial_number = id; }
inline int32 GetSerialNumber() const { return m_SerialNumber; }
inline void SetSerialNumber(int32 id) { m_SerialNumber = id; }
std::map<std::string, ::Timer>& GetTimers() { return m_timers; }
void SetTimer(std::string name, uint32 time);
@@ -305,7 +304,6 @@ 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
@@ -315,7 +313,7 @@ namespace EQ
int16 m_currentslot;
bool m_attuned;
int32 m_merchantcount; //number avaliable on the merchant, -1=unlimited
uint32 m_serial_number; // Unique identifier for this instance of an item. Needed for Bazaar.
int32 m_SerialNumber; // Unique identifier for this instance of an item. Needed for Bazaar.
uint32 m_exp;
int8 m_evolveLvl;
bool m_activated;
+1 -1
View File
@@ -151,7 +151,7 @@ static char *temp=nullptr;
return false;
}
ptr++;
uint32 id = Strings::ToInt(field[id_pos].c_str());
uint32 id = Strings::ToUnsignedInt(field[id_pos].c_str());
items[id]=field;
for(i=0;i<10;i++) {
+1 -1
View File
@@ -131,7 +131,7 @@ bool ParseAddress(const char* iAddress, uint32* oIP, uint16* oPort, char* errbuf
if (*oIP == 0)
return false;
if (oPort)
*oPort = Strings::ToInt(sep.arg[1]);
*oPort = Strings::ToUnsignedInt(sep.arg[1]);
return true;
}
return false;
+4 -4
View File
@@ -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, membername = %s", gjs->yourname, gjs->membername);
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
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, membername = %s", gjs->yourname, gjs->membername);
// Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
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->membername[i]);
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->member_name[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, membername = %s", gjs->yourname, gjs->membername);
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
ENCODE_LENGTH_EXACT(GroupJoin_Struct);
SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct);
+4 -4
View File
@@ -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, membername = %s", gjs->yourname, gjs->membername);
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
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, membername = %s", gjs->yourname, gjs->membername);
// Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
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->membername[i]);
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->member_name[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, membername = %s", gjs->yourname, gjs->membername);
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
ENCODE_LENGTH_EXACT(GroupJoin_Struct);
SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct);
+2 -2
View File
@@ -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 membername[0]; // Member Name Null Terminated
/*0000*/ //char member_name[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 membername[0]; // Null Terminated?
/*0013*/ //char member_name[0]; // Null Terminated?
/*0000*/ uint8 unknown0013[3]; // Seen 0
/*0000*/ uint32 unknown0016; // Matches unknown0132 from GroupFollow_Struct
/*0000*/ uint8 unknown0020[11]; // Seen 0
+2 -2
View File
@@ -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 membername[0]; // Member Name Null Terminated
/*0000*/ //char member_name[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 membername[0]; // Null Terminated?
/*0013*/ //char member_name[0]; // Null Terminated?
/*0000*/ uint8 unknown0013[3]; // Seen 0
/*0000*/ uint32 unknown0016; // Matches unknown0132 from GroupFollow_Struct
/*0000*/ uint8 unknown0020[11]; // Seen 0
+4 -4
View File
@@ -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, membername = %s", gjs->yourname, gjs->membername);
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
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, membername = %s", gjs->yourname, gjs->membername);
// Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
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->membername[i]);
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->member_name[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, membername = %s", gjs->yourname, gjs->membername);
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
ENCODE_LENGTH_EXACT(GroupJoin_Struct);
SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct);
+2 -2
View File
@@ -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 membername[0]; // Member Name Null Terminated
/*0000*/ //char member_name[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 membername[0]; // Null Terminated?
/*0013*/ //char member_name[0]; // Null Terminated?
/*0000*/ uint8 unknown0013[3]; // Seen 0
/*0000*/ uint32 unknown0016; // Matches unknown0132 from GroupFollow_Struct
/*0000*/ uint8 unknown0020[11]; // Seen 0
+4 -4
View File
@@ -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, membername = %s", gjs->yourname, gjs->membername);
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
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, membername = %s", gjs->yourname, gjs->membername);
// Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
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->membername[i]);
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->member_name[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, membername = %s", gjs->yourname, gjs->membername);
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, member_name = %s", gjs->yourname, gjs->member_name);
ENCODE_LENGTH_EXACT(GroupJoin_Struct);
SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct);
+2 -2
View File
@@ -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 membername[0]; // Member Name Null Terminated
/*0000*/ //char member_name[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 membername[0]; // Null Terminated?
/*0013*/ //char member_name[0]; // Null Terminated?
/*0000*/ uint8 unknown0013[3]; // Seen 0
/*0000*/ uint32 unknown0016; // Matches unknown0132 from GroupFollow_Struct
/*0000*/ uint8 unknown0020[11]; // Seen 0
+3 -3
View File
@@ -288,9 +288,9 @@ bool PTimerList::Load(Database *db) {
PersistentTimer *cur;
for (auto row = results.begin(); row != results.end(); ++row) {
type = Strings::ToInt(row[0]);
start_time = strtoul(row[1], nullptr, 10);
timer_time = strtoul(row[2], nullptr, 10);
type = Strings::ToUnsignedInt(row[0]);
start_time = Strings::ToUnsignedInt(row[1]);
timer_time = Strings::ToUnsignedInt(row[2]);
enabled = (row[3][0] == '1');
//if it expired allready, dont bother.
@@ -16,11 +16,12 @@
#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;
};
@@ -34,7 +35,7 @@ public:
{
return {
"id",
"key",
"`key`",
"value",
"expires",
};
@@ -44,7 +45,7 @@ public:
{
return {
"id",
"key",
"`key`",
"value",
"expires",
};
@@ -88,7 +89,7 @@ public:
DataBuckets e{};
e.id = 0;
e.key = "";
e.key_ = "";
e.value = "";
e.expires = 0;
@@ -116,8 +117,9 @@ public:
{
auto results = db.QueryDatabase(
fmt::format(
"{} WHERE id = {} LIMIT 1",
"{} WHERE {} = {} LIMIT 1",
BaseSelect(),
PrimaryKey(),
data_buckets_id
)
);
@@ -127,7 +129,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));
@@ -163,7 +165,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));
@@ -188,7 +190,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));
@@ -221,7 +223,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));
@@ -258,7 +260,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));
@@ -286,7 +288,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;
int32_t hp;
int64_t hp;
int32_t accuracy;
int32_t slow_mitigation;
int32_t attack;
@@ -45,10 +45,13 @@ public:
int32_t physical_resist;
int32_t min_dmg;
int32_t max_dmg;
int32_t hp_regen_rate;
int64_t hp_regen_rate;
int64_t hp_regen_per_second;
int32_t attack_delay;
int32_t spell_scale;
int32_t heal_scale;
uint32_t avoidance;
int32_t heroic_strikethrough;
std::string special_abilities;
};
@@ -86,9 +89,12 @@ public:
"min_dmg",
"max_dmg",
"hp_regen_rate",
"hp_regen_per_second",
"attack_delay",
"spell_scale",
"heal_scale",
"avoidance",
"heroic_strikethrough",
"special_abilities",
};
}
@@ -122,9 +128,12 @@ public:
"min_dmg",
"max_dmg",
"hp_regen_rate",
"hp_regen_per_second",
"attack_delay",
"spell_scale",
"heal_scale",
"avoidance",
"heroic_strikethrough",
"special_abilities",
};
}
@@ -192,9 +201,12 @@ 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;
@@ -237,7 +249,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 = static_cast<int32_t>(atoi(row[5]));
e.hp = strtoll(row[5], nullptr, 10);
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]));
@@ -257,11 +269,14 @@ 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 = 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] : "";
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] : "";
return e;
}
@@ -321,10 +336,13 @@ 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.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) + "'");
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) + "'");
auto results = db.QueryDatabase(
fmt::format(
@@ -372,9 +390,12 @@ 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(
@@ -431,9 +452,12 @@ 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) + ")");
@@ -473,7 +497,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 = static_cast<int32_t>(atoi(row[5]));
e.hp = strtoll(row[5], nullptr, 10);
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]));
@@ -493,11 +517,14 @@ 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 = 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] : "";
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] : "";
all_entries.push_back(e);
}
@@ -527,7 +554,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 = static_cast<int32_t>(atoi(row[5]));
e.hp = strtoll(row[5], nullptr, 10);
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]));
@@ -547,11 +574,14 @@ 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 = 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] : "";
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] : "";
all_entries.push_back(e);
}
@@ -16,11 +16,14 @@
#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;
@@ -32,14 +35,16 @@ public:
static std::string PrimaryKey()
{
return std::string("charid");
return std::string("id");
}
static std::vector<std::string> Columns()
{
return {
"id",
"raidid",
"charid",
"bot_id",
"groupid",
"_class",
"level",
@@ -53,8 +58,10 @@ public:
static std::vector<std::string> SelectColumns()
{
return {
"id",
"raidid",
"charid",
"bot_id",
"groupid",
"_class",
"level",
@@ -102,8 +109,10 @@ 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;
@@ -121,7 +130,7 @@ public:
)
{
for (auto &raid_members : raid_memberss) {
if (raid_members.charid == raid_members_id) {
if (raid_members.id == raid_members_id) {
return raid_members;
}
}
@@ -136,8 +145,9 @@ public:
{
auto results = db.QueryDatabase(
fmt::format(
"{} WHERE id = {} LIMIT 1",
"{} WHERE {} = {} LIMIT 1",
BaseSelect(),
PrimaryKey(),
raid_members_id
)
);
@@ -146,15 +156,17 @@ public:
if (results.RowCount() == 1) {
RaidMembers e{};
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]));
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]));
return e;
}
@@ -188,15 +200,16 @@ public:
auto columns = Columns();
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));
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));
auto results = db.QueryDatabase(
fmt::format(
@@ -204,7 +217,7 @@ public:
TableName(),
Strings::Implode(", ", v),
PrimaryKey(),
e.charid
e.id
)
);
@@ -218,8 +231,10 @@ 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));
@@ -237,7 +252,7 @@ public:
);
if (results.Success()) {
e.charid = results.LastInsertedID();
e.id = results.LastInsertedID();
return e;
}
@@ -256,8 +271,10 @@ 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));
@@ -298,15 +315,17 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
RaidMembers e{};
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]));
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]));
all_entries.push_back(e);
}
@@ -331,15 +350,17 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
RaidMembers e{};
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]));
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]));
all_entries.push_back(e);
}
+6
View File
@@ -93,6 +93,9 @@ 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)")
@@ -211,6 +214,7 @@ 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)
@@ -350,6 +354,7 @@ 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")
@@ -578,6 +583,7 @@ 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.")
+2 -1
View File
@@ -99,8 +99,9 @@ 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);
+161 -212
View File
@@ -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::ToInt(row[0]);
EntitledTime += Strings::ToUnsignedInt(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::ToInt(row[0]);
const uint16 charges = Strings::ToInt(row[1]);
const uint32 id = Strings::ToUnsignedInt(row[0]);
const uint16 charges = Strings::ToUnsignedInt(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 "
"(guid, charid, slotid, itemid, charges, instnodrop, custom_data, color, "
"(charid, slotid, itemid, charges, instnodrop, custom_data, color, "
"augslot1, augslot2, augslot3, augslot4, augslot5, augslot6, ornamenticon, ornamentidfile, ornament_hero_model) "
"VALUES( '%s', %lu, %lu, %lu, %lu, %lu, '%s', %lu, "
"VALUES( %lu, %lu, %lu, %lu, %lu, '%s', %lu, "
"%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu)",
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>(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 "
"(guid, acctid, slotid, itemid, charges, custom_data, "
"(acctid, slotid, itemid, charges, custom_data, "
"augslot1, augslot2, augslot3, augslot4, augslot5, augslot6) "
"VALUES( '%s', %lu, %lu, %lu, %lu, '%s', "
"VALUES( %lu, %lu, %lu, %lu, '%s', "
"%lu, %lu, %lu, %lu, %lu, %lu)",
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>(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.guid "
"sb.augslot4, sb.augslot5, sb.augslot6, sb.custom_data "
"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, guid "
"augslot4, augslot5, augslot6, custom_data "
"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 = static_cast<uint32>(Strings::ToInt(row[1]));
uint32 item_id = Strings::ToUnsignedInt(row[1]);
const int16 charges = static_cast<int16>(Strings::ToInt(row[2]));
uint32 aug[EQ::invaug::SOCKET_COUNT];
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]));
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]);
const EQ::ItemData *item = GetItem(item_id);
@@ -538,9 +538,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, EQ::InventoryProfile *inv, bool is
continue;
}
std::string guid = row[10];
EQ::ItemInstance *inst = CreateBaseItem(item, guid, charges);
EQ::ItemInstance *inst = CreateBaseItem(item, charges);
if (inst && item->IsClassCommon()) {
for (int i = EQ::invaug::SOCKET_BEGIN; i <= EQ::invaug::SOCKET_END; i++) {
if (aug[i])
@@ -550,27 +548,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, EQ::InventoryProfile *inv, bool is
if (inst && row[9]) {
std::string data_str(row[9]);
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->SetCustomDataString(data_str);
}
// theoretically inst can be nullptr ... this would be very bad ...
@@ -600,7 +578,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, guid FROM "
"augslot6, instnodrop, custom_data, ornamenticon, ornamentidfile, ornament_hero_model FROM "
"inventory WHERE charid = %i ORDER BY slotid",
char_id);
auto results = QueryDatabase(query);
@@ -647,8 +625,8 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQ::InventoryProfile *inv)
}
}
uint32 item_id = Strings::ToInt(row[1]);
const uint16 charges = Strings::ToInt(row[2]);
uint32 item_id = Strings::ToUnsignedInt(row[1]);
const uint16 charges = Strings::ToUnsignedInt(row[2]);
const uint32 color = Strings::ToUnsignedInt(row[3]);
uint32 aug[EQ::invaug::SOCKET_COUNT];
@@ -660,7 +638,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::ToInt(row[10]))) ? true : false;
const bool instnodrop = (row[10] && static_cast<uint16>(Strings::ToUnsignedInt(row[10])));
const uint32 ornament_icon = Strings::ToUnsignedInt(row[12]);
const uint32 ornament_idfile = Strings::ToUnsignedInt(row[13]);
@@ -674,36 +652,14 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQ::InventoryProfile *inv)
continue;
}
std::string guid = row[15];
EQ::ItemInstance *inst = CreateBaseItem(item, guid, charges);
EQ::ItemInstance *inst = CreateBaseItem(item, charges);
if (inst == nullptr)
continue;
if (row[11]) {
std::string data_str(row[11]);
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->SetCustomDataString(data_str);
}
inst->SetOrnamentIcon(ornament_icon);
@@ -784,7 +740,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, guid "
"ornamentidfile, ornament_hero_model "
"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);
@@ -798,19 +754,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::ToInt(row[1]);
uint32 item_id = Strings::ToUnsignedInt(row[1]);
const int8 charges = Strings::ToInt(row[2]);
const uint32 color = Strings::ToUnsignedInt(row[3]);
uint32 aug[EQ::invaug::SOCKET_COUNT];
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]));
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]);
const bool instnodrop = (row[10] && static_cast<uint16>(Strings::ToInt(row[10]))) ? true : false;
const bool instnodrop = (row[10] && static_cast<uint16>(Strings::ToUnsignedInt(row[10])));
const uint32 ornament_icon = Strings::ToUnsignedInt(row[12]);
const uint32 ornament_idfile = Strings::ToUnsignedInt(row[13]);
uint32 ornament_hero_model = Strings::ToUnsignedInt(row[14]);
@@ -819,9 +775,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, EQ::InventoryPr
if (!item)
continue;
std::string guid = row[15];
EQ::ItemInstance *inst = CreateBaseItem(item, guid, charges);
EQ::ItemInstance *inst = CreateBaseItem(item, charges);
if (inst == nullptr)
continue;
@@ -830,28 +784,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, EQ::InventoryPr
if (row[11]) {
std::string data_str(row[11]);
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->SetCustomDataString(data_str);
}
inst->SetOrnamentIcon(ornament_icon);
@@ -910,7 +843,7 @@ uint32 SharedDatabase::GetItemRecastTimestamp(uint32 char_id, uint32 recast_type
return 0;
auto& row = results.begin();
return static_cast<uint32>(Strings::ToUnsignedInt(row[0]));
return Strings::ToUnsignedInt(row[0]);
}
void SharedDatabase::ClearOldRecastTimestamps(uint32 char_id)
@@ -938,10 +871,10 @@ void SharedDatabase::GetItemsCount(int32 &item_count, uint32 &max_id)
auto& row = results.begin();
if (row[0])
max_id = Strings::ToInt(row[0]);
max_id = Strings::ToUnsignedInt(row[0]);
if (row[1])
item_count = Strings::ToInt(row[1]);
item_count = Strings::ToUnsignedInt(row[1]);
}
bool SharedDatabase::LoadItems(const std::string &prefix) {
@@ -1030,24 +963,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::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.ArtifactFlag = Strings::ToBool(row[ItemField::artifactflag]);
item.Attuneable = !disable_attuneable && Strings::ToInt(row[ItemField::attuneable]) != 0;
item.BenefitFlag = Strings::ToBool(row[ItemField::benefitflag]) != 0;
item.FVNoDrop = Strings::ToInt(row[ItemField::fvnodrop]) != 0;
item.Magic = Strings::ToBool(row[ItemField::magic]) != 0;
item.NoDrop = disable_no_drop ? static_cast<uint8>(255) : static_cast<uint8>(Strings::ToUnsignedInt(row[ItemField::nodrop]));
item.NoPet = disable_no_pet ? false : Strings::ToInt(row[ItemField::nopet]) ? true : false;
item.NoPet = !disable_no_pet && Strings::ToBool(row[ItemField::nopet]);
item.NoRent = disable_no_rent ? static_cast<uint8>(255) : static_cast<uint8>(Strings::ToUnsignedInt(row[ItemField::norent]));
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;
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]);
// Lore
item.LoreGroup = disable_lore ? 0 : Strings::ToInt(row[ItemField::loregroup]);
item.LoreFlag = disable_lore ? false : item.LoreGroup != 0;
item.LoreFlag = !disable_lore && item.LoreGroup != 0;
// Type
item.AugType = Strings::ToUnsignedInt(row[ItemField::augtype]);
@@ -1063,7 +996,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 ? false : Strings::ToInt(row[ItemField::potionbelt]) ? true : false;
item.PotionBelt = !disable_potion_belt && Strings::ToBool(row[ItemField::potionbelt]);
item.PotionBeltSlots = disable_potion_belt ? 0 : static_cast<uint8>(Strings::ToUnsignedInt(row[ItemField::potionbeltslots]));
// Merchant
@@ -1374,8 +1307,8 @@ void SharedDatabase::GetFactionListInfo(uint32 &list_count, uint32 &max_lists) {
auto& row = results.begin();
list_count = static_cast<uint32>(Strings::ToUnsignedInt(row[0]));
max_lists = static_cast<uint32>(Strings::ToUnsignedInt(row[1] ? row[1] : "0"));
list_count = Strings::ToUnsignedInt(row[0]);
max_lists = Strings::ToUnsignedInt(row[1] ? row[1] : "0");
}
const NPCFactionList* SharedDatabase::GetNPCFactionEntry(uint32 id) const
@@ -1408,7 +1341,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 = static_cast<uint32>(Strings::ToUnsignedInt(row[0]));
const uint32 id = Strings::ToUnsignedInt(row[0]);
if(id != current_id) {
if(current_id != 0) {
hash.insert(current_id, faction);
@@ -1418,7 +1351,7 @@ void SharedDatabase::LoadNPCFactionLists(void *data, uint32 size, uint32 list_co
current_entry = 0;
current_id = id;
faction.id = id;
faction.primaryfaction = static_cast<uint32>(Strings::ToUnsignedInt(row[1]));
faction.primaryfaction = Strings::ToUnsignedInt(row[1]);
faction.assistprimaryfaction = (Strings::ToInt(row[2]) == 0);
}
@@ -1428,10 +1361,10 @@ void SharedDatabase::LoadNPCFactionLists(void *data, uint32 size, uint32 list_co
if(current_entry >= MAX_NPC_FACTIONS)
continue;
faction.factionid[current_entry] = static_cast<uint32>(Strings::ToUnsignedInt(row[3]));
faction.factionvalue[current_entry] = static_cast<int32>(Strings::ToInt(row[4]));
faction.factionid[current_entry] = Strings::ToUnsignedInt(row[3]);
faction.factionvalue[current_entry] = Strings::ToInt(row[4]);
faction.factionnpcvalue[current_entry] = static_cast<int8>(Strings::ToInt(row[5]));
faction.factiontemp[current_entry] = static_cast<uint8>(Strings::ToInt(row[6]));
faction.factiontemp[current_entry] = static_cast<uint8>(Strings::ToUnsignedInt(row[6]));
++current_entry;
}
@@ -1549,13 +1482,17 @@ EQ::ItemInstance* SharedDatabase::CreateItem(
uint32 aug4,
uint32 aug5,
uint32 aug6,
bool attuned
bool attuned,
const std::string& custom_data,
uint32 ornamenticon,
uint32 ornamentidfile,
uint32 ornament_hero_model
) {
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()");
@@ -1570,6 +1507,10 @@ 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;
@@ -1586,11 +1527,15 @@ EQ::ItemInstance* SharedDatabase::CreateItem(
uint32 aug4,
uint32 aug5,
uint32 aug6,
bool attuned
bool attuned,
const std::string& custom_data,
uint32 ornamenticon,
uint32 ornamentidfile,
uint32 ornament_hero_model
) {
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()");
@@ -1605,12 +1550,16 @@ 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, const std::string& guid, int16 charges) {
EQ::ItemInstance* SharedDatabase::CreateBaseItem(const EQ::ItemData* item, int16 charges) {
EQ::ItemInstance* inst = nullptr;
if (item) {
// if maxcharges is -1 that means it is an unlimited use item.
@@ -1621,7 +1570,7 @@ EQ::ItemInstance* SharedDatabase::CreateBaseItem(const EQ::ItemData* item, const
if(charges <= 0 && item->Stackable)
charges = 1;
inst = new EQ::ItemInstance(item, guid, charges);
inst = new EQ::ItemInstance(item, charges);
if (inst == nullptr) {
LogError("Error: valid item data returned a null reference for EQ::ItemInstance creation in SharedDatabase::CreateBaseItem()");
@@ -1669,7 +1618,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::ToInt(row[1]);
command_settings[row[0]].first = Strings::ToUnsignedInt(row[1]);
if (row[2][0] == 0)
continue;
@@ -1767,10 +1716,10 @@ void SharedDatabase::LoadSkillCaps(void *data) {
}
for(auto& row = results.begin(); row != results.end(); ++row) {
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]);
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]);
if(skillID >= skill_count || class_ >= class_count || level >= level_count)
continue;
@@ -1871,7 +1820,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::ToInt(row[1]);
sp[spellID].damage_shield_type = Strings::ToUnsignedInt(row[1]);
}
}
@@ -1952,16 +1901,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=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].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].mana=Strings::ToInt(row[19]);
int y=0;
@@ -1984,7 +1933,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::ToInt(row[70+y]);
sp[tempid].formula[y]=Strings::ToUnsignedInt(row[70+y]);
sp[tempid].good_effect=Strings::ToInt(row[83]);
sp[tempid].activated=Strings::ToInt(row[84]);
@@ -2019,51 +1968,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::ToInt(row[146]) != 0;
sp[tempid].uninterruptable=Strings::ToBool(row[146]);
sp[tempid].resist_difficulty=Strings::ToInt(row[147]);
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].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].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::ToInt(row[159]) != 0;
sp[tempid].feedbackable = Strings::ToInt(row[160]) != 0;
sp[tempid].reflectable = Strings::ToInt(row[161]) != 0;
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].bonus_hate=Strings::ToInt(row[162]);
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].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].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::ToInt(row[185]);
sp[tempid].can_mgb= Strings::ToBool(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 = 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].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].viral_range = Strings::ToInt(row[201]);
sp[tempid].song_cap = Strings::ToInt(row[202]);
sp[tempid].no_block = Strings::ToInt(row[205]);
@@ -2071,22 +2020,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::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].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].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::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].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].damage_shield_type = 0;
}
@@ -2223,9 +2172,9 @@ void SharedDatabase::GetLootTableInfo(uint32 &loot_table_count, uint32 &max_loot
auto& row = results.begin();
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]));
loot_table_count = Strings::ToUnsignedInt(row[0]);
max_loot_table = Strings::ToUnsignedInt(row[1] ? row[1] : "0");
loot_table_entries = Strings::ToUnsignedInt(row[2]);
}
void SharedDatabase::GetLootDropInfo(uint32 &loot_drop_count, uint32 &max_loot_drop, uint32 &loot_drop_entries) {
@@ -2248,9 +2197,9 @@ void SharedDatabase::GetLootDropInfo(uint32 &loot_drop_count, uint32 &max_loot_d
auto& row =results.begin();
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]));
loot_drop_count = Strings::ToUnsignedInt(row[0]);
max_loot_drop = Strings::ToUnsignedInt(row[1] ? row[1] : "0");
loot_drop_entries = Strings::ToUnsignedInt(row[2]);
}
void SharedDatabase::LoadLootTables(void *data, uint32 size) {
@@ -2294,7 +2243,7 @@ void SharedDatabase::LoadLootTables(void *data, uint32 size) {
uint32 current_entry = 0;
for (auto& row = results.begin(); row != results.end(); ++row) {
const uint32 id = static_cast<uint32>(Strings::ToUnsignedInt(row[0]));
const uint32 id = Strings::ToUnsignedInt(row[0]);
if (id != current_id) {
if (current_id != 0) {
hash.insert(
@@ -2306,9 +2255,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 = 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->mincash = Strings::ToUnsignedInt(row[1]);
lt->maxcash = Strings::ToUnsignedInt(row[2]);
lt->avgcoin = 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]));
@@ -2325,11 +2274,11 @@ void SharedDatabase::LoadLootTables(void *data, uint32 size) {
continue;
}
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->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->NumEntries);
++current_entry;
@@ -2388,7 +2337,7 @@ void SharedDatabase::LoadLootDrops(void *data, uint32 size) {
uint32 current_entry = 0;
for (auto& row = results.begin(); row != results.end(); ++row) {
const auto id = static_cast<uint32>(Strings::ToUnsignedInt(row[0]));
const auto id = Strings::ToUnsignedInt(row[0]);
if (id != current_id) {
if (current_id != 0) {
hash.insert(
@@ -2402,7 +2351,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::ToInt(row[11]));
p_loot_drop_struct->content_flags.max_expansion = static_cast<int16>(Strings::ToUnsignedInt(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));
@@ -2412,15 +2361,15 @@ void SharedDatabase::LoadLootDrops(void *data, uint32 size) {
continue;
}
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->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->NumEntries);
++current_entry;
+11 -3
View File
@@ -126,7 +126,11 @@ public:
uint32 aug4 = 0,
uint32 aug5 = 0,
uint32 aug6 = 0,
bool attuned = 0
bool attuned = false,
const std::string& custom_data = "",
uint32 ornamenticon = 0,
uint32 ornamentidfile = 0,
uint32 ornament_hero_model = 0
);
EQ::ItemInstance *CreateItem(
const EQ::ItemData *item,
@@ -137,9 +141,13 @@ public:
uint32 aug4 = 0,
uint32 aug5 = 0,
uint32 aug6 = 0,
bool attuned = 0
bool attuned = false,
const std::string &custom_data = "",
uint32 ornamenticon = 0,
uint32 ornamentidfile = 0,
uint32 ornament_hero_model = 0
);
EQ::ItemInstance *CreateBaseItem(const EQ::ItemData *item, const std::string &guid, int16 charges);
EQ::ItemInstance *CreateBaseItem(const EQ::ItemData *item, int16 charges = 0);
void GetItemsCount(int32 &item_count, uint32 &max_id);
void LoadItems(void *data, uint32 size, int32 items, uint32 max_item_id);
+8 -8
View File
@@ -115,7 +115,7 @@ Strings::SearchDelim(const std::string &haystack, const std::string &needle, con
}
std::string Strings::Implode(std::string glue, std::vector<std::string> src)
std::string Strings::Implode(const 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, std::string element)
bool Strings::Contains(std::vector<std::string> container, const 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(std::string s)
const std::string Strings::UcFirst(const std::string& s)
{
std::string output = s;
if (!s.empty()) {
@@ -327,7 +327,7 @@ const std::string Strings::UcFirst(std::string s)
}
std::vector<std::string> Strings::Wrap(std::vector<std::string> &src, std::string character)
std::vector<std::string> Strings::Wrap(std::vector<std::string> &src, const 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, const std::string &chars)
std::string &Strings::LTrim(std::string &str, std::string_view 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, const std::string &chars)
std::string &Strings::RTrim(std::string &str, std::string_view 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, std::string suffix)
std::string Strings::ConvertToDigit(int n, const 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(std::string bool_string)
bool Strings::ToBool(const std::string& bool_string)
{
if (
Strings::Contains(bool_string, "true") ||
+8 -8
View File
@@ -84,7 +84,7 @@ namespace EQ {
class Strings {
public:
static bool Contains(std::vector<std::string> container, std::string element);
static bool Contains(std::vector<std::string> container, const 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(std::string s);
static std::string &LTrim(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 const std::string UcFirst(const std::string& s);
static std::string &LTrim(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 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, std::string suffix);
static std::string ConvertToDigit(int n, const 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(std::string glue, std::vector<std::string> src);
static std::string Implode(const 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, std::string character);
static std::vector<std::string> Wrap(std::vector<std::string> &src, const 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(std::string bool_string);
static bool ToBool(const 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);
-8
View File
@@ -71,14 +71,6 @@ 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);
}
};
-3
View File
@@ -43,9 +43,6 @@ 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 -2
View File
@@ -25,7 +25,7 @@
// Build variables
// these get injected during the build pipeline
#define CURRENT_VERSION "22.4.5-dev" // always append -dev to the current version for custom-builds
#define CURRENT_VERSION "22.7.0-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,7 +42,8 @@
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
*/
#define CURRENT_BINARY_DATABASE_VERSION 9222
#define CURRENT_BINARY_DATABASE_VERSION 9226
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9038
#endif
-490
View File
@@ -1,490 +0,0 @@
#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";
}
-5
View File
@@ -28,11 +28,6 @@
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),
-4
View File
@@ -39,10 +39,6 @@ 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); }
-21
View File
@@ -260,27 +260,6 @@ 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;
/**
-10
View File
@@ -80,16 +80,6 @@ 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();
};
-140
View File
@@ -658,146 +658,6 @@ 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") {
-15
View File
@@ -198,21 +198,6 @@ 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);
};
+3 -3
View File
@@ -178,7 +178,7 @@ unsigned int Database::GetFreeID(const std::string &loginserver)
auto row = results.begin();
return Strings::ToInt(row[0]);
return Strings::ToUnsignedInt(row[0]);
}
/**
@@ -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::ToInt(row[0]);
r.id = Strings::ToUnsignedInt(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::ToInt(row[0]);
r.id = Strings::ToUnsignedInt(row[0]);
r.account_name = row[1];
r.account_password = row[2];
r.account_email = row[3];
-1
View File
@@ -29,7 +29,6 @@ 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.
-7
View File
@@ -23,13 +23,6 @@ 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
-19
View File
@@ -73,25 +73,6 @@ 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
-11
View File
@@ -72,17 +72,6 @@ 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;
-1
View File
@@ -31,7 +31,6 @@ 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
View File
@@ -1,6 +1,6 @@
{
"name": "eqemu-server",
"version": "22.4.5",
"version": "22.7.0",
"repository": {
"type": "git",
"url": "https://github.com/EQEmu/Server.git"
-6
View File
@@ -45,12 +45,6 @@ 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
+4 -2
View File
@@ -393,13 +393,15 @@ 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) {
+3 -1
View File
@@ -571,7 +571,9 @@ void Clientlist::CheckForStaleConnectionsAll()
void Clientlist::CheckForStaleConnections(Client *c) {
if (!c) return;
if (!c) {
return;
}
std::list<Client*>::iterator Iterator;
-12
View File
@@ -283,18 +283,6 @@ 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,
-7
View File
@@ -45,7 +45,6 @@ public:
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);
@@ -62,12 +61,6 @@ 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
+1 -2
View File
@@ -120,8 +120,7 @@ void WorldServer::ProcessMessage(uint16 opcode, EQ::Net::Packet &p)
if (Message.length() < 2)
break;
if (!c)
{
if (!c) {
LogInfo("Client not found");
break;
}
-9
View File
@@ -1,9 +0,0 @@
//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)
-37
View File
@@ -1,37 +0,0 @@
/* 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
-7
View File
@@ -1,7 +0,0 @@
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; }
-33
View File
@@ -1,33 +0,0 @@
/* 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
-19
View File
@@ -1,19 +0,0 @@
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);
-37
View File
@@ -1,37 +0,0 @@
/* 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
-36
View File
@@ -1,36 +0,0 @@
//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);
-37
View File
@@ -1,37 +0,0 @@
/* 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
-14
View File
@@ -1,14 +0,0 @@
Const_char * get(Const_char *name, Const_char *default_value = "") const;
int getInt(Const_char *name, int default_value = 0) const;
float getFloat(Const_char *name, float default_value = 0.0) const;
//returns a database-safe string
Const_char * getEscaped(Const_char *name, Const_char *default_value = "") const;
map<string,string> get_all() const;
void redirect(Const_char *URL);
void SetResponseCode(Const_char *code);
void header(Const_char *name, Const_char *value);
-37
View File
@@ -1,37 +0,0 @@
/* 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 "HTTPRequest.h"
#ifdef THIS /* this macro seems to leak out on some systems */
#undef THIS
#endif
MODULE = HTTPRequest PACKAGE = HTTPRequest
PROTOTYPES: ENABLE
-28
View File
@@ -1,28 +0,0 @@
int32 GetCharID() { return charid; }
int32 GetDecayTime() { if (!corpse_decay_timer.Enabled()) return 0xFFFFFFFF; else return corpse_decay_timer.GetRemainingTime(); }
inline void Lock() { pLocked = true; }
inline void UnLock() { pLocked = false; }
inline bool IsLocked() { return pLocked; }
inline void ResetLooter() { BeingLootedBy = 0xFFFFFFFF; }
inline int32 GetDBID() { return dbid; }
inline char* GetOwnerName() { return orgname;}
void SetDecayTimer(int32 decaytime);
bool IsEmpty();
void AddItem(uint32 itemnum, int8 charges, sint16 slot = 0);
uint32 GetWornItem(sint16 equipSlot) const;
void RemoveItem(int16 lootslot);
void SetCash(int16 in_copper, int16 in_silver, int16 in_gold, int16 in_platinum);
void RemoveCash();
int32 CountItems();
void Delete();
uint32 GetCopper() { return copper; }
uint32 GetSilver() { return silver; }
uint32 GetGold() { return gold; }
uint32 GetPlatinum() { return platinum; }
void Summon(Client* client, bool spell);
void CastRezz(int16 spellid, Mob* Caster);
void CompleteRezz();
bool CanMobLoot(int charid);
void AllowMobLoot(Mob *them, int8 slot);
void AddLooter(Mob *who);
bool IsRezzed() { return isrezzed; }
-37
View File
@@ -1,37 +0,0 @@
/* 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
*/
#include "features.h"
#ifdef EMBPERL_XS_CLASSES
#include "../common/debug.h"
#include "embperl.h"
#include "PlayerCorpse.h"
#ifdef THIS /* this macro seems to leak out on some systems */
#undef THIS
#endif
MODULE = Corpse PACKAGE = Corpse
PROTOTYPES: ENABLE
-27
View File
@@ -1,27 +0,0 @@
#!/bin/sh
if [ ! -h ./miniperl ]; then
echo "You must have a link in this dir to perl named ./miniperl"
exit 1
fi
./convert client.h Client
./convert entity.h EntityList
./convert mob.h Mob
./convert npc.h NPC
./convert PlayerCorpse.h Corpse
./convert groups.h Group
./convert perlpacket.h PerlPacket
./export ../../world/EQW.h EQW.h
./convert EQW.h EQW
./export ../../common/EQDB.h EQDB.h
./convert EQDB.h EQDB
./export ../../common/EQDBRes.h EQDBRes.h
./convert EQDBRes.h EQDBRes
./export ../../world/HTTPRequest.h HTTPRequest.h
./convert HTTPRequest.h HTTPRequest
./export ../../world/EQLConfig.h EQLConfig.h
./convert EQLConfig.h EQLConfig
echo "Putting files in place..."
./put
-3
View File
@@ -1,3 +0,0 @@
#!/bin/sh
xsubpp -typemap class.typemap class.xs
-442
View File
@@ -1,442 +0,0 @@
#our object types
EQLConfig * T_PTROBJ
EQDB * T_PTROBJ
EQDBRes * T_PTROBJ
Client * T_PTROBJ
NPC * T_PTROBJ
Mob * T_PTROBJ
Group * T_PTROBJ
Corpse * T_PTROBJ
EntityList * T_PTROBJ
PerlPacket * T_PTROBJ
EQW * T_PTROBJ
HTTPRequest * T_PTROBJ
Const_char * T_PV
#some nice c++ types
vector<string> T_STRINGARRAY
map<string,string> T_STRINGMAP
#our int types
FACTION_VALUE T_IV
EmuAppearance T_UV
SkillType T_UV
Mob::eStandingPetOrder T_IV
int32 T_UV
int16 T_UV
int8 T_UV
uint32 T_UV
uint16 T_UV
uint8 T_UV
sint32 T_IV
sint16 T_IV
sint8 T_IV
int * T_INTARRAY
unsigned long * T_INTARRAY
# basic C types
int T_IV
unsigned T_UV
unsigned int T_UV
long T_IV
unsigned long T_UV
unsigned long long T_UV
short T_IV
unsigned short T_UV
char T_CHAR
unsigned char T_U_CHAR
char * T_PV
unsigned char * T_PV
const char * T_PV
caddr_t T_PV
wchar_t * T_PV
wchar_t T_IV
# bool_t is defined in <rpc/rpc.h>
bool_t T_IV
size_t T_UV
ssize_t T_IV
time_t T_NV
unsigned long * T_OPAQUEPTR
char ** T_PACKEDARRAY
void * T_PTR
Time_t * T_PV
SV * T_SV
SVREF T_SVREF
AV * T_AVREF
HV * T_HVREF
CV * T_CVREF
IV T_IV
UV T_UV
NV T_NV
I32 T_IV
I16 T_IV
I8 T_IV
STRLEN T_UV
U32 T_U_LONG
U16 T_U_SHORT
U8 T_UV
Result T_U_CHAR
Boolean T_BOOL
float T_FLOAT
double T_DOUBLE
SysRet T_SYSRET
SysRetLong T_SYSRET
FILE * T_STDIO
PerlIO * T_INOUT
FileHandle T_PTROBJ
InputStream T_IN
InOutStream T_INOUT
OutputStream T_OUT
bool T_BOOL
#############################################################################
INPUT
T_SV
$var = $arg
T_SVREF
if (SvROK($arg))
$var = (SV*)SvRV($arg);
else
Perl_croak(aTHX_ \"$var is not a reference\");
T_AVREF
if (SvROK($arg) && SvTYPE(SvRV($arg))==SVt_PVAV)
$var = (AV*)SvRV($arg);
else
Perl_croak(aTHX_ \"$var is not an array reference\");
T_HVREF
if (SvROK($arg) && SvTYPE(SvRV($arg))==SVt_PVHV)
$var = (HV*)SvRV($arg);
else
Perl_croak(aTHX_ \"$var is not a hash reference\");
T_CVREF
if (SvROK($arg) && SvTYPE(SvRV($arg))==SVt_PVCV)
$var = (CV*)SvRV($arg);
else
Perl_croak(aTHX_ \"$var is not a code reference\");
T_SYSRET
$var NOT IMPLEMENTED
T_UV
$var = ($type)SvUV($arg)
T_IV
$var = ($type)SvIV($arg)
T_INT
$var = (int)SvIV($arg)
T_ENUM
$var = ($type)SvIV($arg)
T_BOOL
$var = (bool)SvTRUE($arg)
T_U_INT
$var = (unsigned int)SvUV($arg)
T_SHORT
$var = (short)SvIV($arg)
T_U_SHORT
$var = (unsigned short)SvUV($arg)
T_LONG
$var = (long)SvIV($arg)
T_U_LONG
$var = (unsigned long)SvUV($arg)
T_CHAR
$var = (char)*SvPV_nolen($arg)
T_U_CHAR
$var = (unsigned char)SvUV($arg)
T_FLOAT
$var = (float)SvNV($arg)
T_NV
$var = ($type)SvNV($arg)
T_DOUBLE
$var = (double)SvNV($arg)
T_PV
$var = ($type)SvPV_nolen($arg)
T_PTR
$var = INT2PTR($type,SvIV($arg))
T_PTRREF
if (SvROK($arg)) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = INT2PTR($type,tmp);
}
else
Perl_croak(aTHX_ \"$var is not a reference\");
if($var == NULL)
Perl_croak(aTHX_ \"$var is NULL, avoiding crash.\");
T_REF_IV_REF
if (sv_isa($arg, \"${ntype}\")) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = *INT2PTR($type *, tmp);
}
else
Perl_croak(aTHX_ \"$var is not of type ${ntype}\");
T_REF_IV_PTR
if (sv_isa($arg, \"${ntype}\")) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = INT2PTR($type, tmp);
}
else
Perl_croak(aTHX_ \"$var is not of type ${ntype}\");
if($var == NULL)
Perl_croak(aTHX_ \"$var is NULL, avoiding crash.\");
T_PTROBJ
if (sv_derived_from($arg, \"${ntype}\")) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = INT2PTR($type,tmp);
}
else
Perl_croak(aTHX_ \"$var is not of type ${ntype}\");
if($var == NULL)
Perl_croak(aTHX_ \"$var is NULL, avoiding crash.\");
T_PTRDESC
if (sv_isa($arg, \"${ntype}\")) {
IV tmp = SvIV((SV*)SvRV($arg));
${type}_desc = (\U${type}_DESC\E*) tmp;
$var = ${type}_desc->ptr;
}
else
Perl_croak(aTHX_ \"$var is not of type ${ntype}\");
if($var == NULL)
Perl_croak(aTHX_ \"$var is NULL, avoiding crash.\");
T_REFREF
if (SvROK($arg)) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = *INT2PTR($type,tmp);
}
else
Perl_croak(aTHX_ \"$var is not a reference\");
if($var == NULL)
Perl_croak(aTHX_ \"$var is NULL, avoiding crash.\");
T_REFOBJ
if (sv_isa($arg, \"${ntype}\")) {
IV tmp = SvIV((SV*)SvRV($arg));
$var = *INT2PTR($type,tmp);
}
else
Perl_croak(aTHX_ \"$var is not of type ${ntype}\");
if($var == NULL)
Perl_croak(aTHX_ \"$var is NULL, avoiding crash.\");
T_OPAQUE
$var = *($type *)SvPV_nolen($arg)
T_OPAQUEPTR
$var = ($type)SvPV_nolen($arg)
T_PACKED
$var = XS_unpack_$ntype($arg)
T_PACKEDARRAY
$var = XS_unpack_$ntype($arg)
T_CALLBACK
$var = make_perl_cb_$type($arg)
T_ARRAY
U32 ix_$var = $argoff;
$var = $ntype(items -= $argoff);
while (items--) {
DO_ARRAY_ELEM;
ix_$var++;
}
/* this is the number of elements in the array */
ix_$var -= $argoff
T_INTARRAY
AV *av_$var;
if (SvROK($arg) && SvTYPE(SvRV($arg))==SVt_PVAV)
av_$var = (AV*)SvRV($arg);
else
Perl_croak(aTHX_ \"$var is not an array reference\");
I32 len_$var = av_len(av_$var) + 1;
I32 ix_$var;
$var = new $ntype\[len_$var\];
for(ix_$var = 0; ix_$var < len_$var; ix_$var ++) {
SV **tmp = av_fetch(av_$var, ix_$var, 0);
if(tmp == NULL || *tmp == NULL) {
$var\[ix_$var\] = 0;
continue;
}
$var\[ix_$var\] = ($ntype)SvIV(*tmp);
}
T_STDIO
$var = PerlIO_findFILE(IoIFP(sv_2io($arg)))
T_IN
$var = IoIFP(sv_2io($arg))
T_INOUT
$var = IoIFP(sv_2io($arg))
T_OUT
$var = IoOFP(sv_2io($arg))
T_STRINGARRAY
$var NOT IMPLEMENTED
T_STRINGMAP
$var NOT IMPLEMENTED
#############################################################################
OUTPUT
T_SV
$arg = $var;
T_SVREF
$arg = newRV((SV*)$var);
T_AVREF
$arg = newRV((SV*)$var);
T_HVREF
$arg = newRV((SV*)$var);
T_CVREF
$arg = newRV((SV*)$var);
T_IV
sv_setiv($arg, (IV)$var);
T_UV
sv_setuv($arg, (UV)$var);
T_INT
sv_setiv($arg, (IV)$var);
T_SYSRET
if ($var != -1) {
if ($var == 0)
sv_setpvn($arg, "0 but true", 10);
else
sv_setiv($arg, (IV)$var);
}
T_ENUM
sv_setiv($arg, (IV)$var);
T_BOOL
$arg = boolSV($var);
T_U_INT
sv_setuv($arg, (UV)$var);
T_SHORT
sv_setiv($arg, (IV)$var);
T_U_SHORT
sv_setuv($arg, (UV)$var);
T_LONG
sv_setiv($arg, (IV)$var);
T_U_LONG
sv_setuv($arg, (UV)$var);
T_CHAR
sv_setpvn($arg, (char *)&$var, 1);
T_U_CHAR
sv_setuv($arg, (UV)$var);
T_FLOAT
sv_setnv($arg, (double)$var);
T_NV
sv_setnv($arg, (NV)$var);
T_DOUBLE
sv_setnv($arg, (double)$var);
T_PV
sv_setpv((SV*)$arg, $var);
T_PTR
sv_setiv($arg, PTR2IV($var));
T_PTRREF
sv_setref_pv($arg, Nullch, (void*)$var);
T_REF_IV_REF
sv_setref_pv($arg, \"${ntype}\", (void*)new $ntype($var));
T_REF_IV_PTR
sv_setref_pv($arg, \"${ntype}\", (void*)$var);
T_PTROBJ
sv_setref_pv($arg, \"${ntype}\", (void*)$var);
T_PTRDESC
sv_setref_pv($arg, \"${ntype}\", (void*)new\U${type}_DESC\E($var));
T_REFREF
NOT_IMPLEMENTED
T_REFOBJ
NOT IMPLEMENTED
T_OPAQUE
sv_setpvn($arg, (char *)&$var, sizeof($var));
T_OPAQUEPTR
sv_setpvn($arg, (char *)$var, sizeof(*$var));
T_PACKED
XS_pack_$ntype($arg, $var);
T_PACKEDARRAY
XS_pack_$ntype($arg, $var, count_$ntype);
T_DATAUNIT
sv_setpvn($arg, $var.chp(), $var.size());
T_CALLBACK
sv_setpvn($arg, $var.context.value().chp(),
$var.context.value().size());
T_ARRAY
{
U32 ix_$var;
EXTEND(SP,size_$var);
for (ix_$var = 0; ix_$var < size_$var; ix_$var++) {
ST(ix_$var) = sv_newmortal();
DO_ARRAY_ELEM
}
}
T_STDIO
{
GV *gv = newGVgen("$Package");
PerlIO *fp = PerlIO_importFILE($var,0);
if ( fp && do_open(gv, "+<&", 3, FALSE, 0, 0, fp) )
sv_setsv($arg, sv_bless(newRV((SV*)gv), gv_stashpv("$Package",1)));
else
$arg = &PL_sv_undef;
}
T_IN
{
GV *gv = newGVgen("$Package");
if ( do_open(gv, "<&", 2, FALSE, 0, 0, $var) )
sv_setsv($arg, sv_bless(newRV((SV*)gv), gv_stashpv("$Package",1)));
else
$arg = &PL_sv_undef;
}
T_INOUT
{
GV *gv = newGVgen("$Package");
if ( do_open(gv, "+<&", 3, FALSE, 0, 0, $var) )
sv_setsv($arg, sv_bless(newRV((SV*)gv), gv_stashpv("$Package",1)));
else
$arg = &PL_sv_undef;
}
T_OUT
{
GV *gv = newGVgen("$Package");
if ( do_open(gv, "+>&", 3, FALSE, 0, 0, $var) )
sv_setsv($arg, sv_bless(newRV((SV*)gv), gv_stashpv("$Package",1)));
else
$arg = &PL_sv_undef;
}
T_STRINGARRAY
{
U32 ix_$var;
/* pop crap off the stack we dont really want */
POPs;
POPs;
/* grow the stack to the number of elements being returned */
EXTEND(SP, $var.size());
for (ix_$var = 0; ix_$var < $var.size(); ix_$var++) {
const string &it = $var\[ix_$var\];
ST(ix_$var) = sv_newmortal();
sv_setpvn(ST(ix_$var), it.c_str(), it.length());
}
/* hackish, but im over it. The normal xsubpp return will be right below this */
XSRETURN($var.size());
}
T_STRINGMAP
if (RETVAL.begin()!=RETVAL.end())
{
//NOTE: we are leaking the original $arg right now
HV *hv = newHV();
sv_2mortal((SV*)hv);
$arg = newRV((SV*)hv);
map<string,string>::const_iterator cur, end;
cur = $var.begin();
end = $var.end();
for(; cur != end; cur++) {
/* get the element from the hash, creating if needed (will be needed) */
SV**ele = hv_fetch(hv, cur->first.c_str(), cur->first.length(), TRUE);
if(ele == NULL) {
Perl_croak(aTHX_ \"Unable to create a hash element for $var\");
break;
}
/* put our string in the SV associated with this element in the hash */
sv_setpvn(*ele, cur->second.c_str(), cur->second.length());
}
}
-177
View File
@@ -1,177 +0,0 @@
//BEGIN CLIENT METHODS
void SendSound();
bool Save(int8 iCommitNow);
void SaveBackup();
inline bool Connected();
inline bool InZone();
inline void Kick();
inline void Disconnect();
inline bool IsLD();
void WorldKick();
inline int8 GetAnon();
void Duck();
void Stand();
void SetGM(bool toggle);
void SetPVP(bool toggle);
inline bool GetPVP();
inline bool GetGM();
inline void SetBaseClass(uint32 i);
inline void SetBaseRace(uint32 i);
inline void SetBaseGender(uint32 i);
inline int8 GetBaseFace();
inline int8 GetLanguageSkill(int16 n);
inline Const_char * GetLastName();
inline int32 GetLDoNPoints();
inline int8 GetBaseSTR();
inline int8 GetBaseSTA();
inline int8 GetBaseCHA();
inline int8 GetBaseDEX();
inline int8 GetBaseINT();
inline int8 GetBaseAGI();
inline int8 GetBaseWIS();
int16 GetWeight();
inline uint32 GetEXP();
bool UpdateLDoNPoints(sint32 points, int32 theme);
inline void SetDeity(uint32 i);
void AddEXP(uint32 add_exp, int8 conlevel = 0xFF, bool resexp = false);
void SetEXP(uint32 set_exp, uint32 set_aaxp, bool resexp=false);
void SetBindPoint(int to_zone = -1, float new_x = 0.0f, float new_y = 0.0f, float new_z = 0.0f);
void MovePC(int32 zoneID, float x, float y, float z, float heading);
void ChangeLastName(const char* in_lastname);
FACTION_VALUE GetFactionLevel(int32 char_id, int32 npc_id, int32 p_race, int32 p_class, int32 p_deity, sint32 pFaction, Mob* tnpc);
void SetFactionLevel(int32 char_id, int32 npc_id, int8 char_class, int8 char_race, int8 char_deity);
void SetFactionLevel2(int32 char_id, sint32 faction_id, int8 char_class, int8 char_race, int8 char_deity, sint32 value);
sint16 GetRawItemAC();
inline int32 AccountID();
inline Const_char * AccountName();
inline sint16 Admin();
inline int32 CharacterID();
void UpdateAdmin(bool iFromDB = true);
void UpdateWho(int8 remove = 0);
inline int8 GuildRank();
inline int32 GuildID();
int8 GetFace();
bool TakeMoneyFromPP(uint32 copper);
void AddMoneyToPP(uint32 copper, uint32 silver, uint32 gold,uint32 platinum,bool updateclient);
bool TGB() {return tgb;}
int16 GetSkillPoints() {return m_pp.points;}
void SetSkillPoints(int inp) {m_pp.points = inp;}
void IncreaseSkill(int skill_id, int value = 1) { if (skill_id <= HIGHEST_SKILL) { m_pp.skills[skill_id] += value; } }
void IncreaseLanguageSkill(int skill_id, int value = 1) { if (skill_id < 26) { m_pp.languages[skill_id] += value; } }
virtual uint16 GetSkill(SkillType skill_id) const { if (skill_id <= HIGHEST_SKILL) { return((itembonuses.skillmod[skill_id] > 0)? m_pp.skills[skill_id]*(100 + itembonuses.skillmod[skill_id])/100 : m_pp.skills[skill_id]); } return 0; }
uint32 GetRawSkill(SkillType skill_id) const { if (skill_id <= HIGHEST_SKILL) { return(m_pp.skills[skill_id]); } return 0; }
bool HasSkill(SkillType skill_id) const;
bool CanHaveSkill(SkillType skill_id) const;
void SetSkill(SkillType skill_num, int8 value); // socket 12-29-01
void AddSkill(SkillType skillid, int8 value);
void CheckSpecializeIncrease(int16 spell_id);
bool CheckIncreaseSkill(SkillType skillid, int chancemodi = 0);
void SetLanguageSkill(int langid, int value);
int8 MaxSkill(SkillType skillid);
void GMKill();
inline bool IsMedding();
inline int16 GetDuelTarget();
inline bool IsDueling();
inline void SetDuelTarget(int16 set_id);
inline void SetDueling(bool duel);
void ResetAA();
void MemSpell(int16 spell_id, int slot, bool update_client = true);
void UnmemSpell(int slot, bool update_client = true);
void UnmemSpellAll(bool update_client = true);
void ScribeSpell(int16 spell_id, int slot, bool update_client = true);
void UnscribeSpell(int slot, bool update_client = true);
void UnscribeSpellAll(bool update_client = true);
inline bool IsSitting();
inline bool IsBecomeNPC();
inline int8 GetBecomeNPCLevel();
inline void SetBecomeNPC(bool flag);
inline void SetBecomeNPCLevel(int8 level);
bool LootToStack(uint32 itemid);
void SetFeigned(bool in_feigned);
inline bool GetFeigned();
inline bool AutoSplitEnabled();
void SetHorseId(int16 horseid_in);
int16 GetHorseId();
uint32 NukeItem(uint32 itemnum);
void SetTint(sint16 slot_id, uint32 color);
void SetMaterial(sint16 slot_id, uint32 item_id);
void Undye();
uint32 GetItemIDAt(sint16 slot_id);
void DeleteItemInInventory(sint16 slot_id, sint8 quantity = 0, bool client_update = false);
void SummonItem(uint32 item_id, sint8 charges = 0);
void SetStats(int8 type,sint16 increase_val);
void IncStats(int8 type,sint16 increase_val);
void DropItem(sint16 slot_id);
void BreakInvis();
Group* GetGroup();
void LeaveGroup();
bool Hungry();
bool Thirsty();
int16 GetInstrumentMod(int16 spell_id);
bool DecreaseByID(int32 type, int8 amt);
int8 SlotConvert2(int8 slot);
void Escape();
void RemoveNoRent();
void RangedAttack(Mob* other);
void ThrowingAttack(Mob* other);
void GoFish();
void ForageItem();
float CalcPriceMod(Mob* other = 0, bool reverse = false);
void ResetTrade();
bool UseDiscipline(int32 spell_id, int32 target);
sint32 GetCharacterFactionLevel(sint32 faction_id);
void SetZoneFlag(uint32 zone_id);
void ClearZoneFlag(uint32 zone_id);
bool HasZoneFlag(uint32 zone_id) const;
void SendZoneFlagInfo(Client *to) const;
void LoadZoneFlags();
void SetAATitle(const char *txt);
//TODO: inventory and ptimers interfaces
//I think there are two GetAA methods in client
-36
View File
@@ -1,36 +0,0 @@
/* 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
*/
#include "features.h"
#ifdef EMBPERL_XS_CLASSES
#include "../common/debug.h"
#include "embperl.h"
#include "client.h"
#ifdef THIS /* this macro seems to leak out on some systems */
#undef THIS
#endif
MODULE = Client PACKAGE = Client
PROTOTYPES: ENABLE
-44
View File
@@ -1,44 +0,0 @@
#!/bin/sh
if [ ! -r "$1" -o -z "$2" ]; then
echo "Usage: $0 headerfile classname"
fi
name=`basename "$1" .h`
name="perl_${name}"
echo "Starting conversion of $2" >&2
{
cat "$1.xs"
cat "$1" \
| sed -e 's/inline//g' -e 's/const//g' -e 's/virtual//g' \
-e 's/{.*}/;/g' -e 's#//.*$##g' \
-e 's/(void)/()/g' \
| tr -d '[&;]' \
| perl -p -e "s/^\\s+(.+)[ \\t]([a-zA-Z0-9_]*)\\(/&\$1&$2::\$2(/g" \
| tr '&' '\n'
} > tmp
{
xsubpp -typemap class.typemap tmp \
| sed -e "s/\"$2::/\"/g" \
-e 's/("\([a-zA-Z0-9_]*\)"/(strcpy(buf, "\1")/g' \
-e 's/ / /g' -e 's/ / /g' \
-e 's#char\* file = __FILE__;#char file[256];^ strncpy(file, __FILE__, 256);^ file[255] = '\0';^ ^ if(items != 1)^ fprintf(stderr, "boot_quest does not take any arguments.");^ char buf[128];^^ //add the strcpy stuff to get rid of const warnings....^^#g' \
-e 's/Ptr//g' \
-e 's/Mob__e/Mob::e/g' \
| tr '^' '\n' \
| grep -v "^#line"
echo "#endif //EMBPERL_XS_CLASSES"
echo
} > "$name.cpp"
#rm -f tmp
-62
View File
@@ -1,62 +0,0 @@
Mob* GetMobID(int16 id);
Mob* GetMob(const char* name);
Mob* GetMobByNpcTypeID(int32 get_id);
Client* GetClientByName(const char *name);
Client* GetClientByAccID(int32 accid);
Client* GetClientByID(int16 id);
Client* GetClientByCharID(int32 iCharID);
Client* GetClientByWID(int32 iWID);
Group* GetGroupByMob(Mob* mob);
Group* GetGroupByClient(Client* client);
Group* GetGroupByID(int32 id);
Group* GetGroupByLeaderName(char* leader);
Corpse* GetCorpseByOwner(Client* client);
Corpse* GetCorpseByID(int16 id);
Corpse* GetCorpseByName(char* name);
void ClearClientPetitionQueue();
bool CanAddHateForMob(Mob *p);
void Clear();
bool RemoveMob(int16 delete_id);
bool RemoveClient(int16 delete_id);
bool RemoveNPC(int16 delete_id);
bool RemoveGroup(int32 delete_id);
bool RemoveCorpse(int16 delete_id);
bool RemoveDoor(int16 delete_id);
bool RemoveTrap(int16 delete_id);
bool RemoveObject(int16 delete_id);
void RemoveAllMobs();
void RemoveAllClients();
void RemoveAllNPCs();
void RemoveAllGroups();
void RemoveAllCorpses();
void RemoveAllDoors();
void RemoveAllTraps();
void RemoveAllObjects();
void Message(int32 to_guilddbid, int32 type, const char* message, ...);
void MessageStatus(int32 to_guilddbid, int to_minstatus, int32 type, const char* message, ...);
void MessageClose(Mob* sender, bool skipsender, float dist, int32 type, const char* message, ...);
void RemoveFromTargets(Mob* mob);
void ReplaceWithTarget(Mob* pOldMob, Mob*pNewTarget);
void OpenDoorsNear(NPC* opener);
char* MakeNameUnique(char* name);
static char* RemoveNumbers(char* name);
// signal quest command support
void SignalMobsByNPCID(int32 npc_type, int signal_id);
void RemoveEntity(int16 id);
sint32 DeleteNPCCorpses();
sint32 DeletePlayerCorpses();
void HalveAggro(Mob* who);
void DoubleAggro(Mob* who);
void ClearFeignAggro(Mob* targ);
bool Fighting(Mob* targ);
void RemoveFromHateLists(Mob* mob, bool settoone = false);
void MessageGroup(Mob* sender, bool skipclose, int32 type, const char* message, ...);
-37
View File
@@ -1,37 +0,0 @@
/* 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
*/
#include "features.h"
#ifdef EMBPERL_XS_CLASSES
#include "../common/debug.h"
#include "embperl.h"
#include "entity.h"
#ifdef THIS /* this macro seems to leak out on some systems */
#undef THIS
#endif
MODULE = EntityList PACKAGE = EntityList
PROTOTYPES: ENABLE
-12
View File
@@ -1,12 +0,0 @@
#!/bin/sh
FROM="$1"
TO="$2"
if [ ! -r "$1" -o -z "$2" ]; then
echo "Usage: $0 [src] [dest]"
fi
grep -A100000 "BEGIN PERL EXPORT" "$FROM" \
| grep -B 100000 "END PERL EXPORT" \
| grep -v "PERL EXPORT" >"$TO"
-17
View File
@@ -1,17 +0,0 @@
void DisbandGroup();
bool IsGroupMember(Mob* client);
void CastGroupSpell(Mob* caster,uint16 spellid);
void SplitExp(uint32 exp, Mob* other);
void GroupMessage(Mob* sender,const char* message);
int32 GetTotalGroupDamage(Mob* other);
void SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum);
void SetLeader(Mob* newleader){ leader=newleader; };
Mob* GetLeader(){ return leader; };
char* GetLeaderName(){ return membername[0]; };
void SendHPPacketsTo(Mob* newmember);
void SendHPPacketsFrom(Mob* newmember);
bool IsLeader(Mob* leadertest) { return leadertest==leader; };
int8 GroupCount();
int32 GetHighestLevel();
void TeleportGroup(Mob* sender, int32 zoneID, float x, float y, float z, float heading);
inline const int32 GetID() const { return id; }
-37
View File
@@ -1,37 +0,0 @@
/* 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
*/
#include "features.h"
#ifdef EMBPERL_XS_CLASSES
#include "../common/debug.h"
#include "embperl.h"
#include "groups.h"
#ifdef THIS /* this macro seems to leak out on some systems */
#undef THIS
#endif
MODULE = Group PACKAGE = Group
PROTOTYPES: ENABLE
-249
View File
@@ -1,249 +0,0 @@
//BEGIN ENTITY METHODS
virtual bool IsClient() { return false; }
virtual bool IsNPC() { return false; }
virtual bool IsMob() { return false; }
virtual bool IsCorpse() { return false; }
virtual bool IsPlayerCorpse() { return false; }
virtual bool IsNPCCorpse() { return false; }
virtual bool IsObject() { return false; }
// virtual bool IsGroup() { return false; }
virtual bool IsDoor() { return false; }
virtual bool IsTrap() { return false; }
virtual bool IsBeacon() { return false; }
Client* CastToClient();
NPC* CastToNPC();
Mob* CastToMob();
Corpse* CastToCorpse();
// Object* CastToObject();
// Group* CastToGroup();
// Doors* CastToDoors();
// Trap* CastToTrap();
// Beacon* CastToBeacon();
//BEGIN MOB METHODS
int16& GetID();
virtual Const_char * GetName();
void Depop(bool StartSpawnTimer = true);
void RogueAssassinate(Mob* other);
bool BehindMob(Mob* other = 0, float playerx = 0.0f, float playery = 0.0f);
void SetLevel(uint8 in_level, bool command = false);
uint32 GetSkill(SkillType skill_num);
void SendWearChange(int8 material_slot);
sint32 GetEquipment(int8 material_slot); // returns item id
sint32 GetEquipmentMaterial(int8 material_slot);
sint32 GetEquipmentColor(int8 material_slot);
bool IsMoving();
void GoToBind();
void Gate();
bool Attack(Mob* other, int Hand = 13, bool FromRiposte = false)
virtual void Damage(Mob* from, sint32 damage, int16 spell_id, SkillType attack_skill, bool avoidable = true, sint8 buffslot = -1, bool iBuffTic = false) {};
void Heal();
void SetMaxHP();
int32 GetLevelCon(int8 iOtherLevel);
void SetHP(sint32 hp);
void DoAnim(const int animnum, int type=1);
void ChangeSize(float in_size, bool bNoRestriction = false);
void GMMove(float x, float y, float z, float heading = 0.01);
void SendPosUpdate(int8 iSendToSelf = 0);
void SendPosition();
bool HasProcs();
//bool CheckLos(Mob* other);
bool IsInvisible(Mob *other = 0);
void SetInvisible(bool state);
bool FindBuff(int16 spellid);
bool FindType(int8 type, bool bOffensive = false, int16 threshold = 100);
sint8 GetBuffSlotFromType(int8 type);
void MakePet(int16 spell_id, const char* pettype, const char *name=NULL);
virtual inline int16 GetBaseRace();
virtual inline int8 GetBaseGender();
virtual inline int8 GetDeity();
inline const int16& GetRace();
inline const int8& GetGender();
inline const int8& GetTexture();
inline const int8& GetHelmTexture();
inline const int8& GetClass();
inline const uint8& GetLevel();
Const_char * GetCleanName();
inline Mob* GetTarget();
virtual inline void SetTarget(Mob* mob);
virtual inline float GetHPRatio();
bool IsWarriorClass();
virtual inline const sint32& GetHP();
virtual inline const sint32& GetMaxHP();
virtual float GetWalkspeed();
virtual float GetRunspeed();
virtual int GetCasterLevel(int16 spell_id);
virtual inline const sint32& GetMaxMana();
virtual inline const sint32& GetMana();
virtual void SetMana(sint32 amount);
virtual inline float GetManaRatio();
inline virtual int16 GetAC();
inline virtual int16 GetATK();
inline virtual sint16 GetSTR();
inline virtual sint16 GetSTA();
inline virtual sint16 GetDEX();
inline virtual sint16 GetAGI();
inline virtual sint16 GetINT();
inline virtual sint16 GetWIS();
inline virtual sint16 GetCHA();
inline virtual sint16 GetMR();
inline virtual sint16 GetFR();
inline virtual sint16 GetDR();
inline virtual sint16 GetPR();
inline virtual sint16 GetCR();
inline virtual sint16 GetMaxSTR();
inline virtual sint16 GetMaxSTA();
inline virtual sint16 GetMaxDEX();
inline virtual sint16 GetMaxAGI();
inline virtual sint16 GetMaxINT();
inline virtual sint16 GetMaxWIS();
inline virtual sint16 GetMaxCHA();
virtual float GetActSpellRange(int16 spell_id, float range);
virtual sint32 GetActSpellDamage(int16 spell_id, sint32 value);
virtual sint32 GetActSpellHealing(int16 spell_id, sint32 value);
virtual sint32 GetActSpellCost(int16 spell_id, sint32 cost);
virtual sint32 GetActSpellDuration(int16 spell_id, sint32 duration);
virtual sint32 GetActSpellCasttime(int16 spell_id, sint32 casttime);
double ResistSpell(uint8 ressit_type, int16 spell_id, Mob *caster);
uint16 GetSpecializeSkillValue(int16 spell_id) const;
int32 GetNPCTypeID();
bool IsTargeted();
inline const float& GetX();
inline const float& GetY();
inline const float& GetZ();
inline const float& GetHeading();
inline const float& GetSize();
void SetFollowID(int32 id);
int32 GetFollowID();
virtual void Message(int32 type, const char* message, ...);
virtual void MessageString(int32 type, int32 string_id, int32 distance = 0);
void Say(const char *format, ...);
void Shout(const char *format, ...);
void Emote(const char *format, ...);
void InterruptSpell(int16 spellid = 0xFFFF);
virtual void CastSpell(int16 spell_id, int16 target_id, int16 slot = 10, sint32 casttime = -1, sint32 mana_cost = -1);
bool IsImmuneToSpell(int16 spell_id, Mob *caster);
void BuffFadeBySpellID(int16 spell_id);
void BuffFadeByEffect(int effectid, int skipslot = -1);
void BuffFadeAll();
void BuffFadeBySlot(int slot, bool iRecalcBonuses = true);
int CanBuffStack(int16 spellid, int8 caster_level, bool iFailIfOverwrite = false);
inline bool IsCasting();
int16 CastingSpellID();
void SetAppearance(EmuAppearance app, bool iIgnoreSelf = true);
inline EmuAppearance GetAppearance();
inline const int8& GetRunAnimSpeed();
inline void SetRunAnimSpeed(sint8 in);
void SetPetID(int16 NewPetID);
inline const int16& GetPetID();
void SetOwnerID(int16 NewOwnerID);
inline const int16& GetOwnerID();
inline const int16& GetPetType();
inline const int8& GetBodyType();
virtual void Stun(int duration);
void Spin();
void Kill();
inline void SetInvul(bool invul);
inline bool GetInvul();
inline void SetExtraHaste(int Haste);
virtual int GetHaste();
int GetMonkHandToHandDamage(void);
bool CanThisClassDoubleAttack(void);
bool CanThisClassDualWield(void);
bool CanThisClassRiposte(void);
bool CanThisClassDodge(void);
bool CanThisClassParry(void);
int GetMonkHandToHandDelay(void);
int8 GetClassLevelFactor();
void Mesmerize();
inline bool IsMezzed();
inline bool IsStunned();
void StartEnrage();
bool IsEnraged();
FACTION_VALUE GetReverseFactionCon(Mob* iOther);
inline const bool& IsAIControlled();
inline const float& GetAggroRange();
inline const float& GetAssistRange();
inline void SetPetOrder(Mob::eStandingPetOrder i);
inline const Mob::eStandingPetOrder& GetPetOrder();
inline const bool& IsRoamer();
inline const bool IsRooted();
void AddToHateList(Mob* other, sint32 hate = 0, sint32 damage = 0, bool iYellForHelp = true, bool bFrenzy = false, bool iBuffTic = false);
void SetHate(Mob* other, sint32 hate = 0, sint32 damage = 0);
int32 GetHateAmount(Mob* tmob, bool is_dam = false);
int32 GetDamageAmount(Mob* tmob);
Mob* GetHateTop();
Mob* GetHateDamageTop(Mob* other);
Mob* GetHateRandom();
bool IsEngaged();
bool HateSummon();
void FaceTarget(Mob* MobToFace = 0, bool update = false);
void SetHeading(float iHeading);
void WipeHateList();
inline bool CheckAggro(Mob* other);
sint8 CalculateHeadingToTarget(float in_x, float in_y);
bool CalculateNewPosition(float x, float y, float z, float speed, bool checkZ = false);
bool CalculateNewPosition2(float x, float y, float z, float speed, bool checkZ = false);
float CalculateDistance(float x, float y, float z);
void SendTo(float new_x, float new_y, float new_z);
void SendToFixZ(float new_x, float new_y, float new_z);
void NPCSpecialAttacks(const char* parse, int permtag);
inline int32& DontHealMeBefore();
inline int32& DontBuffMeBefore();
inline int32& DontDotMeBefore();
inline int32& DontRootMeBefore();
inline int32& DontSnareMeBefore();
sint16 GetResist(int8 type);
Mob* GetShieldTarget();
void SetShieldTarget(Mob* mob);
bool Charmed();
int32 GetLevelHP(int8 tlevel);
int32 GetZoneID() const;
int16 CheckAggroAmount(int16 spellid);
int16 CheckHealAggroAmount(int16 spellid);
virtual int32 GetAA(int32 aa_id);
bool DivineAura();
void AddFeignMemory(Client* attacker);
void RemoveFromFeignMemory(Client* attacker);
void ClearFeignMemory();
//END MOB METHODS
-39
View File
@@ -1,39 +0,0 @@
/* 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
*/
#include "features.h"
#ifdef EMBPERL_XS_CLASSES
#include "../common/debug.h"
#include "embperl.h"
typedef const char Const_char;
#include "mob.h"
#ifdef THIS /* this macro seems to leak out on some systems */
#undef THIS
#endif
MODULE = Mob PACKAGE = Mob
PROTOTYPES: ENABLE
-63
View File
@@ -1,63 +0,0 @@
void SignalNPC(int _signal_id);
FACTION_VALUE CheckNPCFactionAlly(sint32 other_faction);
void AddItem(int32 itemid, int8 charges, int8 slot = 0);
void AddLootTable();
void RemoveItem(uint16 item_id, int16 quantity = 0, int16 slot = 0);
void ClearItemList();
void AddCash(int16 in_copper, int16 in_silver, int16 in_gold, int16 in_platinum);
void RemoveCash();
int32 CountLoot();
inline int32 GetLoottableID() { return loottable_id; }
inline uint32 GetCopper() { return copper; }
inline uint32 GetSilver() { return silver; }
inline uint32 GetGold() { return gold; }
inline uint32 GetPlatinum() { return platinum; }
inline void SetCopper(uint32 amt) { copper = amt; }
inline void SetSilver(uint32 amt) { silver = amt; }
inline void SetGold(uint32 amt) { gold = amt; }
inline void SetPlatinum(uint32 amt) { platinum = amt; }
void SetGrid(int16 grid_){ grid=grid_; }
void SetSp2(int32 sg2){ spawn_group=sg2; }
int16 GetWaypointMax(){ return wp_m; }
sint16 GetGrid(){ return grid; }
int32 GetSp2(){ return spawn_group; }
inline const sint32& GetNPCFactionID() { return npc_faction_id; }
inline sint32 GetPrimaryFaction() { return primary_faction; }
sint32 GetNPCHate(Mob* in_ent) {return hate_list.GetEntHate(in_ent);}
bool IsOnHatelist(Mob*p) { return hate_list.IsOnHateList(p);}
void SetNPCFactionID(sint32 in) { npc_faction_id = in; database.GetFactionIdsForNPC(npc_faction_id, &faction_list, &primary_faction); }
int16 GetMaxDMG() {return max_dmg;}
bool IsAnimal() { return(bodytype == 21); }
int16 GetPetSpellID() {return pet_spell_id;}
void SetPetSpellID(int16 amt) {pet_spell_id = amt;}
int32 GetMaxDamage(int8 tlevel);
void SetTaunting(bool tog) {taunting = tog;}
void PickPocket(Client* thief);
void StartSwarmTimer(int32 duration) { swarm_timer.Start(duration); }
void DoClassAttacks(Mob *target);
int GetMaxWp() const { return max_wp; }
void DisplayWaypointInfo(Client *to);
void CalculateNewWaypoint();
// int8 CalculateHeadingToNextWaypoint();
// float CalculateDistanceToNextWaypoint();
void AssignWaypoints(int32 grid);
void SetWaypointPause();
void UpdateWaypoint(int wp_index);
// quest wandering commands
void StopWandering();
void ResumeWandering();
void PauseWandering(int pausetime);
void MoveTo(float mtx, float mty, float mtz, float mth, bool saveguardspot);
void NextGuardPosition();
void SaveGuardSpot(bool iClearGuardSpot = false);
inline bool IsGuarding() const { return(guard_heading != 0); }
void AI_SetRoambox(float iDist, float iMaxX, float iMinX, float iMaxY, float iMinY, int32 iDelay = 2500);
const int32& GetNPCSpellsID();
-39
View File
@@ -1,39 +0,0 @@
/* 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
*/
#include "features.h"
#ifdef EMBPERL_XS_CLASSES
#include "../common/debug.h"
#include "embperl.h"
typedef const char Const_char;
#include "npc.h"
#ifdef THIS /* this macro seems to leak out on some systems */
#undef THIS
#endif
MODULE = NPC PACKAGE = NPC
PROTOTYPES: ENABLE
-28
View File
@@ -1,28 +0,0 @@
PerlPacket *
PerlPacket::new(const char *opcode = "OP_Unknown", uint32 len = 0);
void DESTROY();
bool SetOpcode(const char *opcode);
void Resize(uint32 len);
//sending functions
void SendTo(Client *who);
void SendToAll();
//editing
void Zero();
void FromArray(int *numbers, uint32 length);
void SetByte(uint32 pos, uint8 val);
void SetShort(uint32 pos, uint16 val);
void SetLong(uint32 pos, uint32 val);
void SetFloat(uint32 pos, float val);
void SetString(uint32 pos, char *str);
void SetEQ1319(uint32 pos, float part13, float part19);
void SetEQ1913(uint32 pos, float part19, float part13);
//reading
uint8 GetByte(uint32 pos);
uint16 GetShort(uint32 pos);
uint32 GetLong(uint32 pos);
float GetFloat(uint32 pos);
-36
View File
@@ -1,36 +0,0 @@
/* 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
*/
#include "features.h"
#ifdef EMBPERL_XS_CLASSES
#include "../common/debug.h"
#include "embperl.h"
#include "perlpacket.h"
#ifdef THIS /* this macro seems to leak out on some systems */
#undef THIS
#endif
MODULE = PerlPacket PACKAGE = PerlPacket
PROTOTYPES: ENABLE
-10
View File
@@ -1,10 +0,0 @@
#!/bin/sh
cp perl_PlayerCorpse.cpp perl_client.cpp perl_entity.cpp perl_groups.cpp \
perl_mob.cpp perl_npc.cpp perl_perlpacket.cpp \
../../zone/
cp perl_EQW.cpp perl_HTTPRequest.cpp perl_EQLConfig.cpp ../../world/
cp perl_EQDB.cpp perl_EQDBRes.cpp ../../common/
@@ -585,7 +585,8 @@ sub translate_mysql_data_type_to_c {
sub get_reserved_cpp_variable_names {
return (
"class",
"int"
"int",
"key"
);
}
+4
View File
@@ -476,6 +476,10 @@
9220|2022_12_19_player_events_tables.sql|SHOW TABLES LIKE 'player_event_logs'|empty|
9221|2023_02_24_npc_scaling_zone_id_instance_version.sql|SHOW COLUMNS FROM `npc_scale_global_base` LIKE 'zone_id'|empty|
9222|2023_02_28_npc_scaling_zone_list_version_list.sql|SHOW COLUMNS FROM `npc_scale_global_base` LIKE 'zone_id_list'|empty|
9223|2023_03_04_npc_scale_global_base_heroic_strikethrough.sql|SHOW COLUMNS FROM `npc_scale_global_base` LIKE 'heroic_strikethrough'|empty|
9224|2023_03_08_npc_scale_global_base_avoidance.sql|SHOW COLUMNS FROM `npc_scale_global_base` LIKE 'hp_regen_per_second'|empty|
9225|2023_01_21_bots_raid_members.sql|SHOW COLUMNS FROM `raid_members` LIKE 'bot_id'|empty|
9226|2023_03_17_corpse_fields.sql|SHOW COLUMNS FROM `character_corpse_items` LIKE 'custom_data'|empty|
# Upgrade conditions:
# This won't be needed after this system is implemented, but it is used database that are not
@@ -0,0 +1,4 @@
DROP INDEX IF EXISTS `PRIMARY` ON `raid_members`;
CREATE UNIQUE INDEX IF NOT EXISTS `UNIQUE` ON `raid_members`(`name`);
ALTER TABLE `raid_members` ADD COLUMN `bot_id` int(4) NOT NULL DEFAULT 0 AFTER `charid`;
ALTER TABLE `raid_members` ADD COLUMN `id` BIGINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT FIRST;
@@ -1,5 +1,5 @@
ALTER TABLE `npc_scale_global_base`
CHANGE COLUMN `zone_id` `zone_id_list` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 0 AFTER `level`,
CHANGE COLUMN `instance_version` `instance_version_list` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 0 AFTER `zone_id_list`,
CHANGE COLUMN `zone_id` `zone_id_list` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL AFTER `level`,
CHANGE COLUMN `instance_version` `instance_version_list` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL AFTER `zone_id_list`,
DROP PRIMARY KEY,
ADD PRIMARY KEY (`type`, `level`, `zone_id_list`(255), `instance_version_list`(255)) USING BTREE;
@@ -0,0 +1,55 @@
UPDATE `npc_scale_global_base` SET ac = 0 WHERE ac IS NULL;
UPDATE `npc_scale_global_base` SET hp = 0 WHERE hp IS NULL;
UPDATE `npc_scale_global_base` SET accuracy = 0 WHERE accuracy IS NULL;
UPDATE `npc_scale_global_base` SET slow_mitigation = 0 WHERE slow_mitigation IS NULL;
UPDATE `npc_scale_global_base` SET attack = 0 WHERE attack IS NULL;
UPDATE `npc_scale_global_base` SET strength = 0 WHERE strength IS NULL;
UPDATE `npc_scale_global_base` SET stamina = 0 WHERE stamina IS NULL;
UPDATE `npc_scale_global_base` SET dexterity = 0 WHERE dexterity IS NULL;
UPDATE `npc_scale_global_base` SET agility = 0 WHERE agility IS NULL;
UPDATE `npc_scale_global_base` SET intelligence = 0 WHERE intelligence IS NULL;
UPDATE `npc_scale_global_base` SET wisdom = 0 WHERE wisdom IS NULL;
UPDATE `npc_scale_global_base` SET charisma = 0 WHERE charisma IS NULL;
UPDATE `npc_scale_global_base` SET magic_resist = 0 WHERE magic_resist IS NULL;
UPDATE `npc_scale_global_base` SET cold_resist = 0 WHERE cold_resist IS NULL;
UPDATE `npc_scale_global_base` SET fire_resist = 0 WHERE fire_resist IS NULL;
UPDATE `npc_scale_global_base` SET poison_resist = 0 WHERE poison_resist IS NULL;
UPDATE `npc_scale_global_base` SET disease_resist = 0 WHERE disease_resist IS NULL;
UPDATE `npc_scale_global_base` SET corruption_resist = 0 WHERE corruption_resist IS NULL;
UPDATE `npc_scale_global_base` SET physical_resist = 0 WHERE physical_resist IS NULL;
UPDATE `npc_scale_global_base` SET min_dmg = 0 WHERE min_dmg IS NULL;
UPDATE `npc_scale_global_base` SET max_dmg = 0 WHERE max_dmg IS NULL;
UPDATE `npc_scale_global_base` SET hp_regen_rate = 0 WHERE hp_regen_rate IS NULL;
UPDATE `npc_scale_global_base` SET attack_delay = 0 WHERE attack_delay IS NULL;
UPDATE `npc_scale_global_base` SET physical_resist = 0 WHERE physical_resist IS NULL;
UPDATE `npc_scale_global_base` SET spell_scale = 100 WHERE spell_scale IS NULL;
UPDATE `npc_scale_global_base` SET heal_scale = 100 WHERE heal_scale IS NULL;
UPDATE `npc_scale_global_base` SET special_abilities = '' WHERE special_abilities IS NULL;
ALTER TABLE `npc_scale_global_base`
MODIFY COLUMN `ac` int(11) NOT NULL DEFAULT 0 AFTER `instance_version_list`,
MODIFY COLUMN `hp` int(11) NOT NULL DEFAULT 0 AFTER `ac`,
MODIFY COLUMN `accuracy` int(11) NOT NULL DEFAULT 0 AFTER `hp`,
MODIFY COLUMN `slow_mitigation` int(11) NOT NULL DEFAULT 0 AFTER `accuracy`,
MODIFY COLUMN `attack` int(11) NOT NULL DEFAULT 0 AFTER `slow_mitigation`,
MODIFY COLUMN `strength` int(11) NOT NULL DEFAULT 0 AFTER `attack`,
MODIFY COLUMN `stamina` int(11) NOT NULL DEFAULT 0 AFTER `strength`,
MODIFY COLUMN `dexterity` int(11) NOT NULL DEFAULT 0 AFTER `stamina`,
MODIFY COLUMN `agility` int(11) NOT NULL DEFAULT 0 AFTER `dexterity`,
MODIFY COLUMN `intelligence` int(11) NOT NULL DEFAULT 0 AFTER `agility`,
MODIFY COLUMN `wisdom` int(11) NOT NULL DEFAULT 0 AFTER `intelligence`,
MODIFY COLUMN `charisma` int(11) NOT NULL DEFAULT 0 AFTER `wisdom`,
MODIFY COLUMN `magic_resist` int(11) NOT NULL DEFAULT 0 AFTER `charisma`,
MODIFY COLUMN `cold_resist` int(11) NOT NULL DEFAULT 0 AFTER `magic_resist`,
MODIFY COLUMN `fire_resist` int(11) NOT NULL DEFAULT 0 AFTER `cold_resist`,
MODIFY COLUMN `poison_resist` int(11) NOT NULL DEFAULT 0 AFTER `fire_resist`,
MODIFY COLUMN `disease_resist` int(11) NOT NULL DEFAULT 0 AFTER `poison_resist`,
MODIFY COLUMN `corruption_resist` int(11) NOT NULL DEFAULT 0 AFTER `disease_resist`,
MODIFY COLUMN `physical_resist` int(11) NOT NULL DEFAULT 0 AFTER `corruption_resist`,
MODIFY COLUMN `min_dmg` int(11) NOT NULL DEFAULT 0 AFTER `physical_resist`,
MODIFY COLUMN `max_dmg` int(11) NOT NULL DEFAULT 0 AFTER `min_dmg`,
MODIFY COLUMN `hp_regen_rate` int(11) NOT NULL DEFAULT 0 AFTER `max_dmg`,
MODIFY COLUMN `attack_delay` int(11) NOT NULL DEFAULT 0 AFTER `hp_regen_rate`,
MODIFY COLUMN `spell_scale` int(11) NOT NULL DEFAULT 100 AFTER `attack_delay`,
MODIFY COLUMN `heal_scale` int(11) NOT NULL DEFAULT 100 AFTER `spell_scale`,
MODIFY COLUMN `special_abilities` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '' AFTER `heal_scale`,
ADD COLUMN `heroic_strikethrough` int(11) NOT NULL DEFAULT 0 AFTER `heal_scale`;
@@ -0,0 +1,5 @@
ALTER TABLE `npc_scale_global_base`
MODIFY COLUMN `hp` bigint(20) NOT NULL DEFAULT 0 AFTER `ac`,
MODIFY COLUMN `hp_regen_rate` bigint(20) NOT NULL DEFAULT 0 AFTER `max_dmg`,
ADD COLUMN `hp_regen_per_second` bigint(20) NOT NULL DEFAULT 0 AFTER `hp_regen_rate`,
ADD COLUMN `avoidance` int(11) unsigned NOT NULL DEFAULT 0 AFTER `heal_scale`;
@@ -0,0 +1,5 @@
ALTER TABLE `character_corpse_items`
ADD COLUMN `custom_data` TEXT NULL AFTER `attuned`,
ADD COLUMN `ornamenticon` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `custom_data`,
ADD COLUMN `ornamentidfile` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `ornamenticon`,
ADD COLUMN `ornament_hero_model` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `ornamentidfile`;
-4
View File
@@ -28,8 +28,6 @@
#include "../common/eq_packet_structs.h"
#include "cliententry.h"
#define CLIENT_TIMEOUT 30000
class EQApplicationPacket;
class EQStreamInterface;
@@ -101,9 +99,7 @@ private:
ClientListEntry* cle;
Timer connect;
bool firstlogin;
bool seen_character_select;
bool realfirstlogin;
bool HandlePacket(const EQApplicationPacket *app);
bool HandleNameApprovalPacket(const EQApplicationPacket *app);
+4 -9
View File
@@ -120,8 +120,9 @@ ClientListEntry::~ClientListEntry()
Camp(); // updates zoneserver's numplayers
client_list.RemoveCLEReferances(this);
}
for (auto &elem : tell_queue)
for (auto& elem : tell_queue) {
safe_delete_array(elem);
}
tell_queue.clear();
}
@@ -131,13 +132,6 @@ void ClientListEntry::SetChar(uint32 iCharID, const char *iCharName)
strn0cpy(pname, iCharName, sizeof(pname));
}
void ClientListEntry::SetOnline(ZoneServer *iZS, CLE_Status iOnline)
{
if (iZS == Server()) {
SetOnline(iOnline);
}
}
void ClientListEntry::SetOnline(CLE_Status iOnline)
{
LogClientLogin(
@@ -289,8 +283,9 @@ void ClientListEntry::ClearVars(bool iAll)
pLFG = 0;
gm = 0;
pClientVersion = 0;
for (auto &elem : tell_queue)
for (auto& elem : tell_queue) {
safe_delete_array(elem);
}
tell_queue.clear();
}
-4
View File
@@ -68,9 +68,6 @@ public:
void LSUpdate(ZoneServer* zoneserver);
void LSZoneChange(ZoneToZone_Struct* ztz);
bool CheckAuth(uint32 loginserver_account_id, const char* key_password);
bool CheckAuth(const char* iName, MD5& iMD5Password);
bool CheckAuth(uint32 id, const char* key, uint32 ip);
void SetOnline(ZoneServer* iZS, CLE_Status iOnline);
void SetOnline(CLE_Status iOnline = CLE_Status::Online);
void SetChar(uint32 iCharID, const char* iCharName);
inline CLE_Status Online() { return pOnline; }
@@ -149,7 +146,6 @@ private:
// Account stuff
uint32 paccountid;
char paccountname[32]{};
MD5 pMD5Pass;
int16 padmin{};
// Character info
-103
View File
@@ -85,19 +85,6 @@ void ClientList::CLERemoveZSRef(ZoneServer* iZS) {
}
}
ClientListEntry* ClientList::GetCLE(uint32 iID) {
LinkedListIterator<ClientListEntry*> iterator(clientlist);
iterator.Reset();
while(iterator.MoreElements()) {
if (iterator.GetData()->GetID() == iID) {
return iterator.GetData();
}
iterator.Advance();
}
return 0;
}
//Check current CLE Entry IPs against incoming connection
void ClientList::GetCLEIP(uint32 in_ip) {
@@ -207,31 +194,6 @@ void ClientList::GetCLEIP(uint32 in_ip) {
}
}
uint32 ClientList::GetCLEIPCount(uint32 in_ip) {
ClientListEntry* cle = nullptr;
LinkedListIterator<ClientListEntry*> iterator(clientlist);
int count = 0;
iterator.Reset();
while (iterator.MoreElements()) {
cle = iterator.GetData();
if (
cle->GetIP() == in_ip &&
(
cle->Admin() < RuleI(World, ExemptMaxClientsStatus) ||
RuleI(World, ExemptMaxClientsStatus) < 0
) &&
cle->Online() >= CLE_Status::Online
) { // If the IP matches, and the connection admin status is below the exempt status, or exempt status is less than 0 (no-one is exempt)
count++; // Increment the occurences of this IP address
}
iterator.Advance();
}
return count;
}
void ClientList::DisconnectByIP(uint32 in_ip) {
ClientListEntry* cle = nullptr;
LinkedListIterator<ClientListEntry*> iterator(clientlist);
@@ -296,19 +258,6 @@ ClientListEntry* ClientList::FindCLEByCharacterID(uint32 iCharID) {
return nullptr;
}
ClientListEntry* ClientList::FindCLEByLSID(uint32 iLSID) {
LinkedListIterator<ClientListEntry*> iterator(clientlist);
iterator.Reset();
while (iterator.MoreElements()) {
if (iterator.GetData()->LSID() == iLSID) {
return iterator.GetData();
}
iterator.Advance();
}
return nullptr;
}
void ClientList::SendCLEList(const int16& admin, const char* to, WorldTCPConnection* connection, const char* iName) {
LinkedListIterator<ClientListEntry*> iterator(clientlist);
int x = 0, y = 0;
@@ -1224,20 +1173,6 @@ Client* ClientList::FindByAccountID(uint32 account_id) {
return 0;
}
Client* ClientList::FindByName(char* charname) {
LinkedListIterator<Client*> iterator(list);
iterator.Reset();
while(iterator.MoreElements()) {
if (iterator.GetData()->GetCharName() == charname) {
Client* tmp = iterator.GetData();
return tmp;
}
iterator.Advance();
}
return 0;
}
Client* ClientList::Get(uint32 ip, uint16 port) {
LinkedListIterator<Client*> iterator(list);
@@ -1315,29 +1250,6 @@ bool ClientList::SendPacket(const char* to, ServerPacket* pack) {
return false;
}
void ClientList::SendGuildPacket(uint32 guild_id, ServerPacket* pack) {
std::set<uint32> zone_ids;
LinkedListIterator<ClientListEntry*> iterator(clientlist);
iterator.Reset();
while(iterator.MoreElements()) {
if (iterator.GetData()->GuildID() == guild_id) {
zone_ids.insert(iterator.GetData()->zone());
}
iterator.Advance();
}
//now we know all the zones, send it to each one... this is kinda a shitty way to do this
//since its basically O(n^2)
std::set<uint32>::iterator cur, end;
cur = zone_ids.begin();
end = zone_ids.end();
for(; cur != end; cur++) {
zoneserver_list.SendPacket(*cur, pack);
}
}
void ClientList::UpdateClientGuild(uint32 char_id, uint32 guild_id) {
LinkedListIterator<ClientListEntry*> iterator(clientlist);
@@ -1351,21 +1263,6 @@ void ClientList::UpdateClientGuild(uint32 char_id, uint32 guild_id) {
}
}
void ClientList::RemoveCLEByLSID(uint32 iLSID)
{
LinkedListIterator<ClientListEntry *> iterator(clientlist);
iterator.Reset();
while (iterator.MoreElements()) {
if (iterator.GetData()->LSAccountID() == iLSID) {
iterator.RemoveCurrent();
}
else {
iterator.Advance();
}
}
}
bool ClientList::IsAccountInGame(uint32 iLSID) {
LinkedListIterator<ClientListEntry*> iterator(clientlist);
iterator.Reset();
-6
View File
@@ -30,7 +30,6 @@ public:
void Add(Client* client);
Client* Get(uint32 ip, uint16 port);
Client* FindByAccountID(uint32 account_id);
Client* FindByName(char* charname);
void ZoneBootup(ZoneServer* zs);
void RemoveCLEReferances(ClientListEntry* cle);
@@ -47,7 +46,6 @@ public:
void SendCLEList(const int16& admin, const char* to, WorldTCPConnection* connection, const char* iName = 0);
bool SendPacket(const char* to, ServerPacket* pack);
void SendGuildPacket(uint32 guild_id, ServerPacket* pack);
void ClientUpdate(ZoneServer* zoneserver, ServerClientList_Struct* scl);
void CLERemoveZSRef(ZoneServer* iZS);
@@ -55,16 +53,12 @@ public:
ClientListEntry* FindCharacter(const char* name);
ClientListEntry* FindCLEByAccountID(uint32 iAccID);
ClientListEntry* FindCLEByCharacterID(uint32 iCharID);
ClientListEntry* FindCLEByLSID(uint32 iLSID);
ClientListEntry* GetCLE(uint32 iID);
void GetCLEIP(uint32 in_ip);
uint32 GetCLEIPCount(uint32 iLSAccountID);
void DisconnectByIP(uint32 in_ip);
void CLCheckStale();
void CLEKeepAlive(uint32 numupdates, uint32* wid);
void CLEAdd(uint32 iLSID, const char* iLoginServerName, const char* iLoginName, const char* iLoginKey, int16 iWorldAdmin = AccountStatus::Player, uint32 ip = 0, uint8 local=0);
void UpdateClientGuild(uint32 char_id, uint32 guild_id);
void RemoveCLEByLSID(uint32 iLSID);
bool IsAccountInGame(uint32 iLSID);
int GetClientCount();
-902
View File
@@ -1,902 +0,0 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
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
*/
#include "../common/global_define.h"
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include "../common/version.h"
#include "console.h"
#include "zoneserver.h"
#include "worlddb.h"
#include "../common/packet_dump.h"
#include "../common/seperator.h"
#include "../common/eq_packet_structs.h"
#include "../common/eq_packet.h"
#include "login_server.h"
#include "login_server_list.h"
#include "../common/serverinfo.h"
#include "../common/md5.h"
#include "../common/opcodemgr.h"
#include "../common/rulesys.h"
#include "../common/ruletypes.h"
#include "../common/strings.h"
#include "world_config.h"
#include "zoneserver.h"
#include "zonelist.h"
#include "clientlist.h"
#include "launcher_list.h"
#include "ucs.h"
#include "queryserv.h"
#ifdef _WINDOWS
#define snprintf _snprintf
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
#endif
extern ZSList zoneserver_list;
extern uint32 numzones;
extern LoginServerList loginserverlist;
extern ClientList client_list;
extern LauncherList launcher_list;
extern UCSConnection UCSLink;
extern QueryServConnection QSLink;
extern volatile bool RunLoops;
ConsoleList console_list;
void CatchSignal(int sig_num);
Console::Console(EmuTCPConnection* itcpc)
: WorldTCPConnection(),
timeout_timer(RuleI(Console, SessionTimeOut)),
prompt_timer(1)
{
tcpc = itcpc;
tcpc->SetEcho(true);
state = 0;
paccountid = 0;
memset(paccountname, 0, sizeof(paccountname));
admin = 0;
pAcceptMessages = false;
}
Console::~Console() {
if (tcpc)
tcpc->Free();
}
void Console::Die() {
state = CONSOLE_STATE_CLOSED;
struct in_addr in;
in.s_addr = GetIP();
LogInfo("Removing console from [{}]:[{}]",inet_ntoa(in),GetPort());
tcpc->Disconnect();
}
bool Console::SendChannelMessage(const ServerChannelMessage_Struct* scm) {
if (!pAcceptMessages)
return false;
switch (scm->chan_num) {
if(RuleB(Chat, ServerWideAuction)){
case 4: {
SendMessage(1, "%s auctions, '%s'", scm->from, scm->message);
break;
}
}
if(RuleB(Chat, ServerWideOOC)){
case 5: {
SendMessage(1, "%s says ooc, '%s'", scm->from, scm->message);
break;
}
}
case 6: {
SendMessage(1, "%s BROADCASTS, '%s'", scm->from, scm->message);
break;
}
case 7: {
SendMessage(1, "[%s] tells you, '%s'", scm->from, scm->message);
auto pack = new ServerPacket(ServerOP_ChannelMessage,
sizeof(ServerChannelMessage_Struct) + strlen(scm->message) + 1);
memcpy(pack->pBuffer, scm, pack->size);
ServerChannelMessage_Struct* scm2 = (ServerChannelMessage_Struct*) pack->pBuffer;
strcpy(scm2->deliverto, scm2->from);
scm2->noreply = true;
client_list.SendPacket(scm->from, pack);
safe_delete(pack);
break;
}
case 11: {
SendMessage(1, "%s GMSAYS, '%s'", scm->from, scm->message);
break;
}
default: {
return false;
}
}
return true;
}
bool Console::SendEmoteMessage(uint32 type, const char* message, ...) {
if (!message)
return false;
if (!pAcceptMessages)
return false;
va_list argptr;
char buffer[1024];
va_start(argptr, message);
vsnprintf(buffer, sizeof(buffer), message, argptr);
va_end(argptr);
SendMessage(1, message);
return true;
}
bool Console::SendEmoteMessageRaw(uint32 type, const char* message) {
if (!message)
return false;
if (!pAcceptMessages)
return false;
SendMessage(1, message);
return true;
}
void Console::SendEmoteMessage(const char* to, uint32 to_guilddbid, int16 to_minstatus, uint32 type, const char* message, ...) {
if (!message)
return;
if (to_guilddbid != 0 || to_minstatus > Admin())
return;
va_list argptr;
char buffer[1024];
va_start(argptr, message);
vsnprintf(buffer, sizeof(buffer), message, argptr);
va_end(argptr);
SendEmoteMessageRaw(to, to_guilddbid, to_minstatus, type, buffer);
}
void Console::SendEmoteMessageRaw(const char* to, uint32 to_guilddbid, int16 to_minstatus, uint32 type, const char* message) {
if (!message)
return;
if (to_guilddbid != 0 || to_minstatus > Admin())
return;
SendMessage(1, message);
}
void Console::SendMessage(uint8 newline, const char* message, ...) {
if (!message)
return;
char* buffer = 0;
uint32 bufsize = 1500;
if (message)
bufsize += strlen(message);
buffer = new char[bufsize];
memset(buffer, 0, bufsize);
if (message != 0) {
va_list argptr;
va_start(argptr, message);
vsnprintf(buffer, bufsize - 512, message, argptr);
va_end(argptr);
}
if (newline) {
char outbuf[3];
outbuf[0] = 13;
outbuf[1] = 10;
outbuf[2] = 0;
for (int i=0; i < newline; i++)
strcat(buffer, outbuf);
}
tcpc->Send((uchar*) buffer, strlen(buffer));
safe_delete_array(buffer);
}
bool Console::Process() {
if (state == CONSOLE_STATE_CLOSED)
return false;
if (!tcpc->Connected()) {
struct in_addr in;
in.s_addr = GetIP();
LogInfo("Removing console (!tcpc->Connected) from [{}]:[{}]",inet_ntoa(in),GetPort());
return false;
}
//if we have not gotten the special markers after this timer, send login prompt
if(prompt_timer.Check()) {
struct in_addr in;
in.s_addr = GetIP();
std::string connecting_ip = inet_ntoa(in);
SendMessage(2, StringFormat("Establishing connection from IP: %s Port: %d", inet_ntoa(in), GetPort()).c_str());
if (connecting_ip.find("127.0.0.1") != std::string::npos) {
SendMessage(2, StringFormat("Connecting established from local host, auto assuming admin").c_str());
state = CONSOLE_STATE_CONNECTED;
tcpc->SetEcho(false);
admin = 255;
SendPrompt();
}
else {
if (tcpc->GetMode() == EmuTCPConnection::modeConsole)
tcpc->Send((const uchar*) "Username: ", strlen("Username: "));
}
prompt_timer.Disable();
}
if (timeout_timer.Check()) {
SendMessage(1, 0);
SendMessage(1, "Timeout, disconnecting...");
struct in_addr in;
in.s_addr = GetIP();
LogInfo("TCP connection timeout from [{}]:[{}]",inet_ntoa(in),GetPort());
return false;
}
if (tcpc->GetMode() == EmuTCPConnection::modePacket) {
struct in_addr in;
in.s_addr = GetIP();
if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeZone) {
auto zs = new ZoneServer(tcpc);
LogInfo("New zoneserver #[{}] from [{}]:[{}]", zs->GetID(), inet_ntoa(in), GetPort());
zoneserver_list.Add(zs);
numzones++;
tcpc = 0;
} else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeLauncher) {
LogInfo("New launcher from [{}]:[{}]", inet_ntoa(in), GetPort());
launcher_list.Add(tcpc);
tcpc = 0;
}
else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeUCS)
{
LogInfo("New UCS Connection from [{}]:[{}]", inet_ntoa(in), GetPort());
UCSLink.SetConnection(tcpc);
tcpc = 0;
}
else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeQueryServ)
{
LogInfo("New QS Connection from [{}]:[{}]", inet_ntoa(in), GetPort());
QSLink.SetConnection(tcpc);
tcpc = 0;
}
else {
LogInfo("Unsupported packet mode from [{}]:[{}]", inet_ntoa(in), GetPort());
}
return false;
}
char* command = 0;
while ((command = tcpc->PopLine())) {
timeout_timer.Start();
ProcessCommand(command);
delete command;
}
return true;
}
void ConsoleList::Add(Console* con) {
list.Insert(con);
}
void ConsoleList::Process() {
LinkedListIterator<Console*> iterator(list);
iterator.Reset();
while(iterator.MoreElements()) {
if (!iterator.GetData()->Process())
iterator.RemoveCurrent();
else
iterator.Advance();
}
}
void ConsoleList::KillAll() {
LinkedListIterator<Console*> iterator(list);
iterator.Reset();
while(iterator.MoreElements()) {
iterator.GetData()->Die();
iterator.RemoveCurrent();
}
}
void ConsoleList::SendConsoleWho(WorldTCPConnection* connection, const char* to, int16 admin, char** output, uint32* outsize, uint32* outlen) {
LinkedListIterator<Console*> iterator(list);
iterator.Reset();
struct in_addr in;
int x = 0;
while(iterator.MoreElements()) {
in.s_addr = iterator.GetData()->GetIP();
if (admin >= iterator.GetData()->Admin())
AppendAnyLenString(output, outsize, outlen, " Console: %s:%i AccID: %i AccName: %s", inet_ntoa(in), iterator.GetData()->GetPort(), iterator.GetData()->AccountID(), iterator.GetData()->AccountName());
else
AppendAnyLenString(output, outsize, outlen, " Console: AccID: %i AccName: %s", iterator.GetData()->AccountID(), iterator.GetData()->AccountName());
if (*outlen >= 3584) {
connection->SendEmoteMessageRaw(to, 0, 0, 10, *output);
safe_delete(*output);
*outsize = 0;
*outlen = 0;
}
else {
if (connection->IsConsole())
AppendAnyLenString(output, outsize, outlen, "\r\n");
else
AppendAnyLenString(output, outsize, outlen, "\n");
}
x++;
iterator.Advance();
}
AppendAnyLenString(output, outsize, outlen, "%i consoles connected", x);
}
void ConsoleList::SendChannelMessage(const ServerChannelMessage_Struct* scm) {
LinkedListIterator<Console*> iterator(list);
iterator.Reset();
while(iterator.MoreElements()) {
iterator.GetData()->SendChannelMessage(scm);
iterator.Advance();
}
}
void ConsoleList::SendEmoteMessage(uint32 type, const char* message, ...) {
va_list argptr;
char buffer[1024];
va_start(argptr, message);
vsnprintf(buffer, sizeof(buffer), message, argptr);
va_end(argptr);
SendEmoteMessageRaw(type, buffer);
}
void ConsoleList::SendEmoteMessageRaw(uint32 type, const char* message) {
LinkedListIterator<Console*> iterator(list);
iterator.Reset();
while(iterator.MoreElements()) {
iterator.GetData()->SendEmoteMessageRaw(type, message);
iterator.Advance();
}
}
Console* ConsoleList::FindByAccountName(const char* accname) {
LinkedListIterator<Console*> iterator(list);
iterator.Reset();
while(iterator.MoreElements()) {
if (strcasecmp(iterator.GetData()->AccountName(), accname) == 0)
return iterator.GetData();
iterator.Advance();
}
return 0;
}
void Console::ProcessCommand(const char* command) {
switch(state)
{
case CONSOLE_STATE_USERNAME:
{
if (strlen(command) >= 16) {
SendMessage(1, 0);
SendMessage(2, "Username buffer overflow.");
SendMessage(1, "Bye Bye.");
state = CONSOLE_STATE_CLOSED;
return;
}
strcpy(paccountname, command);
state = CONSOLE_STATE_PASSWORD;
SendMessage(0, "Password: ");
tcpc->SetEcho(false);
break;
}
case CONSOLE_STATE_PASSWORD:
{
if (strlen(command) >= 16) {
SendMessage(1, 0);
SendMessage(2, "Password buffer overflow.");
SendMessage(1, "Bye Bye.");
state = CONSOLE_STATE_CLOSED;
return;
}
paccountid = database.CheckLogin(paccountname ,command);
if (paccountid == 0) {
SendMessage(1, 0);
SendMessage(2, "Login failed.");
SendMessage(1, "Bye Bye.");
state = CONSOLE_STATE_CLOSED;
return;
}
database.GetAccountName(paccountid, paccountname); // fixes case and stuff
admin = database.CheckStatus(paccountid);
if (!(admin >= consoleLoginStatus)) {
SendMessage(1, 0);
SendMessage(2, "Access denied.");
SendMessage(1, "Bye Bye.");
state = CONSOLE_STATE_CLOSED;
return;
}
LogInfo("TCP console authenticated: Username=[{}], Admin=[{}]",paccountname,admin);
SendMessage(1, 0);
SendMessage(2, "Login accepted.");
state = CONSOLE_STATE_CONNECTED;
tcpc->SetEcho(true);
SendPrompt();
break;
}
case CONSOLE_STATE_CONNECTED: {
Log(Logs::Detail, Logs::World_Server,"TCP command: %s: \"%s\"",paccountname ,command);
Seperator sep(command);
if (strcasecmp(sep.arg[0], "help") == 0 || strcmp(sep.arg[0], "?") == 0) {
SendMessage(1, " whoami");
SendMessage(1, " who");
SendMessage(1, " zonestatus");
SendMessage(1, " uptime [zoneID#]");
SendMessage(1, " emote [zonename or charname or world] [type] [message]");
SendMessage(1, " echo [on/off]");
SendMessage(1, " acceptmessages [on/off]");
SendMessage(1, " tell [name] [message]");
SendMessage(1, " broadcast [message]");
SendMessage(1, " gmsay [message]");
SendMessage(1, " ooc [message]");
SendMessage(1, " auction [message]");
if (admin >= consoleKickStatus)
SendMessage(1, " kick [charname]");
if (admin >= consoleLockStatus)
SendMessage(1, " lock/unlock");
if (admin >= consoleZoneStatus) {
SendMessage(1, " zoneshutdown [zonename or ZoneServerID]");
SendMessage(1, " zonebootup [ZoneServerID] [zonename]");
SendMessage(1, " zonelock [list|lock|unlock] [zonename]");
}
if (admin >= consoleFlagStatus)
SendMessage(1, " flag [status] [accountname]");
if (admin >= consolePassStatus)
SendMessage(1, " setpass [accountname] [newpass]");
if (admin >= consoleWorldStatus) {
SendMessage(1, " version");
SendMessage(1, " worldshutdown");
}
if (admin >= AccountStatus::GMMgmt) {
SendMessage(1, " IPLookup [name]");
}
if (admin >= AccountStatus::GMAdmin) {
SendMessage(1, " LSReconnect");
SendMessage(1, " signalcharbyname charname ID");
SendMessage(1, " reloadworld");
}
}
else if (strcasecmp(sep.arg[0], "ping") == 0) {
// do nothing
}
else if (strcasecmp(sep.arg[0], "signalcharbyname") == 0) {
SendMessage(1, "Signal Sent to %s with ID %i", (char*) sep.arg[1], Strings::ToInt(sep.arg[2]));
uint32 message_len = strlen((char*) sep.arg[1]) + 1;
auto pack = new ServerPacket(ServerOP_CZSignalClientByName,
sizeof(CZClientSignalByName_Struct) + message_len);
CZClientSignalByName_Struct* CZSC = (CZClientSignalByName_Struct*) pack->pBuffer;
strn0cpy(CZSC->Name, (char*) sep.arg[1], 64);
CZSC->data = Strings::ToInt(sep.arg[2]);
zoneserver_list.SendPacket(pack);
safe_delete(pack);
}
else if (strcasecmp(sep.arg[0], "setpass") == 0 && admin >= consolePassStatus) {
if (sep.argnum != 2)
SendMessage(1, "Format: setpass accountname password");
else {
int16 tmpstatus = 0;
uint32 tmpid = database.GetAccountIDByName(sep.arg[1], &tmpstatus);
if (!tmpid)
SendMessage(1, "Error: Account not found");
else if (tmpstatus > admin)
SendMessage(1, "Cannot change password: Account's status is higher than yours");
else if (database.SetLocalPassword(tmpid, sep.arg[2]))
SendMessage(1, "Password changed.");
else
SendMessage(1, "Error changing password.");
}
}
else if (strcasecmp(sep.arg[0], "uptime") == 0) {
if (sep.IsNumber(1) && Strings::ToInt(sep.arg[1]) > 0) {
auto pack = new ServerPacket(ServerOP_Uptime, sizeof(ServerUptime_Struct));
ServerUptime_Struct* sus = (ServerUptime_Struct*) pack->pBuffer;
snprintf(sus->adminname, sizeof(sus->adminname), "*%s", GetName());
sus->zoneserverid = Strings::ToInt(sep.arg[1]);
ZoneServer* zs = zoneserver_list.FindByID(sus->zoneserverid);
if (zs)
zs->SendPacket(pack);
else
SendMessage(1, "Zoneserver not found.");
delete pack;
}
else {
ZSList::ShowUpTime(this);
}
}
else if (strcasecmp(sep.arg[0], "md5") == 0) {
uint8 md5[16];
MD5::Generate((const uchar*) sep.argplus[1], strlen(sep.argplus[1]), md5);
SendMessage(1, "MD5: %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", md5[0], md5[1], md5[2], md5[3], md5[4], md5[5], md5[6], md5[7], md5[8], md5[9], md5[10], md5[11], md5[12], md5[13], md5[14], md5[15]);
}
else if (strcasecmp(sep.arg[0], "whoami") == 0) {
SendMessage(1, "You are logged in as '%s'", AccountName());
SendMessage(1, "You are known as '*%s'", AccountName());
SendMessage(1, "AccessLevel: %d", Admin());
}
else if (strcasecmp(sep.arg[0], "echo") == 0) {
if (strcasecmp(sep.arg[1], "on") == 0)
tcpc->SetEcho(true);
else if (strcasecmp(sep.arg[1], "off") == 0) {
if (pAcceptMessages)
SendMessage(1, "Echo can not be turned off while acceptmessages is on");
else
tcpc->SetEcho(false);
}
else
SendMessage(1, "Usage: echo [on/off]");
}
else if (strcasecmp(sep.arg[0], "acceptmessages") == 0) {
if (strcasecmp(sep.arg[1], "on") == 0)
if (tcpc->GetEcho())
SendMessage(1, "AcceptMessages can not be turned on while echo is on");
else
pAcceptMessages = true;
else if (strcasecmp(sep.arg[1], "off") == 0)
pAcceptMessages = false;
else
SendMessage(1, "Usage: acceptmessages [on/off]");
}
else if (strcasecmp(sep.arg[0], "tell") == 0) {
char tmpname[64];
tmpname[0] = '*';
strcpy(&tmpname[1], paccountname);
zoneserver_list.SendChannelMessage(tmpname, sep.arg[1], 7, 0, sep.argplus[2]);
}
else if (strcasecmp(sep.arg[0], "broadcast") == 0) {
char tmpname[64];
tmpname[0] = '*';
strcpy(&tmpname[1], paccountname);
zoneserver_list.SendChannelMessage(tmpname, 0, 6, 0, sep.argplus[1]);
}
else if (strcasecmp(sep.arg[0], "ooc") == 0) {
char tmpname[64];
tmpname[0] = '*';
strcpy(&tmpname[1], paccountname);
zoneserver_list.SendChannelMessage(tmpname, 0, 5, 0, sep.argplus[1]);
}
else if (strcasecmp(sep.arg[0], "auction") == 0) {
char tmpname[64];
tmpname[0] = '*';
strcpy(&tmpname[1], paccountname);
zoneserver_list.SendChannelMessage(tmpname, 0, 4, 0, sep.argplus[1]);
}
else if (strcasecmp(sep.arg[0], "gmsay") == 0 || strcasecmp(sep.arg[0], "pr") == 0) {
char tmpname[64];
tmpname[0] = '*';
strcpy(&tmpname[1], paccountname);
zoneserver_list.SendChannelMessage(tmpname, 0, 11, 0, sep.argplus[1]);
}
else if (strcasecmp(sep.arg[0], "emote") == 0) {
if (strcasecmp(sep.arg[1], "world") == 0)
zoneserver_list.SendEmoteMessageRaw(0, 0, 0, Strings::ToInt(sep.arg[2]), sep.argplus[3]);
else {
ZoneServer* zs = zoneserver_list.FindByName(sep.arg[1]);
if (zs != 0)
zs->SendEmoteMessageRaw(0, 0, 0, Strings::ToInt(sep.arg[2]), sep.argplus[3]);
else
zoneserver_list.SendEmoteMessageRaw(sep.arg[1], 0, 0, Strings::ToInt(sep.arg[2]), sep.argplus[3]);
}
}
else if (strcasecmp(sep.arg[0], "movechar") == 0) {
if(sep.arg[1][0]==0 || sep.arg[2][0] == 0)
SendMessage(1, "Usage: movechar [charactername] [zonename]");
else {
if (!ZoneID(sep.arg[2]))
SendMessage(1, "Error: Zone '%s' not found", sep.arg[2]);
else if (!database.CheckUsedName((char*) sep.arg[1])) {
if (!database.MoveCharacterToZone((char*) sep.arg[1], (char*) sep.arg[2]))
SendMessage(1, "Character Move Failed!");
else
SendMessage(1, "Character has been moved.");
}
else
SendMessage(1, "Character Does Not Exist");
}
}
else if (strcasecmp(sep.arg[0], "flag") == 0 && Admin() >= consoleFlagStatus) {
// SCORPIOUS2K - reversed parameter order for flag
if(sep.arg[2][0]==0 || !sep.IsNumber(1))
SendMessage(1, "Usage: flag [status] [accountname]");
else
{
if (Strings::ToInt(sep.arg[1]) > Admin())
SendMessage(1, "You cannot set people's status to higher than your own");
else if (Strings::ToInt(sep.arg[1]) < 0 && Admin() < consoleFlagStatus)
SendMessage(1, "You have too low of status to change flags");
else if (!database.SetAccountStatus(sep.arg[2], Strings::ToInt(sep.arg[1])))
SendMessage(1, "Unable to flag account!");
else
SendMessage(1, "Account Flaged");
}
}
else if (strcasecmp(sep.arg[0], "kick") == 0 && admin >= consoleKickStatus) {
char tmpname[64];
tmpname[0] = '*';
strcpy(&tmpname[1], paccountname);
auto pack = new ServerPacket;
pack->opcode = ServerOP_KickPlayer;
pack->size = sizeof(ServerKickPlayer_Struct);
pack->pBuffer = new uchar[pack->size];
ServerKickPlayer_Struct* skp = (ServerKickPlayer_Struct*) pack->pBuffer;
strcpy(skp->adminname, tmpname);
strcpy(skp->name, sep.arg[1]);
skp->adminrank = Admin();
zoneserver_list.SendPacket(pack);
delete pack;
}
else if (strcasecmp(sep.arg[0], "who") == 0) {
auto whom = new Who_All_Struct;
memset(whom, 0, sizeof(Who_All_Struct));
whom->lvllow = 0xFFFF;
whom->lvlhigh = 0xFFFF;
whom->wclass = 0xFFFF;
whom->wrace = 0xFFFF;
whom->gmlookup = 0xFFFF;
for (int i=1; i<=sep.argnum; i++) {
if (strcasecmp(sep.arg[i], "gm") == 0)
whom->gmlookup = 1;
else if (sep.IsNumber(i)) {
if (whom->lvllow == 0xFFFF) {
whom->lvllow = Strings::ToInt(sep.arg[i]);
whom->lvlhigh = whom->lvllow;
}
else if (Strings::ToInt(sep.arg[i]) > int(whom->lvllow))
whom->lvlhigh = Strings::ToInt(sep.arg[i]);
else
whom->lvllow = Strings::ToInt(sep.arg[i]);
}
else
strn0cpy(whom->whom, sep.arg[i], sizeof(whom->whom));
}
client_list.ConsoleSendWhoAll(0, admin, whom, this);
delete whom;
}
else if (strcasecmp(sep.arg[0], "zonestatus") == 0) {
zoneserver_list.SendZoneStatus(0, admin, this);
}
else if (strcasecmp(sep.arg[0], "exit") == 0 || strcasecmp(sep.arg[0], "quit") == 0) {
SendMessage(1, "Bye Bye.");
state = CONSOLE_STATE_CLOSED;
}
else if (strcasecmp(sep.arg[0], "zoneshutdown") == 0 && admin >= consoleZoneStatus) {
if (sep.arg[1][0] == 0) {
SendMessage(1, "Usage: zoneshutdown zoneshortname");
} else {
char tmpname[64];
tmpname[0] = '*';
strcpy(&tmpname[1], paccountname);
auto pack = new ServerPacket;
pack->size = sizeof(ServerZoneStateChange_struct);
pack->pBuffer = new uchar[pack->size];
memset(pack->pBuffer, 0, sizeof(ServerZoneStateChange_struct));
ServerZoneStateChange_struct* s = (ServerZoneStateChange_struct *) pack->pBuffer;
pack->opcode = ServerOP_ZoneShutdown;
strcpy(s->adminname, tmpname);
if (sep.arg[1][0] >= '0' && sep.arg[1][0] <= '9')
s->ZoneServerID = Strings::ToInt(sep.arg[1]);
else
s->zoneid = ZoneID(sep.arg[1]);
ZoneServer* zs = 0;
if (s->ZoneServerID != 0)
zs = zoneserver_list.FindByID(s->ZoneServerID);
else if (s->zoneid != 0)
zs = zoneserver_list.FindByName(ZoneName(s->zoneid));
else
SendMessage(1, "Error: ZoneShutdown: neither ID nor name specified");
if (zs == 0)
SendMessage(1, "Error: ZoneShutdown: zoneserver not found");
else
zs->SendPacket(pack);
delete pack;
}
}
else if (strcasecmp(sep.arg[0], "zonebootup") == 0 && admin >= consoleZoneStatus) {
if (sep.arg[2][0] == 0 || !sep.IsNumber(1)) {
SendMessage(1, "Usage: zonebootup ZoneServerID# zoneshortname");
} else {
char tmpname[64];
tmpname[0] = '*';
strcpy(&tmpname[1], paccountname);
LogInfo("Console ZoneBootup: [{}], [{}], [{}]",tmpname,sep.arg[2],sep.arg[1]);
zoneserver_list.SOPZoneBootup(tmpname, Strings::ToInt(sep.arg[1]), sep.arg[2], (bool) (strcasecmp(sep.arg[3], "static") == 0));
}
}
else if (strcasecmp(sep.arg[0], "worldshutdown") == 0 && admin >= consoleWorldStatus) {
int32 time, interval;
if(sep.IsNumber(1) && sep.IsNumber(2) && ((time=Strings::ToInt(sep.arg[1]))>0) && ((interval=Strings::ToInt(sep.arg[2]))>0)) {
zoneserver_list.WorldShutDown(time, interval);
}
else if(strcasecmp(sep.arg[1], "now") == 0) {
zoneserver_list.WorldShutDown(0, 0);
}
else if(strcasecmp(sep.arg[1], "disable") == 0) {
SendEmoteMessage(
0,
0,
0,
Chat::Yellow,
"[SYSTEM] World shutdown has been aborted."
);
zoneserver_list.SendEmoteMessage(
0,
0,
0,
Chat::Yellow,
"[SYSTEM] World shutdown has been aborted."
);
zoneserver_list.shutdowntimer->Disable();
zoneserver_list.reminder->Disable();
}
else {
SendMessage(1, "Usage: worldshutdown [now] [disable] ([time] [interval])");
//Go ahead and shut down since that's what this used to do when invoked this way.
zoneserver_list.WorldShutDown(0, 0);
}
}
else if (strcasecmp(sep.arg[0], "lock") == 0 && admin >= consoleLockStatus) {
WorldConfig::LockWorld();
if (loginserverlist.Connected()) {
loginserverlist.SendStatus();
SendMessage(1, "World locked.");
}
else {
SendMessage(1, "World locked, but login server not connected.");
}
}
else if (strcasecmp(sep.arg[0], "unlock") == 0 && admin >= consoleLockStatus) {
WorldConfig::UnlockWorld();
if (loginserverlist.Connected()) {
loginserverlist.SendStatus();
SendMessage(1, "World unlocked.");
}
else {
SendMessage(1, "World unlocked, but login server not connected.");
}
}
else if (strcasecmp(sep.arg[0], "version") == 0 && admin >= consoleWorldStatus) {
SendMessage(1, "Current version information.");
SendMessage(1, " %s", CURRENT_VERSION);
SendMessage(1, " Compiled on: %s at %s", COMPILE_DATE, COMPILE_TIME);
SendMessage(1, " Last modified on: %s", LAST_MODIFIED);
}
else if (strcasecmp(sep.arg[0], "serverinfo") == 0 && admin >= AccountStatus::GMMgmt) {
if (strcasecmp(sep.arg[1], "os") == 0) {
#ifdef _WINDOWS
GetOS();
char intbuffer [sizeof(unsigned long)];
SendMessage(1, "Operating system information.");
SendMessage(1, " %s", Ver_name);
SendMessage(1, " Build number: %s", ultoa(Ver_build, intbuffer, 10));
SendMessage(1, " Minor version: %s", ultoa(Ver_min, intbuffer, 10));
SendMessage(1, " Major version: %s", ultoa(Ver_maj, intbuffer, 10));
SendMessage(1, " Platform Id: %s", ultoa(Ver_pid, intbuffer, 10));
#else
char os_string[100];
SendMessage(1, "Operating system information.");
SendMessage(1, " %s", GetOS(os_string));
#endif
}
else {
SendMessage(1, "Usage: Serverinfo [type]");
SendMessage(1, " OS - Operating system version information.");
}
}
else if (strcasecmp(sep.arg[0], "IPLookup") == 0 && admin >= AccountStatus::GMMgmt) {
client_list.SendCLEList(admin, 0, this, sep.argplus[1]);
}
else if (strcasecmp(sep.arg[0], "LSReconnect") == 0 && admin >= AccountStatus::GMAdmin) {
#ifdef _WINDOWS
_beginthread(AutoInitLoginServer, 0, nullptr);
#else
pthread_t thread;
pthread_create(&thread, nullptr, &AutoInitLoginServer, nullptr);
#endif
RunLoops = true;
SendMessage(1, " Login Server Reconnect manually restarted by Console");
LogInfo("Login Server Reconnect manually restarted by Console");
}
else if (strcasecmp(sep.arg[0], "zonelock") == 0 && admin >= consoleZoneStatus) {
if (strcasecmp(sep.arg[1], "list") == 0) {
zoneserver_list.ListLockedZones(0, this);
}
else if (strcasecmp(sep.arg[1], "lock") == 0 && admin >= AccountStatus::GMAdmin) {
uint16 tmp = ZoneID(sep.arg[2]);
if (tmp) {
if (zoneserver_list.SetLockedZone(tmp, true))
zoneserver_list.SendEmoteMessage(0, 0, 80, 15, "Zone locked: %s", ZoneName(tmp));
else
SendMessage(1, "Failed to change lock");
}
else
SendMessage(1, "Usage: #zonelock lock [zonename]");
}
else if (strcasecmp(sep.arg[1], "unlock") == 0 && admin >= AccountStatus::GMAdmin) {
uint16 tmp = ZoneID(sep.arg[2]);
if (tmp) {
if (zoneserver_list.SetLockedZone(tmp, false))
zoneserver_list.SendEmoteMessage(0, 0, 80, 15, "Zone unlocked: %s", ZoneName(tmp));
else
SendMessage(1, "Failed to change lock");
}
else
SendMessage(1, "Usage: #zonelock unlock [zonename]");
}
else {
SendMessage(1, "#zonelock sub-commands");
SendMessage(1, " list");
if (admin >= AccountStatus::GMAdmin) {
SendMessage(1, " lock [zonename]");
SendMessage(1, " unlock [zonename]");
}
}
}
else if (strcasecmp(sep.arg[0], "reloadworld") == 0 && admin > AccountStatus::GMAdmin)
{
SendEmoteMessage(0,0,0,15,"Reloading World...");
auto pack = new ServerPacket(ServerOP_ReloadWorld, sizeof(ReloadWorld_Struct));
ReloadWorld_Struct* RW = (ReloadWorld_Struct*) pack->pBuffer;
RW->global_repop = ReloadWorld::Repop;
zoneserver_list.SendPacket(pack);
safe_delete(pack);
}
else if (strcasecmp(sep.arg[0], "") == 0){
/* Hit Enter with no command */
}
else {
SendMessage(1, "Command unknown.");
}
if (state == CONSOLE_STATE_CONNECTED)
SendPrompt();
break;
}
default: {
break;
}
}
}
void Console::SendPrompt() {
if (tcpc->GetEcho())
SendMessage(0, "%s> ", paccountname);
}
-225
View File
@@ -66,21 +66,6 @@ void EQLConfig::LoadSettings() {
}
EQLConfig *EQLConfig::CreateLauncher(const char *name, uint8 dynamic_count) {
char namebuf[128];
database.DoEscapeString(namebuf, name, strlen(name)&0x3F); //limit len to 64
namebuf[127] = '\0';
std::string query = StringFormat("INSERT INTO launcher (name, dynamics) VALUES('%s', %d)", namebuf, dynamic_count);
auto results = database.QueryDatabase(query);
if (!results.Success()) {
return nullptr;
}
return new EQLConfig(name);
}
void EQLConfig::GetZones(std::vector<LauncherZone> &result) {
std::map<std::string, LauncherZone>::iterator cur, end;
cur = m_zones.begin();
@@ -90,64 +75,6 @@ void EQLConfig::GetZones(std::vector<LauncherZone> &result) {
}
}
std::vector<std::string> EQLConfig::ListZones() {
LauncherLink *ll = launcher_list.Get(m_name.c_str());
std::vector<std::string> res;
if(ll == nullptr) {
//if the launcher isnt connected, use the list from the database.
std::map<std::string, LauncherZone>::iterator cur, end;
cur = m_zones.begin();
end = m_zones.end();
for(; cur != end; ++cur) {
res.push_back(cur->first);
}
} else {
//otherwise, use the zone list from the launcher link.
ll->GetZoneList(res);
}
return(res);
}
void EQLConfig::DeleteLauncher() {
launcher_list.Remove(m_name.c_str());
char namebuf[128];
database.DoEscapeString(namebuf, m_name.c_str(), m_name.length()&0x3F); //limit len to 64
namebuf[127] = '\0';
std::string query = StringFormat("DELETE FROM launcher WHERE name = '%s'", namebuf);
auto results = database.QueryDatabase(query);
if (!results.Success()) {
return;
}
query = StringFormat("DELETE FROM launcher_zones WHERE launcher = '%s'", namebuf);
results = database.QueryDatabase(query);
if (!results.Success()) {
return;
}
}
bool EQLConfig::IsConnected() const {
LauncherLink *ll = launcher_list.Get(m_name.c_str());
return(ll != nullptr);
}
void EQLConfig::RestartZone(Const_char *zone_ref) {
LauncherLink *ll = launcher_list.Get(m_name.c_str());
if(ll == nullptr)
return;
ll->RestartZone(zone_ref);
}
void EQLConfig::StopZone(Const_char *zone_ref) {
LauncherLink *ll = launcher_list.Get(m_name.c_str());
if(ll == nullptr)
return;
ll->StopZone(zone_ref);
}
void EQLConfig::StartZone(Const_char *zone_ref) {
LauncherLink *ll = launcher_list.Get(m_name.c_str());
if(ll == nullptr)
@@ -155,158 +82,6 @@ void EQLConfig::StartZone(Const_char *zone_ref) {
ll->StartZone(zone_ref);
}
bool EQLConfig::BootStaticZone(Const_char *short_name, uint16 port) {
//make sure the short name is valid.
if(ZoneID(short_name) == 0)
return false;
//database update
char namebuf[128];
database.DoEscapeString(namebuf, m_name.c_str(), m_name.length()&0x3F); //limit len to 64
namebuf[127] = '\0';
char zonebuf[32];
database.DoEscapeString(zonebuf, short_name, strlen(short_name)&0xF); //limit len to 16
zonebuf[31] = '\0';
std::string query = StringFormat("INSERT INTO launcher_zones (launcher, zone, port) "
"VALUES('%s', '%s', %d)", namebuf, zonebuf, port);
auto results = database.QueryDatabase(query);
if (!results.Success()) {
return false;
}
//update our internal state.
LauncherZone lz;
lz.name = short_name;
lz.port = port;
m_zones[lz.name] = lz;
//if the launcher is connected, update it.
LauncherLink *ll = launcher_list.Get(m_name.c_str());
if(ll != nullptr) {
ll->BootZone(short_name, port);
}
return true;
}
bool EQLConfig::ChangeStaticZone(Const_char *short_name, uint16 port) {
//make sure the short name is valid.
if(ZoneID(short_name) == 0)
return false;
//check internal state
std::map<std::string, LauncherZone>::iterator res;
res = m_zones.find(short_name);
if(res == m_zones.end()) {
//not found.
LogError("Update for unknown zone {}", short_name);
return false;
}
char namebuf[128];
database.DoEscapeString(namebuf, m_name.c_str(), m_name.length()&0x3F); //limit len to 64
namebuf[127] = '\0';
char zonebuf[32];
database.DoEscapeString(zonebuf, short_name, strlen(short_name)&0xF); //limit len to 16
zonebuf[31] = '\0';
std::string query = StringFormat("UPDATE launcher_zones SET port=%d WHERE "
"launcher = '%s' AND zone = '%s'",port, namebuf, zonebuf);
auto results = database.QueryDatabase(query);
if (!results.Success()) {
return false;
}
//update internal state
res->second.port = port;
//if the launcher is connected, update it.
LauncherLink *ll = launcher_list.Get(m_name.c_str());
if(ll != nullptr) {
ll->RestartZone(short_name);
}
return true;
}
bool EQLConfig::DeleteStaticZone(Const_char *short_name) {
//check internal state
std::map<std::string, LauncherZone>::iterator res;
res = m_zones.find(short_name);
if(res == m_zones.end()) {
//not found.
LogError("Update for unknown zone {}", short_name);
return false;
}
char namebuf[128];
database.DoEscapeString(namebuf, m_name.c_str(), m_name.length()&0x3F); //limit len to 64
namebuf[127] = '\0';
char zonebuf[32];
database.DoEscapeString(zonebuf, short_name, strlen(short_name)&0xF); //limit len to 16
zonebuf[31] = '\0';
std::string query = StringFormat("DELETE FROM launcher_zones WHERE "
"launcher = '%s' AND zone = '%s'", namebuf, zonebuf);
auto results = database.QueryDatabase(query);
if (!results.Success()) {
return false;
}
//internal update.
m_zones.erase(res);
//if the launcher is connected, update it.
LauncherLink *ll = launcher_list.Get(m_name.c_str());
if(ll != nullptr) {
ll->StopZone(short_name);
}
return true;
}
bool EQLConfig::SetDynamicCount(int count) {
char namebuf[128];
database.DoEscapeString(namebuf, m_name.c_str(), m_name.length()&0x3F); //limit len to 64
namebuf[127] = '\0';
std::string query = StringFormat("UPDATE launcher SET dynamics=%d WHERE name='%s'", count, namebuf);
auto results = database.QueryDatabase(query);
if (!results.Success()) {
return false;
}
//update in-memory version.
m_dynamics = count;
//if the launcher is connected, update it.
LauncherLink *ll = launcher_list.Get(m_name.c_str());
if(ll != nullptr) {
ll->BootDynamics(count);
}
return false;
}
int EQLConfig::GetDynamicCount() const {
return(m_dynamics);
}
std::map<std::string,std::string> EQLConfig::GetZoneDetails(Const_char *zone_ref) {
std::map<std::string,std::string> res;
LauncherLink *ll = launcher_list.Get(m_name.c_str());
if(ll == nullptr) {
res["name"] = zone_ref;
res["up"] = "0";
res["starts"] = "0";
res["port"] = "0";
} else {
ll->GetZoneDetails(zone_ref, res);
}
return(res);
}
-16
View File
@@ -42,24 +42,8 @@ public:
//BEGIN PERL EXPORT
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;
std::vector<std::string> ListZones(); //returns an array of zone refs
std::map<std::string,std::string> GetZoneDetails(Const_char *zone_ref);
//END PERL EXPORT
protected:
-1
View File
@@ -37,7 +37,6 @@ extern LauncherList launcher_list;
LauncherLink::LauncherLink(int id, std::shared_ptr<EQ::Net::ServertalkServerConnection> c)
: ID(id),
tcpc(c),
authenticated(false),
m_name(""),
m_bootTimer(2000)
{

Some files were not shown because too many files have changed in this diff Show More