Compare commits

..

925 Commits

Author SHA1 Message Date
KimLS 4c3947efa6 Changes to UF and above clients on how spell buff tics are synced. 2016-05-25 22:00:28 -04:00
Uleat b5f09d435f Updated argument type..but, forgot to change methodology 2016-05-25 19:45:16 -04:00
Michael Cook (mackal) 56cb719d1a Merge pull request #522 from 9thsector/FreeBSDFixes
FreeBSD Compile Fixes
2016-05-25 18:53:56 -04:00
Michael Cook (mackal) e2a5ffe59e Merge pull request #525 from 9thsector/configfile-patch-location-fix
reording includes fixes patch file location problem
2016-05-25 18:53:46 -04:00
Uleat 71f128731f Renamed and moved SkillUseTypes enumeration to EQEmu::skills::SkillType; eq_dictionary work 2016-05-25 18:50:26 -04:00
phredi a715accc5f reording includes fixes patch file location problem 2016-05-25 17:35:47 -05:00
Michael Cook (mackal) 615158e701 Make EQStreamIdentifier::Record ctor take advantage of move semantics [clang-tidy] 2016-05-25 16:29:39 -04:00
Michael Cook (mackal) 60da544d3a clang-tidy modernize-use-auto 2016-05-25 16:10:28 -04:00
Michael Cook (mackal) cdbeb24a05 Change emptiness checks to empty() from size() [clang-tidy]
This has two benefits, it's clear what we are checking and
size() isn't always constant time, where empty is (performance!)
2016-05-25 14:57:47 -04:00
Michael Cook (mackal) c43d436b1f Fix more windows.h/winsock.h/winsock2.h issues
We want to use winsock2.h rather than winsock.h. This was mostly enforced
from the global_defines.h file, but I wanted to make it consistent.

Most of these includes can be removed since they're included via
global_defines.h, but someone on windows should clean that up
2016-05-25 13:46:47 -04:00
KimLS a9ef83c597 Missed config cause I'm totes not on gcc right now 2016-05-24 23:58:19 -07:00
KimLS 290bcc5720 Merge branch 'master' of github.com:EQEmu/Server 2016-05-24 23:49:36 -07:00
KimLS 9894c1b186 Compile fixes, needs cleaning up 2016-05-24 23:49:25 -07:00
Michael Cook (mackal) c059ff01ba Nuke unused COLLECTOR defines 2016-05-25 02:38:06 -04:00
Akkadius 477bf1ba45 Few more windows compile fix adjustments 2016-05-25 01:20:09 -05:00
phredi fd693a671b FreeBSD Compile Fixes 2016-05-24 23:24:49 -05:00
Akkadius ca2ad5b049 Add eqemu_config_extern.h to cmake - add header blockers 2016-05-24 22:57:12 -05:00
Akkadius b4ee5c8515 Merge pull request #521 from 9thsector/ConfigFileUpdate
Config file update(take2)
2016-05-24 22:27:26 -05:00
phredi 455223df1c fix to pass tests 2016-05-24 22:17:50 -05:00
phredi 5cd052458a fix for bin/tests to compile with configfileupdate 2016-05-24 21:53:37 -05:00
phredi a628dee2b7 Merge branch 'master' into ConfigFileUpdate 2016-05-24 20:47:52 -05:00
phredi 109de62916 eqemu_config.xml.full update 2016-05-24 20:45:32 -05:00
phredi 11b3571965 small fix for logdir 2016-05-24 20:18:11 -05:00
phredi 40845adbae initial logdir work(incomplete) 2016-05-24 20:00:54 -05:00
Michael Cook (mackal) 12905a3771 Fix Item_Struct::IsEquipable issue 2016-05-22 18:02:46 -04:00
Uleat 5f1b2475fb Picky penguins... 2016-05-21 15:01:29 -04:00
Uleat afd306f8ce Fix for GCC compile 2016-05-21 14:55:43 -04:00
Uleat b28930b2ea Fix for (possible) shared bank errors 2016-05-21 05:21:03 -04:00
Uleat 3031365e1f Moved struct Item_Struct into namespace EQEmu 2016-05-21 04:54:18 -04:00
phredi b997a040d7 Config File Update Initial Update 2016-05-20 21:03:34 -05:00
Uleat ebe6f95e6e LightSourceProfile relocation and some more formatting changes 2016-05-20 04:26:32 -04:00
Uleat 04f47f1e32 Formatting and GPL updates 2016-05-19 22:50:08 -04:00
Uleat d61e7446bb Missed a couple of EQEmu::OutBuffer reference changes 2016-05-19 07:21:10 -04:00
Uleat ffb88e0a8f Added EQEmu::OutBuffer() - stringstream-derived class with a few additional methods 2016-05-18 22:38:41 -04:00
Uleat 67c92bf171 Changed client 'constants' files to 'limits' 2016-05-18 04:45:31 -04:00
Michael Cook (mackal) 0c311ad3fe Fix Client::ChangeMailBox 2016-05-17 18:22:44 -04:00
Michael Cook (mackal) a8a4712fce Remove unused header 2016-05-17 17:47:26 -04:00
Michael Cook (mackal) 981d3e6b60 Refactor Clientlist::Voiced to std::vector 2016-05-17 17:42:34 -04:00
Michael Cook (mackal) f185257415 Refactor ChatChannel::Invitees to std::vector 2016-05-17 17:38:08 -04:00
Michael Cook (mackal) 1a7a5aa8c8 More UCS refactoring 2016-05-17 16:52:04 -04:00
Michael Cook (mackal) 29da15f38c Rename CL to g_Clientlist 2016-05-17 15:11:23 -04:00
Michael Cook (mackal) 38af484368 Fix mismatch new/delete 2016-05-16 23:47:01 -04:00
Michael Cook (mackal) 046dfe3e12 Add missing continue to Clientlist::Process 2016-05-16 23:25:27 -04:00
Michael Cook (mackal) 52bee3e8a0 Rework Clientlist::Process to not skip clients ... 2016-05-16 23:22:42 -04:00
Michael Cook (mackal) d2888e6cca Fix mismatched new/delete 2016-05-16 23:22:23 -04:00
Michael Cook (mackal) edc42bf5b6 Add small chrono timer object
This is just so if someone wants a quick way to measure how long
something takes for benchmarking purposes they don't have to
reinvent anything. See examples in comments
2016-05-13 21:33:03 -04:00
Uleat cb39a35f3f Fix for stringstream failure 2016-05-11 19:11:25 -04:00
Uleat 915f22d564 Added 'ItemInst::Serialize()' overload to make use of std::stringstream implementation 2016-05-11 00:30:04 -04:00
Uleat 3e0574630b Reworked server 'BulkSendInventoryItems()' to use single buffer methodology 2016-05-10 21:27:40 -04:00
Uleat 37b84c4db1 Reworked client translators' SerializeItem() to recursive, single buffer methodology 2016-05-10 20:16:27 -04:00
Michael Cook (mackal) de48d79b27 Need to account for null byte 2016-05-09 21:46:05 -04:00
Michael Cook (mackal) c159b89e79 Rewrite VarCache_Struct
Basically just remove manual memory management
2016-05-09 14:25:54 -04:00
Uleat 59728c5115 Tweak for Titanium::SerializeItem() rework 2016-05-08 23:43:47 -04:00
Uleat 1a1f5ae619 Titanium::SerializeItem() rework 2016-05-08 20:21:50 -04:00
Michael Cook (mackal) 907bc68e1c Mismatched delete statement 2016-05-06 23:14:48 -04:00
Michael Cook (mackal) 47c9182ba3 Fix potential memory leaks (clang-tidy) 2016-05-06 22:58:45 -04:00
Michael Cook (mackal) 74b3fe9d61 Potential memory leak fix 2016-05-06 22:42:19 -04:00
Michael Cook (mackal) 20a36151b3 Make Client::TradeskillSearchResults take a reference 2016-05-06 22:04:21 -04:00
Michael Cook (mackal) f85add14db Fix some undefined behavior issues?
MakeAnyLenString results in UB (I think?) and is aggressively optimized out with clang
GrantAlternateAdvancementAbility were missing return statements and clang had fun times with those functions too
2016-05-06 21:31:46 -04:00
Michael Cook (mackal) 3bf13c5349 Run the timeout_manager in loginserver (thanks image) 2016-05-06 13:34:13 -04:00
Uleat e304fe6558 Clang appeasement 2016-05-04 22:33:52 -04:00
Michael Cook (mackal) a49aef24c5 Fix luabind::adl::object forward declare for clang
clang didn't like this, and GCC likes both :P
2016-05-04 03:01:53 -04:00
KayenEQ 9ab459292b Merge pull request #519 from KayenEQ/Development
Special attacks hit chance fix
2016-05-03 12:50:21 -04:00
KayenEQ bee5f316b7 Fix for special attacks that was causing most of them do
to do the HitChance roll twice.
2016-05-03 12:49:05 -04:00
KayenEQ 3c8eda599f Merge pull request #518 from KayenEQ/Development
ExtraAttackOptions (for npc special attacks) additions.
2016-05-03 08:26:58 -04:00
KayenEQ 57b483f697 ExtraAttackOptions (for npc special attacks) additions.
melee_damage_bonus_flat //(+/-) damage percent applied to out going damage
skilldmgtaken_bonus_flat //(+/-) mitigation percent applied to out going damage

*Note: These have not been applied to any ingame functions set.
2016-05-03 08:25:36 -04:00
Natedog2012 705295f4c4 Fix perl version of GetBuffSlotFromType 2016-04-27 21:49:17 -07:00
Michael Cook (mackal) 2fde9edb41 Fix null bind issues 2016-04-26 16:06:24 -04:00
Uleat e212368965 Revert (and proper fix) of 'size_t' issue (sneaky little gcc 4.6'es) 2016-04-22 20:51:22 -04:00
Uleat a1ea2052bf Fix for travis-ci failure - attempt 3 2016-04-22 20:03:36 -04:00
Uleat 7c0eb54df6 Updated EQEmu::deity naming conventions 2016-04-22 19:41:11 -04:00
Uleat f36e041176 Fix for travis-ci failure - attempt 2 2016-04-22 19:30:32 -04:00
Uleat 26aeeac1ce Fix for travis-ci failure 2016-04-22 18:29:25 -04:00
Uleat 1890d006a2 Delinked current inventory slot enumeration and constants from EQEmu::constants and global definition 2016-04-22 07:34:55 -04:00
Uleat b3475d7b50 Reworked ClientVersion into EQEmu::versions; Added EQEmu::versions::InventoryVersion 2016-04-22 03:49:17 -04:00
Uleat 6bc60391fb Update to EQEmu::saylink function linkage 2016-04-21 21:43:58 -04:00
Uleat e87e4d07f0 Update to EQEmu::lightsource function linkage 2016-04-21 19:55:46 -04:00
Uleat 57b3652819 Update to EQEmu::limits function linkage 2016-04-21 19:45:52 -04:00
Uleat 59e601733e Update to EQEmu::constants function linkage 2016-04-21 19:16:30 -04:00
Uleat 1693797adb Update to EQEmu::deity function linkage 2016-04-21 18:36:22 -04:00
Uleat 1ee32b4a30 Removed type dec from EQEmu::legacy::InventorySlots 2016-04-20 17:40:41 -04:00
Uleat 8edb6e9595 Eliminated the nested class design of recent EQEmu work; Some more inv2 convergence work 2016-04-19 04:02:53 -04:00
Natedog2012 53c7abf16e Fix for ModifyNPCStat when checking PhR as it would never be true as the check is set to lowercase 2016-04-17 16:27:29 -07:00
Uleat 1b3cfc9a5c Reworked EQDictionary into namespace EQEmu 2016-04-15 22:11:53 -04:00
Uleat 3a339a6646 EQ Dictionary rework 2016-04-14 08:40:11 -04:00
Uleat 1e05ee76f1 Fix for Bot::AI_Process() not advancing the heal rotation when member is currently casting for said heal rotation 2016-04-13 19:29:00 -04:00
Akkadius c33ccb138f Fix for marquee's crashing clients on zone 2016-04-12 23:49:44 -05:00
Akkadius 9673d8c34d Merge pull request #516 from ngdeao/master
Fix for RoF2 clients connecting and sometimes not appearing in the zone to others.
2016-04-12 23:38:07 -05:00
ngdeao 096dd21234 Fix for RoF2 clients connecting and don't appear in the zone to others. 2016-04-12 21:41:14 -06:00
Uleat 149a3c2e82 Would real 'Fix for BotDatabase::LoadBotGroupIDForLoadBotGroup() failures when more than one bot-group exists and requested bg is not primary in retrieval order' please stand up.. 2016-04-12 18:29:09 -04:00
Uleat aafa840d61 Merge branch 'master' of https://github.com/EQEmu/Server 2016-04-12 16:46:53 -04:00
Uleat 3ef98c9411 Added bot command 'inventorywindow' 2016-04-12 16:46:45 -04:00
Michael Cook (mackal) 700e801821 Fix mismatched delete in QueryServ 2016-04-12 13:44:33 -04:00
Uleat 89f46144e6 Fix for BotDatabase::LoadBotGroupIDForLoadBotGroup() failures when more than one bot-group exists and requested bg is not primary in retrieval order 2016-04-11 23:08:27 -04:00
Uleat daeec0f5ec Rework of some existing spell AI code 2016-04-11 16:51:30 -04:00
Akkadius a5119d1a9f Remove some instances of std::cerr 2016-04-11 14:29:45 -05:00
Uleat d47d72f2f2 Merge branch 'master' of https://github.com/EQEmu/Server 2016-04-08 20:58:27 -04:00
Uleat 6e11128cbc Added HealRotation HOT methodology (Heal Override Target) and load/save/delete capabilities 2016-04-08 20:58:17 -04:00
Michael Cook (mackal) 761c2be722 Style changes (auto, post-inc to pre-inc) 2016-04-08 14:14:09 -04:00
Michael Cook (mackal) 1551e5d908 Add mutex to EQStream::Decay to prevent threading issues 2016-04-08 14:11:02 -04:00
Akkadius f69b72f85f Merge pull request #515 from ngdeao/master
Netcode and Zoning Improvements
2016-04-07 21:48:27 -05:00
ngdeao fb23d961c1 Changed where queued packets are sent while zoning. Moved where zoneinpacket_timer is started to assist in not dropping needed packets.
Added better netcode support for handling out of order acks, to preclude excessive resending of same packets.

Changed how timeout checks are performing on individual packets, for re-sends, so they do not happen more often than the client can respond.

Improved how the data rate limit for throttling packets for compressed stream, so the size reduction in packets are accounted for better.
2016-04-07 20:26:47 -06:00
Uleat e75a53b775 Rework of eq_dictionary 2016-04-07 17:21:55 -04:00
Uleat 6ea061dc55 Added missing argument descriptor to 'bot_subcommand_heal_rotation_adjust_safe' usage. 2016-04-06 15:38:26 -04:00
Uleat 28b7e0e208 Fix for bot pet names showing up as numbers 2016-04-05 20:04:31 -04:00
Uleat b07f3d04df Fix for version 9003 trigger criteria 2016-04-05 19:04:06 -04:00
Uleat 51c97211a8 Fix for "ISO C++" taboo 2016-04-05 18:54:40 -04:00
Uleat e759bb6da8 Moved class Bot database code into class BotDatbase 2016-04-05 18:37:19 -04:00
Akkadius 22b7e76537 Added "nolock" argument option, allows database backups while server is online 2016-04-05 14:23:49 -05:00
Akkadius 620ac2a685 Merge pull request #514 from hateborne/master
Exported GetSpellIDFromSlot into Perl
2016-03-31 14:02:36 -05:00
hateborne 1f5eeda79e Exported GetSpellIDFromSlot into Perl
Exported the GetSpellIDFromSlot into Perl. Currently, there are numerous
Perl objections that can accept buff slot info, but nothing that can
return the buffs a mob/client currently has. This lets us iterate over
them with a loop, returning -1 if the slot requested doesn't exist.
2016-03-31 13:09:36 -04:00
Michael Cook (mackal) ba5b3c2796 Update fling struct and add Fling to lua opcode enum 2016-03-29 15:11:59 -04:00
Akkadius 5cbf4aca4f Slight adjustment to wearchange commit 2016-03-28 21:53:46 -05:00
Akkadius a82f5f8bf6 Allow heroforge textures to be manipulated via perl 2016-03-28 21:13:37 -05:00
Uleat 6c5d686b22 Merge branch 'master' of https://github.com/EQEmu/Server 2016-03-27 15:32:56 -04:00
Uleat 9f6e4dd8e7 More appropriate for bot owner targeting issue. Fix for self-following issue using bot_command_follow 2016-03-27 15:32:45 -04:00
KayenEQ 9f0a0a6d9f Merge pull request #512 from KayenEQ/Development
Removed unneccessary entitylist check from ApplySpellBonuses
2016-03-27 11:19:47 -04:00
KayenEQ 365a08ee86 Removed unneccessary entitylist check from ApplySpellBonuses
Fixed an issue with FCBaseEffects not applying bonus when cast on targets from runes.
2016-03-27 11:08:08 -04:00
KayenEQ b8972e0215 Merge git://github.com/EQEmu/Server into Development 2016-03-27 10:58:20 -04:00
KayenEQ d1facd9368 Kayen: delete bad test files accidently merged 2016-03-27 10:57:29 -04:00
KayenEQ 097da2d0af Merge pull request #511 from EQEmu/revert-510-Development
Revert "Removed unneccessary entitylist check from ApplySpellBonuses"
2016-03-27 10:37:05 -04:00
KayenEQ cc554be1df Revert "Removed unneccessary entitylist check from ApplySpellBonuses" 2016-03-27 10:36:49 -04:00
KayenEQ 9f7b67417f Merge pull request #510 from KayenEQ/Development
Removed unneccessary entitylist check from ApplySpellBonuses
2016-03-27 10:28:45 -04:00
KayenEQ 5d9ec0c4bf Removed unneccessary entitylist check from ApplySpellBonuses
Fixed an issue with FCBaseEffects not applying bonus when cast on targets from runes.
2016-03-27 10:27:23 -04:00
Uleat ebbc6b3f6a Cosmetic update for bot_command_actionable 2016-03-26 21:46:33 -04:00
Uleat 84460e3a1f Fix for self-targeting issue in bot_command_follow 2016-03-26 20:14:22 -04:00
Uleat dc09d6dfbd Added positive evaluation break 2016-03-26 18:18:40 -04:00
Uleat 3623fe28ea Merge branch 'master' of https://github.com/EQEmu/Server 2016-03-26 18:09:17 -04:00
Uleat 51879e0276 Missed a rework for actionable criteria botgroup 2016-03-26 18:09:09 -04:00
Michael Cook (mackal) 5585ddb80b Add OP_Fling stuff so devs can play with 2016-03-25 20:26:21 -04:00
KayenEQ 03ae89b628 Merge pull request #509 from KayenEQ/Development
Fix to have better sync server side spell range check to client check.
2016-03-25 18:26:45 -04:00
KayenEQ 1cfd1d478a Fix to have better sync server side spell range check to client check. 2016-03-25 18:25:54 -04:00
Uleat d36ec8c066 Fix for certain Berserker characters not being able to train Piercing skill 2016-03-25 14:19:49 -04:00
Uleat a09e9b479a Merge branch 'master' of https://github.com/EQEmu/Server 2016-03-25 13:19:43 -04:00
Uleat cdf5293ee2 Backport subcommand_list methodology to VS2012 compatibility - VS2013 code left in situ 2016-03-25 13:19:36 -04:00
KayenEQ 1e795c0199 Merge pull request #508 from KayenEQ/Development
Defensive proc rate fix
2016-03-25 13:04:21 -04:00
KayenEQ b369bb1793 Fixed defensive procs so they now only trigger once per attack round like live.
Added live like proc chance modifer based on level difference to target.
"Anything above your level will receive full mod. Starting 6 levels below PC level there is a negative 10 % mod applied each level until it reaches 0 and will not proc on anything 15 levels below you or lower."
Thanks to Huffin from PEQ for the parse data
2016-03-25 13:02:59 -04:00
Uleat a99befebfe Added code blocks for non-BOTS build failures 2016-03-25 12:29:31 -04:00
Uleat 817d8ceb64 Fix for heal rotation 'Stack Overflow' error 2016-03-25 02:04:25 -04:00
Uleat 3b6889d5d3 Changed PreferNoManaCommandSpells check from pre-processor to rules-based criteria 2016-03-25 00:39:11 -04:00
Uleat 66ca522e62 Another fix for portability issues 2016-03-24 20:33:37 -04:00
Uleat 698ef56df9 Few more portability fixes 2016-03-24 19:35:23 -04:00
Uleat 90c87a05e6 Fix for implementation reference failure 2016-03-24 19:23:12 -04:00
Uleat b327da7092 Activation of the new 'Bots' command system 2016-03-24 18:50:31 -04:00
KayenEQ 747895cbe5 Merge pull request #507 from KayenEQ/Development
AE Taunt range fix
2016-03-24 16:27:41 -04:00
KayenEQ fc5d6bd792 Fix for AE taunt to use correct range and hate modifier.
Fix for spell effect version of taunt to use correct range.
2016-03-24 16:26:29 -04:00
Uleat 8cbcd48461 Backport EQEmu::GetSkillUseTypesMap() methodology to VS2012 compatibility - VS2013 code left in situ 2016-03-24 16:07:17 -04:00
Uleat 1e344f2ad2 Added 'Open Chest' animation for LDoN chest death (thanks Natedog!) 2016-03-21 18:35:11 -04:00
Uleat 4842583426 Added some markers for skills.h and eq_constants.h enumerations 2016-03-20 20:09:14 -04:00
Uleat 5c812fb824 Fix for gcc fail 2016-03-20 17:51:09 -04:00
Uleat 87d92fe809 Update to #myskills to show proper 'Piercing' skill - 1HPiercing will still show if there is a value..but, will not be available for use if your class doesn't support it. 2016-03-20 17:27:08 -04:00
Uleat e2e1298523 Removed all bot command spell scripts but 'template' query 2016-03-08 16:25:05 -05:00
Michael Cook (mackal) 2189569312 Merge pull request #506 from clucksoft/master
Zone crash fix
2016-03-07 02:03:25 -05:00
Russell Kinasz 9291318a85 Fix formatting in last commit 2016-03-06 19:35:21 -08:00
Russell Kinasz 5881eabce9 Merge branch 'master' of https://github.com/EQEmu/Server 2016-03-06 18:37:14 -08:00
Russell Kinasz 6382ec2cb8 Prevent crash in spell casting when raid doesn't exist 2016-03-06 18:36:57 -08:00
Michael Cook (mackal) 9599501ace Implement extra bind points (secondary recall)
For SE_Gate, base2 is which bind to use (starting at 1)
For SE_BindAffinity, base1 is which bind to set (starting at 1)
For SE_GateCastersBindpoint, base1 is which bind to use (starting at 1)
    here was actually no spells that don't send to the main bind,
    but it uses a base1 of 1 which matches with SE_Gate
    This also doesn't break anything

The quest stuff for now hasn't been updated to be able to make use of the extra binds

There are a total of 5 bind points, with the 5th being your starting city
2016-03-05 16:28:53 -05:00
Natedog2012 655d2d47ba Fix the typo in this change. Pets size should scale up properly until 3x normal size. 2016-03-01 22:31:58 -08:00
Uleat 09589edcdd Fix for LDoN treasure npcs poofing - please report any issues 2016-03-01 18:23:36 -05:00
Uleat 141d6e3e8b Fix for two possible crash points in NPC::Death() 2016-03-01 16:55:31 -05:00
Akkadius 66b62303e4 Fix for shared_memory and clearing out hotfix_ when ran 2016-02-29 22:01:33 -06:00
Uleat acda4c7444 Merge branch 'master' of https://github.com/EQEmu/Server 2016-02-29 21:47:03 -05:00
Uleat abedfd3918 Add MainAmmo slot check for AddItemBonuses - only includes skill mods 2016-02-29 21:46:53 -05:00
KayenEQ b802a1cb1e Merge pull request #505 from KayenEQ/Development
Fix for ammo weapon damage not calculating when launching projectiles
2016-02-29 02:31:32 -05:00
KayenEQ 02e0431a79 Fix for ammo weapon damage not calculating when launching projectiles with rule enabled. 2016-02-29 02:29:41 -05:00
Uleat 63cce6875f Rework of NPC::PickPocket() - added stacking ability 2016-02-27 20:27:11 -05:00
Natedog2012 2268e6ed34 Fix up Object packet for UF / RoF / RoF2. SolidType was incorrect as those fields are the XY tilt for the object. Need database values for these fields so they will actually be useful. 2016-02-27 01:42:07 -08:00
KayenEQ 114c6b72bb Merge pull request #504 from KayenEQ/Development
Backstab with bane weapons will now hit immune to all but bane targets
2016-02-12 18:21:42 -05:00
KayenEQ a8f353518e Allow backstabs done with bane weapons to hit targets immune to all melee except bane.
Skill attacks will now give appropriate immune messages.
2016-02-12 18:19:03 -05:00
Akkadius 42933aaa8b Merge pull request #503 from hateborne/master
IgnoreSpellDmgLvlRestriction Rule Added (re-resubmitted)
2016-02-11 17:57:01 -06:00
hateborne b432830dfc IgnoreSpellDmgLvlRestriction Rule Added (re-resubmitted)
Added IgnoreSpellDmgLvlRestriction rule (boolean) to ignore the 5 level
spread when checking to add SpellDmg. Resubmitting due to the change
Natedog made ::shakefist::
2016-02-11 17:37:32 -05:00
Natedog2012 31b6346f03 Fix the math so berserkers aren't left out in spell related checks. 2016-02-11 13:10:22 -08:00
Akkadius a14b3117e9 Merge pull request #500 from hateborne/master
FlatItemExtraSpellAmt Custom Rule Addition
2016-02-10 16:00:39 -06:00
hateborne cdd56ec0e1 FlatItemExtraSpellAmt Custom Rule Addition
Added FlatItemExtraSpellAmt rule (boolean) to allow SpellDmg on items to
be added as raw damage versus scaled.
2016-02-10 16:51:58 -05:00
Michael Cook (mackal) 306586fa7e Exclude discs from buff slot stealing logic 2016-02-06 19:33:44 -05:00
JJ 33c7016a0e Simple spelling fix. [skip ci] 2016-02-04 19:17:17 -05:00
Natedog2012 7efccad13e GetFreeGrid should no longer crash when trying to #wpadd in a zone that has no grids 2016-02-02 01:53:30 -08:00
Akkadius 43ed5a325f Merge pull request #498 from Xackery/master
table schema for character_corpses is zone_id, not zoneid.
2016-01-30 02:10:45 -06:00
Xackery 65b44248fb table schema for character_corpses is zone_id, not zoneid. 2016-01-30 00:01:06 -08:00
Michael Cook (mackal) 3bbf337c24 Merge pull request #497 from daerath/master
Changed Item_Struct's CastTime member to uint32 (was uint16)
2016-01-28 19:35:40 -05:00
Natedog2012 09d6ed6bd9 Merge branch 'master' of https://github.com/EQEmu/Server 2016-01-28 13:26:28 -08:00
Natedog2012 3ce3f591a8 UF and ROF2 spawn packet packet for chests now working properly. 2016-01-28 13:26:15 -08:00
Tim DeLong c19a5d7c75 Casttime was too small for the possible data values. The Potion of Serious Healing has a cast time of 90.0 sec (90000), but this was downcast to a lower value. Updated Casttime from uint16 to uint32. This change also makes CastTime have the same data type as Fulfilment which is notable as they are in a struct union and should have the same type. 2016-01-28 08:15:38 -05:00
Uleat f98c04ca7a Fix for false triggering of warning message for command alias processing 2016-01-27 17:39:36 -05:00
Uleat 430be0f2b7 Follow-up for Titanium client - item weight fix (WARNING: re-run shared_memory; Note: re-run cmake; see changelog.txt) 2016-01-26 19:02:07 -05:00
Uleat 09739942c6 Merge pull request #496 from daerath/master
(Fix for) Item weights being downcast to uint8
2016-01-26 16:55:54 -05:00
Tim DeLong 52541c6532 Item weight was being downcast to uint8 which impacted any item with weight over 255. For SoD, SoF, and UF, prior to sending item info to the client we now cap weight at 255 to ensure the item remains heavy instead of being made (in most cases), super light. 2016-01-26 16:44:11 -05:00
Uleat 1b7841f683 Fix for Berserker 'Piercing' skill issues 2016-01-26 15:08:41 -05:00
Michael Cook (mackal) 15c92f019a Mob::Charmed() should be useful now
We should really clean this up, but this is quicker
2016-01-25 14:01:03 -05:00
Akkadius c4cdf811e3 Fix for zone controller spawn events where npc isn't inserted into entity list yet 2016-01-22 13:42:14 -06:00
Alex 211306f9be Merge pull request #493 from daerath/master
Loadlootdrops (shareddb.cpp) not exiting on error
2016-01-21 21:46:50 -08:00
Alex a22df6da33 Merge pull request #487 from lwahlmeier/master
fixed else error case for eqtime table
2016-01-21 21:46:36 -08:00
Tim DeLong b4b28e5eb8 If an error occurs (!results.Success()) in loadlootdrops the method continues processing instead of exiting. 2016-01-21 11:53:14 -05:00
Michael Cook (mackal) d86307c720 Rework say links
We now consume 1 item ID for say links, this means you will be able to create
more items! We used ID 0xFFFFF for this, which is the max ID an item can be
in the item links. You have the rest to play with!

Normal say links pass the ID in the first aug slot and silent say links
in the second aug slot. This means we can have MANY more say links as well!
2016-01-20 22:31:35 -05:00
Uleat 04b7ba7a1d Added proxy accessors for all TextLink fields 2016-01-20 21:54:18 -05:00
Michael Cook (mackal) 1ddbfdf4e9 Fix ItemInst::GetItemElementalDamage 2016-01-16 18:46:32 -05:00
Michael Cook (mackal) 600866f573 Rewrite Bane and Elemental Dmg stuff and GetWeaponDamage (client version) 2016-01-16 18:29:17 -05:00
Michael Cook (mackal) ad1c91f204 Fix bots 2016-01-16 17:52:21 -05:00
Michael Cook (mackal) 8f0d9015be Fix rec/req level issues 2016-01-16 17:17:09 -05:00
Michael Cook (mackal) 281344b049 Add various GetItemStat totallers to ItemInst
The intent of these functions is to simplify various locations in the
code where we need to get a total of some stat on an item, including augs
and we can not just grab the total from the itembonuses struct.

This will also centralize where we need to add the powersource aug scaling
when we implement them. Since they will need the Purity stat from the
item it is in.

Notes:
    - These functions recurse if the augments flag is true, which is false by
      default to make it so you have to be explicit about recursing or not
    - These functions don't take into account if you can equip or if you are
      below recommended level, you will have to do that where you call these
      functions.
2016-01-16 17:10:11 -05:00
Michael Cook (mackal) d7e44643b5 Fix resist display issue for RoF/RoF2
These need to be found for the other clients
They are most likely a similar amount of bytes away from
the potionbelt in all clients
2016-01-15 17:20:48 -05:00
Michael Cook (mackal) 42f7e03b04 Fix typo in last commit 2016-01-15 17:00:10 -05:00
Michael Cook (mackal) f33f3bd4f5 Fix Drakkin base resists and some missing class bonuses 2016-01-15 16:09:23 -05:00
Uleat e161805bc9 Added changelog entry for #summonitem [itemlink] change 2016-01-13 15:25:22 -05:00
Uleat 6db397f07d Added item link functionality to #summonitem (thanks Kinglykrab!) 2016-01-13 15:10:21 -05:00
Uleat 23758d5e90 Merge pull request #491 from KinglyKrab/master
Modified #flag functionality for target-based account status refresh.
2016-01-13 15:00:21 -05:00
Kinglykrab f8ce556acb Modified #flag functionality for target-based account status refresh. 2016-01-13 08:08:23 -05:00
Michael Cook (mackal) 3048eca5ad Merge pull request #490 from AthrogatePEQ/master
Lua_Client::ClearCompassMark()
2016-01-12 22:56:18 -05:00
Athrogate 11a61f3e35 Merge branch 'master' of github.com:AthrogatePEQ/Server 2016-01-12 19:40:46 -08:00
Athrogate 192dadad8c Merge branch 'master' of github.com:AthrogatePEQ/Server 2016-01-12 19:40:19 -08:00
Athrogate 092fa4a3bc Merge branch 'master' of github.com:AthrogatePEQ/Server 2016-01-12 19:34:04 -08:00
Athrogate 0fec2fdfdd Add Lua_Client::ClearCompassMark(). 2016-01-12 19:33:49 -08:00
Athrogate 09b6adf726 Add Lua_Client::ClearCompassMark(). 2016-01-12 19:19:07 -08:00
Athrogate edeb7d79d1 Add Lua_Client::ClearCompassMark(). 2016-01-12 19:19:07 -08:00
Uleat 21fc487c33 World tradeskill objects should now exhibit pre-RoF behavior to all clients 2016-01-12 18:44:51 -05:00
Natedog2012 acb1d14fbd Cap Underfoot material / IDFile in the spawn packet to 99,9999 MAX. Anything higher will crash client 2016-01-11 13:32:00 -08:00
Michael Cook (mackal) 2cb58e9d02 Merge pull request #488 from daerath/master
* LightProfile_Struct::TypeToLevel.  Incorrect comparision in case statement.
2016-01-11 12:34:44 -05:00
Tim DeLong 1711b06836 * LightProfile_Struct::TypeToLevel. The case statement for lightLevelCandle should be lightTypeCandle as the check is on light types, not light levels. Light levels are used for the return value. 2016-01-11 09:11:38 -05:00
Michael Cook (mackal) 6fc5f8fba2 Fix stacking issues with SE_DamageModifier and SE_MinDamageModifier 2016-01-10 15:31:04 -05:00
Uleat 1aa98d34ca Fix for manifest boo-boo 2016-01-08 17:35:50 -05:00
Uleat 2b0ee55752 Add command #findaliases 2016-01-08 17:19:10 -05:00
Michael Cook (mackal) 2f129da08a Add GetAttackDelay to lua's NPC API 2016-01-06 15:48:10 -05:00
Michael Cook (mackal) 17c45c8d36 Move triggered on cast things to after the spell
This appears how live does it
2016-01-06 13:30:50 -05:00
Luke Wahlmeier 3a20bbd834 fixed else error case for eqtime table 2016-01-05 14:18:31 -07:00
Michael Cook (mackal) 20f5c42c3e Fix 60+ resist caps 2016-01-05 02:54:09 -05:00
Akkadius 9174ccd635 Another slight adjustment [skip ci] 2016-01-04 17:11:59 -06:00
Akkadius 2155a53a0d Another slight adjustment [skip ci] 2016-01-04 11:16:26 -06:00
Akkadius 6a404a5a26 Put the zone controller somewhere where people can't see it even with a terrible GlobalLoad.txt [skip ci] 2016-01-04 11:04:56 -06:00
Michael Cook (mackal) 5bcb9f0b35 Fix classic h2h dmg/delay also support for revamp
The revamp was implemented during SoF
Set Combat:UseRevampHandToHand to true to enable
2016-01-03 14:38:50 -05:00
Michael Cook (mackal) 05de206ace Rework quiver haste 2016-01-03 01:58:37 -05:00
Michael Cook (mackal) 28848fa913 Merge pull request #486 from noudess/master
Added runspeed to #mystats window
2016-01-02 17:39:02 -05:00
Paul Coene 51b74f47e3 Merge remote-tracking branch 'upstream/master' 2016-01-02 17:28:23 -05:00
Paul Coene f754f06bec Added runspeed to mystats window. 2016-01-02 17:26:59 -05:00
Alex d1d963df10 Merge pull request #485 from noudess/master
More fixes for SendBuffDuration
2016-01-02 13:43:27 -08:00
Paul Coene a56f17a9e5 Merge remote-tracking branch 'upstream/master' 2016-01-02 09:17:09 -05:00
Paul Coene 11f3e30245 Fixed a ton of buffs when using an EE item (SendBuffDurationPacket). 2016-01-02 09:16:13 -05:00
Akkadius 707d2c8635 Merge branch 'master' of https://github.com/EQEmu/Server 2016-01-01 01:13:37 -06:00
Akkadius dfdfb18a7e VS2012 fix 2016-01-01 01:12:49 -06:00
Akkadius 647fbcd6b6 Adjust an incredibly spammy log message 2016-01-01 01:11:32 -06:00
Akkadius 50a8a3017b Merge pull request #484 from daerath/master
* CheckNameFilter minimum surname check incorrect
2016-01-01 00:55:55 -06:00
Akkadius 9ea9ed2590 Update eqemu_update.pl to include loginserver setup in normal installer routine [skip ci] 2015-12-31 21:45:42 -06:00
Michael Cook (mackal) 3996a70037 2h DB should match client closer
I think the dev missed something when making it pretty for the forums
This should match it better.
2015-12-31 01:08:04 -05:00
Tim DeLong aad1396c73 * CheckNameFilter was enforcing minimum surname length of 3 instead of 4.
* Minor refactoring of CheckNameFilter to eliminate redundant code.
2015-12-30 23:30:52 -05:00
Akkadius 45d81b71d6 Merge pull request #483 from daerath/master
* AddReport's who and against strings were not being escaped properly.
2015-12-30 12:05:55 -06:00
Michael Cook (mackal) e70b34f245 Merge pull request #482 from af4t/master
MSVC 2015 wants <algorithm> #included for std::min.  If any other com…
2015-12-30 12:46:51 -05:00
Tim DeLong fe61abc3cd * AddReport's who and against strings were not being escaped properly. 2015-12-30 11:42:49 -05:00
af4t 2d375eb565 MSVC 2015 wants <algorithm> #included for std::min. If any other compilers require the same, feel free to alter the #if test. 2015-12-30 02:17:09 -05:00
Michael Cook (mackal) 7045581fdc Cap big bags to 10 slots for now 2015-12-29 15:22:09 -05:00
Akkadius 7bf114a0bc Fix Travis 2015-12-29 06:06:12 -06:00
Akkadius 2bf6c2788e eqemu_update.pl - Implement 14) [Remove Duplicate Rule Values] :: Looks for redundant rule_values entries and removes them 2015-12-29 05:40:34 -06:00
Akkadius 8b35ae9921 Change how rules are loaded and inherit values
- When a custom ruleset is loaded, it will always first look for a value present in the ruleset id for that zone, when it is not present, it will load from the default ruleset instead of immediately falling back to the source value. This is to eliminate the excessive amount of duplicate entries in the rule_values tables
2015-12-29 05:21:27 -06:00
Akkadius 8425607460 Implemented standardized zone controller scripts (Rule Zone, UseZoneController) Defaulted to true
- When a zone boots, it will spawn an invisible npc by the name of zone_controller
	- Lua and Perl scripts can be represented with this npc as zone_controller.pl/lua
	- This NPC's ID is ruled be define ZONE_CONTROLLER_NPC_ID 10
	- Two EVENT's uniquely are handled with this NPC/controller (They only work with the zone_controller NPC)
		- EVENT_SPAWN_ZONE :: All NPC spawns in the zone trigger the controller and pass the following variables:
			$spawned_entity_id
			$spawned_npc_id
		- EVENT_DEATH_ZONE :: All NPC deaths in the zone trigger the controller event and pass the following variables:
			$killer_id
			$killer_damage
			$killer_spell
			$killer_skill
			$killed_npc_id
2015-12-29 04:08:10 -06:00
Akkadius f25246e1a0 Adjust eqemu_update.pl [skip ci] 2015-12-29 01:47:21 -06:00
Akkadius 3af9aeeeaf Adjust manifest [skip ci] 2015-12-29 01:45:53 -06:00
Michael Cook (mackal) c2c08b85f1 Merge pull request #481 from KinglyKrab/master
Added GetInstanceTimerByID(instance_id) to Perl and Lua.
2015-12-29 02:35:19 -05:00
Akkadius 9757c38017 Adjust manifest [skip ci] 2015-12-29 01:30:20 -06:00
Kinglykrab 34e1dc9829 Added UpdateZoneHeader(type, value) to Perl and Lua. 2015-12-29 02:28:31 -05:00
Kinglykrab ff876bd558 Added GetInstanceTimerByID(instance_id) to Perl and Lua. 2015-12-29 00:56:32 -05:00
Akkadius b9d00f91de Merge pull request #480 from KinglyKrab/master
Added GetInstanceTimer to Perl and Lua.
2015-12-28 22:42:14 -06:00
Kinglykrab ce71b6d9f0 Added GetInstanceTimer() to Perl and Lua. 2015-12-28 22:13:54 -05:00
Akkadius 17c41a1364 Merge pull request #479 from KinglyKrab/master
Revert accidental change to SetPseudoRoot in lua_mob.cpp.
2015-12-28 19:18:39 -06:00
Kinglykrab bda39c4f77 Revert accidental change to SetPseudoRoot in lua_mob.cpp. 2015-12-28 20:07:59 -05:00
Akkadius e423165bcb DB Update System :: Implement SVN updates into the manifest (To support older databases) [skip ci] 2015-12-28 02:25:01 -06:00
Akkadius 1b4dbd1ce7 Adjust import_13th_floor.pl to flip slots 21 and 22 [skip ci] 2015-12-27 17:26:39 -06:00
Michael Cook (mackal) 3a7d7c727f AA updates [skip ci] 2015-12-26 13:29:34 -05:00
Akkadius dc58173f15 Remove unused script since we have a newer one now [skip ci] 2015-12-22 01:04:27 -06:00
Akkadius f883e085e3 Merge pull request #477 from KinglyKrab/master
Added GetMeleeMitigation() to Perl and Lua for Mobs (Clients/NPCs).
2015-12-21 15:47:16 -06:00
Akkadius 4b2f12cd67 Linux-ify 13th floor script [skip ci] 2015-12-21 15:32:59 -06:00
Akkadius 7223f2da06 Add 13th floor item import script (Natedog/Akkadius) [skip ci] 2015-12-21 15:31:38 -06:00
Kinglykrab 9a1271805a Added GetMeleeMitigation() to Perl and Lua for Mobs (Clients/NPCs). 2015-12-21 15:45:25 -05:00
Michael Cook (mackal) c168d7b7b6 Fix macro hack? [skip ci] 2015-12-21 12:41:49 -05:00
Michael Cook (mackal) 7ad33f2445 Fix formatting 2015-12-21 12:33:32 -05:00
Natedog2012 fc33a10ec0 Change GetSkill to use SkillModMax for clients 2015-12-21 07:37:43 -08:00
Natedog2012 8133f5312f First step into implementing evolving items, added fields to database that were missing. 2015-12-21 05:39:39 -08:00
Michael Cook (mackal) dfc5699403 Merge pull request #476 from KinglyKrab/master
Exported several Mob-based methods to Perl and Lua.
2015-12-19 19:54:17 -05:00
Kinglykrab 0177c8d7d9 Exported several Mob-based methods to Perl and Lua. 2015-12-19 19:42:35 -05:00
Uleat b4b1324ace Updated client version bitmasks 2015-12-19 12:42:55 -05:00
Michael Cook (mackal) 03592e58f9 Port EQMacEmu's Assist Aggro code
This code also allows you to toggle on Tick Pulling (Aggro:AllowTickPulling)
which was a pulling technique (exploit) fixed sometime in 2006

This code also implements assist caps to cut down on trains (5 by default)
Unsure if live what this number is (it exists) or if it's a per NPC basis

An NPC with Assist Aggro will not call for help, only NPCs with Primary Aggro will
2015-12-18 17:41:57 -05:00
Michael Cook (mackal) f8867ea73d Bump up initial aggro from Yell for Help to match initial aggro
I guess I forgot this one
2015-12-18 13:46:05 -05:00
Michael Cook (mackal) 488be05e0e Add DB manifest for eqtime change 2015-12-17 19:50:33 -05:00
Alex 78c99d0be0 Merge pull request #474 from regneq/master
EQTime will now save to database instead of file.
2015-12-17 16:14:46 -08:00
Alex f4479c5cd7 Merge pull request #469 from Shendare/augmentation
Augmentation Feature Patch; going to merge since there's video evidence you tested it and no one seems to have any problem with it.
2015-12-17 16:14:36 -08:00
regneq d449d4f54c EQTime will now save to the DB once every 10 real world minutes. 2015-12-17 15:49:37 -08:00
regneq 17bbd8dfbe eqtime is now stored in the DB.
required/2015_12_17_eqtime.sql
2015-12-17 14:14:04 -08:00
Alex c1feb93e2e Merge pull request #473 from noudess/master
Repair issue with Bind Wounds when you are binding someone that is binding themselves.
2015-12-17 13:09:33 -08:00
Paul Coene 07ab58483d Updated changelog 2015-12-16 09:16:27 -05:00
Paul Coene 2865278987 Merge remote-tracking branch 'upstream/master' 2015-12-16 09:11:43 -05:00
Paul Coene bc77439d11 When binding someone else's wounds, the code tried to send a bind
would response to client with a type of 2.  The intent (based on
comments was to get the client to display a "stand still" message
on the receiving client.

That reply message was not generating that message, but if the client
you were binding was also binding his own  wounds, it would cause your
target to stand up, interrupting his bind.

I replaced this client reply with a simple, directed client message.  It all
seems to work fine now.
2015-12-16 09:05:27 -05:00
Uleat 78f22599f4 Tweak to commandaliases behavior 2015-12-15 19:03:24 -05:00
Akkadius 24ea7e03f1 Merge branch 'master' of https://github.com/EQEmu/Server 2015-12-15 12:59:46 -06:00
Uleat 101bbdfd29 Merge branch 'master' of https://github.com/EQEmu/Server 2015-12-14 17:38:32 -05:00
Uleat c9ecca1a56 Added 'alias added' message and commmandaliases list (future use) 2015-12-14 17:38:24 -05:00
Natedog2012 f0222bb94b Adjust changelog.txt [skip ci] 2015-12-14 12:37:28 -08:00
Akkadius 2fb63d4d26 Merge pull request #472 from KinglyKrab/master
Adds IsBlind() and IsFeared() functionality to Perl and Lua.
2015-12-14 14:11:26 -06:00
Kinglykrab 6949f29295 Adds IsBlind() and IsFeared() functionality to Perl and Lua. 2015-12-14 15:01:58 -05:00
Natedog2012 b3afc684de Allow updating instance timers through perl and lua. 2015-12-14 11:16:09 -08:00
Natedog2012 baaf5801ff Added ability to manipulate disciplines for perl and lua. Also ability to remove spells from spell bar with spellID. 2015-12-14 01:22:59 -08:00
Uleat ee644f7b3e Make better sense things do, after cups of coffee two 2015-12-12 21:36:14 -05:00
Uleat cfde67fcb3 Missed a 'command' note 2015-12-12 17:22:29 -05:00
Akkadius fa872c6030 Some rule code cleanup 2015-12-12 00:37:31 -06:00
Uleat 6802f2a9e8 Conversion of 2015_09_30_bots.sql fail points to perl script; Added drop bots feature to eqemu_update.pl menu 2015-12-11 22:39:18 -05:00
Akkadius 80ef4c7f9f Adjust default Loginserver log settings [skip ci] 2015-12-09 23:24:53 -06:00
Akkadius c2af87431a Fixed a ridiculous issue where world wasn't trying to reconnect to loginservers 2015-12-09 23:21:19 -06:00
Akkadius ffe46bd4d2 Implement Loginserver auto account creation via login.ini option auto_create_accounts = TRUE 2015-12-09 23:01:07 -06:00
Akkadius d7ca2440d3 More loginserver stuff [skip ci] 2015-12-09 22:24:17 -06:00
Akkadius 7a17089b8a Fix remaining loginserver log things 2015-12-09 20:47:59 -06:00
Akkadius efe09f6fe5 Remove old error_log system from the Loginserver 2015-12-09 20:33:20 -06:00
Akkadius 75cddbea71 Loginserver conversion to new Logging system 2015-12-09 20:30:47 -06:00
Akkadius 22496e2ae2 Update eqemu_update.pl [skip ci] 2015-12-09 19:28:56 -06:00
Akkadius acb8e63d9c Update eqemu_update.pl [skip ci] 2015-12-09 01:14:45 -06:00
Akkadius e297de3830 Update eqemu_update.pl [skip ci] 2015-12-09 01:14:07 -06:00
Akkadius f474e171ed Update eqemu_update.pl [skip ci] 2015-12-09 01:02:42 -06:00
Akkadius b499dcc89d Update eqemu_update.pl [skip ci] 2015-12-09 01:00:27 -06:00
Akkadius 98f7766875 Update eqemu_update.pl 2015-12-09 00:21:30 -06:00
Uleat 2159d18920 Fix for VS2012 command.cpp:501 error 2015-12-08 21:15:41 -05:00
Uleat 6f1ad1fbc1 Major change to how commands are loaded 2015-12-07 19:28:13 -05:00
Uleat 1c0192dce3 Fix for guild rank sql error when using bots (thanks N0ctrnl!) 2015-12-02 18:33:49 -05:00
Akkadius f07e708f22 Update eqemu_update.pl [skip ci] :: Add option 13) [Windows Server Loginserver Setup] :: Download and install Windows Loginserver 2015-12-02 15:41:57 -06:00
Akkadius a936796b45 Some more loginserver refactoring to make things more sane to read 2015-12-02 13:46:16 -06:00
Akkadius 2fbf047853 Merge branch 'master' of https://github.com/EQEmu/Server 2015-12-02 13:14:49 -06:00
Akkadius af18377505 Some loginserver refactoring 2015-12-02 13:14:26 -06:00
Uleat fe48f18f71 Added rule-based check for race/class restriction of spell scribing 2015-12-01 20:30:43 -05:00
Akkadius a483d37c26 Re-add some nuked code eqemu_update.pl [skip ci] 2015-12-01 15:27:07 -06:00
Akkadius 549cabe7e8 Added Options 11) and 12) to eqemu_update.pl, updated to version 12
11) [Windows Server Build] :: Download Latest and Stable Server Build (Overwrites existing .exe's, includes .dll's)
12) [Windows Server .dll's] :: Download Pre-Requisite Server .dll's
2015-12-01 15:25:26 -06:00
Uleat 6f8600b885 Draft versions of bot command spell scripts (may still be tweaked based on actual command implementation) 2015-11-30 20:16:21 -05:00
Uleat 3135c92340 Changed criteria in a few bots scripts from count to null-result check 2015-11-30 18:33:27 -05:00
Akkadius c2b0e00cdd Update eqemu_update.pl [skip ci] 2015-11-30 00:34:10 -06:00
Akkadius c0081a0983 Merge branch 'master' of https://github.com/EQEmu/Server 2015-11-30 00:09:03 -06:00
Akkadius 6016ba5140 Add some things to future installer [skip ci] 2015-11-30 00:08:36 -06:00
Natedog2012 4bc844fe3b Work around for Bot::LoadPetBuffs loading buffs with counters 2015-11-24 16:25:21 -08:00
Alex faa8c35554 Merge pull request #470 from noudess/master
Fix mob overpopulation on "idle" zones
2015-11-22 23:20:13 -08:00
Uleat d383ecc5b7 Fix for loginserver project compile failure 2015-11-22 18:31:32 -05:00
Paul Coene b7dc3db703 wMerge remote-tracking branch 'upstream/master' 2015-11-20 14:46:28 -05:00
Michael Cook (mackal) 0fa5b8d3f2 Merge pull request #467 from Cilraaz/master
Old Race/Class Experience Mods
2015-11-20 14:00:03 -05:00
Paul Coene 0c56660692 Merge remote-tracking branch 'upstream/master' 2015-11-20 12:04:11 -05:00
Paul Coene f3120f26ee Fix issue with mobs no depopping (due to spawn_events) while zone is idle. 2015-11-20 12:03:43 -05:00
Michael Cook (mackal) 8464a0e3b5 Implement Guild Banks for RoF/RoF2
Everything appears to work, but please test!
2015-11-17 18:15:46 -05:00
Michael Cook (mackal) 525a39912f Override Mob::GetEndurancePercent() for Merc
This allows their endurance to show in group!
2015-11-15 16:35:11 -05:00
Shendare 7c41472877 Fixed swapping error message
You now get the error message if the augment swap doesn't work, instead
of when it works. One little bang.
2015-11-14 11:40:28 -08:00
Michael Cook (mackal) 7c4abcc68d Fix int16 spell ID limit with items (click, procs, etc)
See issue #7 (Did we resolve it yet?)
2015-11-14 14:37:24 -05:00
KimLS f188851bfb Wont look for mysql .so on non-root systems 2015-11-11 13:52:52 -08:00
KimLS ee2d8a3d6d Fix for FindMySQL not preferring mysql_root hint. 2015-11-11 13:49:10 -08:00
Shendare f6c2c07a94 Augmentation Feature Patch Code Cleanup
Avoided an extraneous GetItem() call when performing an action that
doesn't return an augment to the player. Added additional error checking
and logging. Improved error messages and code comments.
2015-11-10 18:14:47 -08:00
Michael Cook (mackal) 78c75501f7 Reply to the request made on opening XTarget window
This allows the Extended Targets option in the EQ Menu to open the window
2015-11-10 03:27:30 -05:00
Shendare 9e5bfabf91 Augmentation Feature Patch
RoF+ clients now support the built-in adding, swapping, destroying, and
removing of augments in equipment, updating an equipped item's look in
case of ornamentation changes. All clients will now verify that the
proper distiller (or a perfected distiller for RoF+) is being sent for
consumption for safely removing augments. Hard-coded item IDs for
distillers have been replaced with checks on item types.
2015-11-09 22:43:25 -08:00
Akkadius 07f7b18b10 Merge pull request #468 from Shendare/master
Quick query logging addition
2015-11-09 12:19:47 -06:00
Shendare 992797f610 Fixed query logging addition
Resolved platform specific function use.
2015-11-08 22:41:39 -08:00
Shendare ad04b308c0 Quick query logging addition
Reports records affected by inserts, updates, and deletes as well as the
records returned by selects.
2015-11-08 22:18:51 -08:00
Akkadius 18c97ca637 Fix some indents, not sure how they got messed up [skip ci] 2015-11-07 13:23:15 -06:00
Akkadius d64205124f Implemented #repopclose [distance in units] - Used for development purposes, defaults to 500 units
- Real case use: Large zones with 700 NPC's and you are making fast quick tweaks to nearby NPC's you can refresh just the NPC's around you instead of all in the zone
- This can be quite the time saver
- This command will depop all NPC's and only respawn the NPC's that are 500 units around you or unless you specify otherwise
2015-11-07 13:20:24 -06:00
Uleat 86f35e45d3 Fix for LoadBot() hp issue 2015-11-04 23:30:46 -05:00
Michael Cook (mackal) a6f6e18969 Implement cast restriction 700 (NPC only) 2015-11-03 18:43:47 -05:00
Cilraaz 9d01e832a8 Merge remote-tracking branch 'upstream/master' 2015-11-03 15:12:27 -05:00
Michael Cook (mackal) 8d80f39ead Fix copy paste error 2015-11-03 14:17:55 -05:00
Michael Cook (mackal) 63ae7ac315 Add Casting Restrictions to SE_CurrentHP (DoTs) buff processing 2015-11-03 14:16:36 -05:00
Michael Cook (mackal) e7184f402d Add Casting Restrictions to SE_CurrentHPOnce 2015-11-03 14:16:36 -05:00
Michael Cook (mackal) 835fbb81cb Expand Casting Restrictions
Mostly to nerf HT, not fully implemented
2015-11-03 14:16:36 -05:00
Akkadius 27c8a85f61 Change AI_scan_area_timer to have a little variability in renewing a new timer time versus deciding one on spawn and sticking with it 2015-11-02 23:23:04 -06:00
Akkadius 67c7254fd1 Copy paste fail [skip ci] 2015-11-02 22:48:17 -06:00
Akkadius 9304e09eca Adjust changelog.txt [skip ci] 2015-11-02 22:15:40 -06:00
Akkadius 63051dda9c Performance boost (exponential) - Adjusted default idle cast check timers in rules
- NPC:NPCToNPCAggroTimerMin	500 (Now 6000) 6 seconds
	- NPC:NPCToNPCAggroTimerMax	2000 (Now 60000) 60 seconds
	- Database version 9089 will take care of this update automatically only if you used the default values
	- The CPU cost of NPC's checking the entire entity list to cast beneficial spells (Heals/Buffs) becomes extremely high when
		higher NPC count zones exist (Based off of process profiling)
			- Distance checks for every single NPC to every single other NPC who are casting beneficial spells occur every .5 - 2 seconds unless
				npc_spells dictates other values, which most of the time it does not
	- Zones that once fluctuated from 1-8% CPU with no activity (Idle but players present) now idle at .5% based on my testings due
		to this change in conjunction with the past few performance commits, these are zones that have 600-800 NPC's in them
	- These values normally are overidden by the spells table (npc_spells), fields (idle_no_sp_recast_min, idle_no_sp_recast_max)
2015-11-02 22:12:41 -06:00
Akkadius f884d8d738 Fix an issue where during a depop cycle and NPC's are engaged by wiping hatelist before issuing NPC depop 2015-11-02 21:33:36 -06:00
Michael Cook (mackal) 21acd79acf Fix procs that have end cost from consuming end 2015-11-02 17:58:35 -05:00
Cilraaz 7b819c9edf Merge remote-tracking branch 'upstream/master' 2015-11-02 11:25:54 -05:00
Akkadius f4983f090d Once again another adjustment to npc to npc aggro check timer [skip cki] 2015-11-01 20:56:03 -06:00
Akkadius 0ee70a663c Small adjustments to my rushing [skip ci] 2015-11-01 20:31:01 -06:00
Akkadius e8d18cb014 Made many performance optimizing oriented code changes in the source
- Added Rate limit the rate in which signals are processed for NPC's (.5 seconds instead of .01 seconds)
Added Perl Export Settings which should heavily reduce the Perl footprint
	- Normally when any sub EVENT_ gets triggered, all kinds of variables have to get exported every single time an event is triggered and
		this can make Perl very slow when events are triggered constantly
			- The two most taxing variable exports are the item variables ($itemcount{} $hasitem{} $oncursor{}) and qglobals ($qglobals{})
			- qglobals can pose to be an issue quickly when global qglobals build up, it is highly recommend to use the GetGlobal() and SetGlobal()
				methods instead as they don't reference the hashmap $qglobals{} that is rebuilt every single time a sub event is triggered
	- A stress test conducted with 10,000 samples shows an excess of time taken to export variables: http://i.imgur.com/NEpW1tS.png
	- After the Perl Export Settings table is implemented, and all exports are shut off you see the following test result:
		http://i.imgur.com/Du5hth9.png
	- The difference of eliminating uneeded exports brings the overhead and footprint of 10,000 triggers from 54 seconds to 2 seconds
	- In a 10,000 sample test (10,000 sub event triggers), exporting item variables adds 12 seconds alone, when item variables are only needed in
		EVENT_ITEM and EVENT_SAY a majority of the time if at all
	- In a 10,000 sample test (10,000 sub event triggers), exporting qglobals with approximately 1,000 global qglobals in the database creates
		about 11-20 seconds of delay on its own (Depending on hardware of course)
	- I've written a parser that has determined which of these exports are needed in which sub routines and have turned off all of the unneeded
		exports in sub routines that do not need them and used it to create the default table that will be installed in the database.
	- The export table is called 'perl_event_export_settings' and it resembles the following structure and contains all current 81 EVENTS
		- If an entry doesn't exist in this table and a new subroutine is added to the source, all exports will be on by default for that routine

	+----------+-----------------------------------------+-----------------+------------+-------------+-------------+--------------+
	| event_id | event_description                       | export_qglobals | export_mob | export_zone | export_item | export_event |
	+----------+-----------------------------------------+-----------------+------------+-------------+-------------+--------------+
	|        0 | EVENT_SAY                               |               1 |          1 |           1 |           1 |            1 |
	|        1 | EVENT_ITEM                              |               1 |          1 |           1 |           0 |            1 |
	|        2 | EVENT_DEATH                             |               1 |          1 |           1 |           0 |            1 |
	|        3 | EVENT_SPAWN                             |               1 |          1 |           1 |           0 |            1 |
	|        4 | EVENT_ATTACK                            |               0 |          1 |           1 |           0 |            1 |
	|        5 | EVENT_COMBAT                            |               1 |          1 |           1 |           0 |            1 |
	+----------+-----------------------------------------+-----------------+------------+-------------+-------------+--------------+

	- If a change is made to this table while the server is live and running, you can hot reload all zone process settings via:
		#reloadperlexportsettings
	- For those who wonder what "exports" are, they are reference to variables that are made available at runtime of the sub event, such as:
		(export_qglobals) (Heavy) : $qglobals https://github.com/EQEmu/Server/blob/master/zone/embparser.cpp#L916
		(export_item) (Heavy) : $itemcount{} $hasitem{} $oncursor{} https://github.com/EQEmu/Server/blob/master/zone/embparser.cpp#L1103
		(export_zone) : $zoneid, $instanceid, $zoneln etc. https://github.com/EQEmu/Server/blob/master/zone/embparser.cpp#L1083
		(export_mob) : $x, $y, $z, $h, $hpratio etc. https://github.com/EQEmu/Server/blob/master/zone/embparser.cpp#L1032
		(export_event) : (event specific) IE: EVENT_SAY ($text) https://github.com/EQEmu/Server/blob/master/zone/embparser.cpp#L1141
2015-11-01 20:29:51 -06:00
Akkadius 6de2bb720f Adjust AI_scan_area_timer to randomly start between 1-3 ticks (6-18 seconds) 2015-11-01 17:49:45 -06:00
Akkadius 66c7deb2ac Remove some debug junk 2015-11-01 17:46:00 -06:00
Akkadius ce0011ab18 Renaming of some timers 2015-11-01 17:12:14 -06:00
Akkadius 2a69ae42ee (Performance) Rate limit the rate in which signals are processed for NPC's 2015-11-01 17:02:52 -06:00
Akkadius e5ad5e13db Comment out Log.Out super hot path line 2015-11-01 16:11:25 -06:00
Akkadius 624c7341c5 Refactor cfp to currently_fleeing for readability 2015-11-01 16:02:41 -06:00
Akkadius 53c8d63981 Implement Perl Export Variable settings map (Huge performance boost) (Preliminary) 2015-11-01 15:59:24 -06:00
Akkadius 33917fe2a9 - Add Zone Process ID (OS PID) as information passed back to world, ultimately with the ability to display it in the telnet console under 'zonestatus'
- Refactored some zoneserver/worldserver code for readability
2015-10-31 20:19:57 -05:00
Akkadius ab3e31154c Adjust AI Aggro check timers for NPC's with npc_aggro flag set to be far less excessive (Performance increase) 2015-10-31 18:32:23 -05:00
Michael Cook (mackal) 1dd911b150 Correct charm invis breaking 2015-10-30 16:45:34 -04:00
Natedog2012 ec36a3787d Allow ModifyNPCStat to change npc spell effects lists 2015-10-21 01:24:51 -07:00
Natedog2012 376b04a37b Allow ModifyNPCStat to change an NPCs spell list 2015-10-19 10:05:50 -07:00
Uleat 861d057fe5 Merge branch 'master' of https://github.com/EQEmu/Server 2015-10-16 18:09:50 -04:00
Uleat 85adea631d Activated load/save of new bot data fields; added command '#bot clearfollowdistance' 2015-10-16 18:09:22 -04:00
KayenEQ d91e7731c3 Merge pull request #465 from KayenEQ/Development
Optional but recommended SQL to update spells_new table fields.
2015-10-15 18:24:06 -04:00
KayenEQ 190ebbbc6f Optional but recommended SQL to update spells_new table fields. 2015-10-15 18:22:56 -04:00
Cilraaz e2f1456624 Allow For Old Race/Class Experience Modifiers
Add new ruletypes 'Character:UseOldRaceExpPenalties' and 'Character:UseOldClassExpPenalties'

When set to true, adds in bonuses/penalties that existed in Classic

Class-based penalties were disabled during Velious, while race-based penalties were not removed until TSS

This method uses the original SOE method of increase exp needed to level, rather than decreasing exp gained
2015-10-14 22:57:17 -04:00
Michael Cook (mackal) efeb80cc8b Fix MGB not always turning off and make it work for discs 2015-10-14 16:36:38 -04:00
Uleat 98bc7f0ccd Activated load/save of new bot inventory fields (not use implementation) 2015-10-13 19:29:49 -04:00
Uleat 285bd3a627 Updated '2015_09_30_bots.sql' to alleviate import failures due to broken contraints 2015-10-13 14:00:51 -04:00
Uleat d3755cdb08 Temporarily disabled the bot script until a linux issue can be sorted out 2015-10-13 00:30:23 -04:00
Uleat 0a27ab372d Merge branch 'master' of https://github.com/EQEmu/Server 2015-10-12 21:17:07 -04:00
Uleat b85850052a Fix for creation_date mis-naming 2015-10-12 21:16:54 -04:00
KayenEQ d83cd0ce89 Merge pull request #464 from KayenEQ/Development
FD break from spells
2015-10-12 19:53:43 -04:00
KayenEQ e2e8d444e9 Feign death will now break when hit by casted spells, consisted with live.
Implemented suport for AA/spell effect which provides a chance to avoid FD breaking from spells.
2015-10-12 18:51:41 -04:00
Uleat 4a61558de8 Merge branch 'master' of https://github.com/EQEmu/Server into bots_updater 2015-10-12 18:27:54 -04:00
Uleat eeab7baef9 Final commit for bots database versioning 2015-10-12 18:27:26 -04:00
Uleat df88107697 Missed on final review... 2015-10-12 17:59:29 -04:00
Uleat 79eb2d3d4b Remote testing and some final updates 2015-10-12 17:17:07 -04:00
Michael Cook (mackal) 8ed255ad01 Fix expansionless AAs 2015-10-12 14:07:14 -04:00
Akkadius eb4e970c30 Unfix the fix [skip ci] 2015-10-11 21:59:16 -05:00
Akkadius 71d36af3ef eqemu_update.pl minor fix [skip ci] 2015-10-11 17:10:10 -05:00
KimLS f19648f615 Will prefer libmysql(dynamic) over mysqlclient(static) library for linking. Update travis.yml for new travis-ci container types. 2015-10-10 22:06:54 -07:00
Uleat c508b48b42 Merge branch 'master' of https://github.com/EQEmu/Server into bots_updater 2015-10-10 19:28:31 -04:00
Uleat e1a5853389 Updated bots load/drop scripts (thanks Shendare!) 2015-10-10 19:27:39 -04:00
KayenEQ b923c69f39 Merge pull request #463 from KayenEQ/Development
Invisible/Hide mechanics when cast on
2015-10-10 15:42:19 -04:00
KayenEQ 261b6a4623 Invisible/Hide mechanics when cast on
Updated mechanics to be consistent with live regarding how invisible breaks when the client is the target of a spell.
Invisible will drop whenever a client is hit with a detrimental spell, regardless of if resisted, if it does damage or AOE.
Hide skill now also follows the same rules as above.
Implemented support for Rogue AA - Nerves of Steel which gives a chance for hide NOT to break
when client is hit with an AOE spell.
2015-10-10 15:16:49 -04:00
Uleat 531cbf79f5 Merge branch 'master' of https://github.com/EQEmu/Server into bots_updater 2015-10-09 21:39:05 -04:00
Uleat ecd695ff9b Script and server code query updates for bots_updater 2015-10-09 21:34:31 -04:00
KayenEQ 817059a2e8 Merge pull request #462 from KayenEQ/Development
Updated a few AA effects to use database values instead of hard coded …
2015-10-09 14:42:10 -04:00
KayenEQ aae073f588 update 2015-10-09 14:29:15 -04:00
KayenEQ 79c9862131 Few more AA updates to use database instead of hard coded values. 2015-10-09 14:04:39 -04:00
KayenEQ 902a850c71 Merge pull request #461 from KayenEQ/Development
Updated a few AA effects to use database values instead of hard coded …
2015-10-09 13:58:04 -04:00
KayenEQ 2cf59ae2f2 Updated a few AA effects to use database values instead of hardcoded values. 2015-10-09 13:08:24 -04:00
KayenEQ 3bdd954ac0 Merge pull request #460 from KayenEQ/Development
Implemented SE_PC_Pet_Flurry_Chance
2015-10-08 19:58:32 -04:00
KayenEQ 43671fa749 Implemented SE_PC_Pet_Flurry_Chance 466 // Base1 % chance to do flurry from double attack hit. 2015-10-08 19:26:04 -04:00
KayenEQ 4835e87142 Merge pull request #459 from KayenEQ/Development
Implemented spells_new field 198 = no_detrimental_spell_aggro
2015-10-08 16:30:07 -04:00
KayenEQ 20bdbdd52d Implemented spells_new field 198 = no_detrimental_spell_aggro
Spells with this flag will not generate any aggro
Note: DOT portions of spells wilth this flag STILL generate aggro.
Example Harminous Arrow (Ranger AA) 16127
2015-10-08 16:05:14 -04:00
Michael Cook (mackal) 9bff5baa1c Nuked. 2015-10-08 13:36:04 -04:00
KayenEQ 5aa99aeef1 Merge pull request #458 from KayenEQ/Development
Update/Implementation of various fields in spells_new
2015-10-08 12:07:25 -04:00
KayenEQ c35eacbc99 Update/Implementation of various fields in spells_new
219 not_extendable - > not_focusable - No focus are applied to these spells
217 maxtargets -> no_heal_damage_item_mod - Not applied to these spells.
232 -> no_remove -> Can not click off these spells even if beneficial
209 powerful_flag -> no_resist -> Unresistable spell
2015-10-08 11:49:21 -04:00
Akkadius 893f752520 Fix for proper script exit eqemu_update.pl [skip ci] 2015-10-08 09:41:47 -05:00
Akkadius ffe1bede52 eqemu_update.pl additions for EQEmu Installer to come [skip ci] 2015-10-06 14:26:53 -05:00
Akkadius 2680fc1a83 Preliminary routines for modular installer efforts [skip ci] 2015-10-05 01:07:59 -05:00
Akkadius aaae583dab Fix hash order [skip ci] 2015-10-04 20:48:11 -05:00
Akkadius 8973059961 Fix menu links [skip ci] 2015-10-03 22:13:16 -05:00
Akkadius 658b6ba570 Adjustments to eqemu_update.pl menu (V11) 2015-10-03 20:23:39 -05:00
Akkadius bcf2a5c852 eqemu_update.pl minor adjustment, v10 [skip ci] 2015-10-03 16:03:53 -05:00
Uleat 9bf4f399da Temporarily disabled bot versioning until script methods are corrected 2015-10-03 13:42:00 -04:00
Akkadius 625df2ad9b Forgot one part [skip ci] 2015-10-02 20:31:24 -05:00
Akkadius 3e42cae123 Complete support for bots database versioning in eqemu_update.pl (Option 10), ready for Uleat to take it from here [skip ci]
- The one thing to note is that world bootup will not be interrupted with required bot updates, however full versioning is supported.
2015-10-02 20:30:30 -05:00
Uleat 3ac87c8e31 Merge branch 'master' of https://github.com/EQEmu/Server into bots_updater 2015-10-02 20:49:13 -04:00
Uleat 07ee9901b7 Name change for base bot schema sql files 2015-10-02 20:48:24 -04:00
Akkadius 1e3f7b14c8 Bots database versioning (prep) [skip ci] 2015-10-02 19:40:58 -05:00
Akkadius cbcfa2f2df Fix issue with an old SQL update and newer database engines [skip ci] 2015-10-02 19:35:02 -05:00
Uleat 75da37b7b4 Merge branch 'master' of https://github.com/EQEmu/Server into bots_updater 2015-10-02 19:11:59 -04:00
Uleat a5f805e1f7 Unversioned... 2015-10-02 18:59:56 -04:00
Uleat 0999278b75 Initial bots_updater commit 2015-10-02 18:57:51 -04:00
Michael Cook (mackal) 321fa9cd50 Merge pull request #457 from Cilraaz/master
Update to give client access to the proper AAs for the expansions all…
2015-09-30 13:30:44 -04:00
Cilraaz 8323f6af7b Update to give client access to the proper AAs for the expansions allowed
Bit shifting by expansion value minus 1, rather than expansion value
2015-09-30 12:58:05 -04:00
Uleat a1089fccd6 Implemented 'Inventory Snapshot' feature 2015-09-25 23:07:05 -04:00
KayenEQ 41d19c4e8a Merge pull request #456 from KayenEQ/Development
Implemented a few new stackable spell damage focus effects from live.
2015-09-25 05:19:56 -04:00
KayenEQ 370b5d7810 Implemented a few new stackable spell damage focus effects from live.
Implemented SE_ImprovedDamage2				461 // Increase spell damage by percent (SE_Fc_Damage_%2)
Implemented SE_FcDamageAmt2     		462 // Increase spell damage by flat amount (SE_Fc_Damage_Amt2)
2015-09-25 05:18:30 -04:00
KayenEQ eb1d43020e Merge pull request #455 from KayenEQ/Development
Implemented SE_PC_Pet_Rampage
2015-09-25 04:46:13 -04:00
KayenEQ a11816fddf Implemented SE_PC_Pet_Rampage 464 - Base1 % chance to do rampage for base2 % of damage each melee round 2015-09-25 04:44:17 -04:00
Michael Cook (mackal) 957aba7ae5 Fix Sinister Strikes calc 2015-09-24 19:39:36 -04:00
Michael Cook (mackal) d0f9a14217 Revert "Fix likely dev typo in sinister strikes calc"
This reverts commit 72aaf56c79.
2015-09-24 19:33:16 -04:00
KayenEQ 41dc7622f9 Merge pull request #454 from KayenEQ/Development
Implemented spells_new field 217 override_crit_chance
2015-09-22 03:03:11 -04:00
KayenEQ cc0d0cc126 Implemented spells_new field 217 override_crit_chance
Determines the maximum chance this spell has to critical hit.
Ie. If set to 15, the spell will never critical more then 15% of the time
regardless of your characters innate chance to critcal from AAs.
2015-09-22 03:02:24 -04:00
KayenEQ b3ded44a59 Merge pull request #453 from KayenEQ/Development
Added the latest spell effects to spdat.h for future implementation.
2015-09-21 20:30:08 -04:00
KayenEQ ccbaccd0c1 Added the latest spell effects to spdat.h for future implementation. 2015-09-21 20:28:48 -04:00
Akkadius bc525e33c5 Fixed an issue where tints and weapons weren't being refreshed on Mob::SendIllusion triggers from scripts 2015-09-21 15:28:29 -05:00
Akkadius 13ba997589 Update eqemu_update.pl (v8) to use new AA data post AA rework for fresh AA table downloads [skip ci] 2015-09-20 15:21:38 -05:00
Akkadius 4c0a9562ee Update db_dumper.pl (Database backup) script to only create backups with underscores as space delimiters (db 09-2-2015.sql) vs Now: (db_09_20_2015.sql) [skip ci] 2015-09-20 15:12:00 -05:00
Michael Cook (mackal) 72aaf56c79 Fix likely dev typo in sinister strikes calc 2015-09-20 03:58:21 -04:00
Michael Cook (mackal) 9408403a00 Fix damage bonus calculations
Based on dev quotes, nerfs Sinister Strikes
2015-09-18 19:50:48 -04:00
Michael Cook (mackal) 211462456c More hate fixes
Refix double spell casting subtlety
Fix double spell casting subtlety for beneficial spells
Move 100 initial bonus to AddToHateList so melee get it as well
Lower prox aggro since the 100 bonus is in AddToHateList now
2015-09-17 01:46:40 -04:00
Uleat b24f1914ab Minor fix for opcode_handlers.py (Underfoot to UF) 2015-09-16 19:45:28 -04:00
Michael Cook (mackal) 548701cba6 Fix int underflow error in disc reuse timers focus 2015-09-04 14:07:01 -04:00
Michael Cook (mackal) 0d3bd5988b Fix issue when RemoveXTarget was called with a mob not on our XTargets
This could be better, but works for now
2015-09-04 12:12:29 -04:00
Michael Cook (mackal) 5126104fd6 Some crash fixes noticed on EQMacEmu 2015-09-03 20:42:35 -04:00
Michael Cook (mackal) 64deca11b2 Woops, gotta initialize the new flag 2015-09-03 03:05:50 -04:00
Michael Cook (mackal) 4ae02e5efe XTargets will move auto entries up on removal like live
This also makes use of the bulk packet so not a crap ton of packets
generated.
2015-09-03 02:58:04 -04:00
Akkadius b7ee4634be Merge pull request #452 from KinglyKrab/master
Fixed #bot resist commands.
2015-08-31 15:46:12 -05:00
Kinglykrab b868cbbcfe Fixed #bot resist commands. 2015-08-31 14:41:58 -04:00
Michael Cook (mackal) 7002ee184a Merge pull request #451 from KinglyKrab/master
Fixed #npcedit rangedtype.
2015-08-28 15:19:38 -04:00
Kinglykrab 53292a99a2 Fixed #npcedit rangedtype. 2015-08-28 15:15:19 -04:00
Michael Cook (mackal) 43586a33cd Port PROX_AGGRO from EQMacEmu
If this ability is set, the NPCs will continuously add things to their
hate list while their engaged. If it's not set (default) they won't,
which is what the vast majority of NPCs do on live.
2015-08-26 16:20:56 -04:00
Michael Cook (mackal) 839b6e25d8 Fix "same spell line" optimization for same spell mana burns ... 2015-08-24 02:15:41 -04:00
Michael Cook (mackal) 39e35fa011 Temp solution for AE ramp crash 2015-08-21 03:09:27 -04:00
Michael Cook (mackal) 1d6a185f0f Break "same spell line" optimizations for mana burns 2015-08-19 22:21:17 -04:00
Michael Cook (mackal) 60c6583c54 Fix readability [skip ci] 2015-08-19 14:44:46 -04:00
Uleat bc9f85843e Fix for SoF character select screen issue 2015-08-17 23:23:24 -04:00
Alex ce2c1b585f Merge pull request #450 from noudess/master
Fix buffdurationpacket for seeinvis spells
2015-08-15 19:13:04 -07:00
Paul Coene a2c5f359d8 Fix buffdurationpacket for seeinvis spells 2015-08-15 20:14:15 -04:00
Michael Cook (mackal) a4d0db8e0a Implement the extra Wild Rampage/Rampage message (SoD+) 2015-08-15 00:34:10 -04:00
Michael Cook (mackal) fe0758c984 Add EVENT_TICK for NPCs
This event fires at the start of the tick processing so we can
script on the actual tick.
2015-08-13 22:30:49 -04:00
Michael Cook (mackal) 1fc23beb78 Clear auto XTargets on WipeHateList 2015-08-12 23:36:59 -04:00
Michael Cook (mackal) f46b88bbde Merge pull request #447 from noudess/master
Fix snow so it ends correctly.
2015-08-08 19:28:00 -04:00
Michael Cook (mackal) 4a3701f05a Merge pull request #449 from KinglyKrab/master
GetAccountAge() for Perl.
2015-08-08 19:26:30 -04:00
Kinglykrab ede969a614 Added GetAccountAge() functionality to Perl so people can grant veteran AAs based on account age. 2015-08-08 17:09:57 -04:00
Michael Cook (mackal) e0d65df4de Fix #myskills crash 2015-08-06 20:29:55 -04:00
Paul Coene 4e538d14c8 Fix snow so it ends correctly. Packet is different from the all zeros sent
to end rain.  End packets need to have the type that is ending.
2015-08-04 09:48:39 -04:00
Akkadius a04e78cfd1 Shendare: VS2013 query StringFormat glitches when "%f" is passed for the int GetRunSpeed().
Shendare: In CreateNewNPCCommand(), the npc_type_id and spawngroupid are created in the database, but never set in the spawn class, so later it can't delete them with #npcspawn remove or #npcspawn delete.
2015-08-02 02:24:26 -05:00
Akkadius 4106251497 Merge pull request #446 from KinglyKrab/master
Added $client->GetMoney(type, subtype) to Perl/Lua.
2015-08-01 21:28:35 -05:00
Kinglykrab 892fb58b18 Added $client->GetMoney(type, subtype) to Perl/Lua.
Types:
- 0: Copper
- 1: Silver
- 2: Gold
- 3: Platinum
Sub Types (if applicable):
- 0: On Character
- 1: In Bank
- 2: On Cursor
- 3: Shared Bank (only applies to Type 3/Platinum)
2015-08-01 01:28:50 -04:00
Michael Cook (mackal) 7fc8841a67 Fix AE Ramp iterator issue 2015-07-31 02:00:09 -04:00
Michael Cook (mackal) b98bc207fb Move AE Ramp back to 1 target until iterator invalidation issue is resolved 2015-07-31 01:46:16 -04:00
Michael Cook (mackal) f380519803 Fix error with previous commit 2015-07-30 21:42:55 -04:00
Michael Cook (mackal) 0513f1ad5d Default area rampage to unlimited targets 2015-07-30 21:26:51 -04:00
Uleat 4c9a3b7c29 Fix for crash potential in Client::Handle_OP_ShopPlayerBuy 2015-07-27 22:13:55 -04:00
Michael Cook (mackal) be459de555 Fix issue with adding spells via quest to an empty list 2015-07-27 01:20:21 -04:00
Drajor 4258e5cebc Fixes #445 (Integer wrap in Inventory::HasItem)
unit8 changed to uint32 will prevent wrapping, excepting maybe extreme
cases. Fixes #445
2015-07-25 17:13:18 +10:00
Drajor 22a157787e Fix for ClientTaskState::UpdateTasksOnDeliver
Fix for issue introduced in changes to allow stacked items to be handed
in. Calling GetCharges on an item that can not be stacked will return 0
so this mean't that task credit was not awarded for single items.
2015-07-25 16:14:33 +10:00
Alex 26e153727e Merge pull request #444 from KinglyKrab/master
Files changed: ruletypes.h, client.cpp
2015-07-22 19:39:32 -07:00
KimLS 97e47dcbfb Fix for localaddress overwriting address 2015-07-22 17:42:57 -07:00
Michael Cook (mackal) fb4cc70999 Correct some Aggro calcs
See updated post: http://www.eqemulator.org/forums/showthread.php?t=39819

Aggro:MaxStunProcAggro renamed to Aggro:MaxScalingProcAggro
2015-07-22 16:31:38 -04:00
Kinglykrab 918bdd73f4 Files changed: ruletypes.h, client.cpp
Files added: 2015_07_22_CommonTongue.sql

Adds new rules so you can change the start Common Tongue value for Iksars, Ogres, and Trolls.
2015-07-22 09:24:06 -04:00
Alex 234b7a3c57 Merge pull request #443 from EQEmu/TaskHandIn
Hand in stacked items
2015-07-22 01:30:39 -07:00
Alex 638c96f24a Merge pull request #442 from af4t/master
Compile fixes for Visual Studio 2015 Community
2015-07-21 22:58:42 -07:00
Drajor 8f78a3fd35 Hand in stacked items
Added support for handing in stacked items and getting task credit for
those items.
2015-07-22 15:50:19 +10:00
Kemmler 8a55106288 Visual Studio 2015 Community compiles bonuses.cpp correctly now. 2015-07-21 00:42:04 -04:00
Kemmler 76b29c04e5 Merge branch 'master' of https://github.com/af4t/Server 2015-07-20 10:53:52 -04:00
Kemmler a2f39e22d1 Merge branch 'master' of git://github.com/EQEmu/Server 2015-07-20 10:47:13 -04:00
Kemmler 5dc63a6d35 Merge branch 'master' of git://github.com/EQEmu/Server 2015-07-20 10:37:26 -04:00
Kemmler c2cbf7a2ab Merge branch 'master' of https://github.com/af4t/Server
Conflicts:
	zone/bonuses.cpp
2015-07-20 10:31:46 -04:00
Kemmler 5952610a7b Very preliminary work with Visual Studio 2015 Community RC/RTM, resolve some version-specific build errors:
1. Standard library functions snprintf & vsnprintf are available thusly named (without the prepended underscores).  Someone may want to check my conditionals against non-MSVC compilers, though.
2. zone/bonuses.cpp throws an internal compiler error with optimize enabled; #pragma disable optimization on VS2015 only on function Mob::NegateSpellBonuses works around it.
2015-07-20 10:27:51 -04:00
Natedog2012 87b4640ff0 Fix bots from loading AAs that are too high of a level for them. 2015-07-20 00:25:45 -07:00
Kemmler 663ff55271 Very preliminary work with Visual Studio 2015 Community RC/RTM, resolve some version-specific build errors:
1. Standard library functions snprintf & vsnprintf are available thusly named (without the prepended underscores).  Someone may want to check my conditionals against non-MSVC compilers, though.
2. zone/bonuses.cpp throws an internal compiler error with optimize enabled; #pragma disable optimization on VS2015 only. Doing further testing as to whether we have to disable optimization for the WHOLE file ...
2015-07-18 16:56:41 -04:00
Michael Cook (mackal) c91374444b Fix bard song hate 2015-07-18 01:01:27 -04:00
Michael Cook (mackal) be16e558ff Fix Spell Casting Subtlety for offensive spells 2015-07-18 00:58:02 -04:00
Michael Cook (mackal) 7cef9a05dd Bump witness fail chance to 50 2015-07-18 00:57:10 -04:00
Michael Cook (mackal) a245fceddd Merge pull request #439 from KinglyKrab/master
New commands.
2015-07-16 22:39:34 -04:00
Michael Cook (mackal) a52ab7ae48 Rework spell aggro based on http://www.eqemulator.org/forums/showthread.php?t=39819<F37> 2015-07-16 22:38:32 -04:00
Kinglykrab eb5e0ee72c New commands.
- #untraindisc [spellid] - Untrains specified discipline.
- #untraindiscs - Untrains all disciplines.
2015-07-16 21:25:24 -04:00
Akkadius 417b034273 Merge pull request #438 from hateborne/master
Add Optional Enforce Task Level Requirement on AssignTask
2015-07-16 18:12:06 -05:00
KimLS 4d68ddc82f More NAT fixes, please work 2015-07-16 15:07:59 -07:00
KimLS 87d42931aa Fix for not having address/localaddress set from not localhost 2015-07-16 14:35:20 -07:00
hateborne cb874ad4e2 Me being a fool.
Added missing closing paran
2015-07-16 14:56:08 -04:00
hateborne 1b8f613391 Amend these to last commit
Forgot to add changelog and adjustment to task.cpp getmin/getmax
2015-07-16 13:46:41 -04:00
hateborne d64f79cb2a Add Optional Enforce Task Level Requirement
Affected:
quest::assigntask
$client->AssignTask

This is to allow those task level requirements in DB to be used,
optionally. It defaults to do not enforce (translated: no change for
current servers), but can be set with an additional flag to both
commands (see below). The LUA bit was added thanks to help from demonstar55.

quest::assigntask(703); # works
quest::assigntask(703, 1); # denies user
$client->AssignTask(701, $npc->GetID()); # works
$client->AssignTask(701, $npc->GetID(), 1); # denies user
2015-07-16 13:41:46 -04:00
Alex c8f6b098c2 Merge pull request #437 from EQEmu/reload_sm
Reload sm
2015-07-16 02:18:37 -07:00
KimLS b7cd0b223f Added two other commands to let you do shared reloading on your own without the hotfix command. Also changed how world determines a zone's address 2015-07-16 01:51:10 -07:00
KimLS 9f1f36cca6 Merge from master 2015-07-15 23:15:25 -07:00
Michael Cook (mackal) 3cd474e960 Updated SpecialAbility lua constants 2015-07-12 23:37:43 -04:00
KimLS 8dd362a101 Fix for launcher not actually sending static ports when set in the db 2015-07-11 13:28:37 -07:00
Michael Cook (mackal) 7909270527 Make sure we actually have the AA they're trying to cast 2015-07-09 02:44:55 -04:00
Michael Cook (mackal) 3c1b499485 Fix Expendable AAs
Thanks to ASan
2015-07-09 02:37:43 -04:00
KimLS a69fbb9e0b Set -> Get Timer 2015-07-08 18:10:04 -07:00
KimLS 753f53be1b Some small tweaks to reduce the amount of SendPosUpdates() are actually getting sent out on the wire. 2015-07-08 17:10:55 -07:00
Michael Cook (mackal) 3455d70ca2 Make SPECATK_QUAD uncheesable
Live seems to have w kinds of "quads" one is an innate DW
but people found out you could cheese them so luclin+ you can't anymore

so INNATE_DW you can give the NPC a 2h and they will stop quadding
QUAD they will accept the 2h but still quad
2015-07-07 17:20:37 -04:00
Michael Cook (mackal) e70e11f86c Merge pull request #436 from KinglyKrab/master
Bot command changes.
2015-07-06 16:55:52 -04:00
Kinglykrab 2ca5a4ade6 Bot command changes.
- #bot ai mez is now #bot mez
- #bot bindme is now #bot bind
- #bot runeme is now #bot rune
- #bot augmentitem now has an alias of #bot ai
- #bot giveitem now has an alias of #bot gi
- Removed unused #bot groupmessages
- Removed useless additional parameters (c->GetName()/sep->arg[2])
- Formatted loops and conditionals.
2015-07-06 16:28:17 -04:00
Michael Cook (mackal) 1e75b4ba77 Implement Triple Attack as a skill
See change log for more details
Optional SQL will max toons triple attack skills
2015-07-06 16:11:00 -04:00
Alex 5a73d26d12 Merge pull request #435 from KinglyKrab/master
Fixed guild windows on bot-enabled servers.
2015-07-06 11:08:10 -07:00
Kinglykrab 61c9a07596 Fixed guild windows on bot-enabled servers. 2015-07-06 14:05:09 -04:00
Alex 88dfc4abd8 Merge pull request #434 from KinglyKrab/master
Bot saylinks and command aliases.
2015-07-06 10:30:34 -07:00
Kinglykrab e2ac647e03 Bot saylinks and command aliases. 2015-07-05 23:30:38 -04:00
Michael Cook (mackal) 1d29c873fb Rewrite NPC combat rounds logic
See changelog.txt
2015-07-05 16:36:12 -04:00
Michael Cook (mackal) 70577584ab Make SPECATK_QUAD == SPECATK_INNATE_DW when Combat:UseLiveCombatRounds is true 2015-07-05 03:33:16 -04:00
Michael Cook (mackal) dcd1a07553 Fix issue with two hander for NPCs dual wielding
Cleaned up some other 2hander logic as well
2015-07-05 03:11:25 -04:00
Michael Cook (mackal) d083262555 Fix clients offhand double attack check 2015-07-05 02:43:33 -04:00
Michael Cook (mackal) fe97af4d89 Fix some issues with Rampage/AE Ramp 2015-07-05 02:27:51 -04:00
Michael Cook (mackal) 22efe33f9b Correct the definition of "quading"
If you would like your NPCs to use the old rules, turn
Combat:UseLiveCombatRounds to false.
2015-07-05 02:05:50 -04:00
Michael Cook (mackal) 82fe15190b Add CheckDoubleAttack for mobs 2015-07-05 01:37:14 -04:00
Michael Cook (mackal) 7c89ab3fec Pull Mob mainhand/offhand attack rounds into their own functions 2015-07-05 01:15:46 -04:00
Michael Cook (mackal) 578bbf657a Make Client::AI_Process in line with uncharmed 2015-07-05 00:46:37 -04:00
Michael Cook (mackal) 99620f8535 Add Mob/Client CheckDualWield functions 2015-07-05 00:45:46 -04:00
Michael Cook (mackal) 8d3d3d2af2 Add Dual Wield/Double Attack NPC skill overrides
The vast majority of mobs on live follow this path. The exception
appears most commonly with PC pets though. Eventually these should
be changeable in the DB.
2015-07-05 00:42:06 -04:00
JJ 947145a642 Oops. [skip ci] 2015-07-04 12:12:18 -04:00
JJ fe98b3363d Filename consistency. [skip ci] 2015-07-04 12:10:58 -04:00
Michael Cook (mackal) 49e9c9ee34 Reworked activated avoidance skills based on dev quotes 2015-07-04 02:13:26 -04:00
Natedog2012 80c2d9d68d Set a deity for bots so they can LoadAA 2015-07-03 15:44:38 -07:00
Michael Cook (mackal) 0372651613 Fix Bot::LoadAA 2015-07-03 17:42:31 -04:00
Natedog2012 f2e0384cb8 Merge pull request #433 from KinglyKrab/master
Files changed: command.cpp, questmgr.cpp
2015-07-03 12:29:14 -07:00
Kinglykrab 59e40b3fbe Files changed: command.cpp, questmgr.cpp
- Added command aliases: #findzone -> #fz, #reloadquest -> #rq
- Added instance ID to $client->GoToSafeCoords() in quest::safemove();
2015-07-03 14:57:48 -04:00
Michael Cook (mackal) 927a88cf96 Really fix class AA check 2015-07-03 02:31:12 -04:00
Michael Cook (mackal) 803fa48c05 Fix AA class check 2015-07-03 02:17:14 -04:00
KimLS 81e827481b Final touch up on this, changelog + fix for sql classes default being left shifted 1. 2015-07-02 20:18:08 -07:00
KimLS 214873c139 Merge conflicts abound and now are fixed 2015-07-02 20:12:51 -07:00
KimLS 233b096c17 0 != 9 and i suck at manifests cause of that fact 2015-07-02 20:10:26 -07:00
KimLS cca7a7899a Merge branch 'aa' of github.com:EQEmu/Server into aa 2015-07-02 20:08:32 -07:00
KimLS 25c6ddd631 Scary final SQL stuff for aa branch 2015-07-02 20:07:09 -07:00
KimLS 35991b68a0 First sql, need to merge from master first before i finish. 2015-07-02 19:36:38 -07:00
Akkadius da1167671b changelog addition [skip ci] 2015-07-01 01:25:56 -05:00
Akkadius 2bf49be855 Fix an issue where emote messages would overflow the buffer of 256 by increasing the size and changing some of the initialization
Added a custom Health Update message that will display in the middle of the players screen, to enable this server wide you must enable rule 'Character:MarqueeHPUpdates'
(Haynar) Fixed some runspeed issues with Perl and LUA scripts
(Haynar) Updated #showstats and #npcstats for new speed calcs to display speeds again in familiar float format.
(Haynar) Improved client movement while AI Controlled, such as feared and charmed.  Movement will be much smoother from clients perspective.
2015-07-01 01:23:00 -05:00
Akkadius b71e856c8c Increase emote buffer to 4096 2015-07-01 00:19:44 -05:00
Akkadius 88659b5f7e Runspeed changes added to database update manifest 2015-06-30 23:57:13 -05:00
Akkadius 895f27a6c1 Fix an issue with Guild messages sent via gmsay that are too long 2015-06-30 23:42:21 -05:00
Michael Cook (mackal) ea18238a12 Some servers apparently relied on the HP update spam 2015-06-30 20:35:28 -04:00
JJ 56b57d2ca6 Fix moving character to zone using character id and zone name. (bheam) 2015-06-30 20:05:35 -04:00
Akkadius fdfd602bd2 Merge pull request #432 from ngdeao/master
Updated additional support in code for new speed calculations.
2015-06-30 02:29:26 -05:00
ngdeao 850a908874 Fixed #modifynpcstat runspeed <value>, to work with new speed calculations.
Updated #showstats and #npcstats for new speed calcs to display speeds again in familiar float format.
Improved client movement while AI Controlled, such as feared and charmed.  Movement will be much smoother from clients perspective.
2015-06-29 22:57:37 -06:00
Akkadius c61feffe26 Merge pull request #431 from ngdeao/master
Fixed some mob speed scaling.
2015-06-28 03:19:43 -05:00
ngdeao 74aec82d2a Optional SQL for adjusting mob speeds.
The base runspeeds for mobs were about 80% high.  This scales them to values appropriate for new speed calculations.
The RescaleRunspeeds regroups speeds into common seen speed bins.  Higher speeds it lowers them by 20%.  This should only be run once against a db.
The Set specific speeds is tailored to specific mob run speeds, based on data taken from eqlive.
2015-06-28 00:58:03 -06:00
ngdeao b11fea91a6 Fixed some mob speed scaling. 2015-06-28 00:35:55 -06:00
Michael Cook (mackal) 009918cbd1 Fix songcap implementation 2015-06-27 22:43:00 -04:00
Michael Cook (mackal) 5a6685d129 Fix issue with AA cast mana consumption
AAs will now cast from slot "0xFF" instead of the itemslot
to avoid special behavior of items.

Mana reduction also moved down to the same place consumption takes
place like live.
2015-06-27 18:39:13 -04:00
Michael Cook (mackal) 337ce2d74b Fix crash for Bard Furious Refrain
This does a frenzy, which bards don't have. Live this AA is broken.
2015-06-26 18:00:15 -04:00
Michael Cook (mackal) cee7e401dd Fix issue with initial cast of level override proc buffs 2015-06-26 02:19:13 -04:00
Michael Cook (mackal) cb525156ef Merge branch 'master' into aa 2015-06-26 02:04:48 -04:00
Michael Cook (mackal) 4b64e8c39c Ignore skills out of range for bonuses 2015-06-26 02:04:33 -04:00
Michael Cook (mackal) c3a805923c Up the bard level check to 255 again
1-254 actually has special bard logic and client expects it
2015-06-25 13:21:02 -04:00
KimLS 476ee10ca0 Fix for Berserkers not seeing AAs on SoD and below clients. 2015-06-24 20:02:11 -07:00
KimLS 31301e0a26 ResetAA should hopefully play better with granted AA points now 2015-06-24 01:25:49 -07:00
KimLS 3dd89b0daa Polishing shared memory hotfix code 2015-06-23 22:04:48 -07:00
KimLS 67143f1b8a Initial work on shared memory hotfixes 2015-06-23 17:39:06 -07:00
Michael Cook (mackal) 8f156b3c91 Add Client:GetAccountAge to Lua 2015-06-23 18:37:24 -04:00
KimLS a41570677f More work on Granting, incrementaa now uses grant internally which should make it work more consistently with its old behavior 2015-06-23 12:53:46 -07:00
KimLS ce5e185738 Reworked how grant aa works 2015-06-23 00:36:43 -07:00
Michael Cook (mackal) fd989cdbc8 Add back in the bard song focus check
But also allowed focusSpellDuration through for that AA
2015-06-22 00:08:21 -04:00
KimLS 51caa3c577 Merge branch 'aa' of github.com:EQEmu/Server into aa 2015-06-21 01:25:48 -07:00
KimLS 77f050b653 setaapts command will now let you have up to 5k AA points, from 200. Removed the need to specify a prev_id in alternate_abilities table it can deduce that by itself. 2015-06-21 01:25:34 -07:00
Michael Cook (mackal) c0ea82f9e1 SE_MeleeVulnerability really really is Max Mana limit
Also found the cause of bard song tick increase and removed
the uneeded code

Also removed the IsBardSong check from GetFocusEffect, it really
shouldn't be needed, but will need to keep an eye out. The focus
effects should most often limit out the bard songs anyways
2015-06-21 02:58:43 -04:00
Michael Cook (mackal) d34b4a786b Implement duration ramp and war cry with new AA system
Rampage also correctly does a full attack round for classes
other than monk and ranger
2015-06-21 02:01:48 -04:00
KimLS d5098a56e0 Timers and some more loading stuff 2015-06-20 19:44:00 -07:00
Michael Cook (mackal) 32e880f571 Identified the extra byte at the end of OP_TargetBuffs/OP_BuffCreate 2015-06-20 14:05:32 -04:00
Michael Cook (mackal) 635ac692ea Fix merge ... 2015-06-19 21:48:34 -04:00
Michael Cook (mackal) 6621a125e6 Merge branch 'master' into aa 2015-06-19 21:44:58 -04:00
Michael Cook (mackal) 5481847987 Merge pull request #430 from KinglyKrab/master
Added Combat:BackstabBonus rule.
2015-06-19 20:28:35 -04:00
Kinglykrab 6503e6371a Added Combat:BackstabBonus rule.
- 0 = 0%, 5 = 5%, 50 = 50%, 200 = 200%
2015-06-19 19:55:10 -04:00
Natedog2012 ca311c8990 Merge pull request #429 from KinglyKrab/master
Bot changes.
2015-06-19 13:10:41 -07:00
Kinglykrab c5609db8d1 Preferential bot formatting changes. 2015-06-19 15:53:20 -04:00
Kinglykrab 6ffe7a9563 More bot changes.
- Added #bot showhelm [on|off]
- Allows you to disable your bot's helmet showing up
2015-06-19 05:25:48 -04:00
Kinglykrab 0dcf34d62b Bot changes.
- Added support for Powersource.
- Changed all messages to group messages (Defaults to say if they are not in a group)
2015-06-19 04:46:29 -04:00
Michael Cook (mackal) 08f8e2e55c Fix some RoF2 ops 2015-06-19 01:56:58 -04:00
Michael Cook (mackal) 34655e7753 Merge pull request #428 from KinglyKrab/master
Fixed more possible nullptr related bot crashes.
2015-06-19 01:46:35 -04:00
Kinglykrab 56e064751b Fixed more possible nullptr related bot crashes. 2015-06-19 01:42:01 -04:00
Natedog2012 a583391319 Merge pull request #427 from KinglyKrab/master
Fixed possible bot crashes due to nullptr conflict.
2015-06-18 21:02:33 -07:00
Kinglykrab de81850dd9 Fixed possible bot crashes due to nullptr conflict. 2015-06-18 23:42:59 -04:00
KimLS 94f47e7adf Merge branch 'aa' of github.com:EQEmu/Server into aa 2015-06-17 12:05:36 -07:00
KimLS 065363480f Added AA grant to quest system, fixed a bug here or there noticed incrementaa needs to be fixed or removed 2015-06-17 12:05:09 -07:00
Michael Cook (mackal) 0447321d92 Implement songcap needed for the AA revamp
Added rule Character:UseSpellFileSongCap defaulted to true since
most servers will probably be updating everything.
2015-06-17 02:47:05 -04:00
KimLS c445f63186 Okay timers now work right, for real this time 2015-06-16 23:41:46 -07:00
KimLS 33b6748c1b Merge branch 'aa' of github.com:EQEmu/Server into aa 2015-06-16 21:46:24 -07:00
KimLS 60f2e31240 Retooled how cooldowns work so they should be more consistent with how the client shows them 2015-06-16 21:43:51 -07:00
Michael Cook (mackal) f4c22d7111 Fix double riposte 2015-06-16 17:10:47 -04:00
KimLS d3280c9676 Removing old code, need to reimplement warcry and rampage still at least 2015-06-16 12:33:14 -07:00
KimLS 1b088b7157 AA bonus calc -> Mob from Client, Bots should now work with their aa stuff again (untested) 2015-06-16 11:34:43 -07:00
KimLS a984e9bd7c Some cleanup as well as fix for a certain type of aa proc 2015-06-15 15:09:06 -07:00
KimLS 34f0106437 Added reset aa command for rof2 (50 status req), fixed #resetaa command 2015-06-15 13:57:18 -07:00
Michael Cook (mackal) 335470d3db Port up AA sympathetic procs 2015-06-13 22:49:32 -04:00
Michael Cook (mackal) 121af489c4 Support for Eyes Wide Open
This probably needs testing on older clients ...
2015-06-13 17:53:21 -04:00
Michael Cook (mackal) 106e0c69ab Added todo list to ApplyAABonuses
Probably incomplete
2015-06-13 02:43:00 -04:00
Michael Cook (mackal) 4898bfd822 Fix focusReagenCost for pets
All focus seem to use 33 ...
2015-06-13 02:12:17 -04:00
Michael Cook (mackal) d68075a5dc Merge branch 'master' into aa 2015-06-12 22:50:05 -04:00
Michael Cook (mackal) ed11ee8bea AA effects and focus should work
Still need to verify all effects and implement currently unhandled
2015-06-12 22:41:18 -04:00
Uleat b1829e929e Updated SessionStats methodology 2015-06-12 19:25:43 -04:00
KimLS 65ac9683a3 Removed fluff code, added drakkin heritage and status can use modifiers to aa abilities 2015-06-12 13:39:20 -07:00
KimLS e5d1e98793 Added deity and race checking to AAs, doubled over the sanity check code and found a mistake, added code to make boats move smoother after loading into oot 50 times and seeing it skip every time. 2015-06-12 02:56:51 -07:00
KimLS afaa9ee6c9 Expendable aa work 2015-06-11 23:08:17 -07:00
KimLS dd345c01de Activating AAs now works, don't have expend charges working quite yet so they can just be cast over and over. 2015-06-11 21:33:39 -07:00
KimLS 63928caace Removing cruft, patches should *all* work now even titanium, incrementaa has been implemented (untested atm) 2015-06-11 18:38:46 -07:00
KimLS 985d969384 AA purchasing works 2015-06-11 17:04:59 -07:00
KimLS bad4a94b84 Apply RoF2 patch demon gave me for AAs 2015-06-11 01:45:55 -07:00
KimLS 416538764a Merge branch 'master' into aa 2015-06-10 22:47:45 -07:00
KimLS 1589169200 AAs should load from character data now, though will be fucked up if you already had stacked aas. 2015-06-10 22:46:57 -07:00
Michael Cook (mackal) 8dccc8bf90 Fix Pseudo Rooted for runspeed 2015-06-10 23:52:56 -04:00
Michael Cook (mackal) 8174428189 Export SetPseudoRoot to Lua 2015-06-10 23:10:00 -04:00
KimLS 8422ce6f25 Moved effects to a vector since we dont need the random access by slot 2015-06-09 22:46:53 -07:00
KimLS 963eb91669 Merge branch 'master' into aa 2015-06-09 22:13:03 -07:00
KimLS d5e697c061 More work, looks a lot better than before, tomorrow i hope to get actual client implementation done 2015-06-09 22:12:31 -07:00
KimLS 33c1c7c3e4 More packet figuring out... 2015-06-09 16:17:09 -07:00
KimLS dbbe6b5a91 Experimenting with packets 2015-06-09 12:39:39 -07:00
KimLS 250d0cc903 More aa work, it actually loads yay 2015-06-08 20:06:14 -07:00
Michael Cook (mackal) 5186d3a2ef Make filtering out OP_ClientUpdate less aggressive to fix spinning toons
If we are too aggressive filtering out the same position packets it's
possible for toons to continue to spin indefinitely. Instead of
just not sending the update when the position is the same we keep a
tally of how many we get and stop once a threshold (6) is reached.
2015-06-08 18:04:08 -04:00
KimLS 361c93b689 Merge branch 'master' into aa 2015-06-08 09:58:59 -07:00
KimLS 3ee1c43ac4 Remove old aa list send for experiment also want to merge from master... 2015-06-08 09:53:21 -07:00
Michael Cook (mackal) 226bb4f3b2 Fix delete statement 2015-06-08 02:08:32 -04:00
Michael Cook (mackal) 6229b90451 Fix exploit with expendable AAs 2015-06-08 02:00:44 -04:00
Michael Cook (mackal) db307d865b And SQL for last commit 2015-06-07 23:42:28 -04:00
Michael Cook (mackal) 4bb2bb1438 AA packet work mostly and small fix to expendable AAs 2015-06-07 23:41:54 -04:00
KimLS 6515879c14 Merge branch 'master' into aa 2015-06-07 19:42:57 -07:00
KimLS 3d1dc6314d New style AA data loading, still rudimentary 2015-06-07 19:42:12 -07:00
Michael Cook (mackal) f198ab714f Make inspect buffs LAA optional for target buffs 2015-06-07 22:31:21 -04:00
Uleat c2e4365214 Implemented rule-based disenchanted bag use 2015-06-07 22:07:40 -04:00
Michael Cook (mackal) 4a036bede2 Merge pull request #426 from clucksoft/expfix
Full group was being excluded from group exp bonus
2015-06-07 20:06:27 -04:00
Russell Kinasz f35594947c Full group was being excluded from group exp bonus 2015-06-07 16:53:38 -07:00
Alex f57734e591 Merge pull request #425 from clucksoft/encounters
More encounter timers support
2015-06-07 15:07:35 -07:00
Michael Cook (mackal) 42a5ddcf77 Cut down on some HP update spam
This increases the timer that mobs will send out updates
(It could probably be increased more)
This will also reset the timer every time SendHPUpdate is called
to prevent sending like 3+ completely useless updates at once
Also skip sending the update to the client if we're sending an
OP_Damage with the damage since the client will apply this number
2015-06-06 17:46:53 -04:00
Michael Cook (mackal) 03bc245318 Fix fleeing when zones have map files 2015-06-05 21:30:35 -04:00
Michael Cook (mackal) a9b98ed057 Add 64-bit ntoh/hton functions for Linux
BSD macros aren't tested, but should work. These should already
be defined on Windows.
2015-06-05 19:07:01 -04:00
Russell Kinasz b45f0f9dbc Lua_Encounter doesn't need to expose constructor 2015-06-05 12:57:53 -07:00
Russell Kinasz 6cb1861c91 Update to encounter timers so they can actually work from hooked events 2015-06-05 12:32:58 -07:00
Russell Kinasz 0b17dc73f1 Update to encounter timers so they can actually work from hooked events 2015-06-05 12:23:42 -07:00
Alex fafbecb055 Merge pull request #424 from clucksoft/encounters
Encounter timers
2015-06-04 13:44:14 -07:00
Michael Cook (mackal) a5d9faf8ea Allow bard DOTs to get random extra tick
This extra tick business needs to be figured out more ...
bard invul and crescendo songs DO NOT get this extra tick, but DOTs do
2015-06-04 01:02:48 -04:00
Natedog2012 00d258a952 Bot pets will now scale with focus effects. Pets will not scale passed 3x their normal size and stay within 10 levels of their base level unless changed with the rule PetPowerLevelCap 2015-06-03 14:21:38 -07:00
Natedog2012 64caf298fb Only return if the target was a Bot member 2015-06-03 10:18:01 -07:00
Natedog2012 7f30950fdb More group related bot crashes fixed. Bots can now be targeted in the group window and kicked from party. They are also no longer raid_targets when conned. 2015-06-03 10:10:17 -07:00
Russell Kinasz dbd07106d7 Updated zone cmakelists.txt 2015-06-02 17:17:40 -07:00
Russell Kinasz 328b7bb93c Add encounters header to lua_general.cpp 2015-06-02 16:32:42 -07:00
Russell Kinasz c351a9b54f Removed unnecessary commented code. 2015-06-02 15:27:57 -07:00
Russell Kinasz 6ff06ded43 Fix for extra_pointers in Encounter methods 2015-06-02 15:21:27 -07:00
Russell Kinasz 2c6fd44811 Implemented encounter timers - no spawn required 2015-06-02 12:25:09 -07:00
Akkadius 66d37cabe4 Merge pull request #423 from KinglyKrab/master
Added GetGlobal() support for all Mobs.
2015-06-01 22:58:14 -05:00
Kinglykrab 9a5ff58213 Added GetGlobal() support for all Mobs.
- Uses memory (no database hits)
- Allows entity-based quest global checks
2015-06-01 22:25:02 -04:00
Michael Cook (mackal) c3c6d18979 Fix RoF+ AA clientver bug 2015-06-01 16:02:55 -04:00
Michael Cook (mackal) aacd288ad7 Update comment [skip ci] 2015-06-01 15:47:04 -04:00
Michael Cook (mackal) 46dd1511af Fix DoBuffTic crash 2015-06-01 14:15:45 -04:00
Michael Cook (mackal) 7011395d4c Pet target in UF+
I think older clients might have something like this that sets
some spawn data, but these are the only clients that display something
2015-05-31 00:09:59 -04:00
Michael Cook (mackal) 03c006bef5 Implement ST_AEClientV1
This should at least be as correct as ST_AEBard is, unsure of the differences
2015-05-30 15:43:16 -04:00
Michael Cook (mackal) bfb40f6c5f Add failure messages for RNG focus 2015-05-30 03:08:02 -04:00
Michael Cook (mackal) 38cdea7d7e Furious Bash focus message 2015-05-30 02:57:03 -04:00
Michael Cook (mackal) d9cab4820a More focus messages 2015-05-29 21:16:30 -04:00
Michael Cook (mackal) 96264cb688 Send the BEGIN_TO_GLOW message after OP_BeginCast when casting a clicky 2015-05-29 15:26:32 -04:00
Michael Cook (mackal) b0d85e3558 More focus messages thanks to Google 2015-05-29 14:55:32 -04:00
Michael Cook (mackal) 0348c0817d Make ResistSpell aware of the level_override nerf 2015-05-29 14:39:09 -04:00
Michael Cook (mackal) a41fd122bc Add PetType petNone so IsCharmed stops lying 2015-05-29 13:18:04 -04:00
Michael Cook (mackal) 8646791d1d Proc buffs like the shissar rogue poisons have a level override
This corrects the level in those cases. Probably should
propagate the level overrides a bit more, but this fixes the
main issues right now.
2015-05-29 03:26:35 -04:00
Michael Cook (mackal) 070183789b More focus messages 2015-05-29 01:58:38 -04:00
Michael Cook (mackal) 36de3879f8 There is a variety to focus messages
I'm not 100% sure these are classic, but Tit+ at least.
I was able to verify these messages -- crap ton more though.
2015-05-29 00:40:34 -04:00
Uleat e588af2e79 Merge pull request #419 from EQEmu/app_pack_fix
Application packet size fix for high byte opcodes (fix #418)
2015-05-28 18:49:08 -04:00
Michael Cook (mackal) 2416960818 Merge pull request #420 from regneq/master
readded previous commit smoother pathing.
2015-05-28 18:41:36 -04:00
regneq be210950d7 readded previous commit smoother pathing. 2015-05-28 15:05:45 -07:00
Michael Cook (mackal) 5917052a6d I guess short duration buffs needed the extra tick 2015-05-28 18:00:25 -04:00
Natedog2012 d7b9d7c990 Forgot the Regen caps oops! 2015-05-28 14:09:14 -07:00
Natedog2012 235d6b6c48 Bots will not benefit from heroic stats, focus effects like a client 2015-05-28 13:58:17 -07:00
Natedog2012 95243fd6ce Modified ZippZipp's bot name fix from the forums. Limited bot name length to fix a crash. Added Filter check too if you use the Name Filter. 2015-05-28 11:48:03 -07:00
Natedog2012 e5f979665d Merge branch 'master' of https://github.com/EQEmu/Server 2015-05-28 11:27:59 -07:00
Natedog2012 22ef16947c Bots will no longer crash when disbanding on death or normal disbanding.. HP values on bots will no longer roll over when checking STAMINA 2015-05-28 11:27:03 -07:00
Michael Cook (mackal) dbbae0e735 Crash for no zonemap 2015-05-28 13:26:55 -04:00
Uleat 24917257e6 Application packet size fix for high byte opcodes 2015-05-27 22:24:00 -04:00
Uleat dbd615572c Revert "Fix for character select screen client crashes (fix #418)"
This reverts commit 92c756c820.
2015-05-26 21:19:48 -04:00
Uleat 92c756c820 Fix for character select screen client crashes (fix #418) 2015-05-26 15:51:18 -04:00
SecretsOTheP 76d7fe1586 Fixes for mobs on pause waypoints dancing around.
Fixes for runspeed <= 0 as reported by demonstar55
2015-05-26 02:27:48 -04:00
SecretsOTheP 4424afac94 Merge branch 'master' of https://github.com/EQEmu/Server 2015-05-26 01:20:06 -04:00
SecretsOTheP 2b495cea5a bot fixes for compiling 2015-05-26 01:19:49 -04:00
Michael Cook (mackal) e7902342dd EQ seems to round the ticks weird ...
A few examples in the comments ...
2015-05-26 00:59:48 -04:00
Akkadius 5c194c7087 Some syntax adjustments to eqtime.cpp [skip ci] 2015-05-25 23:57:48 -05:00
Akkadius b6091c1960 Update changelog descriptor cause prob not clear enough [skip ci] 2015-05-25 23:51:23 -05:00
Akkadius d2a1fb7acf Add file 2015_05_25_npc_types_texture_fields.sql 2015-05-25 23:49:11 -05:00
Akkadius ee136881c8 Implemented disjointed zone based time, this can be triggered via quest methods
Added parameter to LUA and Perl method settime(hour, minute, [update_world = true])
	- If update_world is false, the zone will then unsubscribe itself from regular worldserver time synchronizations
Added DB ver 9082 with update to add npc_types texture columns if table does not currently have them
2015-05-25 23:48:11 -05:00
Michael Cook (mackal) b06e1c2041 Merge pull request #417 from EQEmu/revert-416-master
Revert "Making $npc->RemoveFromHateList actually work"
2015-05-25 13:20:50 -04:00
Michael Cook (mackal) 41ca23eb7c Revert "Making $npc->RemoveFromHateList actually work" 2015-05-25 13:20:26 -04:00
SecretsOTheP 5c4389effb Revert custom changes that came with my code load 2015-05-25 12:39:36 -04:00
SecretsOTheP 788959a5e2 Haynar's movement fixes.
Changes Speed from float to int. EQ client deals with int step locs better than it does floats according to Haynar's testing.

This also contains mob runspeed changes. I recommend you set runspeeds to start in the DB 1.25 for NPCs below 1.25 which will match player runspeeds almost equally. Existing DBs will need to be updated.

General Cleanup of MobAI functions. Mobs now change their heading on AIMovement timers if their targets' heading has changed since that time. This prevents players from being able to land backstabs inbetween mob swings.

Charmed/feared players now send the appropriate packet, there was a missing CastToClient() in spells that was missing.

Mob runspeed can no longer be snared to 0%, instead, 1% of their base runspeed is the maximum. Roots apply as roots instead of a modifier under this code.

There is going to be bugs with this code. It's better we push through it than revert it. Sanctuary has been running this for a good week and we've worked through the issues.

Misc updates:
Exported some variables to perl, including:

EVENT_ITE_CLICK_CAST:
EVENT_ITEM_CLICK:
spell_id - returns the spell_id of the click effect.
return value - cancels the cast.

EVENT_DROP_ITEM:
quantity - returns the # of items dropped in the packet. If the item has charges, charges are returned here instead.
itemname - name of the item being dropped
itemid - id of the item being droppped
spell_id - spell_id associated with the item's click effect.
slotid - the inventory slot id of the item being dropped.
return value - cancels the item from being dropped.

Added Perl function: CalcEXP. Calculates the experience you would gain for an NPC that cons a specific con value to you.

Fixed a bug where you would receive the group experience bonus and group experience messages for simply being in a group, regardless of the player being in the same zone as you.
2015-05-25 12:35:53 -04:00
JJ aaca6fd2d9 Merge pull request #416 from hateborne/master
Making $npc->RemoveFromHateList actually work
2015-05-25 11:20:37 -04:00
hateborne 1bcb5c72a5 Making $npc->RemoveFromHateList actually work
$npc->RemoveFromHateList is a mob function, not an NPC function. Casting
to Mob to let it work.
2015-05-25 10:44:15 -04:00
Michael Cook (mackal) 249d67a1c3 Bards get a bonus tic at some point
Not sure what level but it's between 53 and 85 ...
(although I remember reading something about around 60)

I also didn't notice any of the odd effects the comments speak of ...
I suspect they were fighting each other?
2015-05-25 02:01:51 -04:00
Michael Cook (mackal) 85bdcf413b Bard songs go negative for some reason?
Hot fix for now, I don't think they really need to be extended,
but I need to investigate more.
2015-05-24 18:50:33 -04:00
Uleat 93942fa82b Merge branch 'master' of https://github.com/EQEmu/Server 2015-05-23 18:59:14 -04:00
Uleat 8922c72452 Added a name block memset to the server character select code and a few comments to the OP_CharInfo encodes 2015-05-23 18:59:03 -04:00
KimLS ec8e7139ec errant else statements 2015-05-23 15:54:33 -07:00
KimLS a882397eb6 errant semi-colon, doesn't matter but still 2015-05-23 15:53:56 -07:00
KimLS 7d61934ce6 Add db manifest for dbstr_us.txt stuff 2015-05-23 15:52:42 -07:00
KimLS 7041db7480 Adding dbstr_us.txt support to client files 2015-05-23 15:50:58 -07:00
Michael Cook (mackal) 70048eb6e1 SE_IllusionPersistence affects self only 2015-05-23 17:45:51 -04:00
Michael Cook (mackal) a46b1ac18b Need to actually copy the bard mod too! 2015-05-23 17:36:05 -04:00
Michael Cook (mackal) 00721f4a96 Fix pet instrument mod issue 2015-05-23 17:14:08 -04:00
Michael Cook (mackal) 8aadc36320 Rework buff duration formulas
These are derived from the client

SE_IllusionPresistence will also set the duration to 10k tics like live
2015-05-23 02:20:36 -04:00
Uleat 351e63ae72 Possible fix for some 'random' character select crashes 2015-05-22 19:15:51 -04:00
Michael Cook (mackal) 9cbda0f81b Unlink Tiger Claw from other monk skills for RoF2+
Tiger Claw has its own reuse now, which the client expects

pTimerCombatAbility2 should be able to be used if they do something
similar for other classes.
2015-05-21 18:15:34 -04:00
Michael Cook (mackal) ea44b4b3b1 Fix manifest 2015-05-21 17:25:59 -04:00
Michael Cook (mackal) ea5a1dd6f1 Bard instrument mods should be more consistent with live
Changes:
	Mods are now saved for in the DB so they are loaded on zone
	This allows long duration buffs from bards that get mods to keep their mods
	Ex. Selo's, Symphony of Battle

	Instrument mods are applied to basically anything that is an instrument skill
	The only exception to this is discs (ex. Puretone is Singing but always 10)

	Singing spells from procs (Ex. Storm Blade) that are instrument skills should
	inherit their buffs instrument mod. Doom effects should also. This isn't
	implemented yet.
2015-05-20 02:01:43 -04:00
KimLS 2ef0fc9342 Change to fishing water location algorithim 2015-05-18 21:46:19 -07:00
Alex 02c3fd0905 Merge pull request #414 from hateborne/master
GM Output for Casting Blocked Spells via Logging System
2015-05-18 21:45:07 -07:00
Uleat 4266f45295 Added merc pointer initialization to avoid an invalid pointer condition 2015-05-18 20:40:57 -04:00
Michael Cook (mackal) 553b7c9f8c Move the extra appearance packet guard to SetAppearance 2015-05-18 00:04:55 -04:00
Michael Cook (mackal) 79a87fac1d Guard against eaStanding spam 2015-05-17 23:51:24 -04:00
Uleat 2308d3e880 Fix for EntityList::CheckSpawnQueue() debug assertion failure crash 2015-05-15 22:49:59 -04:00
hateborne cbcaead8df GM Output for Casting Blocked Spells
Utilizing the logging system to display an alert when a GM casts a
blocked spell, giving some notification instead of silent successes on
cast.
2015-05-13 18:41:18 -04:00
Alex 4b7871a665 Merge pull request #411 from regneq/master
smoother NPC pathing. (credit to Haynar from EQMacEmu)
2015-05-11 22:52:13 -07:00
regneq 052f343e4d smoother NPC pathing. (credit to Haynar from EQMacEmu) 2015-05-11 21:42:48 -07:00
Michael Cook (mackal) e6f6da7845 Merge pull request #410 from regneq/master
* change the kill faction hits display before the xp message not after.
2015-05-11 21:49:44 -04:00
regneq cc2a60feb2 * change the kill faction hits display before the xp message not after.
* removed the double level gain messages to display once either the level gained or the level.
* implement the message "You will now lose experience when you die" and "Your items will no longer stay with you..." when reach a certain level already sets in the rule table.
2015-05-11 16:34:46 -07:00
Michael Cook (mackal) d5eeaf4f47 Merge pull request #409 from regneq/master
Fully implemented QuestReward.  (credit to Cavedude on EQMacEmu)
2015-05-11 16:57:53 -04:00
regneq 6fad93aeee QuestReward now accepts a single bool (true or false) for faction instead of 2 int32s. If true, it will pull the faction hits assigned to the NPC in the DB (reversed, of course) and give you that as part of the reward.
Example usage:
e.other:QuestReward(e.self,copper,silver,gold,platinum,itemid,exp,faction)

(Credit to Cavedude)
2015-05-11 12:42:13 -07:00
regneq d1fbd086d7 Fully implemented QuestReward. (credit to Cavedude on EQMacEmu)
Syntax on NPC is:
e.other:QuestReward(e.self,copper,silver,gold,platinum,item,experience,factionid,factionvalue);

This will give you any or all of the rewards and their messages with one call, including the quest ding sound. Any item is sent to your inventory, like SummonItem does now. The coin message is generated by the client, and will give you a message for each coin type (You recieve 5 copper...). No way around that, but it's still useful if the reward only calls for a single type.
2015-05-11 11:35:54 -07:00
Michael Cook (mackal) c360aa9b0f Make use of Aggressive/Weapon PlayerStates
I HAVE NO IDEA WHAT THIS DOES, BUT LIVE DOES IT

Something to do with the animation system, all I know
2015-05-08 22:42:45 -04:00
JJ f68952c168 Update to some spell duration formulas (Shendare).
Filename fixes.
2015-05-08 22:23:50 -04:00
Michael Cook (mackal) bf4ff03641 Use PlayerState to generate stun particles 2015-05-08 00:59:38 -04:00
Michael Cook (mackal) 103d808925 Whoops, we do want to ignore the sender 2015-05-07 22:15:43 -04:00
Michael Cook (mackal) 53a139256d Merge pull request #408 from hateborne/master
Exporting ConnectNodeToNode and AddNode (from Pathing) to Perl
2015-05-07 18:39:27 -04:00
Michael Cook (mackal) 7bcfaf60ab Save PlayerState server side
We now send the PlayerState in the spawn struct to allow clients
to see other bard animations with instrument to be played if they
zone in after the bard equipped the instrument

OP_WeaponEquip2 and OP_WeaponUnequip2 renamed to OP_PlayerStateAdd
and OP_PlayerStateRemove

Still needs work: Get AI controlled mobs sending the correct
PlayerStates. (stunned, attacking, etc)
2015-05-07 18:34:19 -04:00
hateborne ebe2ea697e Exporting ConnectNodeToNode and AddNode (from Pathing) to Perl
Exporting ConnectNodeToNode and AddNode from pathing to Perl so devs can
more quickly build grids with Perl script(s).
2015-05-07 16:06:06 -04:00
Michael Cook (mackal) 8224a9e776 Fix bards not playing their instruments
This is a rather naive implementation, we should really save the
PlayerState server side so we can have newly zoned in clients
after the equip happened to see the animation. But until we find
all the places the PlayerState is sent, this is fine.
2015-05-06 23:40:01 -04:00
Alex be0507c4d3 Merge pull request #407 from noudess/master
The mob AT_Anim (as set in spawn2) was not working in some cases.
2015-05-06 17:30:56 -07:00
SecretsOTheP cfedf53dc0 *cone of shame* forgot a file 2015-05-06 18:53:41 -04:00
SecretsOTheP 4a4a0c5e8b * -Exported additional entity IDs for dropped items to perl upon EVENT_CLICK_OBJECT (clicker_id) and EVENT_PLAYER_PICKUP ($picked_up_entity_id)
-Identified Size / SolidType fields in newer clients and properly exported it to EQEmu for use in UF, RoF, RoF2 via perl accessors. (Should work in LUA, no testing was done though for LUA)
-Added a sanity check for size to objects. Any size over 5000.f seems to crash the newer clients' graphical engines and PEQ has some containers filled in with bogus values.
-Added the ability to return a value on perl function EVENT_PLAYER_PICKUP which sends a fake dropped item ID to the client to generate the appropriate client response so the item can stay on the ground and not be 'picked up'. Should also work in LUA, didn't test LUA.
-Renamed unknown008 and unknown010 to size and solidtype respectively for objects.
2015-05-06 18:50:08 -04:00
Paul Coene 77dca484fe The mob AT_Anim (as set in spawn2) was not correctly displaying in
various situations.

First, the set function for mob _appearance optimized sending a message
if the new appearance was equal to the old.  This cann't be done, as
the 1st time the zone runs there is no client when the set function is
called.  If we're combining set/send, as we are, better to always do both.  This fixes several of the cases.

Repop also did not work, as no code was being called reliably to set
appearance and update the client based on code path and various flags.  This is also fixed.
2015-05-06 15:39:36 -04:00
JJ 690274338d Merge pull request #406 from noudess/master
Beginnings of fix to SendBuffDuration.
2015-05-02 10:15:21 -04:00
Paul Coene 59ab7071b7 Beginnings of fix to SendBuffDuration. 2015-05-02 07:00:52 -04:00
Michael Cook (mackal) 1438c1a9c3 Merge pull request #404 from noudess/master
Mobs that were blinded were being included in every use of IsFeared()
2015-05-02 02:59:39 -04:00
Michael Cook (mackal) 72702be820 Merge pull request #405 from gpanula/master
maxServerID null check (mysql)
2015-05-02 02:58:04 -04:00
GPanula 1ab3cf53e2 if ServerID is null, it will crash the loginserver when it tries to add the new server to tblWorldServerRegistration table 2015-05-01 22:53:36 -05:00
gpanula 79928c190b Merge pull request #1 from EQEmu/master
sync fork up with source
2015-05-01 22:49:57 -05:00
Paul Coene 6c8dfbdc4d Mobs that were blinded were being included in every use of IsFeared() which
was bad.  Blinded mobs can still cast spells when in melee range.  The
original fear code had no blind rolled into it, I added that.  This was an
overright.  I changed the macro to use bonues and fleemode instead of
looking at curfp.  Testing looks good to me.
2015-05-01 20:40:46 -04:00
Michael Cook (mackal) 1f56c7476e Merge pull request #403 from noudess/master
Fix proc messages for undead proc against non-undead.
2015-05-01 20:27:41 -04:00
Paul Coene eda74e66e0 Fix proc messages for undead proc against non-undead. 2015-05-01 19:22:06 -04:00
Alex 80fd71a406 Merge pull request #402 from noudess/master
Allow Kerran race illusions to be either gender.
2015-05-01 15:44:44 -07:00
Paul Coene 399942f6f4 Allow Kerran race illusions to be either gender. 2015-05-01 07:02:23 -04:00
Alex 3846dc2bbc Merge pull request #401 from noudess/master
Check to make sure we're a client before a CastToClient().
2015-04-30 16:59:39 -07:00
Michael Cook (mackal) 06f4fd49ef Implement mob and client melee push
New rules:
Combat:MeleePush turns melee push on/off
Combat:MeleePushChance is the chance that an NPC will be pushed
Clients are pushed every successful hit, need to verify or disprove this
2015-04-30 19:36:21 -04:00
Paul Coene eea667e22d Check to make sure we're a client before a CastToClient(). Missed this
on first patch.
2015-04-30 09:33:11 -04:00
Alex 8b4d601027 Merge pull request #400 from noudess/master
Now Npcs won't respond to hails if they can't see you.
2015-04-30 06:04:06 -07:00
Paul Coene a1960d4a4a Npcs won't respond to hails if they can't see you. 2015-04-30 08:00:36 -04:00
Alex d7c556c672 Merge pull request #399 from noudess/master
Monk wearing magical gloves can hit creatures that need a magical weapon
2015-04-29 18:55:29 -07:00
Paul Coene 2c4ca77ffc Monk wearing magical gloves can hit creatures that need a magical weapon
when fighting hand to hand.
2015-04-29 19:18:17 -04:00
Alex 7bde00c63b Merge pull request #398 from noudess/master
Noexpend spells like flame lick were expending.
2015-04-29 15:30:53 -07:00
Paul Coene 46d7019909 Spells like flame_lick were not requiring flame lick. Noexpend for
flame lick was not working.

Also fixed a log message with arguments reversed.
2015-04-29 08:26:59 -04:00
Alex 41f3b721d6 Merge pull request #395 from noudess/master
Some illusions and some NPC gear not showing up on zone-in & initial spawn if in zone when it occurs
2015-04-28 16:34:01 -07:00
Alex cafac36bed Merge pull request #397 from gpanula/master
Handle nulls in trusted server lookup(mysql)
2015-04-28 16:33:34 -07:00
Michael Cook (mackal) 0d84ede3d6 Allow /pet attack by mob name to work
ex. /pet attack a_snake
2015-04-26 13:35:36 -04:00
GPanula d7e3a33179 opps, lets use a valid ServeLisTypeID 2015-04-26 09:56:46 -05:00
GPanula c84f56f1f5 Avoid returning nulls when looking up if the server is trusted. Nulls will in the query results will cause the loginserver to crash 2015-04-26 09:43:05 -05:00
JJ 47c9690a32 Don't garble # commands. 2015-04-25 11:46:43 -04:00
JJ de57c94d3e Blocked spell negation fix. 2015-04-23 18:42:17 -04:00
Uleat c974b30192 Probable fix for 'Debug Assertion Failure' in Client::GarbleMessage() 2015-04-22 12:29:35 -04:00
JJ 23dd560a72 Don't delete packet when it is still referenced. Create a new packet instead for deconfliction. 2015-04-20 19:48:52 -04:00
Natedog2012 0eda3efe6a Ignore procs when setting recast timers 2015-04-11 22:49:29 -07:00
Michael Cook (mackal) a4ac2b3831 Added some comments about powersource [skip ci] 2015-04-10 21:23:29 -04:00
Michael Cook (mackal) ea240f7814 Fix sign issue with hate redux spells 2015-04-10 03:06:05 -04:00
JJ 0d4775a9df Adjust to safe_delete packets. 2015-04-07 19:57:36 -04:00
JJ 0321bf72a5 Attempt to catch rare crash in zoneserver process. See http://www.eqemulator.org/forums/showthread.php?t=39549 2015-04-07 10:22:47 -04:00
Michael Cook (mackal) 739a7b6f75 Add decoder for OP_Animation for RoF/RoF2 2015-04-06 21:46:37 -04:00
KimLS 979590db9f Fix for lower than intended drop rates for drop limit loot tables after the min drop changes 2015-04-06 17:42:15 -07:00
Michael Cook (mackal) 7bd185b7b7 Fix RoF+ OP_Animation handling
That's handled in the patch file
2015-04-06 16:13:58 -04:00
Natedog2012 7662eaf983 All animation structs were backwards and poorly named.. RoF+ animations work properly 2015-04-06 03:11:04 -07:00
KimLS 78eb8747aa Merge branch 'master' of github.com:EQEmu/Server 2015-04-04 17:03:42 -07:00
KimLS fc1d6c0676 Fix for mindrop on drop tables sometimes not being fully respected 2015-04-04 17:03:28 -07:00
Natedog2012 7e1c296ecf Fix for RoF2 Bow shoot animation struct was off 2015-04-04 05:04:46 -07:00
Michael Cook (mackal) 51a314fa31 for whatever reason spell based procs generate casting messages 2015-04-02 14:54:11 -04:00
Michael Cook (mackal) b3efd8a817 Quick fix for RoF2 discs showing in song window
This is just a hack until someone does a proper solution
2015-04-02 13:42:47 -04:00
Paul Coene bf93d72a43 Added more changes so mobs armor will appear correctly (pc races only)
when the spawn vie gm command or normally with loot tables that equip.

Refined previous changes that fixed the issue with zoning in and not seeing
previosuly spawned armor by sharing the same module.
2015-04-02 13:25:12 -04:00
Paul Coene 026278504f Merge remote-tracking branch 'upstream/master' 2015-04-01 13:04:39 -04:00
Paul Coene a5872b165f Zoning into a new zone did not properly display PCs with tree/object illusions
and NPCs wearing gear in non-weapon slots.

The illusion thing: Not sure why, but te opcode for BulkZoneSpawn doesn't
display the tree/object illusions.  I did notice that even OP_Illusion gets
rejected by the client if sent before Client_Ready.  Maybe that is why.  The
BULKSpawns cannot be sent that late, I tried moving it in the sequence but
it never did the illusions correctly, at any point.  So, we new new the
single spawn OP code for PCs with those illusions.  This works.

The NPC gear thing.  Same story with BulkZoneSpawn,  Not sure why.  The data
is sent correctly.  So now we update the client zoning in (only them) with
what the NPCs are wearing.  Every othe client already is up to date.
2015-04-01 13:00:38 -04:00
Natedog2012 8bd22e8c38 2nd part to Alternate currency fix forgot to paste this back in 2015-03-29 02:16:23 -07:00
Natedog2012 e304e67cf1 Fix how Alternate Currency Reclaim and Create works if the player has 0 currency available 2015-03-29 01:00:57 -07:00
KimLS b6a01871d8 Fix for another bazaar problem 2015-03-28 23:38:41 -07:00
Alex a569e20110 Merge pull request #388 from iequalshane/master
Enable multiple NPC equipment materials
2015-03-28 23:34:43 -07:00
Alex 75146350fc Merge pull request #393 from noudess/master
Vendor message for rejection based on Deity
2015-03-28 23:34:23 -07:00
KayenEQ 2635d37095 Merge pull request #394 from KayenEQ/Development
sympathetic proc fix
2015-03-29 02:11:49 -04:00
KayenEQ a75f4e70a1 sympathetic proc fix 2015-03-29 02:11:02 -04:00
SecretsOTheP b6cc070633 Identified the Target Ring fields for RoF/RoF2 and added a perl accessor for the last target ring position received from the client.
Usage: $client->GetTargetRingX(), $client->GetTargetRingY(), $client->GetTargetRingZ()
2015-03-29 01:35:24 -04:00
Paul Coene 94d118fdf8 Some vendors would decide not to see based on deity, but messages were
picking the next best reason.  Added a message choice that seemed to make
sense for deity.
2015-03-27 17:12:39 -04:00
JJ 4dcb679c53 Manual merge of #387. 2015-03-27 16:40:02 -04:00
Alex ad9e9ba2d6 Merge pull request #392 from N0ctrnl/master
Added individual tradeskill skillup settings rules
2015-03-27 13:32:06 -07:00
N0ctrnl c4a7acb6d1 Update tradeskills.cpp 2015-03-25 12:04:03 -05:00
N0ctrnl e6835804af Update ruletypes.h 2015-03-25 12:00:14 -05:00
KimLS 9598ce45c9 Merge branch 'master' of github.com:EQEmu/Server 2015-03-24 16:37:25 -07:00
KimLS 9ef4825a72 Fix for gaps in path files during add 2015-03-24 16:37:12 -07:00
KayenEQ eed57ddf97 Merge pull request #391 from KayenEQ/Development
More sympathetic proc fixes
2015-03-24 07:13:58 -04:00
KayenEQ 202c59eb48 More sympathetic proc fixes 2015-03-24 07:13:22 -04:00
KayenEQ f86c6d9c5e Merge pull request #390 from KayenEQ/Development
Fix for sympathetic proc code to allow for it to be properly checked fro...
2015-03-24 01:43:26 -04:00
KayenEQ 340ed6c59d Fix for sympathetic proc code to allow for it to be properly checked from spell buffs. 2015-03-24 01:42:34 -04:00
KimLS 0cf5cca415 Other half of bazaar exploit 2015-03-22 23:18:08 -07:00
KimLS f021ee5491 Fix for traders not correctly setting price 2015-03-22 14:47:45 -07:00
KimLS 6c26bc9c8f Fix for alt currency reclaim exploit and fix for exploit in trader code where price != set price 2015-03-20 13:10:36 -07:00
KayenEQ 93eb727ade Merge pull request #389 from KayenEQ/Development
Fix for pets not receiving group buffs cast on them correctly.
2015-03-19 16:23:23 -04:00
KayenEQ 1c454d9569 Fix for pets not receiving group buffs cast on them correctly. 2015-03-19 16:22:17 -04:00
JJ 3b9f62f0a1 Exported ReloadZoneStaticData to perl and lua.
Usage:
(perl) quest::reloadzonestaticdata();
(lua) eq.reloadzonestaticdata();
2015-03-18 02:49:00 -04:00
Akkadius cd82aae183 [eqemu_update.pl] Small line adjustment [skip ci] 2015-03-12 11:40:46 -05:00
Akkadius d08d50f4b5 [eqemu_update.pl] Set version back to 7... [skip ci] 2015-03-12 11:19:41 -05:00
Akkadius c5fb9ba6dd [eqemu_update.pl] Make it so script is still useable when eqemu_config.xml is not present with no DB configurations [skip ci] 2015-03-12 01:05:25 -05:00
Akkadius 2bcb964326 [eqemu_update.pl V7] Add Option 9) LUA Modules - Download latest LUA Modules (Required for Lua) [skip ci] 2015-03-12 00:33:52 -05:00
Akkadius b3a0370e71 [eqemu_update.pl] Linux compatibility adjustments [skip ci] 2015-03-12 00:08:10 -05:00
Akkadius 9344cfb4e3 [eqemu_update.pl] Add Option 20) to self update script [skip ci] 2015-03-11 21:06:58 -05:00
Akkadius bcf8b1af8e [eqemu_update.pl] Add Option 7) Plugins - Download latest Perl plugins
[eqemu_update.pl] Add Option 8) Quests - Download latest PEQ quests and stage updates
[eqemu_update.pl] Set version 5 of script
[skip ci]
2015-03-11 21:01:43 -05:00
Shane Lynch 2003efb5ab Enable multiple NPC equipment materials (part2)
Adding missing header from previous commit.
2015-03-10 21:59:31 -07:00
Shane Lynch 13743caf19 Enable multiple NPC equipment materials
This change allows #npcedit
armtexture/bracertexture/handtexture/legtexture/feettexture to work
properly and sets individual armor slot materials for NPCs.
2015-03-10 21:33:44 -07:00
Akkadius 6a241d44cc Fix small issue where eqemu_update.pl script would bomb at the very end of the maps download because of blank string [skip ci] 2015-03-10 22:59:07 -05:00
Akkadius b36d9fe115 Update world binary with eqemu_update.pl script version [skip ci] 2015-03-10 22:44:30 -05:00
Akkadius c313bd8d07 Re-rename UF.conf again [skip ci] 2015-03-10 22:40:20 -05:00
Akkadius be9066235b [eqemu_update.pl] Add Option 6) Download Latest map and water files 2015-03-10 22:37:17 -05:00
KayenEQ 1f540666f8 Merge pull request #386 from KayenEQ/Development
Fix to check if weapon actually has a valid proc before trying to proc.
2015-03-10 00:34:01 -04:00
KayenEQ 2cf2ef4fac Fix to check if weapon actually has a valid proc before trying to proc it. 2015-03-10 00:33:11 -04:00
KayenEQ c305582c77 Merge pull request #385 from KayenEQ/Development
perl $npc->GetCombatState
2015-03-09 06:40:55 -04:00
KayenEQ 69d02b7e72 perl $npc->GetCombatState 2015-03-09 06:40:13 -04:00
Uleat c96ee79b1e Added ';' to safe_delete_array(data) in ~BulkZoneSpawnPacket() 2015-03-06 04:26:26 -05:00
Alex bd9665e35b Merge pull request #381 from noudess/master
Allow server customization of swimming start value.
2015-03-04 19:37:01 -08:00
Akkadius 0210d6f6bf Fix Spell Book Deletion 2015-03-04 02:40:49 -06:00
Uleat fe294e60b5 Fix for 'Invalid Slot ID' messages, item loss during corpse looting, and possible item loss during LDoN/Adventure merchant purchases 2015-03-03 04:08:52 -05:00
Michael Cook (mackal) f95806b47b Move item caps that depend on spells/aas to be done after those are valid
Also fix Sleeper's Tomb avatar proc to be counted towards item ATK
2015-03-02 16:23:46 -05:00
KayenEQ 10f1e69ad8 Merge pull request #384 from KayenEQ/Development
fix to prior commit
2015-02-28 23:41:43 -05:00
KayenEQ d3249397f3 fix to prior commit 2015-02-28 23:39:44 -05:00
KayenEQ 69e9adf796 Merge pull request #383 from KayenEQ/Development
PERL remove proc functions
2015-02-28 23:25:23 -05:00
KayenEQ 4835b7063c PERL remove proc functions
$npc->RemoveMeleeProc(spell_id)
$npc->RemoveDefensiveProc(spell_id)
$npc->RemoveDefensiveProc(spell_id)
2015-02-28 23:24:19 -05:00
Uleat 8dfa0a7220 Final tweak for light sources 2015-02-27 19:28:28 -05:00
KayenEQ 2b8bdb9158 Merge pull request #382 from KayenEQ/Development
Fix for ModSkillDmgTaken to once again work with (-1 = ALL skills)
2015-02-27 03:12:36 -05:00
KayenEQ 7851f272e5 Fix for ModSkillDmgTaken to once again work with (-1 = ALL skills)
Fix for perl GetModSkillDmgTaken
2015-02-27 03:11:04 -05:00
Uleat e15ee6e320 Change for 'general' slot range light source behavior 2015-02-26 21:05:06 -05:00
Uleat 1f0b86a0d5 Changes to how valid light sources are critiqued 2015-02-26 18:46:12 -05:00
Michael Cook (mackal) e47f9d95b0 Fix title/suffix for RoF/RoF2 2015-02-24 16:26:25 -05:00
Uleat 0b6d71181f Added safety check to DraggedCorpses list iteration in Client::DraggedCorpses() 2015-02-24 00:52:18 -05:00
JJ 318a664b09 No "sigs". [skip ci] 2015-02-23 19:57:47 -05:00
Paul Coene 180c4c3286 Merge remote-tracking branch 'upstream/master'
Conflicts:
	changelog.txt
2015-02-23 19:11:35 -05:00
Paul Coene 221c1f17c7 Streamline changes for Swimming Rule and add Sense Heading rules 2015-02-23 19:03:28 -05:00
Uleat d601a70546 Fix for RoF+ clients showing active 'Return Home' button when action is not available 2015-02-23 18:42:12 -05:00
Paul Coene ba49e5f696 Allow servers to set starting value for swimming instead of the hard coded
value.
2015-02-23 13:32:10 -05:00
Paul Coene 19fc02c284 Merge remote-tracking branch 'upstream/master'
Conflicts:
	changelog.txt
	world/worlddb.cpp
2015-02-23 08:13:09 -05:00
KayenEQ b05581499a Merge pull request #380 from KayenEQ/Development
perl npc last name related functions.
2015-02-23 03:53:41 -05:00
KayenEQ 9d866c1889 perl $npc->ChangeLastName(name)
perl $npc->ClearLastName()
Modifies NPC last names.
2015-02-23 03:52:43 -05:00
KayenEQ a567812f35 Merge pull request #379 from KayenEQ/Development
perl NPC function RemoveFromHateList(mob)
2015-02-23 00:41:13 -05:00
KayenEQ 167b6f5ebf perl NPC function RemoveFromHateList(mob) 2015-02-23 00:39:06 -05:00
Uleat 2bed129037 Fix for tutorial button kicking client when re-entering tutorial (return home button for RoF/RoF2 issue still at large) 2015-02-22 22:27:58 -05:00
KayenEQ a0ea6066ed Merge pull request #378 from KayenEQ/Development
Fix for perl defensive/ranged proc function
2015-02-21 23:06:19 -05:00
KayenEQ c8c2209617 Fix for perl defensive/ranged proc function
Minor fix to NPC ranged attack.
2015-02-21 23:04:24 -05:00
JJ eff818ca42 Manual merge of #376 for Erudite starting zones. 2015-02-21 20:46:19 -05:00
KayenEQ a537981ad0 Merge pull request #377 from KayenEQ/Development
Fix to allow for mana drain spells to work if client is full mana.
2015-02-21 06:52:14 -05:00
KayenEQ 32cb219e64 Fix to allow for mana drain spells to work if client is full mana. 2015-02-21 06:32:41 -05:00
Michael Cook (mackal) 4f3360aa49 More VS compile fixes (curse you clang/gcc!) 2015-02-21 01:51:41 -05:00
Uleat e61f647bf2 Fix for non-compliant assignment of non-integral type array 2015-02-21 01:20:13 -05:00
Michael Cook (mackal) 7afb29cf02 Fix another memleak in Client::TryReward 2015-02-20 21:10:53 -05:00
Michael Cook (mackal) 0a351bf6e1 VS didn't like this (it was illegal though, stupid gcc/clang) 2015-02-20 20:51:21 -05:00
Michael Cook (mackal) 9a19d59cf7 Fix memory leak in Client::TryRewards 2015-02-20 18:47:46 -05:00
Michael Cook (mackal) c5a217842f Fix issues with claims and implement for RoF/RoF2 2015-02-20 16:29:56 -05:00
Uleat 921a292f5b Fix for new Titanium to UF client accounts not allowing character creation 2015-02-19 21:56:14 -05:00
Trevius 3b45a66498 Fix for potential recursive loops if using RemoveFromHateList() within EVENT_HATE_LIST.
Some work on Bazaar searching, but not functional yet.
2015-02-18 21:32:18 -06:00
Uleat 414db873b7 Fix for tints not showing up at character select (world server) 2015-02-18 19:18:53 -05:00
Michael Cook (mackal) 7deb4d5e78 Fix potion belt loading 2015-02-18 18:28:46 -05:00
Paul Coene fe77c6fb3f Updated change log and made changes to worlddb.cpp so paineel characters
start in paineel again on Titanium.
2015-02-18 16:26:48 -05:00
Alex aaa9595b59 Merge pull request #372 from noudess/master
A non magical weapon with an augment tagged as magic now hits as magic
2015-02-18 12:52:56 -08:00
KimLS 2d40adcf66 Partial revert/rewrite of b6dd604, should be possible to get things on a hate list that have zero hate again 2015-02-18 12:39:28 -08:00
KayenEQ 57ccddbb36 Merge pull request #375 from KayenEQ/Development
Fix for taunt.
2015-02-18 02:47:37 -05:00
KayenEQ b6dd604de2 Fix for taunt.
Added additional check to prevent recourse spells from recoursing themselves and crashing.
2015-02-18 02:46:13 -05:00
Uleat 911a515923 Fix for MySQL query failure 2015-02-18 00:22:05 -05:00
Uleat ea38fd2421 Merge pull request #374 from EQEmu/character_limit
Variable per-client character creation limits
2015-02-17 19:59:05 -05:00
Uleat e7fc6420f2 Added changelog entry for character limit 2015-02-17 19:35:50 -05:00
Uleat 766641cd15 Implemented per-client character creation limits 2015-02-17 13:58:27 -05:00
Uleat e4be4d6895 Pre-purposed clean-up 2015-02-17 13:58:26 -05:00
Uleat 53a1faa36f Constant name and eqdictionary entry addition prior to per-client version limit activation 2015-02-17 13:58:25 -05:00
Uleat 20249cec67 Pre-purposed prep-work 2015-02-17 13:58:25 -05:00
Uleat dedbb3f6c8 Implemented higher bandolier and potion belt counts 2015-02-17 13:58:24 -05:00
Uleat 5a3b10a11c Constant name re-alignments prior to extended bandolier/potion belt activation 2015-02-17 13:58:23 -05:00
Uleat f1a25da065 Pre-purposed clean-up 2015-02-17 13:58:19 -05:00
Paul Coene f9dbea531c Added note about augs to changelog 2015-02-16 17:14:29 -05:00
Michael Cook (mackal) b48a712887 Send bard effect stuff for RoF2
Server side we still use the old system
Servers will need to update their items, PEQ's DB appears fine

RoF2 wasn't show anything, so we have to send it for them
2015-02-16 15:40:44 -05:00
Trevius 28be3b87b7 (RoF2) Bazaar Trading (Buying/Selling) is now fully functional. Bazaar (/bazaar) search is not yet functional. 2015-02-16 11:56:23 -06:00
KimLS db3feafe48 Fix for returning to bound zone you're already in 2015-02-14 20:05:54 -08:00
KimLS 9a78bac0d0 Changed save items back to true to be like old encode, no point tempting fate on that not breaking anything 2015-02-14 18:46:03 -08:00
KimLS f95e211d9b Fixes to OP_ZonePlayerToBind code, esp for RoF clients. 2015-02-14 18:32:49 -08:00
Michael Cook (mackal) 75809fc3bb Fix RoF2 Strategy 2015-02-14 14:21:50 -05:00
Trevius 811e8809cc (RoF2) Bazaar is now partially functional. RoF2 clients can start/end trader mode and other clients can purchase from them. No other functionality yet. 2015-02-14 11:09:36 -06:00
Paul Coene eaf5cea908 Fixed a comment 2015-02-14 10:29:43 -05:00
Akkadius 7ac7914f33 Set door zone to 32 bytes for consistency in copy [skip ci] 2015-02-13 03:50:01 -06:00
Akkadius da425195f9 Missed .sql file [skip ci] 2015-02-12 22:32:36 -06:00
Akkadius a544c681c7 Implement zone based gravity, required SQL DB change
- To test `zone` table `gravity` values, change the value and use #zheader <zoneshortname> to test
2015-02-12 22:09:17 -06:00
Akkadius fd45e8d21d Merge branch 'master' of https://github.com/EQEmu/Server 2015-02-12 20:52:24 -06:00
Akkadius 1966324112 Changed NPCTypes Data to bulk load when the zone loads or Repops, this bulk loading is stored in the npc_types cache 2015-02-12 19:57:24 -06:00
Michael Cook (mackal) d1be53bef2 Fix RoF2 disc stuff 2015-02-12 14:02:14 -05:00
Akkadius 16002eb62e ClientTaskState::GetTaskActivityDoneCountFromTaskID invalid Index return (Crash fix) 2015-02-12 01:54:41 -06:00
KimLS 2774d8e761 AddToHateList will no longer assert on other = nullptr, it will now just do nothing. Since the function can be called from perl/lua it's inapprops to let them just crash the server with an abort() from assert. 2015-02-11 21:56:58 -08:00
Trevius e07704e36b (RoF+) Bandolier no longer displays a Treasure Chest Icon when no Bandoliers are set. 2015-02-11 19:02:52 -06:00
Uleat 9f400c8d14 SharedBank Plat and Item HotKey fixes for RoF 2015-02-11 17:10:45 -05:00
Michael Cook (mackal) 2c31b348c3 RoF2 shared bank plat 2015-02-11 16:26:55 -05:00
Michael Cook (mackal) cefff6506f Fix issue with corpse spawn packets
Historically PC corpses used 3; it doesn't appear true with Tit+

Test case target a corpse and /ttell it :P
2015-02-11 13:20:32 -05:00
Paul Coene 8cde649e39 A non magical weapon with an augment tagged as magical now registers
as a magig weapon when attacking a creature requiring magic
2015-02-09 17:04:44 -05:00
455 changed files with 100278 additions and 39995 deletions
+10 -4
View File
@@ -1,11 +1,17 @@
language: cpp
compiler: gcc
before_install:
- sudo apt-get update -qq
- sudo apt-get install -y libmysqlclient-dev libperl-dev libboost-dev liblua5.1-0-dev zlib1g-dev
sudo: false
addons:
apt:
packages:
- libmysqlclient-dev
- libperl-dev
- libboost-dev
- liblua5.1-0-dev
- zlib1g-dev
script:
- cmake -G "Unix Makefiles" -DEQEMU_BUILD_TESTS=ON -DEQEMU_ENABLE_BOTS=ON
- make
- make -j8
- ./bin/tests
branches:
only:
-12
View File
@@ -31,7 +31,6 @@
#EQEMU_SANITIZE_LUA_LIBS
#EQEMU_BUILD_CLIENT_FILES
#EQEMU_MAP_DIR
#EQEMU_ENABLE_PROFILING
#We set a fairly new version (as of 2013) because I found finding perl was a bit... buggy on older ones
#Can change this if you really want but you should upgrade!
@@ -258,7 +257,6 @@ OPTION(EQEMU_BUILD_TESTS "Build utility tests." OFF)
OPTION(EQEMU_BUILD_PERL "Build Perl parser." ON)
OPTION(EQEMU_BUILD_LUA "Build Lua parser." ON)
OPTION(EQEMU_BUILD_CLIENT_FILES "Build Client Import/Export Data Programs." ON)
OPTION(EQEMU_ENABLE_PROFILING "Enable CPU profiler. Note: will slow down execution time." OFF)
#C++11 stuff
IF(NOT MSVC)
@@ -333,16 +331,6 @@ IF(EQEMU_BUILD_LUA)
ADD_SUBDIRECTORY(luabind)
ENDIF(EQEMU_BUILD_LUA)
IF(EQEMU_ENABLE_PROFILING)
ADD_DEFINITIONS(-DEQPERF_ENABLED)
ADD_DEFINITIONS(-DEQP_MULTITHREAD)
INCLUDE_DIRECTORIES("eqperf")
ADD_SUBDIRECTORY(eqperf)
SET(PERF_LIBS eqperf)
ELSE(EQEMU_ENABLE_PROFILING)
SET(PERF_LIBS "")
ENDIF(EQEMU_ENABLE_PROFILING)
IF(EQEMU_BUILD_SERVER OR EQEMU_BUILD_LOGIN OR EQEMU_BUILD_TESTS)
ADD_SUBDIRECTORY(common)
ENDIF(EQEMU_BUILD_SERVER OR EQEMU_BUILD_LOGIN OR EQEMU_BUILD_TESTS)
+654 -207
View File
File diff suppressed because it is too large Load Diff
+1 -4
View File
@@ -11,17 +11,15 @@ ADD_EXECUTABLE(export_client_files ${export_sources} ${export_headers})
INSTALL(TARGETS export_client_files RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})
TARGET_LINK_LIBRARIES(export_client_files common ${PERF_LIBS} debug ${MySQL_LIBRARY_DEBUG} optimized ${MySQL_LIBRARY_RELEASE} ${ZLIB_LIBRARY})
TARGET_LINK_LIBRARIES(export_client_files common debug ${MySQL_LIBRARY_DEBUG} optimized ${MySQL_LIBRARY_RELEASE} ${ZLIB_LIBRARY})
IF(MSVC)
SET_TARGET_PROPERTIES(export_client_files PROPERTIES LINK_FLAGS_RELEASE "/OPT:REF /OPT:ICF")
TARGET_LINK_LIBRARIES(export_client_files "Ws2_32.lib")
TARGET_LINK_LIBRARIES(export_client_files "rpcrt4")
ENDIF(MSVC)
IF(MINGW)
TARGET_LINK_LIBRARIES(export_client_files "WS2_32")
TARGET_LINK_LIBRARIES(export_client_files "rpcrt4")
ENDIF(MINGW)
IF(UNIX)
@@ -32,7 +30,6 @@ IF(UNIX)
TARGET_LINK_LIBRARIES(export_client_files "rt")
ENDIF(NOT DARWIN)
TARGET_LINK_LIBRARIES(export_client_files "pthread")
TARGET_LINK_LIBRARIES(export_client_files "uuid")
ADD_DEFINITIONS(-fPIC)
ENDIF(UNIX)
+37 -4
View File
@@ -32,6 +32,7 @@ EQEmuLogSys Log;
void ExportSpells(SharedDatabase *db);
void ExportSkillCaps(SharedDatabase *db);
void ExportBaseData(SharedDatabase *db);
void ExportDBStrings(SharedDatabase *db);
int main(int argc, char **argv) {
RegisterExecutablePlatform(ExePlatformClientExport);
@@ -44,12 +45,12 @@ int main(int argc, char **argv) {
return 1;
}
const EQEmuConfig *config = EQEmuConfig::get();
auto Config = EQEmuConfig::get();
SharedDatabase database;
Log.Out(Logs::General, Logs::Status, "Connecting to database...");
if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(),
config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) {
if(!database.Connect(Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(),
Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) {
Log.Out(Logs::General, Logs::Error, "Unable to connect to the database, cannot continue without a "
"database connection");
return 1;
@@ -62,6 +63,7 @@ int main(int argc, char **argv) {
ExportSpells(&database);
ExportSkillCaps(&database);
ExportBaseData(&database);
ExportDBStrings(&database);
Log.CloseFileLogs();
@@ -194,7 +196,38 @@ void ExportBaseData(SharedDatabase *db) {
fprintf(f, "%s\n", line.c_str());
}
} else {
}
fclose(f);
}
void ExportDBStrings(SharedDatabase *db) {
Log.Out(Logs::General, Logs::Status, "Exporting DB Strings...");
FILE *f = fopen("export/dbstr_us.txt", "w");
if(!f) {
Log.Out(Logs::General, Logs::Error, "Unable to open export/dbstr_us.txt to write, skipping.");
return;
}
fprintf(f, "Major^Minor^String(New)\n");
const std::string query = "SELECT * FROM db_str ORDER BY id, type";
auto results = db->QueryDatabase(query);
if(results.Success()) {
for(auto row = results.begin(); row != results.end(); ++row) {
std::string line;
unsigned int fields = results.ColumnCount();
for(unsigned int rowIndex = 0; rowIndex < fields; ++rowIndex) {
if(rowIndex != 0)
line.push_back('^');
if(row[rowIndex] != nullptr) {
line += row[rowIndex];
}
}
fprintf(f, "%s\n", line.c_str());
}
}
fclose(f);
+1 -4
View File
@@ -11,17 +11,15 @@ ADD_EXECUTABLE(import_client_files ${import_sources} ${import_headers})
INSTALL(TARGETS import_client_files RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})
TARGET_LINK_LIBRARIES(import_client_files common ${PERF_LIBS} debug ${MySQL_LIBRARY_DEBUG} optimized ${MySQL_LIBRARY_RELEASE} ${ZLIB_LIBRARY})
TARGET_LINK_LIBRARIES(import_client_files common debug ${MySQL_LIBRARY_DEBUG} optimized ${MySQL_LIBRARY_RELEASE} ${ZLIB_LIBRARY})
IF(MSVC)
SET_TARGET_PROPERTIES(import_client_files PROPERTIES LINK_FLAGS_RELEASE "/OPT:REF /OPT:ICF")
TARGET_LINK_LIBRARIES(import_client_files "Ws2_32.lib")
TARGET_LINK_LIBRARIES(import_client_files "rpcrt4")
ENDIF(MSVC)
IF(MINGW)
TARGET_LINK_LIBRARIES(import_client_files "WS2_32")
TARGET_LINK_LIBRARIES(import_client_files "rpcrt4")
ENDIF(MINGW)
IF(UNIX)
@@ -32,7 +30,6 @@ IF(UNIX)
TARGET_LINK_LIBRARIES(import_client_files "rt")
ENDIF(NOT DARWIN)
TARGET_LINK_LIBRARIES(import_client_files "pthread")
TARGET_LINK_LIBRARIES(import_client_files "uuid")
ADD_DEFINITIONS(-fPIC)
ENDIF(UNIX)
+58 -4
View File
@@ -30,6 +30,7 @@ EQEmuLogSys Log;
void ImportSpells(SharedDatabase *db);
void ImportSkillCaps(SharedDatabase *db);
void ImportBaseData(SharedDatabase *db);
void ImportDBStrings(SharedDatabase *db);
int main(int argc, char **argv) {
RegisterExecutablePlatform(ExePlatformClientImport);
@@ -42,12 +43,12 @@ int main(int argc, char **argv) {
return 1;
}
const EQEmuConfig *config = EQEmuConfig::get();
auto Config = EQEmuConfig::get();
SharedDatabase database;
Log.Out(Logs::General, Logs::Status, "Connecting to database...");
if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(),
config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) {
if(!database.Connect(Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(),
Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) {
Log.Out(Logs::General, Logs::Error, "Unable to connect to the database, cannot continue without a "
"database connection");
return 1;
@@ -59,6 +60,7 @@ int main(int argc, char **argv) {
ImportSpells(&database);
ImportSkillCaps(&database);
ImportBaseData(&database);
ImportDBStrings(&database);
Log.CloseFileLogs();
@@ -202,7 +204,6 @@ void ImportSkillCaps(SharedDatabase *db) {
continue;
}
int class_id, skill_id, level, cap;
class_id = atoi(split[0].c_str());
skill_id = atoi(split[1].c_str());
@@ -262,3 +263,56 @@ void ImportBaseData(SharedDatabase *db) {
fclose(f);
}
void ImportDBStrings(SharedDatabase *db) {
Log.Out(Logs::General, Logs::Status, "Importing DB Strings...");
FILE *f = fopen("import/dbstr_us.txt", "r");
if(!f) {
Log.Out(Logs::General, Logs::Error, "Unable to open import/dbstr_us.txt to read, skipping.");
return;
}
std::string delete_sql = "DELETE FROM db_str";
db->QueryDatabase(delete_sql);
char buffer[2048];
bool first = true;
while(fgets(buffer, 2048, f)) {
if(first) {
first = false;
continue;
}
for(int i = 0; i < 2048; ++i) {
if(buffer[i] == '\n') {
buffer[i] = 0;
break;
}
}
auto split = SplitString(buffer, '^');
if(split.size() < 2) {
continue;
}
std::string sql;
int id, type;
std::string value;
id = atoi(split[0].c_str());
type = atoi(split[1].c_str());
if(split.size() >= 3) {
value = ::EscapeString(split[2]);
}
sql = StringFormat("INSERT INTO db_str(id, type, value) VALUES(%u, %u, '%s')",
id, type, value.c_str());
db->QueryDatabase(sql);
}
fclose(f);
}
+23 -20
View File
@@ -21,6 +21,12 @@ IF(MYSQL_ROOT)
NAMES mysql.h
PATHS ${MYSQL_ROOT}/include
PATH_SUFFIXES mysql
NO_DEFAULT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
)
FIND_PATH(MySQL_INCLUDE_DIR
NAMES mysql.h
PATH_SUFFIXES mysql
)
ELSE(MYSQL_ROOT)
FIND_PATH(MySQL_INCLUDE_DIR
@@ -30,49 +36,46 @@ ELSE(MYSQL_ROOT)
ENDIF(MYSQL_ROOT)
# Library
SET(MySQL_NAMES mysqlclient_r mysqlclient)
SET(MySQL_NAMES libmysql)
IF(MYSQL_ROOT)
FIND_LIBRARY(MySQL_LIBRARY_DEBUG
FIND_LIBRARY(MySQL_LIBRARY
NAMES ${MySQL_NAMES}
PATHS ${MYSQL_ROOT}/lib/debug /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64
PATHS ${MYSQL_ROOT}/lib
PATH_SUFFIXES mysql
NO_DEFAULT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
)
FIND_LIBRARY(MySQL_LIBRARY_RELEASE
FIND_LIBRARY(MySQL_LIBRARY
NAMES ${MySQL_NAMES}
PATHS ${MYSQL_ROOT}/lib /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64
PATH_SUFFIXES mysql
)
ELSE(MYSQL_ROOT)
FIND_LIBRARY(MySQL_LIBRARY_DEBUG
NAMES ${MySQL_NAMES}
PATHS /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64
PATH_SUFFIXES mysql
)
FIND_LIBRARY(MySQL_LIBRARY_RELEASE
NAMES ${MySQL_NAMES}
FIND_LIBRARY(MySQL_LIBRARY
NAMES ${MySQL_NAMES} mysqlclient_r mysqlclient
PATHS /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64
PATH_SUFFIXES mysql
)
ENDIF(MYSQL_ROOT)
IF (MySQL_INCLUDE_DIR AND MySQL_LIBRARY_DEBUG AND MySQL_LIBRARY_RELEASE)
IF (MySQL_INCLUDE_DIR AND MySQL_LIBRARY)
SET(MySQL_FOUND TRUE)
SET( MySQL_LIBRARIES ${MySQL_LIBRARY_DEBUG} ${MySQL_LIBRARY_RELEASE} )
ELSE (MySQL_INCLUDE_DIR AND MySQL_LIBRARY_DEBUG AND MySQL_LIBRARY_RELEASE)
SET( MySQL_LIBRARIES ${MySQL_LIBRARY} )
ELSE (MySQL_INCLUDE_DIR AND MySQL_LIBRARY)
SET(MySQL_FOUND FALSE)
SET( MySQL_LIBRARIES )
ENDIF (MySQL_INCLUDE_DIR AND MySQL_LIBRARY_DEBUG AND MySQL_LIBRARY_RELEASE)
ENDIF (MySQL_INCLUDE_DIR AND MySQL_LIBRARY)
# handle the QUIETLY and REQUIRED arguments and set MySQL_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MySQL DEFAULT_MSG MySQL_LIBRARY_DEBUG MySQL_LIBRARY_RELEASE MySQL_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MySQL DEFAULT_MSG MySQL_LIBRARY MySQL_INCLUDE_DIR)
IF(MySQL_FOUND)
SET( MySQL_LIBRARIES ${MySQL_LIBRARY_DEBUG} ${MySQL_LIBRARY_RELEASE} )
SET( MySQL_LIBRARY_RELEASE ${MySQL_LIBRARY} )
SET( MySQL_LIBRARY_DEBUG ${MySQL_LIBRARY} )
SET( MySQL_LIBRARIES ${MySQL_LIBRARY_RELEASE} ${MySQL_LIBRARY_DEBUG} )
ELSE(MySQL_FOUND)
SET( MySQL_LIBRARIES )
ENDIF(MySQL_FOUND)
+62 -30
View File
@@ -3,6 +3,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
SET(common_sources
base_packet.cpp
classes.cpp
client_version.cpp
condition.cpp
crash.cpp
crc16.cpp
@@ -11,15 +12,19 @@ SET(common_sources
database_conversions.cpp
database_instances.cpp
dbcore.cpp
deity.cpp
emu_constants.cpp
emu_legacy.cpp
emu_limits.cpp
emu_opcodes.cpp
emu_tcp_connection.cpp
emu_tcp_server.cpp
eq_dictionary.cpp
eqdb.cpp
eqdb_res.cpp
eqemu_exception.cpp
eqemu_config.cpp
eqemu_logsys.cpp
eq_limits.cpp
eq_packet.cpp
eq_stream.cpp
eq_stream_factory.cpp
@@ -30,8 +35,11 @@ SET(common_sources
faction.cpp
guild_base.cpp
guilds.cpp
inventory_version.cpp
ipc_mutex.cpp
item.cpp
item_struct.cpp
light_source.cpp
md5.cpp
memory_mapped_file.cpp
misc.cpp
@@ -39,6 +47,7 @@ SET(common_sources
mutex.cpp
mysql_request_result.cpp
mysql_request_row.cpp
opcode_map.cpp
opcodemgr.cpp
packet_dump.cpp
packet_dump_file.cpp
@@ -48,7 +57,9 @@ SET(common_sources
proc_launcher.cpp
ptimer.cpp
races.cpp
rdtsc.cpp
rulesys.cpp
say_link.cpp
serverinfo.cpp
shareddb.cpp
skills.cpp
@@ -60,17 +71,22 @@ SET(common_sources
timeoutmgr.cpp
timer.cpp
unix.cpp
uuid.cpp
worldconn.cpp
xml_parser.cpp
platform.cpp
patches/patches.cpp
patches/sod.cpp
patches/sod_limits.cpp
patches/sof.cpp
patches/sof_limits.cpp
patches/rof.cpp
patches/rof_limits.cpp
patches/rof2.cpp
patches/rof2_limits.cpp
patches/titanium.cpp
patches/titanium_limits.cpp
patches/uf.cpp
patches/uf_limits.cpp
SocketLib/Base64.cpp
SocketLib/File.cpp
SocketLib/HttpdCookies.cpp
@@ -95,6 +111,7 @@ SET(common_headers
base_data.h
bodytypes.h
classes.h
client_version.h
condition.h
crash.h
crc16.h
@@ -103,12 +120,14 @@ SET(common_headers
database.h
dbcore.h
deity.h
emu_constants.h
emu_legacy.h
emu_limits.h
emu_opcodes.h
emu_oplist.h
emu_tcp_connection.h
emu_tcp_server.h
eq_constants.h
eq_dictionary.h
eq_packet_structs.h
eqdb.h
eqdb_res.h
@@ -116,6 +135,7 @@ SET(common_headers
eqemu_config.h
eqemu_config_elements.h
eqemu_logsys.h
eq_limits.h
eq_packet.h
eq_stream.h
eq_stream_factory.h
@@ -134,11 +154,13 @@ SET(common_headers
global_define.h
guild_base.h
guilds.h
inventory_version.h
ipc_mutex.h
item.h
item_fieldlist.h
item_struct.h
languages.h
light_source.h
linked_list.h
loottable.h
mail_oplist.h
@@ -157,12 +179,15 @@ SET(common_headers
packet_functions.h
platform.h
proc_launcher.h
profiler.h
ptimer.h
queue.h
races.h
random.h
rdtsc.h
rulesys.h
ruletypes.h
say_link.h
seperator.h
serverinfo.h
servertalk.h
@@ -179,44 +204,44 @@ SET(common_headers
types.h
unix.h
useperl.h
uuid.h
version.h
worldconn.h
xml_parser.h
zone_numbers.h
patches/patches.h
patches/sod.h
patches/sod_constants.h
patches/sod_itemfields.h
# patches/sod_itemfields.h
patches/sod_limits.h
patches/sod_ops.h
patches/sod_structs.h
patches/sof.h
patches/sof_constants.h
patches/sof_itemfields.h
patches/sof_opcode_list.h
# patches/sof_itemfields.h
patches/sof_limits.h
# patches/sof_opcode_list.h
patches/sof_ops.h
patches/sof_structs.h
patches/ss_declare.h
patches/ss_define.h
patches/ss_register.h
patches/rof.h
patches/rof_constants.h
patches/rof_itemfields.h
# patches/rof_itemfields.h
patches/rof_limits.h
patches/rof_ops.h
patches/rof_structs.h
patches/rof2.h
patches/rof2_constants.h
patches/rof2_itemfields.h
# patches/rof2_itemfields.h
patches/rof2_limits.h
patches/rof2_ops.h
patches/rof2_structs.h
patches/titanium.h
patches/titanium_constants.h
patches/titanium_itemfields.h
# patches/titanium_itemfields_a.h
# patches/titanium_itemfields_b.h
patches/titanium_limits.h
patches/titanium_ops.h
patches/titanium_structs.h
patches/uf.h
patches/uf_constants.h
patches/uf_itemfields.h
# patches/uf_itemfields.h
patches/uf_limits.h
patches/uf_ops.h
patches/uf_structs.h
SocketLib/Base64.h
@@ -239,46 +264,53 @@ SET(common_headers
SOURCE_GROUP(Patches FILES
patches/patches.h
patches/sod.h
patches/sod_itemfields.h
# patches/sod_itemfields.h
patches/sod_limits.h
patches/sod_ops.h
patches/sod_constants.h
patches/sod_structs.h
patches/sof.h
patches/sof_itemfields.h
patches/sof_opcode_list.h
# patches/sof_itemfields.h
patches/sof_limits.h
# patches/sof_opcode_list.h
patches/sof_ops.h
patches/sof_constants.h
patches/sof_structs.h
patches/ss_declare.h
patches/ss_define.h
patches/ss_register.h
patches/rof.h
patches/rof_itemfields.h
# patches/rof_itemfields.h
patches/rof_limits.h
patches/rof_ops.h
patches/rof_constants.h
patches/rof_structs.h
patches/rof2.h
patches/rof2_itemfields.h
# patches/rof2_itemfields.h
patches/rof2_limits.h
patches/rof2_ops.h
patches/rof2_constants.h
patches/rof2_structs.h
patches/titanium.h
patches/titanium_itemfields.h
# patches/titanium_itemfields_a.h
# patches/titanium_itemfields_b.h
patches/titanium_limits.h
patches/titanium_ops.h
patches/titanium_constants.h
patches/titanium_structs.h
patches/uf.h
patches/uf_itemfields.h
# patches/uf_itemfields.h
patches/uf_limits.h
patches/uf_ops.h
patches/uf_constants.h
patches/uf_structs.h
patches/patches.cpp
patches/sod.cpp
patches/sod_limits.cpp
patches/sof.cpp
patches/sof_limits.cpp
patches/rof.cpp
patches/rof_limits.cpp
patches/rof2.cpp
patches/rof2_limits.cpp
patches/titanium.cpp
patches/titanium_limits.cpp
patches/uf.cpp
patches/uf_limits.cpp
)
SOURCE_GROUP(SocketLib FILES
+5 -2
View File
@@ -22,10 +22,10 @@
#include <stdio.h>
#include <string.h>
#ifdef WIN32
#ifdef _WINDOWS
#include <time.h>
#include <windows.h>
#include <winsock2.h>
#include <windows.h>
#else
#include <sys/time.h>
#include <netinet/in.h>
@@ -63,9 +63,12 @@ public:
void WriteFloat(float value) { *(float *)(pBuffer + _wpos) = value; _wpos += sizeof(float); }
void WriteDouble(double value) { *(double *)(pBuffer + _wpos) = value; _wpos += sizeof(double); }
void WriteString(const char * str) { uint32 len = static_cast<uint32>(strlen(str)) + 1; memcpy(pBuffer + _wpos, str, len); _wpos += len; }
void WriteData(const void *ptr, size_t n) { memcpy(pBuffer + _wpos, ptr, n); _wpos += n; }
uint8 ReadUInt8() { uint8 value = *(uint8 *)(pBuffer + _rpos); _rpos += sizeof(uint8); return value; }
uint8 ReadUInt8(uint32 Offset) const { uint8 value = *(uint8 *)(pBuffer + Offset); return value; }
uint16 ReadUInt16() { uint16 value = *(uint16 *)(pBuffer + _rpos); _rpos += sizeof(uint16); return value; }
uint16 ReadUInt16(uint32 Offset) const { uint16 value = *(uint16 *)(pBuffer + Offset); return value; }
uint32 ReadUInt32() { uint32 value = *(uint32 *)(pBuffer + _rpos); _rpos += sizeof(uint32); return value; }
uint32 ReadUInt32(uint32 Offset) const { uint32 value = *(uint32 *)(pBuffer + Offset); return value; }
void ReadString(char *str) { uint32 len = static_cast<uint32>(strlen((char *)(pBuffer + _rpos))) + 1; memcpy(str, pBuffer + _rpos, len); _rpos += len; }
+571 -270
View File
@@ -1,5 +1,5 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
Copyright (C) 2001-2016 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
@@ -18,275 +18,576 @@
#include "../common/global_define.h"
#include "../common/classes.h"
const char* GetEQClassName(uint8 class_, uint8 level) {
switch(class_) {
case WARRIOR:
if (level >= 70)
return "Vanquisher";
else if (level >= 65)
return "Overlord"; //Baron-Sprite: LEAVE MY CLASSES ALONE.
else if (level >= 60)
return "Warlord";
else if (level >= 55)
return "Myrmidon";
else if (level >= 51)
return "Champion";
else
return "Warrior";
case CLERIC:
if (level >= 70)
return "Prelate";
else if (level >= 65)
return "Archon";
else if (level >= 60)
return "High Priest";
else if (level >= 55)
return "Templar";
else if (level >= 51)
return "Vicar";
else
return "Cleric";
case PALADIN:
if (level >= 70)
return "Lord";
else if (level >= 65)
return "Lord Protector";
else if (level >= 60)
return "Crusader";
else if (level >= 55)
return "Knight";
else if (level >= 51)
return "Cavalier";
else
return "Paladin";
case RANGER:
if (level >= 70)
return "Plainswalker";
else if (level >= 65)
return "Forest Stalker";
else if (level >= 60)
return "Warder";
else if (level >= 55)
return "Outrider";
else if (level >= 51)
return "Pathfinder";
else
return "Ranger";
case SHADOWKNIGHT:
if (level >= 70)
return "Scourge Knight";
else if (level >= 65)
return "Dread Lord";
else if (level >= 60)
return "Grave Lord";
else if (level >= 55)
return "Revenant";
else if (level >= 51)
return "Reaver";
else
return "Shadowknight";
case DRUID:
if (level >= 70)
return "Natureguard";
else if (level >= 65)
return "Storm Warden";
else if (level >= 60)
return "Hierophant";
else if (level >= 55)
return "Preserver";
else if (level >= 51)
return "Wanderer";
else
return "Druid";
case MONK:
if (level >= 70)
return "Stone Fist";
else if (level >= 65)
return "Transcendent";
else if (level >= 60)
return "Grandmaster";
else if (level >= 55)
return "Master";
else if (level >= 51)
return "Disciple";
else
return "Monk";
case BARD:
if (level >= 70)
return "Performer";
else if (level >= 65)
return "Maestro";
else if (level >= 60)
return "Virtuoso";
else if (level >= 55)
return "Troubadour";
else if (level >= 51)
return "Minstrel";
else
return "Bard";
case ROGUE:
if (level >= 70)
return "Nemesis";
else if (level >= 65)
return "Deceiver";
else if (level >= 60)
return "Assassin";
else if (level >= 55)
return "Blackguard";
else if (level >= 51)
return "Rake";
else
return "Rogue";
case SHAMAN:
if (level >= 70)
return "Soothsayer";
else if (level >= 65)
return "Prophet";
else if (level >= 60)
return "Oracle";
else if (level >= 55)
return "Luminary";
else if (level >= 51)
return "Mystic";
else
return "Shaman";
case NECROMANCER:
if (level >= 70)
return "Wraith";
else if (level >= 65)
return "Arch Lich";
else if (level >= 60)
return "Warlock";
else if (level >= 55)
return "Defiler";
else if (level >= 51)
return "Heretic";
else
return "Necromancer";
case WIZARD:
if (level >= 70)
return "Grand Arcanist";
else if (level >= 65)
return "Arcanist";
else if (level >= 60)
return "Sorcerer";
else if (level >= 55)
return "Evoker";
else if (level >= 51)
return "Channeler";
else
return "Wizard";
case MAGICIAN:
if (level >= 70)
return "Arch Magus";
else if (level >= 65)
return "Arch Convoker";
else if (level >= 60)
return "Arch Mage";
else if (level >= 55)
return "Conjurer";
if (level >= 51)
return "Elementalist";
else
return "Magician";
case ENCHANTER:
if (level >= 70)
return "Bedazzler";
else if (level >= 65)
return "Coercer";
else if (level >= 60)
return "Phantasmist";
else if (level >= 55)
return "Beguiler";
else if (level >= 51)
return "Illusionist";
else
return "Enchanter";
case BEASTLORD:
if (level >= 70)
return "Wildblood";
else if (level >= 65)
return "Feral Lord";
else if (level >= 60)
return "Savage Lord";
else if (level >= 55)
return "Animist";
else if (level >= 51)
return "Primalist";
else
return "Beastlord";
case BERSERKER:
if (level >= 70)
return "Ravager";
else if (level >= 65)
return "Fury";
else if (level >= 60)
return "Rager";
else if (level >= 55)
return "Vehement";
else if (level >= 51)
return "Brawler";
else
return "Berserker";
case BANKER:
if (level >= 70)
return "Master Banker";
else if (level >= 65)
return "Elder Banker";
else if (level >= 60)
return "Oldest Banker";
else if (level >= 55)
return "Older Banker";
else if (level >= 51)
return "Old Banker";
else
return "Banker";
case WARRIORGM:
return "Warrior Guildmaster";
case CLERICGM:
return "Cleric Guildmaster";
case PALADINGM:
return "Paladin Guildmaster";
case RANGERGM:
return "Ranger Guildmaster";
case SHADOWKNIGHTGM:
return "Shadowknight Guildmaster";
case DRUIDGM:
return "Druid Guildmaster";
case MONKGM:
return "Monk Guildmaster";
case BARDGM:
return "Bard Guildmaster";
case ROGUEGM:
return "Rogue Guildmaster";
case SHAMANGM:
return "Shaman Guildmaster";
case NECROMANCERGM:
return "Necromancer Guildmaster";
case WIZARDGM:
return "Wizard Guildmaster";
case MAGICIANGM:
return "Magician Guildmaster";
case ENCHANTERGM:
return "Enchanter Guildmaster";
case BEASTLORDGM:
return "Beastlord Guildmaster";
case BERSERKERGM:
return "Berserker Guildmaster";
case MERCHANT:
return "Merchant";
case ADVENTURERECRUITER:
return "Adventure Recruiter";
case ADVENTUREMERCHANT:
return "Adventure Merchant";
case CORPSE_CLASS:
return "Corpse Class";
case TRIBUTE_MASTER:
return "Tribute Master";
case GUILD_TRIBUTE_MASTER:
return "Guild Tribute Master";
default:
return "Unknown";
const char* GetClassIDName(uint8 class_id, uint8 level)
{
switch (class_id) {
case WARRIOR:
if (level >= 70)
return "Vanquisher";
else if (level >= 65)
return "Overlord"; //Baron-Sprite: LEAVE MY CLASSES ALONE.
else if (level >= 60)
return "Warlord";
else if (level >= 55)
return "Myrmidon";
else if (level >= 51)
return "Champion";
else
return "Warrior";
case CLERIC:
if (level >= 70)
return "Prelate";
else if (level >= 65)
return "Archon";
else if (level >= 60)
return "High Priest";
else if (level >= 55)
return "Templar";
else if (level >= 51)
return "Vicar";
else
return "Cleric";
case PALADIN:
if (level >= 70)
return "Lord";
else if (level >= 65)
return "Lord Protector";
else if (level >= 60)
return "Crusader";
else if (level >= 55)
return "Knight";
else if (level >= 51)
return "Cavalier";
else
return "Paladin";
case RANGER:
if (level >= 70)
return "Plainswalker";
else if (level >= 65)
return "Forest Stalker";
else if (level >= 60)
return "Warder";
else if (level >= 55)
return "Outrider";
else if (level >= 51)
return "Pathfinder";
else
return "Ranger";
case SHADOWKNIGHT:
if (level >= 70)
return "Scourge Knight";
else if (level >= 65)
return "Dread Lord";
else if (level >= 60)
return "Grave Lord";
else if (level >= 55)
return "Revenant";
else if (level >= 51)
return "Reaver";
else
return "Shadowknight";
case DRUID:
if (level >= 70)
return "Natureguard";
else if (level >= 65)
return "Storm Warden";
else if (level >= 60)
return "Hierophant";
else if (level >= 55)
return "Preserver";
else if (level >= 51)
return "Wanderer";
else
return "Druid";
case MONK:
if (level >= 70)
return "Stone Fist";
else if (level >= 65)
return "Transcendent";
else if (level >= 60)
return "Grandmaster";
else if (level >= 55)
return "Master";
else if (level >= 51)
return "Disciple";
else
return "Monk";
case BARD:
if (level >= 70)
return "Performer";
else if (level >= 65)
return "Maestro";
else if (level >= 60)
return "Virtuoso";
else if (level >= 55)
return "Troubadour";
else if (level >= 51)
return "Minstrel";
else
return "Bard";
case ROGUE:
if (level >= 70)
return "Nemesis";
else if (level >= 65)
return "Deceiver";
else if (level >= 60)
return "Assassin";
else if (level >= 55)
return "Blackguard";
else if (level >= 51)
return "Rake";
else
return "Rogue";
case SHAMAN:
if (level >= 70)
return "Soothsayer";
else if (level >= 65)
return "Prophet";
else if (level >= 60)
return "Oracle";
else if (level >= 55)
return "Luminary";
else if (level >= 51)
return "Mystic";
else
return "Shaman";
case NECROMANCER:
if (level >= 70)
return "Wraith";
else if (level >= 65)
return "Arch Lich";
else if (level >= 60)
return "Warlock";
else if (level >= 55)
return "Defiler";
else if (level >= 51)
return "Heretic";
else
return "Necromancer";
case WIZARD:
if (level >= 70)
return "Grand Arcanist";
else if (level >= 65)
return "Arcanist";
else if (level >= 60)
return "Sorcerer";
else if (level >= 55)
return "Evoker";
else if (level >= 51)
return "Channeler";
else
return "Wizard";
case MAGICIAN:
if (level >= 70)
return "Arch Magus";
else if (level >= 65)
return "Arch Convoker";
else if (level >= 60)
return "Arch Mage";
else if (level >= 55)
return "Conjurer";
if (level >= 51)
return "Elementalist";
else
return "Magician";
case ENCHANTER:
if (level >= 70)
return "Bedazzler";
else if (level >= 65)
return "Coercer";
else if (level >= 60)
return "Phantasmist";
else if (level >= 55)
return "Beguiler";
else if (level >= 51)
return "Illusionist";
else
return "Enchanter";
case BEASTLORD:
if (level >= 70)
return "Wildblood";
else if (level >= 65)
return "Feral Lord";
else if (level >= 60)
return "Savage Lord";
else if (level >= 55)
return "Animist";
else if (level >= 51)
return "Primalist";
else
return "Beastlord";
case BERSERKER:
if (level >= 70)
return "Ravager";
else if (level >= 65)
return "Fury";
else if (level >= 60)
return "Rager";
else if (level >= 55)
return "Vehement";
else if (level >= 51)
return "Brawler";
else
return "Berserker";
case BANKER:
if (level >= 70)
return "Master Banker";
else if (level >= 65)
return "Elder Banker";
else if (level >= 60)
return "Oldest Banker";
else if (level >= 55)
return "Older Banker";
else if (level >= 51)
return "Old Banker";
else
return "Banker";
case WARRIORGM:
return "Warrior Guildmaster";
case CLERICGM:
return "Cleric Guildmaster";
case PALADINGM:
return "Paladin Guildmaster";
case RANGERGM:
return "Ranger Guildmaster";
case SHADOWKNIGHTGM:
return "Shadowknight Guildmaster";
case DRUIDGM:
return "Druid Guildmaster";
case MONKGM:
return "Monk Guildmaster";
case BARDGM:
return "Bard Guildmaster";
case ROGUEGM:
return "Rogue Guildmaster";
case SHAMANGM:
return "Shaman Guildmaster";
case NECROMANCERGM:
return "Necromancer Guildmaster";
case WIZARDGM:
return "Wizard Guildmaster";
case MAGICIANGM:
return "Magician Guildmaster";
case ENCHANTERGM:
return "Enchanter Guildmaster";
case BEASTLORDGM:
return "Beastlord Guildmaster";
case BERSERKERGM:
return "Berserker Guildmaster";
case MERCHANT:
return "Merchant";
case ADVENTURERECRUITER:
return "Adventure Recruiter";
case ADVENTUREMERCHANT:
return "Adventure Merchant";
case CORPSE_CLASS:
return "Corpse Class";
case TRIBUTE_MASTER:
return "Tribute Master";
case GUILD_TRIBUTE_MASTER:
return "Guild Tribute Master";
default:
return "Unknown";
}
}
const char* GetPlayerClassName(uint32 player_class_value, uint8 level)
{
return GetClassIDName(GetClassIDFromPlayerClassValue(player_class_value), level);
}
uint32 GetPlayerClassValue(uint8 class_id)
{
switch (class_id) {
case WARRIOR:
case CLERIC:
case PALADIN:
case RANGER:
case SHADOWKNIGHT:
case DRUID:
case MONK:
case BARD:
case ROGUE:
case SHAMAN:
case NECROMANCER:
case WIZARD:
case MAGICIAN:
case ENCHANTER:
case BEASTLORD:
case BERSERKER:
return class_id;
default:
return PLAYER_CLASS_UNKNOWN; // watch
}
}
uint32 GetPlayerClassBit(uint8 class_id)
{
switch (class_id) {
case WARRIOR:
return PLAYER_CLASS_WARRIOR_BIT;
case CLERIC:
return PLAYER_CLASS_CLERIC_BIT;
case PALADIN:
return PLAYER_CLASS_PALADIN_BIT;
case RANGER:
return PLAYER_CLASS_RANGER_BIT;
case SHADOWKNIGHT:
return PLAYER_CLASS_SHADOWKNIGHT_BIT;
case DRUID:
return PLAYER_CLASS_DRUID_BIT;
case MONK:
return PLAYER_CLASS_MONK_BIT;
case BARD:
return PLAYER_CLASS_BARD_BIT;
case ROGUE:
return PLAYER_CLASS_ROGUE_BIT;
case SHAMAN:
return PLAYER_CLASS_SHAMAN_BIT;
case NECROMANCER:
return PLAYER_CLASS_NECROMANCER_BIT;
case WIZARD:
return PLAYER_CLASS_WIZARD_BIT;
case MAGICIAN:
return PLAYER_CLASS_MAGICIAN_BIT;
case ENCHANTER:
return PLAYER_CLASS_ENCHANTER_BIT;
case BEASTLORD:
return PLAYER_CLASS_BEASTLORD_BIT;
case BERSERKER:
return PLAYER_CLASS_BERSERKER_BIT;
default:
return PLAYER_CLASS_UNKNOWN_BIT;
}
}
uint8 GetClassIDFromPlayerClassValue(uint32 player_class_value)
{
switch (player_class_value) {
case PLAYER_CLASS_WARRIOR:
case PLAYER_CLASS_CLERIC:
case PLAYER_CLASS_PALADIN:
case PLAYER_CLASS_RANGER:
case PLAYER_CLASS_SHADOWKNIGHT:
case PLAYER_CLASS_DRUID:
case PLAYER_CLASS_MONK:
case PLAYER_CLASS_BARD:
case PLAYER_CLASS_ROGUE:
case PLAYER_CLASS_SHAMAN:
case PLAYER_CLASS_NECROMANCER:
case PLAYER_CLASS_WIZARD:
case PLAYER_CLASS_MAGICIAN:
case PLAYER_CLASS_ENCHANTER:
case PLAYER_CLASS_BEASTLORD:
case PLAYER_CLASS_BERSERKER:
return player_class_value;
default:
return PLAYER_CLASS_UNKNOWN; // watch
}
}
uint8 GetClassIDFromPlayerClassBit(uint32 player_class_bit)
{
switch (player_class_bit) {
case PLAYER_CLASS_WARRIOR_BIT:
return WARRIOR;
case PLAYER_CLASS_CLERIC_BIT:
return CLERIC;
case PLAYER_CLASS_PALADIN_BIT:
return PALADIN;
case PLAYER_CLASS_RANGER_BIT:
return RANGER;
case PLAYER_CLASS_SHADOWKNIGHT_BIT:
return SHADOWKNIGHT;
case PLAYER_CLASS_DRUID_BIT:
return DRUID;
case PLAYER_CLASS_MONK_BIT:
return MONK;
case PLAYER_CLASS_BARD_BIT:
return BARD;
case PLAYER_CLASS_ROGUE_BIT:
return ROGUE;
case PLAYER_CLASS_SHAMAN_BIT:
return SHAMAN;
case PLAYER_CLASS_NECROMANCER_BIT:
return NECROMANCER;
case PLAYER_CLASS_WIZARD_BIT:
return WIZARD;
case PLAYER_CLASS_MAGICIAN_BIT:
return MAGICIAN;
case PLAYER_CLASS_ENCHANTER_BIT:
return ENCHANTER;
case PLAYER_CLASS_BEASTLORD_BIT:
return BEASTLORD;
case PLAYER_CLASS_BERSERKER_BIT:
return BERSERKER;
default:
return PLAYER_CLASS_UNKNOWN; // watch
}
}
bool IsFighterClass(uint8 class_id)
{
switch (class_id) {
case WARRIOR:
case PALADIN:
case RANGER:
case SHADOWKNIGHT:
case MONK:
case BARD:
case ROGUE:
case BEASTLORD:
case BERSERKER:
return true;
default:
return false;
}
}
bool IsSpellFighterClass(uint8 class_id)
{
switch (class_id) {
case PALADIN:
case RANGER:
case SHADOWKNIGHT:
case BEASTLORD:
return true;
default:
return false;
}
}
bool IsNonSpellFighterClass(uint8 class_id)
{
switch (class_id) {
case WARRIOR:
case MONK:
case BARD:
case ROGUE:
case BERSERKER:
return true;
default:
return false;
}
}
bool IsCasterClass(uint8 class_id)
{
switch (class_id) {
case CLERIC:
case DRUID:
case SHAMAN:
case NECROMANCER:
case WIZARD:
case MAGICIAN:
case ENCHANTER:
return true;
default:
return false;
}
}
bool IsINTCasterClass(uint8 class_id)
{
switch (class_id) {
case NECROMANCER:
case WIZARD:
case MAGICIAN:
case ENCHANTER:
return true;
default:
return false;
}
}
bool IsWISCasterClass(uint8 class_id)
{
switch (class_id) {
case CLERIC:
case DRUID:
case SHAMAN:
return true;
default:
return false;
}
}
bool IsPlateClass(uint8 class_id)
{
switch (class_id) {
case WARRIOR:
case CLERIC:
case PALADIN:
case SHADOWKNIGHT:
case BARD:
return true;
default:
return false;
}
}
bool IsChainClass(uint8 class_id)
{
switch (class_id) {
case RANGER:
case ROGUE:
case SHAMAN:
case BERSERKER:
return true;
default:
return false;
}
}
bool IsLeatherClass(uint8 class_id)
{
switch (class_id) {
case DRUID:
case MONK:
case BEASTLORD:
return true;
default:
return false;
}
}
bool IsClothClass(uint8 class_id)
{
switch (class_id) {
case NECROMANCER:
case WIZARD:
case MAGICIAN:
case ENCHANTER:
return true;
default:
return false;
}
}
uint8 ClassArmorType(uint8 class_id)
{
switch (class_id) {
case WARRIOR:
case CLERIC:
case PALADIN:
case SHADOWKNIGHT:
case BARD:
return ARMOR_TYPE_PLATE;
case RANGER:
case ROGUE:
case SHAMAN:
case BERSERKER:
return ARMOR_TYPE_CHAIN;
case DRUID:
case MONK:
case BEASTLORD:
return ARMOR_TYPE_LEATHER;
case NECROMANCER:
case WIZARD:
case MAGICIAN:
case ENCHANTER:
return ARMOR_TYPE_CLOTH;
default:
return ARMOR_TYPE_UNKNOWN;
}
}
+100 -42
View File
@@ -1,5 +1,5 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
Copyright (C) 2001-2016 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
@@ -17,26 +17,25 @@
*/
#ifndef CLASSES_CH
#define CLASSES_CH
#include "../common/types.h"
#define Array_Class_UNKNOWN 0
#define WARRIOR 1
#define CLERIC 2
#define PALADIN 3
#define RANGER 4
#define SHADOWKNIGHT 5
#define DRUID 6
#define MONK 7
#define BARD 8
#define ROGUE 9
#define SHAMAN 10
#define NECROMANCER 11
#define WIZARD 12
#define MAGICIAN 13
#define ENCHANTER 14
#define BEASTLORD 15
#define BERSERKER 16
#define PLAYER_CLASS_COUNT 16 // used for array defines, must be the count of playable classes
#define WARRIOR 1
#define CLERIC 2
#define PALADIN 3
#define RANGER 4
#define SHADOWKNIGHT 5
#define DRUID 6
#define MONK 7
#define BARD 8
#define ROGUE 9
#define SHAMAN 10
#define NECROMANCER 11
#define WIZARD 12
#define MAGICIAN 13
#define ENCHANTER 14
#define BEASTLORD 15
#define BERSERKER 16
#define WARRIORGM 20
#define CLERICGM 21
#define PALADINGM 22
@@ -58,33 +57,92 @@
#define DISCORD_MERCHANT 59
#define ADVENTURERECRUITER 60
#define ADVENTUREMERCHANT 61
#define LDON_TREASURE 62 //objects you can use /open on first seen in LDONs
#define CORPSE_CLASS 62 //only seen on Danvi's Corpse in Akheva so far..
#define TRIBUTE_MASTER 63
#define GUILD_TRIBUTE_MASTER 64 //not sure
#define LDON_TREASURE 62 // objects you can use /open on first seen in LDONs
#define CORPSE_CLASS 62 // only seen on Danvi's Corpse in Akheva so far..
#define TRIBUTE_MASTER 63
#define GUILD_TRIBUTE_MASTER 64 // not sure
#define NORRATHS_KEEPERS_MERCHANT 67
#define DARK_REIGN_MERCHANT 68
#define FELLOWSHIP_MASTER 69
#define ALT_CURRENCY_MERCHANT 70
#define MERCERNARY_MASTER 71
#define warrior_1 1
#define monk_1 64
#define paladin_1 4
#define shadow_1 16
#define bard_1 128
#define cleric_1 2
#define necromancer_1 1024
#define ranger_1 8
#define druid_1 32
#define mage_1 4096
#define wizard_1 2048
#define enchanter_1 8192
#define rogue_1 256
#define shaman_1 512
#define beastlord_1 16384
#define berserker_1 32768
#define call_1 65536
const char* GetEQClassName(uint8 class_, uint8 level = 0);
// player class values
#define PLAYER_CLASS_UNKNOWN 0
#define PLAYER_CLASS_WARRIOR 1
#define PLAYER_CLASS_CLERIC 2
#define PLAYER_CLASS_PALADIN 3
#define PLAYER_CLASS_RANGER 4
#define PLAYER_CLASS_SHADOWKNIGHT 5
#define PLAYER_CLASS_DRUID 6
#define PLAYER_CLASS_MONK 7
#define PLAYER_CLASS_BARD 8
#define PLAYER_CLASS_ROGUE 9
#define PLAYER_CLASS_SHAMAN 10
#define PLAYER_CLASS_NECROMANCER 11
#define PLAYER_CLASS_WIZARD 12
#define PLAYER_CLASS_MAGICIAN 13
#define PLAYER_CLASS_ENCHANTER 14
#define PLAYER_CLASS_BEASTLORD 15
#define PLAYER_CLASS_BERSERKER 16
#define PLAYER_CLASS_COUNT 16
// player class bits
#define PLAYER_CLASS_UNKNOWN_BIT 0
#define PLAYER_CLASS_WARRIOR_BIT 1
#define PLAYER_CLASS_CLERIC_BIT 2
#define PLAYER_CLASS_PALADIN_BIT 4
#define PLAYER_CLASS_RANGER_BIT 8
#define PLAYER_CLASS_SHADOWKNIGHT_BIT 16
#define PLAYER_CLASS_DRUID_BIT 32
#define PLAYER_CLASS_MONK_BIT 64
#define PLAYER_CLASS_BARD_BIT 128
#define PLAYER_CLASS_ROGUE_BIT 256
#define PLAYER_CLASS_SHAMAN_BIT 512
#define PLAYER_CLASS_NECROMANCER_BIT 1024
#define PLAYER_CLASS_WIZARD_BIT 2048
#define PLAYER_CLASS_MAGICIAN_BIT 4096
#define PLAYER_CLASS_ENCHANTER_BIT 8192
#define PLAYER_CLASS_BEASTLORD_BIT 16384
#define PLAYER_CLASS_BERSERKER_BIT 32768
#define PLAYER_CLASS_ALL_MASK 65535 // was 65536
#define ARMOR_TYPE_UNKNOWN 0
#define ARMOR_TYPE_CLOTH 1
#define ARMOR_TYPE_LEATHER 2
#define ARMOR_TYPE_CHAIN 3
#define ARMOR_TYPE_PLATE 4
#define ARMOR_TYPE_FIRST ARMOR_TYPE_UNKNOWN
#define ARMOR_TYPE_LAST ARMOR_TYPE_PLATE
#define ARMOR_TYPE_COUNT 5
const char* GetClassIDName(uint8 class_id, uint8 level = 0);
const char* GetPlayerClassName(uint32 player_class_value, uint8 level = 0);
uint32 GetPlayerClassValue(uint8 class_id);
uint32 GetPlayerClassBit(uint8 class_id);
uint8 GetClassIDFromPlayerClassValue(uint32 player_class_value);
uint8 GetClassIDFromPlayerClassBit(uint32 player_class_bit);
bool IsFighterClass(uint8 class_id);
bool IsSpellFighterClass(uint8 class_id);
bool IsNonSpellFighterClass(uint8 class_id);
bool IsCasterClass(uint8 class_id);
bool IsINTCasterClass(uint8 class_id);
bool IsWISCasterClass(uint8 class_id);
bool IsPlateClass(uint8 class_id);
bool IsChainClass(uint8 class_id);
bool IsLeatherClass(uint8 class_id);
bool IsClothClass(uint8 class_id);
uint8 ClassArmorType(uint8 class_id);
#endif
+128
View File
@@ -0,0 +1,128 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
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 "client_version.h"
bool EQEmu::versions::IsValidClientVersion(ClientVersion client_version)
{
if (client_version <= ClientVersion::Unknown || client_version > LastClientVersion)
return false;
return true;
}
EQEmu::versions::ClientVersion EQEmu::versions::ValidateClientVersion(ClientVersion client_version)
{
if (client_version <= ClientVersion::Unknown || client_version > LastClientVersion)
return ClientVersion::Unknown;
return client_version;
}
const char* EQEmu::versions::ClientVersionName(ClientVersion client_version)
{
switch (client_version) {
case ClientVersion::Unknown:
return "Unknown Version";
case ClientVersion::Client62:
return "Client 6.2";
case ClientVersion::Titanium:
return "Titanium";
case ClientVersion::SoF:
return "SoF";
case ClientVersion::SoD:
return "SoD";
case ClientVersion::UF:
return "UF";
case ClientVersion::RoF:
return "RoF";
case ClientVersion::RoF2:
return "RoF2";
default:
return "Invalid Version";
};
}
uint32 EQEmu::versions::ConvertClientVersionToClientVersionBit(ClientVersion client_version)
{
switch (client_version) {
case ClientVersion::Unknown:
case ClientVersion::Client62:
return bit_Unknown;
case ClientVersion::Titanium:
return bit_Titanium;
case ClientVersion::SoF:
return bit_SoF;
case ClientVersion::SoD:
return bit_SoD;
case ClientVersion::UF:
return bit_UF;
case ClientVersion::RoF:
return bit_RoF;
case ClientVersion::RoF2:
return bit_RoF2;
default:
return bit_Unknown;
}
}
EQEmu::versions::ClientVersion EQEmu::versions::ConvertClientVersionBitToClientVersion(uint32 client_version_bit)
{
switch (client_version_bit) {
case (uint32)static_cast<unsigned int>(ClientVersion::Unknown) :
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::Client62) - 1)) :
return ClientVersion::Unknown;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::Titanium) - 1)) :
return ClientVersion::Titanium;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::SoF) - 1)) :
return ClientVersion::SoF;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::SoD) - 1)) :
return ClientVersion::SoD;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::UF) - 1)) :
return ClientVersion::UF;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::RoF) - 1)) :
return ClientVersion::RoF;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::RoF2) - 1)) :
return ClientVersion::RoF2;
default:
return ClientVersion::Unknown;
}
}
uint32 EQEmu::versions::ConvertClientVersionToExpansion(ClientVersion client_version)
{
switch (client_version) {
case ClientVersion::Unknown:
case ClientVersion::Client62:
case ClientVersion::Titanium:
return 0x000007FFU;
case ClientVersion::SoF:
return 0x00007FFFU;
case ClientVersion::SoD:
return 0x0000FFFFU;
case ClientVersion::UF:
return 0x0001FFFFU;
case ClientVersion::RoF:
case ClientVersion::RoF2:
return 0x000FFFFFU;
default:
return 0;
}
}
+78
View File
@@ -0,0 +1,78 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
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
*/
#ifndef COMMON_CLIENT_VERSION_H
#define COMMON_CLIENT_VERSION_H
#include "types.h"
#include <stdlib.h>
namespace EQEmu
{
namespace versions {
enum class ClientVersion {
Unknown = 0,
Client62, // Build: 'Aug 4 2005 15:40:59'
Titanium, // Build: 'Oct 31 2005 10:33:37'
SoF, // Build: 'Sep 7 2007 09:11:49'
SoD, // Build: 'Dec 19 2008 15:22:49'
UF, // Build: 'Jun 8 2010 16:44:32'
RoF, // Build: 'Dec 10 2012 17:35:44'
RoF2 // Build: 'May 10 2013 23:30:08'
};
enum ClientVersionBit : uint32 {
bit_Unknown = 0,
bit_Client62 = 0x00000001, // unsupported (placeholder for scripts)
bit_Titanium = 0x00000002,
bit_SoF = 0x00000004,
bit_SoD = 0x00000008,
bit_UF = 0x00000010,
bit_RoF = 0x00000020,
bit_RoF2 = 0x00000040,
bit_TitaniumAndEarlier = 0x00000003,
bit_SoFAndEarlier = 0x00000007,
bit_SoDAndEarlier = 0x0000000F,
bit_UFAndEarlier = 0x0000001F,
bit_RoFAndEarlier = 0x0000003F,
bit_SoFAndLater = 0xFFFFFFFC,
bit_SoDAndLater = 0xFFFFFFF8,
bit_UFAndLater = 0xFFFFFFF0,
bit_RoFAndLater = 0xFFFFFFE0,
bit_RoF2AndLater = 0xFFFFFFC0,
bit_AllClients = 0xFFFFFFFF
};
static const ClientVersion LastClientVersion = ClientVersion::RoF2;
static const size_t ClientVersionCount = (static_cast<size_t>(LastClientVersion) + 1);
extern bool IsValidClientVersion(ClientVersion client_version);
extern ClientVersion ValidateClientVersion(ClientVersion client_version);
extern const char* ClientVersionName(ClientVersion client_version);
extern uint32 ConvertClientVersionToClientVersionBit(ClientVersion client_version);
extern ClientVersion ConvertClientVersionBitToClientVersion(uint32 client_version_bit);
extern uint32 ConvertClientVersionToExpansion(ClientVersion client_version);
} /*versions*/
} /*EQEmu*/
#endif /*COMMON_CLIENT_VERSION_H*/
-77
View File
@@ -1,77 +0,0 @@
#ifndef CLIENTVERSIONS_H
#define CLIENTVERSIONS_H
#include "types.h"
static const uint32 BIT_Client62 = 1;
static const uint32 BIT_Titanium = 2;
static const uint32 BIT_SoF = 4;
static const uint32 BIT_SoD = 8;
static const uint32 BIT_UF = 16;
static const uint32 BIT_RoF = 32;
static const uint32 BIT_RoF2 = 64;
static const uint32 BIT_TitaniumAndEarlier = 0x00000003;
static const uint32 BIT_SoFAndLater = 0xFFFFFFFC;
static const uint32 BIT_SoDAndLater = 0xFFFFFFF8;
static const uint32 BIT_UFAndLater = 0xFFFFFFF0;
static const uint32 BIT_RoFAndLater = 0xFFFFFFE0;
static const uint32 BIT_RoF2AndLater = 0xFFFFFFC0;
static const uint32 BIT_AllClients = 0xFFFFFFFF;
enum class ClientVersion
{
Unknown = 0,
Client62, // Build: 'Aug 4 2005 15:40:59'
Titanium, // Build: 'Oct 31 2005 10:33:37'
SoF, // Build: 'Sep 7 2007 09:11:49'
SoD, // Build: 'Dec 19 2008 15:22:49'
UF, // Build: 'Jun 8 2010 16:44:32'
RoF, // Build: 'Dec 10 2012 17:35:44'
RoF2, // Build: 'May 10 2013 23:30:08'
MobNPC,
MobMerc,
MobBot,
MobPet,
};
#define CLIENT_VERSION_COUNT 12
#define LAST_PC_CLIENT ClientVersion::RoF2
#define LAST_NPC_CLIENT ClientVersion::MobPet
static const char* ClientVersionName(ClientVersion version)
{
switch (version)
{
case ClientVersion::Unknown:
return "ClientVersion::Unknown";
case ClientVersion::Client62:
return "ClientVersion::Client62";
case ClientVersion::Titanium:
return "ClientVersion::Titanium";
case ClientVersion::SoF:
return "ClientVersion::SoF";
case ClientVersion::SoD:
return "ClientVersion::SoD";
case ClientVersion::UF:
return "ClientVersion::UF";
case ClientVersion::RoF:
return "ClientVersion::RoF";
case ClientVersion::RoF2:
return "ClientVersion::RoF2";
case ClientVersion::MobNPC:
return "ClientVersion::MobNPC";
case ClientVersion::MobMerc:
return "ClientVersion::MobMerc";
case ClientVersion::MobBot:
return "ClientVersion::MobBot";
case ClientVersion::MobPet:
return "ClientVersion::MobPet";
default:
return "<ERROR> Invalid ClientVersion";
};
}
#endif /* CLIENTVERSIONS_H */
+132 -239
View File
@@ -23,6 +23,7 @@
#include <iomanip>
#include <iostream>
#include <map>
#include <algorithm>
#include <mysqld_error.h>
#include <stdio.h>
#include <stdlib.h>
@@ -48,7 +49,6 @@
extern Client client;
Database::Database () {
DBInitVars();
}
/*
@@ -57,13 +57,10 @@ Establish a connection to a mysql database with the supplied parameters
Database::Database(const char* host, const char* user, const char* passwd, const char* database, uint32 port)
{
_eqp
DBInitVars();
Connect(host, user, passwd, database, port);
}
bool Database::Connect(const char* host, const char* user, const char* passwd, const char* database, uint32 port) {
_eqp
uint32 errnum= 0;
char errbuf[MYSQL_ERRMSG_SIZE];
if (!Open(host, user, passwd, database, port, &errnum, errbuf)) {
@@ -76,27 +73,12 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c
}
}
void Database::DBInitVars() {
_eqp
varcache_array = 0;
varcache_max = 0;
varcache_lastupdate = 0;
}
/*
Close the connection to the database
*/
Database::~Database()
{
_eqp
unsigned int x;
if (varcache_array) {
for (x=0; x<varcache_max; x++) {
safe_delete_array(varcache_array[x]);
}
safe_delete_array(varcache_array);
}
}
/*
@@ -105,7 +87,7 @@ Database::~Database()
Zero will also be returned if there is a database error.
*/
uint32 Database::CheckLogin(const char* name, const char* password, int16* oStatus) {
_eqp
if(strlen(name) >= 50 || strlen(password) >= 50)
return(0);
@@ -141,7 +123,6 @@ uint32 Database::CheckLogin(const char* name, const char* password, int16* oStat
//Get Banned IP Address List - Only return false if the incoming connection's IP address is not present in the banned_ips table.
bool Database::CheckBannedIPs(const char* loginIP)
{
_eqp
std::string query = StringFormat("SELECT ip_address FROM Banned_IPs WHERE ip_address='%s'", loginIP);
auto results = QueryDatabase(query);
@@ -158,7 +139,6 @@ bool Database::CheckBannedIPs(const char* loginIP)
}
bool Database::AddBannedIP(char* bannedIP, const char* notes) {
_eqp
std::string query = StringFormat("INSERT into Banned_IPs SET ip_address='%s', notes='%s'", bannedIP, notes);
auto results = QueryDatabase(query);
if (!results.Success()) {
@@ -168,7 +148,6 @@ bool Database::AddBannedIP(char* bannedIP, const char* notes) {
}
bool Database::CheckGMIPs(const char* ip_address, uint32 account_id) {
_eqp
std::string query = StringFormat("SELECT * FROM `gm_ips` WHERE `ip_address` = '%s' AND `account_id` = %i", ip_address, account_id);
auto results = QueryDatabase(query);
@@ -182,20 +161,17 @@ bool Database::AddBannedIP(char* bannedIP, const char* notes) {
}
bool Database::AddGMIP(char* ip_address, char* name) {
_eqp
std::string query = StringFormat("INSERT into `gm_ips` SET `ip_address` = '%s', `name` = '%s'", ip_address, name);
auto results = QueryDatabase(query);
return results.Success();
}
void Database::LoginIP(uint32 AccountID, const char* LoginIP) {
_eqp
std::string query = StringFormat("INSERT INTO account_ip SET accid=%i, ip='%s' ON DUPLICATE KEY UPDATE count=count+1, lastused=now()", AccountID, LoginIP);
QueryDatabase(query);
}
int16 Database::CheckStatus(uint32 account_id) {
_eqp
std::string query = StringFormat("SELECT `status`, UNIX_TIMESTAMP(`suspendeduntil`) as `suspendeduntil`, UNIX_TIMESTAMP() as `current`"
" FROM `account` WHERE `id` = %i", account_id);
@@ -225,7 +201,6 @@ int16 Database::CheckStatus(uint32 account_id) {
}
uint32 Database::CreateAccount(const char* name, const char* password, int16 status, uint32 lsaccount_id) {
_eqp
std::string query;
if (password)
@@ -249,7 +224,6 @@ uint32 Database::CreateAccount(const char* name, const char* password, int16 sta
}
bool Database::DeleteAccount(const char* name) {
_eqp
std::string query = StringFormat("DELETE FROM account WHERE name='%s';",name);
Log.Out(Logs::General, Logs::World_Server, "Account Attempting to be deleted:'%s'", name);
@@ -262,7 +236,6 @@ bool Database::DeleteAccount(const char* name) {
}
bool Database::SetLocalPassword(uint32 accid, const char* password) {
_eqp
std::string query = StringFormat("UPDATE account SET password=MD5('%s') where id=%i;", EscapeString(password).c_str(), accid);
auto results = QueryDatabase(query);
@@ -275,7 +248,6 @@ bool Database::SetLocalPassword(uint32 accid, const char* password) {
}
bool Database::SetAccountStatus(const char* name, int16 status) {
_eqp
std::string query = StringFormat("UPDATE account SET status=%i WHERE name='%s';", status, name);
std::cout << "Account being GM Flagged:" << name << ", Level: " << (int16) status << std::endl;
@@ -296,7 +268,6 @@ bool Database::SetAccountStatus(const char* name, int16 status) {
/* This initially creates the character during character create */
bool Database::ReserveName(uint32 account_id, char* name) {
_eqp
std::string query = StringFormat("SELECT `account_id`, `name` FROM `character_data` WHERE `name` = '%s'", name);
auto results = QueryDatabase(query);
for (auto row = results.begin(); row != results.end(); ++row) {
@@ -317,7 +288,6 @@ bool Database::ReserveName(uint32 account_id, char* name) {
returns false on failure, true otherwise
*/
bool Database::DeleteCharacter(char *name) {
_eqp
uint32 charid = 0;
if(!name || !strlen(name)) {
Log.Out(Logs::General, Logs::World_Server, "DeleteCharacter: request to delete without a name (empty char slot)");
@@ -329,7 +299,10 @@ bool Database::DeleteCharacter(char *name) {
std::string query = StringFormat("SELECT `id` from `character_data` WHERE `name` = '%s'", name);
auto results = QueryDatabase(query);
for (auto row = results.begin(); row != results.end(); ++row) { charid = atoi(row[0]); }
if (charid <= 0){ std::cerr << "Database::DeleteCharacter :: Character not found, stopping delete...\n"; return false; }
if (charid <= 0){
Log.Out(Logs::General, Logs::Error, "Database::DeleteCharacter :: Character (%s) not found, stopping delete...", name);
return false;
}
query = StringFormat("DELETE FROM `quest_globals` WHERE `charid` = '%d'", charid); QueryDatabase(query);
query = StringFormat("DELETE FROM `character_activities` WHERE `charid` = '%d'", charid); QueryDatabase(query);
@@ -364,18 +337,17 @@ bool Database::DeleteCharacter(char *name) {
query = StringFormat("DELETE FROM `character_inspect_messages` WHERE `id` = %u", charid); QueryDatabase(query);
query = StringFormat("DELETE FROM `character_leadership_abilities` WHERE `id` = %u", charid); QueryDatabase(query);
query = StringFormat("DELETE FROM `character_alt_currency` WHERE `char_id` = '%d'", charid); QueryDatabase(query);
#ifdef BOTS
query = StringFormat("DELETE FROM `guild_members` WHERE `char_id` = '%d' AND GetMobTypeById(%i) = 'C'", charid);
#else
#ifdef BOTS
query = StringFormat("DELETE FROM `guild_members` WHERE `char_id` = '%d' AND GetMobTypeById(%i) = 'C'", charid); // note: only use of GetMobTypeById()
#else
query = StringFormat("DELETE FROM `guild_members` WHERE `char_id` = '%d'", charid);
#endif
#endif
QueryDatabase(query);
return true;
}
bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, PlayerProfile_Struct* pp){
_eqp
std::string query = StringFormat(
"REPLACE INTO `character_data` ("
"id,"
@@ -653,12 +625,18 @@ bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, Playe
);
auto results = QueryDatabase(query);
/* Save Bind Points */
query = StringFormat("REPLACE INTO `character_bind` (id, zone_id, instance_id, x, y, z, heading, is_home)"
query = StringFormat("REPLACE INTO `character_bind` (id, zone_id, instance_id, x, y, z, heading, slot)"
" VALUES (%u, %u, %u, %f, %f, %f, %f, %i), "
"(%u, %u, %u, %f, %f, %f, %f, %i), ",
"(%u, %u, %u, %f, %f, %f, %f, %i), ",
"(%u, %u, %u, %f, %f, %f, %f, %i), ",
"(%u, %u, %u, %f, %f, %f, %f, %i)",
character_id, pp->binds[0].zoneId, 0, pp->binds[0].x, pp->binds[0].y, pp->binds[0].z, pp->binds[0].heading, 0,
character_id, pp->binds[4].zoneId, 0, pp->binds[4].x, pp->binds[4].y, pp->binds[4].z, pp->binds[4].heading, 1
); results = QueryDatabase(query);
character_id, pp->binds[1].zoneId, 0, pp->binds[1].x, pp->binds[1].y, pp->binds[1].z, pp->binds[1].heading, 1,
character_id, pp->binds[2].zoneId, 0, pp->binds[2].x, pp->binds[2].y, pp->binds[2].z, pp->binds[2].heading, 2,
character_id, pp->binds[3].zoneId, 0, pp->binds[3].x, pp->binds[3].y, pp->binds[3].z, pp->binds[3].heading, 3,
character_id, pp->binds[4].zoneId, 0, pp->binds[4].x, pp->binds[4].y, pp->binds[4].z, pp->binds[4].heading, 4
); results = QueryDatabase(query);
/* Save Skills */
int firstquery = 0;
@@ -695,7 +673,6 @@ bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, Playe
/* This only for new Character creation storing */
bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inventory* inv) {
_eqp
uint32 charid = 0;
char zone[50];
float x, y, z;
@@ -723,7 +700,7 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven
/* Insert starting inventory... */
std::string invquery;
for (int16 i=EmuConstants::EQUIPMENT_BEGIN; i<=EmuConstants::BANK_BAGS_END;) {
for (int16 i = EQEmu::legacy::EQUIPMENT_BEGIN; i <= EQEmu::legacy::BANK_BAGS_END;) {
const ItemInst* newinv = inv->GetItem(i);
if (newinv) {
invquery = StringFormat("INSERT INTO `inventory` (charid, slotid, itemid, charges, color) VALUES (%u, %i, %u, %i, %u)",
@@ -732,16 +709,16 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven
auto results = QueryDatabase(invquery);
}
if (i == MainCursor) {
i = EmuConstants::GENERAL_BAGS_BEGIN;
if (i == EQEmu::legacy::SlotCursor) {
i = EQEmu::legacy::GENERAL_BAGS_BEGIN;
continue;
}
else if (i == EmuConstants::CURSOR_BAG_END) {
i = EmuConstants::BANK_BEGIN;
else if (i == EQEmu::legacy::CURSOR_BAG_END) {
i = EQEmu::legacy::BANK_BEGIN;
continue;
}
else if (i == EmuConstants::BANK_END) {
i = EmuConstants::BANK_BAGS_BEGIN;
else if (i == EQEmu::legacy::BANK_END) {
i = EQEmu::legacy::BANK_BAGS_BEGIN;
continue;
}
i++;
@@ -750,7 +727,6 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven
}
uint32 Database::GetCharacterID(const char *name) {
_eqp
std::string query = StringFormat("SELECT `id` FROM `character_data` WHERE `name` = '%s'", name);
auto results = QueryDatabase(query);
auto row = results.begin();
@@ -767,7 +743,6 @@ uint32 Database::GetCharacterID(const char *name) {
Zero will also be returned if there is a database error.
*/
uint32 Database::GetAccountIDByChar(const char* charname, uint32* oCharID) {
_eqp
std::string query = StringFormat("SELECT `account_id`, `id` FROM `character_data` WHERE name='%s'", EscapeString(charname).c_str());
auto results = QueryDatabase(query);
@@ -792,7 +767,6 @@ uint32 Database::GetAccountIDByChar(const char* charname, uint32* oCharID) {
// Retrieve account_id for a given char_id
uint32 Database::GetAccountIDByChar(uint32 char_id) {
_eqp
std::string query = StringFormat("SELECT `account_id` FROM `character_data` WHERE `id` = %i LIMIT 1", char_id);
auto results = QueryDatabase(query);
if (!results.Success()) {
@@ -807,7 +781,6 @@ uint32 Database::GetAccountIDByChar(uint32 char_id) {
}
uint32 Database::GetAccountIDByName(const char* accname, int16* status, uint32* lsid) {
_eqp
if (!isAlphaNumeric(accname))
return 0;
@@ -839,7 +812,6 @@ uint32 Database::GetAccountIDByName(const char* accname, int16* status, uint32*
}
void Database::GetAccountName(uint32 accountid, char* name, uint32* oLSAccountID) {
_eqp
std::string query = StringFormat("SELECT `name`, `lsaccount_id` FROM `account` WHERE `id` = '%i'", accountid);
auto results = QueryDatabase(query);
@@ -859,8 +831,7 @@ void Database::GetAccountName(uint32 accountid, char* name, uint32* oLSAccountID
}
void Database::GetCharName(uint32 char_id, char* name) {
_eqp
void Database::GetCharName(uint32 char_id, char* name) {
std::string query = StringFormat("SELECT `name` FROM `character_data` WHERE id='%i'", char_id);
auto results = QueryDatabase(query);
@@ -875,156 +846,75 @@ void Database::GetCharName(uint32 char_id, char* name) {
}
bool Database::LoadVariables() {
_eqp
char *query = nullptr;
auto results = QueryDatabase(query, LoadVariables_MQ(&query));
auto results = QueryDatabase(StringFormat("SELECT varname, value, unix_timestamp() FROM variables where unix_timestamp(ts) >= %d", varcache.last_update));
if (!results.Success())
{
safe_delete_array(query);
return false;
}
safe_delete_array(query);
return LoadVariables_result(std::move(results));
}
uint32 Database::LoadVariables_MQ(char** query)
{
_eqp
return MakeAnyLenString(query, "SELECT varname, value, unix_timestamp() FROM variables where unix_timestamp(ts) >= %d", varcache_lastupdate);
}
// always returns true? not sure about this.
bool Database::LoadVariables_result(MySQLRequestResult results)
{
_eqp
uint32 i = 0;
LockMutex lock(&Mvarcache);
if (results.RowCount() == 0)
return true;
if (!varcache_array) {
varcache_max = results.RowCount();
varcache_array = new VarCache_Struct*[varcache_max];
for (i=0; i<varcache_max; i++)
varcache_array[i] = 0;
}
else {
uint32 tmpnewmax = varcache_max + results.RowCount();
VarCache_Struct** tmp = new VarCache_Struct*[tmpnewmax];
for (i=0; i<tmpnewmax; i++)
tmp[i] = 0;
for (i=0; i<varcache_max; i++)
tmp[i] = varcache_array[i];
VarCache_Struct** tmpdel = varcache_array;
varcache_array = tmp;
varcache_max = tmpnewmax;
delete [] tmpdel;
}
LockMutex lock(&Mvarcache);
for (auto row = results.begin(); row != results.end(); ++row)
{
varcache_lastupdate = atoi(row[2]);
for (i=0; i<varcache_max; i++) {
if (varcache_array[i]) {
if (strcasecmp(varcache_array[i]->varname, row[0]) == 0) {
delete varcache_array[i];
varcache_array[i] = (VarCache_Struct*) new uint8[sizeof(VarCache_Struct) + strlen(row[1]) + 1];
strn0cpy(varcache_array[i]->varname, row[0], sizeof(varcache_array[i]->varname));
strcpy(varcache_array[i]->value, row[1]);
break;
}
}
else {
varcache_array[i] = (VarCache_Struct*) new uint8[sizeof(VarCache_Struct) + strlen(row[1]) + 1];
strcpy(varcache_array[i]->varname, row[0]);
strcpy(varcache_array[i]->value, row[1]);
break;
}
}
std::string key, value;
for (auto row = results.begin(); row != results.end(); ++row) {
varcache.last_update = atoi(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
varcache.Add(key, value);
}
uint32 max_used = 0;
for (i=0; i<varcache_max; i++) {
if (varcache_array[i]) {
if (i > max_used)
max_used = i;
}
}
varcache_max = max_used + 1;
return true;
}
// Gets variable from 'variables' table
bool Database::GetVariable(const char* varname, char* varvalue, uint16 varvalue_len) {
_eqp
varvalue[0] = '\0';
bool Database::GetVariable(std::string varname, std::string &varvalue)
{
varvalue.clear();
LockMutex lock(&Mvarcache);
if (strlen(varname) <= 1)
return false;
for (uint32 i=0; i<varcache_max; i++) {
if (varcache_array[i]) {
if (strcasecmp(varcache_array[i]->varname, varname) == 0) {
snprintf(varvalue, varvalue_len, "%s", varcache_array[i]->value);
varvalue[varvalue_len-1] = 0;
return true;
}
}
else
return false;
if (varname.empty())
return false;
std::transform(std::begin(varname), std::end(varname), std::begin(varname), ::tolower); // all keys are lower case
auto tmp = varcache.Get(varname);
if (tmp) {
varvalue = *tmp;
return true;
}
return false;
}
bool Database::SetVariable(const char* varname_in, const char* varvalue_in) {
_eqp
char *varname,*varvalue;
varname=(char *)malloc(strlen(varname_in)*2+1);
varvalue=(char *)malloc(strlen(varvalue_in)*2+1);
DoEscapeString(varname, varname_in, strlen(varname_in));
DoEscapeString(varvalue, varvalue_in, strlen(varvalue_in));
std::string query = StringFormat("Update variables set value='%s' WHERE varname like '%s'", varvalue, varname);
bool Database::SetVariable(const std::string varname, const std::string &varvalue)
{
std::string escaped_name = EscapeString(varname);
std::string escaped_value = EscapeString(varvalue);
std::string query = StringFormat("Update variables set value='%s' WHERE varname like '%s'", escaped_value.c_str(), escaped_name.c_str());
auto results = QueryDatabase(query);
if (!results.Success())
{
free(varname);
free(varvalue);
return false;
}
if (results.RowsAffected() == 1)
{
LoadVariables(); // refresh cache
free(varname);
free(varvalue);
return true;
}
query = StringFormat("Insert Into variables (varname, value) values ('%s', '%s')", varname, varvalue);
query = StringFormat("Insert Into variables (varname, value) values ('%s', '%s')", escaped_name.c_str(), escaped_value.c_str());
results = QueryDatabase(query);
free(varname);
free(varvalue);
if (results.RowsAffected() != 1)
return false;
LoadVariables(); // refresh cache
return true;
}
uint32 Database::GetMiniLoginAccount(char* ip)
{
_eqp
std::string query = StringFormat("SELECT `id` FROM `account` WHERE `minilogin_ip` = '%s'", ip);
auto results = QueryDatabase(query);
@@ -1037,7 +927,7 @@ uint32 Database::GetMiniLoginAccount(char* ip)
// Get zone starting points from DB
bool Database::GetSafePoints(const char* short_name, uint32 version, float* safe_x, float* safe_y, float* safe_z, int16* minstatus, uint8* minlevel, char *flag_needed) {
_eqp
std::string query = StringFormat("SELECT safe_x, safe_y, safe_z, min_status, min_level, flag_needed FROM zone "
" WHERE short_name='%s' AND (version=%i OR version=0) ORDER BY version DESC", short_name, version);
auto results = QueryDatabase(query);
@@ -1067,7 +957,7 @@ bool Database::GetSafePoints(const char* short_name, uint32 version, float* safe
}
bool Database::GetZoneLongName(const char* short_name, char** long_name, char* file_name, float* safe_x, float* safe_y, float* safe_z, uint32* graveyard_id, uint32* maxclients) {
_eqp
std::string query = StringFormat("SELECT long_name, file_name, safe_x, safe_y, safe_z, graveyard_id, maxclients FROM zone WHERE short_name='%s' AND version=0", short_name);
auto results = QueryDatabase(query);
@@ -1105,7 +995,7 @@ bool Database::GetZoneLongName(const char* short_name, char** long_name, char* f
}
uint32 Database::GetZoneGraveyardID(uint32 zone_id, uint32 version) {
_eqp
std::string query = StringFormat("SELECT graveyard_id FROM zone WHERE zoneidnumber='%u' AND (version=%i OR version=0) ORDER BY version DESC", zone_id, version);
auto results = QueryDatabase(query);
@@ -1120,7 +1010,7 @@ uint32 Database::GetZoneGraveyardID(uint32 zone_id, uint32 version) {
}
bool Database::GetZoneGraveyard(const uint32 graveyard_id, uint32* graveyard_zoneid, float* graveyard_x, float* graveyard_y, float* graveyard_z, float* graveyard_heading) {
_eqp
std::string query = StringFormat("SELECT zone_id, x, y, z, heading FROM graveyard WHERE id=%i", graveyard_id);
auto results = QueryDatabase(query);
@@ -1148,7 +1038,6 @@ bool Database::GetZoneGraveyard(const uint32 graveyard_id, uint32* graveyard_zon
}
bool Database::LoadZoneNames() {
_eqp
std::string query("SELECT zoneidnumber, short_name FROM zone");
auto results = QueryDatabase(query);
@@ -1169,7 +1058,7 @@ bool Database::LoadZoneNames() {
}
uint32 Database::GetZoneID(const char* zonename) {
_eqp
if (zonename == nullptr)
return 0;
@@ -1181,7 +1070,6 @@ uint32 Database::GetZoneID(const char* zonename) {
}
const char* Database::GetZoneName(uint32 zoneID, bool ErrorUnknown) {
_eqp
auto iter = zonename_array.find(zoneID);
if (iter != zonename_array.end())
@@ -1194,7 +1082,7 @@ const char* Database::GetZoneName(uint32 zoneID, bool ErrorUnknown) {
}
uint8 Database::GetPEQZone(uint32 zoneID, uint32 version){
_eqp
std::string query = StringFormat("SELECT peqzone from zone where zoneidnumber='%i' AND (version=%i OR version=0) ORDER BY version DESC", zoneID, version);
auto results = QueryDatabase(query);
@@ -1212,24 +1100,18 @@ uint8 Database::GetPEQZone(uint32 zoneID, uint32 version){
bool Database::CheckNameFilter(const char* name, bool surname)
{
_eqp
std::string str_name = name;
if(surname)
// the minimum 4 is enforced by the client too
if (!name || strlen(name) < 4)
{
// the minimum 4 is enforced by the client too
if(!name || strlen(name) < 3)
{
return false;
}
return false;
}
else
// Given name length is enforced by the client too
if (!surname && strlen(name) > 15)
{
// the minimum 4 is enforced by the client too
if(!name || strlen(name) < 4 || strlen(name) > 15)
{
return false;
}
return false;
}
for (size_t i = 0; i < str_name.size(); i++)
@@ -1289,7 +1171,7 @@ bool Database::CheckNameFilter(const char* name, bool surname)
}
bool Database::AddToNameFilter(const char* name) {
_eqp
std::string query = StringFormat("INSERT INTO name_filter (name) values ('%s')", name);
auto results = QueryDatabase(query);
@@ -1305,7 +1187,6 @@ bool Database::AddToNameFilter(const char* name) {
}
uint32 Database::GetAccountIDFromLSID(uint32 iLSID, char* oAccountName, int16* oStatus) {
_eqp
uint32 account_id = 0;
std::string query = StringFormat("SELECT id, name, status FROM account WHERE lsaccount_id=%i", iLSID);
auto results = QueryDatabase(query);
@@ -1330,7 +1211,7 @@ uint32 Database::GetAccountIDFromLSID(uint32 iLSID, char* oAccountName, int16* o
}
void Database::GetAccountFromID(uint32 id, char* oAccountName, int16* oStatus) {
_eqp
std::string query = StringFormat("SELECT name, status FROM account WHERE id=%i", id);
auto results = QueryDatabase(query);
@@ -1350,12 +1231,10 @@ void Database::GetAccountFromID(uint32 id, char* oAccountName, int16* oStatus) {
}
void Database::ClearMerchantTemp(){
_eqp
QueryDatabase("DELETE FROM merchantlist_temp");
}
bool Database::UpdateName(const char* oldname, const char* newname) {
_eqp
std::cout << "Renaming " << oldname << " to " << newname << "..." << std::endl;
std::string query = StringFormat("UPDATE `character_data` SET `name` = '%s' WHERE `name` = '%s';", newname, oldname);
auto results = QueryDatabase(query);
@@ -1371,7 +1250,6 @@ bool Database::UpdateName(const char* oldname, const char* newname) {
// If the name is used or an error occurs, it returns false, otherwise it returns true
bool Database::CheckUsedName(const char* name) {
_eqp
std::string query = StringFormat("SELECT `id` FROM `character_data` WHERE `name` = '%s'", name);
auto results = QueryDatabase(query);
if (!results.Success()) {
@@ -1385,7 +1263,6 @@ bool Database::CheckUsedName(const char* name) {
}
uint8 Database::GetServerType() {
_eqp
std::string query("SELECT `value` FROM `variables` WHERE `varname` = 'ServerType' LIMIT 1");
auto results = QueryDatabase(query);
if (!results.Success()) {
@@ -1400,7 +1277,6 @@ uint8 Database::GetServerType() {
}
bool Database::MoveCharacterToZone(const char* charname, const char* zonename, uint32 zoneid) {
_eqp
if(zonename == nullptr || strlen(zonename) == 0)
return false;
@@ -1418,13 +1294,11 @@ bool Database::MoveCharacterToZone(const char* charname, const char* zonename, u
}
bool Database::MoveCharacterToZone(const char* charname, const char* zonename) {
_eqp
return MoveCharacterToZone(charname, zonename, GetZoneID(zonename));
}
bool Database::MoveCharacterToZone(uint32 iCharID, const char* iZonename) {
_eqp
std::string query = StringFormat("UPDATE `character_data` SET `zone_id` = %i, `x` = -1, `y` = -1, `z` = -1 WHERE `id` = %i", iZonename, GetZoneID(iZonename), iCharID);
std::string query = StringFormat("UPDATE `character_data` SET `zone_id` = %i, `x` = -1, `y` = -1, `z` = -1 WHERE `id` = %i", GetZoneID(iZonename), iCharID);
auto results = QueryDatabase(query);
if (!results.Success()) {
@@ -1435,7 +1309,6 @@ bool Database::MoveCharacterToZone(uint32 iCharID, const char* iZonename) {
}
bool Database::SetHackerFlag(const char* accountname, const char* charactername, const char* hacked) {
_eqp
std::string query = StringFormat("INSERT INTO `hackers` (account, name, hacked) values('%s','%s','%s')", accountname, charactername, hacked);
auto results = QueryDatabase(query);
@@ -1447,7 +1320,6 @@ bool Database::SetHackerFlag(const char* accountname, const char* charactername,
}
bool Database::SetMQDetectionFlag(const char* accountname, const char* charactername, const char* hacked, const char* zone) {
_eqp
//Utilize the "hacker" table, but also give zone information.
std::string query = StringFormat("INSERT INTO hackers(account,name,hacked,zone) values('%s','%s','%s','%s')", accountname, charactername, hacked, zone);
auto results = QueryDatabase(query);
@@ -1462,7 +1334,6 @@ bool Database::SetMQDetectionFlag(const char* accountname, const char* character
uint8 Database::GetRaceSkill(uint8 skillid, uint8 in_race)
{
_eqp
uint16 race_cap = 0;
//Check for a racial cap!
@@ -1481,7 +1352,6 @@ uint8 Database::GetRaceSkill(uint8 skillid, uint8 in_race)
uint8 Database::GetSkillCap(uint8 skillid, uint8 in_race, uint8 in_class, uint16 in_level)
{
_eqp
uint8 skill_level = 0, skill_formula = 0;
uint16 base_cap = 0, skill_cap = 0, skill_cap2 = 0, skill_cap3 = 0;
@@ -1531,7 +1401,6 @@ uint8 Database::GetSkillCap(uint8 skillid, uint8 in_race, uint8 in_class, uint16
}
uint32 Database::GetCharacterInfo(const char* iName, uint32* oAccID, uint32* oZoneID, uint32* oInstanceID, float* oX, float* oY, float* oZ) {
_eqp
std::string query = StringFormat("SELECT `id`, `account_id`, `zone_id`, `zone_instance`, `x`, `y`, `z` FROM `character_data` WHERE `name` = '%s'", iName);
auto results = QueryDatabase(query);
@@ -1555,7 +1424,7 @@ uint32 Database::GetCharacterInfo(const char* iName, uint32* oAccID, uint32* oZo
}
bool Database::UpdateLiveChar(char* charname,uint32 lsaccount_id) {
_eqp
std::string query = StringFormat("UPDATE account SET charname='%s' WHERE id=%i;",charname, lsaccount_id);
auto results = QueryDatabase(query);
@@ -1567,7 +1436,7 @@ bool Database::UpdateLiveChar(char* charname,uint32 lsaccount_id) {
}
bool Database::GetLiveChar(uint32 account_id, char* cname) {
_eqp
std::string query = StringFormat("SELECT charname FROM account WHERE id=%i", account_id);
auto results = QueryDatabase(query);
@@ -1586,41 +1455,36 @@ bool Database::GetLiveChar(uint32 account_id, char* cname) {
}
void Database::SetLFP(uint32 CharID, bool LFP) {
_eqp
std::string query = StringFormat("UPDATE `character_data` SET `lfp` = %i WHERE `id` = %i",LFP, CharID);
QueryDatabase(query);
}
void Database::SetLoginFlags(uint32 CharID, bool LFP, bool LFG, uint8 firstlogon) {
_eqp
std::string query = StringFormat("update `character_data` SET `lfp` = %i, `lfg` = %i, `firstlogon` = %i WHERE `id` = %i",LFP, LFG, firstlogon, CharID);
QueryDatabase(query);
}
void Database::SetLFG(uint32 CharID, bool LFG) {
_eqp
std::string query = StringFormat("update `character_data` SET `lfg` = %i WHERE `id` = %i",LFG, CharID);
QueryDatabase(query);
}
void Database::SetFirstLogon(uint32 CharID, uint8 firstlogon) {
_eqp
std::string query = StringFormat( "UPDATE `character_data` SET `firstlogon` = %i WHERE `id` = %i",firstlogon, CharID);
QueryDatabase(query);
}
void Database::AddReport(std::string who, std::string against, std::string lines) {
_eqp
char *escape_str = new char[lines.size()*2+1];
void Database::AddReport(std::string who, std::string against, std::string lines)
{
auto escape_str = new char[lines.size() * 2 + 1];
DoEscapeString(escape_str, lines.c_str(), lines.size());
std::string query = StringFormat("INSERT INTO reports (name, reported, reported_text) VALUES('%s', '%s', '%s')", who.c_str(), against.c_str(), escape_str);
std::string query = StringFormat("INSERT INTO reports (name, reported, reported_text) VALUES('%s', '%s', '%s')", EscapeString(who).c_str(), EscapeString(against).c_str(), escape_str);
QueryDatabase(query);
safe_delete_array(escape_str);
}
void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ismerc) {
_eqp
std::string query;
if (id == 0) {
// removing from group
@@ -1640,14 +1504,12 @@ void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ism
void Database::ClearAllGroups(void)
{
_eqp
std::string query("DELETE FROM `group_id`");
QueryDatabase(query);
return;
}
void Database::ClearGroup(uint32 gid) {
_eqp
ClearGroupLeader(gid);
if(gid == 0)
@@ -1663,7 +1525,6 @@ void Database::ClearGroup(uint32 gid) {
}
uint32 Database::GetGroupID(const char* name){
_eqp
std::string query = StringFormat("SELECT groupid from group_id where name='%s'", name);
auto results = QueryDatabase(query);
@@ -1674,7 +1535,7 @@ uint32 Database::GetGroupID(const char* name){
if (results.RowCount() == 0)
{
// Commenting this out until logging levels can prevent this from going to console
//Log.Out(Logs::General, Logs::None, "Character not in a group: %s", name);
//Log.Out(Logs::General, Logs::None,, "Character not in a group: %s", name);
return 0;
}
@@ -1685,7 +1546,6 @@ uint32 Database::GetGroupID(const char* name){
/* Is this really getting used properly... A half implementation ? Akkadius */
char* Database::GetGroupLeaderForLogin(const char* name, char* leaderbuf) {
_eqp
strcpy(leaderbuf, "");
uint32 group_id = 0;
@@ -1710,7 +1570,6 @@ char* Database::GetGroupLeaderForLogin(const char* name, char* leaderbuf) {
}
void Database::SetGroupLeaderName(uint32 gid, const char* name) {
_eqp
std::string query = StringFormat("UPDATE group_leaders SET leadername = '%s' WHERE gid = %u", EscapeString(name).c_str(), gid);
auto result = QueryDatabase(query);
@@ -1729,7 +1588,6 @@ void Database::SetGroupLeaderName(uint32 gid, const char* name) {
char *Database::GetGroupLeadershipInfo(uint32 gid, char* leaderbuf, char* maintank, char* assist, char* puller, char *marknpc, char *mentoree, int *mentor_percent, GroupLeadershipAA_Struct* GLAA)
{
_eqp
std::string query = StringFormat("SELECT `leadername`, `maintank`, `assist`, `puller`, `marknpc`, `mentoree`, `mentor_percent`, `leadershipaa` FROM `group_leaders` WHERE `gid` = %lu",(unsigned long)gid);
auto results = QueryDatabase(query);
@@ -1789,7 +1647,6 @@ char *Database::GetGroupLeadershipInfo(uint32 gid, char* leaderbuf, char* mainta
// Clearing all group leaders
void Database::ClearAllGroupLeaders(void) {
_eqp
std::string query("DELETE from group_leaders");
auto results = QueryDatabase(query);
@@ -1800,7 +1657,7 @@ void Database::ClearAllGroupLeaders(void) {
}
void Database::ClearGroupLeader(uint32 gid) {
_eqp
if(gid == 0)
{
ClearAllGroupLeaders();
@@ -1815,7 +1672,7 @@ void Database::ClearGroupLeader(uint32 gid) {
}
uint8 Database::GetAgreementFlag(uint32 acctid) {
_eqp
std::string query = StringFormat("SELECT rulesflag FROM account WHERE id=%i",acctid);
auto results = QueryDatabase(query);
@@ -1831,13 +1688,11 @@ uint8 Database::GetAgreementFlag(uint32 acctid) {
}
void Database::SetAgreementFlag(uint32 acctid) {
_eqp
std::string query = StringFormat("UPDATE account SET rulesflag=1 where id=%i", acctid);
QueryDatabase(query);
}
void Database::ClearRaid(uint32 rid) {
_eqp
if(rid == 0)
{
//clear all raids
@@ -1854,7 +1709,7 @@ void Database::ClearRaid(uint32 rid) {
}
void Database::ClearAllRaids(void) {
_eqp
std::string query("delete from raid_members");
auto results = QueryDatabase(query);
@@ -1864,7 +1719,7 @@ void Database::ClearAllRaids(void) {
void Database::ClearAllRaidDetails(void)
{
_eqp
std::string query("delete from raid_details");
auto results = QueryDatabase(query);
@@ -1873,7 +1728,7 @@ void Database::ClearAllRaidDetails(void)
}
void Database::ClearRaidDetails(uint32 rid) {
_eqp
if(rid == 0)
{
//clear all raids
@@ -1892,8 +1747,7 @@ void Database::ClearRaidDetails(uint32 rid) {
// returns 0 on error or no raid for that character, or
// the raid id that the character is a member of.
uint32 Database::GetRaidID(const char* name)
{
_eqp
{
std::string query = StringFormat("SELECT `raidid` FROM `raid_members` WHERE `name` = '%s'", name);
auto results = QueryDatabase(query);
@@ -1914,7 +1768,6 @@ uint32 Database::GetRaidID(const char* name)
const char* Database::GetRaidLeaderName(uint32 raid_id)
{
_eqp
// Would be a good idea to fix this to be a passed in variable and
// make the caller responsible. static local variables like this are
// not guaranteed to be thread safe (nor is the internal guard
@@ -1946,7 +1799,6 @@ const char* Database::GetRaidLeaderName(uint32 raid_id)
void Database::GetGroupLeadershipInfo(uint32 gid, uint32 rid, char *maintank,
char *assist, char *puller, char *marknpc, char *mentoree, int *mentor_percent, GroupLeadershipAA_Struct *GLAA)
{
_eqp
std::string query = StringFormat(
"SELECT maintank, assist, puller, marknpc, mentoree, mentor_percent, leadershipaa FROM raid_leaders WHERE gid = %lu AND rid = %lu",
(unsigned long)gid, (unsigned long)rid);
@@ -2004,7 +1856,6 @@ void Database::GetGroupLeadershipInfo(uint32 gid, uint32 rid, char *maintank,
void Database::GetRaidLeadershipInfo(uint32 rid, char *maintank,
char *assist, char *puller, char *marknpc, RaidLeadershipAA_Struct *RLAA)
{
_eqp
std::string query = StringFormat(
"SELECT maintank, assist, puller, marknpc, leadershipaa FROM raid_leaders WHERE gid = %lu AND rid = %lu",
(unsigned long)0xFFFFFFFF, (unsigned long)rid);
@@ -2048,7 +1899,6 @@ void Database::GetRaidLeadershipInfo(uint32 rid, char *maintank,
void Database::SetRaidGroupLeaderInfo(uint32 gid, uint32 rid)
{
_eqp
std::string query = StringFormat("UPDATE raid_leaders SET leadershipaa = '' WHERE gid = %lu AND rid = %lu",
(unsigned long)gid, (unsigned long)rid);
auto results = QueryDatabase(query);
@@ -2066,7 +1916,6 @@ void Database::SetRaidGroupLeaderInfo(uint32 gid, uint32 rid)
// Clearing all raid leaders
void Database::ClearAllRaidLeaders(void)
{
_eqp
std::string query("DELETE from raid_leaders");
QueryDatabase(query);
return;
@@ -2074,7 +1923,6 @@ void Database::ClearAllRaidLeaders(void)
void Database::ClearRaidLeader(uint32 gid, uint32 rid)
{
_eqp
if (rid == 0) {
ClearAllRaidLeaders();
return;
@@ -2086,7 +1934,7 @@ void Database::ClearRaidLeader(uint32 gid, uint32 rid)
void Database::UpdateAdventureStatsEntry(uint32 char_id, uint8 theme, bool win)
{
_eqp
std::string field;
switch(theme)
@@ -2139,7 +1987,6 @@ void Database::UpdateAdventureStatsEntry(uint32 char_id, uint8 theme, bool win)
bool Database::GetAdventureStats(uint32 char_id, AdventureStats_Struct *as)
{
_eqp
std::string query = StringFormat(
"SELECT "
"`guk_wins`, "
@@ -2186,7 +2033,6 @@ bool Database::GetAdventureStats(uint32 char_id, AdventureStats_Struct *as)
uint32 Database::GetGuildIDByCharID(uint32 character_id)
{
_eqp
std::string query = StringFormat("SELECT guild_id FROM guild_members WHERE char_id='%i'", character_id);
auto results = QueryDatabase(query);
@@ -2202,7 +2048,6 @@ uint32 Database::GetGuildIDByCharID(uint32 character_id)
void Database::LoadLogSettings(EQEmuLogSys::LogSettings* log_settings)
{
_eqp
std::string query =
"SELECT "
"log_category_id, "
@@ -2243,3 +2088,51 @@ void Database::LoadLogSettings(EQEmuLogSys::LogSettings* log_settings)
}
}
}
void Database::ClearInvSnapshots(bool use_rule)
{
uint32 del_time = time(nullptr);
if (use_rule) { del_time -= RuleI(Character, InvSnapshotHistoryD) * 86400; }
std::string query = StringFormat("DELETE FROM inventory_snapshots WHERE time_index <= %lu", (unsigned long)del_time);
QueryDatabase(query);
}
struct TimeOfDay_Struct Database::LoadTime(time_t &realtime)
{
TimeOfDay_Struct eqTime;
std::string query = StringFormat("SELECT minute,hour,day,month,year,realtime FROM eqtime limit 1");
auto results = QueryDatabase(query);
if (!results.Success() || results.RowCount() == 0){
Log.Out(Logs::Detail, Logs::World_Server, "Loading EQ time of day failed. Using defaults.");
eqTime.minute = 0;
eqTime.hour = 9;
eqTime.day = 1;
eqTime.month = 1;
eqTime.year = 3100;
realtime = time(0);
}
else{
auto row = results.begin();
eqTime.minute = atoi(row[0]);
eqTime.hour = atoi(row[1]);
eqTime.day = atoi(row[2]);
eqTime.month = atoi(row[3]);
eqTime.year = atoi(row[4]);
realtime = atoi(row[5]);
}
return eqTime;
}
bool Database::SaveTime(int8 minute, int8 hour, int8 day, int8 month, int16 year)
{
std::string query = StringFormat("UPDATE eqtime set minute = %d, hour = %d, day = %d, month = %d, year = %d, realtime = %d limit 1", minute, hour, day, month, year, time(0));
auto results = QueryDatabase(query);
return results.Success();
}
+19 -15
View File
@@ -1,5 +1,5 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2003 EQEMu Development Team (http://eqemulator.net)
Copyright (C) 2001-2016 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
@@ -23,6 +23,7 @@
#include "global_define.h"
#include "eqemu_logsys.h"
#include "types.h"
#include "dbcore.h"
#include "linked_list.h"
@@ -66,8 +67,14 @@ struct npcDecayTimes_Struct {
struct VarCache_Struct {
char varname[26];
char value[0];
std::map<std::string, std::string> m_cache;
uint32 last_update;
VarCache_Struct() : last_update(0) { }
void Add(const std::string &key, const std::string &value) { m_cache[key] = value; }
const std::string *Get(const std::string &key) {
auto it = m_cache.find(key);
return (it != m_cache.end() ? &it->second : nullptr);
}
};
class PTimerList;
@@ -87,7 +94,7 @@ class Database : public DBcore {
public:
Database();
Database(const char* host, const char* user, const char* passwd, const char* database,uint32 port);
bool Connect(const char* host, const char* user, const char* passwd, const char* database,uint32 port);
bool Connect(const char* host, const char* user, const char* passwd, const char* database, uint32 port);
~Database();
/* Character Creation */
@@ -209,17 +216,14 @@ public:
/* Database Conversions 'database_conversions.cpp' */
bool CheckDatabaseConversions();
bool CheckDatabaseConvertBotsPostPPDeblob();
bool CheckDatabaseConvertCorpseDeblob();
bool CheckDatabaseConvertPPDeblob();
/* Database Variables */
bool GetVariable(const char* varname, char* varvalue, uint16 varvalue_len);
bool SetVariable(const char* varname, const char* varvalue);
bool GetVariable(std::string varname, std::string &varvalue);
bool SetVariable(const std::string varname, const std::string &varvalue);
bool LoadVariables();
uint32 LoadVariables_MQ(char** query);
bool LoadVariables_result(MySQLRequestResult results);
/* General Queries */
@@ -241,6 +245,8 @@ public:
uint8 GetSkillCap(uint8 skillid, uint8 in_race, uint8 in_class, uint16 in_level);
void AddReport(std::string who, std::string against, std::string lines);
struct TimeOfDay_Struct LoadTime(time_t &realtime);
bool SaveTime(int8 minute, int8 hour, int8 day, int8 month, int16 year);
void ClearMerchantTemp();
void ClearPTimers(uint32 charid);
void SetFirstLogon(uint32 CharID, uint8 firstlogon);
@@ -248,18 +254,16 @@ public:
void SetLFP(uint32 CharID, bool LFP);
void SetLoginFlags(uint32 CharID, bool LFP, bool LFG, uint8 firstlogon);
void ClearInvSnapshots(bool use_rule = true);
/* EQEmuLogSys */
void LoadLogSettings(EQEmuLogSys::LogSettings* log_settings);
private:
void DBInitVars();
std::map<uint32,std::string> zonename_array;
Mutex Mvarcache;
uint32 varcache_max;
VarCache_Struct** varcache_array;
uint32 varcache_lastupdate;
Mutex Mvarcache;
VarCache_Struct varcache;
/* Groups, utility methods. */
void ClearAllGroupLeaders();
+35 -182
View File
@@ -157,25 +157,36 @@ namespace Convert {
/*84*/ uint32 Points;
/*88*/
} PVPStatsEntry_Struct;
static const size_t BANDOLIERS_SIZE = 4;
static const size_t BANDOLIER_ITEM_COUNT = 4;
struct BandolierItem_Struct {
uint32 item_id;
uint32 icon;
char item_name[64];
uint32 ID;
uint32 Icon;
char Name[64];
};
struct Bandolier_Struct {
char name[32];
Convert::BandolierItem_Struct items[EmuConstants::BANDOLIER_SIZE];
char Name[32];
Convert::BandolierItem_Struct Items[Convert::BANDOLIER_ITEM_COUNT];
};
static const size_t POTION_BELT_ITEM_COUNT = 4;
struct PotionBeltItem_Struct {
uint32 ID;
uint32 Icon;
char Name[64];
};
struct PotionBelt_Struct {
Convert::BandolierItem_Struct items[EmuConstants::POTION_BELT_SIZE];
Convert::PotionBeltItem_Struct Items[Convert::POTION_BELT_ITEM_COUNT];
};
struct SuspendedMinion_Struct
{
/*000*/ uint16 SpellID;
/*002*/ uint32 HP;
/*006*/ uint32 Mana;
/*010*/ Convert::SpellBuff_Struct Buffs[BUFF_COUNT];
/*510*/ uint32 Items[_MaterialCount];
/*510*/ uint32 Items[EQEmu::legacy::MaterialCount];
/*546*/ char Name[64];
/*610*/
};
@@ -216,9 +227,9 @@ namespace Convert {
/*0304*/ uint8 ability_time_minutes;
/*0305*/ uint8 ability_time_hours; //place holder
/*0306*/ uint8 unknown0306[6]; // @bp Spacer/Flag?
/*0312*/ uint32 item_material[_MaterialCount]; // Item texture/material of worn/held items
/*0312*/ uint32 item_material[EQEmu::legacy::MaterialCount]; // Item texture/material of worn/held items
/*0348*/ uint8 unknown0348[44];
/*0392*/ Convert::Color_Struct item_tint[_MaterialCount];
/*0392*/ Convert::Color_Struct item_tint[EQEmu::legacy::MaterialCount];
/*0428*/ Convert::AA_Array aa_array[MAX_PP_AA_ARRAY];
/*2348*/ float unknown2384; //seen ~128, ~47
/*2352*/ char servername[32]; // length probably not right
@@ -319,7 +330,7 @@ namespace Convert {
/*7212*/ uint32 tribute_points;
/*7216*/ uint32 unknown7252;
/*7220*/ uint32 tribute_active; //1=active
/*7224*/ Convert::Tribute_Struct tributes[EmuConstants::TRIBUTE_SIZE];
/*7224*/ Convert::Tribute_Struct tributes[EQEmu::legacy::TRIBUTE_SIZE];
/*7264*/ Convert::Disciplines_Struct disciplines;
/*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use)
/*7744*/ char unknown7780[160];
@@ -346,7 +357,7 @@ namespace Convert {
/*12800*/ uint32 expAA;
/*12804*/ uint32 aapoints; //avaliable, unspent
/*12808*/ uint8 unknown12844[36];
/*12844*/ Convert::Bandolier_Struct bandoliers[EmuConstants::BANDOLIERS_COUNT];
/*12844*/ Convert::Bandolier_Struct bandoliers[Convert::BANDOLIERS_SIZE];
/*14124*/ uint8 unknown14160[4506];
/*18630*/ Convert::SuspendedMinion_Struct SuspendedMinion; // No longer in use
/*19240*/ uint32 timeentitledonaccount;
@@ -459,7 +470,6 @@ static inline void loadbar(unsigned int x, unsigned int n, unsigned int w = 50)
bool Database::CheckDatabaseConversions() {
CheckDatabaseConvertPPDeblob();
CheckDatabaseConvertBotsPostPPDeblob();
CheckDatabaseConvertCorpseDeblob();
/* Fetch Automatic Upgrade Script */
@@ -483,7 +493,7 @@ bool Database::CheckDatabaseConversions() {
/* Check for a new version of this script, the arg passed
would have to be higher than the copy they have downloaded
locally and they will re fetch */
system("perl eqemu_update.pl V 2");
system("perl eqemu_update.pl V 14");
/* Run Automatic Database Upgrade Script */
system("perl eqemu_update.pl ran_from_world");
@@ -1406,7 +1416,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){
if (rquery != ""){ results = QueryDatabase(rquery); }
/* Run Material Color Convert */
first_entry = 0; rquery = "";
for (i = 0; i < _MaterialCount; i++){
for (i = 0; i < EQEmu::legacy::MaterialCount; i++){
if (pp->item_tint[i].color > 0){
if (first_entry != 1){
rquery = StringFormat("REPLACE INTO `character_material` (id, slot, blue, green, red, use_tint, color) VALUES (%u, %u, %u, %u, %u, %u, %u)", character_id, i, pp->item_tint[i].rgb.blue, pp->item_tint[i].rgb.green, pp->item_tint[i].rgb.red, pp->item_tint[i].rgb.use_tint, pp->item_tint[i].color);
@@ -1418,7 +1428,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){
if (rquery != ""){ results = QueryDatabase(rquery); }
/* Run Tribute Convert */
first_entry = 0; rquery = "";
for (i = 0; i < EmuConstants::TRIBUTE_SIZE; i++){
for (i = 0; i < EQEmu::legacy::TRIBUTE_SIZE; i++){
if (pp->tributes[i].tribute > 0 && pp->tributes[i].tribute != 4294967295){
if (first_entry != 1){
rquery = StringFormat("REPLACE INTO `character_tribute` (id, tier, tribute) VALUES (%u, %u, %u)", character_id, pp->tributes[i].tier, pp->tributes[i].tribute);
@@ -1430,15 +1440,15 @@ bool Database::CheckDatabaseConvertPPDeblob(){
if (rquery != ""){ results = QueryDatabase(rquery); }
/* Run Bandolier Convert */
first_entry = 0; rquery = "";
for (i = 0; i < EmuConstants::BANDOLIERS_COUNT; i++){
if (strlen(pp->bandoliers[i].name) < 32) {
for (int si = 0; si < EmuConstants::BANDOLIER_SIZE; si++){
if (pp->bandoliers[i].items[si].item_id > 0){
for (i = 0; i < Convert::BANDOLIERS_SIZE; i++){
if (strlen(pp->bandoliers[i].Name) < 32) {
for (int si = 0; si < Convert::BANDOLIER_ITEM_COUNT; si++){
if (pp->bandoliers[i].Items[si].ID > 0){
if (first_entry != 1) {
rquery = StringFormat("REPLACE INTO `character_bandolier` (id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name) VALUES (%i, %u, %i, %u, %u, '%s')", character_id, i, si, pp->bandoliers[i].items[si].item_id, pp->bandoliers[i].items[si].icon, pp->bandoliers[i].name);
rquery = StringFormat("REPLACE INTO `character_bandolier` (id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name) VALUES (%i, %u, %i, %u, %u, '%s')", character_id, i, si, pp->bandoliers[i].Items[si].ID, pp->bandoliers[i].Items[si].Icon, pp->bandoliers[i].Name);
first_entry = 1;
}
rquery = rquery + StringFormat(", (%i, %u, %i, %u, %u, '%s')", character_id, i, si, pp->bandoliers[i].items[si].item_id, pp->bandoliers[i].items[si].icon, pp->bandoliers[i].name);
rquery = rquery + StringFormat(", (%i, %u, %i, %u, %u, '%s')", character_id, i, si, pp->bandoliers[i].Items[si].ID, pp->bandoliers[i].Items[si].Icon, pp->bandoliers[i].Name);
}
}
}
@@ -1446,13 +1456,13 @@ bool Database::CheckDatabaseConvertPPDeblob(){
if (rquery != ""){ results = QueryDatabase(rquery); }
/* Run Potion Belt Convert */
first_entry = 0; rquery = "";
for (i = 0; i < EmuConstants::POTION_BELT_SIZE; i++){
if (pp->potionbelt.items[i].item_id > 0){
for (i = 0; i < Convert::POTION_BELT_ITEM_COUNT; i++){
if (pp->potionbelt.Items[i].ID > 0){
if (first_entry != 1){
rquery = StringFormat("REPLACE INTO `character_potionbelt` (id, potion_id, item_id, icon) VALUES (%i, %u, %u, %u)", character_id, i, pp->potionbelt.items[i].item_id, pp->potionbelt.items[i].icon);
rquery = StringFormat("REPLACE INTO `character_potionbelt` (id, potion_id, item_id, icon) VALUES (%i, %u, %u, %u)", character_id, i, pp->potionbelt.Items[i].ID, pp->potionbelt.Items[i].Icon);
first_entry = 1;
}
rquery = rquery + StringFormat(", (%i, %u, %u, %u)", character_id, i, pp->potionbelt.items[i].item_id, pp->potionbelt.items[i].icon);
rquery = rquery + StringFormat(", (%i, %u, %u, %u)", character_id, i, pp->potionbelt.Items[i].ID, pp->potionbelt.Items[i].Icon);
}
}
@@ -1480,163 +1490,6 @@ bool Database::CheckDatabaseConvertPPDeblob(){
return true;
}
bool Database::CheckDatabaseConvertBotsPostPPDeblob(){
#ifdef BOTS
int runbotsconvert = 0;
/* Check For Legacy Bot References */
std::string rquery = StringFormat("SHOW CREATE VIEW `vwBotCharacterMobs`");
auto results = QueryDatabase(rquery);
if (results.RowCount() == 1){
auto row = results.begin();
std::string table_check = row[1];
if (table_check.find("character_data") == -1){
runbotsconvert = 1;
printf("\n\n::: Legacy Bot Views and Function Detected... \n");
printf("----------------------------------------------------------\n\n");
printf(" Database currently has bot view/function linkage to obselete \n");
printf(" table references and will now be converted...\n\n");
printf(" It is recommended that you backup your database \n");
printf(" before continuing the automatic conversion process...\n\n");
printf("----------------------------------------------------------\n\n");
std::cout << "Press ENTER to continue....." << std::endl << std::endl;
std::cin.ignore(1);
}
}
if (runbotsconvert == 1){
printf("Running bot views/function database conversion... \n");
/* Update view `vwbotcharactermobs` */
rquery = StringFormat("DROP VIEW `vwBotCharacterMobs`;");
results = QueryDatabase(rquery);
rquery = StringFormat(
"CREATE VIEW `vwBotCharacterMobs` AS\n"
"SELECT _utf8'C' AS mobtype,\n" // Natedog: '_utf8'
"c.`id`,\n"
"c.`name`,\n"
"c.`class`,\n"
"c.`level`,\n"
"c.`last_login`,\n"
"c.`zone_id`\n"
"FROM `character_data` AS c\n"
"UNION ALL\n"
"SELECT _utf8'B' AS mobtype,\n" // Natedog: '_utf8'
"b.`BotID` AS id,\n"
"b.`Name` AS name,\n"
"b.`Class` AS class,\n"
"b.`BotLevel` AS level,\n"
"0 AS timelaston,\n"
"0 AS zoneid\n"
"FROM bots AS b;"
);
results = QueryDatabase(rquery);
/* Update function `GetMobType` */
rquery = StringFormat("DROP FUNCTION IF EXISTS `GetMobType`;");
results = QueryDatabase(rquery);
rquery = StringFormat(
"CREATE FUNCTION `GetMobType` (mobname VARCHAR(64)) RETURNS CHAR(1)\n"
"BEGIN\n"
" DECLARE Result CHAR(1);\n"
"\n"
" SET Result = NULL;\n"
"\n"
" IF (SELECT COUNT(*) FROM `character_data` WHERE `name` = mobname) > 0 THEN\n"
" SET Result = 'C';\n"
" ELSEIF (SELECT COUNT(*) FROM `bots` WHERE `Name` = mobname) > 0 THEN\n"
" SET Result = 'B';\n"
" END IF;\n "
"\n"
" RETURN Result;\n"
"END"
);
results = QueryDatabase(rquery);
/* Update view `vwgroups` */
rquery = StringFormat("DROP VIEW IF EXISTS `vwGroups`;");
results = QueryDatabase(rquery);
rquery = StringFormat(
"CREATE VIEW `vwGroups` AS\n"
"SELECT g.`groupid` AS groupid,\n"
"GetMobType(g.`name`) AS mobtype,\n"
"g.`name` AS name,\n"
"g.`charid` AS mobid,\n"
"IFNULL(c.`level`, b.`BotLevel`) AS level\n"
"FROM `group_id` AS g\n"
"LEFT JOIN `character_data` AS c ON g.`name` = c.`name`\n"
"LEFT JOIN `bots` AS b ON g.`name` = b.`Name`;"
);
results = QueryDatabase(rquery);
/* Update view `vwbotgroups` */
rquery = StringFormat("DROP VIEW IF EXISTS `vwBotGroups`;");
results = QueryDatabase(rquery);
rquery = StringFormat(
"CREATE VIEW `vwBotGroups` AS\n"
"SELECT g.`BotGroupId`,\n"
"g.`BotGroupName`,\n"
"g.`BotGroupLeaderBotId`,\n"
"b.`Name` AS BotGroupLeaderName,\n"
"b.`BotOwnerCharacterId`,\n"
"c.`name` AS BotOwnerCharacterName\n"
"FROM `botgroup` AS g\n"
"JOIN `bots` AS b ON g.`BotGroupLeaderBotId` = b.`BotID`\n"
"JOIN `character_data` AS c ON b.`BotOwnerCharacterID` = c.`id`\n"
"ORDER BY b.`BotOwnerCharacterId`, g.`BotGroupName`;"
);
results = QueryDatabase(rquery);
/* Update view `vwguildmembers` */
rquery = StringFormat("DROP VIEW IF EXISTS `vwGuildMembers`;");
results = QueryDatabase(rquery);
rquery = StringFormat(
"CREATE VIEW `vwGuildMembers` AS\n"
"SELECT 'C' AS mobtype,\n"
"cm.`char_id`,\n"
"cm.`guild_id`,\n"
"cm.`rank`,\n"
"cm.`tribute_enable`,\n"
"cm.`total_tribute`,\n"
"cm.`last_tribute`,\n"
"cm.`banker`,\n"
"cm.`public_note`,\n"
"cm.`alt`\n"
"FROM `guild_members` AS cm\n"
"UNION ALL\n"
"SELECT 'B' AS mobtype,\n"
"bm.`char_id`,\n"
"bm.`guild_id`,\n"
"bm.`rank`,\n"
"bm.`tribute_enable`,\n"
"bm.`total_tribute`,\n"
"bm.`last_tribute`,\n"
"bm.`banker`,\n"
"bm.`public_note`,\n"
"bm.`alt`\n"
"FROM `botguildmembers` AS bm;"
);
results = QueryDatabase(rquery);
}
if (runbotsconvert == 1){
printf("\n\nBot views/function conversion complete, continuing world bootup...\n");
}
#endif
return true;
}
bool Database::CheckDatabaseConvertCorpseDeblob(){
Convert::DBPlayerCorpse_Struct_temp* dbpc;
Convert::classic_db_temp::DBPlayerCorpse_Struct_temp* dbpc_c;
+8 -3
View File
@@ -98,14 +98,14 @@ MySQLRequestResult DBcore::QueryDatabase(const char* query, uint32 querylen, boo
pStatus = Error;
char *errorBuffer = new char[MYSQL_ERRMSG_SIZE];
auto errorBuffer = new char[MYSQL_ERRMSG_SIZE];
snprintf(errorBuffer, MYSQL_ERRMSG_SIZE, "#%i: %s", mysql_errno(&mysql), mysql_error(&mysql));
return MySQLRequestResult(nullptr, 0, 0, 0, 0, (uint32)mysql_errno(&mysql), errorBuffer);
}
char *errorBuffer = new char[MYSQL_ERRMSG_SIZE];
auto errorBuffer = new char[MYSQL_ERRMSG_SIZE];
snprintf(errorBuffer, MYSQL_ERRMSG_SIZE, "#%i: %s", mysql_errno(&mysql), mysql_error(&mysql));
/* Implement Logging at the Root */
@@ -128,7 +128,12 @@ MySQLRequestResult DBcore::QueryDatabase(const char* query, uint32 querylen, boo
MySQLRequestResult requestResult(res, (uint32)mysql_affected_rows(&mysql), rowCount, (uint32)mysql_field_count(&mysql), (uint32)mysql_insert_id(&mysql));
if (Log.log_settings[Logs::MySQLQuery].is_category_enabled == 1)
Log.Out(Logs::General, Logs::MySQLQuery, "%s (%u rows returned)", query, rowCount, requestResult.RowCount());
{
if ((strncasecmp(query, "select", 6) == 0))
Log.Out(Logs::General, Logs::MySQLQuery, "%s (%u row%s returned)", query, requestResult.RowCount(), requestResult.RowCount() == 1 ? "" : "s");
else
Log.Out(Logs::General, Logs::MySQLQuery, "%s (%u row%s affected)", query, requestResult.RowsAffected(), requestResult.RowsAffected() == 1 ? "" : "s");
}
return requestResult;
}
+1 -1
View File
@@ -2,7 +2,7 @@
#define DBCORE_H
#ifdef _WINDOWS
#include <winsock.h>
#include <winsock2.h>
#include <windows.h>
#endif
+149
View File
@@ -0,0 +1,149 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
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 "deity.h"
EQEmu::deity::DeityTypeBit EQEmu::deity::ConvertDeityTypeToDeityTypeBit(DeityType deity_type)
{
switch (deity_type) {
case DeityBertoxxulous:
return bit_DeityBertoxxulous;
case DeityBrellSirilis:
return bit_DeityBrellSirilis;
case DeityCazicThule:
return bit_DeityCazicThule;
case DeityErollisiMarr:
return bit_DeityErollisiMarr;
case DeityBristlebane:
return bit_DeityBristlebane;
case DeityInnoruuk:
return bit_DeityInnoruuk;
case DeityKarana:
return bit_DeityKarana;
case DeityMithanielMarr:
return bit_DeityMithanielMarr;
case DeityPrexus:
return bit_DeityPrexus;
case DeityQuellious:
return bit_DeityQuellious;
case DeityRallosZek:
return bit_DeityRallosZek;
case DeityRodcetNife:
return bit_DeityRodcetNife;
case DeitySolusekRo:
return bit_DeitySolusekRo;
case DeityTheTribunal:
return bit_DeityTheTribunal;
case DeityTunare:
return bit_DeityTunare;
case DeityVeeshan:
return bit_DeityVeeshan;
case DeityAgnostic_LB:
case DeityAgnostic:
return bit_DeityAgnostic;
default:
return bit_DeityAll;
};
}
EQEmu::deity::DeityType EQEmu::deity::ConvertDeityTypeBitToDeityType(DeityTypeBit deity_type_bit)
{
switch (deity_type_bit) {
case bit_DeityAgnostic:
return DeityAgnostic;
case bit_DeityBertoxxulous:
return DeityBertoxxulous;
case bit_DeityBrellSirilis:
return DeityBrellSirilis;
case bit_DeityCazicThule:
return DeityCazicThule;
case bit_DeityErollisiMarr:
return DeityErollisiMarr;
case bit_DeityBristlebane:
return DeityBristlebane;
case bit_DeityInnoruuk:
return DeityInnoruuk;
case bit_DeityKarana:
return DeityKarana;
case bit_DeityMithanielMarr:
return DeityMithanielMarr;
case bit_DeityPrexus:
return DeityPrexus;
case bit_DeityQuellious:
return DeityQuellious;
case bit_DeityRallosZek:
return DeityRallosZek;
case bit_DeityRodcetNife:
return DeityRodcetNife;
case bit_DeitySolusekRo:
return DeitySolusekRo;
case bit_DeityTheTribunal:
return DeityTheTribunal;
case bit_DeityTunare:
return DeityTunare;
case bit_DeityVeeshan:
return DeityVeeshan;
default:
return DeityUnknown;
};
}
const char* EQEmu::deity::DeityName(DeityType deity_type)
{
switch (deity_type) {
case DeityBertoxxulous:
return "Bertoxxulous";
case DeityBrellSirilis:
return "Brell Serilis";
case DeityCazicThule:
return "Cazic-Thule";
case DeityErollisiMarr:
return "Erollisi Marr";
case DeityBristlebane:
return "Bristlebane";
case DeityInnoruuk:
return "Innoruuk";
case DeityKarana:
return "Karana";
case DeityMithanielMarr:
return "Mithaniel Marr";
case DeityPrexus:
return "Prexus";
case DeityQuellious:
return "Quellious";
case DeityRallosZek:
return "Rallos Zek";
case DeityRodcetNife:
return "Rodcet Nife";
case DeitySolusekRo:
return "Solusek Ro";
case DeityTheTribunal:
return "The Tribunal";
case DeityTunare:
return "Tunare";
case DeityVeeshan:
return "Veeshan";
case DeityAgnostic_LB:
case DeityAgnostic:
return "Agnostic";
default:
return "Unknown";
};
}
+55 -141
View File
@@ -1,5 +1,6 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
Copyright (C) 2001-2016 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
@@ -13,154 +14,67 @@
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef DEITY_H
#define DEITY_H
#ifndef COMMON_DEITY_H
#define COMMON_DEITY_H
#include "types.h"
#include <string>
// NOTE: This code is not fully implemented since there are no references in the existing code
/*
** Diety types
**
** (ref: eqstr_us.txt)
**
** (Another orphaned enumeration...)
*/
enum DeityTypes
namespace EQEmu
{
/*----*/ DeityUnknown = 0,
/*----*/ DeityAgnostic_LB = 140,
/*3251*/ DeityBertoxxulous = 201,
/*3262*/ DeityBrellSirilis,
/*3253*/ DeityCazicThule,
/*3256*/ DeityErollisiMarr,
/*3252*/ DeityBristlebane,
/*3254*/ DeityInnoruuk,
/*3255*/ DeityKarana,
/*3257*/ DeityMithanielMarr,
/*3259*/ DeityPrexus,
/*3260*/ DeityQuellious,
/*3266*/ DeityRallosZek,
/*3258*/ DeityRodcetNife,
/*3261*/ DeitySolusekRo,
/*3263*/ DeityTheTribunal,
/*3264*/ DeityTunare,
/*3265*/ DeityVeeshan,
/*3250*/ DeityAgnostic = 396
};
namespace deity {
enum DeityType {
DeityUnknown = 0,
DeityAgnostic_LB = 140,
DeityBertoxxulous = 201,
DeityBrellSirilis,
DeityCazicThule,
DeityErollisiMarr,
DeityBristlebane,
DeityInnoruuk,
DeityKarana,
DeityMithanielMarr,
DeityPrexus,
DeityQuellious,
DeityRallosZek,
DeityRodcetNife,
DeitySolusekRo,
DeityTheTribunal,
DeityTunare,
DeityVeeshan,
DeityAgnostic = 396
};
/*
** Deity type bits
**
** (New orphan, but make use of it!)
*/
enum DeityTypeBits : uint32
{
BIT_DeityAll = 0x00000000,
BIT_DeityAgnostic = 0x00000001,
BIT_DeityBertoxxulous = 0x00000002,
BIT_DeityBrellSirilis = 0x00000004,
BIT_DeityCazicThule = 0x00000008,
BIT_DeityErollisiMarr = 0x00000010,
BIT_DeityBristlebane = 0x00000020,
BIT_DeityInnoruuk = 0x00000040,
BIT_DeityKarana = 0x00000080,
BIT_DeityMithanielMarr = 0x00000100,
BIT_DeityPrexus = 0x00000200,
BIT_DeityQuellious = 0x00000400,
BIT_DeityRallosZek = 0x00000800,
BIT_DeityRodcetNife = 0x00001000,
BIT_DeitySolusekRo = 0x00002000,
BIT_DeityTheTribunal = 0x00004000,
BIT_DeityTunare = 0x00008000,
BIT_DeityVeeshan = 0x00010000
};
enum DeityTypeBit : uint32 {
bit_DeityAll = 0x00000000,
bit_DeityAgnostic = 0x00000001,
bit_DeityBertoxxulous = 0x00000002,
bit_DeityBrellSirilis = 0x00000004,
bit_DeityCazicThule = 0x00000008,
bit_DeityErollisiMarr = 0x00000010,
bit_DeityBristlebane = 0x00000020,
bit_DeityInnoruuk = 0x00000040,
bit_DeityKarana = 0x00000080,
bit_DeityMithanielMarr = 0x00000100,
bit_DeityPrexus = 0x00000200,
bit_DeityQuellious = 0x00000400,
bit_DeityRallosZek = 0x00000800,
bit_DeityRodcetNife = 0x00001000,
bit_DeitySolusekRo = 0x00002000,
bit_DeityTheTribunal = 0x00004000,
bit_DeityTunare = 0x00008000,
bit_DeityVeeshan = 0x00010000
};
static DeityTypeBits ConvertDeityToBitDeity(DeityTypes deity)
{
switch(deity)
{
case DeityBertoxxulous: { return BIT_DeityBertoxxulous; }
case DeityBrellSirilis: { return BIT_DeityBrellSirilis; }
case DeityCazicThule: { return BIT_DeityCazicThule; }
case DeityErollisiMarr: { return BIT_DeityErollisiMarr; }
case DeityBristlebane: { return BIT_DeityBristlebane; }
case DeityInnoruuk: { return BIT_DeityInnoruuk; }
case DeityKarana: { return BIT_DeityKarana; }
case DeityMithanielMarr: { return BIT_DeityMithanielMarr; }
case DeityPrexus: { return BIT_DeityPrexus; }
case DeityQuellious: { return BIT_DeityQuellious; }
case DeityRallosZek: { return BIT_DeityRallosZek; }
case DeityRodcetNife: { return BIT_DeityRodcetNife; }
case DeitySolusekRo: { return BIT_DeitySolusekRo; }
case DeityTheTribunal: { return BIT_DeityTheTribunal; }
case DeityTunare: { return BIT_DeityTunare; }
case DeityVeeshan: { return BIT_DeityVeeshan; }
case DeityAgnostic_LB:
case DeityAgnostic: { return BIT_DeityAgnostic; }
default: { break; }
};
extern DeityTypeBit ConvertDeityTypeToDeityTypeBit(DeityType deity_type);
extern DeityType ConvertDeityTypeBitToDeityType(DeityTypeBit deity_type_bit);
extern const char* DeityName(DeityType deity_type);
return BIT_DeityAll;
};
} /*deity*/
static DeityTypes ConvertBitDeityToDeity(DeityTypeBits deity_bit)
{
switch(deity_bit)
{
case BIT_DeityAgnostic: { return DeityAgnostic; }
case BIT_DeityBertoxxulous: { return DeityBertoxxulous; }
case BIT_DeityBrellSirilis: { return DeityBrellSirilis; }
case BIT_DeityCazicThule: { return DeityCazicThule; }
case BIT_DeityErollisiMarr: { return DeityErollisiMarr; }
case BIT_DeityBristlebane: { return DeityBristlebane; }
case BIT_DeityInnoruuk: { return DeityInnoruuk; }
case BIT_DeityKarana: { return DeityKarana; }
case BIT_DeityMithanielMarr: { return DeityMithanielMarr; }
case BIT_DeityPrexus: { return DeityPrexus; }
case BIT_DeityQuellious: { return DeityQuellious; }
case BIT_DeityRallosZek: { return DeityRallosZek; }
case BIT_DeityRodcetNife: { return DeityRodcetNife; }
case BIT_DeitySolusekRo: { return DeitySolusekRo; }
case BIT_DeityTheTribunal: { return DeityTheTribunal; }
case BIT_DeityTunare: { return DeityTunare; }
case BIT_DeityVeeshan: { return DeityVeeshan; }
default: { break; }
};
} /*EQEmu*/
return DeityUnknown;
};
static std::string GetDeityName(DeityTypes deity)
{
switch(deity)
{
case DeityBertoxxulous: { return "Bertoxxulous"; }
case DeityBrellSirilis: { return "Brell Serilis"; }
case DeityCazicThule: { return "Cazic-Thule"; }
case DeityErollisiMarr: { return "Erollisi Marr"; }
case DeityBristlebane: { return "Bristlebane"; }
case DeityInnoruuk: { return "Innoruuk"; }
case DeityKarana: { return "Karana"; }
case DeityMithanielMarr: { return "Mithaniel Marr"; }
case DeityPrexus: { return "Prexus"; }
case DeityQuellious: { return "Quellious"; }
case DeityRallosZek: { return "Rallos Zek"; }
case DeityRodcetNife: { return "Rodcet Nife"; }
case DeitySolusekRo: { return "Solusek Ro"; }
case DeityTheTribunal: { return "The Tribunal"; }
case DeityTunare: { return "Tunare"; }
case DeityVeeshan: { return "Veeshan"; }
case DeityAgnostic_LB:
case DeityAgnostic: { return "Agnostic"; }
default: { break; }
};
return "Unknown";
};
#endif
#endif /* COMMON_DEITY_H */
+20
View File
@@ -0,0 +1,20 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
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 "emu_constants.h"
+52
View File
@@ -0,0 +1,52 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
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
*/
#ifndef COMMON_EMU_CONSTANTS_H
#define COMMON_EMU_CONSTANTS_H
#include "eq_limits.h"
#include "emu_legacy.h"
#include "inventory_version.h"
//#include "deity.h"
//#include "say_link.h"
#include <string>
namespace EQEmu
{
namespace inventory {
//using namespace RoF2::invtype;
//using namespace RoF2::invslot;
//using namespace RoF2::invbag;
//using namespace RoF2::invaug;
} /*inventory*/
namespace constants {
const EQEmu::versions::ClientVersion CharacterCreationClient = EQEmu::versions::ClientVersion::RoF2;
const size_t CharacterCreationMax = RoF2::constants::CharacterCreationLimit;
const size_t SayLinkBodySize = RoF2::constants::SayLinkBodySize;
} /*constants*/
} /*EQEmu*/
#endif /*COMMON_EMU_CONSTANTS_H*/
+20
View File
@@ -0,0 +1,20 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
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 "emu_legacy.h"
+275
View File
@@ -0,0 +1,275 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
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
*/
#ifndef COMMON_EMU_LEGACY_H
#define COMMON_EMU_LEGACY_H
#include "types.h"
#include <stdlib.h>
namespace EQEmu
{
// this is for perl and other legacy systems
namespace legacy {
enum InventorySlot {
SLOT_CHARM = 0,
SLOT_EAR01 = 1,
SLOT_HEAD = 2,
SLOT_FACE = 3,
SLOT_EAR02 = 4,
SLOT_NECK = 5,
SLOT_SHOULDER = 6,
SLOT_ARMS = 7,
SLOT_BACK = 8,
SLOT_BRACER01 = 9,
SLOT_BRACER02 = 10,
SLOT_RANGE = 11,
SLOT_HANDS = 12,
SLOT_PRIMARY = 13,
SLOT_SECONDARY = 14,
SLOT_RING01 = 15,
SLOT_RING02 = 16,
SLOT_CHEST = 17,
SLOT_LEGS = 18,
SLOT_FEET = 19,
SLOT_WAIST = 20,
SLOT_POWER_SOURCE = 9999,
SLOT_AMMO = 21,
SLOT_GENERAL_1 = 22,
SLOT_GENERAL_2 = 23,
SLOT_GENERAL_3 = 24,
SLOT_GENERAL_4 = 25,
SLOT_GENERAL_5 = 26,
SLOT_GENERAL_6 = 27,
SLOT_GENERAL_7 = 28,
SLOT_GENERAL_8 = 29,
//SLOT_GENERAL_9 = not supported
//SLOT_GENERAL_10 = not supported
SLOT_CURSOR = 30,
SLOT_CURSOR_END = (int16)0xFFFE, // I hope no one is using this...
SLOT_TRADESKILL = 1000,
SLOT_AUGMENT = 1001,
SLOT_INVALID = (int16)0xFFFF,
SLOT_POSSESSIONS_BEGIN = 0,
SLOT_POSSESSIONS_END = 30,
SLOT_EQUIPMENT_BEGIN = 0,
SLOT_EQUIPMENT_END = 21,
SLOT_PERSONAL_BEGIN = 22,
SLOT_PERSONAL_END = 29,
SLOT_PERSONAL_BAGS_BEGIN = 251,
SLOT_PERSONAL_BAGS_END = 330,
SLOT_CURSOR_BAG_BEGIN = 331,
SLOT_CURSOR_BAG_END = 340,
SLOT_TRIBUTE_BEGIN = 400,
SLOT_TRIBUTE_END = 404,
SLOT_BANK_BEGIN = 2000,
SLOT_BANK_END = 2023,
SLOT_BANK_BAGS_BEGIN = 2031,
SLOT_BANK_BAGS_END = 2270,
SLOT_SHARED_BANK_BEGIN = 2500,
SLOT_SHARED_BANK_END = 2501,
SLOT_SHARED_BANK_BAGS_BEGIN = 2531,
SLOT_SHARED_BANK_BAGS_END = 2550,
SLOT_TRADE_BEGIN = 3000,
SLOT_TRADE_END = 3007,
SLOT_TRADE_BAGS_BEGIN = 3031,
SLOT_TRADE_BAGS_END = 3110,
SLOT_WORLD_BEGIN = 4000,
SLOT_WORLD_END = 4009
};
enum InventoryTypes : int16 {
TypePossessions = 0,
TypeBank,
TypeSharedBank,
TypeTrade,
TypeWorld,
TypeLimbo, // 5
TypeTribute,
TypeTrophyTribute,
TypeGuildTribute,
TypeMerchant,
TypeDeleted, // 10
TypeCorpse,
TypeBazaar,
TypeInspect,
TypeRealEstate,
TypeViewMODPC, // 15
TypeViewMODBank,
TypeViewMODSharedBank,
TypeViewMODLimbo,
TypeAltStorage,
TypeArchived, // 20
TypeMail,
TypeGuildTrophyTribute,
TypeKrono,
TypeOther,
TypeCount
};
enum PossessionsSlots : int16 {
SlotCharm = 0,
SlotEar1,
SlotHead,
SlotFace,
SlotEar2,
SlotNeck, // 5
SlotShoulders,
SlotArms,
SlotBack,
SlotWrist1,
SlotWrist2, // 10
SlotRange,
SlotHands,
SlotPrimary,
SlotSecondary,
SlotFinger1, // 15
SlotFinger2,
SlotChest,
SlotLegs,
SlotFeet,
SlotWaist, // 20
SlotPowerSource = 9999, // temp
SlotAmmo = 21, // temp
SlotGeneral1,
SlotGeneral2,
SlotGeneral3,
SlotGeneral4, // 25
SlotGeneral5,
SlotGeneral6,
SlotGeneral7,
SlotGeneral8,
//SlotGeneral9,
//SlotGeneral10,
SlotCursor, // 30
SlotCount
};
enum MaterialSlots : uint8 {
MaterialHead = 0,
MaterialChest,
MaterialArms,
MaterialWrist,
MaterialHands,
MaterialLegs, // 5
MaterialFeet,
MaterialPrimary,
MaterialSecondary,
MaterialCount,
MaterialInvalid = 255
};
// these are currently hard-coded for existing inventory system..do not use in place of special client version handlers until ready
static const uint16 TYPE_POSSESSIONS_SIZE = SlotCount;
static const uint16 TYPE_BANK_SIZE = 24;
static const uint16 TYPE_SHARED_BANK_SIZE = 2;
static const uint16 TYPE_TRADE_SIZE = 8;
static const uint16 TYPE_WORLD_SIZE = 10;
static const uint16 TYPE_LIMBO_SIZE = 36;
static const uint16 TYPE_TRIBUTE_SIZE = 5; // (need client values)
static const uint16 TYPE_TROPHY_TRIBUTE_SIZE = 0;
static const uint16 TYPE_GUILD_TRIBUTE_SIZE = 0;
static const uint16 TYPE_MERCHANT_SIZE = 0;
static const uint16 TYPE_DELETED_SIZE = 0;
static const uint16 TYPE_CORPSE_SIZE = SlotCount; // no bitmask use..limits to size of client corpse window (see EQLimits::InventoryMapSize(MapCorpse, <EQClientVersion))
static const uint16 TYPE_BAZAAR_SIZE = 80;
static const uint16 TYPE_INSPECT_SIZE = 22;
static const uint16 TYPE_REAL_ESTATE_SIZE = 0;
static const uint16 TYPE_VIEW_MOD_PC_SIZE = 0;//NOT_USED;
static const uint16 TYPE_VIEW_MOD_BANK_SIZE = 0;//NOT_USED;
static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = 0;//NOT_USED;
static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = 0;//NOT_USED;
static const uint16 TYPE_ALT_STORAGE_SIZE = 0;
static const uint16 TYPE_ARCHIVED_SIZE = 0;
static const uint16 TYPE_MAIL_SIZE = 0;
static const uint16 TYPE_GUILD_TROPHY_TRIBUTE_SIZE = 0;
static const uint16 TYPE_KRONO_SIZE = 0;
static const uint16 TYPE_OTHER_SIZE = 0;
// most of these definitions will go away with the structure-based system..this maintains compatibility for now
// (these are mainly to assign specific values to constants used in conversions and to identify per-client ranges/offsets)
static const int16 EQUIPMENT_BEGIN = SlotCharm;
static const int16 EQUIPMENT_END = SlotAmmo;
static const uint16 EQUIPMENT_SIZE = 22; // does not account for 'Power Source' - used mainly for npc equipment arrays
static const int16 GENERAL_BEGIN = SlotGeneral1;
static const int16 GENERAL_END = SlotGeneral8;
static const uint16 GENERAL_SIZE = 8;
static const int16 GENERAL_BAGS_BEGIN = 251;
static const int16 GENERAL_BAGS_END_OFFSET = 79;
static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET;
static const int16 CURSOR_BAG_BEGIN = 331;
static const int16 CURSOR_BAG_END_OFFSET = 9;
static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET;
static const int16 BANK_BEGIN = 2000;
static const int16 BANK_END = 2023;
static const int16 BANK_BAGS_BEGIN = 2031;
static const int16 BANK_BAGS_END_OFFSET = 239;
static const int16 BANK_BAGS_END = BANK_BAGS_BEGIN + BANK_BAGS_END_OFFSET;
static const int16 SHARED_BANK_BEGIN = 2500;
static const int16 SHARED_BANK_END = 2501;
static const int16 SHARED_BANK_BAGS_BEGIN = 2531;
static const int16 SHARED_BANK_BAGS_END_OFFSET = 19;
static const int16 SHARED_BANK_BAGS_END = SHARED_BANK_BAGS_BEGIN + SHARED_BANK_BAGS_END_OFFSET;
static const int16 TRADE_BEGIN = 3000;
static const int16 TRADE_END = 3007;
static const int16 TRADE_NPC_END = 3003;
static const int16 TRADE_BAGS_BEGIN = 3031;
static const int16 TRADE_BAGS_END_OFFSET = 79;
static const int16 TRADE_BAGS_END = TRADE_BAGS_BEGIN + TRADE_BAGS_END_OFFSET;
static const int16 WORLD_BEGIN = 4000;
static const int16 WORLD_END = 4009;
static const int16 WORLD_SIZE = TYPE_WORLD_SIZE;
static const int16 TRIBUTE_BEGIN = 400;
static const int16 TRIBUTE_END = 404;
static const int16 TRIBUTE_SIZE = TYPE_TRIBUTE_SIZE;
static const int16 CORPSE_BEGIN = 22;
//static const int16 CORPSE_END = RoF::consts::CORPSE_END; // not ready for use
static const int16 MATERIAL_BEGIN = MaterialHead;
static const int16 MATERIAL_END = MaterialSecondary;
static const int16 MATERIAL_TINT_END = MaterialFeet;
static const int16 MATERIAL_SIZE = MaterialCount;
// items
// common and container sizes will not increase until the new 'location' struct is implemented
static const uint16 ITEM_COMMON_SIZE = 6;//RoF::consts::ITEM_COMMON_SIZE;
static const uint16 ITEM_CONTAINER_SIZE = 10;//Titanium::consts::ITEM_CONTAINER_SIZE;
// BANDOLIERS_SIZE sets maximum limit..active limit will need to be handled by the appropriate AA or spell (or item?)
static const size_t BANDOLIERS_SIZE = 20;//RoF2::consts::BANDOLIERS_SIZE; // number of bandolier instances
static const size_t BANDOLIER_ITEM_COUNT = 4;//RoF2::consts::BANDOLIER_ITEM_COUNT; // number of equipment slots in bandolier instance
// POTION_BELT_SIZE sets maximum limit..active limit will need to be handled by the appropriate AA or spell (or item?)
static const size_t POTION_BELT_ITEM_COUNT = 5;//RoF2::consts::POTION_BELT_ITEM_COUNT;
static const size_t TEXT_LINK_BODY_LENGTH = 56;//RoF2::consts::TEXT_LINK_BODY_LENGTH;
}
}
#endif /* COMMON_EMU_LEGACY_H */
+18
View File
@@ -0,0 +1,18 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
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
*/
+56
View File
@@ -0,0 +1,56 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
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
*/
#ifndef COMMON_EMU_LIMITS_H
#define COMMON_EMU_LIMITS_H
#include "types.h"
#include <stdlib.h>
namespace EntityLimits
{
namespace npc {
enum : int { Invalid = -1, Null, Safety };
enum : bool { False = false, True = true };
}
namespace merc {
enum : int { Invalid = -1, Null, Safety };
enum : bool { False = false, True = true };
}
namespace bot {
enum : int { Invalid = -1, Null, Safety };
enum : bool { False = false, True = true };
}
namespace pet {
enum : int { Invalid = -1, Null, Safety };
enum : bool { False = false, True = true };
}
}; /*EntityLimits*/
#endif /*COMMON_EMU_LIMITS_H*/
+8 -2
View File
@@ -164,6 +164,7 @@ N(OP_FinishTrade),
N(OP_FinishWindow),
N(OP_FinishWindow2),
N(OP_Fishing),
N(OP_Fling),
N(OP_FloatListThing),
N(OP_Forage),
N(OP_ForceFindPerson),
@@ -215,6 +216,7 @@ N(OP_GroupUpdate),
N(OP_GroupUpdateB),
N(OP_GroupUpdateLeaderAA),
N(OP_GuildBank),
N(OP_GuildBankItemList),
N(OP_GuildCreate),
N(OP_GuildDelete),
N(OP_GuildDemote),
@@ -348,6 +350,7 @@ N(OP_OpenTributeMaster),
N(OP_PDeletePetition),
N(OP_PetBuffWindow),
N(OP_PetCommands),
N(OP_PetHoTT),
N(OP_Petition),
N(OP_PetitionBug),
N(OP_PetitionCheckIn),
@@ -364,6 +367,8 @@ N(OP_PetitionUnCheckout),
N(OP_PetitionUpdate),
N(OP_PickPocket),
N(OP_PlayerProfile),
N(OP_PlayerStateAdd),
N(OP_PlayerStateRemove),
N(OP_PlayEverquestRequest),
N(OP_PlayEverquestResponse),
N(OP_PlayMP3),
@@ -519,8 +524,6 @@ N(OP_VetRewardsAvaliable),
N(OP_VoiceMacroIn),
N(OP_VoiceMacroOut),
N(OP_WeaponEquip1),
N(OP_WeaponEquip2),
N(OP_WeaponUnequip2),
N(OP_WearChange),
N(OP_Weather),
N(OP_Weblink),
@@ -534,6 +537,8 @@ N(OP_WorldLogout),
N(OP_WorldObjectsSent),
N(OP_WorldUnknown001),
N(OP_XTargetAutoAddHaters),
N(OP_XTargetOpen),
N(OP_XTargetOpenResponse),
N(OP_XTargetRequest),
N(OP_XTargetResponse),
N(OP_YellForHelp),
@@ -547,4 +552,5 @@ N(OP_ZoneServerInfo),
N(OP_ZoneServerReady),
N(OP_ZoneSpawns),
N(OP_ZoneUnavail),
N(OP_ResetAA),
// mail and chat opcodes located in ../mail_oplist.h
+16 -37
View File
@@ -50,7 +50,6 @@ EmuTCPConnection::EmuTCPConnection(uint32 ID, EmuTCPServer* iServer, SOCKET in_s
keepalive_timer(SERVER_TIMEOUT),
timeout_timer(SERVER_TIMEOUT * 2)
{
_eqp
id = 0;
Server = nullptr;
pOldFormat = iOldFormat;
@@ -77,7 +76,6 @@ EmuTCPConnection::EmuTCPConnection(bool iOldFormat, EmuTCPServer* iRelayServer,
keepalive_timer(SERVER_TIMEOUT),
timeout_timer(SERVER_TIMEOUT * 2)
{
_eqp
Server = iRelayServer;
if (Server)
RelayServer = true;
@@ -100,7 +98,6 @@ EmuTCPConnection::EmuTCPConnection(uint32 ID, EmuTCPServer* iServer, EmuTCPConne
keepalive_timer(SERVER_TIMEOUT),
timeout_timer(SERVER_TIMEOUT * 2)
{
_eqp
Server = iServer;
RelayLink = iRelayLink;
RelayServer = true;
@@ -120,7 +117,6 @@ EmuTCPConnection::~EmuTCPConnection() {
}
EmuTCPNetPacket_Struct* EmuTCPConnection::MakePacket(ServerPacket* pack, uint32 iDestination) {
_eqp
int32 size = sizeof(EmuTCPNetPacket_Struct) + pack->size;
if (pack->compressed) {
size += 4;
@@ -148,7 +144,6 @@ EmuTCPNetPacket_Struct* EmuTCPConnection::MakePacket(ServerPacket* pack, uint32
}
SPackSendQueue* EmuTCPConnection::MakeOldPacket(ServerPacket* pack) {
_eqp
SPackSendQueue* spsq = (SPackSendQueue*) new uchar[sizeof(SPackSendQueue) + pack->size + 4];
if (pack->pBuffer != 0 && pack->size != 0)
memcpy((char *) &spsq->buffer[4], (char *) pack->pBuffer, pack->size);
@@ -159,7 +154,6 @@ SPackSendQueue* EmuTCPConnection::MakeOldPacket(ServerPacket* pack) {
}
bool EmuTCPConnection::SendPacket(ServerPacket* pack, uint32 iDestination) {
_eqp
if (!Connected())
return false;
eTCPMode tmp = GetMode();
@@ -220,7 +214,6 @@ bool EmuTCPConnection::SendPacket(ServerPacket* pack, uint32 iDestination) {
}
bool EmuTCPConnection::SendPacket(EmuTCPNetPacket_Struct* tnps) {
_eqp
if (RemoteID)
return false;
if (!Connected())
@@ -261,7 +254,6 @@ bool EmuTCPConnection::SendPacket(EmuTCPNetPacket_Struct* tnps) {
}
ServerPacket* EmuTCPConnection::PopPacket() {
_eqp
ServerPacket* ret;
if (!MOutQueueLock.trylock())
return nullptr;
@@ -271,14 +263,12 @@ ServerPacket* EmuTCPConnection::PopPacket() {
}
void EmuTCPConnection::InModeQueuePush(EmuTCPNetPacket_Struct* tnps) {
_eqp
MSendQueue.lock();
InModeQueue.push(tnps);
MSendQueue.unlock();
}
void EmuTCPConnection::OutQueuePush(ServerPacket* pack) {
_eqp
MOutQueueLock.lock();
OutQueue.push(pack);
MOutQueueLock.unlock();
@@ -286,7 +276,6 @@ void EmuTCPConnection::OutQueuePush(ServerPacket* pack) {
bool EmuTCPConnection::LineOutQueuePush(char* line) {
_eqp
#if defined(GOTFRAGS) && 0
if (strcmp(line, "**CRASHME**") == 0) {
int i = 0;
@@ -380,7 +369,6 @@ bool EmuTCPConnection::LineOutQueuePush(char* line) {
}
void EmuTCPConnection::Disconnect(bool iSendRelayDisconnect) {
_eqp
TCPConnection::Disconnect();
if (RelayLink) {
@@ -390,7 +378,6 @@ void EmuTCPConnection::Disconnect(bool iSendRelayDisconnect) {
}
bool EmuTCPConnection::ConnectIP(uint32 irIP, uint16 irPort, char* errbuf) {
_eqp
if(!TCPConnection::ConnectIP(irIP, irPort, errbuf))
return(false);
@@ -445,7 +432,6 @@ bool EmuTCPConnection::ConnectIP(uint32 irIP, uint16 irPort, char* errbuf) {
}
void EmuTCPConnection::ClearBuffers() {
_eqp
TCPConnection::ClearBuffers();
LockMutex lock2(&MOutQueueLock);
@@ -462,7 +448,6 @@ void EmuTCPConnection::ClearBuffers() {
}
void EmuTCPConnection::SendNetErrorPacket(const char* reason) {
_eqp
#if TCPC_DEBUG >= 1
struct in_addr in;
in.s_addr = GetrIP();
@@ -471,22 +456,21 @@ void EmuTCPConnection::SendNetErrorPacket(const char* reason) {
std::cout << reason;
std::cout << "': " << inet_ntoa(in) << ":" << GetPort() << std::endl;
#endif
ServerPacket* pack = new ServerPacket(0);
pack->size = 1;
if (reason)
pack->size += strlen(reason) + 1;
pack->pBuffer = new uchar[pack->size];
memset(pack->pBuffer, 0, pack->size);
pack->pBuffer[0] = 255;
strcpy((char*) &pack->pBuffer[1], reason);
SendPacket(pack);
safe_delete(pack);
auto pack = new ServerPacket(0);
pack->size = 1;
if (reason)
pack->size += strlen(reason) + 1;
pack->pBuffer = new uchar[pack->size];
memset(pack->pBuffer, 0, pack->size);
pack->pBuffer[0] = 255;
strcpy((char *)&pack->pBuffer[1], reason);
SendPacket(pack);
safe_delete(pack);
}
void EmuTCPConnection::RemoveRelay(EmuTCPConnection* relay, bool iSendRelayDisconnect) {
_eqp
if (iSendRelayDisconnect) {
ServerPacket* pack = new ServerPacket(0, 5);
auto pack = new ServerPacket(0, 5);
pack->pBuffer[0] = 3;
*((uint32*) &pack->pBuffer[1]) = relay->GetRemoteID();
SendPacket(pack);
@@ -498,7 +482,6 @@ void EmuTCPConnection::RemoveRelay(EmuTCPConnection* relay, bool iSendRelayDisco
bool EmuTCPConnection::ProcessReceivedData(char* errbuf) {
_eqp
if (errbuf)
errbuf[0] = 0;
timeout_timer.Start();
@@ -522,7 +505,6 @@ bool EmuTCPConnection::ProcessReceivedData(char* errbuf) {
bool EmuTCPConnection::ProcessReceivedDataAsPackets(char* errbuf) {
_eqp
if (errbuf)
errbuf[0] = 0;
int32 base = 0;
@@ -627,7 +609,7 @@ bool EmuTCPConnection::ProcessReceivedDataAsPackets(char* errbuf) {
if (base >= recvbuf_used) {
safe_delete_array(recvbuf);
} else {
uchar* tmpbuf = new uchar[recvbuf_size - base];
auto tmpbuf = new uchar[recvbuf_size - base];
memcpy(tmpbuf, &recvbuf[base], recvbuf_used - base);
safe_delete_array(recvbuf);
recvbuf = tmpbuf;
@@ -639,7 +621,6 @@ bool EmuTCPConnection::ProcessReceivedDataAsPackets(char* errbuf) {
}
bool EmuTCPConnection::ProcessReceivedDataAsOldPackets(char* errbuf) {
_eqp
int32 base = 0;
int32 size = 4;
uchar* buffer;
@@ -702,7 +683,7 @@ bool EmuTCPConnection::ProcessReceivedDataAsOldPackets(char* errbuf) {
safe_delete_array(recvbuf);
}
else {
uchar* tmpbuf = new uchar[recvbuf_size - base];
auto tmpbuf = new uchar[recvbuf_size - base];
memcpy(tmpbuf, &recvbuf[base], recvbuf_used - base);
safe_delete_array(recvbuf);
recvbuf = tmpbuf;
@@ -714,7 +695,6 @@ bool EmuTCPConnection::ProcessReceivedDataAsOldPackets(char* errbuf) {
}
void EmuTCPConnection::ProcessNetworkLayerPacket(ServerPacket* pack) {
_eqp
uint8 opcode = pack->pBuffer[0];
uint8* data = &pack->pBuffer[1];
switch (opcode) {
@@ -759,7 +739,8 @@ void EmuTCPConnection::ProcessNetworkLayerPacket(ServerPacket* pack) {
SendNetErrorPacket("New RelayClient: illegal on outgoing connection");
break;
}
EmuTCPConnection* con = new EmuTCPConnection(Server->GetNextID(), Server, this, *((uint32*) data), *((uint32*) &data[4]), *((uint16*) &data[8]));
auto con = new EmuTCPConnection(Server->GetNextID(), Server, this, *((uint32 *)data),
*((uint32 *)&data[4]), *((uint16 *)&data[8]));
Server->AddConnection(con);
RelayCount++;
break;
@@ -800,7 +781,6 @@ void EmuTCPConnection::ProcessNetworkLayerPacket(ServerPacket* pack) {
}
bool EmuTCPConnection::SendData(bool &sent_something, char* errbuf) {
_eqp
sent_something = false;
if(!TCPConnection::SendData(sent_something, errbuf))
return(false);
@@ -808,7 +788,7 @@ bool EmuTCPConnection::SendData(bool &sent_something, char* errbuf) {
if(sent_something)
keepalive_timer.Start();
else if (TCPMode == modePacket && keepalive_timer.Check()) {
ServerPacket* pack = new ServerPacket(0, 0);
auto pack = new ServerPacket(0, 0);
SendPacket(pack);
safe_delete(pack);
#if TCPN_DEBUG >= 5
@@ -820,7 +800,6 @@ bool EmuTCPConnection::SendData(bool &sent_something, char* errbuf) {
}
bool EmuTCPConnection::RecvData(char* errbuf) {
_eqp
if(!TCPConnection::RecvData(errbuf)) {
if (OutQueue.count())
return(true);
+1 -9
View File
@@ -9,7 +9,6 @@ EmuTCPServer::EmuTCPServer(uint16 iPort, bool iOldFormat)
}
EmuTCPServer::~EmuTCPServer() {
_eqp
MInQueue.lock();
while(!m_InQueue.empty()) {
delete m_InQueue.front();
@@ -19,27 +18,23 @@ EmuTCPServer::~EmuTCPServer() {
}
void EmuTCPServer::Process() {
_eqp
CheckInQueue();
TCPServer<EmuTCPConnection>::Process();
}
void EmuTCPServer::CreateNewConnection(uint32 ID, SOCKET in_socket, uint32 irIP, uint16 irPort)
{
_eqp
EmuTCPConnection *conn = new EmuTCPConnection(ID, this, in_socket, irIP, irPort, pOldFormat);
auto conn = new EmuTCPConnection(ID, this, in_socket, irIP, irPort, pOldFormat);
AddConnection(conn);
}
void EmuTCPServer::SendPacket(ServerPacket* pack) {
_eqp
EmuTCPNetPacket_Struct* tnps = EmuTCPConnection::MakePacket(pack);
SendPacket(&tnps);
}
void EmuTCPServer::SendPacket(EmuTCPNetPacket_Struct** tnps) {
_eqp
MInQueue.lock();
m_InQueue.push(*tnps);
MInQueue.unlock();
@@ -47,7 +42,6 @@ void EmuTCPServer::SendPacket(EmuTCPNetPacket_Struct** tnps) {
}
void EmuTCPServer::CheckInQueue() {
_eqp
EmuTCPNetPacket_Struct* tnps = 0;
while (( tnps = InQueuePop() )) {
@@ -63,7 +57,6 @@ void EmuTCPServer::CheckInQueue() {
}
EmuTCPNetPacket_Struct* EmuTCPServer::InQueuePop() {
_eqp
EmuTCPNetPacket_Struct* ret = nullptr;
MInQueue.lock();
if(!m_InQueue.empty()) {
@@ -76,7 +69,6 @@ EmuTCPNetPacket_Struct* EmuTCPServer::InQueuePop() {
EmuTCPConnection *EmuTCPServer::FindConnection(uint32 iID) {
_eqp
vitr cur, end;
cur = m_list.begin();
end = m_list.end();
+81 -524
View File
@@ -1,5 +1,6 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2003 EQEMu Development Team (http://eqemulator.net)
Copyright (C) 2001-2016 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
@@ -13,360 +14,57 @@
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef EQ_CONSTANTS_H
#define EQ_CONSTANTS_H
#ifndef COMMON_EQ_CONSTANTS_H
#define COMMON_EQ_CONSTANTS_H
#include "skills.h"
#include "types.h"
/*
** Item attributes
**
** (There are no grepwin hits other than these declarations... Do they have a use?)
*/
enum ItemAttributes : uint32
{
ItemAttrNone = 0x00000000,
ItemAttrLore = 0x00000001,
ItemAttrArtifact = 0x00000002,
ItemAttrSummoned = 0x00000004,
ItemAttrMagic = 0x00000008,
ItemAttrAugment = 0x00000010,
ItemAttrPendingLore = 0x00000020,
ItemAttrUnknown = 0xFFFFFFFF
};
/*
** Item class types
**
*/
enum ItemClassTypes
{
ItemClassCommon = 0,
ItemClassContainer,
ItemClassBook,
_ItemClassCount
};
//SpawnAppearance types: (compared two clients for server-originating types: SoF & RoF2)
#define AT_Die 0 // this causes the client to keel over and zone to bind point (default action)
#define AT_WhoLevel 1 // the level that shows up on /who
//#define AT_2 2 // unknown
#define AT_Invis 3 // 0 = visible, 1 = invisible
#define AT_PVP 4 // 0 = blue, 1 = pvp (red)
#define AT_Light 5 // light type emitted by player (lightstone, shiny shield)
#define AT_Anim 14 // 100=standing, 110=sitting, 111=ducking, 115=feigned, 105=looting
#define AT_Sneak 15 // 0 = normal, 1 = sneaking
#define AT_SpawnID 16 // server to client, sets player spawn id
#define AT_HP 17 // Client->Server, my HP has changed (like regen tic)
#define AT_Linkdead 18 // 0 = normal, 1 = linkdead
#define AT_Levitate 19 // 0=off, 1=flymode, 2=levitate
#define AT_GM 20 // 0 = normal, 1 = GM - all odd numbers seem to make it GM
#define AT_Anon 21 // 0 = normal, 1 = anon, 2 = roleplay
#define AT_GuildID 22
#define AT_GuildRank 23 // 0=member, 1=officer, 2=leader
#define AT_AFK 24 // 0 = normal, 1 = afk
#define AT_Pet 25 // Param is EntityID of owner, or 0 for when charm breaks
//#define AT_27 27 // unknown
#define AT_Split 28 // 0 = normal, 1 = autosplit on (not showing in SoF+) (client-to-server only)
#define AT_Size 29 // spawn's size (present: SoF, absent: RoF2)
//#define AT_30 30 // unknown
#define AT_NPCName 31 // change PC's name's color to NPC color 0 = normal, 1 = npc name
//#define AT_32 32 // unknown
//#define AT_33 33 // unknown
//#define AT_34 34 // unknown (present: SoF, absent: RoF2)
//#define AT_35 35 // unknown
//#define AT_36 36 // unknown
//#define AT_37 37 // unknown
//#define AT_38 38 // unknown
//#define AT_39 39 // unknown
#define AT_ShowHelm 43 // 0 = hide graphic, 1 = show graphic
#define AT_DamageState 44 // The damage state of a destructible object (0 through 4)
//#define AT_46 46 // unknown
//#define AT_48 48 // unknown
//#define AT_49 49 // unknown
//#define AT_52 52 // (absent: SoF, present: RoF2) (not a replacement for RoF absent 29 or 34)
//#define AT_53 53 // (absent: SoF, present: RoF2) (not a replacement for RoF absent 29 or 34)
/*
** Item use types
**
** (ref: database and eqstr_us.txt)
**
** (Looking at a recent database, it's possible that some of the item values may be off [10-27-2013] -U)
*/
enum ItemUseTypes : uint8
{
/*9138*/ ItemType1HSlash = 0,
/*9141*/ ItemType2HSlash,
/*9140*/ ItemType1HPiercing,
/*9139*/ ItemType1HBlunt,
/*9142*/ ItemType2HBlunt,
/*5504*/ ItemTypeBow,
/*----*/ ItemTypeUnknown1,
/*----*/ ItemTypeLargeThrowing,
/*5505*/ ItemTypeShield,
/*5506*/ ItemTypeScroll,
/*5507*/ ItemTypeArmor,
/*5508*/ ItemTypeMisc, // a lot of random crap has this item use.
/*7564*/ ItemTypeLockPick,
/*----*/ ItemTypeUnknown2,
/*5509*/ ItemTypeFood,
/*5510*/ ItemTypeDrink,
/*5511*/ ItemTypeLight,
/*5512*/ ItemTypeCombinable, // not all stackable items are this use...
/*5513*/ ItemTypeBandage,
/*----*/ ItemTypeSmallThrowing,
/*----*/ ItemTypeSpell, // spells and tomes
/*5514*/ ItemTypePotion,
/*----*/ ItemTypeUnknown3,
/*0406*/ ItemTypeWindInstrument,
/*0407*/ ItemTypeStringedInstrument,
/*0408*/ ItemTypeBrassInstrument,
/*0405*/ ItemTypePercussionInstrument,
/*5515*/ ItemTypeArrow,
/*----*/ ItemTypeUnknown4,
/*5521*/ ItemTypeJewelry,
/*----*/ ItemTypeSkull,
/*5516*/ ItemTypeBook, // skill-up tomes/books? (would probably need a pp flag if true...)
/*5517*/ ItemTypeNote,
/*5518*/ ItemTypeKey,
/*----*/ ItemTypeCoin,
/*5520*/ ItemType2HPiercing,
/*----*/ ItemTypeFishingPole,
/*----*/ ItemTypeFishingBait,
/*5519*/ ItemTypeAlcohol,
/*----*/ ItemTypeKey2, // keys and satchels?? (questable keys?)
/*----*/ ItemTypeCompass,
/*----*/ ItemTypeUnknown5,
/*----*/ ItemTypePoison, // might be wrong, but includes poisons
/*----*/ ItemTypeUnknown6,
/*----*/ ItemTypeUnknown7,
/*5522*/ ItemTypeMartial,
/*----*/ ItemTypeUnknown8,
/*----*/ ItemTypeUnknown9,
/*----*/ ItemTypeUnknown10,
/*----*/ ItemTypeUnknown11,
/*----*/ ItemTypeSinging,
/*5750*/ ItemTypeAllInstrumentTypes,
/*5776*/ ItemTypeCharm,
/*----*/ ItemTypeDye,
/*----*/ ItemTypeAugmentation,
/*----*/ ItemTypeAugmentationSolvent,
/*----*/ ItemTypeAugmentationDistiller,
/*----*/ ItemTypeUnknown12,
/*----*/ ItemTypeFellowshipKit,
/*----*/ ItemTypeUnknown13,
/*----*/ ItemTypeRecipe,
/*----*/ ItemTypeAdvancedRecipe,
/*----*/ ItemTypeJournal, // only one(1) database entry
/*----*/ ItemTypeAltCurrency, // alt-currency (as opposed to coinage)
/*5881*/ ItemTypePerfectedAugmentationDistiller,
/*----*/ _ItemTypeCount
/*
Unknowns:
Mounts?
Ornamentations?
GuildBanners?
Collectible?
Placeable?
(others?)
*/
};
/*
** Augmentation use type bitmasks (1-based)
**
** (ref: dbstr_us.txt)
**
*/
enum AugmentationUseTypeBitmasks : uint32 {
AugUseNone = 0x00000000,
AugUseGeneralSingleStat = 0x00000001, /*1^16^1 (General: Single Stat)^0*/
AugUseGeneralMultipleStat = 0x00000002, /*2^16^2 (General: Multiple Stat)^0*/
AugUseGeneralSpellEffect = 0x00000004, /*3^16^3 (General: Spell Effect)^0*/
AugUseWeaponGeneral = 0x00000008, /*4^16^4 (Weapon: General)^0*/
AugUseWeaponElemDamage = 0x00000010, /*5^16^5 (Weapon: Elem Damage)^0*/
AugUseWeaponBaseDamage = 0x00000020, /*6^16^6 (Weapon: Base Damage)^0*/
AugUseGeneralGroup = 0x00000040, /*7^16^7 (General: Group)^0*/
AugUseGeneralRaid = 0x00000080, /*8^16^8 (General: Raid)^0*/
AugUseGeneralDragonsPoints = 0x00000100, /*9^16^9 (General: Dragons Points)^0*/
AugUseCraftedCommon = 0x00000200, /*10^16^10 (Crafted: Common)^0*/
AugUseCraftedGroup1 = 0x00000400, /*11^16^11 (Crafted: Group)^0*/
AugUseCraftedRaid1 = 0x00000800, /*12^16^12 (Crafted: Raid)^0*/
AugUseEnergeiacGroup = 0x00001000, /*13^16^13 (Energeiac: Group)^0*/
AugUseEnergeiacRaid = 0x00002000, /*14^16^14 (Energeiac: Raid)^0*/
AugUseEmblem = 0x00004000, /*15^16^15 (Emblem)^0*/
AugUseCraftedGroup2 = 0x00008000, /*16^16^16 (Crafted: Group)^0*/
AugUseCraftedRaid2 = 0x00010000, /*17^16^17 (Crafted: Raid)^0*/
AugUseUnknown1 = 0x00020000, /*18^16^18^0*/
AugUseUnknown2 = 0x00040000, /*19^16^19^0*/
AugUseOrnamentation = 0x00080000, /*20^16^20 (Ornamentation)^0*/
AugUseSpecialOrnamentation = 0x00100000, /*21^16^21 (Special Ornamentation)^0*/
AugUseUnknown3 = 0x00200000, /*22^16^22^0*/
AugUseUnknown4 = 0x00400000, /*23^16^23^0*/
AugUseUnknown5 = 0x00800000, /*24^16^24^0*/
AugUseUnknown6 = 0x01000000, /*25^16^25^0*/
AugUseUnknown7 = 0x02000000, /*26^16^26^0*/
AugUseUnknown8 = 0x04000000, /*27^16^27^0*/
AugUseUnknown9 = 0x08000000, /*28^16^28^0*/
AugUseUnknown10 = 0x10000000, /*29^16^29^0*/
AugUseEpic25 = 0x20000000, /*30^16^30^0*/
AugUseTest = 0x40000000, /*31^16^Test^0*/ // listed as 31^16^31^0 in 5-10 client
AugUseAll = 0xFFFFFFFF
};
/*
** Augmentation use types (enumerated)
**
*/
enum AugmentationUseTypes : uint8 {
AugTypeNone = 0,
AugTypeGeneralSingleStat,
AugTypeGeneralMultipleStat,
AugTypeGeneralSpellEffect,
AugTypeWeaponGeneral,
AugTypeWeaponElemDamage,
AugTypeWeaponBaseDamage,
AugTypeGeneralGroup,
AugTypeGeneralRaid,
AugTypeGeneralDragonsPoints,
AugTypeCraftedCommon,
AugTypeCraftedGroup1,
AugTypeCraftedRaid1,
AugTypeEnergeiacGroup,
AugTypeEnergeiacRaid,
AugTypeEmblem,
AugTypeCraftedGroup2,
AugTypeCraftedRaid2,
AugTypeUnknown1,
AugTypeUnknown2,
AugTypeOrnamentation,
AugTypeSpecialOrnamentation,
AugTypeUnknown3,
AugTypeUnknown4,
AugTypeUnknown5,
AugTypeUnknown6,
AugTypeUnknown7,
AugTypeUnknown8,
AugTypeUnknown9,
AugTypeUnknown10,
AugTypeEpic25,
AugTypeTest,
_AugTypeCount,
AugTypeAll = 255
};
/*
** Augmentation restriction types (in-work)
**
** (ref: eqstr_us.txt)
**
*/
enum AugmentationRestrictionTypes : uint8 {
/*4690*/ AugRestrAny = 0,
/*9134*/ AugRestrArmor,
/*9135*/ AugRestrWeapons,
/*9136*/ AugRestr1HWeapons,
/*9137*/ AugRestr2HWeapons,
/*9138*/ AugRestr1HSlash,
/*9139*/ AugRestr1HBlunt,
/*9140*/ AugRestrPiercing,
/*9148*/ AugRestrHandToHand,
/*9141*/ AugRestr2HSlash,
/*9142*/ AugRestr2HBlunt,
/*9143*/ AugRestr2HPierce,
/*9144*/ AugRestrBows,
/*9145*/ AugRestrShields,
/*8052*/ AugRestr1HSlash1HBluntOrHandToHand,
/*9200*/ AugRestr1HBluntOrHandToHand, // no listed peq entries
// these three appear to be post-RoF (12-10-2012) and can not be verified until RoF (05-10-2013) is supported
/*????*/ AugRestrUnknown1,
/*????*/ AugRestrUnknown2,
/*????*/ AugRestrUnknown3, // last value in peq entries
_AugRestrCount
/*4687*/ //AugTypeAllItems, // ?? unknown atm
/*4688*/ //AugTypePrestige, // ?? unknown atm
/*4689*/ //AugTypeNonPrestige, // ?? unknown atm
};
/*
** Container use types
**
** This correlates to world 'object.type' (object.h/Object.cpp) as well as Item_Struct.BagType
**
** (ref: database, web forums and eqstr_us.txt)
*/
enum ContainerUseTypes : uint8
{
/*3400*/ BagTypeSmallBag = 0,
/*3401*/ BagTypeLargeBag,
/*3402*/ BagTypeQuiver,
/*3403*/ BagTypeBeltPouch,
/*3404*/ BagTypeWristPouch,
/*3405*/ BagTypeBackPack,
/*3406*/ BagTypeSmallChest,
/*3407*/ BagTypeLargeChest,
/*----*/ BagTypeBandolier, // <*Database Reference Only>
/*3408*/ BagTypeMedicineBag,
/*3409*/ BagTypeToolBox,
/*3410*/ BagTypeLexicon,
/*3411*/ BagTypeMortar,
/*3412*/ BagTypeSelfDusting, // Quest container (Auto-clear contents?)
/*3413*/ BagTypeMixingBowl,
/*3414*/ BagTypeOven,
/*3415*/ BagTypeSewingKit,
/*3416*/ BagTypeForge,
/*3417*/ BagTypeFletchingKit,
/*3418*/ BagTypeBrewBarrel,
/*3419*/ BagTypeJewelersKit,
/*3420*/ BagTypePotteryWheel,
/*3421*/ BagTypeKiln,
/*3422*/ BagTypeKeymaker, // (no database entries as of peq rev 69)
/*3423*/ BagTypeWizardsLexicon,
/*3424*/ BagTypeMagesLexicon,
/*3425*/ BagTypeNecromancersLexicon,
/*3426*/ BagTypeEnchantersLexicon,
/*----*/ BagTypeUnknown1, // (a coin pouch/purse?) (no database entries as of peq rev 69)
/*----*/ BagTypeConcordanceofResearch, // <*Database Reference Only>
/*3427*/ BagTypeAlwaysWorks, // Quest container (Never-fail combines?)
/*3428*/ BagTypeKoadaDalForge, // High Elf
/*3429*/ BagTypeTeirDalForge, // Dark Elf
/*3430*/ BagTypeOggokForge, // Ogre
/*3431*/ BagTypeStormguardForge, // Dwarf
/*3432*/ BagTypeAkanonForge, // Gnome
/*3433*/ BagTypeNorthmanForge, // Barbarian
/*----*/ BagTypeUnknown2, // (no database entries as of peq rev 69)
/*3434*/ BagTypeCabilisForge, // Iksar
/*3435*/ BagTypeFreeportForge, // Human 1
/*3436*/ BagTypeRoyalQeynosForge, // Human 2
/*3439*/ BagTypeHalflingTailoringKit,
/*3438*/ BagTypeErudTailoringKit,
/*3440*/ BagTypeFierDalTailoringKit, // Wood Elf
/*3441*/ BagTypeFierDalFletchingKit, // Wood Elf
/*3437*/ BagTypeIksarPotteryWheel,
/*3442*/ BagTypeTackleBox,
/*3443*/ BagTypeTrollForge,
/*3445*/ BagTypeFierDalForge, // Wood Elf
/*3444*/ BagTypeValeForge, // Halfling
/*3446*/ BagTypeErudForge,
/*----*/ BagTypeTradersSatchel, // <*Database Reference Only> (db: Yellow Trader's Satchel Token?)
/*5785*/ BagTypeGuktaForge, // Froglok (no database entries as of peq rev 69)
/*3359*/ BagTypeAugmentationSealer,
/*----*/ BagTypeIceCreamChurn, // <*Database Reference Only>
/*6325*/ BagTypeTransformationmold, // Ornamentation
/*6340*/ BagTypeDetransformationmold, // Ornamentation Stripper
/*5400*/ BagTypeUnattuner,
/*7684*/ BagTypeTradeskillBag,
/*7692*/ BagTypeCollectibleBag,
/*----*/ _BagTypeCount
};
/*
** Item Effect Types
**
*/
enum {
ET_CombatProc = 0,
ET_ClickEffect = 1,
ET_WornEffect = 2,
ET_Expendable = 3,
ET_EquipClick = 4,
ET_ClickEffect2 = 5, //name unknown
ET_Focus = 6,
ET_Scroll = 7
};
//SpawnAppearance types:
#define AT_Die 0 // this causes the client to keel over and zone to bind point
#define AT_WhoLevel 1 // the level that shows up on /who
#define AT_Invis 3 // 0 = visible, 1 = invisible
#define AT_PVP 4 // 0 = blue, 1 = pvp (red)
#define AT_Light 5 // light type emitted by player (lightstone, shiny shield)
#define AT_Anim 14 // 100=standing, 110=sitting, 111=ducking, 115=feigned, 105=looting
#define AT_Sneak 15 // 0 = normal, 1 = sneaking
#define AT_SpawnID 16 // server to client, sets player spawn id
#define AT_HP 17 // Client->Server, my HP has changed (like regen tic)
#define AT_Linkdead 18 // 0 = normal, 1 = linkdead
#define AT_Levitate 19 // 0=off, 1=flymode, 2=levitate
#define AT_GM 20 // 0 = normal, 1 = GM - all odd numbers seem to make it GM
#define AT_Anon 21 // 0 = normal, 1 = anon, 2 = roleplay
#define AT_GuildID 22
#define AT_GuildRank 23 // 0=member, 1=officer, 2=leader
#define AT_AFK 24 // 0 = normal, 1 = afk
#define AT_Pet 25 // Param is EntityID of owner, or 0 for when charm breaks
#define AT_Split 28 // 0 = normal, 1 = autosplit on
#define AT_Size 29 // spawn's size
#define AT_NPCName 31 // change PC's name's color to NPC color 0 = normal, 1 = npc name
#define AT_ShowHelm 43 // 0 = do not show helmet graphic, 1 = show graphic
#define AT_DamageState 44 // The damage state of a destructible object (0 through 4)
//#define AT_Trader 300 // Bazzar Trader Mode
//#define AT_Trader 300 // Bazaar Trader Mode (not present in SoF or RoF2)
// animations for AT_Anim
#define ANIM_FREEZE 102
@@ -472,15 +170,40 @@ typedef enum {
#define MT_StrikeThrough 339
#define MT_Stun 340
// TODO: Really should combine above and below into one
//from showeq
enum ChatColor
{
/*
CC_Default = 0,
CC_DarkGrey = 1,
CC_DarkGreen = 2,
CC_DarkBlue = 3,
CC_Purple = 5,
CC_LightGrey = 6,
*/
CC_WhiteSmoke = 0, // FF|F0F0F0
CC_Green = 2, // FF|008000
CC_BrightBlue = 3, // FF|0040FF
CC_Magenta = 5, // FF|F000F0
CC_Gray = 6, // FF|808080
CC_LightGray = 7, // FF|E0E0E0
//CC_WhiteSmoke2 = 10, // FF|F0F0F0
CC_DarkGray = 12, // FF|A0A0A0
CC_Red = 13, // FF|F00000
CC_Lime = 14, // FF|00F000
CC_Yellow = 15, // FF|F0F000
CC_Blue = 16, // FF|0000F0
CC_LightNavy = 17, // FF|0000AF
CC_Cyan = 18, // FF|00F0F0
CC_Black = 20, // FF|000000
// any index <= 255 that is not defined above
CC_DimGray = 1, // FF|606060
CC_Default = 1,
CC_User_Say = 256,
CC_User_Tell = 257,
CC_User_Group = 258,
@@ -676,7 +399,7 @@ static const uint8 DamageTypeUnknown = 0xFF;
**
** (indexed by 'Skill' of SkillUseTypes)
*/
static const uint8 SkillDamageTypes[HIGHEST_SKILL + 1] = // change to _SkillServerArraySize once activated
static const uint8 SkillDamageTypes[EQEmu::skills::HIGHEST_SKILL + 1] = // change to _SkillServerArraySize once activated
{
/*1HBlunt*/ 0,
/*1HSlashing*/ 1,
@@ -752,29 +475,10 @@ static const uint8 SkillDamageTypes[HIGHEST_SKILL + 1] = // change to _SkillServ
/*Intimidation*/ DamageTypeUnknown,
/*Berserking*/ DamageTypeUnknown,
/*Taunt*/ DamageTypeUnknown,
/*Frenzy*/ 74 //,
// /*RemoveTrap*/ DamageTypeUnknown, // Needs research (set for SenseTrap value)
// /*TripleAttack*/ DamageTypeUnknown, // Needs research (set for DoubleAttack value)
// /*2HPiercing*/ 36 // Needs research (set for 1HPiercing value - similar to slash/blunt)
};
/*
** Material use slots
**
*/
enum MaterialUseSlots : uint8
{
MaterialHead = 0,
MaterialChest,
MaterialArms,
MaterialWrist,
MaterialHands,
MaterialLegs,
MaterialFeet,
MaterialPrimary,
MaterialSecondary,
_MaterialCount,
_MaterialInvalid = 255
/*Frenzy*/ 74,
/*RemoveTrap*/ DamageTypeUnknown, // Needs research (set for SenseTrap value)
/*TripleAttack*/ DamageTypeUnknown, // Needs research (set for DoubleAttack value)
/*2HPiercing*/ 36 // Needs research (set for 1HPiercing value - similar to slash/blunt)
};
/*
@@ -811,164 +515,17 @@ enum MaterialUseSlots : uint8
**
*/
enum InventoryMapTypes : int16 {
MapPossessions = 0,
MapBank,
MapSharedBank,
MapTrade,
MapWorld,
MapLimbo,
MapTribute,
MapTrophyTribute,
MapGuildTribute,
MapMerchant,
MapDeleted,
MapCorpse,
MapBazaar,
MapInspect,
MapRealEstate,
MapViewMODPC,
MapViewMODBank,
MapViewMODSharedBank,
MapViewMODLimbo,
MapAltStorage,
MapArchived,
MapMail,
MapGuildTrophyTribute,
MapKrono,
MapOther,
_MapCount
};
enum InventoryMainTypes : int16 {
MainCharm = 0,
MainEar1,
MainHead,
MainFace,
MainEar2,
MainNeck,
MainShoulders,
MainArms,
MainBack,
MainWrist1,
MainWrist2,
MainRange,
MainHands,
MainPrimary,
MainSecondary,
MainFinger1,
MainFinger2,
MainChest,
MainLegs,
MainFeet,
MainWaist,
MainPowerSource = 9999, // temp
MainAmmo = 21, // temp
MainGeneral1,
MainGeneral2,
MainGeneral3,
MainGeneral4,
MainGeneral5,
MainGeneral6,
MainGeneral7,
MainGeneral8,
//MainGeneral9,
//MainGeneral10,
MainCursor,
_MainCount
};
#define INVALID_INDEX -1
#define NOT_USED 0
#define NO_ITEM 0
// yes..these are redundant... but, they help to identify and define what is actually being performed
// plus, since they're pre-op's, they don't affect the actual binary size
#define MAP_BEGIN 0
#define MAIN_BEGIN 0
#define SUB_BEGIN 0
#define AUG_BEGIN 0
namespace legacy {
// this is for perl and other legacy systems
typedef enum {
SLOT_CHARM = 0,
SLOT_EAR01 = 1,
SLOT_HEAD = 2,
SLOT_FACE = 3,
SLOT_EAR02 = 4,
SLOT_NECK = 5,
SLOT_SHOULDER = 6,
SLOT_ARMS = 7,
SLOT_BACK = 8,
SLOT_BRACER01 = 9,
SLOT_BRACER02 = 10,
SLOT_RANGE = 11,
SLOT_HANDS = 12,
SLOT_PRIMARY = 13,
SLOT_SECONDARY = 14,
SLOT_RING01 = 15,
SLOT_RING02 = 16,
SLOT_CHEST = 17,
SLOT_LEGS = 18,
SLOT_FEET = 19,
SLOT_WAIST = 20,
SLOT_POWER_SOURCE = 9999,
SLOT_AMMO = 21,
SLOT_GENERAL_1 = 22,
SLOT_GENERAL_2 = 23,
SLOT_GENERAL_3 = 24,
SLOT_GENERAL_4 = 25,
SLOT_GENERAL_5 = 26,
SLOT_GENERAL_6 = 27,
SLOT_GENERAL_7 = 28,
SLOT_GENERAL_8 = 29,
//SLOT_GENERAL_9 = not supported
//SLOT_GENERAL_10 = not supported
SLOT_CURSOR = 30,
SLOT_CURSOR_END = (int16)0xFFFE, // I hope no one is using this...
SLOT_TRADESKILL = 1000,
SLOT_AUGMENT = 1001,
SLOT_INVALID = (int16)0xFFFF,
SLOT_POSSESSIONS_BEGIN = 0,
SLOT_POSSESSIONS_END = 30,
SLOT_EQUIPMENT_BEGIN = 0,
SLOT_EQUIPMENT_END = 21,
SLOT_PERSONAL_BEGIN = 22,
SLOT_PERSONAL_END = 29,
SLOT_PERSONAL_BAGS_BEGIN = 251,
SLOT_PERSONAL_BAGS_END = 330,
SLOT_CURSOR_BAG_BEGIN = 331,
SLOT_CURSOR_BAG_END = 340,
SLOT_TRIBUTE_BEGIN = 400,
SLOT_TRIBUTE_END = 404,
SLOT_BANK_BEGIN = 2000,
SLOT_BANK_END = 2023,
SLOT_BANK_BAGS_BEGIN = 2031,
SLOT_BANK_BAGS_END = 2270,
SLOT_SHARED_BANK_BEGIN = 2500,
SLOT_SHARED_BANK_END = 2501,
SLOT_SHARED_BANK_BAGS_BEGIN = 2531,
SLOT_SHARED_BANK_BAGS_END = 2550,
SLOT_TRADE_BEGIN = 3000,
SLOT_TRADE_END = 3007,
SLOT_TRADE_BAGS_BEGIN = 3031,
SLOT_TRADE_BAGS_END = 3110,
SLOT_WORLD_BEGIN = 4000,
SLOT_WORLD_END = 4009
} InventorySlot;
}
#define TYPE_BEGIN 0
#define SLOT_BEGIN 0
#define SUB_INDEX_BEGIN 0
#define AUG_INDEX_BEGIN 0
static const uint32 MAX_SPELL_DB_ID_VAL = 65535;
#endif
#endif /*COMMON_EQ_CONSTANTS_H*/
-956
View File
@@ -1,956 +0,0 @@
/*
EQEMu: Everquest Server Emulator
Copyright (C) 2001-2014 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 "eq_dictionary.h"
#include "string_util.h"
//
// class EmuConstants
//
uint16 EmuConstants::InventoryMapSize(int16 indexMap) {
switch (indexMap) {
case MapPossessions:
return MAP_POSSESSIONS_SIZE;
case MapBank:
return MAP_BANK_SIZE;
case MapSharedBank:
return MAP_SHARED_BANK_SIZE;
case MapTrade:
return MAP_TRADE_SIZE;
case MapWorld:
return MAP_WORLD_SIZE;
case MapLimbo:
return MAP_LIMBO_SIZE;
case MapTribute:
return MAP_TRIBUTE_SIZE;
case MapTrophyTribute:
return MAP_TROPHY_TRIBUTE_SIZE;
case MapGuildTribute:
return MAP_GUILD_TRIBUTE_SIZE;
case MapMerchant:
return MAP_MERCHANT_SIZE;
case MapDeleted:
return MAP_DELETED_SIZE;
case MapCorpse:
return MAP_CORPSE_SIZE;
case MapBazaar:
return MAP_BAZAAR_SIZE;
case MapInspect:
return MAP_INSPECT_SIZE;
case MapRealEstate:
return MAP_REAL_ESTATE_SIZE;
case MapViewMODPC:
return MAP_VIEW_MOD_PC_SIZE;
case MapViewMODBank:
return MAP_VIEW_MOD_BANK_SIZE;
case MapViewMODSharedBank:
return MAP_VIEW_MOD_SHARED_BANK_SIZE;
case MapViewMODLimbo:
return MAP_VIEW_MOD_LIMBO_SIZE;
case MapAltStorage:
return MAP_ALT_STORAGE_SIZE;
case MapArchived:
return MAP_ARCHIVED_SIZE;
case MapMail:
return MAP_MAIL_SIZE;
case MapGuildTrophyTribute:
return MAP_GUILD_TROPHY_TRIBUTE_SIZE;
case MapKrono:
return MAP_KRONO_SIZE;
case MapOther:
return MAP_OTHER_SIZE;
default:
return NOT_USED;
}
}
/*
std::string EmuConstants::InventoryLocationName(Location_Struct location) {
// not ready for implementation...
std::string ret_str;
StringFormat(ret_str, "%s, %s, %s, %s", InventoryMapName(location.map), InventoryMainName(location.main), InventorySubName(location.sub), InventoryAugName(location.aug));
return ret_str;
}
*/
std::string EmuConstants::InventoryMapName(int16 indexMap) {
switch (indexMap) {
case INVALID_INDEX:
return "Invalid Map";
case MapPossessions:
return "Possessions";
case MapBank:
return "Bank";
case MapSharedBank:
return "Shared Bank";
case MapTrade:
return "Trade";
case MapWorld:
return "World";
case MapLimbo:
return "Limbo";
case MapTribute:
return "Tribute";
case MapTrophyTribute:
return "Trophy Tribute";
case MapGuildTribute:
return "Guild Tribute";
case MapMerchant:
return "Merchant";
case MapDeleted:
return "Deleted";
case MapCorpse:
return "Corpse";
case MapBazaar:
return "Bazaar";
case MapInspect:
return "Inspect";
case MapRealEstate:
return "Real Estate";
case MapViewMODPC:
return "View MOD PC";
case MapViewMODBank:
return "View MOD Bank";
case MapViewMODSharedBank:
return "View MOD Shared Bank";
case MapViewMODLimbo:
return "View MOD Limbo";
case MapAltStorage:
return "Alt Storage";
case MapArchived:
return "Archived";
case MapMail:
return "Mail";
case MapGuildTrophyTribute:
return "Guild Trophy Tribute";
case MapKrono:
return "Krono";
case MapOther:
return "Other";
default:
return "Unknown Map";
}
}
std::string EmuConstants::InventoryMainName(int16 indexMain) {
switch (indexMain) {
case INVALID_INDEX:
return "Invalid Main";
case MainCharm:
return "Charm";
case MainEar1:
return "Ear 1";
case MainHead:
return "Head";
case MainFace:
return "Face";
case MainEar2:
return "Ear 2";
case MainNeck:
return "Neck";
case MainShoulders:
return "Shoulders";
case MainArms:
return "Arms";
case MainBack:
return "Back";
case MainWrist1:
return "Wrist 1";
case MainWrist2:
return "Wrist 2";
case MainRange:
return "Range";
case MainHands:
return "Hands";
case MainPrimary:
return "Primary";
case MainSecondary:
return "Secondary";
case MainFinger1:
return "Finger 1";
case MainFinger2:
return "Finger 2";
case MainChest:
return "Chest";
case MainLegs:
return "Legs";
case MainFeet:
return "Feet";
case MainWaist:
return "Waist";
case MainPowerSource:
return "Power Source";
case MainAmmo:
return "Ammo";
case MainGeneral1:
return "General 1";
case MainGeneral2:
return "General 2";
case MainGeneral3:
return "General 3";
case MainGeneral4:
return "General 4";
case MainGeneral5:
return "General 5";
case MainGeneral6:
return "General 6";
case MainGeneral7:
return "General 7";
case MainGeneral8:
return "General 8";
/*
case MainGeneral9:
return "General 9";
case MainGeneral10:
return "General 10";
*/
case MainCursor:
return "Cursor";
default:
return "Unknown Main";
}
}
std::string EmuConstants::InventorySubName(int16 indexSub) {
if (indexSub == INVALID_INDEX)
return "Invalid Sub";
if ((uint16)indexSub >= ITEM_CONTAINER_SIZE)
return "Unknown Sub";
std::string ret_str;
ret_str = StringFormat("Container %i", (indexSub + 1)); // zero-based index..but, count starts at one
return ret_str;
}
std::string EmuConstants::InventoryAugName(int16 indexAug) {
if (indexAug == INVALID_INDEX)
return "Invalid Aug";
if ((uint16)indexAug >= ITEM_COMMON_SIZE)
return "Unknown Aug";
std::string ret_str;
ret_str = StringFormat("Augment %i", (indexAug + 1)); // zero-based index..but, count starts at one
return ret_str;
}
//
// class EQLimits
//
// client validation
bool EQLimits::IsValidPCClientVersion(ClientVersion clientVersion) {
if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_PC_CLIENT)
return true;
return false;
}
ClientVersion EQLimits::ValidatePCClientVersion(ClientVersion clientVersion) {
if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_PC_CLIENT)
return clientVersion;
return ClientVersion::Unknown;
}
// npc validation
bool EQLimits::IsValidNPCClientVersion(ClientVersion clientVersion) {
if (clientVersion > LAST_PC_CLIENT && clientVersion <= LAST_NPC_CLIENT)
return true;
return false;
}
ClientVersion EQLimits::ValidateNPCClientVersion(ClientVersion clientVersion) {
if (clientVersion > LAST_PC_CLIENT && clientVersion <= LAST_NPC_CLIENT)
return clientVersion;
return ClientVersion::Unknown;
}
// mob validation
bool EQLimits::IsValidMobClientVersion(ClientVersion clientVersion) {
if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_NPC_CLIENT)
return true;
return false;
}
ClientVersion EQLimits::ValidateMobClientVersion(ClientVersion clientVersion) {
if (clientVersion > ClientVersion::Unknown && clientVersion <= LAST_NPC_CLIENT)
return clientVersion;
return ClientVersion::Unknown;
}
// inventory
uint16 EQLimits::InventoryMapSize(int16 indexMap, ClientVersion clientVersion) {
// not all maps will have an instantiated container..some are references for queue generators (i.e., bazaar, mail, etc...)
// a zero '0' indicates a needed value..otherwise, change to '_NOTUSED' for a null value so indices requiring research can be identified
// ALL of these values need to be verified before pushing to live
//
// make sure that you transcribe the actual value from 'defaults' to here before updating or client crashes will ensue..and/or...
// insert older clients inside of the progression of client order
//
// MAP_POSSESSIONS_SIZE does not reflect all actual <client>_constants size due to bitmask-use compatibility
//
// when setting NPC-based values, try to adhere to an EmuConstants::<property> or NOT_USED value to avoid unnecessary issues
static const uint16 local[_MapCount][CLIENT_VERSION_COUNT] = {
// server and database are sync'd to current MapPossessions's client as set in 'using namespace RoF::slots;' and
// 'EmuConstants::MAP_POSSESSIONS_SIZE' - use/update EquipmentBitmask(), GeneralBitmask() and CursorBitmask()
// for partial range validation checks and 'EmuConstants::MAP_POSSESSIONS_SIZE' for full range iterations
{ // local[MainPossessions]
/*Unknown*/ NOT_USED,
/*62*/ EmuConstants::MAP_POSSESSIONS_SIZE,
/*Titanium*/ EmuConstants::MAP_POSSESSIONS_SIZE,
/*SoF*/ EmuConstants::MAP_POSSESSIONS_SIZE,
/*SoD*/ EmuConstants::MAP_POSSESSIONS_SIZE,
/*Underfoot*/ EmuConstants::MAP_POSSESSIONS_SIZE,
/*RoF*/ EmuConstants::MAP_POSSESSIONS_SIZE,
/*RoF2*/ EmuConstants::MAP_POSSESSIONS_SIZE,
/*NPC*/ EmuConstants::MAP_POSSESSIONS_SIZE,
/*Merc*/ EmuConstants::MAP_POSSESSIONS_SIZE,
/*Bot*/ EmuConstants::MAP_POSSESSIONS_SIZE,
/*Pet*/ EmuConstants::MAP_POSSESSIONS_SIZE
},
{ // local[MapBank]
/*Unknown*/ NOT_USED,
/*62*/ NOT_USED,
/*Titanium*/ Titanium::consts::MAP_BANK_SIZE,
/*SoF*/ EmuConstants::MAP_BANK_SIZE,
/*SoD*/ EmuConstants::MAP_BANK_SIZE,
/*Underfoot*/ EmuConstants::MAP_BANK_SIZE,
/*RoF*/ EmuConstants::MAP_BANK_SIZE,
/*RoF2*/ EmuConstants::MAP_BANK_SIZE,
/*NPC*/ NOT_USED,
/*Merc*/ NOT_USED,
/*Bot*/ NOT_USED,
/*Pet*/ NOT_USED
},
{ // local[MapSharedBank]
/*Unknown*/ NOT_USED,
/*62*/ EmuConstants::MAP_SHARED_BANK_SIZE,
/*Titanium*/ EmuConstants::MAP_SHARED_BANK_SIZE,
/*SoF*/ EmuConstants::MAP_SHARED_BANK_SIZE,
/*SoD*/ EmuConstants::MAP_SHARED_BANK_SIZE,
/*Underfoot*/ EmuConstants::MAP_SHARED_BANK_SIZE,
/*RoF*/ EmuConstants::MAP_SHARED_BANK_SIZE,
/*RoF2*/ EmuConstants::MAP_SHARED_BANK_SIZE,
/*NPC*/ NOT_USED,
/*Merc*/ NOT_USED,
/*Bot*/ NOT_USED,
/*Pet*/ NOT_USED
},
{ // local[MapTrade]
/*Unknown*/ NOT_USED,
/*62*/ EmuConstants::MAP_TRADE_SIZE,
/*Titanium*/ EmuConstants::MAP_TRADE_SIZE,
/*SoF*/ EmuConstants::MAP_TRADE_SIZE,
/*SoD*/ EmuConstants::MAP_TRADE_SIZE,
/*Underfoot*/ EmuConstants::MAP_TRADE_SIZE,
/*RoF*/ EmuConstants::MAP_TRADE_SIZE,
/*RoF2*/ EmuConstants::MAP_TRADE_SIZE,
/*NPC*/ 4,
/*Merc*/ 4,
/*Bot*/ EmuConstants::MAP_TRADE_SIZE, // client thinks this is another client
/*Pet*/ 4
},
{ // local[MapWorld]
/*Unknown*/ NOT_USED,
/*62*/ EmuConstants::MAP_WORLD_SIZE,
/*Titanium*/ EmuConstants::MAP_WORLD_SIZE,
/*SoF*/ EmuConstants::MAP_WORLD_SIZE,
/*SoD*/ EmuConstants::MAP_WORLD_SIZE,
/*Underfoot*/ EmuConstants::MAP_WORLD_SIZE,
/*RoF*/ EmuConstants::MAP_WORLD_SIZE,
/*RoF2*/ EmuConstants::MAP_WORLD_SIZE,
/*NPC*/ NOT_USED,
/*Merc*/ NOT_USED,
/*Bot*/ NOT_USED,
/*Pet*/ NOT_USED
},
{ // local[MapLimbo]
/*Unknown*/ NOT_USED,
/*62*/ EmuConstants::MAP_LIMBO_SIZE,
/*Titanium*/ EmuConstants::MAP_LIMBO_SIZE,
/*SoF*/ EmuConstants::MAP_LIMBO_SIZE,
/*SoD*/ EmuConstants::MAP_LIMBO_SIZE,
/*Underfoot*/ EmuConstants::MAP_LIMBO_SIZE,
/*RoF*/ EmuConstants::MAP_LIMBO_SIZE,
/*RoF2*/ EmuConstants::MAP_LIMBO_SIZE,
/*NPC*/ NOT_USED,
/*Merc*/ NOT_USED,
/*Bot*/ NOT_USED,
/*Pet*/ NOT_USED
},
{ // local[MapTribute]
/*Unknown*/ NOT_USED,
/*62*/ EmuConstants::MAP_TRIBUTE_SIZE,
/*Titanium*/ EmuConstants::MAP_TRIBUTE_SIZE,
/*SoF*/ EmuConstants::MAP_TRIBUTE_SIZE,
/*SoD*/ EmuConstants::MAP_TRIBUTE_SIZE,
/*Underfoot*/ EmuConstants::MAP_TRIBUTE_SIZE,
/*RoF*/ EmuConstants::MAP_TRIBUTE_SIZE,
/*RoF2*/ EmuConstants::MAP_TRIBUTE_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
},
{ // local[MapTrophyTribute]
/*Unknown*/ NOT_USED,
/*62*/ 0,
/*Titanium*/ 0,
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ EmuConstants::MAP_TROPHY_TRIBUTE_SIZE,
/*RoF2*/ EmuConstants::MAP_TROPHY_TRIBUTE_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
},
{ // local[MapGuildTribute]
/*Unknown*/ NOT_USED,
/*62*/ 0,
/*Titanium*/ 0,
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ EmuConstants::MAP_GUILD_TRIBUTE_SIZE,
/*RoF2*/ EmuConstants::MAP_GUILD_TRIBUTE_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
},
{ // local[MapMerchant]
/*Unknown*/ NOT_USED,
/*62*/ 0,
/*Titanium*/ 0,
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ EmuConstants::MAP_MERCHANT_SIZE,
/*RoF2*/ EmuConstants::MAP_MERCHANT_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
},
{ // local[MapDeleted]
/*Unknown*/ NOT_USED,
/*62*/ 0,
/*Titanium*/ 0,
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ EmuConstants::MAP_DELETED_SIZE,
/*RoF2*/ EmuConstants::MAP_DELETED_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
},
{ // local[MapCorpse]
/*Unknown*/ NOT_USED,
/*62*/ NOT_USED,
/*Titanium*/ Titanium::consts::MAP_CORPSE_SIZE,
/*SoF*/ SoF::consts::MAP_CORPSE_SIZE,
/*SoD*/ SoD::consts::MAP_CORPSE_SIZE,
/*Underfoot*/ UF::consts::MAP_CORPSE_SIZE,
/*RoF*/ RoF::consts::MAP_CORPSE_SIZE,
/*RoF2*/ RoF2::consts::MAP_CORPSE_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
},
{ // local[MapBazaar]
/*Unknown*/ NOT_USED,
/*62*/ EmuConstants::MAP_BAZAAR_SIZE,
/*Titanium*/ EmuConstants::MAP_BAZAAR_SIZE,
/*SoF*/ EmuConstants::MAP_BAZAAR_SIZE,
/*SoD*/ EmuConstants::MAP_BAZAAR_SIZE,
/*Underfoot*/ EmuConstants::MAP_BAZAAR_SIZE,
/*RoF*/ EmuConstants::MAP_BAZAAR_SIZE,
/*RoF2*/ EmuConstants::MAP_BAZAAR_SIZE,
/*NPC*/ 0, // this may need to be 'EmuConstants::MAP_BAZAAR_SIZE' if offline client traders respawn as an npc
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
},
{ // local[MapInspect]
/*Unknown*/ NOT_USED,
/*62*/ NOT_USED,
/*Titanium*/ Titanium::consts::MAP_INSPECT_SIZE,
/*SoF*/ SoF::consts::MAP_INSPECT_SIZE,
/*SoD*/ SoD::consts::MAP_INSPECT_SIZE,
/*Underfoot*/ UF::consts::MAP_INSPECT_SIZE,
/*RoF*/ RoF::consts::MAP_INSPECT_SIZE,
/*RoF2*/ RoF2::consts::MAP_INSPECT_SIZE,
/*NPC*/ NOT_USED,
/*Merc*/ NOT_USED,
/*Bot*/ NOT_USED,
/*Pet*/ NOT_USED
},
{ // local[MapRealEstate]
/*Unknown*/ NOT_USED,
/*62*/ 0,
/*Titanium*/ 0,
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ EmuConstants::MAP_REAL_ESTATE_SIZE,
/*RoF2*/ EmuConstants::MAP_REAL_ESTATE_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
},
{ // local[MapViewMODPC]
/*Unknown*/ NOT_USED,
/*62*/ 0,
/*Titanium*/ 0,
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ EmuConstants::MAP_VIEW_MOD_PC_SIZE,
/*RoF2*/ EmuConstants::MAP_VIEW_MOD_PC_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
},
{ // local[MapViewMODBank]
/*Unknown*/ NOT_USED,
/*62*/ 0,
/*Titanium*/ 0,
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ EmuConstants::MAP_VIEW_MOD_BANK_SIZE,
/*RoF2*/ EmuConstants::MAP_VIEW_MOD_BANK_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
},
{ // local[MapViewMODSharedBank]
/*Unknown*/ NOT_USED,
/*62*/ 0,
/*Titanium*/ 0,
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ EmuConstants::MAP_VIEW_MOD_SHARED_BANK_SIZE,
/*RoF2*/ EmuConstants::MAP_VIEW_MOD_SHARED_BANK_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
},
{ // local[MapViewMODLimbo]
/*Unknown*/ NOT_USED,
/*62*/ 0,
/*Titanium*/ 0,
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ EmuConstants::MAP_VIEW_MOD_LIMBO_SIZE,
/*RoF2*/ EmuConstants::MAP_VIEW_MOD_LIMBO_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
},
{ // local[MapAltStorage]
/*Unknown*/ NOT_USED,
/*62*/ 0,
/*Titanium*/ 0,
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ EmuConstants::MAP_ALT_STORAGE_SIZE,
/*RoF2*/ EmuConstants::MAP_ALT_STORAGE_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
},
{ // local[MapArchived]
/*Unknown*/ NOT_USED,
/*62*/ 0,
/*Titanium*/ 0,
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ EmuConstants::MAP_ARCHIVED_SIZE,
/*RoF2*/ EmuConstants::MAP_ARCHIVED_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
},
{ // local[MapMail]
/*Unknown*/ NOT_USED,
/*62*/ 0,
/*Titanium*/ 0,
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ EmuConstants::MAP_MAIL_SIZE,
/*RoF2*/ EmuConstants::MAP_MAIL_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
},
{ // local[MapGuildTrophyTribute]
/*Unknown*/ NOT_USED,
/*62*/ 0,
/*Titanium*/ 0,
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ EmuConstants::MAP_GUILD_TROPHY_TRIBUTE_SIZE,
/*RoF2*/ EmuConstants::MAP_GUILD_TROPHY_TRIBUTE_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
},
{ // local[MapKrono]
/*Unknown*/ NOT_USED,
/*62*/ NOT_USED,
/*Titanium*/ NOT_USED,
/*SoF*/ NOT_USED,
/*SoD*/ NOT_USED,
/*Underfoot*/ NOT_USED,
/*RoF*/ EmuConstants::MAP_KRONO_SIZE,
/*RoF2*/ EmuConstants::MAP_KRONO_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
},
{ // local[MapOther]
/*Unknown*/ NOT_USED,
/*62*/ 0,
/*Titanium*/ 0,
/*SoF*/ 0,
/*SoD*/ 0,
/*Underfoot*/ 0,
/*RoF*/ EmuConstants::MAP_OTHER_SIZE,
/*RoF2*/ EmuConstants::MAP_OTHER_SIZE,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
}
};
if ((uint16)indexMap < _MapCount)
return local[indexMap][static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
return NOT_USED;
}
uint64 EQLimits::PossessionsBitmask(ClientVersion clientVersion) {
// these are for the new inventory system (RoF)..not the current (Ti) one...
// 0x0000000000200000 is SlotPowerSource (SoF+)
// 0x0000000080000000 is SlotGeneral9 (RoF+)
// 0x0000000100000000 is SlotGeneral10 (RoF+)
static const uint64 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
/*62*/ 0x000000027FDFFFFF,
/*Titanium*/ 0x000000027FDFFFFF,
/*SoF*/ 0x000000027FFFFFFF,
/*SoD*/ 0x000000027FFFFFFF,
/*Underfoot*/ 0x000000027FFFFFFF,
/*RoF*/ 0x00000003FFFFFFFF,
/*RoF2*/ 0,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
};
return NOT_USED;
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
uint64 EQLimits::EquipmentBitmask(ClientVersion clientVersion) {
static const uint64 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
/*62*/ 0x00000000005FFFFF,
/*Titanium*/ 0x00000000005FFFFF,
/*SoF*/ 0x00000000007FFFFF,
/*SoD*/ 0x00000000007FFFFF,
/*Underfoot*/ 0x00000000007FFFFF,
/*RoF*/ 0x00000000007FFFFF,
/*RoF2*/ 0,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
};
return NOT_USED;
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
uint64 EQLimits::GeneralBitmask(ClientVersion clientVersion) {
static const uint64 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
/*62*/ 0x000000007F800000,
/*Titanium*/ 0x000000007F800000,
/*SoF*/ 0x000000007F800000,
/*SoD*/ 0x000000007F800000,
/*Underfoot*/ 0x000000007F800000,
/*RoF*/ 0x00000001FF800000,
/*RoF2*/ 0,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
};
return NOT_USED;
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
uint64 EQLimits::CursorBitmask(ClientVersion clientVersion) {
static const uint64 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
/*62*/ 0x0000000200000000,
/*Titanium*/ 0x0000000200000000,
/*SoF*/ 0x0000000200000000,
/*SoD*/ 0x0000000200000000,
/*Underfoot*/ 0x0000000200000000,
/*RoF*/ 0x0000000200000000,
/*RoF2*/ 0,
/*NPC*/ 0,
/*Merc*/ 0,
/*Bot*/ 0,
/*Pet*/ 0
};
return NOT_USED;
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
bool EQLimits::AllowsEmptyBagInBag(ClientVersion clientVersion) {
static const bool local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ false,
/*62*/ false,
/*Titanium*/ Titanium::limits::ALLOWS_EMPTY_BAG_IN_BAG,
/*SoF*/ SoF::limits::ALLOWS_EMPTY_BAG_IN_BAG,
/*SoD*/ SoD::limits::ALLOWS_EMPTY_BAG_IN_BAG,
/*Underfoot*/ UF::limits::ALLOWS_EMPTY_BAG_IN_BAG,
/*RoF*/ RoF::limits::ALLOWS_EMPTY_BAG_IN_BAG,
/*RoF2*/ RoF2::limits::ALLOWS_EMPTY_BAG_IN_BAG,
/*NPC*/ false,
/*Merc*/ false,
/*Bot*/ false,
/*Pet*/ false
};
return false; // not implemented
//return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
bool EQLimits::AllowsClickCastFromBag(ClientVersion clientVersion) {
static const bool local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ false,
/*62*/ false,
/*Titanium*/ Titanium::limits::ALLOWS_CLICK_CAST_FROM_BAG,
/*SoF*/ SoF::limits::ALLOWS_CLICK_CAST_FROM_BAG,
/*SoD*/ SoD::limits::ALLOWS_CLICK_CAST_FROM_BAG,
/*Underfoot*/ UF::limits::ALLOWS_CLICK_CAST_FROM_BAG,
/*RoF*/ RoF::limits::ALLOWS_CLICK_CAST_FROM_BAG,
/*RoF2*/ RoF2::limits::ALLOWS_CLICK_CAST_FROM_BAG,
/*NPC*/ false,
/*Merc*/ false,
/*Bot*/ false,
/*Pet*/ false
};
return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
// items
uint16 EQLimits::ItemCommonSize(ClientVersion clientVersion) {
static const uint16 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
/*62*/ EmuConstants::ITEM_COMMON_SIZE,
/*Titanium*/ EmuConstants::ITEM_COMMON_SIZE,
/*SoF*/ EmuConstants::ITEM_COMMON_SIZE,
/*SoD*/ EmuConstants::ITEM_COMMON_SIZE,
/*Underfoot*/ EmuConstants::ITEM_COMMON_SIZE,
/*RoF*/ EmuConstants::ITEM_COMMON_SIZE,
/*RoF2*/ EmuConstants::ITEM_COMMON_SIZE,
/*NPC*/ EmuConstants::ITEM_COMMON_SIZE,
/*Merc*/ EmuConstants::ITEM_COMMON_SIZE,
/*Bot*/ EmuConstants::ITEM_COMMON_SIZE,
/*Pet*/ EmuConstants::ITEM_COMMON_SIZE
};
return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
uint16 EQLimits::ItemContainerSize(ClientVersion clientVersion) {
static const uint16 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
/*62*/ EmuConstants::ITEM_CONTAINER_SIZE,
/*Titanium*/ EmuConstants::ITEM_CONTAINER_SIZE,
/*SoF*/ EmuConstants::ITEM_CONTAINER_SIZE,
/*SoD*/ EmuConstants::ITEM_CONTAINER_SIZE,
/*Underfoot*/ EmuConstants::ITEM_CONTAINER_SIZE,
/*RoF*/ EmuConstants::ITEM_CONTAINER_SIZE,
/*RoF2*/ EmuConstants::ITEM_CONTAINER_SIZE,
/*NPC*/ EmuConstants::ITEM_CONTAINER_SIZE,
/*Merc*/ EmuConstants::ITEM_CONTAINER_SIZE,
/*Bot*/ EmuConstants::ITEM_CONTAINER_SIZE,
/*Pet*/ EmuConstants::ITEM_CONTAINER_SIZE
};
return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
bool EQLimits::CoinHasWeight(ClientVersion clientVersion) {
static const bool local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ true,
/*62*/ true,
/*Titanium*/ Titanium::limits::COIN_HAS_WEIGHT,
/*SoF*/ SoF::limits::COIN_HAS_WEIGHT,
/*SoD*/ SoD::limits::COIN_HAS_WEIGHT,
/*Underfoot*/ UF::limits::COIN_HAS_WEIGHT,
/*RoF*/ RoF::limits::COIN_HAS_WEIGHT,
/*RoF2*/ RoF::limits::COIN_HAS_WEIGHT,
/*NPC*/ true,
/*Merc*/ true,
/*Bot*/ true,
/*Pet*/ true
};
return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
uint32 EQLimits::BandoliersCount(ClientVersion clientVersion) {
static const uint32 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
/*62*/ EmuConstants::BANDOLIERS_COUNT,
/*Titanium*/ EmuConstants::BANDOLIERS_COUNT,
/*SoF*/ EmuConstants::BANDOLIERS_COUNT,
/*SoD*/ EmuConstants::BANDOLIERS_COUNT,
/*Underfoot*/ EmuConstants::BANDOLIERS_COUNT,
/*RoF*/ EmuConstants::BANDOLIERS_COUNT,
/*RoF2*/ EmuConstants::BANDOLIERS_COUNT,
/*NPC*/ NOT_USED,
/*Merc*/ NOT_USED,
/*Bot*/ NOT_USED,
/*Pet*/ NOT_USED
};
return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
uint32 EQLimits::BandolierSize(ClientVersion clientVersion) {
static const uint32 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
/*62*/ EmuConstants::BANDOLIER_SIZE,
/*Titanium*/ EmuConstants::BANDOLIER_SIZE,
/*SoF*/ EmuConstants::BANDOLIER_SIZE,
/*SoD*/ EmuConstants::BANDOLIER_SIZE,
/*Underfoot*/ EmuConstants::BANDOLIER_SIZE,
/*RoF*/ EmuConstants::BANDOLIER_SIZE,
/*RoF2*/ EmuConstants::BANDOLIER_SIZE,
/*NPC*/ NOT_USED,
/*Merc*/ NOT_USED,
/*Bot*/ NOT_USED,
/*Pet*/ NOT_USED
};
return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
uint32 EQLimits::PotionBeltSize(ClientVersion clientVersion) {
static const uint32 local[CLIENT_VERSION_COUNT] = {
/*Unknown*/ NOT_USED,
/*62*/ EmuConstants::POTION_BELT_SIZE,
/*Titanium*/ EmuConstants::POTION_BELT_SIZE,
/*SoF*/ EmuConstants::POTION_BELT_SIZE,
/*SoD*/ EmuConstants::POTION_BELT_SIZE,
/*Underfoot*/ EmuConstants::POTION_BELT_SIZE,
/*RoF*/ EmuConstants::POTION_BELT_SIZE,
/*RoF2*/ EmuConstants::POTION_BELT_SIZE,
/*NPC*/ NOT_USED,
/*Merc*/ NOT_USED,
/*Bot*/ NOT_USED,
/*Pet*/ NOT_USED
};
return local[static_cast<unsigned int>(ValidateMobClientVersion(clientVersion))];
}
-209
View File
@@ -1,209 +0,0 @@
/*
EQEMu: Everquest Server Emulator
Copyright (C) 2001-2014 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
*/
#ifndef EQ_DICTIONARY_H
#define EQ_DICTIONARY_H
#include "types.h"
#include "eq_constants.h"
#include "clientversions.h"
#include <string>
#include "../common/patches/titanium_constants.h"
#include "../common/patches/sof_constants.h"
#include "../common/patches/sod_constants.h"
#include "../common/patches/uf_constants.h"
#include "../common/patches/rof_constants.h"
#include "../common/patches/rof2_constants.h"
// *** DO NOT CHANGE without a full understanding of the consequences..the server is set up to use these settings explicitly!! ***
// *** You will cause compilation failures and corrupt your database if partial or incorrect attempts to change them are made!! ***
// Hard-coded values usually indicate that further research is needed and the values given are from the old (known) system
// (future use)
//using namespace RoF2::maps; // server inventory maps enumeration (code and database sync'd to reference)
//using namespace RoF::slots; // server possessions slots enumeration (code and database sync'd to reference)
class EmuConstants {
// an immutable value is required to initialize arrays, etc... use this class as a repository for those
public:
// database
static const ClientVersion CHARACTER_CREATION_CLIENT = ClientVersion::RoF2; // adjust according to starting item placement and target client
// inventory
static uint16 InventoryMapSize(int16 indexMap);
//static std::string InventoryLocationName(Location_Struct location);
static std::string InventoryMapName(int16 indexMap);
static std::string InventoryMainName(int16 indexMain);
static std::string InventorySubName(int16 indexSub);
static std::string InventoryAugName(int16 indexAug);
// these are currently hard-coded for existing inventory system..do not use in place of special client version handlers until ready
static const uint16 MAP_POSSESSIONS_SIZE = _MainCount;
static const uint16 MAP_BANK_SIZE = 24;
static const uint16 MAP_SHARED_BANK_SIZE = 2;
static const uint16 MAP_TRADE_SIZE = 8;
static const uint16 MAP_WORLD_SIZE = 10;
static const uint16 MAP_LIMBO_SIZE = 36;
static const uint16 MAP_TRIBUTE_SIZE = 5; // (need client values)
static const uint16 MAP_TROPHY_TRIBUTE_SIZE = 0;
static const uint16 MAP_GUILD_TRIBUTE_SIZE = 0;
static const uint16 MAP_MERCHANT_SIZE = 0;
static const uint16 MAP_DELETED_SIZE = 0;
static const uint16 MAP_CORPSE_SIZE = _MainCount; // no bitmask use..limits to size of client corpse window (see EQLimits::InventoryMapSize(MapCorpse, <EQClientVersion))
static const uint16 MAP_BAZAAR_SIZE = 80;
static const uint16 MAP_INSPECT_SIZE = 22;
static const uint16 MAP_REAL_ESTATE_SIZE = 0;
static const uint16 MAP_VIEW_MOD_PC_SIZE = NOT_USED;
static const uint16 MAP_VIEW_MOD_BANK_SIZE = NOT_USED;
static const uint16 MAP_VIEW_MOD_SHARED_BANK_SIZE = NOT_USED;
static const uint16 MAP_VIEW_MOD_LIMBO_SIZE = NOT_USED;
static const uint16 MAP_ALT_STORAGE_SIZE = 0;
static const uint16 MAP_ARCHIVED_SIZE = 0;
static const uint16 MAP_MAIL_SIZE = 0;
static const uint16 MAP_GUILD_TROPHY_TRIBUTE_SIZE = 0;
static const uint16 MAP_KRONO_SIZE = 0;
static const uint16 MAP_OTHER_SIZE = 0;
// most of these definitions will go away with the structure-based system..this maintains compatibility for now
// (these are mainly to assign specific values to constants used in conversions and to identify per-client ranges/offsets)
static const int16 EQUIPMENT_BEGIN = MainCharm;
static const int16 EQUIPMENT_END = MainAmmo;
static const uint16 EQUIPMENT_SIZE = 22; // does not account for 'Power Source' - used mainly for npc equipment arrays
static const int16 GENERAL_BEGIN = MainGeneral1;
static const int16 GENERAL_END = MainGeneral8;
static const uint16 GENERAL_SIZE = 8;
static const int16 GENERAL_BAGS_BEGIN = 251;
static const int16 GENERAL_BAGS_END_OFFSET = 79;
static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET;
static const int16 CURSOR_BAG_BEGIN = 331;
static const int16 CURSOR_BAG_END_OFFSET = 9;
static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET;
static const int16 BANK_BEGIN = 2000;
static const int16 BANK_END = 2023;
static const int16 BANK_BAGS_BEGIN = 2031;
static const int16 BANK_BAGS_END_OFFSET = 239;
static const int16 BANK_BAGS_END = BANK_BAGS_BEGIN + BANK_BAGS_END_OFFSET;
static const int16 SHARED_BANK_BEGIN = 2500;
static const int16 SHARED_BANK_END = 2501;
static const int16 SHARED_BANK_BAGS_BEGIN = 2531;
static const int16 SHARED_BANK_BAGS_END_OFFSET = 19;
static const int16 SHARED_BANK_BAGS_END = SHARED_BANK_BAGS_BEGIN + SHARED_BANK_BAGS_END_OFFSET;
static const int16 TRADE_BEGIN = 3000;
static const int16 TRADE_END = 3007;
static const int16 TRADE_NPC_END = 3003;
static const int16 TRADE_BAGS_BEGIN = 3031;
static const int16 TRADE_BAGS_END_OFFSET = 79;
static const int16 TRADE_BAGS_END = TRADE_BAGS_BEGIN + TRADE_BAGS_END_OFFSET;
static const int16 WORLD_BEGIN = 4000;
static const int16 WORLD_END = 4009;
static const int16 WORLD_SIZE = MAP_WORLD_SIZE;
static const int16 TRIBUTE_BEGIN = 400;
static const int16 TRIBUTE_END = 404;
static const int16 TRIBUTE_SIZE = MAP_TRIBUTE_SIZE;
static const int16 CORPSE_BEGIN = 22;
//static const int16 CORPSE_END = RoF::consts::CORPSE_END; // not ready for use
static const int16 MATERIAL_BEGIN = MaterialHead;
static const int16 MATERIAL_END = MaterialSecondary;
static const int16 MATERIAL_TINT_END = MaterialFeet;
static const int16 MATERIAL_SIZE = _MaterialCount;
// items
// common and container sizes will not increase until the new 'location' struct is implemented
static const uint16 ITEM_COMMON_SIZE = RoF::consts::ITEM_COMMON_SIZE;
static const uint16 ITEM_CONTAINER_SIZE = Titanium::consts::ITEM_CONTAINER_SIZE;
// player profile
//static const uint32 CLASS_BITMASK = 0; // needs value
//static const uint32 RACE_BITMASK = 0; // needs value
// BANDOLIERS_COUNT sets maximum limit..active limit will need to be handled by the appropriate AA
static const uint32 BANDOLIERS_COUNT = Titanium::consts::BANDOLIERS_COUNT; // count = number of bandolier instances
static const uint32 BANDOLIER_SIZE = Titanium::consts::BANDOLIER_SIZE; // size = number of equipment slots in bandolier instance
static const uint32 POTION_BELT_SIZE = Titanium::consts::POTION_BELT_SIZE;
static const size_t TEXT_LINK_BODY_LENGTH = 56;
// legacy-related functions
//static int ServerToPerlSlot(int slot); // encode
//static int PerlToServerSlot(int slot); // decode
};
class EQLimits {
// values should default to a non-beneficial value..unless value conflicts with intended operation
//
// EmuConstants may be used as references..but, not every reference needs to be in EmuConstants (i.e., AllowsEmptyBagInBag(), CoinHasWeight(), etc...)
public:
// client version validation (checks to avoid crashing zone server when accessing reference arrays)
// use this inside of class Client (limits to actual clients)
static bool IsValidPCClientVersion(ClientVersion clientVersion);
static ClientVersion ValidatePCClientVersion(ClientVersion clientVersion);
// basically..any non-client classes - do not when setting a valid client
static bool IsValidNPCClientVersion(ClientVersion clientVersion);
static ClientVersion ValidateNPCClientVersion(ClientVersion clientVersion);
// these are 'universal' - do not when setting a valid client
static bool IsValidMobClientVersion(ClientVersion clientVersion);
static ClientVersion ValidateMobClientVersion(ClientVersion clientVersion);
// inventory
static uint16 InventoryMapSize(int16 indexMap, ClientVersion clientVersion);
static uint64 PossessionsBitmask(ClientVersion clientVersion);
static uint64 EquipmentBitmask(ClientVersion clientVersion);
static uint64 GeneralBitmask(ClientVersion clientVersion);
static uint64 CursorBitmask(ClientVersion clientVersion);
static bool AllowsEmptyBagInBag(ClientVersion clientVersion);
static bool AllowsClickCastFromBag(ClientVersion clientVersion);
// items
static uint16 ItemCommonSize(ClientVersion clientVersion);
static uint16 ItemContainerSize(ClientVersion clientVersion);
// player profile
static bool CoinHasWeight(ClientVersion clientVersion);
static uint32 BandoliersCount(ClientVersion clientVersion);
static uint32 BandolierSize(ClientVersion clientVersion);
static uint32 PotionBeltSize(ClientVersion clientVersion);
};
#endif /* EQ_DICTIONARY_H */
/*
Working Notes:
--------------
- full review of client_packet.cpp and client translators needed
*/
+521
View File
@@ -0,0 +1,521 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
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 "emu_constants.h"
#include "emu_limits.h"
size_t EQEmu::constants::CharacterCreationLimit(versions::ClientVersion client_version)
{
static const size_t local[versions::ClientVersionCount] = {
ClientUnknown::Null,
Client62::Null,
Titanium::constants::CharacterCreationLimit,
SoF::constants::CharacterCreationLimit,
SoD::constants::CharacterCreationLimit,
UF::constants::CharacterCreationLimit,
RoF::constants::CharacterCreationLimit,
RoF2::constants::CharacterCreationLimit
};
return local[static_cast<size_t>(versions::ValidateClientVersion(client_version))];
}
uint16 EQEmu::inventory::InventoryTypeSize(versions::InventoryVersion inventory_version, int16 inv_type)
{
static const uint16 local[legacy::TypeCount][versions::InventoryVersionCount] = {
{ // local[TypePossessions]
ClientUnknown::Null,
Client62::Null,
legacy::TYPE_POSSESSIONS_SIZE,
legacy::TYPE_POSSESSIONS_SIZE,
legacy::TYPE_POSSESSIONS_SIZE,
legacy::TYPE_POSSESSIONS_SIZE,
legacy::TYPE_POSSESSIONS_SIZE,
legacy::TYPE_POSSESSIONS_SIZE,
legacy::TYPE_POSSESSIONS_SIZE,
legacy::TYPE_POSSESSIONS_SIZE,
legacy::TYPE_POSSESSIONS_SIZE,
legacy::TYPE_POSSESSIONS_SIZE
},
{ // local[TypeBank]
ClientUnknown::Null,
Client62::Null,
Titanium::invtype::InvTypeBankSize,
legacy::TYPE_BANK_SIZE,
legacy::TYPE_BANK_SIZE,
legacy::TYPE_BANK_SIZE,
legacy::TYPE_BANK_SIZE,
legacy::TYPE_BANK_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeSharedBank]
ClientUnknown::Null,
Client62::Null,
legacy::TYPE_SHARED_BANK_SIZE,
legacy::TYPE_SHARED_BANK_SIZE,
legacy::TYPE_SHARED_BANK_SIZE,
legacy::TYPE_SHARED_BANK_SIZE,
legacy::TYPE_SHARED_BANK_SIZE,
legacy::TYPE_SHARED_BANK_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeTrade]
ClientUnknown::Null,
Client62::Null,
legacy::TYPE_TRADE_SIZE,
legacy::TYPE_TRADE_SIZE,
legacy::TYPE_TRADE_SIZE,
legacy::TYPE_TRADE_SIZE,
legacy::TYPE_TRADE_SIZE,
legacy::TYPE_TRADE_SIZE,
4,
4,
legacy::TYPE_TRADE_SIZE, // client thinks this is another client
4
},
{ // local[TypeWorld]
ClientUnknown::Null,
Client62::Null,
legacy::TYPE_WORLD_SIZE,
legacy::TYPE_WORLD_SIZE,
legacy::TYPE_WORLD_SIZE,
legacy::TYPE_WORLD_SIZE,
legacy::TYPE_WORLD_SIZE,
legacy::TYPE_WORLD_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeLimbo]
ClientUnknown::Null,
Client62::Null,
legacy::TYPE_LIMBO_SIZE,
legacy::TYPE_LIMBO_SIZE,
legacy::TYPE_LIMBO_SIZE,
legacy::TYPE_LIMBO_SIZE,
legacy::TYPE_LIMBO_SIZE,
legacy::TYPE_LIMBO_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeTribute]
ClientUnknown::Null,
Client62::Null,
legacy::TYPE_TRIBUTE_SIZE,
legacy::TYPE_TRIBUTE_SIZE,
legacy::TYPE_TRIBUTE_SIZE,
legacy::TYPE_TRIBUTE_SIZE,
legacy::TYPE_TRIBUTE_SIZE,
legacy::TYPE_TRIBUTE_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeTrophyTribute]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_TROPHY_TRIBUTE_SIZE,
legacy::TYPE_TROPHY_TRIBUTE_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeGuildTribute]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_GUILD_TRIBUTE_SIZE,
legacy::TYPE_GUILD_TRIBUTE_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeMerchant]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_MERCHANT_SIZE,
legacy::TYPE_MERCHANT_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeDeleted]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_DELETED_SIZE,
legacy::TYPE_DELETED_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeCorpse]
ClientUnknown::Null,
Client62::Null,
Titanium::invtype::InvTypeCorpseSize,
SoF::invtype::InvTypeCorpseSize,
SoD::invtype::InvTypeCorpseSize,
UF::invtype::InvTypeCorpseSize,
RoF::invtype::InvTypeCorpseSize,
RoF2::invtype::InvTypeCorpseSize,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeBazaar]
ClientUnknown::Null,
Client62::Null,
legacy::TYPE_BAZAAR_SIZE,
legacy::TYPE_BAZAAR_SIZE,
legacy::TYPE_BAZAAR_SIZE,
legacy::TYPE_BAZAAR_SIZE,
legacy::TYPE_BAZAAR_SIZE,
legacy::TYPE_BAZAAR_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeInspect]
ClientUnknown::Null,
Client62::Null,
Titanium::invtype::InvTypeInspectSize,
SoF::invtype::InvTypeInspectSize,
SoD::invtype::InvTypeInspectSize,
UF::invtype::InvTypeInspectSize,
RoF::invtype::InvTypeInspectSize,
RoF2::invtype::InvTypeInspectSize,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeRealEstate]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_REAL_ESTATE_SIZE,
legacy::TYPE_REAL_ESTATE_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeViewMODPC]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_VIEW_MOD_PC_SIZE,
legacy::TYPE_VIEW_MOD_PC_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeViewMODBank]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_VIEW_MOD_BANK_SIZE,
legacy::TYPE_VIEW_MOD_BANK_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeViewMODSharedBank]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_VIEW_MOD_SHARED_BANK_SIZE,
legacy::TYPE_VIEW_MOD_SHARED_BANK_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeViewMODLimbo]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_VIEW_MOD_LIMBO_SIZE,
legacy::TYPE_VIEW_MOD_LIMBO_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeAltStorage]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_ALT_STORAGE_SIZE,
legacy::TYPE_ALT_STORAGE_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeArchived]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_ARCHIVED_SIZE,
legacy::TYPE_ARCHIVED_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeMail]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_MAIL_SIZE,
legacy::TYPE_MAIL_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeGuildTrophyTribute]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_GUILD_TROPHY_TRIBUTE_SIZE,
legacy::TYPE_GUILD_TROPHY_TRIBUTE_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeKrono]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_KRONO_SIZE,
legacy::TYPE_KRONO_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeOther]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_OTHER_SIZE,
legacy::TYPE_OTHER_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
}
};
if ((uint16)inv_type < legacy::TypeCount)
return local[inv_type][static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
return NOT_USED;
}
uint64 EQEmu::inventory::PossessionsBitmask(versions::InventoryVersion inventory_version)
{
static const uint64 local[versions::InventoryVersionCount] = {
ClientUnknown::Null,
Client62::Null,
0x000000027FDFFFFF,
0x000000027FFFFFFF,
0x000000027FFFFFFF,
0x000000027FFFFFFF,
0x00000003FFFFFFFF,
0x00000003FFFFFFFF,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
};
return NOT_USED;
//return local[static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
}
bool EQEmu::inventory::AllowEmptyBagInBag(versions::InventoryVersion inventory_version)
{
static const bool local[versions::InventoryVersionCount] = {
ClientUnknown::False,
Client62::False,
Titanium::behavior::AllowEmptyBagInBag,
SoF::behavior::AllowEmptyBagInBag,
SoD::behavior::AllowEmptyBagInBag,
UF::behavior::AllowEmptyBagInBag,
RoF::behavior::AllowEmptyBagInBag,
RoF2::behavior::AllowEmptyBagInBag,
EntityLimits::npc::False,
EntityLimits::merc::False,
EntityLimits::bot::False,
EntityLimits::pet::False
};
return false;
//return local[static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
}
bool EQEmu::inventory::AllowClickCastFromBag(versions::InventoryVersion inventory_version)
{
static const bool local[versions::InventoryVersionCount] = {
ClientUnknown::False,
Client62::False,
Titanium::behavior::AllowClickCastFromBag,
SoF::behavior::AllowClickCastFromBag,
SoD::behavior::AllowClickCastFromBag,
UF::behavior::AllowClickCastFromBag,
RoF::behavior::AllowClickCastFromBag,
RoF2::behavior::AllowClickCastFromBag,
EntityLimits::npc::False,
EntityLimits::merc::False,
EntityLimits::bot::False,
EntityLimits::pet::False
};
return local[static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
}
uint16 EQEmu::inventory::ItemAugSize(versions::InventoryVersion inventory_version)
{
static const uint16 local[versions::InventoryVersionCount] = {
ClientUnknown::Null,
Client62::Null,
legacy::ITEM_COMMON_SIZE,
legacy::ITEM_COMMON_SIZE,
legacy::ITEM_COMMON_SIZE,
legacy::ITEM_COMMON_SIZE,
legacy::ITEM_COMMON_SIZE,
legacy::ITEM_COMMON_SIZE,
legacy::ITEM_COMMON_SIZE,
legacy::ITEM_COMMON_SIZE,
legacy::ITEM_COMMON_SIZE,
legacy::ITEM_COMMON_SIZE
};
return local[static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
}
uint16 EQEmu::inventory::ItemBagSize(versions::InventoryVersion inventory_version)
{
static const uint16 local[versions::InventoryVersionCount] = {
ClientUnknown::Null,
Client62::Null,
legacy::ITEM_CONTAINER_SIZE,
legacy::ITEM_CONTAINER_SIZE,
legacy::ITEM_CONTAINER_SIZE,
legacy::ITEM_CONTAINER_SIZE,
legacy::ITEM_CONTAINER_SIZE,
legacy::ITEM_CONTAINER_SIZE,
legacy::ITEM_CONTAINER_SIZE,
legacy::ITEM_CONTAINER_SIZE,
legacy::ITEM_CONTAINER_SIZE,
legacy::ITEM_CONTAINER_SIZE
};
return local[static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
}
bool EQEmu::profile::CoinHasWeight(versions::InventoryVersion inventory_version)
{
static const bool local[versions::InventoryVersionCount] = {
ClientUnknown::True,
Client62::True,
Titanium::behavior::CoinHasWeight,
SoF::behavior::CoinHasWeight,
SoD::behavior::CoinHasWeight,
UF::behavior::CoinHasWeight,
RoF::behavior::CoinHasWeight,
RoF::behavior::CoinHasWeight,
EntityLimits::npc::True,
EntityLimits::merc::True,
EntityLimits::bot::True,
EntityLimits::pet::True
};
return local[static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
}
+80
View File
@@ -0,0 +1,80 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
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
*/
#ifndef COMMON_EQ_LIMITS_H
#define COMMON_EQ_LIMITS_H
#include "types.h"
#include "eq_constants.h"
#include "inventory_version.h"
#include "../common/patches/titanium_limits.h"
#include "../common/patches/sof_limits.h"
#include "../common/patches/sod_limits.h"
#include "../common/patches/uf_limits.h"
#include "../common/patches/rof_limits.h"
#include "../common/patches/rof2_limits.h"
namespace EQEmu
{
namespace constants {
extern size_t CharacterCreationLimit(versions::ClientVersion client_version);
} /*constants*/
namespace inventory {
extern uint16 InventoryTypeSize(versions::InventoryVersion inventory_version, int16 inv_type);
extern uint64 PossessionsBitmask(versions::InventoryVersion inventory_version);
extern bool AllowEmptyBagInBag(versions::InventoryVersion inventory_version);
extern bool AllowClickCastFromBag(versions::InventoryVersion inventory_version);
extern uint16 ItemAugSize(versions::InventoryVersion inventory_version);
extern uint16 ItemBagSize(versions::InventoryVersion inventory_version);
extern bool ConcatenateInvTypeLimbo(versions::InventoryVersion inventory_version);
extern bool AllowOverLevelEquipment(versions::InventoryVersion inventory_version);
} /*inventory*/
namespace profile {
extern bool CoinHasWeight(versions::InventoryVersion inventory_version);
} /*profile*/
} /*EQEmu*/
namespace ClientUnknown
{
enum : int { Invalid = -1, Null, Safety };
enum : bool { False = false, True = true };
} /*ClientUnknown*/
namespace Client62
{
enum : int { Invalid = -1, Null, Safety };
enum : bool { False = false, True = true };
} /*Client62*/
#endif /*COMMON_EQ_LIMITS_H*/
+80 -41
View File
@@ -40,11 +40,9 @@ EQPacket::EQPacket(EmuOpcode op, const unsigned char *buf, uint32 len)
: BasePacket(buf, len),
emu_opcode(op)
{
_eqp
}
void EQPacket::build_raw_header_dump(char *buffer, uint16 seq) const {
_eqp
BasePacket::build_raw_header_dump(buffer, seq);
buffer += strlen(buffer);
@@ -53,20 +51,17 @@ void EQPacket::build_raw_header_dump(char *buffer, uint16 seq) const {
void EQPacket::DumpRawHeader(uint16 seq, FILE *to) const
{
_eqp
char buff[196];
build_raw_header_dump(buff, seq);
fprintf(to, "%s", buff);
}
void EQPacket::build_header_dump(char *buffer) const {
_eqp
sprintf(buffer, "[EmuOpCode 0x%04x Size=%u]", emu_opcode, size);
}
void EQPacket::DumpRawHeaderNoTime(uint16 seq, FILE *to) const
{
_eqp
if (src_ip) {
std::string sIP,dIP;;
sIP=long2ip(src_ip);
@@ -81,7 +76,6 @@ void EQPacket::DumpRawHeaderNoTime(uint16 seq, FILE *to) const
void EQProtocolPacket::build_raw_header_dump(char *buffer, uint16 seq) const
{
_eqp
BasePacket::build_raw_header_dump(buffer, seq);
buffer += strlen(buffer);
@@ -90,7 +84,6 @@ void EQProtocolPacket::build_raw_header_dump(char *buffer, uint16 seq) const
void EQProtocolPacket::DumpRawHeader(uint16 seq, FILE *to) const
{
_eqp
char buff[196];
build_raw_header_dump(buff, seq);
fprintf(to, "%s", buff);
@@ -98,13 +91,11 @@ void EQProtocolPacket::DumpRawHeader(uint16 seq, FILE *to) const
void EQProtocolPacket::build_header_dump(char *buffer) const
{
_eqp
sprintf(buffer, "[ProtoOpCode 0x%04x Size=%u]",opcode,size);
}
void EQProtocolPacket::DumpRawHeaderNoTime(uint16 seq, FILE *to) const
{
_eqp
if (src_ip) {
std::string sIP,dIP;;
sIP=long2ip(src_ip);
@@ -119,7 +110,6 @@ void EQProtocolPacket::DumpRawHeaderNoTime(uint16 seq, FILE *to) const
void EQApplicationPacket::build_raw_header_dump(char *buffer, uint16 seq) const
{
_eqp
BasePacket::build_raw_header_dump(buffer, seq);
buffer += strlen(buffer);
@@ -132,7 +122,6 @@ void EQApplicationPacket::build_raw_header_dump(char *buffer, uint16 seq) const
void EQApplicationPacket::DumpRawHeader(uint16 seq, FILE *to) const
{
_eqp
char buff[196];
build_raw_header_dump(buff, seq);
fprintf(to, "%s", buff);
@@ -140,7 +129,6 @@ void EQApplicationPacket::DumpRawHeader(uint16 seq, FILE *to) const
void EQApplicationPacket::build_header_dump(char *buffer) const
{
_eqp
#ifdef STATIC_OPCODE
sprintf(buffer, "[OpCode 0x%04x Size=%u]\n", emu_opcode,size);
#else
@@ -150,7 +138,6 @@ void EQApplicationPacket::build_header_dump(char *buffer) const
void EQApplicationPacket::DumpRawHeaderNoTime(uint16 seq, FILE *to) const
{
_eqp
if (src_ip) {
std::string sIP,dIP;;
sIP=long2ip(src_ip);
@@ -169,7 +156,6 @@ void EQApplicationPacket::DumpRawHeaderNoTime(uint16 seq, FILE *to) const
void EQRawApplicationPacket::build_raw_header_dump(char *buffer, uint16 seq) const
{
_eqp
BasePacket::build_raw_header_dump(buffer, seq);
buffer += strlen(buffer);
@@ -182,7 +168,6 @@ void EQRawApplicationPacket::build_raw_header_dump(char *buffer, uint16 seq) con
void EQRawApplicationPacket::DumpRawHeader(uint16 seq, FILE *to) const
{
_eqp
char buff[196];
build_raw_header_dump(buff, seq);
fprintf(to, "%s", buff);
@@ -190,7 +175,6 @@ void EQRawApplicationPacket::DumpRawHeader(uint16 seq, FILE *to) const
void EQRawApplicationPacket::build_header_dump(char *buffer) const
{
_eqp
#ifdef STATIC_OPCODE
sprintf(buffer, "[OpCode 0x%04x (0x%04x) Size=%u]\n", emu_opcode, opcode,size);
#else
@@ -200,7 +184,6 @@ void EQRawApplicationPacket::build_header_dump(char *buffer) const
void EQRawApplicationPacket::DumpRawHeaderNoTime(uint16 seq, FILE *to) const
{
_eqp
if (src_ip) {
std::string sIP,dIP;;
sIP=long2ip(src_ip);
@@ -219,7 +202,6 @@ void EQRawApplicationPacket::DumpRawHeaderNoTime(uint16 seq, FILE *to) const
uint32 EQProtocolPacket::serialize(unsigned char *dest) const
{
_eqp
if (opcode>0xff) {
*(uint16 *)dest=opcode;
} else {
@@ -233,7 +215,6 @@ uint32 EQProtocolPacket::serialize(unsigned char *dest) const
uint32 EQApplicationPacket::serialize(uint16 opcode, unsigned char *dest) const
{
_eqp
uint8 OpCodeBytes = app_opcode_size;
if (app_opcode_size==1)
@@ -255,12 +236,31 @@ uint32 EQApplicationPacket::serialize(uint16 opcode, unsigned char *dest) const
return size+OpCodeBytes;
}
/*EQProtocolPacket::EQProtocolPacket(uint16 op, const unsigned char *buf, uint32 len)
: BasePacket(buf, len),
opcode(op)
{
uint32 offset;
opcode=ntohs(*(const uint16 *)buf);
offset=2;
if (len-offset) {
pBuffer= new unsigned char[len-offset];
memcpy(pBuffer,buf+offset,len-offset);
size=len-offset;
} else {
pBuffer=nullptr;
size=0;
}
OpMgr=&RawOpcodeManager;
}*/
bool EQProtocolPacket::combine(const EQProtocolPacket *rhs)
{
_eqp
bool result=false;
bool result=false;
if (opcode==OP_Combined && size+rhs->size+5<256) {
unsigned char *tmpbuffer=new unsigned char [size+rhs->size+3];
auto tmpbuffer = new unsigned char[size + rhs->size + 3];
memcpy(tmpbuffer,pBuffer,size);
uint32 offset=size;
tmpbuffer[offset++]=rhs->Size();
@@ -270,7 +270,7 @@ bool EQProtocolPacket::combine(const EQProtocolPacket *rhs)
pBuffer=tmpbuffer;
result=true;
} else if (size+rhs->size+7<256) {
unsigned char *tmpbuffer=new unsigned char [size+rhs->size+6];
auto tmpbuffer = new unsigned char[size + rhs->size + 6];
uint32 offset=0;
tmpbuffer[offset++]=Size();
offset+=serialize(tmpbuffer+offset);
@@ -284,12 +284,61 @@ bool EQProtocolPacket::combine(const EQProtocolPacket *rhs)
}
return result;
}
/*
this is the code to do app-layer combining, instead of protocol layer.
this was taken out due to complex interactions with the opcode manager,
and will require a bit more thinking (likely moving into EQStream) to
get running again... but might be a good thing some day.
bool EQApplicationPacket::combine(const EQApplicationPacket *rhs)
{
uint32 newsize=0, offset=0;
unsigned char *tmpbuffer=nullptr;
if (opcode!=OP_AppCombined) {
newsize=app_opcode_size+size+(size>254?3:1)+app_opcode_size+rhs->size+(rhs->size>254?3:1);
tmpbuffer=new unsigned char [newsize];
offset=0;
if (size>254) {
tmpbuffer[offset++]=0xff;
*(uint16 *)(tmpbuffer+offset)=htons(size);
offset+=1;
} else {
tmpbuffer[offset++]=size;
}
offset+=serialize(tmpbuffer+offset);
} else {
newsize=size+app_opcode_size+rhs->size+(rhs->size>254?3:1);
tmpbuffer=new unsigned char [newsize];
memcpy(tmpbuffer,pBuffer,size);
offset=size;
}
if (rhs->size>254) {
tmpbuffer[offset++]=0xff;
*(uint16 *)(tmpbuffer+offset)=htons(rhs->size);
offset+=1;
} else {
tmpbuffer[offset++]=rhs->size;
}
offset+=rhs->serialize(tmpbuffer+offset);
size=offset;
opcode=OP_AppCombined;
delete[] pBuffer;
pBuffer=tmpbuffer;
return true;
}
*/
bool EQProtocolPacket::ValidateCRC(const unsigned char *buffer, int length, uint32 Key)
{
_eqp
bool valid=false;
bool valid=false;
// OP_SessionRequest, OP_SessionResponse, OP_OutOfSession are not CRC'd
if (buffer[0]==0x00 && (buffer[1]==OP_SessionRequest || buffer[1]==OP_SessionResponse || buffer[1]==OP_OutOfSession)) {
valid=true;
@@ -308,9 +357,8 @@ bool EQProtocolPacket::ValidateCRC(const unsigned char *buffer, int length, uint
uint32 EQProtocolPacket::Decompress(const unsigned char *buffer, const uint32 length, unsigned char *newbuf, uint32 newbufsize)
{
_eqp
uint32 newlen=0;
uint32 flag_offset=0;
uint32 newlen=0;
uint32 flag_offset=0;
newbuf[0]=buffer[0];
if (buffer[0]==0x00) {
flag_offset=2;
@@ -334,8 +382,7 @@ uint32 EQProtocolPacket::Decompress(const unsigned char *buffer, const uint32 le
}
uint32 EQProtocolPacket::Compress(const unsigned char *buffer, const uint32 length, unsigned char *newbuf, uint32 newbufsize) {
_eqp
uint32 flag_offset=1,newlength;
uint32 flag_offset=1,newlength;
//dump_message_column(buffer,length,"Before: ");
newbuf[0]=buffer[0];
if (buffer[0]==0) {
@@ -358,7 +405,6 @@ uint32 EQProtocolPacket::Compress(const unsigned char *buffer, const uint32 leng
void EQProtocolPacket::ChatDecode(unsigned char *buffer, int size, int DecodeKey)
{
_eqp
if ((size >= 2) && buffer[1]!=0x01 && buffer[0]!=0x02 && buffer[0]!=0x1d) {
int Key=DecodeKey;
unsigned char *test=(unsigned char *)malloc(size);
@@ -384,7 +430,6 @@ void EQProtocolPacket::ChatDecode(unsigned char *buffer, int size, int DecodeKey
void EQProtocolPacket::ChatEncode(unsigned char *buffer, int size, int EncodeKey)
{
_eqp
if (buffer[1]!=0x01 && buffer[0]!=0x02 && buffer[0]!=0x1d) {
int Key=EncodeKey;
char *test=(char*)malloc(size);
@@ -408,13 +453,11 @@ void EQProtocolPacket::ChatEncode(unsigned char *buffer, int size, int EncodeKey
}
EQApplicationPacket *EQApplicationPacket::Copy() const {
_eqp
return(new EQApplicationPacket(*this));
}
EQRawApplicationPacket *EQProtocolPacket::MakeAppPacket() const {
_eqp
EQRawApplicationPacket *res = new EQRawApplicationPacket(opcode, pBuffer, size);
auto res = new EQRawApplicationPacket(opcode, pBuffer, size);
res->copyInfo(this);
return(res);
}
@@ -423,13 +466,10 @@ EQRawApplicationPacket::EQRawApplicationPacket(uint16 opcode, const unsigned cha
: EQApplicationPacket(OP_Unknown, buf, len),
opcode(opcode)
{
_eqp
}
EQRawApplicationPacket::EQRawApplicationPacket(const unsigned char *buf, const uint32 len)
: EQApplicationPacket(OP_Unknown, buf+sizeof(uint16), len-sizeof(uint16))
{
_eqp
if(GetExecutablePlatform() != ExePlatformUCS) {
opcode = *((const uint16 *) buf);
if(opcode == 0x0000)
@@ -463,17 +503,16 @@ EQRawApplicationPacket::EQRawApplicationPacket(const unsigned char *buf, const u
}
void DumpPacket(const EQApplicationPacket* app, bool iShowInfo) {
_eqp
if (iShowInfo) {
std::cout << "Dumping Applayer: 0x" << std::hex << std::setfill('0') << std::setw(4) << app->GetOpcode() << std::dec;
std::cout << " size:" << app->size << std::endl;
}
DumpPacketHex(app->pBuffer, app->size);
// DumpPacketAscii(app->pBuffer, app->size);
}
std::string DumpPacketToString(const EQApplicationPacket* app){
_eqp
std::ostringstream out;
out << DumpPacketHexToString(app->pBuffer, app->size);
return out.str();
}
}
+2 -1
View File
@@ -62,7 +62,7 @@ class EQProtocolPacket : public BasePacket {
friend class EQStream;
friend class EQStreamPair;
public:
EQProtocolPacket(uint16 op, const unsigned char *buf, uint32 len) : BasePacket(buf,len), opcode(op) { acked = false; }
EQProtocolPacket(uint16 op, const unsigned char *buf, uint32 len) : BasePacket(buf, len), opcode(op) { acked = false; sent_time = 0; }
// EQProtocolPacket(const unsigned char *buf, uint32 len);
bool combine(const EQProtocolPacket *rhs);
uint32 serialize (unsigned char *dest) const;
@@ -70,6 +70,7 @@ public:
EQRawApplicationPacket *MakeAppPacket() const;
bool acked;
uint32 sent_time;
virtual void build_raw_header_dump(char *buffer, uint16 seq=0xffff) const;
virtual void build_header_dump(char *buffer) const;
+298 -207
View File
@@ -1,5 +1,5 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2003 EQEMu Development Team (http://eqemulator.net)
Copyright (C) 2001-2016 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
@@ -15,6 +15,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef EQ_PACKET_STRUCTS_H
#define EQ_PACKET_STRUCTS_H
@@ -32,8 +33,7 @@ static const uint32 MAX_MERC_GRADES = 10;
static const uint32 MAX_MERC_STANCES = 10;
static const uint32 BLOCKED_BUFF_COUNT = 20;
//#include "eq_constants.h"
#include "eq_dictionary.h"
#include "emu_constants.h"
/*
** Compiler override to ensure
@@ -123,83 +123,81 @@ struct LDoNTrapTemplate
///////////////////////////////////////////////////////////////////////////////
/*
** Color_Struct
** Size: 4 bytes
** Used for convenience
** Merth: Gave struct a name so gcc 2.96 would compile
**
*/
// All clients translate the character select information to some degree
struct Color_Struct
{
union
{
struct
{
uint8 blue;
uint8 green;
uint8 red;
uint8 use_tint; // if there's a tint this is FF
} rgb;
uint32 color;
union {
struct {
uint8 Blue;
uint8 Green;
uint8 Red;
uint8 UseTint; // if there's a tint this is FF
} RGB;
uint32 Color;
};
};
/*
* Visible equiptment.
* Size: 20 Octets
*/
struct EquipStruct {
/*00*/ uint32 material;
/*04*/ uint32 unknown1;
/*08*/ uint32 elitematerial;
/*12*/ uint32 heroforgemodel;
/*16*/ uint32 material2; // Same as material?
/*20*/
struct EquipStruct
{
uint32 Material;
uint32 Unknown1;
uint32 EliteMaterial;
uint32 HeroForgeModel;
uint32 Material2; // Same as material?
};
struct CharSelectEquip {
uint32 material;
uint32 unknown1;
uint32 elitematerial;
uint32 heroforgemodel;
uint32 material2;
Color_Struct color;
struct CharSelectEquip
{
uint32 Material;
uint32 Unknown1;
uint32 EliteMaterial;
uint32 HeroForgeModel;
uint32 Material2;
Color_Struct Color;
};
/*
** Character Selection Struct
** Length: 1704 Bytes
**
*/
struct CharacterSelect_Struct {
/*0000*/ uint32 race[10]; // Characters Race
/*0040*/ //Color_Struct cs_colors[10][9]; // Characters Equipment Colors
/*0400*/ uint8 beardcolor[10]; // Characters beard Color
/*0410*/ uint8 hairstyle[10]; // Characters hair style
/*0420*/ //uint32 equip[10][9]; // 0=helm, 1=chest, 2=arm, 3=bracer, 4=hand, 5=leg, 6=boot, 7=melee1, 8=melee2 (Might not be)
/*0000*/ CharSelectEquip equip[10][9];
/*0780*/ uint32 secondary[10]; // Characters secondary IDFile number
/*0820*/ uint32 drakkin_heritage[10]; // added for SoF
/*0860*/ uint32 drakkin_tattoo[10]; // added for SoF
/*0900*/ uint32 drakkin_details[10]; // added for SoF
/*0940*/ uint32 deity[10]; // Characters Deity
/*0980*/ uint8 gohome[10]; // 1=Go Home available, 0=not
/*0990*/ uint8 tutorial[10]; // 1=Tutorial available, 0=not
/*1000*/ uint8 beard[10]; // Characters Beard Type
/*1010*/ uint8 unknown902[10]; // 10x ff
/*1020*/ uint32 primary[10]; // Characters primary IDFile number
/*1060*/ uint8 haircolor[10]; // Characters Hair Color
/*1070*/ uint8 unknown0962[2]; // 2x 00
/*1072*/ uint32 zone[10]; // Characters Current Zone
/*1112*/ uint8 class_[10]; // Characters Classes
/*1022*/ uint8 face[10]; // Characters Face Type
/*1032*/ char name[10][64]; // Characters Names
/*1672*/ uint8 gender[10]; // Characters Gender
/*1682*/ uint8 eyecolor1[10]; // Characters Eye Color
/*1692*/ uint8 eyecolor2[10]; // Characters Eye 2 Color
/*1702*/ uint8 level[10]; // Characters Levels
/*1712*/
// RoF2-based hybrid struct
struct CharacterSelectEntry_Struct
{
char Name[64];
uint8 Class;
uint32 Race;
uint8 Level;
uint8 ShroudClass;
uint32 ShroudRace;
uint16 Zone;
uint16 Instance;
uint8 Gender;
uint8 Face;
CharSelectEquip Equip[9];
uint8 Unknown15; // Seen FF
uint8 Unknown19; // Seen FF
uint32 DrakkinTattoo;
uint32 DrakkinDetails;
uint32 Deity;
uint32 PrimaryIDFile;
uint32 SecondaryIDFile;
uint8 HairColor;
uint8 BeardColor;
uint8 EyeColor1;
uint8 EyeColor2;
uint8 HairStyle;
uint8 Beard;
uint8 GoHome; // Seen 0 for new char and 1 for existing
uint8 Tutorial; // Seen 1 for new char or 0 for existing
uint32 DrakkinHeritage;
uint8 Unknown1; // Seen 0
uint8 Enabled; // Originally labeled as 'CharEnabled' - unknown purpose and setting
uint32 LastLogin;
uint8 Unknown2; // Seen 0
};
struct CharacterSelect_Struct
{
uint32 CharCount; //number of chars in this packet
uint32 TotalChars; //total number of chars allowed?
CharacterSelectEntry_Struct Entries[0];
};
/*
@@ -274,7 +272,8 @@ struct Spawn_Struct {
/*0146*/ uint8 beard; // Beard style (not totally, sure but maybe!)
/*0147*/ uint8 unknown0147[4];
/*0151*/ uint8 level; // Spawn Level
/*0152*/ uint8 unknown0259[4]; // ***Placeholder
// None = 0, Open = 1, WeaponSheathed = 2, Aggressive = 4, ForcedAggressive = 8, InstrumentEquipped = 16, Stunned = 32, PrimaryWeaponEquipped = 64, SecondaryWeaponEquipped = 128
/*0152*/ uint32 PlayerState; // Controls animation stuff
/*0156*/ uint8 beardcolor; // Beard color
/*0157*/ char suffix[32]; // Player's suffix (of Veeshan, etc.)
/*0189*/ uint32 petOwnerId; // If this is a pet, the spawn id of owner
@@ -294,7 +293,7 @@ struct Spawn_Struct {
/*0000*/ EquipStruct equip_primary; // Equipment: Main visual
/*0000*/ EquipStruct equip_secondary; // Equipment: Off visual
} equip;
/*0000*/ EquipStruct equipment[_MaterialCount];
/*0000*/ EquipStruct equipment[EQEmu::legacy::MaterialCount];
};
/*0233*/ float runspeed; // Speed when running
/*0036*/ uint8 afk; // 0=no, 1=afk
@@ -340,7 +339,7 @@ union
/*0376*/ Color_Struct color_primary; // Color of primary item
/*0380*/ Color_Struct color_secondary; // Color of secondary item
} equipment_colors;
/*0348*/ Color_Struct colors[_MaterialCount]; // Array elements correspond to struct equipment_colors above
/*0348*/ Color_Struct colors[EQEmu::legacy::MaterialCount]; // Array elements correspond to struct equipment_colors above
};
/*0384*/ uint8 lfg; // 0=off, 1=lfg on
/*0385*/
@@ -367,6 +366,11 @@ union
};
struct PlayerState_Struct {
/*00*/ uint32 spawn_id;
/*04*/ uint32 state;
};
/*
** New Spawn
** Length: 176 Bytes
@@ -548,7 +552,7 @@ struct SpellBuff_Struct
/*002*/ uint8 bard_modifier;
/*003*/ uint8 effect; //not real
/*004*/ uint32 spellid;
/*008*/ uint32 duration;
/*008*/ int32 duration;
/*012*/ uint32 counters;
/*016*/ uint32 player_id; //'global' ID of the caster, for wearoff messages
/*020*/
@@ -561,7 +565,7 @@ struct SpellBuffFade_Struct {
/*006*/ uint8 effect;
/*007*/ uint8 unknown7;
/*008*/ uint32 spellid;
/*012*/ uint32 duration;
/*012*/ int32 duration;
/*016*/ uint32 num_hits;
/*020*/ uint32 unknown020; //prolly global player ID
/*024*/ uint32 slotid;
@@ -579,14 +583,8 @@ struct BuffRemoveRequest_Struct
struct PetBuff_Struct {
/*000*/ uint32 petid;
/*004*/ uint32 spellid[BUFF_COUNT];
/*104*/ uint32 unknown700;
/*108*/ uint32 unknown701;
/*112*/ uint32 unknown702;
/*116*/ uint32 unknown703;
/*120*/ uint32 unknown704;
/*124*/ uint32 ticsremaining[BUFF_COUNT];
/*224*/ uchar unknown705[20];
/*004*/ uint32 spellid[BUFF_COUNT+5];
/*124*/ int32 ticsremaining[BUFF_COUNT+5];
/*244*/ uint32 buffcount;
};
@@ -727,6 +725,7 @@ struct AA_Array
{
uint32 AA;
uint32 value;
uint32 charges;
};
@@ -756,29 +755,46 @@ struct Tribute_Struct {
uint32 tier;
};
//len = 72
struct BandolierItem_Struct {
uint32 item_id;
uint32 icon;
char item_name[64];
};
//len = 320
enum { //bandolier item positions
bandolierMainHand = 0,
bandolierOffHand,
// Bandolier item positions
enum
{
bandolierPrimary = 0,
bandolierSecondary,
bandolierRange,
bandolierAmmo
};
struct Bandolier_Struct {
char name[32];
BandolierItem_Struct items[EmuConstants::BANDOLIER_SIZE];
};
struct PotionBelt_Struct {
BandolierItem_Struct items[EmuConstants::POTION_BELT_SIZE];
//len = 72
struct BandolierItem_Struct
{
uint32 ID;
uint32 Icon;
char Name[64];
};
struct MovePotionToBelt_Struct {
//len = 320
struct Bandolier_Struct
{
char Name[32];
BandolierItem_Struct Items[EQEmu::legacy::BANDOLIER_ITEM_COUNT];
};
//len = 72
struct PotionBeltItem_Struct
{
uint32 ID;
uint32 Icon;
char Name[64];
};
//len = 288
struct PotionBelt_Struct
{
PotionBeltItem_Struct Items[EQEmu::legacy::POTION_BELT_ITEM_COUNT];
};
struct MovePotionToBelt_Struct
{
uint32 Action;
uint32 SlotNumber;
uint32 ItemID;
@@ -865,7 +881,7 @@ struct SuspendedMinion_Struct
/*002*/ uint32 HP;
/*006*/ uint32 Mana;
/*010*/ SpellBuff_Struct Buffs[BUFF_COUNT];
/*510*/ uint32 Items[_MaterialCount];
/*510*/ uint32 Items[EQEmu::legacy::MaterialCount];
/*546*/ char Name[64];
/*610*/
};
@@ -973,9 +989,9 @@ struct PlayerProfile_Struct
/*0304*/ uint8 ability_time_minutes;
/*0305*/ uint8 ability_time_hours; //place holder
/*0306*/ uint8 unknown0306[6]; // @bp Spacer/Flag?
/*0312*/ uint32 item_material[_MaterialCount]; // Item texture/material of worn/held items
/*0312*/ uint32 item_material[EQEmu::legacy::MaterialCount]; // Item texture/material of worn/held items
/*0348*/ uint8 unknown0348[44];
/*0392*/ Color_Struct item_tint[_MaterialCount];
/*0392*/ Color_Struct item_tint[EQEmu::legacy::MaterialCount];
/*0428*/ AA_Array aa_array[MAX_PP_AA_ARRAY];
/*2348*/ float unknown2384; //seen ~128, ~47
/*2352*/ char servername[32]; // length probably not right
@@ -1076,7 +1092,7 @@ struct PlayerProfile_Struct
/*7212*/ uint32 tribute_points;
/*7216*/ uint32 unknown7252;
/*7220*/ uint32 tribute_active; //1=active
/*7224*/ Tribute_Struct tributes[EmuConstants::TRIBUTE_SIZE];
/*7224*/ Tribute_Struct tributes[EQEmu::legacy::TRIBUTE_SIZE];
/*7264*/ Disciplines_Struct disciplines;
/*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use)
/*7744*/ char unknown7780[160];
@@ -1103,7 +1119,7 @@ struct PlayerProfile_Struct
/*12800*/ uint32 expAA;
/*12804*/ uint32 aapoints; //avaliable, unspent
/*12808*/ uint8 unknown12844[36];
/*12844*/ Bandolier_Struct bandoliers[EmuConstants::BANDOLIERS_COUNT];
/*12844*/ Bandolier_Struct bandoliers[EQEmu::legacy::BANDOLIERS_SIZE];
/*14124*/ uint8 unknown14160[4506];
/*18630*/ SuspendedMinion_Struct SuspendedMinion; // No longer in use
/*19240*/ uint32 timeentitledonaccount;
@@ -1144,7 +1160,7 @@ struct TargetReject_Struct {
struct PetCommand_Struct {
/*000*/ uint32 command;
/*004*/ uint32 unknown;
/*004*/ uint32 target;
};
/*
@@ -1249,7 +1265,7 @@ struct ZoneChange_Struct {
// Whatever you send to the client in RequestClientZoneChange_Struct.type, the client will send back
// to the server in ZoneChange_Struct.zone_reason. My guess is this is a memo field of sorts.
// WildcardX 27 January 2008
// 27 January 2008
struct RequestClientZoneChange_Struct {
/*00*/ uint16 zone_id;
@@ -1263,8 +1279,8 @@ struct RequestClientZoneChange_Struct {
struct Animation_Struct {
/*00*/ uint16 spawnid;
/*02*/ uint8 action;
/*03*/ uint8 value;
/*02*/ uint8 speed;
/*03*/ uint8 action;
/*04*/
};
@@ -1302,10 +1318,10 @@ struct CombatDamage_Struct
/* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells
/* 05 */ uint16 spellid;
/* 07 */ uint32 damage;
/* 11 */ uint32 unknown11;
/* 15 */ uint32 sequence; // see above notes in Action_Struct
/* 19 */ uint32 unknown19;
/* 23 */
/* 11 */ float force;
/* 15 */ float meleepush_xy; // see above notes in Action_Struct
/* 19 */ float meleepush_z;
/* 23 */ uint32 special; // 2 = Rampage, 1 = Wild Rampage
};
/*
@@ -1501,17 +1517,38 @@ struct ExpUpdate_Struct
enum ItemPacketType
{
ItemPacketViewLink = 0x00,
ItemPacketMerchant = 0x64,
ItemPacketTradeView = 0x65,
ItemPacketLoot = 0x66,
ItemPacketTrade = 0x67,
ItemPacketCharInventory = 0x69,
ItemPacketSummonItem = 0x6A,
ItemPacketTributeItem = 0x6C,
ItemPacketMerchant = 0x64,
ItemPacketWorldContainer = 0x6B,
ItemPacketCharmUpdate = 0x6E,
ItemPacketTributeItem = 0x6C,
ItemPacketGuildTribute = 0x6D,
ItemPacketCharmUpdate = 0x6E, // noted as incorrect
ItemPacketInvalid = 0xFF
};
//enum ItemPacketType
//{
// ItemPacketMerchant = /*100*/ 0x64, // Titanium+
// ItemPacketTradeView = /*101*/ 0x65,
// ItemPacketLoot = /*102*/ 0x66,
// ItemPacketTrade = /*103*/ 0x67,
// ItemPacketCharInventory = /*105*/ 0x69,
// ItemPacketLimbo = /*106*/ 0x6A, // name change
// ItemPacketWorldContainer = /*107*/ 0x6B,
// ItemPacketTributeItem = /*108*/ 0x6C,
// ItemPacketGuildTribute = /*109*/ 0x6D, // missing from EQEmu
// ItemPacket10 = /*110*/ 0x6E,
// ItemPacket11 = /*111*/ 0x6F, // UF+ (equipment slots only) (RoF+ checks '(WORD*)slot + 4 != -1' [(WORD*)]slot + 2 would be bag index - if used) (guess)
// ItemPacket12 = /*112*/ 0x70, // RoF+ (causes stat update) (could be TrophyTribute and GuildTrophyTribute together - two case methodology - is it checking for GuildID?)
// ItemPacketRecovery = /*113*/ 0x71, (same handler as merchant..exception: parameter is '1' versus merchant '0' looks like tab id)
// ItemPacket14 = /*115*/ 0x73, (real estate/moving crate?)
// ItemPacket__ = /*xxx*/ 0xXX // switch 'default' - all clients
//};
struct ItemPacket_Struct
{
/*00*/ ItemPacketType PacketType;
@@ -2082,7 +2119,7 @@ struct AdventureLeaderboard_Struct
/*struct Item_Shop_Struct {
uint16 merchantid;
uint8 itemtype;
Item_Struct item;
EQEmu::Item_Struct item;
uint8 iss_unknown001[6];
};*/
@@ -2108,7 +2145,7 @@ struct Illusion_Struct { //size: 256 - SoF
/*092*/ uint32 drakkin_heritage; //
/*096*/ uint32 drakkin_tattoo; //
/*100*/ uint32 drakkin_details; //
/*104*/ uint32 armor_tint[_MaterialCount]; //
/*104*/ uint32 armor_tint[EQEmu::legacy::MaterialCount]; //
/*140*/ uint8 eyecolor1; // Field Not Identified in any Illusion Struct
/*141*/ uint8 eyecolor2; // Field Not Identified in any Illusion Struct
/*142*/ uint8 unknown138[114]; //
@@ -2132,24 +2169,24 @@ struct Illusion_Struct_Old {
// OP_Sound - Size: 68
struct QuestReward_Struct
{
/*000*/ uint32 from_mob; // ID of mob awarding the client
/*004*/ uint32 unknown004;
/*008*/ uint32 unknown008;
/*012*/ uint32 unknown012;
/*016*/ uint32 unknown016;
/*020*/ uint32 unknown020;
/*024*/ uint32 silver; // Gives silver to the client
/*028*/ uint32 gold; // Gives gold to the client
/*032*/ uint32 platinum; // Gives platinum to the client
/*036*/ uint32 unknown036;
/*040*/ uint32 unknown040;
/*044*/ uint32 unknown044;
/*048*/ uint32 unknown048;
/*052*/ uint32 unknown052;
/*056*/ uint32 unknown056;
/*060*/ uint32 unknown060;
/*064*/ uint32 unknown064;
/*068*/
/*000*/ uint32 mob_id; // ID of mob awarding the client
/*004*/ uint32 target_id;
/*008*/ uint32 exp_reward;
/*012*/ uint32 faction;
/*016*/ int32 faction_mod;
/*020*/ uint32 copper; // Gives copper to the client
/*024*/ uint32 silver; // Gives silver to the client
/*028*/ uint32 gold; // Gives gold to the client
/*032*/ uint32 platinum; // Gives platinum to the client
/*036*/ uint32 item_id;
/*040*/ uint32 unknown040;
/*044*/ uint32 unknown044;
/*048*/ uint32 unknown048;
/*052*/ uint32 unknown052;
/*056*/ uint32 unknown056;
/*060*/ uint32 unknown060;
/*064*/ uint32 unknown064;
/*068*/
};
// Size: 8
@@ -2405,11 +2442,11 @@ struct InspectResponse_Struct {
/*004*/ uint32 playerid;
/*008*/ char itemnames[23][64];
/*1480*/uint32 itemicons[23];
/*1572*/char text[288]; // Max number of chars in Inspect Window appears to be 254 // Msg struct property is 256 (254 + '\0' is my guess) -U
/*1572*/char text[288]; // Max number of chars in Inspect Window appears to be 254 // Msg struct property is 256 (254 + '\0' is my guess)
/*1860*/
};
//OP_InspectMessageUpdate - Size: 256 (SoF+ clients after self-inspect window is closed) -U
//OP_InspectMessageUpdate - Size: 256 (SoF+ clients after self-inspect window is closed)
struct InspectMessage_Struct {
/*000*/ char text[256];
/*256*/
@@ -2518,9 +2555,9 @@ struct BookRequest_Struct {
**
*/
struct Object_Struct {
/*00*/ uint32 linked_list_addr[2];// <Zaphod> They are, get this, prev and next, ala linked list
/*08*/ uint16 unknown008; //
/*10*/ uint16 unknown010; //
/*00*/ uint32 linked_list_addr[2];// They are, get this, prev and next, ala linked list
/*08*/ uint16 size; //
/*10*/ uint16 solidtype; //
/*12*/ uint32 drop_id; // Unique object id for zone
/*16*/ uint16 zone_id; // Redudant, but: Zone the object appears in
/*18*/ uint16 zone_instance; //
@@ -2537,8 +2574,8 @@ struct Object_Struct {
/*88*/ uint32 spawn_id; // Spawn Id of client interacting with object
/*92*/
};
//<Zaphod> 01 = generic drop, 02 = armor, 19 = weapon
//[13:40] <Zaphod> and 0xff seems to be indicative of the tradeskill/openable items that end up returning the old style item type in the OP_OpenObject
// 01 = generic drop, 02 = armor, 19 = weapon
//[13:40] and 0xff seems to be indicative of the tradeskill/openable items that end up returning the old style item type in the OP_OpenObject
/*
** Click Object Struct
@@ -2595,7 +2632,7 @@ struct CloseContainer_Struct {
*/
struct Door_Struct
{
/*0000*/ char name[32]; // Filename of Door // Was 10char long before... added the 6 in the next unknown to it: Daeken M. BlackBlade //changed both to 32: Trevius
/*0000*/ char name[32]; // Filename of Door // Was 10char long before... added the 6 in the next unknown to it //changed both to 32
/*0032*/ float yPos; // y loc
/*0036*/ float xPos; // x loc
/*0040*/ float zPos; // z loc
@@ -2761,7 +2798,8 @@ struct BazaarWelcome_Struct {
BazaarWindowStart_Struct Beginning;
uint32 Traders;
uint32 Items;
uint8 Unknown012[8];
uint32 Unknown012;
uint32 Unknown016;
};
struct BazaarSearch_Struct {
@@ -3146,6 +3184,7 @@ struct Trader_ShowItems_Struct{
/*000*/ uint32 Code;
/*004*/ uint32 TraderID;
/*008*/ uint32 Unknown08[3];
/*020*/
};
struct TraderBuy_Struct{
@@ -3191,9 +3230,10 @@ struct TraderDelItem_Struct{
struct TraderClick_Struct{
/*000*/ uint32 TraderID;
/*004*/ uint32 Unknown004;
/*004*/ uint32 Code;
/*008*/ uint32 Unknown008;
/*012*/ uint32 Approval;
/*016*/
};
struct FormattedMessage_Struct{
@@ -3392,7 +3432,7 @@ struct DyeStruct
struct Color_Struct secondary; // or this
}
dyes;
struct Color_Struct dye[_MaterialCount];
struct Color_Struct dye[EQEmu::legacy::MaterialCount];
};
};
@@ -3453,8 +3493,8 @@ struct SelectTributeReply_Struct {
struct TributeInfo_Struct {
uint32 active; //0 == inactive, 1 == active
uint32 tributes[EmuConstants::TRIBUTE_SIZE]; //-1 == NONE
uint32 tiers[EmuConstants::TRIBUTE_SIZE]; //all 00's
uint32 tributes[EQEmu::legacy::TRIBUTE_SIZE]; //-1 == NONE
uint32 tiers[EQEmu::legacy::TRIBUTE_SIZE]; //all 00's
uint32 tribute_master_id;
};
@@ -4011,7 +4051,7 @@ struct MarkNPC_Struct
struct InspectBuffs_Struct {
/*000*/ uint32 spell_id[BUFF_COUNT];
/*100*/ uint32 tics_remaining[BUFF_COUNT];
/*100*/ int32 tics_remaining[BUFF_COUNT];
};
struct RaidGeneral_Struct {
@@ -4104,30 +4144,35 @@ struct DynamicWall_Struct {
/*80*/
};
enum { //bandolier actions
BandolierCreate = 0,
BandolierRemove = 1,
BandolierSet = 2
// Bandolier actions
enum
{
bandolierCreate = 0,
bandolierRemove,
bandolierSet
};
struct BandolierCreate_Struct {
/*00*/ uint32 action; //0 for create
/*04*/ uint8 number;
/*05*/ char name[32];
/*37*/ uint16 unknown37; //seen 0x93FD
/*39*/ uint8 unknown39; //0
struct BandolierCreate_Struct
{
/*00*/ uint32 Action; //0 for create
/*04*/ uint8 Number;
/*05*/ char Name[32];
/*37*/ uint16 Unknown37; //seen 0x93FD
/*39*/ uint8 Unknown39; //0
};
struct BandolierDelete_Struct {
/*00*/ uint32 action;
/*04*/ uint8 number;
/*05*/ uint8 unknown05[35];
struct BandolierDelete_Struct
{
/*00*/ uint32 Action;
/*04*/ uint8 Number;
/*05*/ uint8 Unknown05[35];
};
struct BandolierSet_Struct {
/*00*/ uint32 action;
/*04*/ uint8 number;
/*05*/ uint8 unknown05[35];
struct BandolierSet_Struct
{
/*00*/ uint32 Action;
/*04*/ uint8 Number;
/*05*/ uint8 Unknown05[35];
};
struct Arrow_Struct {
@@ -4194,6 +4239,52 @@ struct UseAA_Struct {
uint32 end;
};
//new AA stuff
//reference only
struct AARankInfo_Struct
{
uint32 id;
int32 upper_hotkey_sid;
int32 lower_hotkey_sid;
int32 title_sid;
int32 desc_sid;
int32 level_req;
int32 cost;
uint32 seq;
uint32 current_level;
uint32 type;
int32 spell;
int32 spell_type;
int32 spell_refresh;
int32 classes;
int32 max_level;
int32 prev_id;
int32 next_id;
int32 total_cost;
int32 expansion;
int32 category;
uint32 charges;
uint8 grant_only;
uint32 total_effects;
uint32 total_prereqs;
};
struct AARankPrereq_Struct
{
int32 aa_id;
int32 points;
};
struct AARankEffect_Struct
{
int32 effect_id;
int32 base1;
int32 base2;
int32 slot;
};
//old AA stuff
struct AA_Ability {
/*00*/ uint32 skill_id;
/*04*/ uint32 base1;
@@ -4248,18 +4339,10 @@ struct SendAA_Struct {
struct AA_Action {
/*00*/ uint32 action;
/*04*/ uint32 ability;
/*08*/ uint32 unknown08;
/*08*/ uint32 target_id;
/*12*/ uint32 exp_value;
};
struct AA_Skills { //this should be removed and changed to AA_Array
/*00*/ uint32 aa_skill; // Total AAs Spent
/*04*/ uint32 aa_value;
/*08*/ uint32 unknown08;
/*12*/
};
struct AAExpUpdate_Struct {
/*00*/ uint32 unknown00; //seems to be a value from AA_Action.ability
/*04*/ uint32 aapoints_unspent;
@@ -4277,12 +4360,12 @@ struct AltAdvStats_Struct {
};
struct PlayerAA_Struct { // Is this still used?
AA_Skills aa_list[MAX_PP_AA_ARRAY];
AA_Array aa_list[MAX_PP_AA_ARRAY];
};
struct AATable_Struct {
/*00*/ int32 aa_spent; // Total AAs Spent
/*04*/ AA_Skills aa_list[MAX_PP_AA_ARRAY];
/*04*/ AA_Array aa_list[MAX_PP_AA_ARRAY];
};
struct Weather_Struct {
@@ -4530,19 +4613,12 @@ struct InternalVeteranReward
/*012*/ InternalVeteranRewardItem items[8];
};
struct VeteranClaimReply
struct VeteranClaim
{
/*000*/ char name[64];
/*064*/ uint32 claim_id;
/*068*/ uint32 reject_field;
/*072*/ uint32 unknown072;
};
struct VeteranClaimRequest
{
/*000*/ char name_data[64]; //name + other data
/*000*/ char name[64]; //name + other data
/*064*/ uint32 claim_id;
/*068*/ uint32 unknown068;
/*072*/ uint32 action;
};
struct GMSearchCorpse_Struct
@@ -4668,6 +4744,22 @@ struct GuildBankItemUpdate_Struct
/*226*/ uint16 Unknown226;
};
// newer clients (RoF+) send a list that contains 240 entries
// The packets don't actually use all 64 chars in the strings, but we'll just overallocate for these
struct GuildBankItemListEntry_Struct
{
uint8 vaild;
uint32 permissions;
char whofor[64];
char donator[64];
uint32 item_id;
uint32 item_icon;
uint32 quantity;
uint8 allow_merge; // 1 here for non-full stacks
uint8 usable;
char item_name[64];
};
struct GuildBankClear_Struct
{
/*00*/ uint32 Action;
@@ -4714,7 +4806,7 @@ struct BuffIconEntry_Struct
{
uint32 buff_slot;
uint32 spell_id;
uint32 tics_remaining;
int32 tics_remaining;
uint32 num_hits;
};
@@ -4723,6 +4815,8 @@ struct BuffIcon_Struct
uint32 entity_id;
uint8 all_buffs;
uint16 count;
uint8 type; // 0 = self buff window, 1 = self target window, 4 = group, 5 = PC, 7 = NPC
int32 tic_timer;
BuffIconEntry_Struct entries[0];
};
@@ -5269,21 +5363,18 @@ struct ClientMarqueeMessage_Struct {
typedef std::list<ServerLootItem_Struct*> ItemList;
struct TextLinkBody_Struct {
// Current server mask: EQClientRoF2
uint8 unknown_1; /* %1X */
uint32 item_id; /* %05X */
uint32 augment_1; /* %05X */
uint32 augment_2; /* %05X */
uint32 augment_3; /* %05X */
uint32 augment_4; /* %05X */
uint32 augment_5; /* %05X */
uint32 augment_6; /* %05X */
uint8 is_evolving; /* %1X */
uint32 evolve_group; /* %05X */
uint8 evolve_level; /* %02X */
uint32 ornament_icon; /* %05X */
int hash; /* %08X */
struct fling_struct {
/* 00 */ uint32 collision; // 0 collision is off, anything else it's on
/* 04 */ int32 travel_time; // ms -- UF we need to calc this, RoF+ -1 auto calcs
/* 08 */ uint8 unk3; // bool, set to 1 has something to do with z-axis or something weird things happen if the new Z is above or equal to yours
/* 09 */ uint8 disable_fall_damage; // 1 you take no fall damage, 0 you take fall damage
/* 10 */ uint8 padding[2];
/* 12 */ float speed_z;
/* 16 */ float new_y;
/* 20 */ float new_x;
/* 24 */ float new_z;
/* 28 */
};
// Restore structure packing to default
+146 -200
View File
@@ -50,7 +50,6 @@
uint16 EQStream::MaxWindowSize=2048;
void EQStream::init(bool resetSession) {
_eqp
// we only reset these statistics if it is a 'new' connection
if ( resetSession )
{
@@ -73,8 +72,10 @@ void EQStream::init(bool resetSession) {
RateThreshold=RATEBASE/250;
DecayRate=DECAYBASE/250;
BytesWritten=0;
sent_packet_count = 0;
received_packet_count = 0;
SequencedBase = 0;
NextSequencedSend = 0;
AverageDelta = 500;
if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) {
retransmittimer = Timer::GetCurrentTime();
@@ -85,15 +86,10 @@ void EQStream::init(bool resetSession) {
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
Log.Out(Logs::Detail, Logs::Netcode, _L "init Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
}
if(NextSequencedSend > SequencedQueue.size()) {
Log.Out(Logs::Detail, Logs::Netcode, _L "init Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
}
}
EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p)
{
_eqp
EQRawApplicationPacket *ap=nullptr;
Log.Out(Logs::Detail, Logs::Netcode, _L "Creating new application packet, length %d" __L, p->size);
// _raw(NET__APP_CREATE_HEX, 0xFFFF, p);
@@ -103,7 +99,6 @@ EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p)
EQRawApplicationPacket *EQStream::MakeApplicationPacket(const unsigned char *buf, uint32 len)
{
_eqp
EQRawApplicationPacket *ap=nullptr;
Log.Out(Logs::Detail, Logs::Netcode, _L "Creating new application packet, length %d" __L, len);
ap = new EQRawApplicationPacket(buf, len);
@@ -111,7 +106,6 @@ EQRawApplicationPacket *EQStream::MakeApplicationPacket(const unsigned char *buf
}
EQProtocolPacket *EQStream::MakeProtocolPacket(const unsigned char *buf, uint32 len) {
_eqp
uint16 proto_opcode = ntohs(*(const uint16 *)buf);
//advance over opcode.
@@ -123,7 +117,6 @@ EQProtocolPacket *EQStream::MakeProtocolPacket(const unsigned char *buf, uint32
void EQStream::ProcessPacket(EQProtocolPacket *p)
{
_eqp
uint32 processed=0, subpacket_length=0;
if (p == nullptr)
return;
@@ -295,10 +288,8 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
}
break;
case OP_KeepAlive: {
#ifndef COLLECTOR
NonSequencedPush(new EQProtocolPacket(p->opcode,p->pBuffer,p->size));
Log.Out(Logs::Detail, Logs::Netcode, _L "Received and queued reply to keep alive" __L);
#endif
}
break;
case OP_Ack: {
@@ -307,14 +298,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_Ack that was of malformed size" __L);
break;
}
#ifndef COLLECTOR
uint16 seq=ntohs(*(uint16 *)(p->pBuffer));
AckPackets(seq);
if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) {
retransmittimer = Timer::GetCurrentTime();
}
#endif
}
break;
case OP_SessionRequest: {
@@ -323,7 +312,6 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_SessionRequest that was of malformed size" __L);
break;
}
#ifndef COLLECTOR
if (GetState()==ESTABLISHED) {
Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_SessionRequest in ESTABLISHED state (%d) streamactive (%i) attempt (%i)" __L, GetState(),streamactive,sessionAttempts);
@@ -336,7 +324,6 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
break;
}
}
#endif
sessionAttempts++;
// we set established below, so statistics will not be reset for session attempts/stream active.
init(GetState()!=ESTABLISHED);
@@ -346,10 +333,8 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
SetMaxLen(ntohl(Request->MaxLength));
Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_SessionRequest: session %lu, maxlen %d" __L, (unsigned long)Session, MaxLen);
SetState(ESTABLISHED);
#ifndef COLLECTOR
Key=0x11223344;
SendSessionResponse();
#endif
}
break;
case OP_SessionResponse: {
@@ -415,7 +400,6 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_OutOfOrderAck that was of malformed size" __L);
break;
}
#ifndef COLLECTOR
uint16 seq=ntohs(*(uint16 *)(p->pBuffer));
MOutboundQueue.lock();
@@ -423,36 +407,30 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
Log.Out(Logs::Detail, Logs::Netcode, _L "Pre-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
}
if(NextSequencedSend > SequencedQueue.size()) {
Log.Out(Logs::Detail, Logs::Netcode, _L "Pre-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
}
//if the packet they got out of order is between our last acked packet and the last sent packet, then its valid.
if (CompareSequence(SequencedBase,seq) != SeqPast && CompareSequence(NextOutSeq,seq) == SeqPast) {
Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_OutOfOrderAck for sequence %d, starting retransmit at the start of our unacked buffer (seq %d, was %d)." __L,
seq, SequencedBase, SequencedBase+NextSequencedSend);
seq, SequencedBase, SequencedBase+SequencedQueue.size());
bool retransmit_acked_packets = false;
if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) {
retransmit_acked_packets = RETRANSMIT_ACKED_PACKETS;
}
if(!retransmit_acked_packets) {
uint16 sqsize = SequencedQueue.size();
uint16 index = seq - SequencedBase;
Log.Out(Logs::Detail, Logs::Netcode, _L "OP_OutOfOrderAck marking packet acked in queue (queue index = %d, queue size = %d)." __L, index, sqsize);
if (index < sqsize) {
std::deque<EQProtocolPacket *>::iterator sitr;
sitr = SequencedQueue.begin();
sitr += index;
(*sitr)->acked = true;
uint16 sqsize = SequencedQueue.size();
uint16 index = seq - SequencedBase;
Log.Out(Logs::Detail, Logs::Netcode, _L "OP_OutOfOrderAck marking packet acked in queue (queue index = %d, queue size = %d)." __L, index, sqsize);
if (index < sqsize) {
SequencedQueue[index]->acked = true;
// flag packets for a resend
uint16 count = 0;
uint32 timeout = AverageDelta * 2 + 100;
for (auto sitr = SequencedQueue.begin(); sitr != SequencedQueue.end() && count < index; ++sitr, ++count) {
if (!(*sitr)->acked && (*sitr)->sent_time > 0 && (((*sitr)->sent_time + timeout) < Timer::GetCurrentTime())) {
(*sitr)->sent_time = 0;
Log.Out(Logs::Detail, Logs::Netcode, _L "OP_OutOfOrderAck Flagging packet %d for retransmission" __L, SequencedBase + count);
}
}
}
if(RETRANSMIT_TIMEOUT_MULT) {
retransmittimer = Timer::GetCurrentTime();
}
NextSequencedSend = 0;
} else {
Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_OutOfOrderAck for out-of-window %d. Window (%d->%d)." __L, seq, SequencedBase, NextOutSeq);
}
@@ -461,46 +439,49 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
Log.Out(Logs::Detail, Logs::Netcode, _L "Post-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
}
if(NextSequencedSend > SequencedQueue.size()) {
Log.Out(Logs::Detail, Logs::Netcode, _L "Post-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
}
MOutboundQueue.unlock();
#endif
}
break;
case OP_SessionStatRequest: {
if(p->Size() < sizeof(SessionStats))
if(p->Size() < sizeof(ClientSessionStats))
{
Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_SessionStatRequest that was of malformed size" __L);
break;
}
#ifndef COLLECTOR
SessionStats *Stats=(SessionStats *)p->pBuffer;
ClientSessionStats *ClientStats=(ClientSessionStats *)p->pBuffer;
Log.Out(Logs::Detail, Logs::Netcode, _L "Received Stats: %lu packets received, %lu packets sent, Deltas: local %lu, (%lu <- %lu -> %lu) remote %lu" __L,
(unsigned long)ntohl(Stats->packets_received), (unsigned long)ntohl(Stats->packets_sent), (unsigned long)ntohl(Stats->last_local_delta),
(unsigned long)ntohl(Stats->low_delta), (unsigned long)ntohl(Stats->average_delta),
(unsigned long)ntohl(Stats->high_delta), (unsigned long)ntohl(Stats->last_remote_delta));
uint64 x=Stats->packets_received;
Stats->packets_received=Stats->packets_sent;
Stats->packets_sent=x;
NonSequencedPush(new EQProtocolPacket(OP_SessionStatResponse,p->pBuffer,p->size));
AdjustRates(ntohl(Stats->average_delta));
(unsigned long)ntohl(ClientStats->packets_received), (unsigned long)ntohl(ClientStats->packets_sent), (unsigned long)ntohl(ClientStats->last_local_delta),
(unsigned long)ntohl(ClientStats->low_delta), (unsigned long)ntohl(ClientStats->average_delta),
(unsigned long)ntohl(ClientStats->high_delta), (unsigned long)ntohl(ClientStats->last_remote_delta));
AdjustRates(ntohl(ClientStats->average_delta));
if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) {
if(RETRANSMIT_TIMEOUT_MULT && ntohl(Stats->average_delta)) {
if (RETRANSMIT_TIMEOUT_MULT && ntohl(ClientStats->average_delta)) {
//recalculate retransmittimeout using the larger of the last rtt or average rtt, which is multiplied by the rule value
if((ntohl(Stats->last_local_delta) + ntohl(Stats->last_remote_delta)) > (ntohl(Stats->average_delta) * 2)) {
retransmittimeout = (ntohl(Stats->last_local_delta) + ntohl(Stats->last_remote_delta))
if ((ntohl(ClientStats->last_local_delta) + ntohl(ClientStats->last_remote_delta)) > (ntohl(ClientStats->average_delta) * 2)) {
retransmittimeout = (ntohl(ClientStats->last_local_delta) + ntohl(ClientStats->last_remote_delta))
* RETRANSMIT_TIMEOUT_MULT;
} else {
retransmittimeout = ntohl(Stats->average_delta) * 2 * RETRANSMIT_TIMEOUT_MULT;
retransmittimeout = ntohl(ClientStats->average_delta) * 2 * RETRANSMIT_TIMEOUT_MULT;
}
retransmittimeout += 300;
if(retransmittimeout > RETRANSMIT_TIMEOUT_MAX)
retransmittimeout = RETRANSMIT_TIMEOUT_MAX;
Log.Out(Logs::Detail, Logs::Netcode, _L "Retransmit timeout recalculated to %dms" __L, retransmittimeout);
}
}
#endif
ServerSessionStats *ServerStats = (ServerSessionStats *)p->pBuffer;
//ServerStats->RequestID = ClientStats->RequestID; // no change
ServerStats->ServerTime = htonl(Timer::GetCurrentTime());
ServerStats->packets_sent_echo = ClientStats->packets_sent; // still in htonll format
ServerStats->packets_received_echo = ClientStats->packets_received; // still in htonll format
ServerStats->packets_sent = htonll(GetPacketsSent());
ServerStats->packets_received = htonll(GetPacketsReceived());
NonSequencedPush(new EQProtocolPacket(OP_SessionStatResponse, p->pBuffer, p->size));
}
break;
case OP_SessionStatResponse: {
@@ -521,7 +502,6 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
void EQStream::QueuePacket(const EQApplicationPacket *p, bool ack_req)
{
_eqp
if(p == nullptr)
return;
@@ -533,7 +513,6 @@ void EQStream::QueuePacket(const EQApplicationPacket *p, bool ack_req)
void EQStream::FastQueuePacket(EQApplicationPacket **p, bool ack_req)
{
_eqp
EQApplicationPacket *pack=*p;
*p = nullptr; //clear caller's pointer.. effectively takes ownership
@@ -563,7 +542,6 @@ void EQStream::FastQueuePacket(EQApplicationPacket **p, bool ack_req)
void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p)
{
_eqp
uint32 chunksize, used;
uint32 length;
@@ -581,16 +559,18 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p)
// Convert the EQApplicationPacket to 1 or more EQProtocolPackets
if (p->size>(MaxLen-8)) { // proto-op(2), seq(2), app-op(2) ... data ... crc(2)
Log.Out(Logs::Detail, Logs::Netcode, _L "Making oversized packet, len %d" __L, p->size);
Log.Out(Logs::Detail, Logs::Netcode, _L "Making oversized packet, len %d" __L, p->Size());
unsigned char *tmpbuff=new unsigned char[p->size+3];
auto tmpbuff = new unsigned char[p->size + 3];
length=p->serialize(opcode, tmpbuff);
if (length != p->Size())
Log.Out(Logs::Detail, Logs::Netcode, _L "Packet adjustment, len %d to %d" __L, p->Size(), length);
EQProtocolPacket *out=new EQProtocolPacket(OP_Fragment,nullptr,MaxLen-4);
*(uint32 *)(out->pBuffer+2)=htonl(p->Size());
auto out = new EQProtocolPacket(OP_Fragment, nullptr, MaxLen - 4);
*(uint32 *)(out->pBuffer+2)=htonl(length);
used=MaxLen-10;
memcpy(out->pBuffer+6,tmpbuff,used);
Log.Out(Logs::Detail, Logs::Netcode, _L "First fragment: used %d/%d. Put size %d in the packet" __L, used, p->size, p->Size());
Log.Out(Logs::Detail, Logs::Netcode, _L "First fragment: used %d/%d. Payload size %d in the packet" __L, used, length, p->size);
SequencedPush(out);
@@ -601,16 +581,16 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p)
out->size=chunksize+2;
SequencedPush(out);
used+=chunksize;
Log.Out(Logs::Detail, Logs::Netcode, _L "Subsequent fragment: len %d, used %d/%d." __L, chunksize, used, p->size);
Log.Out(Logs::Detail, Logs::Netcode, _L "Subsequent fragment: len %d, used %d/%d." __L, chunksize, used, length);
}
delete p;
delete[] tmpbuff;
} else {
unsigned char *tmpbuff=new unsigned char[p->Size()+3];
auto tmpbuff = new unsigned char[p->Size() + 3];
length=p->serialize(opcode, tmpbuff+2) + 2;
EQProtocolPacket *out=new EQProtocolPacket(OP_Packet,tmpbuff,length);
auto out = new EQProtocolPacket(OP_Packet, tmpbuff, length);
delete[] tmpbuff;
SequencedPush(out);
@@ -620,50 +600,37 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p)
void EQStream::SequencedPush(EQProtocolPacket *p)
{
_eqp
#ifdef COLLECTOR
delete p;
#else
MOutboundQueue.lock();
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
Log.Out(Logs::Detail, Logs::Netcode, _L "Pre-Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
}
if(NextSequencedSend > SequencedQueue.size()) {
Log.Out(Logs::Detail, Logs::Netcode, _L "Pre-Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
if (uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
Log.Out(Logs::Detail, Logs::Netcode, _L "Pre-Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L,
SequencedBase, SequencedQueue.size(), NextOutSeq);
}
Log.Out(Logs::Detail, Logs::Netcode, _L "Pushing sequenced packet %d of length %d. Base Seq is %d." __L, NextOutSeq, p->size, SequencedBase);
*(uint16 *)(p->pBuffer)=htons(NextOutSeq);
Log.Out(Logs::Detail, Logs::Netcode, _L "Pushing sequenced packet %d of length %d. Base Seq is %d." __L,
NextOutSeq, p->size, SequencedBase);
*(uint16 *)(p->pBuffer) = htons(NextOutSeq);
SequencedQueue.push_back(p);
NextOutSeq++;
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
Log.Out(Logs::Detail, Logs::Netcode, _L "Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
}
if(NextSequencedSend > SequencedQueue.size()) {
Log.Out(Logs::Detail, Logs::Netcode, _L "Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
if (uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
Log.Out(Logs::Detail, Logs::Netcode, _L "Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L,
SequencedBase, SequencedQueue.size(), NextOutSeq);
}
MOutboundQueue.unlock();
#endif
}
void EQStream::NonSequencedPush(EQProtocolPacket *p)
{
_eqp
#ifdef COLLECTOR
delete p;
#else
MOutboundQueue.lock();
Log.Out(Logs::Detail, Logs::Netcode, _L "Pushing non-sequenced packet of length %d" __L, p->size);
NonSequencedQueue.push(p);
MOutboundQueue.unlock();
#endif
}
void EQStream::SendAck(uint16 seq)
{
_eqp
uint16 Seq=htons(seq);
uint16 Seq=htons(seq);
Log.Out(Logs::Detail, Logs::Netcode, _L "Sending ack with sequence %d" __L, seq);
SetLastAckSent(seq);
NonSequencedPush(new EQProtocolPacket(OP_Ack,(unsigned char *)&Seq,sizeof(uint16)));
@@ -671,9 +638,8 @@ void EQStream::SendAck(uint16 seq)
void EQStream::SendOutOfOrderAck(uint16 seq)
{
_eqp
Log.Out(Logs::Detail, Logs::Netcode, _L "Sending out of order ack with sequence %d" __L, seq);
uint16 Seq=htons(seq);
uint16 Seq=htons(seq);
NonSequencedPush(new EQProtocolPacket(OP_OutOfOrderAck,(unsigned char *)&Seq,sizeof(uint16)));
}
@@ -703,21 +669,15 @@ void EQStream::Write(int eq_fd)
// Place to hold the base packet t combine into
EQProtocolPacket *p=nullptr;
if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) {
// if we have a timeout defined and we have not received an ack recently enough, retransmit from beginning of queue
if (RETRANSMIT_TIMEOUT_MULT && !SequencedQueue.empty() && NextSequencedSend &&
(GetState()==ESTABLISHED) && ((retransmittimer+retransmittimeout) < Timer::GetCurrentTime())) {
Log.Out(Logs::Detail, Logs::Netcode, _L "Timeout since last ack received, starting retransmit at the start of our unacked "
"buffer (seq %d, was %d)." __L, SequencedBase, SequencedBase+NextSequencedSend);
NextSequencedSend = 0;
retransmittimer = Timer::GetCurrentTime(); // don't want to endlessly retransmit the first packet
}
}
// Find the next sequenced packet to send from the "queue"
sitr = SequencedQueue.begin();
if (sitr!=SequencedQueue.end())
sitr += NextSequencedSend;
uint16 count = 0;
// get to start of packets
while (sitr != SequencedQueue.end() && (*sitr)->sent_time > 0) {
++sitr;
++count;
}
// Loop until both are empty or MaxSends is reached
while(!SeqEmpty || !NonSeqEmpty) {
@@ -731,7 +691,7 @@ void EQStream::Write(int eq_fd)
Log.Out(Logs::Detail, Logs::Netcode, _L "Starting combined packet with non-seq packet of len %d" __L, p->size);
NonSequencedQueue.pop();
} else if (!p->combine(NonSequencedQueue.front())) {
// Tryint to combine this packet with the base didn't work (too big maybe)
// Trying to combine this packet with the base didn't work (too big maybe)
// So just send the base packet (we'll try this packet again later)
Log.Out(Logs::Detail, Logs::Netcode, _L "Combined packet full at len %d, next non-seq packet is len %d" __L, p->size, (NonSequencedQueue.front())->size);
ReadyToSend.push(p);
@@ -754,16 +714,9 @@ void EQStream::Write(int eq_fd)
NonSeqEmpty=true;
}
if (sitr!=SequencedQueue.end()) {
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
Log.Out(Logs::Detail, Logs::Netcode, _L "Pre-Send Seq NSS=%d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, NextSequencedSend, SequencedBase, SequencedQueue.size(), NextOutSeq);
}
if (sitr != SequencedQueue.end()) {
uint16 seq_send = SequencedBase + count; //just for logging...
if(NextSequencedSend > SequencedQueue.size()) {
Log.Out(Logs::Detail, Logs::Netcode, _L "Pre-Send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
}
uint16 seq_send = SequencedBase + NextSequencedSend; //just for logging...
if(SequencedQueue.empty()) {
Log.Out(Logs::Detail, Logs::Netcode, _L "Tried to write a packet with an empty queue (%d is past next out %d)" __L, seq_send, NextOutSeq);
SeqEmpty=true;
@@ -771,26 +724,32 @@ void EQStream::Write(int eq_fd)
}
if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) {
if (!RETRANSMIT_ACKED_PACKETS && (*sitr)->acked) {
if ((*sitr)->acked || (*sitr)->sent_time != 0) {
++sitr;
++count;
if (p) {
Log.Out(Logs::Detail, Logs::Netcode, _L "Final combined packet not full, len %d" __L, p->size);
ReadyToSend.push(p);
BytesWritten += p->size;
p = nullptr;
}
Log.Out(Logs::Detail, Logs::Netcode, _L "Not retransmitting seq packet %d because already marked as acked" __L, seq_send);
sitr++;
NextSequencedSend++;
} else if (!p) {
// If we don't have a packet to try to combine into, use this one as the base
// Copy it first as it will still live until it is acked
p=(*sitr)->Copy();
Log.Out(Logs::Detail, Logs::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size);
(*sitr)->sent_time = Timer::GetCurrentTime();
++sitr;
NextSequencedSend++;
++count;
} else if (!p->combine(*sitr)) {
// Trying to combine this packet with the base didn't work (too big maybe)
// So just send the base packet (we'll try this packet again later)
Log.Out(Logs::Detail, Logs::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size);
Log.Out(Logs::Detail, Logs::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send + 1, (*sitr)->size);
ReadyToSend.push(p);
BytesWritten+=p->size;
p=nullptr;
if (BytesWritten > threshold) {
if ((*sitr)->opcode != OP_Fragment && BytesWritten > threshold) {
// Sent enough this round, lets stop to be fair
Log.Out(Logs::Detail, Logs::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold);
break;
@@ -798,17 +757,28 @@ void EQStream::Write(int eq_fd)
} else {
// Combine worked
Log.Out(Logs::Detail, Logs::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size);
(*sitr)->sent_time = Timer::GetCurrentTime();
++sitr;
NextSequencedSend++;
++count;
}
} else {
if (!p) {
if ((*sitr)->sent_time != 0) {
++sitr;
++count;
if (p) {
Log.Out(Logs::Detail, Logs::Netcode, _L "Final combined packet not full, len %d" __L, p->size);
ReadyToSend.push(p);
BytesWritten += p->size;
p = nullptr;
}
} else if (!p) {
// If we don't have a packet to try to combine into, use this one as the base
// Copy it first as it will still live until it is acked
p=(*sitr)->Copy();
(*sitr)->sent_time = Timer::GetCurrentTime();
Log.Out(Logs::Detail, Logs::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size);
++sitr;
NextSequencedSend++;
++count;
} else if (!p->combine(*sitr)) {
// Trying to combine this packet with the base didn't work (too big maybe)
// So just send the base packet (we'll try this packet again later)
@@ -824,18 +794,16 @@ void EQStream::Write(int eq_fd)
}
} else {
// Combine worked
Log.Out(Logs::Detail, Logs::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size);
Log.Out(Logs::Detail, Logs::Netcode, _L "Combined seq packet %d of len %d, yielding %d combined." __L, seq_send, (*sitr)->size, p->size);
(*sitr)->sent_time = Timer::GetCurrentTime();
++sitr;
NextSequencedSend++;
++count;
}
}
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
Log.Out(Logs::Detail, Logs::Netcode, _L "Post send Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
}
if(NextSequencedSend > SequencedQueue.size()) {
Log.Out(Logs::Detail, Logs::Netcode, _L "Post send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
}
} else {
// No more sequenced packets
SeqEmpty=true;
@@ -874,9 +842,8 @@ void EQStream::Write(int eq_fd)
void EQStream::WritePacket(int eq_fd, EQProtocolPacket *p)
{
_eqp
uint32 length;
sockaddr_in address;
uint32 length;
sockaddr_in address;
address.sin_family = AF_INET;
address.sin_addr.s_addr=remote_ip;
address.sin_port=remote_port;
@@ -895,9 +862,11 @@ void EQStream::WritePacket(int eq_fd, EQProtocolPacket *p)
length=p->serialize(buffer);
if (p->opcode!=OP_SessionRequest && p->opcode!=OP_SessionResponse) {
if (compressed) {
BytesWritten -= p->size;
uint32 newlen=EQProtocolPacket::Compress(buffer,length, _tempBuffer, 2048);
memcpy(buffer,_tempBuffer,newlen);
length=newlen;
BytesWritten += newlen;
}
if (encoded) {
EQProtocolPacket::ChatEncode(buffer,length,Key);
@@ -913,8 +882,7 @@ void EQStream::WritePacket(int eq_fd, EQProtocolPacket *p)
void EQStream::SendSessionResponse()
{
_eqp
EQProtocolPacket *out=new EQProtocolPacket(OP_SessionResponse,nullptr,sizeof(SessionResponse));
auto out = new EQProtocolPacket(OP_SessionResponse, nullptr, sizeof(SessionResponse));
SessionResponse *Response=(SessionResponse *)out->pBuffer;
Response->Session=htonl(Session);
Response->MaxLength=htonl(MaxLen);
@@ -936,8 +904,7 @@ void EQStream::SendSessionResponse()
void EQStream::SendSessionRequest()
{
_eqp
EQProtocolPacket *out=new EQProtocolPacket(OP_SessionRequest,nullptr,sizeof(SessionRequest));
auto out = new EQProtocolPacket(OP_SessionRequest, nullptr, sizeof(SessionRequest));
SessionRequest *Request=(SessionRequest *)out->pBuffer;
memset(Request,0,sizeof(SessionRequest));
Request->Session=htonl(time(nullptr));
@@ -950,11 +917,10 @@ void EQStream::SendSessionRequest()
void EQStream::_SendDisconnect()
{
_eqp
if(GetState() == CLOSED)
return;
EQProtocolPacket *out=new EQProtocolPacket(OP_SessionDisconnect,nullptr,sizeof(uint32));
auto out = new EQProtocolPacket(OP_SessionDisconnect, nullptr, sizeof(uint32));
*(uint32 *)out->pBuffer=htonl(Session);
NonSequencedPush(out);
@@ -963,7 +929,6 @@ void EQStream::_SendDisconnect()
void EQStream::InboundQueuePush(EQRawApplicationPacket *p)
{
_eqp
MInboundQueue.lock();
InboundQueue.push_back(p);
MInboundQueue.unlock();
@@ -971,12 +936,11 @@ void EQStream::InboundQueuePush(EQRawApplicationPacket *p)
EQApplicationPacket *EQStream::PopPacket()
{
_eqp
EQRawApplicationPacket *p=nullptr;
EQRawApplicationPacket *p=nullptr;
MInboundQueue.lock();
if (InboundQueue.size()) {
std::vector<EQRawApplicationPacket *>::iterator itr=InboundQueue.begin();
if (!InboundQueue.empty()) {
auto itr = InboundQueue.begin();
p=*itr;
InboundQueue.erase(itr);
}
@@ -997,12 +961,11 @@ EQApplicationPacket *EQStream::PopPacket()
EQRawApplicationPacket *EQStream::PopRawPacket()
{
_eqp
EQRawApplicationPacket *p=nullptr;
EQRawApplicationPacket *p=nullptr;
MInboundQueue.lock();
if (InboundQueue.size()) {
std::vector<EQRawApplicationPacket *>::iterator itr=InboundQueue.begin();
if (!InboundQueue.empty()) {
auto itr = InboundQueue.begin();
p=*itr;
InboundQueue.erase(itr);
}
@@ -1025,12 +988,11 @@ EQRawApplicationPacket *EQStream::PopRawPacket()
EQRawApplicationPacket *EQStream::PeekPacket()
{
_eqp
EQRawApplicationPacket *p=nullptr;
EQRawApplicationPacket *p=nullptr;
MInboundQueue.lock();
if (InboundQueue.size()) {
std::vector<EQRawApplicationPacket *>::iterator itr=InboundQueue.begin();
if (!InboundQueue.empty()) {
auto itr = InboundQueue.begin();
p=*itr;
}
MInboundQueue.unlock();
@@ -1040,8 +1002,7 @@ EQRawApplicationPacket *EQStream::PeekPacket()
void EQStream::InboundQueueClear()
{
_eqp
EQApplicationPacket *p=nullptr;
EQApplicationPacket *p=nullptr;
Log.Out(Logs::Detail, Logs::Netcode, _L "Clearing inbound queue" __L);
@@ -1059,8 +1020,7 @@ void EQStream::InboundQueueClear()
bool EQStream::HasOutgoingData()
{
_eqp
bool flag;
bool flag;
//once closed, we have nothing more to say
if(CheckClosed())
@@ -1085,8 +1045,7 @@ bool EQStream::HasOutgoingData()
void EQStream::OutboundQueueClear()
{
_eqp
EQProtocolPacket *p=nullptr;
EQProtocolPacket *p=nullptr;
Log.Out(Logs::Detail, Logs::Netcode, _L "Clearing outbound queue" __L);
@@ -1108,8 +1067,7 @@ void EQStream::OutboundQueueClear()
void EQStream::PacketQueueClear()
{
_eqp
EQProtocolPacket *p=nullptr;
EQProtocolPacket *p=nullptr;
Log.Out(Logs::Detail, Logs::Netcode, _L "Clearing future packet queue" __L);
@@ -1125,7 +1083,6 @@ void EQStream::PacketQueueClear()
void EQStream::Process(const unsigned char *buffer, const uint32 length)
{
_eqp
static unsigned char newbuffer[2048];
uint32 newlength=0;
if (EQProtocolPacket::ValidateCRC(buffer,length,Key)) {
@@ -1150,7 +1107,6 @@ void EQStream::Process(const unsigned char *buffer, const uint32 length)
long EQStream::GetNextAckToSend()
{
_eqp
MAcks.lock();
long l=NextAckToSend;
MAcks.unlock();
@@ -1160,7 +1116,6 @@ long EQStream::GetNextAckToSend()
long EQStream::GetLastAckSent()
{
_eqp
MAcks.lock();
long l=LastAckSent;
MAcks.unlock();
@@ -1170,17 +1125,9 @@ long EQStream::GetLastAckSent()
void EQStream::AckPackets(uint16 seq)
{
_eqp
std::deque<EQProtocolPacket *>::iterator itr, tmp;
std::deque<EQProtocolPacket *>::iterator itr, tmp;
MOutboundQueue.lock();
//do a bit of sanity checking.
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
Log.Out(Logs::Detail, Logs::Netcode, _L "Pre-Ack Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
}
if(NextSequencedSend > SequencedQueue.size()) {
Log.Out(Logs::Detail, Logs::Netcode, _L "Pre-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
}
SeqOrder ord = CompareSequence(SequencedBase, seq);
if(ord == SeqInOrder) {
@@ -1197,27 +1144,20 @@ void EQStream::AckPackets(uint16 seq)
seq++; //we stop at the block right after their ack, counting on the wrap of both numbers.
while(SequencedBase != seq) {
if(SequencedQueue.empty()) {
Log.Out(Logs::Detail, Logs::Netcode, _L "OUT OF PACKETS acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend);
Log.Out(Logs::Detail, Logs::Netcode, _L "OUT OF PACKETS acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, SequencedQueue.size());
SequencedBase = NextOutSeq;
NextSequencedSend = 0;
break;
}
Log.Out(Logs::Detail, Logs::Netcode, _L "Removing acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend);
Log.Out(Logs::Detail, Logs::Netcode, _L "Removing acked packet with sequence %lu." __L, (unsigned long)SequencedBase);
//clean out the acked packet
delete SequencedQueue.front();
SequencedQueue.pop_front();
//adjust our "next" pointer
if(NextSequencedSend > 0)
NextSequencedSend--;
//advance the base sequence number to the seq of the block after the one we just got rid of.
SequencedBase++;
}
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
Log.Out(Logs::Detail, Logs::Netcode, _L "Post-Ack on %d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, seq, SequencedBase, SequencedQueue.size(), NextOutSeq);
}
if(NextSequencedSend > SequencedQueue.size()) {
Log.Out(Logs::Detail, Logs::Netcode, _L "Post-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
}
}
MOutboundQueue.unlock();
@@ -1225,7 +1165,6 @@ void EQStream::AckPackets(uint16 seq)
void EQStream::SetNextAckToSend(uint32 seq)
{
_eqp
MAcks.lock();
Log.Out(Logs::Detail, Logs::Netcode, _L "Set Next Ack To Send to %lu" __L, (unsigned long)seq);
NextAckToSend=seq;
@@ -1234,7 +1173,6 @@ void EQStream::SetNextAckToSend(uint32 seq)
void EQStream::SetLastAckSent(uint32 seq)
{
_eqp
MAcks.lock();
Log.Out(Logs::Detail, Logs::Netcode, _L "Set Last Ack Sent to %lu" __L, (unsigned long)seq);
LastAckSent=seq;
@@ -1243,7 +1181,6 @@ void EQStream::SetLastAckSent(uint32 seq)
void EQStream::ProcessQueue()
{
_eqp
if(PacketQueue.empty()) {
return;
}
@@ -1259,9 +1196,8 @@ void EQStream::ProcessQueue()
EQProtocolPacket *EQStream::RemoveQueue(uint16 seq)
{
_eqp
std::map<unsigned short,EQProtocolPacket *>::iterator itr;
EQProtocolPacket *qp=nullptr;
std::map<unsigned short,EQProtocolPacket *>::iterator itr;
EQProtocolPacket *qp=nullptr;
if ((itr=PacketQueue.find(seq))!=PacketQueue.end()) {
qp=itr->second;
PacketQueue.erase(itr);
@@ -1272,7 +1208,6 @@ EQProtocolPacket *EQStream::RemoveQueue(uint16 seq)
void EQStream::SetStreamType(EQStreamType type)
{
_eqp
Log.Out(Logs::Detail, Logs::Netcode, _L "Changing stream type from %s to %s" __L, StreamTypeString(StreamType), StreamTypeString(type));
StreamType=type;
switch (StreamType) {
@@ -1303,7 +1238,6 @@ void EQStream::SetStreamType(EQStreamType type)
const char *EQStream::StreamTypeString(EQStreamType t)
{
_eqp
switch (t) {
case LoginStream:
return "Login";
@@ -1333,7 +1267,6 @@ const char *EQStream::StreamTypeString(EQStreamType t)
//returns SeqFuture if `seq` is later than `expected_seq`
EQStream::SeqOrder EQStream::CompareSequence(uint16 expected_seq , uint16 seq)
{
_eqp
if (expected_seq==seq) {
// Curent
return SeqInOrder;
@@ -1347,7 +1280,6 @@ EQStream::SeqOrder EQStream::CompareSequence(uint16 expected_seq , uint16 seq)
}
void EQStream::SetState(EQStreamState state) {
_eqp
MState.lock();
Log.Out(Logs::Detail, Logs::Netcode, _L "Changing state from %d to %d" __L, State, state);
State=state;
@@ -1356,7 +1288,7 @@ void EQStream::SetState(EQStreamState state) {
void EQStream::CheckTimeout(uint32 now, uint32 timeout) {
_eqp
bool outgoing_data = HasOutgoingData(); //up here to avoid recursive locking
EQStreamState orig_state = GetState();
@@ -1395,7 +1327,6 @@ void EQStream::CheckTimeout(uint32 now, uint32 timeout) {
void EQStream::Decay()
{
_eqp
MRate.lock();
uint32 rate=DecayRate;
MRate.unlock();
@@ -1404,26 +1335,43 @@ void EQStream::Decay()
if (BytesWritten<0)
BytesWritten=0;
}
// check for any timed out acks
if ((GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) && RETRANSMIT_TIMEOUT_MULT && retransmittimeout) {
int count = 0;
MOutboundQueue.lock();
for (auto sitr = SequencedQueue.begin(); sitr != SequencedQueue.end(); ++sitr, count++) {
if (!(*sitr)->acked && (*sitr)->sent_time > 0 && ((*sitr)->sent_time + retransmittimeout) < Timer::GetCurrentTime()) {
(*sitr)->sent_time = 0;
Log.Out(Logs::Detail, Logs::Netcode, _L "Timeout exceeded for seq %d. Flagging packet for retransmission" __L, SequencedBase + count);
}
}
MOutboundQueue.unlock();
}
}
void EQStream::AdjustRates(uint32 average_delta)
{
_eqp
if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) {
if (average_delta && (average_delta <= AVERAGE_DELTA_MAX)) {
MRate.lock();
AverageDelta = average_delta;
RateThreshold=RATEBASE/average_delta;
DecayRate=DECAYBASE/average_delta;
if (BytesWritten > RateThreshold)
BytesWritten = RateThreshold + DecayRate;
Log.Out(Logs::Detail, Logs::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L,
RateThreshold, DecayRate, average_delta);
MRate.unlock();
} else {
Log.Out(Logs::Detail, Logs::Netcode, _L "Not adjusting data rate because avg delta over max (%d > %d)" __L,
average_delta, AVERAGE_DELTA_MAX);
AverageDelta = AVERAGE_DELTA_MAX;
}
} else {
if (average_delta) {
MRate.lock();
AverageDelta = average_delta;
BytesWritten = 0;
RateThreshold=RATEBASE/average_delta;
DecayRate=DECAYBASE/average_delta;
Log.Out(Logs::Detail, Logs::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L,
@@ -1434,7 +1382,6 @@ void EQStream::AdjustRates(uint32 average_delta)
}
void EQStream::Close() {
_eqp
if(HasOutgoingData()) {
//there is pending data, wait for it to go out.
Log.Out(Logs::Detail, Logs::Netcode, _L "Stream requested to Close(), but there is pending data, waiting for it." __L);
@@ -1451,7 +1398,6 @@ void EQStream::Close() {
//this could be expanded to check more than the fitst opcode if
//we needed more complex matching
EQStream::MatchState EQStream::CheckSignature(const Signature *sig) {
_eqp
EQRawApplicationPacket *p = nullptr;
MatchState res = MatchNotReady;
+20 -3
View File
@@ -71,7 +71,7 @@ struct SessionResponse {
};
//Deltas are in ms, representing round trip times
struct SessionStats {
struct ClientSessionStats {
/*000*/ uint16 RequestID;
/*002*/ uint32 last_local_delta;
/*006*/ uint32 average_delta;
@@ -83,6 +83,16 @@ struct SessionStats {
/*038*/
};
struct ServerSessionStats {
/*000*/ uint16 RequestID;
/*002*/ uint32 ServerTime;
/*006*/ uint64 packets_sent_echo;
/*014*/ uint64 packets_received_echo;
/*022*/ uint64 packets_sent;
/*030*/ uint64 packets_received;
/*038*/
};
#pragma pack()
class OpcodeManager;
@@ -143,7 +153,6 @@ class EQStream : public EQStreamInterface {
std::deque<EQProtocolPacket *> SequencedQueue;
uint16 NextOutSeq;
uint16 SequencedBase; //the sequence number of SequencedQueue[0]
long NextSequencedSend; //index into SequencedQueue
Mutex MOutboundQueue;
//a buffer we use for compression/decompression
@@ -158,10 +167,13 @@ class EQStream : public EQStreamInterface {
int32 BytesWritten;
uint64 sent_packet_count;
uint64 received_packet_count;
Mutex MRate;
int32 RateThreshold;
int32 DecayRate;
uint32 AverageDelta;
OpcodeManager **OpMgr;
@@ -265,11 +277,13 @@ class EQStream : public EQStreamInterface {
void AddBytesSent(uint32 bytes)
{
bytes_sent += bytes;
++sent_packet_count;
}
void AddBytesRecv(uint32 bytes)
{
bytes_recv += bytes;
++received_packet_count;
}
virtual const uint32 GetBytesSent() const { return bytes_sent; }
@@ -288,6 +302,9 @@ class EQStream : public EQStreamInterface {
return bytes_recv / (Timer::GetTimeSeconds() - create_time);
}
const uint64 GetPacketsSent() { return sent_packet_count; }
const uint64 GetPacketsReceived() { return received_packet_count; }
//used for dynamic stream identification
class Signature {
public:
+20 -29
View File
@@ -3,7 +3,7 @@
#include "eq_stream_factory.h"
#ifdef _WINDOWS
#include <winsock.h>
#include <winsock2.h>
#include <process.h>
#include <io.h>
#include <stdio.h>
@@ -23,8 +23,7 @@
ThreadReturnType EQStreamFactoryReaderLoop(void *eqfs)
{
_eqp
EQStreamFactory *fs = (EQStreamFactory*)eqfs;
EQStreamFactory *fs=(EQStreamFactory *)eqfs;
#ifndef WIN32
Log.Out(Logs::Detail, Logs::None, "Starting EQStreamFactoryReaderLoop with thread ID %d", pthread_self());
@@ -41,8 +40,7 @@ ThreadReturnType EQStreamFactoryReaderLoop(void *eqfs)
ThreadReturnType EQStreamFactoryWriterLoop(void *eqfs)
{
_eqp
EQStreamFactory *fs = (EQStreamFactory*)eqfs;
EQStreamFactory *fs=(EQStreamFactory *)eqfs;
#ifndef WIN32
Log.Out(Logs::Detail, Logs::None, "Starting EQStreamFactoryWriterLoop with thread ID %d", pthread_self());
@@ -60,7 +58,6 @@ ThreadReturnType EQStreamFactoryWriterLoop(void *eqfs)
EQStreamFactory::EQStreamFactory(EQStreamType type, int port, uint32 timeout)
: Timeoutable(5000), stream_timeout(timeout)
{
_eqp
StreamType=type;
Port=port;
sock=-1;
@@ -68,7 +65,6 @@ EQStreamFactory::EQStreamFactory(EQStreamType type, int port, uint32 timeout)
void EQStreamFactory::Close()
{
_eqp
Stop();
#ifdef _WINDOWS
@@ -81,8 +77,7 @@ void EQStreamFactory::Close()
bool EQStreamFactory::Open()
{
_eqp
struct sockaddr_in address;
struct sockaddr_in address;
#ifndef WIN32
pthread_t t1,t2;
#endif
@@ -123,10 +118,9 @@ bool EQStreamFactory::Open()
std::shared_ptr<EQStream> EQStreamFactory::Pop()
{
_eqp
std::shared_ptr<EQStream> s = nullptr;
MNewStreams.lock();
if (NewStreams.size()) {
if (!NewStreams.empty()) {
s = NewStreams.front();
NewStreams.pop();
s->PutInUse();
@@ -138,7 +132,6 @@ std::shared_ptr<EQStream> EQStreamFactory::Pop()
void EQStreamFactory::Push(std::shared_ptr<EQStream> s)
{
_eqp
MNewStreams.lock();
NewStreams.push(s);
MNewStreams.unlock();
@@ -146,7 +139,6 @@ void EQStreamFactory::Push(std::shared_ptr<EQStream> s)
void EQStreamFactory::ReaderLoop()
{
_eqp
fd_set readset;
std::map<std::pair<uint32, uint16>, std::shared_ptr<EQStream>>::iterator stream_itr;
int num;
@@ -224,7 +216,6 @@ void EQStreamFactory::ReaderLoop()
void EQStreamFactory::CheckTimeout()
{
_eqp
//lock streams the entire time were checking timeouts, it should be fast.
MStreams.lock();
@@ -244,7 +235,7 @@ void EQStreamFactory::CheckTimeout()
//give it a little time for everybody to finish with it
} else {
//everybody is done, we can delete it now
std::map<std::pair<uint32, uint16>, std::shared_ptr<EQStream>>::iterator temp = stream_itr;
auto temp = stream_itr;
++stream_itr;
temp->second = nullptr;
Streams.erase(temp);
@@ -259,9 +250,7 @@ void EQStreamFactory::CheckTimeout()
void EQStreamFactory::WriterLoop()
{
_eqp
std::map<std::pair<uint32, uint16>, std::shared_ptr<EQStream>>::iterator stream_itr;
bool havework=true;
bool havework = true;
std::vector<std::shared_ptr<EQStream>> wants_write;
std::vector<std::shared_ptr<EQStream>>::iterator cur, end;
bool decay = false;
@@ -270,7 +259,7 @@ void EQStreamFactory::WriterLoop()
WriterRunning = true;
DecayTimer.Enable();
while(sock!=-1) {
while (sock != -1) {
MWriterRunning.lock();
if (!WriterRunning)
break;
@@ -279,34 +268,36 @@ void EQStreamFactory::WriterLoop()
havework = false;
wants_write.clear();
decay=DecayTimer.Check();
decay = DecayTimer.Check();
//copy streams into a seperate list so we dont have to keep
//MStreams locked while we are writting
// copy streams into a seperate list so we dont have to keep
// MStreams locked while we are writting
MStreams.lock();
for(stream_itr=Streams.begin();stream_itr!=Streams.end();++stream_itr) {
for (auto stream_itr = Streams.begin(); stream_itr != Streams.end(); ++stream_itr) {
// If it's time to decay the bytes sent, then let's do it before we try to write
if (decay)
stream_itr->second->Decay();
//bullshit checking, to see if this is really happening, GDB seems to think so...
if(stream_itr->second == nullptr) {
fprintf(stderr, "ERROR: nullptr Stream encountered in EQStreamFactory::WriterLoop for: %i:%i", stream_itr->first.first, stream_itr->first.second);
// bullshit checking, to see if this is really happening, GDB seems to think so...
if (stream_itr->second == nullptr) {
fprintf(stderr,
"ERROR: nullptr Stream encountered in EQStreamFactory::WriterLoop for: %i:%i",
stream_itr->first.first, stream_itr->first.second);
continue;
}
if (stream_itr->second->HasOutgoingData()) {
havework=true;
havework = true;
stream_itr->second->PutInUse();
wants_write.push_back(stream_itr->second);
}
}
MStreams.unlock();
//do the actual writes
// do the actual writes
cur = wants_write.begin();
end = wants_write.end();
for(; cur != end; ++cur) {
for (; cur != end; ++cur) {
(*cur)->Write(sock);
(*cur)->ReleaseFromUse();
}
+4 -2
View File
@@ -1,3 +1,5 @@
#include <utility>
#include "global_define.h"
#include "eqemu_logsys.h"
#include "eq_stream_ident.h"
@@ -25,7 +27,7 @@ EQStreamIdentifier::~EQStreamIdentifier() {
}
void EQStreamIdentifier::RegisterPatch(const EQStream::Signature &sig, const char *name, OpcodeManager ** opcodes, const StructStrategy *structs) {
Patch *p = new Patch;
auto p = new Patch;
p->signature = sig;
p->name = name;
p->opcodes = opcodes;
@@ -156,7 +158,7 @@ EQStreamInterface *EQStreamIdentifier::PopIdentified() {
}
EQStreamIdentifier::Record::Record(std::shared_ptr<EQStream> s)
: stream(s),
: stream(std::move(s)),
expire(STREAM_IDENT_WAIT_MS)
{
}
+2 -2
View File
@@ -4,7 +4,7 @@
//this is the only part of an EQStream that is seen by the application.
#include <string>
#include "clientversions.h"
#include "client_version.h" // inv2 watch
typedef enum {
ESTABLISHED,
@@ -35,7 +35,7 @@ public:
virtual const uint32 GetBytesRecieved() const { return 0; }
virtual const uint32 GetBytesSentPerSecond() const { return 0; }
virtual const uint32 GetBytesRecvPerSecond() const { return 0; }
virtual const ClientVersion GetClientVersion() const { return ClientVersion::Unknown; }
virtual const EQEmu::versions::ClientVersion ClientVersion() const { return EQEmu::versions::ClientVersion::Unknown; }
};
#endif /*EQSTREAMINTF_H_*/
+2 -2
View File
@@ -21,9 +21,9 @@ std::string EQStreamProxy::Describe() const {
return(m_structs->Describe());
}
const ClientVersion EQStreamProxy::GetClientVersion() const
const EQEmu::versions::ClientVersion EQStreamProxy::ClientVersion() const
{
return m_structs->GetClientVersion();
return m_structs->ClientVersion();
}
void EQStreamProxy::QueuePacket(const EQApplicationPacket *p, bool ack_req) {
+1 -1
View File
@@ -28,7 +28,7 @@ public:
virtual void RemoveData();
virtual bool CheckState(EQStreamState state);
virtual std::string Describe() const;
virtual const ClientVersion GetClientVersion() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
virtual const uint32 GetBytesSent() const;
virtual const uint32 GetBytesRecieved() const;
+1 -1
View File
@@ -63,7 +63,7 @@ EQDBRes * EQDB::query(Const_char *q) {
//NOT THREAD SAFE!
Const_char *EQDB::escape_string(Const_char *from) {
int len = strlen(from);
char *res = new char[len*2+1];
auto res = new char[len * 2 + 1];
mysql_real_escape_string(mysql_ref,res,from,len);
+53 -17
View File
@@ -28,7 +28,6 @@ EQEmuConfig *EQEmuConfig::_config = nullptr;
void EQEmuConfig::do_world(TiXmlElement *ele)
{
_eqp
const char *text;
TiXmlElement * sub_ele;;
text = ParseTextBlock(ele, "shortname");
@@ -81,7 +80,7 @@ void EQEmuConfig::do_world(TiXmlElement *ele)
sprintf(str, "loginserver%i", ++LoginCount);
sub_ele = ele->FirstChildElement(str);
if (sub_ele) {
LoginConfig* loginconfig = new LoginConfig;
auto loginconfig = new LoginConfig;
text = ParseTextBlock(sub_ele, "host", true);
if (text) {
loginconfig->LoginHost = text;
@@ -146,7 +145,6 @@ void EQEmuConfig::do_world(TiXmlElement *ele)
void EQEmuConfig::do_chatserver(TiXmlElement *ele)
{
_eqp
const char *text;
text = ParseTextBlock(ele, "host", true);
if (text) {
@@ -160,7 +158,6 @@ void EQEmuConfig::do_chatserver(TiXmlElement *ele)
void EQEmuConfig::do_mailserver(TiXmlElement *ele)
{
_eqp
const char *text;
text = ParseTextBlock(ele, "host", true);
if (text) {
@@ -174,7 +171,6 @@ void EQEmuConfig::do_mailserver(TiXmlElement *ele)
void EQEmuConfig::do_database(TiXmlElement *ele)
{
_eqp
const char *text;
text = ParseTextBlock(ele, "host", true);
if (text) {
@@ -201,7 +197,6 @@ void EQEmuConfig::do_database(TiXmlElement *ele)
void EQEmuConfig::do_qsdatabase(TiXmlElement *ele)
{
_eqp
const char *text;
text = ParseTextBlock(ele, "host", true);
if (text) {
@@ -227,7 +222,6 @@ void EQEmuConfig::do_qsdatabase(TiXmlElement *ele)
void EQEmuConfig::do_zones(TiXmlElement *ele)
{
_eqp
const char *text;
TiXmlElement *sub_ele;
// TiXmlNode *node,*sub_node;
@@ -251,7 +245,6 @@ void EQEmuConfig::do_zones(TiXmlElement *ele)
void EQEmuConfig::do_files(TiXmlElement *ele)
{
_eqp
const char *text;
text = ParseTextBlock(ele, "spells", true);
if (text) {
@@ -261,33 +254,62 @@ void EQEmuConfig::do_files(TiXmlElement *ele)
if (text) {
OpCodesFile = text;
}
text = ParseTextBlock(ele, "eqtime", true);
text = ParseTextBlock(ele, "plugin.pl", true);
if (text) {
EQTimeFile = text;
PluginPlFile = text;
}
}
void EQEmuConfig::do_directories(TiXmlElement *ele)
{
_eqp
const char *text;
text = ParseTextBlock(ele, "maps", true);
if (text) {
MapDir = text;
if ( MapDir.back() != '/' )
MapDir += '/';
}
text = ParseTextBlock(ele, "quests", true);
if (text) {
QuestDir = text;
if ( QuestDir.back() != '/' )
QuestDir += '/';
}
text = ParseTextBlock(ele, "plugins", true);
if (text) {
PluginDir = text;
if ( PluginDir.back() != '/' )
PluginDir += '/';
}
text = ParseTextBlock(ele, "lua_modules", true);
if (text) {
LuaModuleDir = text;
if ( LuaModuleDir.back() != '/' )
LuaModuleDir += '/';
}
text = ParseTextBlock(ele, "patches", true);
if (text) {
PatchDir = text;
if ( PatchDir.back() != '/' )
PatchDir += '/';
}
text = ParseTextBlock(ele, "shared_memory", true);
if (text) {
SharedMemDir = text;
if ( SharedMemDir.back() != '/' )
SharedMemDir += '/';
}
//Not Fully Implemented yet LogDir
text = ParseTextBlock(ele, "logs", true);
if (text) {
LogDir = text;
if ( LogDir.back() != '/' )
LogDir += '/';
}
}
void EQEmuConfig::do_launcher(TiXmlElement *ele)
{
_eqp
const char *text;
TiXmlElement *sub_ele;
text = ParseTextBlock(ele, "logprefix", true);
@@ -327,7 +349,6 @@ void EQEmuConfig::do_launcher(TiXmlElement *ele)
std::string EQEmuConfig::GetByName(const std::string &var_name) const
{
_eqp
if (var_name == "ShortName") {
return (ShortName);
}
@@ -418,8 +439,8 @@ std::string EQEmuConfig::GetByName(const std::string &var_name) const
if (var_name == "OpCodesFile") {
return (OpCodesFile);
}
if (var_name == "EQTimeFile") {
return (EQTimeFile);
if (var_name == "PluginPlFile") {
return (PluginPlFile);
}
if (var_name == "MapDir") {
return (MapDir);
@@ -430,6 +451,18 @@ std::string EQEmuConfig::GetByName(const std::string &var_name) const
if (var_name == "PluginDir") {
return (PluginDir);
}
if (var_name == "LuaModuleDir") {
return (LuaModuleDir);
}
if (var_name == "PatchDir") {
return (PatchDir);
}
if (var_name == "SharedMemDir") {
return (SharedMemDir);
}
if (var_name == "LogDir") {
return (LogDir);
}
if (var_name == "LogPrefix") {
return (LogPrefix);
}
@@ -455,7 +488,6 @@ std::string EQEmuConfig::GetByName(const std::string &var_name) const
void EQEmuConfig::Dump() const
{
_eqp
std::cout << "ShortName = " << ShortName << std::endl;
std::cout << "LongName = " << LongName << std::endl;
std::cout << "WorldAddress = " << WorldAddress << std::endl;
@@ -486,10 +518,14 @@ void EQEmuConfig::Dump() const
std::cout << "QSDatabasePort = " << QSDatabasePort << std::endl;
std::cout << "SpellsFile = " << SpellsFile << std::endl;
std::cout << "OpCodesFile = " << OpCodesFile << std::endl;
std::cout << "EQTimeFile = " << EQTimeFile << std::endl;
std::cout << "PluginPlFile = " << PluginPlFile << std::endl;
std::cout << "MapDir = " << MapDir << std::endl;
std::cout << "QuestDir = " << QuestDir << std::endl;
std::cout << "PluginDir = " << PluginDir << std::endl;
std::cout << "LuaModuleDir = " << LuaModuleDir << std::endl;
std::cout << "PatchDir = " << PatchDir << std::endl;
std::cout << "SharedMemDir = " << SharedMemDir << std::endl;
std::cout << "LogDir = " << LogDir << std::endl;
std::cout << "ZonePortLow = " << ZonePortLow << std::endl;
std::cout << "ZonePortHigh = " << ZonePortHigh << std::endl;
std::cout << "DefaultStatus = " << (int)DefaultStatus << std::endl;
+14 -5
View File
@@ -79,12 +79,16 @@ class EQEmuConfig : public XMLParser
// From <files/>
std::string SpellsFile;
std::string OpCodesFile;
std::string EQTimeFile;
std::string PluginPlFile;
// From <directories/>
std::string MapDir;
std::string QuestDir;
std::string PluginDir;
std::string LuaModuleDir;
std::string PatchDir;
std::string SharedMemDir;
std::string LogDir;
// From <launcher/>
std::string LogPrefix;
@@ -154,11 +158,16 @@ class EQEmuConfig : public XMLParser
// Files
SpellsFile = "spells_us.txt";
OpCodesFile = "opcodes.conf";
EQTimeFile = "eqtime.cfg";
PluginPlFile = "plugin.pl";
// Dirs
MapDir = "Maps";
QuestDir = "quests";
PluginDir = "plugins";
MapDir = "Maps/";
QuestDir = "quests/";
PluginDir = "plugins/";
LuaModuleDir = "lua_modules/";
PatchDir = "./";
SharedMemDir = "shared/";
LogDir = "logs/";
// Launcher
LogPrefix = "logs/zone-";
LogSuffix = ".log";
+2 -4
View File
@@ -96,13 +96,13 @@ void EQEmuLogSys::LoadLogSettingsDefaults()
memset(log_settings, 0, sizeof(LogSettings) * Logs::LogCategory::MaxCategoryID);
/* Set Defaults */
log_settings[Logs::LoginServer].log_to_console = Logs::General;
log_settings[Logs::World_Server].log_to_console = Logs::General;
log_settings[Logs::Zone_Server].log_to_console = Logs::General;
log_settings[Logs::QS_Server].log_to_console = Logs::General;
log_settings[Logs::UCS_Server].log_to_console = Logs::General;
log_settings[Logs::Crash].log_to_console = Logs::General;
log_settings[Logs::MySQLError].log_to_console = Logs::General;
log_settings[Logs::Login_Server].log_to_console = Logs::General;
/* Declare process file names for log writing
If there is no process_file_name declared, no log file will be written, simply
@@ -273,14 +273,12 @@ void EQEmuLogSys::ProcessConsoleMessage(uint16 debug_level, uint16 log_category,
void EQEmuLogSys::Out(Logs::DebugLevel debug_level, uint16 log_category, std::string message, ...)
{
_eqp
const bool log_to_console = log_settings[log_category].log_to_console > 0;
const bool log_to_file = log_settings[log_category].log_to_file > 0;
const bool log_to_gmsay = log_settings[log_category].log_to_gmsay > 0;
const bool nothing_to_log = !log_to_console && !log_to_file && !log_to_gmsay;
if (nothing_to_log)
return;
if (nothing_to_log) return;
va_list args;
va_start(args, message);
+4 -6
View File
@@ -48,14 +48,12 @@ namespace Logs {
Combat,
Commands,
Crash,
Database,
Debug,
Doors,
Error,
Guilds,
Inventory,
Launcher,
LoginServer,
Netcode,
Normal,
Object,
@@ -84,6 +82,7 @@ namespace Logs {
Client_Server_Packet_Unhandled,
Server_Client_Packet_With_Dump,
Client_Server_Packet_With_Dump,
Login_Server,
MaxCategoryID /* Don't Remove this*/
};
@@ -98,14 +97,12 @@ namespace Logs {
"Combat",
"Commands",
"Crash",
"Database",
"Debug",
"Doors",
"Error",
"Guilds",
"Inventory",
"Launcher",
"LoginServer",
"Netcode",
"Normal",
"Object",
@@ -126,14 +123,15 @@ namespace Logs {
"WebInterface Server",
"World Server",
"Zone Server",
"MySQLError",
"MySQLQuery",
"MySQL Error",
"MySQL Query",
"Mercenaries",
"Quest Debug",
"Packet :: Server -> Client",
"Packet :: Client -> Server Unhandled",
"Packet :: Server -> Client (Dump)",
"Packet :: Client -> Server (Dump)",
"Login Server"
};
}
+40 -107
View File
@@ -43,19 +43,19 @@ EQTime::EQTime(TimeOfDay_Struct start_eq, time_t start_real)
EQTime::EQTime()
{
timezone=0;
timezone = 0;
memset(&eqTime, 0, sizeof(eqTime));
//Defaults for time
TimeOfDay_Struct start;
start.day=1;
start.hour=9;
start.minute=0;
start.month=1;
start.year=3100;
start.day = 1;
start.hour = 9;
start.minute = 0;
start.month = 1;
start.year = 3100;
//Set default time zone
timezone=0;
timezone = 0;
//Start EQTimer
setEQTimeOfDay(start, time(0));
SetCurrentEQTimeOfDay(start, time(0));
}
EQTime::~EQTime()
@@ -67,10 +67,10 @@ EQTime::~EQTime()
//Input: Current Time (as a time_t), a pointer to the TimeOfDay_Struct that will be written to.
//Output: 0=Error, 1=Sucess
int EQTime::getEQTimeOfDay( time_t timeConvert, struct TimeOfDay_Struct *eqTimeOfDay )
int EQTime::GetCurrentEQTimeOfDay(time_t timeConvert, struct TimeOfDay_Struct *eqTimeOfDay)
{
/* check to see if we have a reference time to go by. */
if( eqTime.start_realtime == 0 )
if (eqTime.start_realtime == 0)
return 0;
unsigned long diff = timeConvert - eqTime.start_realtime;
@@ -83,7 +83,7 @@ int EQTime::getEQTimeOfDay( time_t timeConvert, struct TimeOfDay_Struct *eqTimeO
int32 ntz = timezone;
/* The minutes range from 0 - 59 */
diff += eqTime.start_eqtime.minute + (ntz%60);
diff += eqTime.start_eqtime.minute + (ntz % 60);
eqTimeOfDay->minute = diff % 60;
diff /= 60;
ntz /= 60;
@@ -97,24 +97,24 @@ int EQTime::getEQTimeOfDay( time_t timeConvert, struct TimeOfDay_Struct *eqTimeO
//
// Modify it so that it works from
// 0-23 for our calculations
diff += ( eqTime.start_eqtime.hour - 1) + (ntz%24);
eqTimeOfDay->hour = (diff%24) + 1;
diff += (eqTime.start_eqtime.hour - 1) + (ntz % 24);
eqTimeOfDay->hour = (diff % 24) + 1;
diff /= 24;
ntz /= 24;
// The days range from 1-28
// Modify it so that it works from
// 0-27 for our calculations
diff += ( eqTime.start_eqtime.day - 1 ) + (ntz%28);
eqTimeOfDay->day = (diff%28) + 1;
diff += (eqTime.start_eqtime.day - 1) + (ntz % 28);
eqTimeOfDay->day = (diff % 28) + 1;
diff /= 28;
ntz /= 28;
// The months range from 1-12
// Modify it so that it works from
// 0-11 for our calculations
diff += ( eqTime.start_eqtime.month - 1 ) + (ntz%12);
eqTimeOfDay->month = (diff%12) + 1;
diff += (eqTime.start_eqtime.month - 1) + (ntz % 12);
eqTimeOfDay->month = (diff % 12) + 1;
diff /= 12;
ntz /= 12;
@@ -124,100 +124,34 @@ int EQTime::getEQTimeOfDay( time_t timeConvert, struct TimeOfDay_Struct *eqTimeO
}
//setEQTimeOfDay
int EQTime::setEQTimeOfDay(TimeOfDay_Struct start_eq, time_t start_real)
int EQTime::SetCurrentEQTimeOfDay(TimeOfDay_Struct start_eq, time_t start_real)
{
if(start_real==0)
if (start_real == 0)
return 0;
eqTime.start_eqtime=start_eq;
eqTime.start_realtime=start_real;
eqTime.start_eqtime = start_eq;
eqTime.start_realtime = start_real;
return 1;
}
//saveFile and loadFile need to use long for the save datatype...
//For some reason, ifstream/ofstream have problems with EQEmu datatypes in files.
bool EQTime::saveFile(const char *filename)
{
std::ofstream of;
of.open(filename);
if(!of)
{
Log.Out(Logs::General, Logs::Error, "EQTime::saveFile failed: Unable to open file '%s'", filename);
return false;
}
//Enable for debugging
of << EQT_VERSION << std::endl;
of << (long)eqTime.start_eqtime.day << std::endl;
of << (long)eqTime.start_eqtime.hour << std::endl;
of << (long)eqTime.start_eqtime.minute << std::endl;
of << (long)eqTime.start_eqtime.month << std::endl;
of << eqTime.start_eqtime.year << std::endl;
of << eqTime.start_realtime << std::endl;
of.close();
return true;
}
bool EQTime::loadFile(const char *filename)
{
int version=0;
long in_data=0;
std::ifstream in;
in.open(filename);
if(!in)
{
Log.Out(Logs::General, Logs::Error, "Could not load EQTime file %s", filename);
return false;
}
in >> version;
in.ignore(80, '\n');
if(version != EQT_VERSION)
{
Log.Out(Logs::General, Logs::Error, "'%s' is NOT a valid EQTime file. File version is %i, EQTime version is %i", filename, version, EQT_VERSION);
return false;
}
//in >> eqTime.start_eqtime.day;
in >> in_data;
in.ignore(80, '\n');
eqTime.start_eqtime.day = in_data;
//in >> eqTime.start_eqtime.hour;
in >> in_data;
eqTime.start_eqtime.hour = in_data;
in.ignore(80, '\n');
//in >> eqTime.start_eqtime.minute;
in >> in_data;
in.ignore(80, '\n');
eqTime.start_eqtime.minute = in_data;
//in >> eqTime.start_eqtime.month;
in >> in_data;
in.ignore(80, '\n');
eqTime.start_eqtime.month = in_data;
in >> eqTime.start_eqtime.year;
in.ignore(80, '\n');
in >> eqTime.start_realtime;
//Enable for debugging...
in.close();
return true;
}
bool EQTime::IsTimeBefore(TimeOfDay_Struct *base, TimeOfDay_Struct *test) {
if(base->year > test->year)
if (base->year > test->year)
return(true);
if(base->year < test->year)
if (base->year < test->year)
return(false);
//same years
if(base->month > test->month)
if (base->month > test->month)
return(true);
if(base->month < test->month)
if (base->month < test->month)
return(false);
//same month
if(base->day > test->day)
if (base->day > test->day)
return(true);
if(base->day < test->day)
if (base->day < test->day)
return(false);
//same day
if(base->hour > test->hour)
if (base->hour > test->hour)
return(true);
if(base->hour < test->hour)
if (base->hour < test->hour)
return(false);
//same hour...
return(base->minute > test->minute);
@@ -230,7 +164,7 @@ void EQTime::AddMinutes(uint32 minutes, TimeOfDay_Struct *to) {
//minutes start at 0, everything else starts at 1
cur = to->minute;
cur += minutes;
if(cur < 60) {
if (cur < 60) {
to->minute = cur;
return;
}
@@ -238,29 +172,29 @@ void EQTime::AddMinutes(uint32 minutes, TimeOfDay_Struct *to) {
//carry hours
cur /= 60;
cur += to->hour;
if(cur <= 24) {
if (cur <= 24) {
to->hour = cur;
return;
}
to->hour = ((cur-1) % 24) + 1;
to->hour = ((cur - 1) % 24) + 1;
//carry days
cur = (cur-1) / 24;
cur = (cur - 1) / 24;
cur += to->day;
if(cur <= 28) {
if (cur <= 28) {
to->day = cur;
return;
}
to->day = ((cur-1) % 28) + 1;
to->day = ((cur - 1) % 28) + 1;
//carry months
cur = (cur-1) / 28;
cur = (cur - 1) / 28;
cur += to->month;
if(cur <= 12) {
if (cur <= 12) {
to->month = cur;
return;
}
to->month = ((cur-1) % 12) + 1;
to->month = ((cur - 1) % 12) + 1;
//carry years
to->year += (cur-1) / 12;
to->year += (cur - 1) / 12;
}
void EQTime::ToString(TimeOfDay_Struct *t, std::string &str) {
@@ -269,5 +203,4 @@ void EQTime::ToString(TimeOfDay_Struct *t, std::string &str) {
t->month, t->day, t->year, t->hour, t->minute);
buf[127] = '\0';
str = buf;
}
}
+3 -9
View File
@@ -21,8 +21,8 @@ public:
~EQTime();
//Get functions
int getEQTimeOfDay( TimeOfDay_Struct *eqTimeOfDay ) { return(getEQTimeOfDay(time(nullptr), eqTimeOfDay)); }
int getEQTimeOfDay( time_t timeConvert, TimeOfDay_Struct *eqTimeOfDay );
int GetCurrentEQTimeOfDay( TimeOfDay_Struct *eqTimeOfDay ) { return(GetCurrentEQTimeOfDay(time(nullptr), eqTimeOfDay)); }
int GetCurrentEQTimeOfDay( time_t timeConvert, TimeOfDay_Struct *eqTimeOfDay );
TimeOfDay_Struct getStartEQTime() { return eqTime.start_eqtime; }
time_t getStartRealTime() { return eqTime.start_realtime; }
uint32 getEQTimeZone() { return timezone; }
@@ -30,7 +30,7 @@ public:
uint32 getEQTimeZoneMin() { return timezone%60; }
//Set functions
int setEQTimeOfDay(TimeOfDay_Struct start_eq, time_t start_real);
int SetCurrentEQTimeOfDay(TimeOfDay_Struct start_eq, time_t start_real);
void setEQTimeZone(int32 in_timezone) { timezone=in_timezone; }
//Time math/logic functions
@@ -39,12 +39,6 @@ public:
static void ToString(TimeOfDay_Struct *t, std::string &str);
//Database functions
//bool loadDB(Database q);
//bool setDB(Database q);
bool loadFile(const char *filename);
bool saveFile(const char *filename);
private:
//This is our reference clock.
eqTimeOfDay eqTime;
-1
View File
@@ -26,7 +26,6 @@ void InitExtendedProfile(ExtendedProfile_Struct *p) {
}
bool SetExtendedProfile(ExtendedProfile_Struct *to, char *old, unsigned int len) {
_eqp
if(len == 0 || old == nullptr) {
//handle old chars without an extended profile...
InitExtendedProfile(to);
+3 -1
View File
@@ -40,7 +40,7 @@ struct ExtendedProfile_Struct {
uint16 old_pet_hp; /* Not Used */
uint16 old_pet_mana; /* Not Used */
SpellBuff_Struct pet_buffs[BUFF_COUNT]; /* Not Used */
uint32 pet_items[_MaterialCount]; /* Not Used */
uint32 pet_items[EQEmu::legacy::MaterialCount]; /* Not Used */
char merc_name[64]; /* Used */
uint32 aa_effects; /* Used */
@@ -54,6 +54,8 @@ struct ExtendedProfile_Struct {
uint32 mercTimerRemaining; /* Not Used */
uint8 mercGender; /* Not Used */
int32 mercState; /* Not Used */
uint32 last_invsnapshot_time; /* Used */
uint32 next_invsnapshot_time; /* Used */
};
#pragma pack()
-4
View File
@@ -21,7 +21,6 @@
const char *FactionValueToString(FACTION_VALUE fv)
{
_eqp
switch (fv) {
case FACTION_ALLY:
return ("Ally");
@@ -56,7 +55,6 @@ const char *FactionValueToString(FACTION_VALUE fv)
//o--------------------------------------------------------------
FACTION_VALUE CalculateFaction(FactionMods* fm, int32 tmpCharacter_value)
{
_eqp
int32 character_value = tmpCharacter_value;
if (fm) {
character_value += fm->base + fm->class_mod + fm->race_mod + fm->deity_mod;
@@ -94,7 +92,6 @@ FACTION_VALUE CalculateFaction(FactionMods* fm, int32 tmpCharacter_value)
// this function should check if some races have more than one race define
bool IsOfEqualRace(int r1, int r2)
{
_eqp
if (r1 == r2) {
return true;
}
@@ -116,7 +113,6 @@ bool IsOfEqualRace(int r1, int r2)
// trolls endure ogres, dark elves, ...
bool IsOfIndiffRace(int r1, int r2)
{
_eqp
if (r1 == r2) {
return true;
}
+7 -1
View File
@@ -154,11 +154,12 @@ enum { //reuse times
enum { //timer settings, all in milliseconds
AImovement_duration = 100,
AIthink_duration = 150,
AIscanarea_delay = 500,
AIscanarea_delay = 6000,
AIfeignremember_delay = 500,
AItarget_check_duration = 500,
AIClientScanarea_delay = 750, //used in REVERSE_AGGRO
AIassistcheck_delay = 3000, //now often a fighting NPC will yell for help
AI_check_signal_timer_delay = 500, // How often EVENT_SIGNAL checks are processed
ClientProximity_interval = 150,
CombatEventTimer_expire = 12000,
Tribute_duration = 600000,
@@ -232,6 +233,8 @@ enum { //some random constants
#define GROUP_EXP_PER_POINT 1000
#define RAID_EXP_PER_POINT 2000
#define ZONE_CONTROLLER_NPC_ID 10
//Some hard coded statuses from commands and other places:
enum {
minStatusToBeGM = 40,
@@ -270,6 +273,9 @@ enum {
#define NPC_DEFAULT_LOGGING_ENABLED false
// This is the item ID we use for say links, we use the max that fits in 5 ASCII chars
#define SAYLINK_ITEM_ID 0xFFFFF
/*
+2 -8
View File
@@ -16,6 +16,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// WHY IS THIS UP HERE
#if defined(_DEBUG) && defined(WIN32)
#ifndef _CRTDBG_MAP_ALLOC
#include <stdlib.h>
@@ -26,16 +27,9 @@
#ifndef EQDEBUG_H
#define EQDEBUG_H
#define _WINSOCKAPI_ //stupid windows, trying to fix the winsock2 vs. winsock issues
#if defined(WIN32) && ( defined(PACKETCOLLECTOR) || defined(COLLECTOR) )
// Packet Collector on win32 requires winsock.h due to latest pcap.h
// winsock.h must come before windows.h
#include <winsock.h>
#endif
#ifdef _WINDOWS
#include <windows.h>
#include <winsock2.h>
#include <windows.h>
#endif
#endif
+27 -81
View File
@@ -39,8 +39,10 @@ BaseGuildManager::~BaseGuildManager() {
ClearGuilds();
}
bool BaseGuildManager::LoadGuilds() {
_eqp
ClearGuilds();
if(m_db == nullptr) {
@@ -102,7 +104,6 @@ bool BaseGuildManager::LoadGuilds() {
}
bool BaseGuildManager::RefreshGuild(uint32 guild_id) {
_eqp
if(m_db == nullptr) {
Log.Out(Logs::Detail, Logs::Guilds, "Requested to refresh guild %d when we have no database object.", guild_id);
return(false);
@@ -168,7 +169,6 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) {
BaseGuildManager::GuildInfo *BaseGuildManager::_CreateGuild(uint32 guild_id, const char *guild_name, uint32 leader_char_id, uint8 minstatus, const char *guild_motd, const char *motd_setter, const char *Channel, const char *URL)
{
_eqp
std::map<uint32, GuildInfo *>::iterator res;
//remove any old entry.
@@ -179,7 +179,7 @@ BaseGuildManager::GuildInfo *BaseGuildManager::_CreateGuild(uint32 guild_id, con
}
//make the new entry and store it into the map.
GuildInfo *info = new GuildInfo;
auto info = new GuildInfo;
info->name = guild_name;
info->leader_char_id = leader_char_id;
info->minstatus = minstatus;
@@ -213,7 +213,6 @@ BaseGuildManager::GuildInfo *BaseGuildManager::_CreateGuild(uint32 guild_id, con
}
bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) {
_eqp
if(m_db == nullptr) {
Log.Out(Logs::Detail, Logs::Guilds, "Requested to store guild %d when we have no database object.", guild_id);
return(false);
@@ -237,9 +236,9 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) {
results = m_db->QueryDatabase(query);
//escape our strings.
char *name_esc = new char[info->name.length()*2+1];
char *motd_esc = new char[info->motd.length()*2+1];
char *motd_set_esc = new char[info->motd_setter.length()*2+1];
auto name_esc = new char[info->name.length() * 2 + 1];
auto motd_esc = new char[info->motd.length() * 2 + 1];
auto motd_set_esc = new char[info->motd_setter.length() * 2 + 1];
m_db->DoEscapeString(name_esc, info->name.c_str(), info->name.length());
m_db->DoEscapeString(motd_esc, info->motd.c_str(), info->motd.length());
m_db->DoEscapeString(motd_set_esc, info->motd_setter.c_str(), info->motd_setter.length());
@@ -265,7 +264,7 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) {
for(rank = 0; rank <= GUILD_MAX_RANK; rank++) {
const RankInfo &rankInfo = info->ranks[rank];
char *title_esc = new char[rankInfo.name.length()*2+1];
auto title_esc = new char[rankInfo.name.length() * 2 + 1];
m_db->DoEscapeString(title_esc, rankInfo.name.c_str(), rankInfo.name.length());
query = StringFormat("INSERT INTO guild_ranks "
@@ -296,7 +295,6 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) {
}
uint32 BaseGuildManager::_GetFreeGuildID() {
_eqp
if(m_db == nullptr) {
Log.Out(Logs::Detail, Logs::Guilds, "Requested find a free guild ID when we have no database object.");
return(GUILD_NONE);
@@ -344,7 +342,6 @@ uint32 BaseGuildManager::_GetFreeGuildID() {
uint32 BaseGuildManager::CreateGuild(const char* name, uint32 leader_char_id) {
_eqp
uint32 gid = DBCreateGuild(name, leader_char_id);
if(gid == GUILD_NONE)
return(GUILD_NONE);
@@ -356,7 +353,6 @@ uint32 BaseGuildManager::CreateGuild(const char* name, uint32 leader_char_id) {
}
bool BaseGuildManager::DeleteGuild(uint32 guild_id) {
_eqp
if(!DBDeleteGuild(guild_id))
return(false);
@@ -366,7 +362,6 @@ bool BaseGuildManager::DeleteGuild(uint32 guild_id) {
}
bool BaseGuildManager::RenameGuild(uint32 guild_id, const char* name) {
_eqp
if(!DBRenameGuild(guild_id, name))
return(false);
@@ -376,7 +371,6 @@ bool BaseGuildManager::RenameGuild(uint32 guild_id, const char* name) {
}
bool BaseGuildManager::SetGuildLeader(uint32 guild_id, uint32 leader_char_id) {
_eqp
//get old leader first.
std::map<uint32, GuildInfo *>::const_iterator res;
res = m_guilds.find(guild_id);
@@ -396,7 +390,6 @@ bool BaseGuildManager::SetGuildLeader(uint32 guild_id, uint32 leader_char_id) {
}
bool BaseGuildManager::SetGuildMOTD(uint32 guild_id, const char* motd, const char *setter) {
_eqp
if(!DBSetGuildMOTD(guild_id, motd, setter))
return(false);
@@ -407,7 +400,6 @@ bool BaseGuildManager::SetGuildMOTD(uint32 guild_id, const char* motd, const cha
bool BaseGuildManager::SetGuildURL(uint32 GuildID, const char* URL)
{
_eqp
if(!DBSetGuildURL(GuildID, URL))
return(false);
@@ -418,7 +410,6 @@ bool BaseGuildManager::SetGuildURL(uint32 GuildID, const char* URL)
bool BaseGuildManager::SetGuildChannel(uint32 GuildID, const char* Channel)
{
_eqp
if(!DBSetGuildChannel(GuildID, Channel))
return(false);
@@ -428,7 +419,6 @@ bool BaseGuildManager::SetGuildChannel(uint32 GuildID, const char* Channel)
}
bool BaseGuildManager::SetGuild(uint32 charid, uint32 guild_id, uint8 rank) {
_eqp
if(rank > GUILD_MAX_RANK && guild_id != GUILD_NONE)
return(false);
@@ -449,7 +439,6 @@ bool BaseGuildManager::SetGuild(uint32 charid, uint32 guild_id, uint8 rank) {
//changes rank, but not guild.
bool BaseGuildManager::SetGuildRank(uint32 charid, uint8 rank) {
_eqp
if(rank > GUILD_MAX_RANK)
return(false);
@@ -463,7 +452,6 @@ bool BaseGuildManager::SetGuildRank(uint32 charid, uint8 rank) {
bool BaseGuildManager::SetBankerFlag(uint32 charid, bool is_banker) {
_eqp
if(!DBSetBankerFlag(charid, is_banker))
return(false);
@@ -473,14 +461,12 @@ bool BaseGuildManager::SetBankerFlag(uint32 charid, bool is_banker) {
}
bool BaseGuildManager::ForceRankUpdate(uint32 charid) {
_eqp
SendRankUpdate(charid);
return(true);
}
bool BaseGuildManager::SetAltFlag(uint32 charid, bool is_alt)
{
_eqp
if(!DBSetAltFlag(charid, is_alt))
return(false);
@@ -490,7 +476,6 @@ bool BaseGuildManager::SetAltFlag(uint32 charid, bool is_alt)
}
bool BaseGuildManager::SetTributeFlag(uint32 charid, bool enabled) {
_eqp
if(!DBSetTributeFlag(charid, enabled))
return(false);
@@ -500,7 +485,6 @@ bool BaseGuildManager::SetTributeFlag(uint32 charid, bool enabled) {
}
bool BaseGuildManager::SetPublicNote(uint32 charid, const char *note) {
_eqp
if(!DBSetPublicNote(charid, note))
return(false);
@@ -510,7 +494,6 @@ bool BaseGuildManager::SetPublicNote(uint32 charid, const char *note) {
}
uint32 BaseGuildManager::DBCreateGuild(const char* name, uint32 leader) {
_eqp
//first try to find a free ID.
uint32 new_id = _GetFreeGuildID();
if(new_id == GUILD_NONE)
@@ -532,7 +515,6 @@ uint32 BaseGuildManager::DBCreateGuild(const char* name, uint32 leader) {
}
bool BaseGuildManager::DBDeleteGuild(uint32 guild_id) {
_eqp
//remove the local entry
std::map<uint32, GuildInfo *>::iterator res;
@@ -569,7 +551,6 @@ bool BaseGuildManager::DBDeleteGuild(uint32 guild_id) {
}
bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) {
_eqp
if(m_db == nullptr) {
Log.Out(Logs::Detail, Logs::Guilds, "Requested to rename guild %d when we have no database object.", guild_id);
return false;
@@ -583,7 +564,7 @@ bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) {
//escape our strings.
uint32 len = strlen(name);
char *esc = new char[len*2+1];
auto esc = new char[len * 2 + 1];
m_db->DoEscapeString(esc, name, len);
//insert the new `guilds` entry
@@ -606,7 +587,6 @@ bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) {
}
bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) {
_eqp
if(m_db == nullptr) {
Log.Out(Logs::Detail, Logs::Guilds, "Requested to set the leader for guild %d when we have no database object.", guild_id);
return false;
@@ -642,7 +622,6 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) {
}
bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const char *setter) {
_eqp
if(m_db == nullptr) {
Log.Out(Logs::Detail, Logs::Guilds, "Requested to set the MOTD for guild %d when we have no database object.", guild_id);
return(false);
@@ -657,8 +636,8 @@ bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const c
//escape our strings.
uint32 len = strlen(motd);
uint32 len2 = strlen(setter);
char *esc = new char[len*2+1];
char *esc_set = new char[len2*2+1];
auto esc = new char[len * 2 + 1];
auto esc_set = new char[len2 * 2 + 1];
m_db->DoEscapeString(esc, motd, len);
m_db->DoEscapeString(esc_set, setter, len2);
@@ -685,7 +664,6 @@ bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const c
bool BaseGuildManager::DBSetGuildURL(uint32 GuildID, const char* URL)
{
_eqp
if(m_db == nullptr)
return false;
@@ -697,7 +675,7 @@ bool BaseGuildManager::DBSetGuildURL(uint32 GuildID, const char* URL)
//escape our strings.
uint32 len = strlen(URL);
char *esc = new char[len*2+1];
auto esc = new char[len * 2 + 1];
m_db->DoEscapeString(esc, URL, len);
std::string query = StringFormat("UPDATE guilds SET url='%s' WHERE id=%d", esc, GuildID);
@@ -719,7 +697,6 @@ bool BaseGuildManager::DBSetGuildURL(uint32 GuildID, const char* URL)
bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel)
{
_eqp
if(m_db == nullptr)
return(false);
@@ -732,7 +709,7 @@ bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel)
//escape our strings.
uint32 len = strlen(Channel);
char *esc = new char[len*2+1];
auto esc = new char[len * 2 + 1];
m_db->DoEscapeString(esc, Channel, len);
std::string query = StringFormat("UPDATE guilds SET channel='%s' WHERE id=%d", esc, GuildID);
@@ -753,7 +730,6 @@ bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel)
}
bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) {
_eqp
if(m_db == nullptr) {
Log.Out(Logs::Detail, Logs::Guilds, "Requested to set char to guild %d when we have no database object.", guild_id);
return(false);
@@ -782,13 +758,11 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) {
}
bool BaseGuildManager::DBSetGuildRank(uint32 charid, uint8 rank) {
_eqp
std::string query = StringFormat("UPDATE guild_members SET rank=%d WHERE char_id=%d", rank, charid);
return(QueryWithLogging(query, "setting a guild member's rank"));
}
bool BaseGuildManager::DBSetBankerFlag(uint32 charid, bool is_banker) {
_eqp
std::string query = StringFormat("UPDATE guild_members SET banker=%d WHERE char_id=%d",
is_banker? 1: 0, charid);
return(QueryWithLogging(query, "setting a guild member's banker flag"));
@@ -796,7 +770,6 @@ bool BaseGuildManager::DBSetBankerFlag(uint32 charid, bool is_banker) {
bool BaseGuildManager::GetBankerFlag(uint32 CharID)
{
_eqp
if(!m_db)
return false;
@@ -819,7 +792,6 @@ bool BaseGuildManager::GetBankerFlag(uint32 CharID)
bool BaseGuildManager::DBSetAltFlag(uint32 charid, bool is_alt)
{
_eqp
std::string query = StringFormat("UPDATE guild_members SET alt=%d WHERE char_id=%d",
is_alt ? 1: 0, charid);
@@ -828,7 +800,6 @@ bool BaseGuildManager::DBSetAltFlag(uint32 charid, bool is_alt)
bool BaseGuildManager::GetAltFlag(uint32 CharID)
{
_eqp
if(!m_db)
return false;
@@ -850,20 +821,18 @@ bool BaseGuildManager::GetAltFlag(uint32 CharID)
}
bool BaseGuildManager::DBSetTributeFlag(uint32 charid, bool enabled) {
_eqp
std::string query = StringFormat("UPDATE guild_members SET tribute_enable=%d WHERE char_id=%d",
enabled ? 1: 0, charid);
return(QueryWithLogging(query, "setting a guild member's tribute flag"));
}
bool BaseGuildManager::DBSetPublicNote(uint32 charid, const char* note) {
_eqp
if(m_db == nullptr)
return(false);
//escape our strings.
uint32 len = strlen(note);
char *esc = new char[len*2+1];
auto esc = new char[len * 2 + 1];
m_db->DoEscapeString(esc, note, len);
//insert the new `guilds` entry
@@ -882,7 +851,6 @@ bool BaseGuildManager::DBSetPublicNote(uint32 charid, const char* note) {
}
bool BaseGuildManager::QueryWithLogging(std::string query, const char *errmsg) {
_eqp
if(m_db == nullptr)
return(false);
@@ -899,19 +867,18 @@ bool BaseGuildManager::QueryWithLogging(std::string query, const char *errmsg) {
//factored out so I dont have to copy this crap.
#ifdef BOTS
#define GuildMemberBaseQuery \
"SELECT c.id,c.name,c.class,c.level,c.timelaston,c.zoneid," \
" g.guild_id,g.rank,g.tribute_enable,g.total_tribute,g.last_tribute," \
" g.banker,g.public_note,g.alt" \
" FROM vwBotCharacterMobs AS c LEFT JOIN vwGuildMembers AS g ON c.id=g.char_id AND c.mobtype = g.mobtype "
"SELECT c.`id`, c.`name`, c.`class`, c.`level`, c.`last_login`, c.`zone_id`," \
" g.`guild_id`, g.`rank`, g.`tribute_enable`, g.`total_tribute`, g.`last_tribute`," \
" g.`banker`, g.`public_note`, g.`alt`" \
" FROM `vw_bot_character_mobs` AS c LEFT JOIN `vw_guild_members` AS g ON c.`id` = g.`char_id` AND c.`mob_type` = g.`mob_type` "
#else
#define GuildMemberBaseQuery \
"SELECT c.id,c.name,c.class,c.level,c.last_login,c.zone_id," \
" g.guild_id,g.rank,g.tribute_enable,g.total_tribute,g.last_tribute," \
" g.banker,g.public_note,g.alt " \
" FROM `character_data` AS c LEFT JOIN guild_members AS g ON c.id=g.char_id "
"SELECT c.`id`, c.`name`, c.`class`, c.`level`, c.`last_login`, c.`zone_id`," \
" g.`guild_id`, g.`rank`, g.`tribute_enable`, g.`total_tribute`, g.`last_tribute`," \
" g.`banker`, g.`public_note`, g.`alt` " \
" FROM `character_data` AS c LEFT JOIN `guild_members` AS g ON c.`id` = g.`char_id` "
#endif
static void ProcessGuildMember(MySQLRequestRow row, CharGuildInfo &into) {
_eqp
//fields from `characer_`
into.char_id = atoi(row[0]);
into.char_name = row[1];
@@ -939,7 +906,6 @@ static void ProcessGuildMember(MySQLRequestRow row, CharGuildInfo &into) {
bool BaseGuildManager::GetEntireGuild(uint32 guild_id, std::vector<CharGuildInfo *> &members) {
_eqp
members.clear();
if(m_db == nullptr)
@@ -952,8 +918,8 @@ bool BaseGuildManager::GetEntireGuild(uint32 guild_id, std::vector<CharGuildInfo
return false;
}
for (auto row = results.begin(); row != results.end(); ++row) {
CharGuildInfo *ci = new CharGuildInfo;
for (auto row = results.begin(); row != results.end(); ++row) {
auto ci = new CharGuildInfo;
ProcessGuildMember(row, *ci);
members.push_back(ci);
}
@@ -964,7 +930,6 @@ bool BaseGuildManager::GetEntireGuild(uint32 guild_id, std::vector<CharGuildInfo
}
bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) {
_eqp
if(m_db == nullptr) {
Log.Out(Logs::Detail, Logs::Guilds, "Requested char info on %s when we have no database object.", char_name);
return(false);
@@ -972,7 +937,7 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) {
//escape our strings.
uint32 nl = strlen(char_name);
char *esc = new char[nl*2+1];
auto esc = new char[nl * 2 + 1];
m_db->DoEscapeString(esc, char_name, nl);
//load up the rank info for each guild.
@@ -996,7 +961,6 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) {
}
bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) {
_eqp
if(m_db == nullptr) {
Log.Out(Logs::Detail, Logs::Guilds, "Requested char info on %d when we have no database object.", char_id);
return false;
@@ -1005,7 +969,7 @@ bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) {
//load up the rank info for each guild.
std::string query;
#ifdef BOTS
query = StringFormat(GuildMemberBaseQuery " WHERE c.id=%d AND c.mobtype = 'C'", char_id);
query = StringFormat(GuildMemberBaseQuery " WHERE c.id=%d AND c.mob_type = 'C'", char_id);
#else
query = StringFormat(GuildMemberBaseQuery " WHERE c.id=%d", char_id);
#endif
@@ -1027,11 +991,10 @@ bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) {
//returns ownership of the buffer.
uint8 *BaseGuildManager::MakeGuildList(const char *head_name, uint32 &length) const {
_eqp
//dynamic structs will make this a lot less painful.
length = sizeof(GuildsList_Struct);
uint8 *buffer = new uint8[length];
auto buffer = new uint8[length];
//a bit little better than memsetting the whole thing...
uint32 r,pos;
@@ -1055,7 +1018,6 @@ uint8 *BaseGuildManager::MakeGuildList(const char *head_name, uint32 &length) co
}
const char *BaseGuildManager::GetRankName(uint32 guild_id, uint8 rank) const {
_eqp
if(rank > GUILD_MAX_RANK)
return("Invalid Rank");
std::map<uint32, GuildInfo *>::const_iterator res;
@@ -1066,7 +1028,6 @@ const char *BaseGuildManager::GetRankName(uint32 guild_id, uint8 rank) const {
}
const char *BaseGuildManager::GetGuildName(uint32 guild_id) const {
_eqp
if(guild_id == GUILD_NONE)
return("");
std::map<uint32, GuildInfo *>::const_iterator res;
@@ -1077,7 +1038,6 @@ const char *BaseGuildManager::GetGuildName(uint32 guild_id) const {
}
bool BaseGuildManager::GetGuildNameByID(uint32 guild_id, std::string &into) const {
_eqp
std::map<uint32, GuildInfo *>::const_iterator res;
res = m_guilds.find(guild_id);
if(res == m_guilds.end())
@@ -1088,7 +1048,6 @@ bool BaseGuildManager::GetGuildNameByID(uint32 guild_id, std::string &into) cons
uint32 BaseGuildManager::GetGuildIDByName(const char *GuildName)
{
_eqp
std::map<uint32, GuildInfo *>::iterator Iterator;
for(Iterator = m_guilds.begin(); Iterator != m_guilds.end(); ++Iterator)
@@ -1101,7 +1060,6 @@ uint32 BaseGuildManager::GetGuildIDByName(const char *GuildName)
}
bool BaseGuildManager::GetGuildMOTD(uint32 guild_id, char *motd_buffer, char *setter_buffer) const {
_eqp
std::map<uint32, GuildInfo *>::const_iterator res;
res = m_guilds.find(guild_id);
if(res == m_guilds.end())
@@ -1113,7 +1071,6 @@ bool BaseGuildManager::GetGuildMOTD(uint32 guild_id, char *motd_buffer, char *se
bool BaseGuildManager::GetGuildURL(uint32 GuildID, char *URLBuffer) const
{
_eqp
std::map<uint32, GuildInfo *>::const_iterator res;
res = m_guilds.find(GuildID);
if(res == m_guilds.end())
@@ -1125,7 +1082,6 @@ bool BaseGuildManager::GetGuildURL(uint32 GuildID, char *URLBuffer) const
bool BaseGuildManager::GetGuildChannel(uint32 GuildID, char *ChannelBuffer) const
{
_eqp
std::map<uint32, GuildInfo *>::const_iterator res;
res = m_guilds.find(GuildID);
if(res == m_guilds.end())
@@ -1135,14 +1091,12 @@ bool BaseGuildManager::GetGuildChannel(uint32 GuildID, char *ChannelBuffer) cons
}
bool BaseGuildManager::GuildExists(uint32 guild_id) const {
_eqp
if(guild_id == GUILD_NONE)
return(false);
return(m_guilds.find(guild_id) != m_guilds.end());
}
bool BaseGuildManager::IsGuildLeader(uint32 guild_id, uint32 char_id) const {
_eqp
if(guild_id == GUILD_NONE) {
Log.Out(Logs::Detail, Logs::Guilds, "Check leader for char %d: not a guild.", char_id);
return(false);
@@ -1158,7 +1112,6 @@ bool BaseGuildManager::IsGuildLeader(uint32 guild_id, uint32 char_id) const {
}
uint32 BaseGuildManager::FindGuildByLeader(uint32 leader) const {
_eqp
std::map<uint32, GuildInfo *>::const_iterator cur, end;
cur = m_guilds.begin();
end = m_guilds.end();
@@ -1171,7 +1124,6 @@ uint32 BaseGuildManager::FindGuildByLeader(uint32 leader) const {
//returns the rank to be sent to the client for display purposes, given their eqemu rank.
uint8 BaseGuildManager::GetDisplayedRank(uint32 guild_id, uint8 rank, uint32 char_id) const {
_eqp
std::map<uint32, GuildInfo *>::const_iterator res;
res = m_guilds.find(guild_id);
if(res == m_guilds.end())
@@ -1184,7 +1136,6 @@ uint8 BaseGuildManager::GetDisplayedRank(uint32 guild_id, uint8 rank, uint32 cha
}
bool BaseGuildManager::CheckGMStatus(uint32 guild_id, uint8 status) const {
_eqp
if(status >= 250) {
Log.Out(Logs::Detail, Logs::Guilds, "Check permission on guild %d with user status %d > 250, granted.", guild_id, status);
return(true); //250+ as allowed anything
@@ -1206,7 +1157,6 @@ bool BaseGuildManager::CheckGMStatus(uint32 guild_id, uint8 status) const {
}
bool BaseGuildManager::CheckPermission(uint32 guild_id, uint8 rank, GuildAction act) const {
_eqp
if(rank > GUILD_MAX_RANK) {
Log.Out(Logs::Detail, Logs::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid rank, denied.",
guild_id, rank, GuildActionNames[act], act);
@@ -1232,7 +1182,6 @@ bool BaseGuildManager::CheckPermission(uint32 guild_id, uint8 rank, GuildAction
}
bool BaseGuildManager::LocalDeleteGuild(uint32 guild_id) {
_eqp
std::map<uint32, GuildInfo *>::iterator res;
res = m_guilds.find(guild_id);
if(res == m_guilds.end())
@@ -1252,21 +1201,18 @@ void BaseGuildManager::ClearGuilds() {
}
BaseGuildManager::RankInfo::RankInfo() {
_eqp
uint8 r;
for(r = 0; r < _MaxGuildAction; r++)
permissions[r] = false;
}
BaseGuildManager::GuildInfo::GuildInfo() {
_eqp
leader_char_id = 0;
minstatus = 0;
}
uint32 BaseGuildManager::DoesAccountContainAGuildLeader(uint32 AccountID)
{
_eqp
std::string query = StringFormat("SELECT guild_id FROM guild_members WHERE char_id IN "
"(SELECT id FROM `character_data` WHERE account_id = %i) AND rank = 2",
AccountID);
+147
View File
@@ -0,0 +1,147 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
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 "inventory_version.h"
bool EQEmu::versions::IsValidInventoryVersion(InventoryVersion inventory_version)
{
if (inventory_version <= InventoryVersion::Unknown || inventory_version > LastInventoryVersion)
return false;
return true;
}
bool EQEmu::versions::IsValidPCInventoryVersion(InventoryVersion inventory_version)
{
if (inventory_version <= InventoryVersion::Unknown || inventory_version > LastPCInventoryVersion)
return false;
return true;
}
bool EQEmu::versions::IsValidNonPCInventoryVersion(InventoryVersion inventory_version)
{
if (inventory_version <= LastPCInventoryVersion || inventory_version > LastNonPCInventoryVersion)
return false;
return true;
}
EQEmu::versions::InventoryVersion EQEmu::versions::ValidateInventoryVersion(InventoryVersion inventory_version)
{
if (inventory_version <= InventoryVersion::Unknown || inventory_version > LastInventoryVersion)
return InventoryVersion::Unknown;
return inventory_version;
}
EQEmu::versions::InventoryVersion EQEmu::versions::ValidatePCInventoryVersion(InventoryVersion inventory_version)
{
if (inventory_version <= InventoryVersion::Unknown || inventory_version > LastPCInventoryVersion)
return InventoryVersion::Unknown;
return inventory_version;
}
EQEmu::versions::InventoryVersion EQEmu::versions::ValidateNonPCInventoryVersion(InventoryVersion inventory_version)
{
if (inventory_version <= LastPCInventoryVersion || inventory_version > LastNonPCInventoryVersion)
return InventoryVersion::Unknown;
return inventory_version;
}
const char* EQEmu::versions::InventoryVersionName(InventoryVersion inventory_version)
{
switch (inventory_version) {
case InventoryVersion::Unknown:
return "Unknown Version";
case InventoryVersion::Client62:
return "Client 6.2";
case InventoryVersion::Titanium:
return "Titanium";
case InventoryVersion::SoF:
return "SoF";
case InventoryVersion::SoD:
return "SoD";
case InventoryVersion::UF:
return "UF";
case InventoryVersion::RoF:
return "RoF";
case InventoryVersion::RoF2:
return "RoF2";
case InventoryVersion::NPC:
return "NPC";
case InventoryVersion::Merc:
return "Merc";
case InventoryVersion::Bot:
return "Bot";
case InventoryVersion::Pet:
return "Pet";
default:
return "Invalid Version";
};
}
EQEmu::versions::ClientVersion EQEmu::versions::ConvertInventoryVersionToClientVersion(InventoryVersion inventory_version)
{
switch (inventory_version) {
case InventoryVersion::Unknown:
case InventoryVersion::Client62:
return ClientVersion::Unknown;
case InventoryVersion::Titanium:
return ClientVersion::Titanium;
case InventoryVersion::SoF:
return ClientVersion::SoF;
case InventoryVersion::SoD:
return ClientVersion::SoD;
case InventoryVersion::UF:
return ClientVersion::UF;
case InventoryVersion::RoF:
return ClientVersion::RoF;
case InventoryVersion::RoF2:
return ClientVersion::RoF2;
default:
return ClientVersion::Unknown;
}
}
EQEmu::versions::InventoryVersion EQEmu::versions::ConvertClientVersionToInventoryVersion(ClientVersion client_version)
{
switch (client_version) {
case ClientVersion::Unknown:
case ClientVersion::Client62:
return InventoryVersion::Unknown;
case ClientVersion::Titanium:
return InventoryVersion::Titanium;
case ClientVersion::SoF:
return InventoryVersion::SoF;
case ClientVersion::SoD:
return InventoryVersion::SoD;
case ClientVersion::UF:
return InventoryVersion::UF;
case ClientVersion::RoF:
return InventoryVersion::RoF;
case ClientVersion::RoF2:
return InventoryVersion::RoF2;
default:
return InventoryVersion::Unknown;
}
}
+63
View File
@@ -0,0 +1,63 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
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
*/
#ifndef COMMON_INVENTORY_VERSION_H
#define COMMON_INVENTORY_VERSION_H
#include "client_version.h"
namespace EQEmu
{
namespace versions {
enum class InventoryVersion {
Unknown = 0,
Client62,
Titanium,
SoF,
SoD,
UF,
RoF,
RoF2,
NPC,
Merc,
Bot,
Pet
};
static const InventoryVersion LastInventoryVersion = InventoryVersion::Pet;
static const InventoryVersion LastPCInventoryVersion = InventoryVersion::RoF2;
static const InventoryVersion LastNonPCInventoryVersion = InventoryVersion::Pet;
static const size_t InventoryVersionCount = (static_cast<size_t>(LastInventoryVersion) + 1);
extern bool IsValidInventoryVersion(InventoryVersion inventory_version);
extern bool IsValidPCInventoryVersion(InventoryVersion inventory_version);
extern bool IsValidNonPCInventoryVersion(InventoryVersion inventory_version);
extern InventoryVersion ValidateInventoryVersion(InventoryVersion inventory_version);
extern InventoryVersion ValidatePCInventoryVersion(InventoryVersion inventory_version);
extern InventoryVersion ValidateNonPCInventoryVersion(InventoryVersion inventory_version);
extern const char* InventoryVersionName(InventoryVersion inventory_version);
extern ClientVersion ConvertInventoryVersionToClientVersion(InventoryVersion inventory_version);
extern InventoryVersion ConvertClientVersionToInventoryVersion(ClientVersion client_version);
} /*versions*/
} /*EQEmu*/
#endif /*COMMON_INVENTORY_VERSION_H*/
+7 -3
View File
@@ -18,7 +18,9 @@
#include "ipc_mutex.h"
#ifdef _WINDOWS
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#undef WIN32_LEAN_AND_MEAN
#else
#include <sys/types.h>
#include <sys/stat.h>
@@ -27,7 +29,7 @@
#endif
#include "types.h"
#include "eqemu_exception.h"
#include "eqemu_config.h"
namespace EQEmu {
struct IPCMutex::Implementation {
@@ -41,7 +43,8 @@ namespace EQEmu {
IPCMutex::IPCMutex(std::string name) : locked_(false) {
imp_ = new Implementation;
#ifdef _WINDOWS
std::string final_name = "EQEmuMutex_";
auto Config = EQEmuConfig::get();
std::string final_name = Config->SharedMemDir + "EQEmuMutex_";
final_name += name;
imp_->mut_ = CreateMutex(nullptr,
@@ -52,7 +55,8 @@ namespace EQEmu {
EQ_EXCEPT("IPC Mutex", "Could not create mutex.");
}
#else
std::string final_name = name;
auto Config = EQEmuConfig::get();
std::string final_name = Config->SharedMemDir + name;
final_name += ".lock";
#ifdef __DARWIN
+1011 -304
View File
File diff suppressed because it is too large Load Diff
+98 -27
View File
@@ -1,5 +1,6 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2003 EQEMu Development Team (http://eqemulator.net)
Copyright (C) 2001-2016 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
@@ -13,15 +14,16 @@
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
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 04111-1307 USA
*/
// @merth notes:
// These classes could be optimized with database reads/writes by storing
// a status flag indicating how object needs to interact with database
#ifndef __ITEM_H
#define __ITEM_H
#ifndef COMMON_ITEM_H
#define COMMON_ITEM_H
class ItemParse; // Parses item packets
class EvolveInfo; // Stores information about an evolving item family
@@ -29,9 +31,14 @@ class EvolveInfo; // Stores information about an evolving item family
#include "../common/eq_constants.h"
#include "../common/item_struct.h"
#include "../common/timer.h"
#include "../common/bodytypes.h"
#include "../common/deity.h" // aren't we already in '/common'?
#include "string_util.h"
#include <list>
#include <map>
//#include <sstream>
namespace ItemField
@@ -71,6 +78,7 @@ enum {
invWhereCursor = 0x20
};
class ItemInst;
// ########################################
// Class: Queue
@@ -113,22 +121,23 @@ public:
///////////////////////////////
// Public Methods
///////////////////////////////
Inventory() { m_version = ClientVersion::Unknown; m_versionset = false; }
Inventory() { m_inventory_version = EQEmu::versions::InventoryVersion::Unknown; m_inventory_version_set = false; }
~Inventory();
// Inventory v2 creep
bool SetInventoryVersion(ClientVersion version) {
if (!m_versionset) {
m_version = version;
return (m_versionset = true);
// inv2 creep
bool SetInventoryVersion(EQEmu::versions::InventoryVersion inventory_version) {
if (!m_inventory_version_set) {
m_inventory_version = EQEmu::versions::ValidateInventoryVersion(inventory_version);
return (m_inventory_version_set = true);
}
else {
return false;
}
}
bool SetInventoryVersion(EQEmu::versions::ClientVersion client_version) { return SetInventoryVersion(EQEmu::versions::ConvertClientVersionToInventoryVersion(client_version)); }
ClientVersion GetInventoryVersion() { return m_version; }
EQEmu::versions::InventoryVersion InventoryVersion() { return m_inventory_version; }
static void CleanDirty();
static void MarkDirty(ItemInst *inst);
@@ -168,7 +177,7 @@ public:
ItemInst* PopItem(int16 slot_id);
// Check whether there is space for the specified number of the specified item.
bool HasSpaceForItem(const Item_Struct *ItemToTry, int16 Quantity);
bool HasSpaceForItem(const EQEmu::Item_Struct *ItemToTry, int16 Quantity);
// Check whether item exists in inventory
// where argument specifies OR'd list of invWhere constants to look
@@ -193,7 +202,7 @@ public:
static int16 CalcSlotFromMaterial(uint8 material);
static uint8 CalcMaterialFromSlot(int16 equipslot);
static bool CanItemFitInContainer(const Item_Struct *ItemToTry, const Item_Struct *Container);
static bool CanItemFitInContainer(const EQEmu::Item_Struct *ItemToTry, const EQEmu::Item_Struct *Container);
// Test for valid inventory casting slot
bool SupportsClickCasting(int16 slot_id);
@@ -204,7 +213,7 @@ public:
int GetSlotByItemInst(ItemInst *inst);
uint8 FindHighestLightValue();
uint8 FindBrightestLightType();
void dumpEntireInventory();
void dumpWornItems();
@@ -251,8 +260,8 @@ protected:
private:
// Active inventory version
ClientVersion m_version;
bool m_versionset;
EQEmu::versions::InventoryVersion m_inventory_version;
bool m_inventory_version_set;
};
class SharedDatabase;
@@ -270,7 +279,7 @@ public:
/////////////////////////
// Constructors/Destructor
ItemInst(const Item_Struct* item = nullptr, int16 charges = 0);
ItemInst(const EQEmu::Item_Struct* item = nullptr, int16 charges = 0);
ItemInst(SharedDatabase *db, uint32 item_id, int16 charges = 0);
@@ -281,7 +290,15 @@ public:
~ItemInst();
// Query item type
bool IsType(ItemClassTypes item_class) const;
bool IsType(EQEmu::item::ItemClass item_class) const;
bool IsClassCommon();
bool IsClassBag();
bool IsClassBook();
bool IsClassCommon() const { return const_cast<ItemInst*>(this)->IsClassCommon(); }
bool IsClassBag() const { return const_cast<ItemInst*>(this)->IsClassBag(); }
bool IsClassBook() const { return const_cast<ItemInst*>(this)->IsClassBook(); }
// Can item be stacked?
bool IsStackable() const;
@@ -300,7 +317,7 @@ public:
bool IsAugmentSlotAvailable(int32 augtype, uint8 slot) const;
inline int32 GetAugmentType() const { return ((m_item) ? m_item->AugType : NO_ITEM); }
inline bool IsExpendable() const { return ((m_item) ? ((m_item->Click.Type == ET_Expendable ) || (m_item->ItemType == ItemTypePotion)) : false); }
inline bool IsExpendable() const { return ((m_item) ? ((m_item->Click.Type == EQEmu::item::ItemEffectExpendable) || (m_item->ItemType == EQEmu::item::ItemTypePotion)) : false); }
//
// Contents
@@ -331,7 +348,7 @@ public:
bool IsAugmented();
ItemInst* GetOrnamentationAug(int32 ornamentationAugtype) const;
bool UpdateOrnamentationInfo();
static bool CanTransform(const Item_Struct *ItemToTry, const Item_Struct *Container, bool AllowAll = false);
static bool CanTransform(const EQEmu::Item_Struct *ItemToTry, const EQEmu::Item_Struct *Container, bool AllowAll = false);
// Has attack/delay?
bool IsWeapon() const;
@@ -340,8 +357,8 @@ public:
// Accessors
const uint32 GetID() const { return ((m_item) ? m_item->ID : NO_ITEM); }
const uint32 GetItemScriptID() const { return ((m_item) ? m_item->ScriptFileID : NO_ITEM); }
const Item_Struct* GetItem() const;
const Item_Struct* GetUnscaledItem() const;
const EQEmu::Item_Struct* GetItem() const;
const EQEmu::Item_Struct* GetUnscaledItem() const;
int16 GetCharges() const { return m_charges; }
void SetCharges(int16 charges) { m_charges = charges; }
@@ -409,7 +426,9 @@ public:
int8 GetMaxEvolveLvl() const;
uint32 GetKillsNeeded(uint8 currentlevel);
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; }
std::string Serialize(int16 slot_id) const { EQEmu::InternalSerializedItem_Struct s; s.slot_id = slot_id; s.inst = (const void*)this; std::string ser; ser.assign((char*)&s, sizeof(EQEmu::InternalSerializedItem_Struct)); return ser; }
void Serialize(EQEmu::OutBuffer& ob, int16 slot_id) const { EQEmu::InternalSerializedItem_Struct isi; isi.slot_id = slot_id; isi.inst = (const void*)this; ob.write((const char*)&isi, sizeof(isi)); }
inline int32 GetSerialNumber() const { return m_SerialNumber; }
inline void SetSerialNumber(int32 id) { m_SerialNumber = id; }
@@ -418,6 +437,58 @@ public:
void StopTimer(std::string name);
void ClearTimers();
// Get a total of a stat, including augs
// These functions should be used in place of other code manually totaling
// to centralize where it is done to make future changes easier (ex. whenever powersources come around)
// and to minimize errors. CalcItemBonuses however doesn't use these in interest of performance
// by default these do not recurse into augs
int GetItemArmorClass(bool augments = false) const;
int GetItemElementalDamage(int &magic, int &fire, int &cold, int &poison, int &disease, int &chromatic, int &prismatic, int &physical, int &corruption, bool augments = false) const;
// These two differ in the fact that they're quick checks (they are checked BEFORE the one above
int GetItemElementalFlag(bool augments = false) const;
int GetItemElementalDamage(bool augments = false) const;
int GetItemRecommendedLevel(bool augments = false) const;
int GetItemRequiredLevel(bool augments = false) const;
int GetItemWeaponDamage(bool augments = false) const;
int GetItemBackstabDamage(bool augments = false) const;
// these two are just quick checks
int GetItemBaneDamageBody(bool augments = false) const;
int GetItemBaneDamageRace(bool augments = false) const;
int GetItemBaneDamageBody(bodyType against, bool augments = false) const;
int GetItemBaneDamageRace(uint16 against, bool augments = false) const;
int GetItemMagical(bool augments = false) const;
int GetItemHP(bool augments = false) const;
int GetItemMana(bool augments = false) const;
int GetItemEndur(bool augments = false) const;
int GetItemAttack(bool augments = false) const;
int GetItemStr(bool augments = false) const;
int GetItemSta(bool augments = false) const;
int GetItemDex(bool augments = false) const;
int GetItemAgi(bool augments = false) const;
int GetItemInt(bool augments = false) const;
int GetItemWis(bool augments = false) const;
int GetItemCha(bool augments = false) const;
int GetItemMR(bool augments = false) const;
int GetItemFR(bool augments = false) const;
int GetItemCR(bool augments = false) const;
int GetItemPR(bool augments = false) const;
int GetItemDR(bool augments = false) const;
int GetItemCorrup(bool augments = false) const;
int GetItemHeroicStr(bool augments = false) const;
int GetItemHeroicSta(bool augments = false) const;
int GetItemHeroicDex(bool augments = false) const;
int GetItemHeroicAgi(bool augments = false) const;
int GetItemHeroicInt(bool augments = false) const;
int GetItemHeroicWis(bool augments = false) const;
int GetItemHeroicCha(bool augments = false) const;
int GetItemHeroicMR(bool augments = false) const;
int GetItemHeroicFR(bool augments = false) const;
int GetItemHeroicCR(bool augments = false) const;
int GetItemHeroicPR(bool augments = false) const;
int GetItemHeroicDR(bool augments = false) const;
int GetItemHeroicCorrup(bool augments = false) const;
int GetItemHaste(bool augments = false) const;
protected:
//////////////////////////
// Protected Members
@@ -431,7 +502,7 @@ protected:
void _PutItem(uint8 index, ItemInst* inst) { m_contents[index] = inst; }
ItemInstTypes m_use_type; // Usage type for item
const Item_Struct* m_item; // Ptr to item data
const EQEmu::Item_Struct* m_item; // Ptr to item data
int16 m_charges; // # of charges for chargeable items
uint32 m_price; // Bazaar /trader price
uint32 m_color;
@@ -443,7 +514,7 @@ protected:
uint32 m_exp;
int8 m_evolveLvl;
bool m_activated;
Item_Struct* m_scaledItem;
EQEmu::Item_Struct* m_scaledItem;
EvolveInfo* m_evolveInfo;
bool m_scaling;
uint32 m_ornamenticon;
@@ -472,4 +543,4 @@ public:
~EvolveInfo();
};
#endif // #define __ITEM_H
#endif /*COMMON_ITEM_H*/
+4
View File
@@ -41,6 +41,7 @@ F(ac)
F(deity)
F(skillmodvalue)
F(UNK033)
F(skillmodmax)
F(skillmodtype)
F(banedmgrace)
F(banedmgamt)
@@ -172,7 +173,10 @@ F(bardlevel)
F(questitemflag)
F(svcorruption)
F(purity)
F(evoitem)
F(evoid)
F(evolvinglevel)
F(evomax)
F(backstabdmg)
F(dsmitigation)
F(heroic_str)
+209
View File
@@ -0,0 +1,209 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
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 "item_struct.h"
#include "classes.h"
#include "races.h"
//#include "deity.h"
uint32 EQEmu::item::ConvertAugTypeToAugTypeBit(uint8 aug_type)
{
switch (aug_type) {
case AugTypeGeneralSingleStat:
return bit_AugTypeGeneralSingleStat;
case AugTypeGeneralMultipleStat:
return bit_AugTypeGeneralMultipleStat;
case AugTypeGeneralSpellEffect:
return bit_AugTypeGeneralSpellEffect;
case AugTypeWeaponGeneral:
return bit_AugTypeWeaponGeneral;
case AugTypeWeaponElemDamage:
return bit_AugTypeWeaponElemDamage;
case AugTypeWeaponBaseDamage:
return bit_AugTypeWeaponBaseDamage;
case AugTypeGeneralGroup:
return bit_AugTypeGeneralGroup;
case AugTypeGeneralRaid:
return bit_AugTypeGeneralRaid;
case AugTypeGeneralDragonsPoints:
return bit_AugTypeGeneralDragonsPoints;
case AugTypeCraftedCommon:
return bit_AugTypeCraftedCommon;
case AugTypeCraftedGroup1:
return bit_AugTypeCraftedGroup1;
case AugTypeCraftedRaid1:
return bit_AugTypeCraftedRaid1;
case AugTypeEnergeiacGroup:
return bit_AugTypeEnergeiacGroup;
case AugTypeEnergeiacRaid:
return bit_AugTypeEnergeiacRaid;
case AugTypeEmblem:
return bit_AugTypeEmblem;
case AugTypeCraftedGroup2:
return bit_AugTypeCraftedGroup2;
case AugTypeCraftedRaid2:
return bit_AugTypeCraftedRaid2;
case AugTypeUnknown1:
return bit_AugTypeUnknown1;
case AugTypeUnknown2:
return bit_AugTypeUnknown2;
case AugTypeOrnamentation:
return bit_AugTypeOrnamentation;
case AugTypeSpecialOrnamentation:
return bit_AugTypeSpecialOrnamentation;
case AugTypeUnknown3:
return bit_AugTypeUnknown3;
case AugTypeUnknown4:
return bit_AugTypeUnknown4;
case AugTypeUnknown5:
return bit_AugTypeUnknown5;
case AugTypeUnknown6:
return bit_AugTypeUnknown6;
case AugTypeUnknown7:
return bit_AugTypeUnknown7;
case AugTypeUnknown8:
return bit_AugTypeUnknown8;
case AugTypeUnknown9:
return bit_AugTypeUnknown9;
case AugTypeUnknown10:
return bit_AugTypeUnknown10;
case AugTypeEpic2_5:
return bit_AugTypeEpic2_5;
case AugTypeTest:
return bit_AugTypeTest;
case AugTypeAll:
return bit_AugTypeAll;
default:
return bit_AugTypeNone;
}
}
uint8 EQEmu::item::ConvertAugTypeBitToAugType(uint32 aug_type_bit)
{
switch (aug_type_bit) {
case bit_AugTypeGeneralSingleStat:
return AugTypeGeneralSingleStat;
case bit_AugTypeGeneralMultipleStat:
return AugTypeGeneralMultipleStat;
case bit_AugTypeGeneralSpellEffect:
return AugTypeGeneralSpellEffect;
case bit_AugTypeWeaponGeneral:
return AugTypeWeaponGeneral;
case bit_AugTypeWeaponElemDamage:
return AugTypeWeaponElemDamage;
case bit_AugTypeWeaponBaseDamage:
return AugTypeWeaponBaseDamage;
case bit_AugTypeGeneralGroup:
return AugTypeGeneralGroup;
case bit_AugTypeGeneralRaid:
return AugTypeGeneralRaid;
case bit_AugTypeGeneralDragonsPoints:
return AugTypeGeneralDragonsPoints;
case bit_AugTypeCraftedCommon:
return AugTypeCraftedCommon;
case bit_AugTypeCraftedGroup1:
return AugTypeCraftedGroup1;
case bit_AugTypeCraftedRaid1:
return AugTypeCraftedRaid1;
case bit_AugTypeEnergeiacGroup:
return AugTypeEnergeiacGroup;
case bit_AugTypeEnergeiacRaid:
return AugTypeEnergeiacRaid;
case bit_AugTypeEmblem:
return AugTypeEmblem;
case bit_AugTypeCraftedGroup2:
return AugTypeCraftedGroup2;
case bit_AugTypeCraftedRaid2:
return AugTypeCraftedRaid2;
case bit_AugTypeUnknown1:
return AugTypeUnknown1;
case bit_AugTypeUnknown2:
return AugTypeUnknown2;
case bit_AugTypeOrnamentation:
return AugTypeOrnamentation;
case bit_AugTypeSpecialOrnamentation:
return AugTypeSpecialOrnamentation;
case bit_AugTypeUnknown3:
return AugTypeUnknown3;
case bit_AugTypeUnknown4:
return AugTypeUnknown4;
case bit_AugTypeUnknown5:
return AugTypeUnknown5;
case bit_AugTypeUnknown6:
return AugTypeUnknown6;
case bit_AugTypeUnknown7:
return AugTypeUnknown7;
case bit_AugTypeUnknown8:
return AugTypeUnknown8;
case bit_AugTypeUnknown9:
return AugTypeUnknown9;
case bit_AugTypeUnknown10:
return AugTypeUnknown10;
case bit_AugTypeEpic2_5:
return AugTypeEpic2_5;
case bit_AugTypeTest:
return AugTypeTest;
case bit_AugTypeAll:
return AugTypeAll;
default:
return AugTypeNone;
}
}
bool EQEmu::Item_Struct::IsEquipable(uint16 race_id, uint16 class_id)
{
if (!(Races & GetPlayerRaceBit(race_id)))
return false;
if (!(Classes & GetPlayerClassBit(GetPlayerClassValue(class_id))))
return false;
return true;
}
bool EQEmu::Item_Struct::IsClassCommon()
{
return (ItemClass == item::ItemClassCommon);
}
bool EQEmu::Item_Struct::IsClassBag()
{
return (ItemClass == item::ItemClassBag);
}
bool EQEmu::Item_Struct::IsClassBook()
{
return (ItemClass == item::ItemClassBook);
}
bool EQEmu::Item_Struct::IsType1HWeapon()
{
return ((ItemType == item::ItemType1HBlunt) || (ItemType == item::ItemType1HSlash) || (ItemType == item::ItemType1HPiercing));
}
bool EQEmu::Item_Struct::IsType2HWeapon()
{
return ((ItemType == item::ItemType2HBlunt) || (ItemType == item::ItemType2HSlash) || (ItemType == item::ItemType2HPiercing));
}
bool EQEmu::Item_Struct::IsTypeShield()
{
return (ItemType == item::ItemTypeShield);
}
+510 -196
View File
@@ -1,5 +1,6 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2003 EQEMu Development Team (http://eqemulator.net)
Copyright (C) 2001-2016 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
@@ -13,11 +14,12 @@
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 04111-1307 USA
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 04111-1307 USA
*/
#ifndef ITEM_STRUCT_H
#define ITEM_STRUCT_H
#ifndef COMMON_ITEM_STRUCT_H
#define COMMON_ITEM_STRUCT_H
/*
* Note: (Doodman)
@@ -42,210 +44,522 @@
* Made ya look! Ha!
*/
//#include "eq_constants.h"
#include "eq_dictionary.h"
#include "emu_constants.h"
namespace EQEmu
{
namespace item {
enum ItemAttributeBit : uint32 {
bit_ItemAttributeNone = 0x00000000,
bit_ItemAttributeLore = 0x00000001,
bit_ItemAttributeArtifact = 0x00000002,
bit_ItemAttributeSummoned = 0x00000004,
bit_ItemAttributeMagic = 0x00000008,
bit_ItemAttributeAugment = 0x00000010,
bit_ItemAttributePendingLore = 0x00000020,
bit_ItemAttributeUnknown = 0xFFFFFFFF
};
enum ItemClass {
ItemClassCommon = 0,
ItemClassBag,
ItemClassBook,
ItemClassCount
};
enum ItemType : uint8 {
/*9138*/ ItemType1HSlash = 0,
/*9141*/ ItemType2HSlash,
/*9140*/ ItemType1HPiercing,
/*9139*/ ItemType1HBlunt,
/*9142*/ ItemType2HBlunt,
/*5504*/ ItemTypeBow, // 5
/*----*/ ItemTypeUnknown1,
/*----*/ ItemTypeLargeThrowing,
/*5505*/ ItemTypeShield,
/*5506*/ ItemTypeScroll,
/*5507*/ ItemTypeArmor, // 10
/*5508*/ ItemTypeMisc, // a lot of random crap has this item use.
/*7564*/ ItemTypeLockPick,
/*----*/ ItemTypeUnknown2,
/*5509*/ ItemTypeFood,
/*5510*/ ItemTypeDrink, // 15
/*5511*/ ItemTypeLight,
/*5512*/ ItemTypeCombinable, // not all stackable items are this use...
/*5513*/ ItemTypeBandage,
/*----*/ ItemTypeSmallThrowing,
/*----*/ ItemTypeSpell, // 20 // spells and tomes
/*5514*/ ItemTypePotion,
/*----*/ ItemTypeUnknown3,
/*0406*/ ItemTypeWindInstrument,
/*0407*/ ItemTypeStringedInstrument,
/*0408*/ ItemTypeBrassInstrument, // 25
/*0405*/ ItemTypePercussionInstrument,
/*5515*/ ItemTypeArrow,
/*----*/ ItemTypeUnknown4,
/*5521*/ ItemTypeJewelry,
/*----*/ ItemTypeSkull, // 30
/*5516*/ ItemTypeBook, // skill-up tomes/books? (would probably need a pp flag if true...)
/*5517*/ ItemTypeNote,
/*5518*/ ItemTypeKey,
/*----*/ ItemTypeCoin,
/*5520*/ ItemType2HPiercing, // 35
/*----*/ ItemTypeFishingPole,
/*----*/ ItemTypeFishingBait,
/*5519*/ ItemTypeAlcohol,
/*----*/ ItemTypeKey2, // keys and satchels?? (questable keys?)
/*----*/ ItemTypeCompass, // 40
/*----*/ ItemTypeUnknown5,
/*----*/ ItemTypePoison, // might be wrong, but includes poisons
/*----*/ ItemTypeUnknown6,
/*----*/ ItemTypeUnknown7,
/*5522*/ ItemTypeMartial, // 45
/*----*/ ItemTypeUnknown8,
/*----*/ ItemTypeUnknown9,
/*----*/ ItemTypeUnknown10,
/*----*/ ItemTypeUnknown11,
/*----*/ ItemTypeSinging, // 50
/*5750*/ ItemTypeAllInstrumentTypes,
/*5776*/ ItemTypeCharm,
/*----*/ ItemTypeDye,
/*----*/ ItemTypeAugmentation,
/*----*/ ItemTypeAugmentationSolvent, // 55
/*----*/ ItemTypeAugmentationDistiller,
/*----*/ ItemTypeUnknown12,
/*----*/ ItemTypeFellowshipKit,
/*----*/ ItemTypeUnknown13,
/*----*/ ItemTypeRecipe, // 60
/*----*/ ItemTypeAdvancedRecipe,
/*----*/ ItemTypeJournal, // only one(1) database entry
/*----*/ ItemTypeAltCurrency, // alt-currency (as opposed to coinage)
/*5881*/ ItemTypePerfectedAugmentationDistiller,
/*----*/ ItemTypeCount
/*
** Child struct of Item_Struct:
** Effect data: Click, Proc, Focus, Worn, Scroll
**
Unknowns:
Mounts?
Ornamentations?
GuildBanners?
Collectible?
Placeable?
(others?)
*/
struct ItemEffect_Struct {
int16 Effect;
uint8 Type;
uint8 Level;
uint8 Level2;
//MaxCharges
//CastTime
//RecastDelay
//RecastType
//ProcRate
};
};
class ItemInst;
enum AugTypeBit : uint32 {
bit_AugTypeNone = 0x00000000,
bit_AugTypeGeneralSingleStat = 0x00000001, /*1^16^1 (General: Single Stat)^0*/
bit_AugTypeGeneralMultipleStat = 0x00000002, /*2^16^2 (General: Multiple Stat)^0*/
bit_AugTypeGeneralSpellEffect = 0x00000004, /*3^16^3 (General: Spell Effect)^0*/
bit_AugTypeWeaponGeneral = 0x00000008, /*4^16^4 (Weapon: General)^0*/
bit_AugTypeWeaponElemDamage = 0x00000010, /*5^16^5 (Weapon: Elem Damage)^0*/
bit_AugTypeWeaponBaseDamage = 0x00000020, /*6^16^6 (Weapon: Base Damage)^0*/
bit_AugTypeGeneralGroup = 0x00000040, /*7^16^7 (General: Group)^0*/
bit_AugTypeGeneralRaid = 0x00000080, /*8^16^8 (General: Raid)^0*/
bit_AugTypeGeneralDragonsPoints = 0x00000100, /*9^16^9 (General: Dragons Points)^0*/
bit_AugTypeCraftedCommon = 0x00000200, /*10^16^10 (Crafted: Common)^0*/
bit_AugTypeCraftedGroup1 = 0x00000400, /*11^16^11 (Crafted: Group)^0*/
bit_AugTypeCraftedRaid1 = 0x00000800, /*12^16^12 (Crafted: Raid)^0*/
bit_AugTypeEnergeiacGroup = 0x00001000, /*13^16^13 (Energeiac: Group)^0*/
bit_AugTypeEnergeiacRaid = 0x00002000, /*14^16^14 (Energeiac: Raid)^0*/
bit_AugTypeEmblem = 0x00004000, /*15^16^15 (Emblem)^0*/
bit_AugTypeCraftedGroup2 = 0x00008000, /*16^16^16 (Crafted: Group)^0*/
bit_AugTypeCraftedRaid2 = 0x00010000, /*17^16^17 (Crafted: Raid)^0*/
bit_AugTypeUnknown1 = 0x00020000, /*18^16^18^0*/
bit_AugTypeUnknown2 = 0x00040000, /*19^16^19^0*/
bit_AugTypeOrnamentation = 0x00080000, /*20^16^20 (Ornamentation)^0*/
bit_AugTypeSpecialOrnamentation = 0x00100000, /*21^16^21 (Special Ornamentation)^0*/
bit_AugTypeUnknown3 = 0x00200000, /*22^16^22^0*/
bit_AugTypeUnknown4 = 0x00400000, /*23^16^23^0*/
bit_AugTypeUnknown5 = 0x00800000, /*24^16^24^0*/
bit_AugTypeUnknown6 = 0x01000000, /*25^16^25^0*/
bit_AugTypeUnknown7 = 0x02000000, /*26^16^26^0*/
bit_AugTypeUnknown8 = 0x04000000, /*27^16^27^0*/
bit_AugTypeUnknown9 = 0x08000000, /*28^16^28^0*/
bit_AugTypeUnknown10 = 0x10000000, /*29^16^29^0*/
bit_AugTypeEpic2_5 = 0x20000000, /*30^16^30^0*/
bit_AugTypeTest = 0x40000000, /*31^16^Test^0*/ // listed as 31^16^31^0 in 5-10 client
bit_AugTypeAll = 0xFFFFFFFF
};
struct InternalSerializedItem_Struct {
int16 slot_id;
const void * inst;
};
enum AugType : uint8 {
AugTypeNone = 0,
AugTypeGeneralSingleStat,
AugTypeGeneralMultipleStat,
AugTypeGeneralSpellEffect,
AugTypeWeaponGeneral,
AugTypeWeaponElemDamage, // 5
AugTypeWeaponBaseDamage,
AugTypeGeneralGroup,
AugTypeGeneralRaid,
AugTypeGeneralDragonsPoints,
AugTypeCraftedCommon, // 10
AugTypeCraftedGroup1,
AugTypeCraftedRaid1,
AugTypeEnergeiacGroup,
AugTypeEnergeiacRaid,
AugTypeEmblem, // 15
AugTypeCraftedGroup2,
AugTypeCraftedRaid2,
AugTypeUnknown1,
AugTypeUnknown2,
AugTypeOrnamentation, // 20
AugTypeSpecialOrnamentation,
AugTypeUnknown3,
AugTypeUnknown4,
AugTypeUnknown5,
AugTypeUnknown6, // 25
AugTypeUnknown7,
AugTypeUnknown8,
AugTypeUnknown9,
AugTypeUnknown10,
AugTypeEpic2_5, // 30
AugTypeTest,
AugTypeCount,
AugTypeAll = 255
};
// use EmuConstants::ITEM_COMMON_SIZE
//#define MAX_AUGMENT_SLOTS 5
enum AugRestriction : uint8 {
/*4690*/ AugRestrictionAny = 0,
/*9134*/ AugRestrictionArmor,
/*9135*/ AugRestrictionWeapons,
/*9136*/ AugRestriction1HWeapons,
/*9137*/ AugRestriction2HWeapons,
/*9138*/ AugRestriction1HSlash, // 5
/*9139*/ AugRestriction1HBlunt,
/*9140*/ AugRestrictionPiercing,
/*9148*/ AugRestrictionHandToHand,
/*9141*/ AugRestriction2HSlash,
/*9142*/ AugRestriction2HBlunt, // 10
/*9143*/ AugRestriction2HPierce,
/*9144*/ AugRestrictionBows,
/*9145*/ AugRestrictionShields,
/*8052*/ AugRestriction1HSlash1HBluntOrHandToHand,
/*9200*/ AugRestriction1HBluntOrHandToHand, // 15 // no listed peq entries
struct Item_Struct {
bool IsEquipable(uint16 Race, uint16 Class) const;
// Non packet based fields
uint8 MinStatus;
// these three appear to be post-RoF (12-10-2012) and can not be verified until RoF (05-10-2013) is supported
/*????*/ AugRestrictionUnknown1,
/*????*/ AugRestrictionUnknown2,
/*????*/ AugRestrictionUnknown3, // last value in peq entries
AugRestrictionCount
// Packet based fields
uint8 ItemClass; // Item Type: 0=common, 1=container, 2=book
char Name[64]; // Name
char Lore[80]; // Lore Name: *=lore, &=summoned, #=artifact, ~=pending lore
char IDFile[30]; // Visible model
uint32 ID; // Unique ID (also PK for DB)
uint8 Weight; // Item weight * 10
uint8 NoRent; // No Rent: 0=norent, 255=not norent
uint8 NoDrop; // No Drop: 0=nodrop, 255=not nodrop
uint8 Size; // Size: 0=tiny, 1=small, 2=medium, 3=large, 4=giant
uint32 Slots; // Bitfield for which slots this item can be used in
uint32 Price; // Item cost (?)
uint32 Icon; // Icon Number
uint32 LoreGroup; // Later items use LoreGroup instead of LoreFlag. we might want to see about changing this to int32 since it is commonly -1 and is constantly being cast from signed (-1) to unsigned (4294967295)
bool LoreFlag; // This will be true if LoreGroup is non-zero
bool PendingLoreFlag;
bool ArtifactFlag;
bool SummonedFlag;
uint8 FVNoDrop; // Firiona Vie nodrop flag
uint32 Favor; // Individual favor
uint32 GuildFavor; // Guild favor
uint32 PointType;
/*4687*/ //AugTypeAllItems, // ?? unknown atm
/*4688*/ //AugTypePrestige, // ?? unknown atm
/*4689*/ //AugTypeNonPrestige, // ?? unknown atm
};
//uint32 Unk117;
//uint32 Unk118;
//uint32 Unk121;
//uint32 Unk124;
enum BagType : uint8 {
/*3400*/ BagTypeSmallBag = 0,
/*3401*/ BagTypeLargeBag,
/*3402*/ BagTypeQuiver,
/*3403*/ BagTypeBeltPouch,
/*3404*/ BagTypeWristPouch,
/*3405*/ BagTypeBackPack, // 5
/*3406*/ BagTypeSmallChest,
/*3407*/ BagTypeLargeChest,
/*----*/ BagTypeBandolier, // <*Database Reference Only>
/*3408*/ BagTypeMedicineBag,
/*3409*/ BagTypeToolBox, // 10
/*3410*/ BagTypeLexicon,
/*3411*/ BagTypeMortar,
/*3412*/ BagTypeSelfDusting, // Quest container (Auto-clear contents?)
/*3413*/ BagTypeMixingBowl,
/*3414*/ BagTypeOven, // 15
/*3415*/ BagTypeSewingKit,
/*3416*/ BagTypeForge,
/*3417*/ BagTypeFletchingKit,
/*3418*/ BagTypeBrewBarrel,
/*3419*/ BagTypeJewelersKit, // 20
/*3420*/ BagTypePotteryWheel,
/*3421*/ BagTypeKiln,
/*3422*/ BagTypeKeymaker, // (no database entries as of peq rev 69)
/*3423*/ BagTypeWizardsLexicon,
/*3424*/ BagTypeMagesLexicon, // 25
/*3425*/ BagTypeNecromancersLexicon,
/*3426*/ BagTypeEnchantersLexicon,
/*----*/ BagTypeUnknown1, // (a coin pouch/purse?) (no database entries as of peq rev 69)
/*----*/ BagTypeConcordanceofResearch, // <*Database Reference Only>
/*3427*/ BagTypeAlwaysWorks, // 30 // Quest container (Never-fail combines?)
/*3428*/ BagTypeKoadaDalForge, // High Elf
/*3429*/ BagTypeTeirDalForge, // Dark Elf
/*3430*/ BagTypeOggokForge, // Ogre
/*3431*/ BagTypeStormguardForge, // Dwarf
/*3432*/ BagTypeAkanonForge, // 35 // Gnome
/*3433*/ BagTypeNorthmanForge, // Barbarian
/*----*/ BagTypeUnknown2, // (no database entries as of peq rev 69)
/*3434*/ BagTypeCabilisForge, // Iksar
/*3435*/ BagTypeFreeportForge, // Human 1
/*3436*/ BagTypeRoyalQeynosForge, // 40 // Human 2
/*3439*/ BagTypeHalflingTailoringKit,
/*3438*/ BagTypeErudTailoringKit,
/*3440*/ BagTypeFierDalTailoringKit, // Wood Elf
/*3441*/ BagTypeFierDalFletchingKit, // Wood Elf
/*3437*/ BagTypeIksarPotteryWheel, // 45
/*3442*/ BagTypeTackleBox,
/*3443*/ BagTypeTrollForge,
/*3445*/ BagTypeFierDalForge, // Wood Elf
/*3444*/ BagTypeValeForge, // Halfling
/*3446*/ BagTypeErudForge, // 50
/*----*/ BagTypeTradersSatchel, // <*Database Reference Only> (db: Yellow Trader's Satchel Token?)
/*5785*/ BagTypeGuktaForge, // Froglok (no database entries as of peq rev 69)
/*3359*/ BagTypeAugmentationSealer,
/*----*/ BagTypeIceCreamChurn, // <*Database Reference Only>
/*6325*/ BagTypeTransformationmold, // 55 // Ornamentation
/*6340*/ BagTypeDetransformationmold, // Ornamentation Stripper
/*5400*/ BagTypeUnattuner,
/*7684*/ BagTypeTradeskillBag,
/*7692*/ BagTypeCollectibleBag,
/*----*/ BagTypeCount
};
uint8 BagType; // 0:Small Bag, 1:Large Bag, 2:Quiver, 3:Belt Pouch ... there are 50 types
uint8 BagSlots; // Number of slots: can only be 2, 4, 6, 8, or 10
uint8 BagSize; // 0:TINY, 1:SMALL, 2:MEDIUM, 3:LARGE, 4:GIANT
uint8 BagWR; // 0->100
enum ItemEffect {
ItemEffectCombatProc = 0,
ItemEffectClick,
ItemEffectWorn,
ItemEffectExpendable,
ItemEffectEquipClick,
ItemEffectClick2, //5 //name unknown
ItemEffectFocus,
ItemEffectScroll,
ItemEffectCount
};
bool BenefitFlag;
bool Tradeskills; // Is this a tradeskill item?
int8 CR; // Save vs Cold
int8 DR; // Save vs Disease
int8 PR; // Save vs Poison
int8 MR; // Save vs Magic
int8 FR; // Save vs Fire
int8 AStr; // Strength
int8 ASta; // Stamina
int8 AAgi; // Agility
int8 ADex; // Dexterity
int8 ACha; // Charisma
int8 AInt; // Intelligence
int8 AWis; // Wisdom
int32 HP; // HP
int32 Mana; // Mana
int32 AC; // AC
uint32 Deity; // Bitmask of Deities that can equip this item
//uint32 Unk033
int32 SkillModValue; // % Mod to skill specified in SkillModType
uint32 SkillModType; // Type of skill for SkillModValue to apply to
uint32 BaneDmgRace; // Bane Damage Race
int8 BaneDmgAmt; // Bane Damage Body Amount
uint32 BaneDmgBody; // Bane Damage Body
bool Magic; // True=Magic Item, False=not
int32 CastTime_;
uint8 ReqLevel; // Required Level to use item
uint32 BardType; // Bard Skill Type
int32 BardValue; // Bard Skill Amount
int8 Light; // Light
uint8 Delay; // Delay * 10
uint8 RecLevel; // Recommended level to use item
uint8 RecSkill; // Recommended skill to use item (refers to primary skill of item)
uint8 ElemDmgType; // Elemental Damage Type (1=magic, 2=fire)
uint8 ElemDmgAmt; // Elemental Damage
uint8 Range; // Range of item
uint32 Damage; // Delay between item usage (in 0.1 sec increments)
uint32 Color; // RR GG BB 00 <-- as it appears in pc
uint32 Classes; // Bitfield of classes that can equip item (1 << class#)
uint32 Races; // Bitfield of races that can equip item (1 << race#)
//uint32 Unk054;
int16 MaxCharges; // Maximum charges items can hold: -1 if not a chargeable item
uint8 ItemType; // Item Type/Skill (itemClass* from above)
uint8 Material; // Item material type
uint32 HerosForgeModel;// Hero's Forge Armor Model Type (2-13?)
float SellRate; // Sell rate
//uint32 Unk059;
union {
uint32 Fulfilment; // Food fulfilment (How long it lasts)
int16 CastTime; // Cast Time for clicky effects, in milliseconds
enum ItemSize : uint8 {
ItemSizeTiny = 0,
ItemSizeSmall,
ItemSizeMedium,
ItemSizeLarge,
ItemSizeGiant,
ItemSizeCount
};
enum ItemDataType : uint8 {
ItemDataTypeBase = 0,
ItemDataTypeScaling,
ItemDataTypeEvolving,
ItemDataTypeCount
};
struct ItemEffect_Struct {
int16 Effect;
uint8 Type;
uint8 Level;
uint8 Level2;
//MaxCharges
//CastTime
//RecastDelay
//RecastType
//ProcRate
};
extern uint32 ConvertAugTypeToAugTypeBit(uint8 aug_type);
extern uint8 ConvertAugTypeBitToAugType(uint32 aug_type_bit);
} /*item*/
struct InternalSerializedItem_Struct {
int16 slot_id;
const void * inst;
};
uint32 EliteMaterial;
int32 ProcRate;
int8 CombatEffects; // PoP: Combat Effects +
int8 Shielding; // PoP: Shielding %
int8 StunResist; // PoP: Stun Resist %
int8 StrikeThrough; // PoP: Strike Through %
uint32 ExtraDmgSkill;
uint32 ExtraDmgAmt;
int8 SpellShield; // PoP: Spell Shield %
int8 Avoidance; // PoP: Avoidance +
int8 Accuracy; // PoP: Accuracy +
uint32 CharmFileID;
int32 FactionMod1; // Faction Mod 1
int32 FactionMod2; // Faction Mod 2
int32 FactionMod3; // Faction Mod 3
int32 FactionMod4; // Faction Mod 4
int32 FactionAmt1; // Faction Amt 1
int32 FactionAmt2; // Faction Amt 2
int32 FactionAmt3; // Faction Amt 3
int32 FactionAmt4; // Faction Amt 4
char CharmFile[32]; // ?
uint32 AugType;
uint8 AugSlotType[EmuConstants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Type
uint8 AugSlotVisible[EmuConstants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Visible
uint8 AugSlotUnk2[EmuConstants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Unknown
uint32 LDoNTheme;
uint32 LDoNPrice;
uint32 LDoNSold;
uint32 BaneDmgRaceAmt;
uint32 AugRestrict;
uint32 Endur;
uint32 DotShielding;
uint32 Attack;
uint32 Regen;
uint32 ManaRegen;
uint32 EnduranceRegen;
uint32 Haste;
uint32 DamageShield;
uint32 RecastDelay;
uint32 RecastType;
uint32 AugDistiller;
bool Attuneable;
bool NoPet;
bool PotionBelt;
bool Stackable;
bool NoTransfer;
bool QuestItemFlag;
int16 StackSize;
uint8 PotionBeltSlots;
ItemEffect_Struct Click, Proc, Worn, Focus, Scroll, Bard;
uint8 Book; // 0=Not book, 1=Book
uint32 BookType;
char Filename[33]; // Filename for book data
// Begin SoF Fields
int32 SVCorruption;
uint32 Purity;
uint8 EvolvingLevel;
uint32 BackstabDmg;
uint32 DSMitigation;
int32 HeroicStr;
int32 HeroicInt;
int32 HeroicWis;
int32 HeroicAgi;
int32 HeroicDex;
int32 HeroicSta;
int32 HeroicCha;
int32 HeroicMR;
int32 HeroicFR;
int32 HeroicCR;
int32 HeroicDR;
int32 HeroicPR;
int32 HeroicSVCorrup;
int32 HealAmt;
int32 SpellDmg;
uint32 LDoNSellBackRate;
uint32 ScriptFileID;
uint16 ExpendableArrow;
uint32 Clairvoyance;
char ClickName[65];
char ProcName[65];
char WornName[65];
char FocusName[65];
char ScrollName[65];
struct Item_Struct {
// Non packet based fields
uint8 MinStatus;
//uint8 ItemDataType;
};
// Packet based fields
uint8 ItemClass; // Item Type: 0=common, 1=container, 2=book
char Name[64]; // Name
char Lore[80]; // Lore Name: *=lore, &=summoned, #=artifact, ~=pending lore
char IDFile[30]; // Visible model
uint32 ID; // Unique ID (also PK for DB)
int32 Weight; // Item weight * 10
uint8 NoRent; // No Rent: 0=norent, 255=not norent
uint8 NoDrop; // No Drop: 0=nodrop, 255=not nodrop
uint8 Size; // Size: 0=tiny, 1=small, 2=medium, 3=large, 4=giant
uint32 Slots; // Bitfield for which slots this item can be used in
uint32 Price; // Item cost (?)
uint32 Icon; // Icon Number
uint32 LoreGroup; // Later items use LoreGroup instead of LoreFlag. we might want to see about changing this to int32 since it is commonly -1 and is constantly being cast from signed (-1) to unsigned (4294967295)
bool LoreFlag; // This will be true if LoreGroup is non-zero
bool PendingLoreFlag;
bool ArtifactFlag;
bool SummonedFlag;
uint8 FVNoDrop; // Firiona Vie nodrop flag
uint32 Favor; // Individual favor
uint32 GuildFavor; // Guild favor
uint32 PointType;
#endif
//uint32 Unk117;
//uint32 Unk118;
//uint32 Unk121;
//uint32 Unk124;
uint8 BagType; // 0:Small Bag, 1:Large Bag, 2:Quiver, 3:Belt Pouch ... there are 50 types
uint8 BagSlots; // Number of slots: can only be 2, 4, 6, 8, or 10
uint8 BagSize; // 0:TINY, 1:SMALL, 2:MEDIUM, 3:LARGE, 4:GIANT
uint8 BagWR; // 0->100
bool BenefitFlag;
bool Tradeskills; // Is this a tradeskill item?
int8 CR; // Save vs Cold
int8 DR; // Save vs Disease
int8 PR; // Save vs Poison
int8 MR; // Save vs Magic
int8 FR; // Save vs Fire
int8 AStr; // Strength
int8 ASta; // Stamina
int8 AAgi; // Agility
int8 ADex; // Dexterity
int8 ACha; // Charisma
int8 AInt; // Intelligence
int8 AWis; // Wisdom
int32 HP; // HP
int32 Mana; // Mana
int32 AC; // AC
uint32 Deity; // Bitmask of Deities that can equip this item
//uint32 Unk033
int32 SkillModValue; // % Mod to skill specified in SkillModType
int32 SkillModMax; // Max skill point modification
uint32 SkillModType; // Type of skill for SkillModValue to apply to
uint32 BaneDmgRace; // Bane Damage Race
int8 BaneDmgAmt; // Bane Damage Body Amount
uint32 BaneDmgBody; // Bane Damage Body
bool Magic; // True=Magic Item, False=not
int32 CastTime_;
uint8 ReqLevel; // Required Level to use item
uint32 BardType; // Bard Skill Type
int32 BardValue; // Bard Skill Amount
int8 Light; // Light
uint8 Delay; // Delay * 10
uint8 RecLevel; // Recommended level to use item
uint8 RecSkill; // Recommended skill to use item (refers to primary skill of item)
uint8 ElemDmgType; // Elemental Damage Type (1=magic, 2=fire)
uint8 ElemDmgAmt; // Elemental Damage
uint8 Range; // Range of item
uint32 Damage; // Delay between item usage (in 0.1 sec increments)
uint32 Color; // RR GG BB 00 <-- as it appears in pc
uint32 Classes; // Bitfield of classes that can equip item (1 << class#)
uint32 Races; // Bitfield of races that can equip item (1 << race#)
//uint32 Unk054;
int16 MaxCharges; // Maximum charges items can hold: -1 if not a chargeable item
uint8 ItemType; // Item Type/Skill (itemClass* from above)
uint8 Material; // Item material type
uint32 HerosForgeModel;// Hero's Forge Armor Model Type (2-13?)
float SellRate; // Sell rate
//uint32 Unk059;
union {
uint32 Fulfilment; // Food fulfilment (How long it lasts)
uint32 CastTime; // Cast Time for clicky effects, in milliseconds
};
uint32 EliteMaterial;
int32 ProcRate;
int8 CombatEffects; // PoP: Combat Effects +
int8 Shielding; // PoP: Shielding %
int8 StunResist; // PoP: Stun Resist %
int8 StrikeThrough; // PoP: Strike Through %
uint32 ExtraDmgSkill;
uint32 ExtraDmgAmt;
int8 SpellShield; // PoP: Spell Shield %
int8 Avoidance; // PoP: Avoidance +
int8 Accuracy; // PoP: Accuracy +
uint32 CharmFileID;
int32 FactionMod1; // Faction Mod 1
int32 FactionMod2; // Faction Mod 2
int32 FactionMod3; // Faction Mod 3
int32 FactionMod4; // Faction Mod 4
int32 FactionAmt1; // Faction Amt 1
int32 FactionAmt2; // Faction Amt 2
int32 FactionAmt3; // Faction Amt 3
int32 FactionAmt4; // Faction Amt 4
char CharmFile[32]; // ?
uint32 AugType;
uint8 AugSlotType[EQEmu::legacy::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Type
uint8 AugSlotVisible[EQEmu::legacy::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Visible
uint8 AugSlotUnk2[EQEmu::legacy::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Unknown Most likely Powersource related
uint32 LDoNTheme;
uint32 LDoNPrice;
uint32 LDoNSold;
uint32 BaneDmgRaceAmt;
uint32 AugRestrict;
uint32 Endur;
uint32 DotShielding;
uint32 Attack;
uint32 Regen;
uint32 ManaRegen;
uint32 EnduranceRegen;
uint32 Haste;
uint32 DamageShield;
uint32 RecastDelay;
uint32 RecastType;
uint32 AugDistiller;
bool Attuneable;
bool NoPet;
bool PotionBelt;
bool Stackable;
bool NoTransfer;
bool QuestItemFlag;
int16 StackSize;
uint8 PotionBeltSlots;
item::ItemEffect_Struct Click, Proc, Worn, Focus, Scroll, Bard;
uint8 Book; // 0=Not book, 1=Book
uint32 BookType;
char Filename[33]; // Filename for book data
// Begin SoF Fields
int32 SVCorruption;
uint32 Purity;
uint8 EvolvingItem;
uint32 EvolvingID;
uint8 EvolvingLevel;
uint8 EvolvingMax;
uint32 BackstabDmg;
uint32 DSMitigation;
int32 HeroicStr;
int32 HeroicInt;
int32 HeroicWis;
int32 HeroicAgi;
int32 HeroicDex;
int32 HeroicSta;
int32 HeroicCha;
int32 HeroicMR;
int32 HeroicFR;
int32 HeroicCR;
int32 HeroicDR;
int32 HeroicPR;
int32 HeroicSVCorrup;
int32 HealAmt;
int32 SpellDmg;
uint32 LDoNSellBackRate;
uint32 ScriptFileID;
uint16 ExpendableArrow;
uint32 Clairvoyance;
char ClickName[65];
char ProcName[65];
char WornName[65];
char FocusName[65];
char ScrollName[65];
//BardName
bool IsEquipable(uint16 Race, uint16 Class);
bool IsClassCommon();
bool IsClassBag();
bool IsClassBook();
bool IsType1HWeapon();
bool IsType2HWeapon();
bool IsTypeShield();
bool IsEquipable(uint16 Race, uint16 Class) const { return const_cast<Item_Struct*>(this)->IsEquipable(Race, Class); }
bool IsClassCommon() const { return const_cast<Item_Struct*>(this)->IsClassCommon(); }
bool IsClassBag() const { return const_cast<Item_Struct*>(this)->IsClassBag(); }
bool IsClassBook() const { return const_cast<Item_Struct*>(this)->IsClassBook(); }
bool IsType1HWeapon() const { return const_cast<Item_Struct*>(this)->IsType1HWeapon(); }
bool IsType2HWeapon() const { return const_cast<Item_Struct*>(this)->IsType2HWeapon(); }
bool IsTypeShield() const { return const_cast<Item_Struct*>(this)->IsTypeShield(); }
};
} /*EQEmu*/
#endif /*COMMON_ITEM_STRUCT_H*/
+99
View File
@@ -0,0 +1,99 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
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 "light_source.h"
#include <string.h>
uint8 EQEmu::lightsource::TypeToLevel(uint8 light_type)
{
switch (light_type) {
case LightTypeGlobeOfStars:
return LightLevelBrilliant; // 10
case LightTypeFlamelessLantern:
case LightTypeGreaterLightstone:
return LightLevelLargeMagic; // 9
case LightTypeLargeLantern:
return LightLevelLargeLantern; // 8
case LightTypeSteinOfMoggok:
case LightTypeLightstone:
return LightLevelMagicLantern; // 7
case LightTypeSmallLantern:
return LightLevelSmallLantern; // 6
case LightTypeColdlight:
case LightTypeUnknown2:
return LightLevelBlueLight; // 5
case LightTypeFireBeetleEye:
case LightTypeUnknown1:
return LightLevelRedLight; // 4
case LightTypeTinyGlowingSkull:
case LightTypeLightGlobe:
return LightLevelSmallMagic; // 3
case LightTypeTorch:
return LightLevelTorch; // 2
case LightTypeCandle:
return LightLevelCandle; // 1
default:
return LightLevelUnlit; // 0
}
}
bool EQEmu::lightsource::IsLevelGreater(uint8 left_type, uint8 right_type)
{
static const uint8 light_levels[LightTypeCount] = {
LightLevelUnlit, /* LightTypeNone */
LightLevelCandle, /* LightTypeCandle */
LightLevelTorch, /* LightTypeTorch */
LightLevelSmallMagic, /* LightTypeTinyGlowingSkull */
LightLevelSmallLantern, /* LightTypeSmallLantern */
LightLevelMagicLantern, /* LightTypeSteinOfMoggok */
LightLevelLargeLantern, /* LightTypeLargeLantern */
LightLevelLargeMagic, /* LightTypeFlamelessLantern */
LightLevelBrilliant, /* LightTypeGlobeOfStars */
LightLevelSmallMagic, /* LightTypeLightGlobe */
LightLevelMagicLantern, /* LightTypeLightstone */
LightLevelLargeMagic, /* LightTypeGreaterLightstone */
LightLevelRedLight, /* LightTypeFireBeetleEye */
LightLevelBlueLight, /* LightTypeColdlight */
LightLevelRedLight, /* LightTypeUnknown1 */
LightLevelBlueLight /* LightTypeUnknown2 */
};
if (left_type >= LightTypeCount) { left_type = LightTypeNone; }
if (right_type >= LightTypeCount) { right_type = LightTypeNone; }
return (light_levels[left_type] > light_levels[right_type]);
}
EQEmu::lightsource::Light_Struct::Light_Struct()
{
Clear();
}
void EQEmu::lightsource::Light_Struct::Clear()
{
memset(&Slot, 0, (sizeof(uint8) * sizeof(Slot)));
}
void EQEmu::LightSourceProfile::Clear()
{
Type.Clear();
Level.Clear();
}
+116
View File
@@ -0,0 +1,116 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
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
*/
#ifndef COMMON_LIGHT_SOURCE_H
#define COMMON_LIGHT_SOURCE_H
#include "types.h"
namespace EQEmu
{
namespace lightsource {
enum LightSlot {
LightInnate = 0, // Defined by db field `npc_types`.`light` - where appropriate
LightEquipment, // Item_Struct::light value of worn/carried equipment
LightSpell, // Set value of any light-producing spell (can be modded to mimic equip_light behavior)
LightActive, // Highest value of all light sources
LightCount
};
enum LightType {
LightTypeNone = 0,
LightTypeCandle,
LightTypeTorch,
LightTypeTinyGlowingSkull,
LightTypeSmallLantern,
LightTypeSteinOfMoggok, // 5
LightTypeLargeLantern,
LightTypeFlamelessLantern,
LightTypeGlobeOfStars,
LightTypeLightGlobe,
LightTypeLightstone, // 10
LightTypeGreaterLightstone,
LightTypeFireBeetleEye,
LightTypeColdlight,
LightTypeUnknown1,
LightTypeUnknown2, // 15
LightTypeCount
};
enum LightLevel {
LightLevelUnlit = 0,
LightLevelCandle,
LightLevelTorch,
LightLevelSmallMagic,
LightLevelRedLight,
LightLevelBlueLight, // 5
LightLevelSmallLantern,
LightLevelMagicLantern,
LightLevelLargeLantern,
LightLevelLargeMagic,
LightLevelBrilliant, // 10
LightLevelCount
};
struct Light_Struct {
uint8 Slot[LightCount];
Light_Struct();
void Clear();
inline uint8& operator[](LightSlot index) { return Slot[index]; }
};
extern uint8 TypeToLevel(uint8 light_type);
extern bool IsLevelGreater(uint8 left_type, uint8 right_type);
}; /*lightsource*/
struct LightSourceProfile {
/*
Current criteria (light types):
Equipment: { 0 .. 15 }
General: { 9 .. 13 }
Notes:
- Initial character load and item movement updates use different light source update behaviors
-- Server procedure matches the item movement behavior since most updates occur post-character load
- MainAmmo is not considered when determining light sources
- No 'Sub' or 'Aug' items are recognized as light sources
- Light types '< 9' and '> 13' are not considered for general (carried) light sources
- If values > 0x0F are valid, then assignment limiters will need to be removed
- MainCursor 'appears' to be a valid light source update slot..but, have not experienced updates during debug sessions
- All clients have a bug regarding stackable items (light and sound updates are not processed when picking up an item)
-- The timer-based update cancels out the invalid light source
*/
lightsource::Light_Struct Type; // Light types (classifications)
lightsource::Light_Struct Level; // Light levels (intensities) - used to determine which light source should be active
LightSourceProfile() { }
void Clear();
};
} /*EQEmu*/
#endif /*COMMON_LIGHT_SOURCE_H*/
+64 -34
View File
@@ -24,6 +24,36 @@
std::map<int,std::string> DBFieldNames;
#ifndef WIN32
#if defined(FREEBSD) || defined(__CYGWIN__)
int print_stacktrace()
{
printf("Insert stack trace here...\n");
return(0);
}
#else //!WIN32 && !FREEBSD == linux
#include <execinfo.h>
int print_stacktrace()
{
void *ba[20];
int n = backtrace (ba, 20);
if (n != 0)
{
char **names = backtrace_symbols (ba, n);
if (names != nullptr)
{
int i;
std::cerr << "called from " << (char*)names[0] << std::endl;
for (i = 1; i < n; ++i)
std::cerr << " " << (char*)names[i] << std::endl;
free (names);
}
}
return(0);
}
#endif //!FREEBSD
#endif //!WIN32
void Unprotect(std::string &s, char what)
{
if (s.length()) {
@@ -48,12 +78,12 @@ void Protect(std::string &s, char what)
*/
bool ItemParse(const char *data, int length, std::map<int,std::map<int,std::string> > &items, int id_pos, int name_pos, int max_field, int level)
{
int i;
char *end,*ptr;
std::map<int,std::string> field;
static char *buffer=nullptr;
static int buffsize=0;
static char *temp=nullptr;
int i;
char *end,*ptr;
std::map<int,std::string> field;
static char *buffer=nullptr;
static int buffsize=0;
static char *temp=nullptr;
if (!buffsize || buffsize<(length+1)) {
buffer=(char *)realloc(buffer,length+1);
temp=(char *)realloc(temp,length+1);
@@ -156,10 +186,10 @@ bool ItemParse(const char *data, int length, std::map<int,std::map<int,std::stri
int Tokenize(std::string s,std::map<int,std::string> & tokens, char delim)
{
int i,len;
std::string::size_type end;
//char temp[1024];
std::string x;
int i,len;
std::string::size_type end;
//char temp[1024];
std::string x;
tokens.clear();
i=0;
while(s.length()) {
@@ -305,14 +335,14 @@ void LoadItemDBFieldNames() {
void encode_length(unsigned long length, char *out)
{
char buf[4];
char buf[4];
memcpy(buf,&length,sizeof(unsigned long));
encode_chunk(buf,3,out);
}
unsigned long encode(char *in, unsigned long length, char *out)
{
unsigned long used=0,len=0;
unsigned long used=0,len=0;
while(used<length) {
encode_chunk(in+used,length-used,out+len);
used+=3;
@@ -325,8 +355,8 @@ unsigned long encode(char *in, unsigned long length, char *out)
unsigned long decode_length(char *in)
{
int length;
char buf[4];
int length;
char buf[4];
decode_chunk(in,&buf[0]);
buf[3]=0;
memcpy(&length,buf,sizeof(unsigned long));
@@ -336,8 +366,8 @@ unsigned long decode_length(char *in)
void decode(char *in, char *out)
{
char *ptr=in;
char *outptr=out;
char *ptr=in;
char *outptr=out;
while(*ptr) {
decode_chunk(ptr,outptr);
ptr+=4;
@@ -363,8 +393,8 @@ void decode_chunk(char *in, char *out)
void dump_message_column(unsigned char *buffer, unsigned long length, std::string leader, FILE *to)
{
unsigned long i,j;
unsigned long rows,offset=0;
unsigned long i,j;
unsigned long rows,offset=0;
rows=(length/16)+1;
for(i=0;i<rows;i++) {
fprintf(to, "%s%05ld: ",leader.c_str(),i*16);
@@ -389,8 +419,8 @@ void dump_message_column(unsigned char *buffer, unsigned long length, std::strin
std::string long2ip(unsigned long ip)
{
char temp[16];
union { unsigned long ip; struct { unsigned char a,b,c,d; } octet;} ipoctet;
char temp[16];
union { unsigned long ip; struct { unsigned char a,b,c,d; } octet;} ipoctet;
ipoctet.ip=ip;
sprintf(temp,"%d.%d.%d.%d",ipoctet.octet.a,ipoctet.octet.b,ipoctet.octet.c,ipoctet.octet.d);
@@ -400,8 +430,8 @@ std::string long2ip(unsigned long ip)
std::string string_from_time(std::string pattern, time_t now)
{
struct tm *now_tm;
char time_string[51];
struct tm *now_tm;
char time_string[51];
if (!now)
time(&now);
@@ -420,9 +450,9 @@ std::string timestamp(time_t now)
std::string pop_arg(std::string &s, std::string seps, bool obey_quotes)
{
std::string ret;
unsigned long i;
bool in_quote=false;
std::string ret;
unsigned long i;
bool in_quote=false;
unsigned long length=s.length();
for(i=0;i<length;i++) {
@@ -451,8 +481,8 @@ std::string pop_arg(std::string &s, std::string seps, bool obey_quotes)
int EQsprintf(char *buffer, const char *pattern, const char *arg1, const char *arg2, const char *arg3, const char *arg4, const char *arg5, const char *arg6, const char *arg7, const char *arg8, const char *arg9)
{
const char *args[9],*ptr;
char *bptr;
const char *args[9],*ptr;
char *bptr;
args[0]=arg1;
args[1]=arg2;
args[2]=arg3;
@@ -494,11 +524,11 @@ int EQsprintf(char *buffer, const char *pattern, const char *arg1, const char *a
std::string generate_key(int length)
{
std::string key;
//TODO: write this for win32...
std::string key;
//TODO: write this for win32...
#ifndef WIN32
int i;
timeval now;
int i;
timeval now;
static const char *chars="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
for(i=0;i<length;i++) {
gettimeofday(&now,nullptr);
@@ -520,9 +550,9 @@ void print_hex(const char *data, unsigned long length) {
void build_hex_line(const char *buffer, unsigned long length, unsigned long offset, char *out_buffer, unsigned char padding)
{
char *ptr=out_buffer;
int i;
char printable[17];
char *ptr=out_buffer;
int i;
char printable[17];
ptr+=sprintf(ptr,"%0*lu:",padding,offset);
for(i=0;i<16; i++) {
if (i==8) {
+4
View File
@@ -24,6 +24,10 @@ void decode(char *in, char *out);
void encode_chunk(char *in, int len, char *out);
void decode_chunk(char *in, char *out);
#ifndef WIN32
int print_stacktrace();
#endif
void dump_message_column(unsigned char *buffer, unsigned long length, std::string leader="", FILE *to = stdout);
std::string string_from_time(std::string pattern, time_t now=0);
std::string timestamp(time_t now=0);
+1 -1
View File
@@ -18,7 +18,7 @@
#ifndef MYMUTEX_H
#define MYMUTEX_H
#ifdef _WINDOWS
#include <winsock.h>
#include <winsock2.h>
#include <windows.h>
#else
#include <pthread.h>
+1
View File
@@ -32,6 +32,7 @@ MySQLRequestResult::MySQLRequestResult(MYSQL_RES* result, uint32 rowsAffected, u
void MySQLRequestResult::FreeInternals()
{
safe_delete_array(m_ErrorBuffer);
if (m_Result != nullptr)
+7 -1
View File
@@ -2,7 +2,7 @@
#define MYSQL_REQUEST_RESULT_H
#ifdef _WINDOWS
#include <winsock.h>
#include <winsock2.h>
#include <windows.h>
#endif
@@ -10,6 +10,12 @@
#include "types.h"
#include "mysql_request_row.h"
#ifdef __FreeBSD__
#include <string>
#include <sstream>
#include <iostream>
#endif
class MySQLRequestResult {
private:
MYSQL_RES* m_Result;
+1 -1
View File
@@ -2,7 +2,7 @@
#define MYSQL_REQUEST_ROW_H
#ifdef _WINDOWS
#include <winsock.h>
#include <winsock2.h>
#include <windows.h>
#endif
+4 -3
View File
@@ -146,6 +146,7 @@ INr(OP_GuildDelete); //?
IN(OP_GuildPublicNote, GuildUpdate_PublicNote);
INz(OP_GetGuildsList); //?
IN(OP_SetGuildMOTD, GuildMOTD_Struct);
IN(OP_SetRunMode, SetRunMode_Struct);
INz(OP_GuildPeace); //?
INz(OP_GuildWar); //?
IN(OP_GuildLeader, GuildMakeLeader);
@@ -180,7 +181,7 @@ IN(OP_GMLastName, GMLastName_Struct);
IN(OP_GMToggle, GMToggle_Struct);
IN(OP_LFGCommand, LFG_Struct);
IN(OP_GMGoto, GMSummon_Struct);
IN(OP_TraderShop, TraderClick_Struct);
INv(OP_TraderShop, TraderClick_Struct);
IN(OP_ShopRequest, Merchant_Click_Struct);
IN(OP_Bazaar, BazaarSearch_Struct);
//alt:IN(OP_Bazaar, BazaarWelcome_Struct); //alternate structure for OP_Bazaar
@@ -399,7 +400,7 @@ OUT(OP_Weather, Weather_Struct);
OUT(OP_ZoneChange, ZoneChange_Struct);
OUT(OP_ZoneInUnknown, ZoneInUnknown_Struct);
//this is the set of opcodes which are allready listed
//this is the set of opcodes which are already listed
//in the IN section above, but are also sent OUT
#ifdef DISJOINT_DIRECTIONS
OUTz(OP_ClientReady); //follows OP_SetServerFilter
@@ -449,7 +450,7 @@ OUT(OP_Trader, TraderBuy_Struct); //3 possible lengths
//alt:OUT(OP_Trader, Trader_ShowItems_Struct);
//alt:OUT(OP_Trader, Trader_Struct);
OUT(OP_TraderBuy, TraderBuy_Struct);
OUT(OP_TraderShop, TraderClick_Struct);
OUTv(OP_TraderShop, TraderClick_Struct);
OUT(OP_WearChange, WearChange_Struct);
OUT(OP_ZoneEntry, ServerZoneEntry_Struct);
#endif
+307
View File
@@ -0,0 +1,307 @@
#include "global_define.h"
#include <map>
#include <string>
std::map<unsigned long, std::string> opcode_map;
std::string get_opcode_name(unsigned long opcode)
{
std::map<unsigned long, std::string>::iterator itr;;
return (itr = opcode_map.find(opcode)) != opcode_map.end() ? itr->second : "OP_Unknown";
}
void load_opcode_names()
{
opcode_map[0x0176] = "LiveOP_Heartbeat";
opcode_map[0x02d7] = "LiveOP_ReloadUI";
opcode_map[0x01eb] = "LiveOP_IncreaseStats";
opcode_map[0x0134] = "LiveOP_ApproveZone";
opcode_map[0x01d5] = "LiveOP_Dye";
opcode_map[0x0168] = "LiveOP_Stamina";
opcode_map[0x014d] = "LiveOP_ControlBoat";
opcode_map[0x003e] = "LiveOP_MobUpdate";
opcode_map[0x0027] = "LiveOP_ClientUpdate";
opcode_map[0x0024] = "LiveOP_ChannelMessage";
opcode_map[0x01d7] = "LiveOP_SimpleMessage";
opcode_map[0x01d8] = "LiveOP_FormattedMessage";
opcode_map[0x01c6] = "LiveOP_TGB";
opcode_map[0x0285] = "LiveOP_TestBuff";
opcode_map[0x012d] = "LiveOP_Bind_Wound";
opcode_map[0x01ab] = "LiveOP_Charm";
opcode_map[0x014c] = "LiveOP_Begging";
opcode_map[0x0152] = "LiveOP_MoveCoin";
opcode_map[0x0292] = "LiveOP_SpawnDoor";
opcode_map[0x009d] = "LiveOP_Sneak";
opcode_map[0x0079] = "LiveOP_ExpUpdate";
opcode_map[0x027d] = "LiveOP_DumpName";
opcode_map[0x01ea] = "LiveOP_RespondAA";
opcode_map[0x01c9] = "LiveOP_SendAAStats";
opcode_map[0x0366] = "LiveOP_SendAATable";
opcode_map[0x01e9] = "LiveOP_AAAction";
opcode_map[0x00bb] = "LiveOP_BoardBoat";
opcode_map[0x00bc] = "LiveOP_LeaveBoat";
opcode_map[0x02b8] = "LiveOP_AdventureInfoRequest";
opcode_map[0x02b9] = "LiveOP_AdventureInfo";
opcode_map[0x02a6] = "LiveOP_AdventureRequest";
opcode_map[0x02a8] = "LiveOP_AdventureDetails";
opcode_map[0x02a9] = "LiveOP_LDoNButton";
opcode_map[0x02ba] = "LiveOP_AdventureData";
opcode_map[0x02c9] = "LiveOP_AdventureFinish";
opcode_map[0x02c6] = "LiveOP_LeaveAdventure";
opcode_map[0x02ce] = "LiveOP_AdventureUpdate";
opcode_map[0x002b] = "LiveOP_SendExpZonein";
opcode_map[0x01e4] = "LiveOP_ZoneInSendName";
opcode_map[0x01bf] = "LiveOP_GuildLeader";
opcode_map[0x009a] = "LiveOP_GuildPeace";
opcode_map[0x0132] = "LiveOP_GuildRemove";
opcode_map[0x0059] = "LiveOP_GuildMemberList";
opcode_map[0x026e] = "LiveOP_GuildMemberUpdate";
opcode_map[0x0130] = "LiveOP_GuildInvite";
opcode_map[0x01c0] = "LiveOP_GuildMOTD";
opcode_map[0x003c] = "LiveOP_GuildPublicNote";
opcode_map[0x027e] = "LiveOP_GetGuildMOTD";
opcode_map[0x0277] = "LiveOP_GuildDemote";
opcode_map[0x0131] = "LiveOP_GuildInviteAccept";
opcode_map[0x00a4] = "LiveOP_GuildWar";
opcode_map[0x0133] = "LiveOP_GuildDelete";
opcode_map[0x0233] = "LiveOP_GuildManageRemove";
opcode_map[0x022d] = "LiveOP_GuildManageAdd";
opcode_map[0x0039] = "LiveOP_GuildManageStatus";
opcode_map[0x01e8] = "LiveOP_Trader";
opcode_map[0x01e7] = "LiveOP_Bazaar";
opcode_map[0x01c4] = "LiveOP_BecomeTrader";
opcode_map[0x01f4] = "LiveOP_BazaarInspect";
opcode_map[0x006e] = "LiveOP_TraderItemUpdate";
opcode_map[0x017c] = "LiveOP_TraderDelItem";
opcode_map[0x01eb] = "LiveOP_TraderShop";
opcode_map[0x01ca] = "LiveOP_TraderBuy";
opcode_map[0x01ac] = "LiveOP_PetCommands";
opcode_map[0x0042] = "LiveOP_TradeSkillCombine";
opcode_map[0x02e5] = "LiveOP_AugmentItem";
opcode_map[0x0367] = "LiveOP_ItemName";
opcode_map[0x02cd] = "LiveOP_ShopItem";
opcode_map[0x0065] = "LiveOP_ShopPlayerBuy";
opcode_map[0x006a] = "LiveOP_ShopPlayerSell";
opcode_map[0x006d] = "LiveOP_ShopDelItem";
opcode_map[0x0f6d] = "LiveOP_ShopEndConfirm";
opcode_map[0x00f7] = "LiveOP_ShopRequest";
opcode_map[0x006c] = "LiveOP_ShopEnd";
opcode_map[0x02d1] = "LiveOP_AdventureMerchantRequest";
opcode_map[0x02d2] = "LiveOP_AdventureMerchantResponse";
opcode_map[0x02d3] = "LiveOP_AdventureMerchantPurchase";
opcode_map[0x02e3] = "LiveOP_AdventurePointsUpdate";
opcode_map[0x0270] = "LiveOP_LFGCommand";
opcode_map[0x01d0] = "LiveOP_LFGAppearance";
opcode_map[0x01b5] = "LiveOP_MoneyUpdate";
opcode_map[0x0721] = "LiveOP_GroupDelete";
opcode_map[0x0272] = "LiveOP_GroupAcknowledge";
opcode_map[0x024a] = "LiveOP_GroupUpdate";
opcode_map[0x025f] = "LiveOP_GroupInvite";
opcode_map[0x00ff] = "LiveOP_GroupDisband";
opcode_map[0x00d5] = "LiveOP_GroupInvite2";
opcode_map[0x025e] = "LiveOP_GroupFollow";
opcode_map[0x00d7] = "LiveOP_GroupFollow2";
opcode_map[0x00d6] = "LiveOP_GroupCancelInvite";
opcode_map[0x0156] = "LiveOP_Split";
opcode_map[0x00d8] = "LiveOP_Jump";
opcode_map[0x01d6] = "LiveOP_ConsiderCorpse";
opcode_map[0x0064] = "LiveOP_SkillUpdate";
opcode_map[0x0178] = "LiveOP_GMEndTrainingResponse";
opcode_map[0x013c] = "LiveOP_GMEndTraining";
opcode_map[0x0175] = "LiveOP_GMTrainSkill";
opcode_map[0x013b] = "LiveOP_GMTraining";
opcode_map[0x017b] = "LiveOP_ConsumeAmmo";
opcode_map[0x0171] = "LiveOP_CombatAbility";
opcode_map[0x009c] = "LiveOP_TrackUnknown";
opcode_map[0x0234] = "LiveOP_TrackTarget";
opcode_map[0x0286] = "LiveOP_Track";
opcode_map[0x0297] = "LiveOP_ReadBook";
opcode_map[0x001f] = "LiveOP_ItemLinkClick";
opcode_map[0x01f4] = "LiveOP_ItemLinkResponse";
opcode_map[0x01d9] = "LiveOP_ItemLinkText";
opcode_map[0x0a41] = "LiveOP_RezzRequest";
opcode_map[0x00e5] = "LiveOP_RezzAnswer";
opcode_map[0x019b] = "LiveOP_RezzComplete";
opcode_map[0x0128] = "LiveOP_MoveDoor";
opcode_map[0x0127] = "LiveOP_ClickDoor";
opcode_map[0x0247] = "LiveOP_SendZonepoints";
opcode_map[0x008c] = "LiveOP_SetRunMode";
opcode_map[0x0248] = "LiveOP_InspectRequest";
opcode_map[0x0249] = "LiveOP_InspectAnswer";
opcode_map[0x0187] = "LiveOP_SenseTraps";
opcode_map[0x018e] = "LiveOP_DisarmTraps";
opcode_map[0x01bc] = "LiveOP_Assist";
opcode_map[0x0240] = "LiveOP_PickPocket";
opcode_map[0x0119] = "LiveOP_LootRequest";
opcode_map[0x011a] = "LiveOP_EndLootRequest";
opcode_map[0x011b] = "LiveOP_MoneyOnCorpse";
opcode_map[0x0179] = "LiveOP_LootComplete";
opcode_map[0x013f] = "LiveOP_LootItem";
opcode_map[0x0151] = "LiveOP_MoveItem";
opcode_map[0x0056] = "LiveOP_WhoAllRequest";
opcode_map[0x0229] = "LiveOP_WhoAllResponse";
opcode_map[0x0167] = "LiveOP_Consume";
opcode_map[0x0172] = "LiveOP_AutoAttack";
opcode_map[0x0186] = "LiveOP_AutoAttack2";
opcode_map[0x0173] = "LiveOP_TargetMouse";
opcode_map[0x01ba] = "LiveOP_TargetCommand";
opcode_map[0x01d8] = "LiveOP_TargetReject";
opcode_map[0x009e] = "LiveOP_Hide";
opcode_map[0x012e] = "LiveOP_Forage";
opcode_map[0x0077] = "LiveOP_Fishing";
opcode_map[0x0246] = "LiveOP_Bug";
opcode_map[0x00f2] = "LiveOP_Emote";
opcode_map[0x0140] = "LiveOP_EmoteAnim";
opcode_map[0x015c] = "LiveOP_Consider";
opcode_map[0x01cb] = "LiveOP_FaceChange";
opcode_map[0x0197] = "LiveOP_RandomReq";
opcode_map[0x0087] = "LiveOP_RandomReply";
opcode_map[0x01c3] = "LiveOP_Camp";
opcode_map[0x0192] = "LiveOP_YellForHelp";
opcode_map[0x00ef] = "LiveOP_SafePoint";
opcode_map[0x0157] = "LiveOP_Buff";
opcode_map[0x00c0] = "LiveOP_ColoredText";
opcode_map[0x0440] = "LiveOP_MultiLineMsg";
opcode_map[0x021c] = "LiveOP_SpecialMesg";
opcode_map[0x0013] = "LiveOP_Consent";
opcode_map[0x029d] = "LiveOP_ConsentResponse";
opcode_map[0x02d4] = "LiveOP_Deny";
opcode_map[0x016c] = "LiveOP_Stun";
opcode_map[0x0021] = "LiveOP_BeginCast";
opcode_map[0x00be] = "LiveOP_CastSpell";
opcode_map[0x01a8] = "LiveOP_InterruptCast";
opcode_map[0x0105] = "LiveOP_Death";
opcode_map[0x023f] = "LiveOP_FeignDeath";
opcode_map[0x012b] = "LiveOP_Illusion";
opcode_map[0x0078] = "LiveOP_LevelUpdate";
opcode_map[0x0371] = "LiveOP_LevelAppearance";
opcode_map[0x00c2] = "LiveOP_MemorizeSpell";
opcode_map[0x0244] = "LiveOP_HPUpdate";
opcode_map[0x022e] = "LiveOP_SendHPTarget";
opcode_map[0x007d] = "LiveOP_Mend";
opcode_map[0x0160] = "LiveOP_Taunt";
opcode_map[0x0199] = "LiveOP_GMDelCorpse";
opcode_map[0x0047] = "LiveOP_GMFind";
opcode_map[0x0020] = "LiveOP_GMServers";
opcode_map[0x010b] = "LiveOP_GMGoto";
opcode_map[0x028c] = "LiveOP_GMSummon";
opcode_map[0x010a] = "LiveOP_GMKick";
opcode_map[0x0109] = "LiveOP_GMKill";
opcode_map[0x0b40] = "LiveOP_GMNameChange";
opcode_map[0x00a3] = "LiveOP_GMLastName";
opcode_map[0x01b3] = "LiveOP_GMToggle";
opcode_map[0x028f] = "LiveOP_GMEmoteZone";
opcode_map[0x0074] = "LiveOP_GMBecomeNPC";
opcode_map[0x00de] = "LiveOP_GMHideMe";
opcode_map[0x0184] = "LiveOP_GMZoneRequest";
opcode_map[0x0239] = "LiveOP_GMZoneRequest2";
opcode_map[0x0068] = "LiveOP_Petition";
opcode_map[0x0085] = "LiveOP_PetitionRefresh";
opcode_map[0x01ee] = "LiveOP_PDeletePetition";
opcode_map[0x0092] = "LiveOP_PetitionBug";
opcode_map[0x0069] = "LiveOP_PetitionUpdate";
opcode_map[0x0076] = "LiveOP_PetitionCheckout";
opcode_map[0x0056] = "LiveOP_PetitionCheckout2";
opcode_map[0x0091] = "LiveOP_PetitionDelete";
opcode_map[0x02b4] = "LiveOP_PetitionResolve";
opcode_map[0x007e] = "LiveOP_PetitionCheckIn";
opcode_map[0x0090] = "LiveOP_PetitionUnCheckout";
opcode_map[0x01ec] = "LiveOP_PetitionQue";
opcode_map[0x01bb] = "LiveOP_SetServerFilter";
opcode_map[0x0218] = "LiveOP_NewSpawn";
opcode_map[0x0140] = "LiveOP_Animation";
opcode_map[0x0142] = "LiveOP_ZoneChange";
opcode_map[0x00f3] = "LiveOP_DeleteSpawn";
opcode_map[0x0265] = "LiveOP_CrashDump";
opcode_map[0x00e8] = "LiveOP_EnvDamage";
opcode_map[0x0101] = "LiveOP_Action";
opcode_map[0x00e2] = "LiveOP_Damage";
opcode_map[0x00bf] = "LiveOP_ManaChange";
opcode_map[0x027c] = "LiveOP_ClientError";
opcode_map[0x00fb] = "LiveOP_Save";
opcode_map[0x0316] = "LiveOP_LocInfo";
opcode_map[0x0188] = "LiveOP_Surname";
opcode_map[0x018f] = "LiveOP_SwapSpell";
opcode_map[0x01db] = "LiveOP_DeleteSpell";
opcode_map[0x029f] = "LiveOP_CloseContainer";
opcode_map[0x029f] = "LiveOP_ClickObjectAck";
opcode_map[0x00fa] = "LiveOP_CreateObject";
opcode_map[0x00f9] = "LiveOP_ClickObject";
opcode_map[0x01c1] = "LiveOP_ClearObject";
opcode_map[0x0265] = "LiveOP_ZoneUnavail";
opcode_map[0x02e0] = "LiveOP_ItemPacket";
opcode_map[0x029a] = "LiveOP_TradeRequest";
opcode_map[0x0037] = "LiveOP_TradeRequestAck";
opcode_map[0x002d] = "LiveOP_TradeAcceptClick";
opcode_map[0x0162] = "LiveOP_TradeMoneyUpdate";
opcode_map[0x0036] = "LiveOP_TradeCoins";
opcode_map[0x002e] = "LiveOP_CancelTrade";
opcode_map[0x002f] = "LiveOP_FinishTrade";
opcode_map[0x00a1] = "LiveOP_SaveOnZoneReq";
opcode_map[0x0185] = "LiveOP_Logout";
opcode_map[0x0298] = "LiveOP_RequestDuel";
opcode_map[0x0a5d] = "LiveOP_DuelResponse";
opcode_map[0x016e] = "LiveOP_DuelResponse2";
opcode_map[0x007c] = "LiveOP_InstillDoubt";
opcode_map[0x00ac] = "LiveOP_SafeFallSuccess";
opcode_map[0x02fb] = "LiveOP_DisciplineUpdate";
opcode_map[0x02f2] = "LiveOP_TributeUpdate";
opcode_map[0x02f3] = "LiveOP_TributeItem";
opcode_map[0x02f4] = "LiveOP_TributePointUpdate";
opcode_map[0x02f5] = "LiveOP_SendTributes";
opcode_map[0x02f6] = "LiveOP_TributeInfo";
opcode_map[0x02f7] = "LiveOP_SelectTribute";
opcode_map[0x02f8] = "LiveOP_TributeTimer";
opcode_map[0x02f9] = "LiveOP_StartTribute";
opcode_map[0x02fa] = "LiveOP_TributeNPC";
opcode_map[0x02fe] = "LiveOP_TributeMoney";
opcode_map[0x0364] = "LiveOP_TributeToggle";
opcode_map[0x0322] = "LiveOP_RecipesFavorite";
opcode_map[0x01f9] = "LiveOP_RecipesSearch";
opcode_map[0x01fa] = "LiveOP_RecipeReply";
opcode_map[0x01fb] = "LiveOP_RecipeDetails";
opcode_map[0x01fc] = "LiveOP_RecipeAutoCombine";
opcode_map[0x02db] = "LiveOP_FindPersonRequest";
opcode_map[0x02dc] = "LiveOP_FindPersonReply";
opcode_map[0x01dd] = "LiveOP_Shielding";
opcode_map[0x0198] = "LiveOP_SetDataRate";
opcode_map[0x023b] = "LiveOP_ZoneEntry";
opcode_map[0x006b] = "LiveOP_PlayerProfile";
opcode_map[0x0291] = "LiveOP_CharInventory";
opcode_map[0x0170] = "LiveOP_ZoneSpawns";
opcode_map[0x0026] = "LiveOP_TimeOfDay";
opcode_map[0x015b] = "LiveOP_Weather";
opcode_map[0x00ec] = "LiveOP_ReqNewZone";
opcode_map[0x00eb] = "LiveOP_NewZone";
opcode_map[0x00fd] = "LiveOP_ReqClientSpawn";
opcode_map[0x012F] = "LiveOP_SpawnAppearance";
opcode_map[0x0086] = "LiveOP_ClientReady";
opcode_map[0x0086] = "LiveOP_ZoneComplete";
opcode_map[0x02db] = "LiveOP_LoginComplete";
opcode_map[0x0195] = "LiveOP_ApproveWorld";
opcode_map[0x035f] = "LiveOP_LogServer";
opcode_map[0x01b2] = "LiveOP_MOTD";
opcode_map[0x0251] = "LiveOP_SendLoginInfo";
opcode_map[0x00ea] = "LiveOP_DeleteCharacter";
opcode_map[0x0102] = "LiveOP_SendCharInfo";
opcode_map[0x00e1] = "LiveOP_ExpansionInfo";
opcode_map[0x0104] = "LiveOP_CharacterCreate";
opcode_map[0x02ab] = "LiveOP_RandomNameGenerator";
opcode_map[0x005d] = "LiveOP_GuildsList";
opcode_map[0x0125] = "LiveOP_ApproveName";
opcode_map[0x0261] = "LiveOP_EnterWorld";
opcode_map[0x015a] = "LiveOP_World_Client_CRC1";
opcode_map[0x015e] = "LiveOP_World_Client_CRC2";
opcode_map[0x0269] = "LiveOP_SetChatServer";
opcode_map[0x0264] = "LiveOP_ZoneServerInfo";
opcode_map[0x0017] = "LiveOP_AckPacket";
opcode_map[0x012c] = "LiveOP_WearChange";
opcode_map[0x1FA1] = "LiveOP_WorldObjectsSent";
opcode_map[0x39C4] = "LiveOP_BlockedBuffs";
opcode_map[0x4656] = "LiveOP_SpawnPositionUpdate";
opcode_map[0x4b61] = "LiveOP_ManaUpdate";
opcode_map[0x02d6] = "LiveOP_EnduranceUpdate";
opcode_map[0x2ac1] = "LiveOP_MobManaUpdate";
opcode_map[0x6c5f] = "LiveOP_MobEnduranceUpdate";
opcode_map[0x73a8] = "LiveOP_SendMaxCharacters";
}
+2 -2
View File
@@ -54,7 +54,7 @@ void DumpPacketHex(const uchar* buf, uint32 size, uint32 cols, uint32 skip) {
// Output as HEX
char output[4];
int j = 0;
char* ascii = new char[cols+1];
auto ascii = new char[cols + 1];
memset(ascii, 0, cols+1);
uint32 i;
for(i=skip; i<size; i++)
@@ -100,7 +100,7 @@ std::string DumpPacketHexToString(const uchar* buf, uint32 size, uint32 cols, ui
// Output as HEX
char output[4];
int j = 0;
char* ascii = new char[cols + 1];
auto ascii = new char[cols + 1];
memset(ascii, 0, cols + 1);
uint32 i;
for (i = skip; i < size; i++)
+3 -1
View File
@@ -94,7 +94,9 @@ void FileDumpPacketHex(const char* filename, const uchar* buf, uint32 size, uint
std::ofstream logfile(filename, std::ios::app);
// Output as HEX
char output[4];
int j = 0; char* ascii = new char[cols+1]; memset(ascii, 0, cols+1);
int j = 0;
auto ascii = new char[cols + 1];
memset(ascii, 0, cols + 1);
uint32 i;
for(i=skip; i<size; i++)
{
+438
View File
@@ -0,0 +1,438 @@
#ifndef WIN32
#include <unistd.h>
#else
#include <winsock2.h>
#endif
#include <errno.h>
#include <string.h>
#include <time.h>
#include "packetfile.h"
#include "../common/eq_opcodes.h"
#include "../common/eq_packet_structs.h"
#include "../common/misc.h"
#include <map>
PacketFileWriter::PacketFileWriter(bool _force_flush) {
out = NULL;
force_flush = _force_flush;
}
PacketFileWriter::~PacketFileWriter() {
CloseFile();
}
bool PacketFileWriter::SetPacketStamp(const char *name, uint32 stamp) {
FILE *in;
in = fopen(name, "r+b");
if(in == NULL) {
fprintf(stderr, "Error opening packet file '%s': %s\n", name, strerror(errno));
return(false);
}
unsigned long magic = 0;
if(fread(&magic, sizeof(magic), 1, in) != 1) {
fprintf(stderr, "Error reading header from packet file: %s\n", strerror(errno));
fclose(in);
return(false);
}
PacketFileReader *ret = NULL;
if(magic == OLD_PACKET_FILE_MAGIC) {
OldPacketFileHeader *pos = 0;
uint32 stamp_pos = (uint32) &pos->packet_file_stamp;
fseek(in, stamp_pos, SEEK_SET);
OldPacketFileHeader hdr;
hdr.packet_file_stamp = stamp;
if(fwrite(&hdr.packet_file_stamp, sizeof(hdr.packet_file_stamp), 1, in) != 1) {
fprintf(stderr, "Error writting to packet file: %s\n", strerror(errno));
fclose(in);
return(false);
}
} else if(magic == PACKET_FILE_MAGIC) {
PacketFileHeader *pos = 0;
uint32 stamp_pos = (uint32) &pos->packet_file_stamp;
fseek(in, stamp_pos, SEEK_SET);
PacketFileHeader hdr;
hdr.packet_file_stamp = stamp;
if(fwrite(&hdr.packet_file_stamp, sizeof(hdr.packet_file_stamp), 1, in) != 1) {
fprintf(stderr, "Error writting to packet file: %s\n", strerror(errno));
fclose(in);
return(false);
}
} else {
fprintf(stderr, "Unknown packet file type 0x%.8x\n", magic);
fclose(in);
return(false);
}
fclose(in);
return(true);
}
bool PacketFileWriter::OpenFile(const char *name) {
CloseFile();
printf("Opening packet file: %s\n", name);
out = fopen(name, "wb");
if(out == NULL) {
fprintf(stderr, "Error opening packet file '%s': %s\n", name, strerror(errno));
return(false);
}
PacketFileHeader head;
head.packet_file_magic = PACKET_FILE_MAGIC;
head.packet_file_version = PACKET_FILE_CURRENT_VERSION;
head.packet_file_stamp = time(NULL);
if(fwrite(&head, sizeof(head), 1, out) != 1) {
fprintf(stderr, "Error writting header to packet file: %s\n", strerror(errno));
fclose(out);
return(false);
}
return(true);
}
void PacketFileWriter::CloseFile() {
if(out != NULL) {
fclose(out);
out = NULL;
printf("Closed packet file.\n");
}
}
void PacketFileWriter::WritePacket(uint16 eq_op, uint32 packlen, const unsigned char *packet, bool to_server, const struct timeval &tv) {
if(out == NULL)
return;
_WriteBlock(eq_op, packet, packlen, to_server, tv);
/*
Could log only the packets we care about, but this is most of the stream,
so just log them all...
switch(eq_op) {
case OP_NewZone:
case OP_ZoneSpawns:
case OP_NewSpawn:
case OP_MobUpdate:
case OP_ClientUpdate:
case OP_Death:
case OP_DeleteSpawn:
case OP_CastSpell:
case OP_ShopRequest:
case OP_ShopEndConfirm:
case OP_ItemPacket:
_WriteBlock(eq_op, packet, packlen);
default:
return;
}
*/
}
bool PacketFileWriter::_WriteBlock(uint16 eq_op, const void *d, uint16 len, bool to_server, const struct timeval &tv) {
if(out == NULL)
return(false);
PacketFileSection s;
s.opcode = eq_op;
s.len = len;
s.tv_sec = tv.tv_sec;
s.tv_msec = tv.tv_usec/1000;
if(to_server)
SetToServer(s);
else
SetToClient(s);
if(fwrite(&s, sizeof(s), 1, out) != 1) {
fprintf(stderr, "Error writting block header: %s\n", strerror(errno));
return(false);
}
if(fwrite(d, 1, len, out) != len) {
fprintf(stderr, "Error writting block body: %s\n", strerror(errno));
return(false);
}
if(force_flush)
fflush(out);
return(true);
}
PacketFileReader *PacketFileReader::OpenPacketFile(const char *name) {
FILE *in;
in = fopen(name, "rb");
if(in == NULL) {
fprintf(stderr, "Error opening packet file '%s': %s\n", name, strerror(errno));
return(NULL);
}
unsigned long magic = 0;
if(fread(&magic, sizeof(magic), 1, in) != 1) {
fprintf(stderr, "Error reading header to packet file: %s\n", strerror(errno));
fclose(in);
return(NULL);
}
PacketFileReader *ret = NULL;
if(magic == OLD_PACKET_FILE_MAGIC) {
ret = new OldPacketFileReader();
} else if(magic == PACKET_FILE_MAGIC) {
ret = new NewPacketFileReader();
} else {
fprintf(stderr, "Unknown packet file type 0x%.8x\n", magic);
fclose(in);
return(NULL);
}
if(!ret->OpenFile(name)) {
safe_delete(ret);
return(NULL);
}
return(ret);
}
PacketFileReader::PacketFileReader() {
packet_file_stamp = 0;
}
OldPacketFileReader::OldPacketFileReader()
: PacketFileReader()
{
in = NULL;
}
OldPacketFileReader::~OldPacketFileReader() {
CloseFile();
}
bool OldPacketFileReader::OpenFile(const char *name) {
CloseFile();
in = fopen(name, "rb");
if(in == NULL) {
fprintf(stderr, "Error opening packet file '%s': %s\n", name, strerror(errno));
return(false);
}
OldPacketFileHeader head;
if(fread(&head, sizeof(head), 1, in) != 1) {
fprintf(stderr, "Error reading header to packet file: %s\n", strerror(errno));
fclose(in);
return(false);
}
if(head.packet_file_magic != OLD_PACKET_FILE_MAGIC) {
fclose(in);
if(head.packet_file_magic > (OLD_PACKET_FILE_MAGIC)) {
fprintf(stderr, "Error: this is a build file, not a packet file, its allready processed!\n");
} else {
fprintf(stderr, "Error: this is not a packet file!\n");
}
return(false);
}
uint32 now = time(NULL);
if(head.packet_file_stamp > now) {
fprintf(stderr, "Error: invalid timestamp in file. Your clock or the collector's is wrong (%d sec ahead).\n", head.packet_file_stamp-now);
fclose(in);
return(false);
}
packet_file_stamp = head.packet_file_stamp;
return(true);
}
void OldPacketFileReader::CloseFile() {
if(in != NULL) {
fclose(in);
in = NULL;
}
}
bool OldPacketFileReader::ResetFile() {
if(in == NULL)
return(false);
rewind(in);
//gotta read past the header again
OldPacketFileHeader head;
if(fread(&head, sizeof(head), 1, in) != 1) {
return(false);
}
return(true);
}
bool OldPacketFileReader::ReadPacket(uint16 &eq_op, uint32 &packlen, unsigned char *packet, bool &to_server, struct timeval &tv) {
if(in == NULL)
return(false);
if(feof(in))
return(false);
OldPacketFileSection s;
if(fread(&s, sizeof(s), 1, in) != 1) {
if(!feof(in))
fprintf(stderr, "Error reading section header: %s\n", strerror(errno));
return(false);
}
eq_op = s.opcode;
if(packlen < s.len) {
fprintf(stderr, "Packet buffer is too small! %d < %d, skipping\n", packlen, s.len);
fseek(in, s.len, SEEK_CUR);
return(false);
}
if(fread(packet, 1, s.len, in) != s.len) {
if(feof(in))
fprintf(stderr, "Error: EOF encountered when expecting packet data.\n");
else
fprintf(stderr, "Error reading packet body: %s\n", strerror(errno));
return(false);
}
packlen = s.len;
to_server = false;
tv.tv_sec = 0;
tv.tv_usec = 0;
return(true);
}
NewPacketFileReader::NewPacketFileReader()
: PacketFileReader()
{
in = NULL;
}
NewPacketFileReader::~NewPacketFileReader() {
CloseFile();
}
bool NewPacketFileReader::OpenFile(const char *name) {
CloseFile();
in = fopen(name, "rb");
if(in == NULL) {
fprintf(stderr, "Error opening packet file '%s': %s\n", name, strerror(errno));
return(false);
}
PacketFileHeader head;
if(fread(&head, sizeof(head), 1, in) != 1) {
fprintf(stderr, "Error reading header to packet file: %s\n", strerror(errno));
fclose(in);
return(false);
}
if(head.packet_file_magic != PACKET_FILE_MAGIC) {
fclose(in);
if(head.packet_file_magic == (PACKET_FILE_MAGIC+1)) {
fprintf(stderr, "Error: this is a build file, not a packet file, its allready processed!\n");
} else {
fprintf(stderr, "Error: this is not a packet file!\n");
}
return(false);
}
uint32 now = time(NULL);
if(head.packet_file_stamp > now) {
fprintf(stderr, "Error: invalid timestamp in file. Your clock or the collector's is wrong (%d sec ahead).\n", head.packet_file_stamp-now);
fclose(in);
return(false);
}
packet_file_stamp = head.packet_file_stamp;
return(true);
}
void NewPacketFileReader::CloseFile() {
if(in != NULL) {
fclose(in);
in = NULL;
}
}
bool NewPacketFileReader::ResetFile() {
if(in == NULL)
return(false);
rewind(in);
//gotta read past the header again
PacketFileHeader head;
if(fread(&head, sizeof(head), 1, in) != 1) {
return(false);
}
return(true);
}
bool NewPacketFileReader::ReadPacket(uint16 &eq_op, uint32 &packlen, unsigned char *packet, bool &to_server, struct timeval &tv) {
if(in == NULL)
return(false);
if(feof(in))
return(false);
PacketFileSection s;
if(fread(&s, sizeof(s), 1, in) != 1) {
if(!feof(in))
fprintf(stderr, "Error reading section header: %s\n", strerror(errno));
return(false);
}
eq_op = s.opcode;
if(packlen < s.len) {
fprintf(stderr, "Packet buffer is too small! %d < %d, skipping\n", packlen, s.len);
fseek(in, s.len, SEEK_CUR);
return(false);
}
if(fread(packet, 1, s.len, in) != s.len) {
if(feof(in))
fprintf(stderr, "Error: EOF encountered when expecting packet data.\n");
else
fprintf(stderr, "Error reading packet body: %s\n", strerror(errno));
return(false);
}
packlen = s.len;
to_server = IsToServer(s);
tv.tv_sec = s.tv_sec;
tv.tv_usec = 1000*s.tv_msec;
return(true);
}
+130
View File
@@ -0,0 +1,130 @@
#ifndef PACKET_FILE_H
#define PACKET_FILE_H
#include "../common/types.h"
#include <stdio.h>
#include <time.h>
//#include <zlib.h>
//constants used in the packet file header
#define PACKET_FILE_MAGIC 0x93a7b6f6
#define OLD_PACKET_FILE_MAGIC 0x93a7b6f7
#define PACKET_FILE_CURRENT_VERSION 1
#pragma pack(1)
//old structs from when I forgot to put the version number in
struct OldPacketFileHeader {
uint32 packet_file_magic;
uint32 packet_file_stamp;
};
struct OldPacketFileSection {
uint16 opcode;
uint32 len;
};
struct PacketFileHeader {
uint32 packet_file_magic;
uint16 packet_file_version;
uint32 packet_file_stamp;
};
struct PacketFileSection {
uint16 opcode;
uint8 flags; //mainly for client->server, but others could be added
uint32 tv_sec;
uint16 tv_msec;
uint32 len;
};
#pragma pack()
#define TO_SERVER_FLAG 0x01
#define SetToClient(pfs) pfs.flags = pfs.flags&~TO_SERVER_FLAG
#define SetToServer(pfs) pfs.flags = pfs.flags|TO_SERVER_FLAG
#define IsToClient(pfs) (pfs.flags&TO_SERVER_FLAG == 0)
#define IsToServer(pfs) (pfs.flags&TO_SERVER_FLAG != 0)
class PacketFileWriter {
public:
PacketFileWriter(bool force_flush);
~PacketFileWriter();
bool OpenFile(const char *name);
void CloseFile();
void WritePacket(uint16 eq_op, uint32 packlen, const unsigned char *packet, bool to_server, const struct timeval &tv);
static bool SetPacketStamp(const char *file, uint32 stamp);
protected:
bool _WriteBlock(uint16 eq_op, const void *d, uint16 len, bool to_server, const struct timeval &tv);
//gzFile out;
FILE *out;
bool force_flush;
};
class PacketFileReader {
public:
PacketFileReader();
virtual bool OpenFile(const char *name) = 0;
virtual void CloseFile() = 0;
virtual bool ResetFile() = 0; //aka rewind
virtual bool ReadPacket(uint16 &eq_op, uint32 &packlen, unsigned char *packet, bool &to_server, struct timeval &tv) = 0;
time_t GetStamp() { return(time_t(packet_file_stamp)); }
//factory method to open the right packet file.
static PacketFileReader *OpenPacketFile(const char *name);
protected:
uint32 packet_file_stamp;
};
class OldPacketFileReader : public PacketFileReader {
public:
OldPacketFileReader();
virtual ~OldPacketFileReader();
bool OpenFile(const char *name);
void CloseFile();
bool ResetFile(); //aka rewind
bool ReadPacket(uint16 &eq_op, uint32 &packlen, unsigned char *packet, bool &to_server, struct timeval &tv);
time_t GetStamp() { return(time_t(packet_file_stamp)); }
protected:
//gzFile in;
FILE *in;
};
class NewPacketFileReader: public PacketFileReader {
public:
NewPacketFileReader();
virtual ~NewPacketFileReader();
bool OpenFile(const char *name);
void CloseFile();
bool ResetFile(); //aka rewind
bool ReadPacket(uint16 &eq_op, uint32 &packlen, unsigned char *packet, bool &to_server, struct timeval &tv);
time_t GetStamp() { return(time_t(packet_file_stamp)); }
protected:
//gzFile in;
FILE *in;
};
#endif
@@ -0,0 +1,19 @@
/*
These fields must be in the order of how they are serialized!
*/
/* 000 */ //I(ItemClass) Leave this one off on purpose
/* 001 */ S(Name)
/* 002 */ S(Lore)
/* 003 */ S(IDFile)
/* 004 */ I(ID)
/* 005 */ //I(Weight) handled manually
// titanium_itemfields_b.h
@@ -8,12 +8,10 @@ These fields must be in the order of how they are serialized!
*/
/* 000 */ //I(ItemClass) Leave this one off on purpose
/* 001 */ S(Name)
/* 002 */ S(Lore)
/* 003 */ S(IDFile)
/* 004 */ I(ID)
/* 005 */ I(Weight)
// titanium_itemfields_a.h
/* 005 */ //I(Weight) handled manually
/* 006 */ I(NoRent)
/* 007 */ I(NoDrop)
/* 008 */ I(Size)
@@ -41,7 +39,7 @@ These fields must be in the order of how they are serialized!
/* 030 */ I(AC)
/* 031 */ I(Deity)
/* 032 */ I(SkillModValue)
/* 033 */ C("0")
/* 033 */ I(SkillModMax)
/* 034 */ I(SkillModType)
/* 035 */ I(BaneDmgRace)
/* 036 */ I(BaneDmgAmt)
+1 -1
View File
@@ -5,7 +5,7 @@ if [ -z "$1" ]; then
exit 1
fi
for ext in .cpp .h _ops.h _constants.h _structs.h
for ext in .cpp _limits.cpp .h _ops.h _limits.h _structs.h
do
cp template$ext $1$ext
perl -pi -e "s/TEMPLATE/$1/g" $1$ext
+23 -2
View File
@@ -1,3 +1,21 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
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 "../global_define.h"
#include "patches.h"
@@ -9,7 +27,9 @@
#include "rof.h"
#include "rof2.h"
void RegisterAllPatches(EQStreamIdentifier &into) {
void RegisterAllPatches(EQStreamIdentifier &into)
{
Titanium::Register(into);
SoF::Register(into);
SoD::Register(into);
@@ -18,7 +38,8 @@ void RegisterAllPatches(EQStreamIdentifier &into) {
RoF2::Register(into);
}
void ReloadAllPatches() {
void ReloadAllPatches()
{
Titanium::Reload();
SoF::Reload();
SoD::Reload();
+23 -3
View File
@@ -1,5 +1,25 @@
#ifndef PATCHES_H_
#define PATCHES_H_
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
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
*/
#ifndef COMMON_PATCHES_H
#define COMMON_PATCHES_H
/*enum {
Patch_062,
@@ -12,4 +32,4 @@ class EQStreamIdentifier;
void RegisterAllPatches(EQStreamIdentifier &into);
void ReloadAllPatches();
#endif /*PATCHES_H_*/
#endif /*COMMON_PATCHES_H*/
+817 -687
View File
File diff suppressed because it is too large Load Diff
+26 -6
View File
@@ -1,11 +1,31 @@
#ifndef ROF_H_
#define ROF_H_
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
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
*/
#ifndef COMMON_ROF_H
#define COMMON_ROF_H
#include "../struct_strategy.h"
class EQStreamIdentifier;
namespace RoF {
namespace RoF
{
//these are the only public member of this namespace.
extern void Register(EQStreamIdentifier &into);
@@ -23,13 +43,13 @@ namespace RoF {
protected:
virtual std::string Describe() const;
virtual const ClientVersion GetClientVersion() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
#include "rof_ops.h"
};
};
}; /*RoF*/
#endif /*ROF_H_*/
#endif /*COMMON_ROF_H*/
+1061 -728
View File
File diff suppressed because it is too large Load Diff
+26 -6
View File
@@ -1,11 +1,31 @@
#ifndef ROF2_H_
#define ROF2_H_
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
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
*/
#ifndef COMMON_ROF2_H
#define COMMON_ROF2_H
#include "../struct_strategy.h"
class EQStreamIdentifier;
namespace RoF2 {
namespace RoF2
{
//these are the only public member of this namespace.
extern void Register(EQStreamIdentifier &into);
@@ -23,13 +43,13 @@ namespace RoF2 {
protected:
virtual std::string Describe() const;
virtual const ClientVersion GetClientVersion() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
#include "rof2_ops.h"
};
};
}; /*RoF2*/
#endif /*ROF2_H_*/
#endif /*COMMON_ROF2_H*/
-219
View File
@@ -1,219 +0,0 @@
/*
EQEMu: Everquest Server Emulator
Copyright (C) 2001-2014 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
*/
#ifndef ROF2_CONSTANTS_H_
#define ROF2_CONSTANTS_H_
#include "../types.h"
namespace RoF2 {
namespace maps {
typedef enum : int16 {
MapPossessions = 0,
MapBank,
MapSharedBank,
MapTrade,
MapWorld,
MapLimbo,
MapTribute,
MapTrophyTribute,
MapGuildTribute,
MapMerchant,
MapDeleted,
MapCorpse,
MapBazaar,
MapInspect,
MapRealEstate,
MapViewMODPC,
MapViewMODBank,
MapViewMODSharedBank,
MapViewMODLimbo,
MapAltStorage,
MapArchived,
MapMail,
MapGuildTrophyTribute,
MapKrono,
MapOther,
_MapCount
} InventoryMaps;
}
namespace slots {
typedef enum : int16 {
MainCharm = 0,
MainEar1,
MainHead,
MainFace,
MainEar2,
MainNeck,
MainShoulders,
MainArms,
MainBack,
MainWrist1,
MainWrist2,
MainRange,
MainHands,
MainPrimary,
MainSecondary,
MainFinger1,
MainFinger2,
MainChest,
MainLegs,
MainFeet,
MainWaist,
MainPowerSource,
MainAmmo,
MainGeneral1,
MainGeneral2,
MainGeneral3,
MainGeneral4,
MainGeneral5,
MainGeneral6,
MainGeneral7,
MainGeneral8,
MainGeneral9,
MainGeneral10,
MainCursor,
_MainCount,
_MainEquipmentBegin = MainCharm,
_MainEquipmentEnd = MainAmmo,
_MainEquipmentCount = (_MainEquipmentEnd - _MainEquipmentBegin + 1),
_MainGeneralBegin = MainGeneral1,
_MainGeneralEnd = MainGeneral10,
_MainGeneralCount = (_MainGeneralEnd - _MainGeneralBegin + 1)
} EquipmentSlots;
}
namespace consts {
static const uint16 MAP_POSSESSIONS_SIZE = slots::_MainCount;
static const uint16 MAP_BANK_SIZE = 24;
static const uint16 MAP_SHARED_BANK_SIZE = 2;
static const uint16 MAP_TRADE_SIZE = 8;
static const uint16 MAP_WORLD_SIZE = 10;
static const uint16 MAP_LIMBO_SIZE = 36;
static const uint16 MAP_TRIBUTE_SIZE = 0; //?
static const uint16 MAP_TROPHY_TRIBUTE_SIZE = 0;
static const uint16 MAP_GUILD_TRIBUTE_SIZE = 0;
static const uint16 MAP_MERCHANT_SIZE = 0;
static const uint16 MAP_DELETED_SIZE = 0;
static const uint16 MAP_CORPSE_SIZE = slots::_MainCount;
static const uint16 MAP_BAZAAR_SIZE = 200;
static const uint16 MAP_INSPECT_SIZE = slots::_MainEquipmentCount;
static const uint16 MAP_REAL_ESTATE_SIZE = 0;
static const uint16 MAP_VIEW_MOD_PC_SIZE = MAP_POSSESSIONS_SIZE;
static const uint16 MAP_VIEW_MOD_BANK_SIZE = MAP_BANK_SIZE;
static const uint16 MAP_VIEW_MOD_SHARED_BANK_SIZE = MAP_SHARED_BANK_SIZE;
static const uint16 MAP_VIEW_MOD_LIMBO_SIZE = MAP_LIMBO_SIZE;
static const uint16 MAP_ALT_STORAGE_SIZE = 0;
static const uint16 MAP_ARCHIVED_SIZE = 0;
static const uint16 MAP_MAIL_SIZE = 0;
static const uint16 MAP_GUILD_TROPHY_TRIBUTE_SIZE = 0;
static const uint16 MAP_KRONO_SIZE = NOT_USED;
static const uint16 MAP_OTHER_SIZE = 0;
// most of these definitions will go away with the structure-based system..this maintains compatibility for now
// (bag slots and main slots beyond Possessions are assigned for compatibility with current server coding)
static const int16 EQUIPMENT_BEGIN = slots::MainCharm;
static const int16 EQUIPMENT_END = slots::MainAmmo;
static const uint16 EQUIPMENT_SIZE = slots::_MainEquipmentCount;
static const int16 GENERAL_BEGIN = slots::MainGeneral1;
static const int16 GENERAL_END = slots::MainGeneral10;
static const uint16 GENERAL_SIZE = slots::_MainGeneralCount;
static const int16 GENERAL_BAGS_BEGIN = 251;
static const int16 GENERAL_BAGS_END_OFFSET = 99;
static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET;
static const int16 CURSOR = slots::MainCursor;
static const int16 CURSOR_BAG_BEGIN = 351;
static const int16 CURSOR_BAG_END_OFFSET = 9;
static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET;
static const int16 BANK_BEGIN = 2000;
static const int16 BANK_END = 2023;
static const int16 BANK_BAGS_BEGIN = 2031;
static const int16 BANK_BAGS_END_OFFSET = 239;
static const int16 BANK_BAGS_END = BANK_BAGS_BEGIN + BANK_BAGS_END_OFFSET;
static const int16 SHARED_BANK_BEGIN = 2500;
static const int16 SHARED_BANK_END = 2501;
static const int16 SHARED_BANK_BAGS_BEGIN = 2531;
static const int16 SHARED_BANK_BAGS_END_OFFSET = 19;
static const int16 SHARED_BANK_BAGS_END = SHARED_BANK_BAGS_BEGIN + SHARED_BANK_BAGS_END_OFFSET;
static const int16 TRADE_BEGIN = 3000;
static const int16 TRADE_END = 3007;
static const int16 TRADE_NPC_END = 3003;
static const int16 TRADE_BAGS_BEGIN = 3031;
static const int16 TRADE_BAGS_END_OFFSET = 79;
static const int16 TRADE_BAGS_END = TRADE_BAGS_BEGIN + TRADE_BAGS_END_OFFSET;
static const int16 WORLD_BEGIN = 4000;
static const int16 WORLD_END = 4009;
static const int16 TRIBUTE_BEGIN = 400;
static const int16 TRIBUTE_END = 404;
static const int16 CORPSE_BEGIN = slots::MainGeneral1;
static const int16 CORPSE_END = slots::MainGeneral1 + slots::MainCursor;
static const uint16 ITEM_COMMON_SIZE = 6;
static const uint16 ITEM_CONTAINER_SIZE = 255; // 255; (server max will be 255..unsure what actual client is - test)
static const uint32 BANDOLIERS_COUNT = 20; // count = number of bandolier instances
static const uint32 BANDOLIER_SIZE = 4; // size = number of equipment slots in bandolier instance
static const uint32 POTION_BELT_SIZE = 5;
static const size_t TEXT_LINK_BODY_LENGTH = 56;
}
namespace limits {
static const bool ALLOWS_EMPTY_BAG_IN_BAG = true;
static const bool ALLOWS_CLICK_CAST_FROM_BAG = true;
static const bool COIN_HAS_WEIGHT = false;
}
}; //end namespace RoF2
#endif /*ROF2_CONSTANTS_H_*/
/*
RoF2 Notes:
** Structure-based inventory **
ok Possessions: ( 0, { 0 .. 33 }, -1, -1 ) (Corpse: { 23 .. 56 } [Offset 23])
ok [Equipment: ( 0, { 0 .. 22 }, -1, -1 )]
ok [General: ( 0, { 23 .. 32 }, -1, -1 )]
ok [Cursor: ( 0, 33, -1, -1 )]
General Bags: ( 0, { 23 .. 32 }, { 0 .. (maxsize - 1) }, -1 )
Cursor Bags: ( 0, 33, { 0 .. (maxsize - 1) }, -1 )
Bank: ( 1, { 0 .. 23 }, -1, -1 )
Bank Bags: ( 1, { 0 .. 23 }, { 0 .. (maxsize - 1)}, -1 )
Shared Bank: ( 2, { 0 .. 1 }, -1, -1 )
Shared Bank Bags: ( 2, { 0 .. 1 }, { 0 .. (maxsize - 1) }, -1 )
Trade: ( 3, { 0 .. 8 }, -1, -1 )
(Trade Bags: 3031 - 3110 -- server values)
World: ( 4, { 0 .. 10 }, -1, -1 )
*/
+266
View File
@@ -0,0 +1,266 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
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 "rof2_limits.h"
#include "../string_util.h"
size_t RoF2::invtype::InvTypeSize(int inv_type)
{
switch (inv_type) {
case invtype::InvTypePossessions:
return invtype::InvTypePossessionsSize;
case invtype::InvTypeBank:
return invtype::InvTypeBankSize;
case invtype::InvTypeSharedBank:
return invtype::InvTypeSharedBankSize;
case invtype::InvTypeTrade:
return invtype::InvTypeTradeSize;
case invtype::InvTypeWorld:
return invtype::InvTypeWorldSize;
case invtype::InvTypeLimbo:
return invtype::InvTypeLimboSize;
case invtype::InvTypeTribute:
return invtype::InvTypeTributeSize;
case invtype::InvTypeTrophyTribute:
return invtype::InvTypeTrophyTributeSize;
case invtype::InvTypeGuildTribute:
return invtype::InvTypeGuildTributeSize;
case invtype::InvTypeMerchant:
return invtype::InvTypeMerchantSize;
case invtype::InvTypeDeleted:
return invtype::InvTypeDeletedSize;
case invtype::InvTypeCorpse:
return invtype::InvTypeCorpseSize;
case invtype::InvTypeBazaar:
return invtype::InvTypeBazaarSize;
case invtype::InvTypeInspect:
return invtype::InvTypeInspectSize;
case invtype::InvTypeRealEstate:
return invtype::InvTypeRealEstateSize;
case invtype::InvTypeViewMODPC:
return invtype::InvTypeViewMODPCSize;
case invtype::InvTypeViewMODBank:
return invtype::InvTypeViewMODBankSize;
case invtype::InvTypeViewMODSharedBank:
return invtype::InvTypeViewMODSharedBankSize;
case invtype::InvTypeViewMODLimbo:
return invtype::InvTypeViewMODLimboSize;
case invtype::InvTypeAltStorage:
return invtype::InvTypeAltStorageSize;
case invtype::InvTypeArchived:
return invtype::InvTypeArchivedSize;
case invtype::InvTypeMail:
return invtype::InvTypeMailSize;
case invtype::InvTypeGuildTrophyTribute:
return invtype::InvTypeGuildTrophyTributeSize;
case invtype::InvTypeKrono:
return invtype::InvTypeKronoSize;
case invtype::InvTypeOther:
return invtype::InvTypeOtherSize;
default:
return 0;
}
}
const char* RoF2::invtype::InvTypeName(int inv_type)
{
switch (inv_type) {
case invtype::InvTypeInvalid:
return "Invalid Type";
case invtype::InvTypePossessions:
return "Possessions";
case invtype::InvTypeBank:
return "Bank";
case invtype::InvTypeSharedBank:
return "Shared Bank";
case invtype::InvTypeTrade:
return "Trade";
case invtype::InvTypeWorld:
return "World";
case invtype::InvTypeLimbo:
return "Limbo";
case invtype::InvTypeTribute:
return "Tribute";
case invtype::InvTypeTrophyTribute:
return "Trophy Tribute";
case invtype::InvTypeGuildTribute:
return "Guild Tribute";
case invtype::InvTypeMerchant:
return "Merchant";
case invtype::InvTypeDeleted:
return "Deleted";
case invtype::InvTypeCorpse:
return "Corpse";
case invtype::InvTypeBazaar:
return "Bazaar";
case invtype::InvTypeInspect:
return "Inspect";
case invtype::InvTypeRealEstate:
return "Real Estate";
case invtype::InvTypeViewMODPC:
return "View MOD PC";
case invtype::InvTypeViewMODBank:
return "View MOD Bank";
case invtype::InvTypeViewMODSharedBank:
return "View MOD Shared Bank";
case invtype::InvTypeViewMODLimbo:
return "View MOD Limbo";
case invtype::InvTypeAltStorage:
return "Alt Storage";
case invtype::InvTypeArchived:
return "Archived";
case invtype::InvTypeMail:
return "Mail";
case invtype::InvTypeGuildTrophyTribute:
return "Guild Trophy Tribute";
case invtype::InvTypeKrono:
return "Krono";
case invtype::InvTypeOther:
return "Other";
default:
return "Unknown Type";
}
}
const char* RoF2::invslot::InvPossessionsSlotName(int inv_slot)
{
switch (inv_slot) {
case invslot::InvSlotInvalid:
return "Invalid Slot";
case invslot::PossessionsCharm:
return "Charm";
case invslot::PossessionsEar1:
return "Ear 1";
case invslot::PossessionsHead:
return "Head";
case invslot::PossessionsFace:
return "Face";
case invslot::PossessionsEar2:
return "Ear 2";
case invslot::PossessionsNeck:
return "Neck";
case invslot::PossessionsShoulders:
return "Shoulders";
case invslot::PossessionsArms:
return "Arms";
case invslot::PossessionsBack:
return "Back";
case invslot::PossessionsWrist1:
return "Wrist 1";
case invslot::PossessionsWrist2:
return "Wrist 2";
case invslot::PossessionsRange:
return "Range";
case invslot::PossessionsHands:
return "Hands";
case invslot::PossessionsPrimary:
return "Primary";
case invslot::PossessionsSecondary:
return "Secondary";
case invslot::PossessionsFinger1:
return "Finger 1";
case invslot::PossessionsFinger2:
return "Finger 2";
case invslot::PossessionsChest:
return "Chest";
case invslot::PossessionsLegs:
return "Legs";
case invslot::PossessionsFeet:
return "Feet";
case invslot::PossessionsWaist:
return "Waist";
case invslot::PossessionsPowerSource:
return "Power Source";
case invslot::PossessionsAmmo:
return "Ammo";
case invslot::PossessionsGeneral1:
return "General 1";
case invslot::PossessionsGeneral2:
return "General 2";
case invslot::PossessionsGeneral3:
return "General 3";
case invslot::PossessionsGeneral4:
return "General 4";
case invslot::PossessionsGeneral5:
return "General 5";
case invslot::PossessionsGeneral6:
return "General 6";
case invslot::PossessionsGeneral7:
return "General 7";
case invslot::PossessionsGeneral8:
return "General 8";
case invslot::PossessionsGeneral9:
return "General 9";
case invslot::PossessionsGeneral10:
return "General 10";
case invslot::PossessionsCursor:
return "Cursor";
default:
return "Unknown Slot";
}
}
const char* RoF2::invslot::InvSlotName(int inv_type, int inv_slot)
{
if (inv_type == invtype::InvTypePossessions)
return invslot::InvPossessionsSlotName(inv_slot);
size_t type_size = invtype::InvTypeSize(inv_type);
if (!type_size || inv_slot == invslot::InvSlotInvalid)
return "Invalid Slot";
if ((size_t)(inv_slot + 1) >= type_size)
return "Unknown Slot";
static std::string ret_str;
ret_str = StringFormat("Slot %i", (inv_slot + 1));
return ret_str.c_str();
}
const char* RoF2::invbag::InvBagIndexName(int bag_index)
{
if (bag_index == invbag::InvBagInvalid)
return "Invalid Bag";
if ((size_t)bag_index >= invbag::ItemBagSize)
return "Unknown Bag";
static std::string ret_str;
ret_str = StringFormat("Bag %i", (bag_index + 1));
return ret_str.c_str();
}
const char* RoF2::invaug::InvAugIndexName(int aug_index)
{
if (aug_index == invaug::InvAugInvalid)
return "Invalid Augment";
if ((size_t)aug_index >= invaug::ItemAugSize)
return "Unknown Augment";
static std::string ret_str;
ret_str = StringFormat("Augment %i", (aug_index + 1));
return ret_str.c_str();
}
+285
View File
@@ -0,0 +1,285 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
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
*/
#ifndef COMMON_ROF2_LIMITS_H
#define COMMON_ROF2_LIMITS_H
#include "../types.h"
#include "../client_version.h"
#include "../skills.h"
namespace RoF2
{
enum : int { Invalid = -1, Null, Safety };
enum : bool { False = false, True = true };
// pre-declarations
namespace invtype {
inline EQEmu::versions::ClientVersion InvTypeRef() { return EQEmu::versions::ClientVersion::RoF2; }
enum : int { InvTypeInvalid = -1, InvTypeBegin };
enum InventoryType : int {
InvTypePossessions = InvTypeBegin,
InvTypeBank,
InvTypeSharedBank,
InvTypeTrade,
InvTypeWorld,
InvTypeLimbo,
InvTypeTribute,
InvTypeTrophyTribute,
InvTypeGuildTribute,
InvTypeMerchant,
InvTypeDeleted,
InvTypeCorpse,
InvTypeBazaar,
InvTypeInspect,
InvTypeRealEstate,
InvTypeViewMODPC,
InvTypeViewMODBank,
InvTypeViewMODSharedBank,
InvTypeViewMODLimbo,
InvTypeAltStorage,
InvTypeArchived,
InvTypeMail,
InvTypeGuildTrophyTribute,
InvTypeKrono,
InvTypeOther,
InvTypeCount
};
} /*invtype*/
namespace invslot {
inline EQEmu::versions::ClientVersion InvSlotRef() { return EQEmu::versions::ClientVersion::RoF2; }
enum : int { InvSlotInvalid = -1, InvSlotBegin };
enum PossessionsSlot : int {
PossessionsCharm = InvSlotBegin,
PossessionsEar1,
PossessionsHead,
PossessionsFace,
PossessionsEar2,
PossessionsNeck,
PossessionsShoulders,
PossessionsArms,
PossessionsBack,
PossessionsWrist1,
PossessionsWrist2,
PossessionsRange,
PossessionsHands,
PossessionsPrimary,
PossessionsSecondary,
PossessionsFinger1,
PossessionsFinger2,
PossessionsChest,
PossessionsLegs,
PossessionsFeet,
PossessionsWaist,
PossessionsPowerSource,
PossessionsAmmo,
PossessionsGeneral1,
PossessionsGeneral2,
PossessionsGeneral3,
PossessionsGeneral4,
PossessionsGeneral5,
PossessionsGeneral6,
PossessionsGeneral7,
PossessionsGeneral8,
PossessionsGeneral9,
PossessionsGeneral10,
PossessionsCursor,
PossessionsCount
};
const int EquipmentBegin = PossessionsCharm;
const int EquipmentEnd = PossessionsAmmo;
const int EquipmentCount = (EquipmentEnd - EquipmentBegin + 1);
const int GeneralBegin = PossessionsGeneral1;
const int GeneralEnd = PossessionsGeneral10;
const int GeneralCount = (GeneralEnd - GeneralBegin + 1);
} /*invslot*/
namespace invbag {
inline EQEmu::versions::ClientVersion InvBagRef() { return EQEmu::versions::ClientVersion::RoF2; }
enum : int { InvBagInvalid = -1, InvBagBegin };
} /*invbag*/
namespace invaug {
inline EQEmu::versions::ClientVersion InvAugRef() { return EQEmu::versions::ClientVersion::RoF2; }
enum : int { InvAugInvalid = -1, InvAugBegin };
} /*invaug*/
namespace item {
inline EQEmu::versions::ClientVersion ItemRef() { return EQEmu::versions::ClientVersion::RoF2; }
//enum Unknown : int { // looks like item class..but, RoF has it too - nothing in UF-
// Unknown1 = 0,
// Unknown2 = 1,
// Unknown3 = 2,
// Unknown4 = 5 // krono?
//};
enum ItemPacketType : int {
ItemPacketMerchant = 100,
ItemPacketTradeView = 101,
ItemPacketLoot = 102,
ItemPacketTrade = 103,
ItemPacketCharInventory = 105,
ItemPacketLimbo = 106,
ItemPacketWorldContainer = 107,
ItemPacketTributeItem = 108,
ItemPacketGuildTribute = 109,
ItemPacket10 = 110,
ItemPacket11 = 111,
ItemPacket12 = 112,
ItemPacketRecovery = 113,
ItemPacket14 = 115
};
} /*item*/
namespace profile {
inline EQEmu::versions::ClientVersion ProfileRef() { return EQEmu::versions::ClientVersion::RoF2; }
} /*profile*/
namespace constants {
inline EQEmu::versions::ClientVersion ConstantsRef() { return EQEmu::versions::ClientVersion::RoF2; }
} /*constants*/
namespace behavior {
inline EQEmu::versions::ClientVersion BehaviorRef() { return EQEmu::versions::ClientVersion::RoF2; }
} /*behavior*/
namespace skills {
inline EQEmu::versions::ClientVersion SkillsRef() { return EQEmu::versions::ClientVersion::RoF2; }
} /*skills*/
// declarations
namespace invtype {
const size_t InvTypePossessionsSize = invslot::PossessionsCount;
const size_t InvTypeBankSize = 24;
const size_t InvTypeSharedBankSize = 2;
const size_t InvTypeTradeSize = 8;
const size_t InvTypeWorldSize = 10;
const size_t InvTypeLimboSize = 36;
const size_t InvTypeTributeSize = 5;
const size_t InvTypeTrophyTributeSize = 0;//unknown
const size_t InvTypeGuildTributeSize = 0;//unknown
const size_t InvTypeMerchantSize = 200;
const size_t InvTypeDeletedSize = 0;//unknown - "Recovery Tab"
const size_t InvTypeCorpseSize = InvTypePossessionsSize;
const size_t InvTypeBazaarSize = 200;
const size_t InvTypeInspectSize = invslot::EquipmentCount;
const size_t InvTypeRealEstateSize = 0;//unknown
const size_t InvTypeViewMODPCSize = InvTypePossessionsSize;
const size_t InvTypeViewMODBankSize = InvTypeBankSize;
const size_t InvTypeViewMODSharedBankSize = InvTypeSharedBankSize;
const size_t InvTypeViewMODLimboSize = InvTypeLimboSize;
const size_t InvTypeAltStorageSize = 0;//unknown - "Shroud Bank"
const size_t InvTypeArchivedSize = 0;//unknown
const size_t InvTypeMailSize = 0;//unknown
const size_t InvTypeGuildTrophyTributeSize = 0;//unknown
const size_t InvTypeKronoSize = 0;//unknown
const size_t InvTypeOtherSize = 0;//unknown
const size_t NPCTradeSize = 4;
extern size_t InvTypeSize(int inv_type);
extern const char* InvTypeName(int inv_type);
} /*invtype*/
namespace invslot {
extern const char* InvPossessionsSlotName(int inv_slot);
extern const char* InvSlotName(int inv_type, int inv_slot);
} /*invslot*/
namespace invbag {
const size_t ItemBagSize = 255; // server Size will be 255..unsure what actual client is (test)
extern const char* InvBagIndexName(int bag_index);
} /*invbag*/
namespace invaug {
const size_t ItemAugSize = 6;
extern const char* InvAugIndexName(int aug_index);
} /*invaug*/
namespace item {
} /*item*/
namespace profile {
const size_t TributeSize = invtype::InvTypeTributeSize;
const size_t BandoliersSize = 20; // number of bandolier instances
const size_t BandolierItemCount = 4; // number of equipment slots in bandolier instance
const size_t PotionBeltSize = 5;
const size_t SkillArraySize = 100;
} /*profile*/
namespace constants {
const size_t CharacterCreationLimit = 12;
const size_t SayLinkBodySize = 56;
} /*constants*/
namespace behavior {
const bool ConcatenateInvTypeLimbo = false;
const bool AllowOverLevelEquipment = true;
const bool AllowEmptyBagInBag = true;
const bool AllowClickCastFromBag = true;
const bool CoinHasWeight = false;
} /*behavior*/
namespace skills {
const size_t LastUsableSkill = EQEmu::skills::Skill2HPiercing;
} /*skills*/
}; /*RoF2*/
#endif /*COMMON_ROF2_LIMITS_H*/
+29
View File
@@ -1,11 +1,35 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
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
*/
// out-going packets that require an ENCODE translation:
// Begin RoF2 Encodes
E(OP_SendMembershipDetails)
E(OP_TraderShop)
E(OP_TraderDelItem)
// incoming packets that require a DECODE translation:
// Begin RoF2 Decodes
D(OP_TraderShop)
// End RoF2 Encodes/Decodes
// These require Encodes/Decodes for RoF, so they do for RoF2 as well
@@ -53,6 +77,7 @@ E(OP_GroupFollow)
E(OP_GroupFollow2)
E(OP_GroupInvite)
E(OP_GroupUpdate)
E(OP_GuildBank)
E(OP_GuildMemberList)
E(OP_GuildMemberUpdate)
E(OP_GuildsList)
@@ -107,6 +132,7 @@ E(OP_Trader)
E(OP_TraderBuy)
E(OP_TributeInfo)
E(OP_TributeItem)
E(OP_VetClaimReply)
E(OP_VetRewardsAvaliable)
E(OP_WearChange)
E(OP_WhoAllResponse)
@@ -119,6 +145,7 @@ E(OP_ZoneSpawns)
D(OP_AdventureMerchantSell)
D(OP_AltCurrencySell)
D(OP_AltCurrencySellSelection)
D(OP_Animation)
D(OP_ApplyPoison)
D(OP_AugmentInfo)
D(OP_AugmentItem)
@@ -146,6 +173,7 @@ D(OP_GroupFollow)
D(OP_GroupFollow2)
D(OP_GroupInvite)
D(OP_GroupInvite2)
D(OP_GuildBank)
D(OP_GuildDemote)
D(OP_GuildRemove)
D(OP_GuildStatus)
@@ -170,6 +198,7 @@ D(OP_Trader)
D(OP_TraderBuy)
D(OP_TradeSkillCombine)
D(OP_TributeItem)
D(OP_VetClaimRequest)
D(OP_WhoAllRequest)
D(OP_ZoneChange)
D(OP_ZoneEntry)

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