Compare commits

...

698 Commits

Author SHA1 Message Date
Kinglykrab 74fde3972b [Quest API] Add Adventure methods to Perl and Lua. 2021-02-12 22:31:02 -05:00
Akkadius 5e45bf262d Log line [skip ci] 2021-02-10 00:00:46 -06:00
Akkadius e4dc304b5a Update servertalk.h 2021-02-09 23:58:24 -06:00
Akkadius aff1223181 LDON tweaks, working branch, average_level pass 2021-02-09 23:57:31 -06:00
Michael Cook (mackal) 10ffcf155d [Lua/Cmake] Prefer LuaJIT over normal Lua (#1235)
* Add a separate FindLuaJit.cmake

* Remove LuaJit from our modified FindLua51.cmake

* Make use of the new FindLuaJit

The reason for splitting them up like this is so we can have a
preference for LuaJIT that's not determined by the search order in
FindLua51.cmake as well as giving the server operators the choice to
prefer normal Lua with the EQEMU_PREFER_LUA cmake option
2021-02-08 23:10:16 -06:00
TurmoilToad ed71543dff Add category tags to new client methods. (#1233)
Add category tags to new client methods.
2021-02-08 23:09:42 -06:00
TurmoilToad 0dcaea1e4e Add category tags for Object methods. (#1232)
Add category tags for Object methods.
2021-02-08 23:09:16 -06:00
TurmoilToad 52a359180c Add category tags for corpse methods (#1234)
Add category tags for corpse methods.
2021-02-08 23:08:41 -06:00
Alex 8f89f38f5c Add ScaleNPC() to Perl and Lua. (#1238) 2021-02-08 23:08:07 -06:00
Alex f2b67ae969 [Quest API] Add Mob-based data bucket methods to Perl/Lua. (#1237)
* Add Mob-based data bucket methods to Perl/Lua.

* Update mob.cpp

* Update perl_mob.cpp
2021-02-08 23:06:33 -06:00
Akkadius ef0398ebd3 Move data aliases after null checks for safety [skip ci] 2021-02-08 21:50:28 -06:00
Akkadius dcc921efcb Update repo with latest template [skip ci] 2021-02-08 21:35:43 -06:00
Akkadius eedd5e2821 [Hotfix] Remove test branch fields from repo 2021-02-08 21:34:33 -06:00
Chris Miles 96b65b848b [Repositories] Insert repository improvements (#1236)
* Insert repository improvements

* Remove no longer necessary code, remove license banner since we have a license at the repo level

* Update template comments
2021-02-08 20:56:44 -06:00
Chris Miles 694d380e66 [Door Opening] Rule to let configure Animal Door Opening (#1231)
* Add rule configuration for letting animals open doors or not

* Handle one more spot

* Make adjustments and add mob property that serves as a check as to whether a mob entity can open doors or not

* Push attribute to mob window
2021-02-07 19:52:58 -06:00
Michael Cook (mackal) 672c09ee11 Provide more search paths for luajit (#1216)
The include folder on my system is /usr/include/luajit-2.0, added some
extra library names since mine was /usr/lib64/libluajit-5.1.so
2021-02-07 18:42:55 -06:00
TurmoilToad ca9756abc9 [Quest API] Perl Client Annotations (#1224)
* Update perl_client.cpp

Added category tags for client methods.

* Update perl_client.cpp

Now with less iis!  (Thanks KK)

* Update perl_client.cpp

Now with fewer slashes!

* Update perl_client.cpp

Now with fewer tabs!
2021-02-07 18:13:04 -06:00
TurmoilToad da7b5b3560 [Quest API] Perl Raid Annotations (#1226)
Added categories tags for raid methods.
2021-02-07 18:12:09 -06:00
TurmoilToad ecc1dd9475 Update perl_questitem.cpp (#1227)
Add category tags for quest_item methods.
2021-02-07 18:11:24 -06:00
Chris Miles 8f7702095b Merge pull request #1228 from EQEmu/anon_afk_client
[Quest API] Add Anon/AFK methods to Perl and Lua.
2021-02-07 18:09:49 -06:00
Chris Miles 13303a1e14 Merge pull request #1230 from EQEmu/bug_fix/name_enforcement
[Character Validation] Enforce some naming limits people were getting around
2021-02-07 18:09:22 -06:00
Chris Miles b184a5d013 Merge pull request #1229 from EQEmu/akkadius/task-code-cleanup
[Refactor and Cleanup] Task Code
2021-02-07 18:06:44 -06:00
Akkadius 9f5ce8e3c9 PR comments 2021-02-07 17:08:16 -06:00
Michael Cook (mackal) 6621338064 Enforce some naming limits people were getting around 2021-02-07 17:00:48 -05:00
Akkadius 00902d8a7e Private member prefixes for proximities and goal lists 2021-02-07 15:44:25 -06:00
Akkadius 01f69bcc51 Update task_client_state.cpp 2021-02-07 15:22:30 -06:00
Akkadius f429df39a9 Update CMakeLists.txt 2021-02-07 15:06:46 -06:00
Akkadius 0c533071d4 Yet more cleanup 2021-02-07 15:00:16 -06:00
Kinglykrab fac9c3469f Add Anon/AFK methods to Perl and Lua. 2021-02-07 00:40:08 -05:00
Akkadius 8414973077 Typo [skip ci] 2021-02-06 21:40:42 -06:00
Akkadius 5fba138a5a Improve GM command interface UI 2021-02-06 21:14:25 -06:00
Akkadius 053bdb8646 More cleanups 2021-02-06 19:19:20 -06:00
Akkadius ff5ea82e38 Split task classes into their own cpp/h files to speed up incremental compilation and make things easier to maintain 2021-02-06 18:52:14 -06:00
Akkadius 55d4865d36 Correct one missed repository pointer 2021-02-06 18:16:39 -06:00
Akkadius b01793081a More cleanup 2021-02-06 17:38:11 -06:00
Chris Miles 18e9c4dc95 Merge pull request #1225 from EQEmu/akkadius/repository-improvements
[Repositories] Explicitly pass database pointers to repository methods
2021-02-06 14:23:54 -06:00
Akkadius ed9f155f7c More logging 2021-02-06 04:37:16 -06:00
Akkadius d83dc339fc Logging cleanups 2021-02-06 04:27:41 -06:00
Akkadius 8d7fdd6549 More cleanups 2021-02-06 04:12:11 -06:00
Akkadius 65f2f823a8 More refactors 2021-02-06 03:57:46 -06:00
Akkadius fac75a3ae0 Move ClientTaskState::RemoveTaskByTaskID to repository methods 2021-02-06 03:46:03 -06:00
Akkadius 19e9c0bc22 Move ClientTaskState::RemoveTask to repository methods 2021-02-06 03:44:36 -06:00
Akkadius 9816608bba Another pass 2021-02-06 03:42:14 -06:00
Akkadius 83b279bac3 Migrate TaskManager::LoadClientState to repository methods 2021-02-06 03:00:14 -06:00
Akkadius 32aeb6197f Refactor and move TaskManager::LoadTasks to load from repositories 2021-02-06 02:33:07 -06:00
Akkadius 11eab9c284 Move TaskManager::LoadTaskSets() loading to repositories 2021-02-06 01:37:30 -06:00
Akkadius 8d863a507b Fourth pass 2021-02-06 01:25:03 -06:00
Akkadius c194e2ac9c Fix linux compile warnings 2021-02-06 01:22:22 -06:00
Akkadius aeb0dbc6ae Third pass 2021-02-06 01:14:32 -06:00
Akkadius 4039cb12ba Second pass 2021-02-06 01:05:34 -06:00
Akkadius b7983d4c20 First pass 2021-02-06 00:45:13 -06:00
Akkadius e8ab176d4a Explicitly pass database pointers to repository methods 2021-02-05 23:00:27 -06:00
Chris Miles b7f7c66a50 Merge pull request #1223 from EQEmu/akkadius/update-repositories-expeditions
[Repositories] Add expedition repositories
2021-02-05 22:45:38 -06:00
Chris Miles 3455863099 Merge pull request #1220 from EQEmu/perl_npc_formatting
Formatting NPC validation macro.
2021-02-05 22:14:34 -06:00
Akkadius 7fe0bbacd4 Add expedition repositories 2021-02-05 18:12:05 -06:00
Michael Cook (mackal) c8dfb72cd2 Merge pull request #1222 from EQEmu/feature/op_clearaa_tit
Identify OP_ClearLeadershipAbilities/OP_ClearAA for Tit
2021-02-05 16:18:19 -05:00
Michael Cook (mackal) 42b34bbf87 Identify OP_ClearLeadershipAbilities/OP_ClearAA for Tit 2021-02-05 14:17:13 -05:00
Kinglykrab 963b8fdd53 Formatting NPC validation macro. 2021-02-02 17:06:55 -05:00
Chris Miles 0923ff040f Merge pull request #1204 from EQEmu/perl_client_macro
[Quest API] Perl Client Validation Macro
2021-02-01 23:24:54 -06:00
Chris Miles 369461f9e1 Merge pull request #1205 from EQEmu/perl_doors_macro
[Quest API] Perl Doors Validation Macro
2021-02-01 23:24:26 -06:00
Chris Miles bb2dcdcb31 Merge pull request #1206 from EQEmu/perl_entity_macro
[Quest API] Perl Entity Validation Macro
2021-02-01 23:24:09 -06:00
Chris Miles e67b3dd6d4 Merge pull request #1207 from EQEmu/perl_group_macro
[Quest API] Perl Group Validation Macro
2021-02-01 23:23:46 -06:00
Chris Miles ddfc0dda42 Merge pull request #1208 from EQEmu/perl_hate_macro
[Quest API] Perl Hate Validation Macro
2021-02-01 23:23:21 -06:00
Chris Miles f7cc51c134 Merge pull request #1209 from EQEmu/perl_mob_macro
[Quest API] Perl Mob Validation Macro
2021-02-01 23:22:52 -06:00
Chris Miles 1b27d9dc9d Merge pull request #1210 from EQEmu/perl_npc_macro
[Quest API] Perl NPC Validation Macro
2021-02-01 23:19:09 -06:00
Chris Miles 8011c4afcc Merge pull request #1211 from EQEmu/perl_object_macro
[Quest API] Perl Object Validation Macro
2021-02-01 23:18:10 -06:00
Chris Miles 69de53c459 Merge pull request #1212 from EQEmu/perl_packet_macro
[Quest API] Perl Packet Validation Macro
2021-02-01 23:17:53 -06:00
Chris Miles 82b3cccc95 Merge pull request #1213 from EQEmu/perl_corpse_macro
[Quest API] Perl Corpse Validation Macro
2021-02-01 23:17:22 -06:00
Chris Miles 91d9a4f73c Merge pull request #1214 from EQEmu/perl_item_macro
[Quest API] Perl Item Validation Macro
2021-02-01 23:17:05 -06:00
Chris Miles 93f83923ce Merge pull request #1215 from EQEmu/perl_raid_macro
[Quest API] Perl Raid Validation Macro
2021-02-01 23:16:41 -06:00
Kinglykrab 9759208ed6 [Quest API] Perl Raid Validation Macro
Add validation macro to all raid methods.
2021-02-01 22:38:19 -05:00
Kinglykrab 9d3d9a97ff [Quest API] Perl Item Validation Macro
Add validation macro to all item methods.
2021-02-01 22:36:26 -05:00
Kinglykrab a29de5963f [Quest API] Perl Corpse Validation Macro
Add validation macro to all corpse methods.
2021-02-01 22:34:47 -05:00
Kinglykrab 381b029ffc [Quest API] Perl Packet Validation Macro
Add validation macro to all packet methods.
2021-02-01 22:32:43 -05:00
Kinglykrab 772c88d020 [Quest API] Perl Object Validation Macro
Add validation macro to all object methods.
2021-02-01 22:30:34 -05:00
Kinglykrab b69213abcc [Quest API] Perl NPC Validation Macro
Add validation macro to all NPC methods.
2021-02-01 22:28:15 -05:00
Kinglykrab 4338d657fc [Quest API] Perl Mob Validation Macro
Add validation macro to all mob methods.
2021-02-01 22:24:36 -05:00
Kinglykrab 2430b38406 [Quest API] Perl Hate Validation Macro
Add validation macro to all hate methods.
2021-02-01 22:16:44 -05:00
Kinglykrab 6cfe7853f5 [Quest API] Perl Group Validation Macro
Add validation macro to all group methods.
2021-02-01 22:10:50 -05:00
Kinglykrab 64c97a5283 [Quest API] Perl Entity Validation Macro
Add validation macro to all entitylist methods.
2021-02-01 22:06:41 -05:00
Kinglykrab f32f4346e7 [Quest API] Perl Doors Validation Macro
Add validation macro to all door methods.
2021-02-01 22:02:17 -05:00
Kinglykrab dcc2dcdb8d Convert perl_client.cpp to use validation macro. 2021-02-01 21:56:47 -05:00
Chris Miles 9b8845949e Merge pull request #1203 from EQEmu/perl_inventory
[Quest API] Add Inventory methods to Perl
2021-02-01 20:16:55 -06:00
Kinglykrab 36bfebfe6a Add Inventory methods to Perl.
- Add $client->GetInventory() to Perl.
- Export Lua Inventory methods to Perl.
 - Add quest::createitem(item_id, charges, augment_one, augment_two, augment_three, augment_four, augment_five, augment_six, attuned) to Perl so you can return a ItemInstance for testing purposes.
2021-02-01 21:07:07 -05:00
Chris Miles 0c70004102 Merge pull request #1201 from splose/npcedit
[Command] Add raidtarget / respawntimer to #npcedit
2021-02-01 12:56:55 -06:00
Chris Miles 5238d30236 Merge pull request #1202 from regneq/master
RandomPath improvements
2021-02-01 12:56:06 -06:00
regneq 58e0ce6a4b fixed the references from previous commits. 2021-01-31 16:53:25 -08:00
regneq e4b437cb5f RandomPath grid type improvement
RandomPath has been changed to the following behavior:

* When stopped at a waypoint, it will now use the waypoint's pause timer if it is non-zero.  If it is zero, it will use the first waypoint's pause timer if that is non-zero.  If both are zero it will use 38 seconds.  Previously it would always use the first waypoint's pause timer if it was non-zero.  This new way is what it should have been from the start, really.

* If any waypoint is flagged as a centerpoint, then the NPCs will always return to that first randomly selected centerpoint waypoint after moving.  I.e. every other move will be to the first waypoint if the bool is set.

If any waypoint has a negative number (-1, -10, etc) in the pause timer. It will not be included in the waypoints to be random.  Instead the npc will just path through it everytime.  This is useful for a path to only select a small area to pause at before returning to it's centerpoints or another random waypoints in between it.
2021-01-31 15:11:45 -08:00
regneq 5a94e82db8 Merge pull request #7 from EQEmu/master
update
2021-01-31 14:01:54 -08:00
Alex 9713d62849 Merge pull request #1200 from hgtw/fix/empty-expedition-invite
Verify expedition is not empty on invites
2021-01-30 21:43:35 -05:00
Matthew Silvia a751339c99 add raidtarget / respawntimer to #npcedit 2021-01-30 19:43:37 -05:00
hg 62e480fed7 Verify expedition is not empty on invites
Fixes an edge case where a member could accept a pending invite into an
empty expedition before world could invalidate it
2021-01-30 18:58:39 -05:00
Chris Miles b74edd9dc2 Merge pull request #1196 from EQEmu/spell_lua_perl
Add new Spell methods to Perl and Lua.
2021-01-30 17:27:15 -06:00
Chris Miles 7eba9552e2 Merge pull request #1193 from noudess/gmmove
Use heading in GMMove and change FaceTarget not to turn boat
2021-01-30 15:29:05 -06:00
Chris Miles 396c300315 Merge pull request #1198 from EQEmu/akkadius/fix-mysqldump-buffer-allocation-edge-case
[Bugfix] Fix MySQL Dump Buffer Allocation
2021-01-29 23:51:19 -06:00
Akkadius c192590af6 Fix issue where sometimes under certain circumstances when issuing a database dump with large data over a network with extended inserts we hit a buffer threshold that kills a MySQL dump with Error 2013 2021-01-29 18:13:37 -06:00
JJ fb5fc935e7 Merge pull request #1197 from EQEmu/perl_target_ring
Fix GetTargetRingX(), GetTargetRingY(), and GetTargetRingZ() in Perl.
2021-01-28 23:34:00 -06:00
JJ 780c7a8476 Merge pull request #1195 from hgtw/feat/color-constants
Add missing chat color constants to Lua
2021-01-28 23:33:44 -06:00
JJ c72e18f082 Merge pull request #1194 from hgtw/fix/unescaped-fmt
Replace unescaped braces in format string
2021-01-28 23:33:31 -06:00
Kinglykrab a90d836bcd Fix GetTargetRingX(), GetTargetRingY(), and GetTargetRingZ() in Perl. 2021-01-28 20:29:50 -05:00
Kinglykrab c0129a6b8a Add new Spell methods to Perl and Lua. 2021-01-28 20:12:57 -05:00
hg a77d2408ac Add missing chat color constants to Lua 2021-01-28 20:10:26 -05:00
hg 6baf8412c6 Replace unescaped braces in format string
Fixes zone crash when this is logged
2021-01-28 19:42:02 -05:00
Noudess 9907984aca Use passed heading in GMMove and change FaceTarget not to turn if npc is boat. 2021-01-26 09:08:45 -05:00
Chris Miles f767a7c076 Merge pull request #1191 from EQEmu/immune_aggro
Add 4 new special attacks to Perl/Lua.
2021-01-25 19:14:28 -06:00
Chris Miles 445fcc2d40 Merge pull request #1188 from EQEmu/message_whisper
Add message(color, message) and whisper(message) to Perl/Lua.
2021-01-25 17:21:56 -06:00
Chris Miles f4ee11ac62 Merge pull request #1189 from EQEmu/popup2
Fix Popup2 Perl croak.
2021-01-25 17:21:40 -06:00
Kinglykrab d30593c35e Add 4 new special attacks to Perl/Lua.
- IMMUNE_DAMAGE_CLIENT (47)
Immune to all damage except NPC damage.

- IMMUNE_DAMAGE_NPC (48)
Immune to all damage except Client damage.

- IMMUNE_AGGRO_CLIENT (49)
Immune to aggro by a Client.

- IMMUNE_AGGRO_NPC (50)
Immune to aggro by an NPC, clients must attack directly to gain aggro, allows pet only boss mechanics and stuff.
2021-01-23 21:36:07 -05:00
Kinglykrab 102263f37d Fix Popup2 Perl croak.
Noticed the Gitbook documentation listed SendFullPopup not Popup2 due to parsing the Perl croaks in the files, causing people not to be able to find the proper way to send a full popup window.
2021-01-23 11:15:21 -05:00
Kinglykrab 19ae461e36 Add message(color, message) and whisper(message) to Perl/Lua.
- Add quest::message(color, message) to Perl.
- Add eq.message(color, message) to Lua.
- Add quest::whisper(message) to Perl.
- Add eq.whisper(message) to Lua.

These methods allow you to use implied client references. The whisper method also converts a widely used plugin in Perl to a Perl and Lua method that works on both Clients and NPCs.
2021-01-23 10:47:44 -05:00
Alex c481d52064 Add HasDisciplineLearned() to Perl/Lua. 2021-01-23 10:23:50 -05:00
Chris Miles 7c69400618 Merge pull request #1175 from EQEmu/akkadius/command-name-adjustment
[Command] Naming suggestions from https://github.com/EQEmu/Server/pull/1170
2021-01-21 18:26:35 -06:00
Chris Miles ca98ea9872 Merge pull request #1180 from noudess/boat
Allow boats flymode to be overridden by local db
2021-01-21 18:26:05 -06:00
Chris Miles 7d40e42cc2 Merge pull request #1177 from hgtw/fix/door-packets
[Bugfix] Don't respawn doors while clients are zoning
2021-01-21 18:22:53 -06:00
Chris Miles f1920f2132 Merge pull request #1178 from hgtw/fix/spawn-condition-crash
[Bugfix] Fix zone crash on spawn condition change
2021-01-21 18:22:27 -06:00
Chris Miles 30490abc50 Merge pull request #1179 from hgtw/fix/zonemap-crash
Fix zone startup crash if maps not installed
2021-01-21 18:22:04 -06:00
Chris Miles c5c0a3a73e Merge pull request #1181 from EQEmu/aa_message
Add AA gain messages.
2021-01-21 18:21:35 -06:00
Chris Miles 0551cfc013 Merge pull request #1182 from EQEmu/race_class
Add Race/Class Name and Bitmask Methods.
2021-01-21 18:19:56 -06:00
Chris Miles 1a2cec58f1 Merge pull request #1184 from EQEmu/finditem
#finditem Changes
2021-01-21 18:19:28 -06:00
Chris Miles a9b992a1b0 Merge pull request #1186 from hgtw/fix/expedition-max
Fix bug that could allow expeditions to exceed max members
2021-01-21 18:18:04 -06:00
hg d87ae839a2 Verify members in db on expedition invites
Fixes an exploit where multiple accepted cross zone invites could race
with cache updates and allow an expedition to exceed its max members
2021-01-21 19:02:00 -05:00
Kinglykrab 0f859a2a0f Preferential changes to #finditem, doesn't show stack options if item isn't stackable.
Only shows 1 or max stack size of item for summoning items. Also resolves the issues some people were having where this command would summon an item with 1 charge instead of max charges because 1 was supplied as charges. In my experience most people who summon items like this want either one item or a full stack of an item and the summon size here is relative to the current item's stack size. Also shows name first instead of ID so the formatting is better.
2021-01-19 18:34:19 -05:00
Kinglykrab 7e1e1651e4 Add GetClassBitmask(), GetClassName(), GetRaceBitmask(), and GetRaceName() to Perl/Lua. 2021-01-18 18:47:32 -05:00
Kinglykrab 1c00edb458 Add AA gain messages. 2021-01-15 19:54:44 -05:00
Noudess eb24e333d7 Allow boats flymode to be overridden by local db 2021-01-11 10:58:08 -05:00
hg 836210404c Fix zone crash on spawn condition change
The NPC pointer held by Spawn2 wasn't reset if the npc was depopped
without a respawn timer by #depop commands or depop(false) quest apis.
If the NPC was part of a spawn condition then the condition would try
to dereference that pointer (which gets deleted) on condition change.
2021-01-08 23:53:06 -05:00
hg 896dd48960 Fix zone startup crash if maps not installed 2021-01-08 20:55:56 -05:00
hg 312ee2b42c Don't respawn doors while clients are zoning
Fixes regression from b08dc02a (PR #1051)

The normal door list sent on zone entry caused unopenable double doors
on clients if an api respawned them while the client was zoning. This
waits until the client finishes zoning and has received the initial
door list before sending any despawn/respawn packets.
2021-01-07 20:05:55 -05:00
Akkadius 3fc1aea3ce Naming suggestions from https://github.com/EQEmu/Server/pull/1170 2021-01-04 11:44:23 -06:00
Chris Miles 0f5a7e1317 Merge pull request #1173 from EQEmu/akkadius/npc-guard-scan-fix
[Bugfix] Very edge case Guard awareness latency
2021-01-04 11:38:23 -06:00
Alex bebf95cfe3 Merge pull request #1170 from splose/ww
Add #wwcast command.
2021-01-03 19:19:56 -05:00
splose 02aa4302de Merge branch 'master' into ww 2021-01-03 18:58:00 -05:00
Chris Miles b7d002dd8b Merge pull request #1171 from KinglyKrab/client_fling
Add client->Fling() to Perl/Lua.
2021-01-03 17:20:04 -06:00
Chris Miles 480e3a89df Merge pull request #1172 from KinglyKrab/target_ring
Add GetTargetRingX(), GetTargetRingY(), and GetTargetRingZ() to Lua.
2021-01-03 17:19:02 -06:00
Chris Miles 427b4db2b3 Merge pull request #1166 from fryguy503/barter-bag-bug
[Bug] Barter was allowing the purchase of bags. Bags could contain…
2021-01-03 17:18:31 -06:00
Chris Miles 306328529e Merge pull request #1169 from splose/endurance
#endurance
2021-01-03 17:18:01 -06:00
Chris Miles 0396bada96 Merge pull request #1165 from fryguy503/instrument-autoequip
[Bug] Prevent Bards from auto equip loot when using instrument
2021-01-03 17:17:08 -06:00
Chris Miles e9be7146af Merge pull request #1164 from fryguy503/group-fixes
[Bug] Fix for Group Leader Disband Issue
2021-01-03 17:13:31 -06:00
Akkadius 53bbbbba1d Add comments around close mob system [skip ci] 2021-01-03 17:07:10 -06:00
Akkadius f5817677df Only add self to others when moving 2021-01-03 16:42:34 -06:00
Akkadius 7b9d88b70b Fix a situation where guards don't scan fast enough because they stand idle, moving mobs will add themselves to guards 2021-01-03 16:40:56 -06:00
Matthew Silvia 4750768e0f Merge branch 'ww' of https://github.com/splose/Server into ww
# Conflicts:
#	zone/command.cpp
2021-01-03 13:20:01 -05:00
Matthew Silvia 90295d8dec change name 2021-01-03 13:18:33 -05:00
Matthew Silvia 6fe05bbf5e change name 2021-01-03 13:16:01 -05:00
Matthew Silvia a4d8d2261a change name 2021-01-03 13:09:09 -05:00
Evan Alexander King c58ba2e6a5 Add GetTargetRingX(), GetTargetRingY(), and GetTargetRingZ() to Lua. 2021-01-03 03:21:54 -05:00
Evan Alexander King 3fa236c2bb Add client->Fling() to Perl/Lua.
- $client->Fling(value, target_x, target_y, target_z, ignore_los, clipping) in Perl.
- client:Fling(value, target_x, target_y, target_z, ignore_los, clipping) in Lua.
2021-01-03 03:12:01 -05:00
Matthew Silvia e13346560e #ww 2021-01-02 23:24:28 -05:00
Matthew Silvia d6e29810f1 #endurance 2021-01-02 23:17:47 -05:00
Trust 29e693d443 Also added LogGroupDetail 2021-01-02 22:57:57 -05:00
Trust 7fbf522aa3 Added LogGroup to logging aliases. 2021-01-02 22:54:26 -05:00
Chris Miles 0456bef903 Merge pull request #1167 from hgtw/fix/instance-corpses
Move player corpses on instance shutdown
2021-01-02 21:31:28 -06:00
hg 6c8c81f3db Move player corpses on instance shutdown
Moves corpses to graveyard when an expired instance shuts down.
Zones without a graveyard move them to non-instance version instead.

Fixes player corpses being left inside instances that expire
before graveyards process or in instances without a graveyard
2021-01-02 19:42:18 -05:00
Trust 538092d59e Fix for incorrect slot definition. 2020-12-31 11:33:04 -05:00
Trust 789cfb2490 [REBASE] Barter was allowing the purchase of bags. Bags could contain anything and it would be traded. 2020-12-31 00:44:55 -05:00
Trust 83928fa4d0 [REBASE] Prevent Bards from auto equip loot when using instrument 2020-12-31 00:22:54 -05:00
Trust f854137ca0 [BUG] Fix for Group Leader Disband Issue
Added public/private class for oldleadername so we can save the previous leader name when the entity is destroyed then allow us to transfer leadership.

Adjusted DelmemberOOZ and in zone functions to include removal of the old leader when disbanding.
2020-12-31 00:16:27 -05:00
Chris Miles de5b7f472d Merge pull request #1163 from hgtw/feat/dz-expeditions
[Expedition / DZ] HGTW DZ / Expedition System
2020-12-30 21:16:22 -06:00
hg 33e5bd0b67 Assign db version to expedition schema 2020-12-30 18:47:59 -05:00
hg a312cd6e1d Don't sync character lockout uuid
Fixes regression that caused loot event apis to stop working
2020-12-30 18:47:33 -05:00
hg 8b2b2db848 Move offline players to dz safereturn
This is an experimental change which allows members to log in at the
safe return if they were offline when the expedition was deleted.
Prior to this they would log in at bind instead

Partially reverts commit 32c69d235d
Removed expedition members are no longer hard deleted from db
2020-12-30 18:47:33 -05:00
hg 4f9eaf7574 Sync character lockouts when entering dz
This removes the is_pending column from character lockouts table

Synchronizing character lockout timers with the expedition's when zoning
into the dynamic zone simplifies adding missing lockouts to new members.
This also matches live behavior that replaces any character lockout
timers from another expedition with ones from the current expedition
2020-12-30 18:47:32 -05:00
hg fc7d8a82e5 Sort #dz list output by dz id
Sort #dz expedition list by expedition id
2020-12-30 18:47:32 -05:00
hg 81e4bd6040 Reduce expedition member status packet updates
Only send update for expedition member status if it changes

Avoids unnecessary packets when members zone
2020-12-30 18:47:32 -05:00
hg 54a175b3ef Cleanup unused arg in remove lockout method 2020-12-30 18:47:32 -05:00
hg 738fd48163 Use id not name in dz makeleader world msg 2020-12-30 18:47:32 -05:00
hg e5916c5c03 Add rule to enable "In Dynamic Zone" status
Live doesn't appear to ever update with this status
2020-12-30 18:47:32 -05:00
hg 1de590137f Verify new expedition leader in world
Cleanup makeleader methods

World now checks if character is expedition member instead of zone
2020-12-30 18:47:32 -05:00
hg 311042f06d Add ExpeditionMember::IsValid method 2020-12-30 18:47:32 -05:00
hg 6acfc41778 Let world handle expedition leader changes
This should eliminate race conditions caused by zones trying to set
a leader when members in different zones quit at the same time

Zone still detects when leader goes offline to trigger a change
since it's easier than having world process expedition member status
updates and perform expedition lookups
2020-12-30 18:47:32 -05:00
hg 955cbeb826 Revert "Don't set member offline before linkdead"
This reverts commit 8d27602aa0.

This doesn't work because a linkdead leader coming back online will
toggle to offline state anyway
2020-12-30 18:47:32 -05:00
hg 6e9f920931 Add saylinks to #dz list output 2020-12-30 18:47:32 -05:00
hg 4ae9904822 Use strlen for perl hash key size 2020-12-30 18:47:32 -05:00
hg c0b8bfde03 Fix invalid return in perl expedition api
This was returning an invalid (garbage) hash reference for
empty results when filtering on expedition name
2020-12-30 18:47:32 -05:00
hg c09ada67d6 Add expedition lock message constants to perl 2020-12-30 18:47:32 -05:00
hg cc5dd4cd82 Add missing expedition perl api declaration 2020-12-30 18:47:32 -05:00
hg 8708564889 Don't send info packet when new member added
It isn't necessary to send this packet to current members when a new
expedition member is added. The member list packet changes the current
player count on the window
2020-12-30 18:47:32 -05:00
hg f506ce9d58 Reduce packet updates when expedition member added
This fixes unnecessary packets and compass updates being sent for
invited members and better matches live's packet update pattern

This also fixes duplicate updates being sent to the added member

Live only sends a MemberListName update for members added through a
swap (player count doesn't change). For members added through an
invite it sends expedition info and a full member list update

A full member list update is sent for both cases in this patch. This
is because MemberListName currently always adds members with status
"unknown". This is either due to unknown packet fields or a change
in future clients
2020-12-30 18:47:32 -05:00
hg 074b7096df Use fmt join for simple query strings 2020-12-30 18:47:32 -05:00
hg b46eca4ec6 Store expeditions with dz id not instance id
This exposes dynamic zone ids for any future changes and will make it
easier to preserve historic dz and expedition data. This also cleans up
some dynamic zone creation for expedition requests

When purging instances the expedition table is no longer updated
since dynamic zone ids are not re-used like instance ids are

Update #dz list commands to show dz id

Add GetDynamicZoneID and get_expedition_by_dz_id quest apis
2020-12-30 18:47:32 -05:00
hg 54500b0e72 Use column aliases for expedition request query 2020-12-30 18:47:31 -05:00
hg d2ad2ec078 Add comment to FormatName 2020-12-30 18:47:31 -05:00
hg b85feb5461 Rename expedition packet fields 2020-12-30 18:47:31 -05:00
hg 022f82291a Rename world expedition cache to state 2020-12-30 18:47:31 -05:00
hg 579c300cbc Rename expeditions table 2020-12-30 18:47:31 -05:00
hg 0f051b68ae Separate world expedition source files 2020-12-30 18:47:31 -05:00
hg 58b3708a47 Use named args in CreateExpedition lua api
This is a breaking api change

All expedition request parameters are now passed via a single table
containing hash keyed options to define values
2020-12-30 18:47:31 -05:00
hg b68994f25c Change all expedition tables to latin1
The lockout tables are latin1 to support older MySQL and MariaDB
versions that limit indexes
2020-12-30 18:47:31 -05:00
hg ad51de052c Cleanup expedition perl api croak messages 2020-12-30 18:47:31 -05:00
hg 77406d7322 Add AddReplayLockoutDuration api 2020-12-30 18:47:31 -05:00
hg 3ed7215a92 Rename character expedition lockouts table 2020-12-30 18:47:31 -05:00
hg 3a1eb51890 Send lockout times with client rounding offset
Add 60s to lockout times sent to clients. Lockout timers
are rounded down to the nearest minute when displayed

This replaces the lockout leeway rule with better behavior
2020-12-30 18:47:31 -05:00
hg ca113cdd85 Let world dispatch expedition expire warnings
This depends on C++14 remaining enabled for chrono literals
2020-12-30 18:47:31 -05:00
hg da5d4b9830 Send all members expedition expire warnings
All expedition members are notified not just those in dz

This will only work if the dz is running. It might make more sense to
move this to client or world processing so members are notified even if
the zone instance isn't running
2020-12-30 18:47:31 -05:00
hg 79287fc507 Require zone id to get expedition by instance id
This is a breaking api change
eq.get_expedition_by_instance_id(instance_id) is replaced with
eq.get_expedition_by_zone_instance(zone_id, instance_id)

This replaces the FindCachedExpeditionByInstanceID method of
obtaining expeditions via instance id with a new method that
requires the dz zone id as well
2020-12-30 18:47:31 -05:00
hg cd98b8bc6f Only send member updates after caching dz data
This fixes characters not receiving a compass if they're already
in the compass zone when an expedition is created from another zone
2020-12-30 18:47:31 -05:00
hg 18dd9e6637 Add #dz expedition unlock command
Add expedition name and zone to #dz expedition list

Adjust #dz list output
2020-12-30 18:47:31 -05:00
hg 6266aa86a4 Add perl expedition api 2020-12-30 18:47:31 -05:00
hg c26c6af356 Remove rule to verify expedition leader with db
This is a holdover from earlier system design and shouldn't be necessary
2020-12-30 18:47:11 -05:00
hg a3a6e55d22 Add lockout timer multiplier rule
This allows servers to adjust all new lockout durations added
during special events like live does
2020-12-30 18:47:11 -05:00
hg b965a165b1 Add api to update expedition expire time
Add SetSecondsRemaining method to set expire time on expedition
2020-12-30 18:47:11 -05:00
hg 2c2c2ac5ee Add api to get expedition's zone name 2020-12-30 18:47:11 -05:00
hg cbccd72050 Truncate members after conflict checks
This more accurately matches live for the new behavior introduced
in the September 16, 2020 patch. All members of a raid/group are
still checked for conflicts and the truncation is only allowed if
there are none.

It might make sense to add a rule for this since ignoring members
that would exceed the expedition max from the start makes it more
convenient to create expeditions. Members that wouldn't be added
anyway don't really need their conflicts checked.
2020-12-30 18:47:11 -05:00
hg 3db23e402c Add api to add lockout to all clients in zone 2020-12-30 18:47:11 -05:00
hg c45840173e Load dz from cache on client switchlist reply 2020-12-30 18:47:11 -05:00
hg 76b5803f83 Let MovePCDynamicZone filter on zone version
Add client GetDynamicZones method to provide a single method to get all
associated client dynamic zones

Refactor compass update and MovePCDynamicZone to use this method
instead of searching for client dzs separately

Add optional disable message arg to MovePCDynamicZone
2020-12-30 18:47:11 -05:00
hg b377fd183a Add api to add lockout duration
Also supports reducing lockout duration

Add Expedition::AddLockoutDuration

Add Client::AddExpeditionLockoutDuration

Some expeditions require adding to existing lockout durations
during progression. These add the specified seconds to individual
member lockout timers instead of setting a static duration based on
internal expedition lockout like UpdateLockoutDuration.
2020-12-30 18:47:11 -05:00
hg 8e52dd0579 Add expedition lock messages 2020-12-30 18:47:11 -05:00
hg b5db40cba6 Add GetZoneVersion to expedition api 2020-12-30 18:47:11 -05:00
hg ea34aa2030 Add group and raid api to check for lockout
Add Group and Raid method DoesAnyMemberHaveExpeditionLockout

This is required by some expeditions that perform a manual check for
custom dialogue (Ikkinz group expeditions)
2020-12-30 18:47:11 -05:00
hg 40717970ff Cleanup some expedition message formatting 2020-12-30 18:47:10 -05:00
hg 1d24432e47 Truncate expedition members to max on creation
This implements the new behavior from live's September 16, 2020
(test server's September 8, 2020) patch

Expeditions can be created even when the client's group or raid
exceeds the expedition's max player requirement. Members are added
until the max player count is reached and the rest are ignored.

Raid members are added ordered by their raid group number with
ungrouped members having the lowest priority

Rename expedition request method ValidateMembers to CanMembersJoin

Change some expedition messages to System color (live changes)
2020-12-30 18:47:10 -05:00
hg a597753bee Increase default early dz shutdown time
Increases default from 15 minutes to 25 minutes

This compensates for current default graveyard timer code. Otherwise
instances may shutdown before graveyards can process any corpses.

A better fix needs implemented later to deal with corpses inside
expired dynamic zone/instances. Zones without graveyards should move
corpses to the non-instance version and zones with graveyards should
somehow still be processed (maybe offloaded to world?)
2020-12-30 18:47:10 -05:00
hg 4d1abce084 Allow zone name in alt CreateExpedition api 2020-12-30 18:47:10 -05:00
hg f822798c63 Cleanup some vector emplacements in expeditions 2020-12-30 18:47:10 -05:00
hg 0c5bd9b338 Escape expedition and event names in queries
Fixes names that have apostrophes
2020-12-30 18:47:10 -05:00
hg 779fc6265e Load character lockouts without looping 2020-12-30 18:47:10 -05:00
hg d6ab87e2c4 Avoid world message on offline member invite
Expedition member status can be used to choose the message
2020-12-30 18:47:10 -05:00
hg 6e5ca19d18 Get dz safe return from cache not db
This was loading the dz from database to get safe return data every time
a client's dz removal timer triggered

Add the Zone::GetDynamicZone() method so zones that are dz instances can
find the data from the cache of any dz systems
2020-12-30 18:47:10 -05:00
hg fba078bbe9 Format name in expedition invite message
Live uses the original unformatted user input in invite messages, but
this doesn't seem necessary to emulate
2020-12-30 18:47:10 -05:00
hg ce19deb5d1 Add rule to always notify new expedition leader
On live, new expedition leaders are only notified if made leader from
the /dzmakeleader command (or from ui). This rule makes it so the new
leader is always messaged on a leader change for cases where previous
leader goes offline or quits
2020-12-30 18:47:10 -05:00
hg 1f3c5af996 Add #dz makeleader command 2020-12-30 18:47:10 -05:00
hg 9c4df6f026 Don't set member offline before linkdead
This prevents toggling to offline state before setting to and from
linkdead status. Without this change, a new expedition leader will be
chosen as soon as the current leader goes linkdead. On live an
expedition leader retains leadership while linkdead
2020-12-30 18:47:10 -05:00
hg d8b825f478 Fix linkdead expedition member offline update
This was leaving expedition members with linkdead status even after
the client was timed out by the server
2020-12-30 18:47:10 -05:00
hg ba9ce2335e Set new expedition leader on leader disconnect
Only choose an online member as new leader on leader changes

Keep leader online status updated in zone expedition caches

Currently this will also trigger a leader change if the leader goes
linkdead. On live the character retains leadership while linkdead
and a new one is only chosen once kicked offline
2020-12-30 18:47:10 -05:00
hg 15235d77f7 Fix regression deleting expedition from db
Set expedition's instance id NULL instead of deleting it from the
database when instances are deleted. Only expedition functions
should delete expeditions

This fixes a regression caused by removing foreign key constraints

The expedition_details row was being deleted and not the corresponding
expedition_members and expedition_lockouts rows. Any characters inside
the members table could no longer join expeditions
2020-12-30 18:47:10 -05:00
hg cb4a117503 Cleanup some expedition logging and formatting
Remove logging unsanitized input

Make unsigned comparison not compare < 0

Cleanup some FormatName and string usage. Some of these strings could
probably be moved instead

Remove unnecessary expedition lookup in a world message handler
2020-12-30 18:47:10 -05:00
hg d61879fd3c Add character id based expedition apis
Add static expedition methods to add or remove character lockouts

Add CreateLockout static helper to ExpeditionLockoutTimer

Refactor existing character lockout removal to allow removal of lockouts
for offline characters (was only used by #dz lockouts remove command)

Fix #dz list member count
2020-12-30 18:47:10 -05:00
hg 3e373210c5 Remove dz check in expedition invite reply
Characters can no longer be re-invited while inside a dz, these checks
aren't necessary
2020-12-30 18:47:10 -05:00
hg 5a826add92 Cleanup expedition headers and unused variables
Modify some expedition and dz logging

Remove unnecessary includes in expedition sources
2020-12-30 18:47:10 -05:00
hg 3843ed6540 Don't log expired lockouts in expedition request
Removes logging of lockouts with timer under leeway rule
2020-12-30 18:47:09 -05:00
hg 184ea679f2 Refactor client cross zone message helpers
Remove extra cross zone message server opcode and struct. Existing
function already exists for normal messages

Group CZClientMessageString struct with other CZ structs
2020-12-30 18:47:09 -05:00
hg e99528fe73 Change lockout packet variable to signed 2020-12-30 18:47:09 -05:00
hg 70161aecc4 Remove fk constraints in expedition tables
Add expedition tables to database schema lists
2020-12-30 18:47:09 -05:00
hg e8d250827d Add api to update lockout duration
Some live expeditions update a lockout's duration during progression

The current AddLockout method replaces lockout timers. This updates the
expiration of an existing lockout by modifying the original duration

Only members are updated and not the internal expedition timer by
default. This is so new members receive the original duration like live
2020-12-30 18:47:09 -05:00
hg f97cc7cdec Add expedition event loot api
Add SetLootEventByNPCTypeID and SetLootEventBySpawnID quest apis

These associate events with npcs or entities inside the dz to prevent
them from being looted by characters that didn't receive the event
lockout from the current expedition.

This fixes an exploit that allowed a player that already had a lockout
from another expedition being added to loot after the event is complete
2020-12-30 18:47:09 -05:00
hg 06d84b83de Remove member history from expeditions
Expedition uuids are now used to check if characters may re-join
2020-12-30 18:47:09 -05:00
hg da2a6205ed Use replay timer uuid to allow re-invite
Instead of allowing all previous members to bypass a replay timer
conflict, only allow if expedition uuid of the lockout matches

This fixes an exploit for expeditions that add delayed replay timers.
Members could be part of an expedition on creation and then quit to form
another expedition. They could then always be re-invited to the original
expedition even with a conflicting replay timer lockout.
2020-12-30 18:47:09 -05:00
hg fa21d835d9 Store lockouts with source expedition uuid
Add Client::GetLockoutExpeditionUUID quest api

Refactor lockout update methods to take ExpeditionLockoutTimer parameter

Fix updating expedition lockout cache for multiple AddLockout calls

Fix updating lockout duration when replacing a lockout in database

Replace lockout timer inherited flags with expedition uuid comparisons

Remove is_inherited column from expedition_lockouts table
2020-12-30 18:47:09 -05:00
hg 6a7980ec75 Assign expeditions a uuid 2020-12-30 18:47:09 -05:00
hg f23ca8055f Remove replay timer argument to CreateExpedition
Breaking change to the current API

has_replay_timer column removed from expedition_details table

This argument is unnecessary and just creates confusion. Expedition
replay timers use a hardcoded name precisely for this purpose and
those lockouts are already being checked on creation requests.
2020-12-30 18:47:09 -05:00
hg 892556e26d Fix replay timer assignment to new members
Ignore expired state of replay timers when assigning to new members

This fixes a regression from a previous change that stopped assigning
expired lockouts to new members. Only expired event timers should be
ignored for new members. Replay Timers should always be added with a
a fresh lockout
2020-12-30 18:47:09 -05:00
hg 75410e8886 Don't allow expedition re-invite inside dz
Live requires characters that quit an expedition to zone out before
being re-added. This is probably to avoid exploiting max player
requirements by constantly swapping players in and out
2020-12-30 18:47:09 -05:00
hg 4af5f79328 Remove logging of expedition query failures
This is redundant with sql error logging. Logging the operations is
enough to determine the source of any errors
2020-12-30 18:47:09 -05:00
hg ea0b37b7fc Store expedition duration and times as chrono
This simplifies comparisons and reduces conversions
2020-12-30 18:47:09 -05:00
hg 006f7bf9e9 Don't remove expedition lockouts from non-members
Clients still inside a dz after being removed from an expedition
should only ever have lockouts added
2020-12-30 18:47:09 -05:00
hg 17be2bf2f7 Clear stale pending expedition lockouts
Delete pending lockouts of members on expedition creation

Delete pending lockouts when all members removed from expedition

This fixes an edge case where members could incorrectly be assigned
pending lockouts that were never cleared from the database (from a
server crash or other situation) after entering another dz.
2020-12-30 18:47:09 -05:00
hg 6165550133 Copy instead of moving expedition request data 2020-12-30 18:47:09 -05:00
hg 59d10a9db3 Process character lockout results in db methods 2020-12-30 18:47:09 -05:00
hg f287e9318e Refactor member validation in expedition requests
Small cleanup of logic and unused variables

Rename LoadValidationData to LoadMembersForCreateRequest

Remove unnecessary early string building for members query

Remove unnecessary lockout expired check for leader messages
2020-12-30 18:47:09 -05:00
hg 402491b36b Refactor expedition member online status requests
This optimizes character status requests by only sending a single
bulk request to world for characters in all expeditions instead of
sending a separate request for each expedition on zone startup
2020-12-30 18:47:09 -05:00
hg 2c4f505309 Refactor zone expedition caching
This optimizes caching all expeditions by loading dynamic zone data and
expedition members in bulk instead of for each expedition separately.
This reduces the number of queries from 1+2n to 3 total.

Expedition members are now joined in the initial query since empty
expeditions aren't cached anyway. Optional internal lockouts for all
cached expeditions are loaded in a single bulk query afterwards.

Dynamic Zone data is also loaded as a single bulk query afterwards to
simplify processing and keep dz database logic separated. It might be
worth investigating if joining dz data in the initial expeditions load
query is worth refactoring for.
2020-12-30 18:47:08 -05:00
hg f9eafa52f9 Ignore expired lockouts on expedition invite
This fixes an edge case with client invites sometimes failing because
an expired lockout hasn't been removed from client yet

Clients no longer receive expired lockouts from expeditions when joining
2020-12-30 18:47:08 -05:00
hg 4284624096 Remove expedition includes from client header
Make quest compass a vec3 to remove include dependency

Quest compass location doesn't require a zone id since it can only be
set in the zone that it's drawn in. Drop the DynamicZoneLocation member
and forward declare to remove the dependency on header.

Move ExpeditionInvite struct to zone common header

Including expedition.h in client.h just to use the ExpeditionInvite struct
is an unnecessary header dependency that increases incremental build time.
This allows expedition classes to be forward declared in client header.
2020-12-30 18:47:08 -05:00
hg 9b82cf57e4 Add #dz lockouts remove by event name 2020-12-30 18:47:08 -05:00
hg 9164073d14 Let world shutdown dz early for empty expeditions
Since world now tracks empty expeditions it can determine when to
shutdown dynamic zone instances when the rule is enabled rather than
letting zones do it.
2020-12-30 18:47:08 -05:00
hg 148af3edfc Only delete empty expeditions when the dz is empty
Zones are no longer able to delete expeditions. World now tracks empty
expeditions in cache and only deletes them when it detects an
expedition's dynamic zone instance has no more clients inside.

This fixes an exploit where lockouts couldn't be applied to expeditions
after all members were removed because zones were deleting the expedition
immediately. Clients still inside the dz were able to complete events
before being kicked from the instance while not having an expedition.

Expeditions are no longer purged from database in the world purge
instance timer to avoid a possible race with this new system
2020-12-30 18:47:08 -05:00
hg dcbcc5a156 Implement world cache to monitor expeditions
This implements a small cache in world to track expedition states.

This fixes expired expeditions being left in zone caches unless the
expedition's dz instance was running to detect it (or unless an
expedition was deleted via a client using /kickplayers). This was also
leaving clients in a ghost expedition that no longer actually existed
2020-12-30 18:47:08 -05:00
hg 33f2336244 Only draw dynamic zone compasses in non-instances
This fixes compasses being drawn in instances that use the same zone as compass

Also adds RemoveCompass method to quest api
2020-12-30 18:47:08 -05:00
hg 3f4ea66ea1 Implement expedition locking
Disables the ability to add new members

Adds Expedition::SetLocked(bool) to quest api

Adds is_locked column to expedition_details db table
2020-12-30 18:47:08 -05:00
hg 5ddb62e275 Make adding replay timers to new members optional
Not all expeditions with a replay timer lockout add it to newly
added members automatically

This adds the Expedition::SetReplayLockoutOnMemberJoin(bool) method
to the quest api so it can be disabled
2020-12-30 18:47:08 -05:00
hg a7795eda5d Change expedition tables to latin1_swedish_ci
Fixes insertion in MySQL older than 5.7.7 and MariaDB older than 10.2.2
that limit indexes to 767 bytes. This may be a temporary fix until
future refactoring
2020-12-30 18:47:08 -05:00
hg aee3e1084c Fix missing invite failure messages 2020-12-30 18:47:08 -05:00
hg 39fad0c1a0 Remove unused ExpeditionMemberStatus Lua constants 2020-12-30 18:47:08 -05:00
hg 32cc2d66dd Use stl algorithms for expedition member searches 2020-12-30 18:47:08 -05:00
hg 780cf148fa Use built-in benchmarking for expedition caching 2020-12-30 18:47:08 -05:00
hg 8c1f556f29 Rename #dz cache to #dz expedition
Add expedition's remaining dz time to expedition list

Move #dz destroy to a #dz expedition subcommand

Add success or failure messages to destroy command
2020-12-30 18:47:08 -05:00
hg c9504452e1 Add #dzkickplayers command for pre-RoF clients
Performs "/kickplayers exp" for older clients without the command
2020-12-30 18:47:07 -05:00
hg 528b74109e Only update dz expire time if reducing
Add optional UpdateExpireTime parameter

This is currently only used when an expedition becomes empty to make
dynamic zone instances shutdown earlier. For that it should only update
if new time is less than remaining time
2020-12-30 18:47:07 -05:00
hg 89c6d1e258 Send expedition re-invite to clients that zone
Moves expedition message handling in world to Expedition method
for messages that need special handling
2020-12-30 18:47:07 -05:00
hg 50f9a49911 Check for empty expedition via database not cache
Checking the cache on member removal here isn't reliable due to race
with cross zone message

If a zone removes a member at the same time as another zone, neither zone
can know if the expedition will be empty via cache unless it processes the
world message from the other zone's member removal first.
2020-12-30 18:47:07 -05:00
hg cc0c5afd00 Add alternative CreateExpedition api
This allows expedition creation to be passed via Lua tables

This also allows for compass, safereturn, and/or zone in location data
of dynamic zones to be set on expedition creation from lua api

Usage example:
  local instance_info = {
    "anguish", 0, 21600,
    compass = { 300, 1353.15, 1712.19, 109.001 },
    safereturn = { 300, 1349.13, 1715.00, 123.81, 0 },
    zonein = { -9, -2466, -79, 0 }
  }
  local expedition_info = { "Anguish, the Fallen Palace", 6, 54, true }
  local dz = e.other:CreateExpedition(instance_info, expedition_info)
2020-12-30 18:47:07 -05:00
hg a1b5b210dd Send client lockout update in lockout methods
Add optional client update argument to client lockout methods

This is better than requiring callers to manually send the update
2020-12-30 18:47:07 -05:00
hg d92c0e330d Validate expedition invite response server side
Stores expedition invite data on client
2020-12-30 18:47:07 -05:00
hg 43963783db Add instance time remaining to #dz list output 2020-12-30 18:47:07 -05:00
hg 11181190ee Add expired lockouts leeway rule
Adds a rule for leeway with expired lockouts during creation requests

The client removes lockout timers with under 60s remaining from the
window. This allows a small leeway to compensate so players don't
request an expedition that has visually hidden lockouts.
2020-12-30 18:47:07 -05:00
hg af766dd323 Move LoadAllClientLockouts back to a client method 2020-12-30 18:47:07 -05:00
hg 158dad052c Clear client expedition info if removed inside dz
Clears client expedition info immediately if removed inside dynamic zone

Live clears expedition info from clients removed inside a dz on the same
timer used for removals, even if the client zones before it triggers.
This is problematic to mimic and not worth the effort
2020-12-30 18:47:07 -05:00
hg a9c65cd4b2 Filter out expired instances from #dz list
Add 'all' argument to #dz list to optionally show expired instances
2020-12-30 18:47:07 -05:00
hg ef77b28b3f Add #dz lockouts remove command
This allows clearing a character's lockouts

Adds client RemoveAllExpeditionLockouts methods and exposes to lua api
2020-12-30 18:47:07 -05:00
hg b116730885 Fix wrong group leader name in expedition requests
Get group leader name from Client if possible and ask database otherwise

Group::GetLeaderName() is unreliable and broken for groups formed across
zones. The correct leader name is needed here to avoid any possible
exploits with an invalid leader bypassing lockout checks.
2020-12-30 18:47:07 -05:00
hg 78eb3be127 Add option to disable expedition conflict messages
Add optional argument to CreateExpedition to disable conflict messages

Some live expeditions like anguish use a timeout to prevent excessive
leader conflict messages while still performing a creation request
2020-12-30 18:47:07 -05:00
hg 1819b7c23b Cache new expedition before sending client updates
Compass updates get data from the expedition cache so it needs to be
cached first.

Currently this doesn't affect anything because compass isn't sent to
CreateExpedition and has to be set post-creation. In the future this
will make the order of client messages more live accurate though
2020-12-30 18:47:07 -05:00
hg eccc79e4ce Let dz handle client removal timers
Remove all clients inside a dz, not just those assigned to instance
2020-12-30 18:47:07 -05:00
hg 9102bb1478 Assign lockouts to all clients inside dz
This is live like and prevents possible exploiting by dropping
expedition before a lockout. Clients will continue receiving lockouts
until they leave the zone or are kicked via timer
2020-12-30 18:47:07 -05:00
hg 8eef2ae089 Add DynamicZone class for expedition instancing
Add DynamicZone sql table schema

Add DynamicZones logging category

Modify CreateExpedition to take DynamicZone and ExpeditionRequest objects

Implement DynamicZone compass, safereturn, and zone-in coordinates.

Implement live-like DynamicZone instance kick timer for removed members

Implement updating multiple client compasses (supports existing quest compass)

fix: Send client compass update after entering zones to clear existing compass

Implement Client::MovePCDynamicZone to invoke DynamicZoneSwitchListWnd
when entering a zone where client has multiple dynamic zones assigned

Implement OP_DzChooseZoneReply handling

Add Lua api methods for expedition's associated dynamic zone

Add #dz list gm command to list current DynamicZone instances from database
2020-12-30 18:47:07 -05:00
hg f74605d339 Implement Lua quest api for expeditions 2020-12-30 18:47:06 -05:00
hg 7798504641 Add expeditions sql schema file 2020-12-30 18:47:06 -05:00
hg da067be2fa Implement initial expedition system
Add Expeditions logging category

Add handlers for all Dynamic Zone/Expedition related opcodes

Add FormatName string_util function to format character names

Add Zone::IsZone helper method

Add cross zone MessageString support with variable parameters

Add static Client method helpers for cross zone messaging

Add #dz gm command to debug expedition cache for current zone
2020-12-30 18:47:06 -05:00
hg a77f8b582e Update opcodes and packet structs for expeditions
Add and rename some opcodes

Add packet translations for expeditions

Fix OP_DzExpeditionEndsWarning opcode for RoF2

Add RoF2 OP_KickPlayers
2020-12-30 18:47:06 -05:00
Alex 51a74c23ef quest::getspellname() and quest::getclassname() fixes/additions. (#1158)
- Update GetSpellName() to uint16.
- Add more classes to GetClassIDName().
2020-12-30 14:47:27 -06:00
Alex c593ed6a05 Add SetRadiantCrystals() and SetEbonCrystals() to Perl/Lua. (#1159)
- Add $client->SetRadiantCrystals(value) to Perl.
- Add $client->SetEbonCrystals(value) to Perl.
- Add client:SetRadiantCrystals(value) to Lua.
- Add client:SetEbonCrystals(value) to Lua.

Co-authored-by: Chris Miles <akkadius1@gmail.com>
2020-12-30 14:46:09 -06:00
Chris Miles c1d7a82307 [DevTools] Improve DevTools Toggling Options (#1161)
* Improve devtools toggling

* Cleanup a few more references
2020-12-30 14:43:33 -06:00
Alex a920d449ff Add removeitem(item_id, quantity) to Perl/Lua. (#1156)
- Perl: quest::removeitem(item_id, quantity);
- Lua: eq.remove_item(item_id, quantity);
2020-12-29 18:21:47 -06:00
Paul Coene 21a1a7bed7 Client tracks pet sit/stand - force new pets to stand rather than use client (#1155)
Co-authored-by: Noudess <noudess@gmail.com>
2020-12-22 18:05:02 -06:00
Paul Coene 8a0f242fc6 Added RACE_BOAT_533 to IsBoat() (#1154)
Co-authored-by: Noudess <noudess@gmail.com>
2020-12-22 14:45:17 -06:00
Michael Cook (mackal) 4ec9ccae98 Merge pull request #1153 from thalix1337/master
Fix for Feature/underworld, typo in SQL
2020-12-22 12:56:09 -05:00
thalix1337 cc344ac98a Fix for Feature/underworld, typo in SQL 2020-12-22 18:06:26 +01:00
Michael Cook (mackal) 69a8507908 Feature/underworld (#1146)
* Update NewZone_Structs

* Update packet translators for NewZone_Struct

* Add OP_UnderWorld OPcodes

These aren't implemented yet, but I thought it would be good to document
them. This sends up just entity ID and location when you fall
underworld. This could possibly be used to check for someone screwing
with zone data locally to warp or something I guess.

* Add database fields
2020-12-21 17:08:04 -06:00
Thalic f87662f676 Minor ortographic corrections of ruletypes.h (#1147)
* Update ruletypes.h

* Update ruletypes.h
2020-12-21 17:07:45 -06:00
Paul Coene 1eb5e4a0c1 Remove the extra erroneous message (DoT landing message) at mob death if mob dies of DoT. (#1138)
* Removed the erroneous message of a DoT "landing" when a mob dies from that DoT

* Set spell=-1 on Death struct for NPCs.  It was causing extra DoT msg.

* Remove whitespace

Co-authored-by: Noudess <noudess@gmail.com>
2020-12-21 17:07:15 -06:00
neckkola a1cc68d214 Added new Perl/LUA GetSpellIDByBookSlot (#1151)
Added a new questAPI GetSpellIDByBookSlot to allow for sorting spellbooks by various attributes (level, type, etc).  Allows to determine which spell is in what book slot.
2020-12-21 17:06:48 -06:00
Alex c6d4d8f291 Merge pull request #1148 from noudess/waterroam
Destination check needed to be actual ground z at loc.  -15 wasnt enough
2020-12-13 16:38:55 -08:00
Noudess fff53fc465 Destination check needed to be actual ground z at loc. -15 wasnt enough 2020-12-13 10:17:04 -05:00
Chris Miles 5a4c651d6b Drone Build Pipeline (#1144)
* Create drone config

* Tweak config

* Update .drone.yml

* Garbage commit to run another build

* Bring cores down

* Fix formatting from https://github.com/EQEmu/Server/pull/1142

* Add tests line

* Change directory to build before running the unit tests

* Remove tests dir

* Avoid double build on PR's

* Testing build settings
2020-12-07 22:36:59 -06:00
Alex ff4c9e1e70 Merge pull request #1142 from noudess/waterroam
Allow water based roamboxes again.
2020-12-07 14:07:59 -08:00
Noudess 8bc60acd77 Fix so roamboxes allow water boxes again. 2020-12-07 11:10:59 -05:00
E Spause f26b3195c9 Add safeguard for issue with mobs pathing to 0,0,0 on teleport nodes with values 0,0,0 (#1140)
* IP limit and account session limit refactor - uses responses built into loginserver

* Fix an issue where teleport nodes with 0.0f as a value were added to routes when pathing.
2020-12-05 15:15:53 -06:00
Michael Cook (mackal) 31019b8832 Merge pull request #1137 from EQEmu/bug_fix/rest_timer
Save the rest_timer sooner to prevent issues
2020-11-22 14:35:24 -05:00
Michael Cook (mackal) df4ccaf970 Merge pull request #1136 from EQEmu/bug_fix/quest_reward_charges
Update the SummonItem call to default charges for QuestRewards
2020-11-22 14:08:33 -05:00
Michael Cook (mackal) eb0d12f220 Save the rest_timer sooner to prevent issues
We need to save the remaining time sooner to prevent circumstances
described here:

http://www.projecteq.net/forums/index.php?threads/raid-out-of-combat-regen-timers-resetting-on-non-raid-mobs.16114/
2020-11-17 15:47:12 -05:00
Michael Cook (mackal) 60254105f1 Update the SummonItem call to default charges for QuestRewards
This should summon the item at max charges, if it has charges
2020-11-05 19:40:04 -05:00
Akkadius 1fc4073a05 Garbage commit to push a build 2020-11-03 19:46:47 -05:00
Chris Miles be12cad7bd Fix for quest::GetZoneLongName(zone_short_name) garbled output (#1134) 2020-10-31 18:47:43 -05:00
Akkadius 25c596656c Merge branch 'master' of https://github.com/EQEmu/Server 2020-10-25 23:49:08 -05:00
Akkadius ee7ef97506 Revert "Spell Fizzle for < LDON expansions via lua_mod (#1118)"
This reverts commit e9d312fa86.
2020-10-25 23:48:57 -05:00
Chris Miles 80ce499f67 Scanning Optimizations (#1133)
* Scanning optimizations this more properly applies idle / moving scanning algorithms and applies update_others when a client is moving

* Fix bots

* Perform a self and other scan when npc's pop
2020-10-25 23:01:30 -05:00
Chris Miles 62efae2e00 SendIllusion Update Internal Values (#1130)
* Fix scenarios where quest calls to SendIllusion also update internal values so that new clients that zone in see the correct appearance

* Typo [skip ci]
2020-10-25 21:48:29 -05:00
Ali Al-Khalifa e9d312fa86 Spell Fizzle for < LDON expansions via lua_mod (#1118)
* [expansions] Create a Lua mod hook into Client::CheckFizzle()

* Added expansions_combat.lua mod stub

* Spell  Fizzle as per TAKP formula
2020-10-24 19:49:43 -05:00
Chris Miles c1c010bc8d Merge pull request #1128 from EQEmu/editmassrespawn_upd
Fix for command '#editmassrespawn'
2020-10-10 20:19:14 -05:00
Uleat f03669b8f4 Fix for command '#editmassrespawn' 2020-10-10 21:13:13 -04:00
Paul Coene b996f40016 Merge pull request #22 from EQEmu/master
Merge base back into my fork
2020-10-09 11:30:38 -04:00
Chris Miles a4a4a2266b Merge pull request #1122 from EQEmu/bug/item_loss_message
Only UF and earlier have the CORPSE_ITEM_LOST string
2020-10-06 02:30:26 -05:00
Chris Miles 82512899b2 Merge pull request #1126 from snail23/master
Compile fix on linux
2020-10-06 02:30:01 -05:00
JJ 4ac62a2ddc Merge pull request #1123 from noudess/amphibious
Allow amphibious mobs underwater to follow los and not fall to water bottom when pathing
2020-10-05 20:17:37 -04:00
Snail 1d4bea21c1 compile fix on linux (glm is using c++14 code), update CXX_STANDARD 2020-10-04 18:50:19 -04:00
regneq ed351fb4cb Merge pull request #6 from EQEmu/master
update
2020-10-01 08:02:43 -07:00
Noudess d507222d21 Allow amphibious creatures to swim to next node of pathing. 2020-09-21 10:36:00 -04:00
Paul Coene 27e19900ae Merge pull request #21 from EQEmu/master
Merge from base.
2020-09-21 10:27:18 -04:00
Michael Cook (mackal) 32f4722c0f Only UF and earlier have the CORPSE_ITEM_LOST string
Let's not confuse players with missing messages I guess
2020-09-20 13:55:45 -04:00
Chris Miles 5e93746e8c Merge pull request #1119 from noudess/master
Fix bugged pet sit button and taunt.
2020-09-19 18:48:13 -05:00
Michael Cook (mackal) 1106e404c7 Merge pull request #1121 from EQEmu/bug_fix/pet_affinity_solo_fix
Fix issue where a group buff was casted on a solo player
2020-09-10 14:25:37 -04:00
KimLS 0e2c918479 Added alias to lua skills that don't start with a number so i can use them with typescript which don't allow identifiers starting with 0-9 2020-09-09 21:29:29 -07:00
Noudess 05dfe748d3 Use aabonuses.PetCommands instead of checking AA level 2020-09-08 19:10:48 -04:00
Noudess cd2b2c3c19 Fix indentation. 2020-09-08 16:48:09 -04:00
Michael Cook (mackal) 6f2b39792a Fix issue where a group buff was casted on a solo player
The pet affinity in this case was checking the caster's AAs not the
target's like it should
2020-09-08 15:57:17 -04:00
Noudess ff6de1938b Change older clients to default to taunting=true only for taunt eligble pets. 2020-09-03 15:38:35 -04:00
Noudess d5451c5d77 Remove left over logging. 2020-09-02 14:56:12 -04:00
Noudess 96fb156c47 Change Older clients to not use persistant taunt button & default to taunt on. 2020-09-02 14:50:51 -04:00
Noudess 56afa0404b Updates to fix taunt button on PET UI to match live behavior. 2020-09-02 12:50:11 -04:00
Noudess 29f7bc7a9c Fix bugged pet window sit button and pet sit based regen. 2020-08-31 13:39:42 -04:00
Paul Coene ad74af7797 Merge pull request #20 from EQEmu/master
Merge from base
2020-08-28 18:59:13 -04:00
Chris Miles 3fe0f59deb Merge pull request #1117 from EQEmu/xackery/vscode-update
changed build dir to /bin, updated peq db dump
2020-08-24 08:03:53 -05:00
Xackery Xtal ebf1cc2bc6 changed build dir to /bin, updated peq db dump 2020-08-23 18:17:23 -07:00
Akkadius 32407dbb56 Add rule Character:FinalExpMultiplier - Added on top of everything else, easy for setting EXP events 2020-08-21 01:04:18 -05:00
Chris Miles 482816058f Merge pull request #1113 from EQEmu/fix/ZonePoint_memleak
Fix memory leak for virtual zone line branch
2020-08-21 00:25:27 -05:00
Chris Miles 8ed2ea5cfe Merge pull request #1114 from noudess/patch-1
Removed duplicate code for pruning merhantlist_temp
2020-08-21 00:24:59 -05:00
Chris Miles 5d4a78fb3f Merge pull request #1112 from noudess/untargettable
Add check so that the 'u' key does not open a trade window with an untargettable mob.
2020-08-21 00:24:28 -05:00
Chris Miles ebea77e8ea Merge pull request #1115 from EQEmu/bugfix/command_task
Fix missing arg to client message in #task
2020-08-21 00:24:03 -05:00
Akkadius 51356610b2 Fix overflow issue with character corpse creation using the wrong struct in allocation 2020-08-21 00:23:13 -05:00
Michael Cook (mackal) 84a75f2a77 Fix missing arg to client message in #task 2020-08-19 17:13:28 -04:00
Paul Coene 9be5ac4ca6 Update main.cpp 2020-08-19 14:58:04 -04:00
Paul Coene b8586bf9cb Update main.cpp 2020-08-19 14:57:21 -04:00
Paul Coene 7cc23fcbeb Removed duplicate code for pruning merhantlist_temp
The code already exists, guarded by a rule.
2020-08-19 14:48:28 -04:00
Michael Cook (mackal) 539de20a11 Fix memory leak for virtual zone line branch 2020-08-18 23:32:45 -04:00
Chris Miles b57bcced40 Merge pull request #1111 from EQEmu/bug_fix/aepcv1_mobai_distance
Fix NPC AI casting of ST_AEClientV1
2020-08-18 13:21:53 -05:00
Noudess 9ab61d4ed4 Fix so an untargettable mob is not opened for trade when client pressed the 'u'
key.  Discovered this on untargettable mobs at doors.
2020-08-18 11:15:33 -04:00
Paul Coene 09e0b09649 Merge pull request #19 from EQEmu/master
merge from base
2020-08-18 10:55:21 -04:00
Michael Cook (mackal) b9f01e0d1c Merge pull request #1107 from fryguy503/percentheal_aggro
[Aggro] PercentalHeal should be included in aggro generation
2020-08-17 21:17:40 -04:00
Michael Cook (mackal) f7e997fba1 Fix NPC AI casting of ST_AEClientV1
As noted, I think we do this check incorrectly, but this should work
fine and matches other similar spells, let's get it good enough first.
2020-08-17 18:04:52 -04:00
Akkadius 78776df107 Update world content service API's to consider all expansions enabled 2020-08-16 20:04:49 -05:00
Trust bd4810351d [Aggro] PercentalHeal should be included in aggro generation
Per January 15th 2003 Patch Notes:
"NPCs will now notice Druid and Shaman Percentage Heal spells in a manner similar to traditional healing spells."

Added SE_PercetalHeal to the same CheckHealAggroAmount as SE_CurrentHP to be similar to traditional healing spells.
2020-08-16 18:32:26 -04:00
Chris Miles 0506c01103 Merge pull request #1102 from fryguy503/AERamp
[Combat] AE Ramp now allows Max Melee Range
2020-08-16 02:03:54 -05:00
Chris Miles 24a8ca39d3 Merge pull request #1100 from noudess/empty_processing
Allow quests to turn on mob processing in empty zones
2020-08-16 02:03:22 -05:00
Chris Miles ecf47a0bbb Merge pull request #1097 from SecretsOTheP/null_ptr_fixes
Null ptr fixes
2020-08-16 02:02:46 -05:00
Chris Miles 6a4a4de31c Merge pull request #1106 from EQEmu/feature/virtual-zonepoints
Add support for virtual zonepoints
2020-08-16 01:42:33 -05:00
Akkadius efdead0b0a Add expansion info 2020-08-16 01:12:30 -05:00
Akkadius e319746ca9 Typos 2020-08-16 00:16:50 -05:00
Akkadius f78828216d Add support for virtual zonepoints 2020-08-16 00:06:20 -05:00
Akkadius 9d0f7781b4 Fix compiler warnings 2020-08-15 19:03:25 -05:00
Akkadius f6e544a2e6 Merge branch 'master' of https://github.com/EQEmu/Server 2020-08-15 18:49:24 -05:00
Akkadius 3ffb5299a8 Update repositories 2020-08-15 18:28:34 -05:00
Chris Miles aeb1ce0fbe Merge pull request #1105 from EQEmu/feature/lootdrop-changes
Lootdrop Filtering Adjustments
2020-08-15 17:55:18 -05:00
Akkadius 4b764e2cc5 Set loot default log [skip ci] 2020-08-15 17:48:10 -05:00
Akkadius 45f08b4645 Cleanup some logic 2020-08-15 17:43:20 -05:00
Akkadius 0e31302a7d Add an easy way to pull item saylinks 2020-08-15 17:25:09 -05:00
Akkadius 94d87584aa Lootdrop level filtering adjustments 2020-08-15 16:37:38 -05:00
Trust 3245fa6123 [Combat] AE Ramp now allows Max Melee Range
RuleR AERampageSafeZone - Reduce AE Ramp range by this amount to allow for a small safe zone on AE Ramp.
2020-08-09 14:04:03 -04:00
Akkadius bda13383ef Revert "Merge pull request #1101 from KinglyKrab/custom"
This reverts commit 43108acae1, reversing
changes made to daa1db65b9.
2020-08-03 22:21:51 -05:00
Alex 43108acae1 Merge pull request #1101 from KinglyKrab/custom
Custom changes.
2020-08-03 23:17:37 -04:00
Alex ff7c3aff92 Custom changes. 2020-08-03 23:14:39 -04:00
Chris Miles daa1db65b9 Merge pull request #1094 from EQEmu/integration/multi-tenancy-expansions-repository
Integration/multi tenancy expansions repository
2020-07-30 22:27:58 -05:00
Chris Miles fd48912bd2 Merge pull request #1098 from EQEmu/lua_update_zone_header
Add Lua eq.update_zone_header export to lua_general.cpp.
2020-07-30 22:07:47 -05:00
Akkadius cfa3e88bb2 Add command #gearup as a fairly decent start to a expansion specific way of gearing up a GM test character 2020-07-30 21:10:15 -05:00
Noudess 8e7591cd4b Added support for quests to enable and then redisable processing of movement. 2020-07-27 10:43:24 -04:00
Paul Coene 44a1256eb9 Merge pull request #18 from EQEmu/master
Merge mainline into my fork
2020-07-27 09:53:56 -04:00
Akkadius a307636962 Fix object update spam issue (terrible code) 2020-07-20 22:53:58 -05:00
Akkadius a617fc5034 Merge branch 'master' of https://github.com/EQEmu/Server into integration/multi-tenancy-expansions-repository 2020-07-19 20:40:00 -05:00
Alex 63ad92090a Add Lua eq.update_zone_header export to lua_general.cpp. 2020-07-19 18:01:06 -04:00
E Spause 147916ce2e Set group info to null in various places
When the group is disbanded, set the leader to null.

When setting a new raid leader, make sure we have a new raid leader. If we don't, avoid a crash and disband the raid. It's better than zones falling apart, and will resolve itself on the next VerifyRaid call.

If a member zones, set the leader pointer to nullptr. This fixes an issue where the leader pointer is freed later (MemberZoned normally cleans up the Client object), but referenced by other entities, allowing the leader to be used in the same server process tick, post-cleanup - as the leader won't exist.
2020-07-19 02:34:59 -04:00
Akkadius 98340751b0 Sanity check on adding self to other lists 2020-07-19 01:34:25 -05:00
E Spause 42781036a8 Fix issue where npc_types could become null in the cache but remain referenced, causing a crash due to invalid memory accessed 2020-07-19 02:31:22 -04:00
E Spause eacd2c2cde Fix null pointers in group/raid pointer removal 2020-07-19 02:30:50 -04:00
Akkadius 2e0c892b07 Add cli character:copy-character and #copycharacter 2020-07-18 21:07:22 -05:00
Akkadius 880b19cc7f Hit the zone cache first so we're not hitting the database every time someone attempts to zone 2020-07-18 13:16:27 -05:00
Chris Miles fc6689ec09 Merge pull request #1096 from noudess/master
Added Rule to enable AA Ding()
2020-07-18 11:50:37 -05:00
Noudess db4f113129 Added rule to allow the Ding sound when AA is earned. 2020-07-13 08:12:02 -04:00
Akkadius 30e0bbb912 More conversion changes to reduce warnings [skip ci] 2020-07-12 17:33:17 -05:00
Akkadius 6a7a78af29 Static cast floats in atof usages where the datatype is actually float to avoid windows compiler warnings 2020-07-12 17:25:50 -05:00
Akkadius 758a30a080 Fix merge 2020-07-12 16:57:36 -05:00
Akkadius 3016f9409b Fix merge 2020-07-12 16:57:04 -05:00
Chris Miles 7ba55759c5 Merge pull request #1095 from EQEmu/world_wide_lua_overrides
Add Lua overrides to worldwide methods to make additional parameters optional.
2020-07-12 16:53:47 -05:00
Akkadius 8647bd73ce Merge remote-tracking branch 'origin' into integration/multi-tenancy-expansions-repository 2020-07-12 16:51:36 -05:00
Alex e033d89a32 Add Lua overrides to worldwide methods to make additional parameters optional. 2020-07-08 18:16:20 -04:00
Paul Coene a8928d4a39 Merge pull request #17 from EQEmu/master
Merge master into our fork
2020-07-08 15:48:20 -04:00
Chris Miles b801f8dfe5 Merge pull request #1092 from EQEmu/cross_zone_overhaul
Completely overhaul cross zone and world wide methods in quest API.
2020-07-07 14:15:29 -05:00
Chris Miles b0b63cc64c Merge pull request #1093 from EQEmu/hot_reload_adjustments
Add hot reload saylinks as well as a rule to determine if you bypass the saylinks.
2020-07-07 14:13:15 -05:00
Alex c8389bc674 Completely overhaul cross zone and world wide methods in quest API. 2020-07-07 08:02:56 -04:00
Alex f1929c4f45 Add hot reload saylinks as well as a rule to determine if you bypass the saylinks. 2020-07-07 07:20:08 -04:00
Akkadius f6b5bbef00 Add world api get_database_schema 2020-07-07 02:21:44 -05:00
Akkadius bdf55403cf Add manifest criteria 2020-07-07 02:10:00 -05:00
Akkadius 084e9b7a35 Fix command exit codes 2020-07-07 02:09:39 -05:00
Akkadius a54d92d078 Cleanup content flag loading logic 2020-07-07 02:06:16 -05:00
Akkadius 331eb51126 Add connection label to MySQL connects 2020-07-07 02:06:00 -05:00
Akkadius b7e2261e16 Merge branch 'master' of https://github.com/EQEmu/Server into integration/multi-tenancy-expansions-repository 2020-07-07 01:32:17 -05:00
Akkadius 4e6c3b524f Add fix for scenario where a client traveled far distance quickly and mob scanning is too slow; this takes care of all scenarios 2020-07-07 01:19:02 -05:00
Chris Miles 520ac3ae46 Merge pull request #1091 from EQEmu/feature/windows-shared-memory-hotfix-fix
Windows #hotfix Fix
2020-07-04 02:27:17 -05:00
Akkadius 15a70c7aa9 Fix for windows hotfix [skip ci] 2020-07-04 02:24:53 -05:00
Akkadius 9e960b90bd Adjust path quote [skip ci] 2020-07-04 02:01:35 -05:00
Akkadius 8e96232690 Add explicit file extension to file check [skip ci] 2020-07-04 01:58:02 -05:00
Akkadius 6aad062e9a Add logging [skip ci] 2020-07-04 01:50:29 -05:00
Chris Miles 818fd53dd0 Merge pull request #1090 from xevianindustries/titanium_start_zone_fix
Issue 743 - WorldDatabase::GetStartZone now checks isTitanium when creating the SQL
2020-07-02 21:34:52 -05:00
Akkadius 36e064a7b3 Fix issue where #hotfix doesn't work properly in new Windows installations 2020-07-02 21:31:50 -05:00
Erick Christgau 12a0e3e226 Issue 743 - WorldDatabase::GetStartZone now checks isTitanium when creating the SQL 2020-07-02 10:16:04 -05:00
Chris Miles a78c3b9800 Merge pull request #1086 from EQEmu/cross_zone_move
Optimize cross-zone utilities and add cross-zone player move utilities to Perl/Lua.
2020-06-30 14:48:16 -05:00
Chris Miles 62439fe8ee Merge pull request #1088 from EQEmu/move_zone_instance
Add MoveZoneInstance methods to Perl/Lua.
2020-06-30 14:47:16 -05:00
Chris Miles 4b1ea13c32 Merge pull request #1089 from EQEmu/dye_armor
Add DyeArmorBySlot(slot, red, green, blue, use_tint) to Perl/Lua.
2020-06-30 14:46:43 -05:00
Chris Miles 7a5a0915e5 Merge pull request #1085 from EQEmu/display_ac
Add GetDisplayAC() to Perl/Lua.
2020-06-30 14:46:08 -05:00
Paul Coene 0202a2ad23 Merge pull request #16 from EQEmu/master
Merge master into main
2020-06-30 07:56:00 -04:00
Alex eed1fd8a43 Add DyeArmorBySlot(slot, red, green, blue, use_tint) to Perl/Lua. 2020-06-29 20:55:30 -04:00
Alex 1b2c2a1dd0 Add MoveZoneInstance methods to Perl/Lua. 2020-06-29 19:49:37 -04:00
Alex f514dd5b55 Optimize cross-zone utilities and add cross-zone player move utilities to Perl/Lua. 2020-06-29 17:54:30 -04:00
Alex eb039d176c Add GetDisplayAC() to Perl/Lua. 2020-06-29 15:49:24 -04:00
Akkadius 954b0c5106 Post merge fixes 2020-06-29 00:55:53 -05:00
Akkadius e03ca7f65e Merge branch 'master' of https://github.com/EQEmu/Server into integration/multi-tenancy-expansions-repository 2020-06-29 00:40:27 -05:00
Akkadius f32126faac Fix issue where when a client first enters a zone, a mob may not be aware of their distance to a client immediately so when the client does their scan we also add ourselves to their lists 2020-06-28 23:10:30 -05:00
Akkadius e11868eb65 Merge branch 'master' of https://github.com/EQEmu/Server 2020-06-28 22:56:35 -05:00
Akkadius 05113aab7d Lower animation throttle frequency 2020-06-28 22:56:33 -05:00
Chris Miles ba62d0bdd3 Merge pull request #1074 from thalix1337/master
Improvement of rule descriptions
2020-06-28 22:03:31 -05:00
Chris Miles 53eb28c5c6 Merge pull request #1079 from KinglyKrab/disc_timer
Add GetDisciplineTimer() and ResetDisciplineTimer() to Perl/Lua.
2020-06-28 22:00:45 -05:00
Chris Miles f6d415410d Merge pull request #1080 from KinglyKrab/assign_tasks
Add cross-zone task assign methods to Perl/Lua.
2020-06-28 21:54:52 -05:00
Chris Miles f143cddc97 Merge pull request #1082 from KinglyKrab/move_zone
Add MoveZone methods to Perl/Lua.
2020-06-28 20:05:16 -05:00
Chris Miles 2a19ad0197 Merge pull request #1083 from EQEmu/recalculate_skills
Fix $npc->RecalculateSkills() in Perl.
2020-06-28 20:04:41 -05:00
Akkadius 30067f9b6d Fix UCS connection bug 2020-06-28 19:14:36 -05:00
Alex 1292e1c9c0 Fix $npc->RecalculateSkills() in Perl. 2020-06-28 10:08:21 -04:00
Alex 9a2294774e Add client-based MoveZone methods. 2020-06-27 21:35:52 -04:00
Alex 2c7d227f4a Merge pull request #1 from EQEmu/master
Update.
2020-06-27 20:41:58 -04:00
Alex 25c3d3803f Add cross-zone task assign methods to Perl/Lua. 2020-06-27 20:03:06 -04:00
Alex 736c345a45 Add GetDisciplineTimer() and ResetDisciplineTimer() to Perl/Lua. 2020-06-27 16:37:24 -04:00
thalix1337 c3e7cd65e8 Corrected duplicate descriptions
Corrected descriptions for the rules UseOldConSystem and UseLiveBlockedMessage
2020-06-27 03:18:40 +02:00
freyonsecurity 9bbef1d79a Missing descriptions added
All missing descriptions added. Made corrections to existing descriptions.
2020-06-26 22:05:35 +02:00
Chris Miles 6bdc1ffffb Merge pull request #1067 from noudess/CallForHelp
Prevent mob from moving from point of aggro until after calls for help are issued.
2020-06-23 14:20:40 -05:00
Chris Miles a9c2e35bc7 Merge pull request #1075 from KinglyKrab/findzone
Add zone ID to #findzone.
2020-06-23 14:18:47 -05:00
Chris Miles 10f54313a5 Merge pull request #1076 from KinglyKrab/zone
Add new zone methods to Perl/Lua.
2020-06-23 14:18:33 -05:00
Chris Miles 2fd149469d Merge pull request #1073 from noudess/gridshow
Repair #grid show command
2020-06-23 14:15:48 -05:00
Chris Miles 08e5176c0c Merge pull request #1077 from KinglyKrab/findrace
Add #findrace command.
2020-06-23 14:10:36 -05:00
Alex 0daadde415 Add #findrace command. 2020-06-21 16:10:55 -04:00
Alex 1ae077ea8f Add new zone methods to Perl/Lua. 2020-06-21 01:15:29 -04:00
Alex 0d28f0c083 Add zone ID to #findzone 2020-06-21 00:26:13 -04:00
Thalix 01698ae989 Incorrectly deleted rules inserted again 2020-06-21 04:03:03 +02:00
Thalix ab73fd7938 Improvement of rule descriptions
Incomplete descriptions added as far as the function was clear to me. Tried to standardize the words used in the descriptions. Corrected a few orthographic problems. Added some words to existing descriptions to make them more understandable. Some rules which were not used anymore are deleted.
2020-06-21 03:19:38 +02:00
Noudess 06f3d40c28 Replaced expensive IsPet() with GetOwnerID(). 2020-06-19 07:59:08 -04:00
Noudess efc3832f52 Fix some formatting and change visual label for stacked node names. 2020-06-19 07:43:06 -04:00
Chris Miles 64b56bd746 Merge pull request #1071 from noudess/master
SQL to add faction mods for guktan and drakkin races, and Agnostic mods
2020-05-30 08:09:20 -05:00
Chris Miles 577fbdac01 Merge pull request #1072 from alimalkhalifa/cmake_mariadb
Updated CMakeLists to default to MariaDB instead of MySQL
2020-05-30 08:08:34 -05:00
Noudess fa2caf8f83 Comment movement code and make target required in all cases again 2020-05-28 13:30:34 -04:00
Noudess 4ad38d4c49 Fix for pets, mercs, bot that don't set combat state. 2020-05-28 13:17:31 -04:00
Noudess 4a23086183 Fixes to #grid show. Added new string utilities. 2020-05-28 08:41:10 -04:00
Paul Coene 9195e5e961 Merge pull request #15 from EQEmu/master
Merge master into my branch
2020-05-28 08:19:35 -04:00
Ali 42352359ad [ci skip] Updated CMakeLists to default to MariaDB instead of MySQL 2020-05-28 15:18:25 +03:00
KimLS 88b405edee Merge branch 'master' of https://github.com/EQEmu/Server 2020-05-26 22:30:24 -07:00
KimLS 8a0d4e37bd Remove optimization off of quest::ChooseRandom on msvc to solve a crash on x64 in release mode 2020-05-26 22:30:19 -07:00
Chris Miles c10a9cb620 Update README.md 2020-05-26 00:32:45 -05:00
Akkadius 01d326ef83 Merge branch 'master' of https://github.com/EQEmu/Server into integration/multi-tenancy-expansions-repository 2020-05-25 23:06:14 -05:00
Akkadius 2ec9a2addd Zone point logging 2020-05-25 23:05:05 -05:00
KimLS 6a416a78a8 Merge branch 'master' of https://github.com/EQEmu/Server 2020-05-25 20:56:54 -07:00
KimLS 5e9bf3b044 Make ChooseRandom more idiomatic, the fact that the code can return a SV of anytype makes it a bit dangerous, good canidate for rewriting as a plugin 2020-05-25 20:56:49 -07:00
Chris Miles a3874b5252 Merge pull request #1070 from alimalkhalifa/installer/support_powershell2
Updated installer to support powershell older than 3.0
2020-05-25 18:38:14 -05:00
Paul Coene 0e04e42bea Added two missing agnostic mods 2020-05-25 16:48:03 -04:00
Paul Coene 40e690f8e3 SQL to add the needed guktan and drakkin faction fixes missed by faction_conversion. 2020-05-25 16:25:55 -04:00
Ali 6896ef650e [ci skip] Updated installer to support powershell older than 3.0 2020-05-25 16:19:33 +03:00
Akkadius cfe3b2b071 Reconile a post merge issue [skip ci] 2020-05-25 01:35:39 -05:00
Akkadius a9790e2779 Update lua_general.cpp 2020-05-24 21:57:09 -05:00
Akkadius a4b027db58 Export quest::is_content_flag_enabled and quest::set_content_flag 2020-05-24 20:45:44 -05:00
Akkadius 50c266982f Remove string quotes from integers in mysql queries for faction and rules [skip ci] 2020-05-24 19:21:26 -05:00
Akkadius 905baa71b2 Merge branch 'master' of https://github.com/EQEmu/Server into integration/multi-tenancy-expansions-repository 2020-05-24 04:24:01 -05:00
Akkadius db072e767a Bulk instance deletion instead of tons of individual statements [skip ci] 2020-05-24 04:23:52 -05:00
Akkadius 02fa823736 Merge branch 'master' of https://github.com/EQEmu/Server into integration/multi-tenancy-expansions-repository 2020-05-24 04:07:38 -05:00
Akkadius 0d2d6a2c6b More resilient fix to killing instances for now [skip ci] 2020-05-24 04:07:29 -05:00
Akkadius 12d10bbc50 Slight adjustment to filter criteria [skip ci] 2020-05-24 03:08:52 -05:00
Akkadius d98e69ae5d Merge branch 'master' of https://github.com/EQEmu/Server into integration/multi-tenancy-expansions-repository 2020-05-24 02:56:13 -05:00
Chris Miles 26831d5ad4 Fix a copy paste error 2020-05-24 02:56:04 -05:00
Akkadius e82f0254b0 Add content_flags_disabled field for additional filtering 2020-05-24 02:24:38 -05:00
Akkadius 630ab5e69d Merge branch 'master' of https://github.com/EQEmu/Server into integration/multi-tenancy-expansions-repository 2020-05-24 01:37:10 -05:00
Akkadius e474df2b12 Tweak content flag filtering [skip ci] 2020-05-24 01:36:17 -05:00
Chris Miles e8a05ec680 Fixes instance deletion issue https://github.com/EQEmu/Server/issues/1069 2020-05-24 01:32:50 -05:00
KimLS 712df6c35a Fix compile issue for latest vc compiler 2020-05-23 23:19:54 -07:00
Akkadius 56c4eb280f Fix post merge issues 2020-05-23 22:41:59 -05:00
Akkadius 03a4254397 Post merge fix [skip ci] 2020-05-23 22:34:32 -05:00
Akkadius 3f62da4573 Merge branch 'master' of https://github.com/EQEmu/Server into integration/multi-tenancy-expansions-repository 2020-05-23 22:33:34 -05:00
Akkadius 86ef1b12e2 Strawberry Perl OOB has issue with getstore so lets use something else [skip ci] 2020-05-23 16:50:09 -05:00
Akkadius b585d9b062 Use wget again for windows [skip ci] 2020-05-23 16:29:04 -05:00
Chris Miles 4603fa2ef8 Merge pull request #1068 from alimalkhalifa/reintroduce_wget_to_windows_installer
Revert back to using wget.exe for windows installs
2020-05-23 16:23:57 -05:00
Ali 2c2c09531f [ci skip] Revert back to using wget.exe for windows installs 2020-05-21 15:16:50 +03:00
Noudess 4e8764b6b9 Repair aggro so CallsForHelp are completed before mob charges. 2020-05-20 16:08:42 -04:00
Paul Coene 3ebbcd84d4 Merge pull request #14 from EQEmu/master
Merge Mainline into my base
2020-05-20 15:52:59 -04:00
Alex d7c5a45cc2 Merge pull request #1064 from EQEmu/getskill
Remove duplicate GetSkill() definition.
2020-05-19 19:35:08 -04:00
Alex 5964bcc3c4 Merge branch 'master' into getskill 2020-05-19 18:50:32 -04:00
Chris Miles 0c531e976b Merge pull request #1065 from EQEmu/signalclient
Remove duplicate SignalClient() definition.
2020-05-19 02:38:44 -05:00
Chris Miles a64c0dfd92 Merge pull request #1063 from EQEmu/maketemppet
Remove duplicate MakeTempPet() definition.
2020-05-19 02:37:46 -05:00
Chris Miles 19107e5ace Merge pull request #1037 from alimalkhalifa/win64
Win64 eqemu_server.pl
2020-05-19 01:24:30 -05:00
Chris Miles 852a8e1617 Update eqemu_server.pl [skip ci] 2020-05-19 01:17:02 -05:00
Chris Miles 4180ef58ef Update eqemu_server.pl [skip ci] 2020-05-19 00:58:19 -05:00
Alex 6a817fdce5 Merge pull request #1051 from hgtw/fix/missing-doors
Fix edge case with door packets that can cause missing doors on clients
2020-05-17 20:36:04 -07:00
KimLS c330904695 Fix for broken tests 2020-05-17 19:10:12 -07:00
KimLS 2fbd5aaccc Rename namespace EQEmu to namespace EQ (so we don't have two similar but different namespaces anymore) 2020-05-17 18:36:06 -07:00
Alex 5bdc9c6c60 Remove duplicate SignalClient() definition. 2020-05-16 14:42:38 -04:00
Alex ceff8b8674 Remove duplicate GetSkill() definition. 2020-05-16 14:40:36 -04:00
Alex 968efe8831 Remove duplicate MakeTempPet definition. 2020-05-16 14:30:35 -04:00
Michael Cook (mackal) 06104b624a Merge pull request #1062 from EQEmu/istaunting
Add IsTaunting() to Perl/Lua.
2020-05-15 17:44:59 -04:00
Alex ee55755c85 Add IsTaunting() to Perl/Lua. 2020-05-14 23:55:55 -04:00
Michael Cook (mackal) d042b0831a Merge pull request #1061 from noudess/NewFishing
New fishing
2020-05-12 13:31:52 -04:00
Alex 5f0d3e9026 Add several cross zone methods to Perl/Lua. 2020-05-11 20:10:52 -04:00
Noudess ea48acbf0b Added check for GetItem() failure on Pole 2020-05-11 15:39:28 -04:00
Noudess b37c75630b Fix subtype logic 2020-05-11 14:56:38 -04:00
Noudess fb1228946a Add code to patchers to put support for Expendable flag on breakable fishing 2020-05-11 14:50:17 -04:00
Noudess 94606504af Add check for fishing pole expendable using new subtype field. 2020-05-11 10:07:29 -04:00
Paul Coene c799267c86 Merge pull request #13 from EQEmu/master
Merge from master
2020-05-11 08:37:28 -04:00
Chris Miles 5dbd2c38ed Update script [skip ci] 2020-05-11 04:51:59 -05:00
Chris Miles f785dc232b More tweaks [skip ci] 2020-05-11 03:37:09 -05:00
Chris Miles d534d345d5 More tweaks [skip ci] 2020-05-11 03:35:16 -05:00
Chris Miles 51b98ec724 Lots of tweaks for overhauls [skip ci] 2020-05-11 03:21:46 -05:00
Chris Miles 2c13f2e928 Update server script [skip ci] 2020-05-11 01:13:59 -05:00
Chris Miles 496a958def Update eqemu_server.pl 2020-05-11 00:28:24 -05:00
Chris Miles 39cd5bb9a8 Fix issue where powershell progress output was dramatically slowing down requests [skip ci] 2020-05-10 23:07:48 -05:00
Chris Miles 5e0ab3e37c Merge pull request #1054 from EQEmu/feature/item_subtype
Add Item SubType to data structures and DB
2020-05-10 20:04:43 -05:00
Chris Miles e64526920c Merge pull request #1053 from KinglyKrab/crosszonesignalplayerbygroupid
Add CrossZoneSignalPlayerByGroupID() to Perl/Lua.
2020-05-10 20:01:51 -05:00
Alex dc9bd031ff Merge branch 'master' into crosszonesignalplayerbygroupid 2020-05-10 21:00:43 -04:00
Chris Miles 7113c9236e Merge pull request #1057 from KinglyKrab/crosszonesignalclientbyname
Fix typo in crosszonesignalclientbyname Perl_croak.
2020-05-10 20:00:42 -05:00
Chris Miles 13d4bbcae2 Merge pull request #1060 from KinglyKrab/crosszonemessageplayerbyguildid
Add CrossZoneMessagePlayerByGuildID() to Perl/Lua.
2020-05-10 19:59:49 -05:00
Alex 857b24727c Add CrossZoneMessagePlayerByGuildID() to Perl/Lua. 2020-05-10 16:52:33 -04:00
Alex 4d93406176 Fix typo in crosszonesignalclientbyname Perl_croak. 2020-05-10 09:16:58 -04:00
Michael Cook (mackal) 0e6a0b5a70 Add Item SubType to data structures and DB 2020-05-09 22:37:35 -04:00
Alex 12c4b20169 Add CrossZoneSignalPlayerByGroupID() to Perl/Lua. 2020-05-09 21:15:34 -04:00
Chris Miles 90e6bb8a8a Merge pull request #1052 from KinglyKrab/master
Fix #findzone to allow you to search using part of a zone's short name.
2020-05-09 17:15:50 -05:00
Alex 518bcb58d3 Fix #findzone to allow you to search using part of a zone's short name. 2020-05-09 18:14:22 -04:00
hg b08dc02a0a Fix edge case with door packets that can cause missing doors on clients
Send OP_RemoveAllDoors packets with default CLIENT_CONNECTINGALL flag
to match flag used for OP_SpawnDoor
2020-05-09 16:26:55 -04:00
Chris Miles 0aa8d90e9e Merge pull request #1049 from noudess/NotifyNewTitles
Notify new titles
2020-05-09 14:54:24 -05:00
Chris Miles e453f3e6ed Merge pull request #1048 from KinglyKrab/master
Add GetNPCBySpawnID() to Perl/Lua.
2020-05-09 14:53:47 -05:00
Chris Miles e719992267 Merge pull request #1042 from noudess/master
Fix for static zone issue with mobs congregating after last player zones
2020-05-09 14:52:54 -05:00
Chris Miles e2a7d4f33f Merge pull request #1046 from noudess/flying
Flying
2020-05-09 14:45:15 -05:00
Chris Miles 8b999a63a4 Merge pull request #1047 from isenior/ScaleFix
Don't scale 0 values
2020-05-09 14:42:30 -05:00
Jose123456 914ea27406 Compile on Freebsd (#1044)
* Compile on Freebsd

Small changes needed for compilation on Freebsd. Note that you'll have
to pass -DEQEMU_BUILD_ZLIB=OFF on the cmake command line. The bundled
zlib-ng does not build on Freebsd even though mainline zlib-ng does.

* Fix build errors: typo
2020-05-09 14:40:33 -05:00
Michael Cook (mackal) 7f3e4e3438 Merge pull request #1050 from EQEmu/feature/subtype_to_structs
Identify SubType in Item structs in some clients
2020-05-09 15:22:06 -04:00
Noudess 5471774b4c Repair prototype 2020-05-08 18:24:25 -04:00
Michael Cook (mackal) 572ad1b6ab Identify SubType in Item structs in some clients
This maybe in older clients as well, but I couldn't verify it and those
clients never did anything with this field so it doesn't matter.

MQ2 calls this SubClass, but we call the field it's a "sub" of Type so I
figured we'd call it SubType.

We still need to rename the DB field and handle it server side etc
2020-05-08 12:56:10 -04:00
Noudess 0a42ded33f Expose client method NotifyNewTitlesAvailable for perl and lua 2020-05-08 09:58:53 -04:00
Paul Coene ca50013334 Merge pull request #12 from EQEmu/master
Merge base
2020-05-08 09:54:23 -04:00
Alex 0b03f27660 Add GetNPCBySpawnID() to Perl/Lua. 2020-05-07 23:11:36 -04:00
= 263ed3913b Don't scale 0 values 2020-05-06 02:44:17 +00:00
regneq 7bea9a7273 Merge pull request #5 from EQEmu/master
eqemu merge update
2020-05-04 08:30:48 -07:00
Noudess 2bcaf2a476 Extended Movement Manager to have a FlyTo 2020-04-30 11:35:09 -04:00
Paul Coene 855e592d22 Merge pull request #10 from EQEmu/master
Merge from master
2020-04-30 11:33:13 -04:00
Akkadius d8b9c3e3de Fix bad object Z data automatically using Z calcs, works fairly reliably 2020-04-25 04:24:22 -05:00
Akkadius 206761d5e8 Force str_tolower on zone name lookups 2020-04-24 20:09:59 -05:00
Akkadius bf0322f8f6 Not sure why we are trying to detete id 0 objects [skip ci] 2020-04-24 18:15:07 -05:00
Akkadius 5dc351e5d5 Remove cross boundary dependency in command_who [skip ci] 2020-04-24 02:22:33 -05:00
Akkadius 22180d4bac Merge branch 'master' of https://github.com/EQEmu/Server into integration/multi-tenancy-expansions-repository 2020-04-24 02:11:44 -05:00
Akkadius 954247956e Adjust syntax 2020-04-24 02:11:06 -05:00
Akkadius 43ff59d7db Merge branch 'master' of https://github.com/EQEmu/Server into integration/multi-tenancy-expansions-repository 2020-04-24 01:27:17 -05:00
Akkadius 387e1668a5 Remove hard delete from DeleteInstance so that the purge timer can pick it up later 2020-04-24 01:25:09 -05:00
Noudess 5989edb6ec Fix for static zone issue with mobs congregating after last player zones 2020-04-21 09:09:30 -04:00
Akkadius 2159b5db2d Add damageshieldtypes to content tables 2020-04-21 02:10:52 -05:00
Paul Coene 54d494da36 Fix errant merchant full messages and add logging for later use (#1035)
* Fix errant merchant full issues, add logging for later use

* Rename merchant list dump more clearly

* spaces around '='

* Added line spacing,

Co-authored-by: Noudess <noudess@gmail.com>
2020-04-20 23:40:18 -05:00
Alex d6af1b566f Merge pull request #1041 from peterigz/master
Add missing break for OP_AppCombined switch statement
2020-04-19 19:23:40 -07:00
Akkadius b6b008e74a Add tenancy support to the dump service 2020-04-19 19:52:19 -05:00
Michael Cook (mackal) 89f5b0b71e Merge pull request #1040 from alimalkhalifa/redundant-check-during-enter-world
Removed redundant check during enter world
2020-04-19 15:22:18 -04:00
Akkadius 6409e02aed Update base repositories to use int as a base to avoid atoi overflow 2020-04-19 04:49:28 -05:00
Akkadius 373fb3f0e7 Decouple zone calls, cleanup logic 2020-04-19 04:36:39 -05:00
Akkadius ebda1cf601 Add zone store 2020-04-19 03:05:15 -05:00
Akkadius 6a51bcf8fd Fix null reference issue [skip ci] 2020-04-19 01:02:35 -05:00
Akkadius caa0ffda00 Add Truncate repository method and purge player sold items on world bootup 2020-04-18 23:53:52 -05:00
Akkadius 85daee85b8 Move spawn events from content table to server 2020-04-18 23:26:53 -05:00
Akkadius e4748a01e0 Fix tradeskill combine logic [skip ci] 2020-04-18 21:50:00 -05:00
Akkadius 472c0cd196 More tweaks [skip ci] 2020-04-18 20:03:34 -05:00
Akkadius df43a23d98 Another adjustment [skip ci] 2020-04-18 19:52:56 -05:00
Akkadius 74c878a481 Fix [skip ci] 2020-04-18 19:49:20 -05:00
Akkadius 093509baa9 Few adjustments [skip ci[ 2020-04-18 19:46:19 -05:00
Akkadius b8c44ee41b Fix container interaction [skip ci] 2020-04-18 18:19:59 -05:00
Akkadius bcd62b76c4 Fix all expansion enabled filtering [skip ci] 2020-04-18 18:12:25 -05:00
Akkadius a0f8bbb3b9 Merge branch 'master' of https://github.com/EQEmu/Server into integration/multi-tenancy-expansions-repository 2020-04-18 02:31:43 -05:00
Akkadius 4db646db94 Revert "Merge pull request #1007 from EQEmu/feature/improved-name-generator"
This reverts commit 3c71e2c91d, reversing
changes made to 80d1601754.
2020-04-18 01:44:43 -05:00
Michael Cook (mackal) 5ce1fef9ec Merge pull request #1039 from alimalkhalifa/gitignore-win-64
Added a VS ignore for x64 compiles
2020-04-17 19:58:20 -04:00
Michael Cook (mackal) 874ca053f7 Merge pull request #1038 from alimalkhalifa/fix_charm_break_during_cast_lifetap_nuke
Fix edge case with NPC pet owners charming PCs
2020-04-17 14:19:13 -04:00
peterigz 21ed02ca52 Add missing break for OP_AppCombined switch statement 2020-04-17 18:27:45 +01:00
Ali 6c3ae4580f [skip ci] Win64 eqemu_server.pl
Changed binaries to x64 and got rid of wget.exe for windows, switched to
native WebClient
2020-04-17 18:53:35 +03:00
Ali 5d4e53bb25 Removed redundant check during enter world 2020-04-17 18:48:43 +03:00
Ali b8e7e5bb0d [skip ci] Added a VS ignore for x64 compiles 2020-04-17 18:46:07 +03:00
Ali 15f3697df1 Fix edge case with NPC pet owners charming PCs
* Addresses #1036
* Cleaned up if statement formatting
* Using Mob::GetOwnerOrSelf() now, which accounts for the edge case

NB: The Mob::SpellOnTarget() and Mob::CommonDamage() methods really
should be looked at and spell logic combined somehow.  Both have if
statements that dodge around the other's conditions to decide which
method sends the CombatDamage_Struct packet
2020-04-17 10:56:43 +03:00
Chris Miles 16cfad1966 UCS / Raid / Zone Fixes (#1033)
* Cache EntityList::GetRaidByClient

* Adjustments [skip ci]

* Update entity [skip ci]

* More cleanup [skip ci]

* More tweaks [skip ci]

* Cleanup [skip ci]

* Fix bugs with UCS reconnection on crash / exit, not adding soft deleted characters, put main loop on UV lib

* Reduce log spam that should be debugging; send keepalives to clients so that they properly prune from the connection list

* Shutdown the eventloop to properly shutdown the zone versus calling a hard exit
2020-04-14 23:28:43 -05:00
JJ bffeee8d1a Merge pull request #1034 from TurmoilToad/patch-1
Update README.md
2020-04-13 09:37:07 -05:00
TurmoilToad d29c0fc332 Update README.md
Updated wiki link.
2020-04-13 10:01:22 -04:00
Chris Miles a031c20e7e Update peq-dump.sh [skip ci] 2020-04-11 16:44:19 -05:00
Akkadius 3daf03c796 Remove errant cout [skip ci] 2020-04-11 05:57:31 -05:00
Akkadius 5b4c4bfd66 Implement content flags 2020-04-11 05:48:41 -05:00
Akkadius 47b8aa3f18 Export quest calls 2020-04-11 04:38:42 -05:00
Akkadius 287fc5d313 Create 2020_04_11_expansions_content_filters.sql 2020-04-11 03:13:03 -05:00
Akkadius 77cacf5cd1 Add std::string WorldContentService::GetCurrentExpansionName() [skip ci] 2020-04-11 03:11:09 -05:00
Akkadius e0363a8fe1 Repository tweaks [skip ci] 2020-04-11 02:47:54 -05:00
Akkadius 5c7eb0707f Bulk load goallists 2020-04-11 02:19:58 -05:00
Akkadius 423bb7f0b3 Adjust content bootstrapping in zone [skip ci] 2020-04-11 01:58:35 -05:00
Chris Miles 67d3cab80b Merge pull request #1030 from EQEmu/feature/send-to-guild-hall-instance-fixes
Implement SendToGuildHall and Improve Instance ID Cycling
2020-04-11 01:33:12 -05:00
Akkadius b41f2dac66 Clamp value for max reserved instance id [skip ci] 2020-04-10 03:26:09 -05:00
Akkadius b5b473f25d Update peq dump [skip ci] 2020-04-10 03:21:33 -05:00
Akkadius 0dc3e5ba35 Add jank permanent reference pass back in [skip ci] 2020-04-10 03:20:41 -05:00
Akkadius 499fe153ab Tweak peq dump [skip ci] 2020-04-10 02:56:45 -05:00
Akkadius d1349e5ac9 Oops, math 2020-04-10 02:30:46 -05:00
Akkadius bd8e94ff17 Use version 1 for GH 2020-04-10 02:20:56 -05:00
Akkadius d89b2f11b5 Get time remaining directly from database for now, this needs to be cached better at the zone state level, I'll refactor this when repositories are merged in 2020-04-10 02:03:30 -05:00
Akkadius 88ff56b2f2 Add client->SendToGuildHall - have instances properly cycle out IDs 2020-04-10 01:43:00 -05:00
Akkadius 1728923bbb Revert "Merge pull request #1007 from EQEmu/feature/improved-name-generator"
This reverts commit 3c71e2c91d, reversing
changes made to 80d1601754.
2020-04-08 16:00:27 -05:00
Alex cbd1f42a08 Merge conflict fixes... 2020-04-06 18:57:13 -04:00
Alex f8735cf9ba Update lua_general.cpp 2020-04-06 18:06:18 -04:00
Chris Miles eb00667eab Merge pull request #1027 from noudess/patch-15
Propose change in location of Stun check as possible resolution to crash
2020-04-06 15:40:39 -05:00
Chris Miles cbc0ada454 Merge pull request #1017 from noudess/master
Fix Issue #849.
2020-04-06 15:39:43 -05:00
Alex 54b33f959e Merge pull request #1026 from KinglyKrab/getclassname
Add getclassname(class_id, level) to Perl/Lua.
2020-04-06 16:25:39 -04:00
Alex c6e4b5647f Merge branch 'master' into getclassname 2020-04-06 16:25:29 -04:00
Alex 928070e994 Merge pull request #1023 from KinglyKrab/getcurrencyitemid
Add getcurrencyitemid(currency_id) to Perl/Lua.
2020-04-06 16:22:50 -04:00
Alex 40ef4c799b Update embparser_api.cpp 2020-04-06 16:22:08 -04:00
Alex 8ba7ddd054 Merge branch 'master' into getcurrencyitemid 2020-04-06 16:21:29 -04:00
Paul Coene 973fd376e5 Propose change in location of Stun check as possible resolution to crash 2020-04-06 08:23:57 -04:00
Paul Coene b5575133cd Put in braces in my new function as well as the source function.
The entire file has implied braces...  I'd change them all but fear making a mistake.
2020-04-06 08:10:15 -04:00
Akkadius 2b1b786f02 Merge branch 'master' of https://github.com/EQEmu/Server into integration/multi-tenancy-expansions-repository 2020-04-06 02:55:46 -05:00
Chris Miles 6f846dc4ff Merge pull request #1025 from KinglyKrab/getracename
Add getracename(race_id) to Perl/Lua.
2020-04-06 01:57:54 -05:00
Chris Miles 0461fc1789 Merge pull request #1024 from KinglyKrab/getskillname
Add getskillname(skill_id) to Perl/Lua.
2020-04-06 01:57:12 -05:00
Chris Miles aa6264266e Merge pull request #1022 from KinglyKrab/getcurrencyid
Add getcurrencyid(item_id) to Perl/Lua.
2020-04-06 01:56:25 -05:00
Chris Miles c3cbe90575 Merge pull request #1021 from KinglyKrab/getnpcnamebyid
Add getnpcnamebyid(npc_id) to Perl/Lua.
2020-04-06 01:56:01 -05:00
Alex c2c6282cc7 Add getclassname(class_id, level) to Perl/Lua. 2020-04-06 02:26:58 -04:00
Alex fab071d9da Add getracename(race_id) to Perl/Lua. 2020-04-06 02:02:20 -04:00
Alex 358bd60716 Add getskillname(skill_id) to Perl/Lua. 2020-04-06 01:36:46 -04:00
Alex 03ca345b37 Add getcurrencyitemid(currency_id) to Perl/Lua. 2020-04-06 01:07:59 -04:00
Alex 6ddcc2bb8a Add getcurrencyid(item_id) to Perl/Lua. 2020-04-06 00:49:57 -04:00
Alex 02cac686b6 Add getnpcnamebyid(npc_id) to Perl/Lua. 2020-04-06 00:10:58 -04:00
Alex 4c348baabd Merge pull request #1020 from KinglyKrab/getcharnamebyid
Added getcharnamebyid(char_id) to Perl/Lua.
2020-04-05 21:26:31 -04:00
Alex 035bac1044 Update embparser_api.cpp 2020-04-05 21:22:23 -04:00
Alex 5a8d467d25 Merge branch 'master' into getcharnamebyid 2020-04-05 21:21:15 -04:00
Alex ae959be5ac Added getcharnamebyid(char_id) to Perl/Lua. 2020-04-05 21:18:05 -04:00
Chris Miles 4157a03f32 Merge pull request #1019 from KinglyKrab/getcharidbyname
Add getcharidbyname(name) to Perl/Lua.
2020-04-05 20:14:00 -05:00
Alex 41d0b1a947 Add getcharidbyname(name) to Perl/Lua. 2020-04-05 20:41:49 -04:00
Chris Miles 3c71e2c91d Merge pull request #1007 from EQEmu/feature/improved-name-generator
Improved Random Name Generator
2020-04-03 03:23:08 -05:00
Chris Miles 80d1601754 Merge pull request #1009 from noudess/patch-13
Hack to fix RoF2 perma IVU/IVA bug after zoning.
2020-04-03 03:22:50 -05:00
Chris Miles cfcbfea3ab Merge pull request #1010 from EQEmu/feared_proximity
Added proximity check for feared clients
2020-04-03 03:22:29 -05:00
Michael Cook (mackal) 7aa8db76f4 Merge pull request #1016 from noudess/patch-14
Update ruletypes.h
2020-04-02 14:44:52 -04:00
Paul Coene 561433902e Removed heal per @mackal 2020-04-02 13:08:05 -04:00
Paul Coene abeb93f1e6 Update entity.h 2020-04-02 12:04:16 -04:00
Paul Coene ef0b29dc8e Update entity.cpp 2020-04-02 12:03:45 -04:00
Paul Coene 42f959329d Update client.h 2020-04-02 11:56:06 -04:00
Paul Coene a898a1d07b Update aggro.cpp 2020-04-02 11:55:05 -04:00
Paul Coene 803c3aabe4 Update client.cpp 2020-04-02 11:54:19 -04:00
Paul Coene 15dde4778a Update aggro.cpp 2020-04-02 11:52:27 -04:00
Paul Coene f2b68e6783 Merge pull request #5 from EQEmu/master
Update from master
2020-04-02 11:50:50 -04:00
Paul Coene 8193b04627 Update ruletypes.h 2020-04-01 08:41:40 -04:00
Chris Miles 47e56f9381 Merge pull request #1015 from EQEmu/checkinstancebycharid
Add CheckInstanceByCharID(instance_id, char_id) to Perl/Lua.
2020-03-31 22:21:08 -05:00
Chris Miles 58b9b719f4 Merge pull request #1014 from EQEmu/gettaskname
Add gettaskname(task_id) to Perl/Lua.
2020-03-31 22:20:58 -05:00
Alex a4bf484c74 Add CheckInstanceByCharID(instance_id, char_id) to Perl/Lua. 2020-03-31 23:19:32 -04:00
Alex 4712b56078 Add gettaskname(task_id) to Perl/Lua. 2020-03-31 23:17:25 -04:00
Chris Miles 9362890d26 Merge pull request #1013 from EQEmu/unusedtaskcode
Remove unused variables in resettaskactivity.
2020-03-31 22:11:37 -05:00
KimLS 6d3848b2c7 Removed make_unique from namegen, was conflicting with real make_unique on windows and we're set to cxx11 still 2020-03-31 19:55:27 -07:00
Alex 8974059577 Remove unused variables in resettaskactivity. 2020-03-31 20:01:47 -04:00
Chris Miles 963735e7dd Merge pull request #1012 from EQEmu/getspellname
Add getspellname(spell_id) to Perl/Lua.
2020-03-31 18:53:20 -05:00
Chris Miles c94a2496ca Merge pull request #1011 from EQEmu/getitemname
Add getitemname(item_id) to Perl/Lua.
2020-03-31 18:51:40 -05:00
Alex ceb8b31bc0 Add getspellname(spell_id) to Perl/Lua. 2020-03-31 19:48:44 -04:00
Alex 51b31b5e53 Add getitemname(item_id) to Perl/Lua. 2020-03-31 19:31:04 -04:00
Paul Coene 6fb6d8891d Hack to fix RoF2 perma IVU/IVA bug after zoning.
This fixes the problem, but I believe someone with better knowledge of the client than I can find a more "correct" solution.

Posted as a PR per @joligario  to solve it for now.  Was also asked to put SE_Invisibility in there so that this "hack" is a catch all.
2020-03-31 09:22:16 -04:00
Akkadius d4ea9bbee0 Use a better name generator 2020-03-31 02:00:09 -05:00
Uleat 3a7908b1de Fix for bots database updates not running when invoked from world.exe [skip ci] 2020-03-30 16:45:50 -04:00
Uleat 99c1c826a8 Fix for bots guild-related view query issue 2020-03-30 08:02:45 -04:00
Chris Miles 1b888784eb Merge pull request #1001 from alimalkhalifa/fix_double_spell_msg
Fix double damaging spell messages to non-attacked and non-attacker
2020-03-29 19:23:49 -05:00
Chris Miles 52a25c3b78 Merge pull request #1005 from EQEmu/editmassrespawn
Added command 'editmassrespawn' for mass editing of respawn times
2020-03-29 19:22:36 -05:00
Uleat 4b08ce1237 Merge branch 'master' of https://github.com/EQEmu/Server into editmassrespawn 2020-03-29 18:02:39 -04:00
Uleat b94fdda429 Updated command 'editmassrespawn' queries to use resolved names over aliases 2020-03-29 18:02:27 -04:00
Ali Al-Khalifa a48153baa1 Fix errant formatting
Mistakenly had a variable in camelCase
2020-03-30 00:26:56 +03:00
Chris Miles e26b159efe Merge pull request #1002 from alimalkhalifa/gitignore-enhancements
Enhanced .gitignore
2020-03-29 16:08:20 -05:00
Uleat a2b381bc9e Added command 'editmassrespawn' for mass editing of respawn times 2020-03-29 16:34:07 -04:00
Ali 60e194e32b Fix double damaging spell messages to non-attacked and non-attacker
With handling for client attacker and pets thanks to @noudess
2020-03-25 15:41:09 +03:00
Ali 1cdf507b9f [ci skip] Enhanced .gitignore
* Removes the generated files from both CMake and VS
2020-03-24 12:48:04 +03:00
Chris Miles 3e98e60877 Merge pull request #996 from KinglyKrab/master
Add countitem(item_id) to Perl/Lua.
2020-03-21 21:33:07 -05:00
Chris Miles af5022b3db Merge pull request #999 from EQEmu/PortFindLoopless
Rewrite how zone finds ports
2020-03-21 21:30:11 -05:00
KimLS 52d2469da2 Rewrite how zone finds ports 2020-03-21 17:05:28 -07:00
Akkadius e431c56f7c Remove tables that no longer exist 2020-03-21 18:41:36 -05:00
Alex 0ab7291625 Add countitem(item_id) to Perl/Lua. 2020-03-19 22:33:07 -04:00
KimLS e384cf6149 Replace hard coded 12 with EFFECT_COUNT in the two spots I see it used. 2020-03-18 20:42:27 -07:00
Uleat 463c0d9e0e Added proximity check for feared clients 2020-03-18 16:12:25 -04:00
Chris Miles 0f92287c02 Merge pull request #993 from EQEmu/7z_tweak
Tweaked compression arguments for 7-Zip cli command invocation
2020-03-12 22:22:55 -05:00
Uleat 6a61fd5df9 Tweaked compression arguments for 7-Zip cli command invocation 2020-03-12 23:12:44 -04:00
Alex dac7541d89 Update README.md
Change the badges to the updated builds we have for appveyor.
2020-03-11 20:43:53 -07:00
Chris Miles e7266943e2 Merge pull request #990 from alimalkhalifa/master
Modified eqemu_server.pl to pull latest PEQ
2020-03-11 21:20:27 -05:00
Ali 7f25f8a235 Modified eqemu_server.pl to pull latest PEQ
* Also added an escape to skip pulling Maps (tighter feedback loop if
developing)
2020-03-11 17:28:56 +03:00
695 changed files with 200816 additions and 35120 deletions
+16
View File
@@ -0,0 +1,16 @@
---
kind: pipeline
type: docker
name: EQEmulator Server Linux CI
# Limits how many of these builds can run on the drone runner at a time, this isn't about cores
concurrency:
limit: 1
steps:
- name: server-build
# Source build script https://github.com/Akkadius/akk-stack/blob/master/containers/eqemu-server/Dockerfile#L20
image: akkadius/eqemu-server:latest
commands:
- sudo chown eqemu:eqemu /drone/src/ * -R
- git submodule init && git submodule update && mkdir -p build && cd build && cmake -DEQEMU_BUILD_LOGIN=ON -DEQEMU_BUILD_BOTS=ON -DEQEMU_BUILD_LUA=ON -G 'Unix Makefiles' .. && make -j$((`nproc`-4))
+17 -1
View File
@@ -37,4 +37,20 @@ perl/
submodules/*
cmake-build-debug/
.nfs.*
.nfs.*
# Visual Studio and CMAKE Generated Files
/.vs/
*.vcxproj
*.vcxproj.filters
*.vcxproj.user
*.cmake
*.ilk
*.pdb
*.sln
*.dir/
libs/
bin/
/Win32
/x64
/client_files/**/CMakeFiles/
+22 -13
View File
@@ -6,7 +6,7 @@
{
"label": "make",
"type": "shell",
"command": "cd build && make",
"command": "cd bin && make",
"group": {
"kind": "build",
"isDefault": true
@@ -18,7 +18,7 @@
{
"label": "make clean",
"type": "shell",
"command": "cd build && make clean",
"command": "cd bin && make clean",
"group": {
"kind": "build",
"isDefault": true
@@ -30,7 +30,7 @@
{
"label": "cmake",
"type": "shell",
"command": "mkdir -p build && cd build && rm CMakeCache.txt && cmake -DEQEMU_BUILD_LOGIN=ON -DEQEMU_BUILD_LUA=ON -G 'Unix Makefiles' ..",
"command": "mkdir -p bin && cd bin && rm CMakeCache.txt && cmake -DEQEMU_BUILD_LOGIN=ON -DEQEMU_BUILD_LUA=ON -G 'Unix Makefiles' ..",
"group": {
"kind": "build",
"isDefault": true
@@ -52,7 +52,7 @@
{
"label": "download maps",
"type": "shell",
"command": "mkdir -p build/bin && cd build/bin && wget https://codeload.github.com/Akkadius/EQEmuMaps/zip/master -O maps.zip && unzip -o maps.zip && rm ./maps -rf && mv EQEmuMaps-master maps && rm maps.zip",
"command": "mkdir -p bin && cd bin && wget https://codeload.github.com/Akkadius/EQEmuMaps/zip/master -O maps.zip && unzip -o maps.zip && rm ./maps -rf && mv EQEmuMaps-master maps && rm maps.zip",
"group": {
"kind": "build",
"isDefault": true
@@ -64,7 +64,7 @@
{
"label": "download quests",
"type": "shell",
"command": "mkdir -p build/bin && cd build/bin && cd server && git -C ./quests pull 2> /dev/null || git clone https://github.com/ProjectEQ/projecteqquests.git quests",
"command": "mkdir -p bin && cd bin && cd server && git -C ./quests pull 2> /dev/null || git clone https://github.com/ProjectEQ/projecteqquests.git quests",
"group": {
"kind": "build",
"isDefault": true
@@ -76,7 +76,7 @@
{
"label": "download eqemu_config",
"type": "shell",
"command": "mkdir -p build/bin && cd build/bin && wget --no-check-certificate https://raw.githubusercontent.com/Akkadius/EQEmuInstall/master/eqemu_config_docker.json -O eqemu_config.json",
"command": "mkdir -p bin && cd bin && wget --no-check-certificate https://raw.githubusercontent.com/Akkadius/EQEmuInstall/master/eqemu_config_docker.json -O eqemu_config.json",
"group": {
"kind": "build",
"isDefault": true
@@ -88,7 +88,7 @@
{
"label": "rebuild database (mariadb must be started)",
"type": "shell",
"command": "mkdir -p build/bin && cd build/bin && docker run -i --rm --privileged -v ${HOST_PROJECT_PATH}/build/bin:/src --network=eqemu -it eqemu/server:0.0.3 bash -c './eqemu_server.pl source_peq_db && ./eqemu_server.pl check_db_updates && ./eqemu_server.pl linux_login_server_setup'",
"command": "mkdir -p bin && cd bin && docker run -i --rm --privileged -v ${HOST_PROJECT_PATH}/bin:/src --network=eqemu -it eqemu/server:0.0.3 bash -c './eqemu_server.pl source_peq_db && ./eqemu_server.pl check_db_updates && ./eqemu_server.pl linux_login_server_setup'",
"group": {
"kind": "build",
"isDefault": true
@@ -100,7 +100,7 @@
{
"label": "zone 7000",
"type": "shell",
"command": "docker stop zone7000 | true && docker network create eqemu | true && docker run -i --rm --name zone7000 --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged -v ${HOST_PROJECT_PATH}/build/bin:/src --ulimit core=10000000 --network=eqemu -p 7000:7000/udp -e LD_LIBRARY_PATH=/src/ eqemu/server:0.0.3 gdb -ex run --args ./zone dynamic_zone7000:7000",
"command": "docker stop zone7000 | true && docker network create eqemu | true && docker run -i --rm --name zone7000 --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged -v ${HOST_PROJECT_PATH}/bin:/src --ulimit core=10000000 --network=eqemu -p 7000:7000/udp -e LD_LIBRARY_PATH=/src/ eqemu/server:0.0.3 gdb -ex run --args ./zone dynamic_zone7000:7000",
"group": {
"kind": "test",
"isDefault": true
@@ -109,7 +109,7 @@
{
"label": "zone 7001",
"type": "shell",
"command": "docker stop zone7001 | true && docker network create eqemu | true && docker run -i --rm --name zone7001 --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged -v ${HOST_PROJECT_PATH}/build/bin:/src --ulimit core=10000000 --network=eqemu -p 7001:7001/udp -e LD_LIBRARY_PATH=/src/ eqemu/server:0.0.3 gdb -ex run --args ./zone dynamic_zone7001:7001",
"command": "docker stop zone7001 | true && docker network create eqemu | true && docker run -i --rm --name zone7001 --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged -v ${HOST_PROJECT_PATH}/bin:/src --ulimit core=10000000 --network=eqemu -p 7001:7001/udp -e LD_LIBRARY_PATH=/src/ eqemu/server:0.0.3 gdb -ex run --args ./zone dynamic_zone7001:7001",
"group": {
"kind": "test",
"isDefault": true
@@ -118,7 +118,7 @@
{
"label": "loginserver",
"type": "shell",
"command": "docker stop loginserver | true && docker network create eqemu | true && docker run -i --rm --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged -v ${HOST_PROJECT_PATH}/build/bin:/src --ulimit core=10000000 --network=eqemu --name loginserver -p 5999:5999/udp -p 5998:5998/udp -e LD_LIBRARY_PATH=/src/ eqemu/server:0.0.3 gdb -ex run --args ./loginserver",
"command": "docker stop loginserver | true && docker network create eqemu | true && docker run -i --rm --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged -v ${HOST_PROJECT_PATH}/bin:/src --ulimit core=10000000 --network=eqemu --name loginserver -p 5999:5999/udp -p 5998:5998/udp -e LD_LIBRARY_PATH=/src/ eqemu/server:0.0.3 gdb -ex run --args ./loginserver",
"group": {
"kind": "test",
"isDefault": true
@@ -127,7 +127,7 @@
{
"label": "shared_memory, world",
"type": "shell",
"command": "docker stop sharedmemory | true && docker stop world | true && docker network create eqemu | true && docker run --rm -v ${HOST_PROJECT_PATH}/build/bin:/src --network=eqemu --name sharedmemory eqemu/server:0.0.3 ./shared_memory && docker run --rm -v ${HOST_PROJECT_PATH}/build/bin:/src --ulimit core=10000000 -e LD_LIBRARY_PATH=/src/ --network=eqemu --name world -p 9000:9000 -p 9000:9000/udp -p 9001:9001 -p 9080:9080 eqemu/server:0.0.3 gdb -ex run ./world",
"command": "docker stop sharedmemory | true && docker stop world | true && docker network create eqemu | true && docker run --rm -v ${HOST_PROJECT_PATH}/bin:/src --network=eqemu --name sharedmemory eqemu/server:0.0.3 ./shared_memory && docker run --rm -v ${HOST_PROJECT_PATH}/bin:/src --ulimit core=10000000 -e LD_LIBRARY_PATH=/src/ --network=eqemu --name world -p 9000:9000 -p 9000:9000/udp -p 9001:9001 -p 9080:9080 eqemu/server:0.0.3 gdb -ex run ./world",
"group": {
"kind": "test",
"isDefault": true
@@ -136,7 +136,7 @@
{
"label": "queryserv",
"type": "shell",
"command": "docker stop queryserv | true && docker run --rm -v ${HOST_PROJECT_PATH}/build/bin:/src --ulimit core=10000000 -e LD_LIBRARY_PATH=/src/ --network=eqemu --name queryserv eqemu/server:0.0.3 gdb -ex run ./queryserv",
"command": "docker stop queryserv | true && docker run --rm -v ${HOST_PROJECT_PATH}/bin:/src --ulimit core=10000000 -e LD_LIBRARY_PATH=/src/ --network=eqemu --name queryserv eqemu/server:0.0.3 gdb -ex run ./queryserv",
"group": {
"kind": "test",
"isDefault": true
@@ -145,7 +145,16 @@
{
"label": "mariadb",
"type": "shell",
"command": "docker stop mariadb | true && cd build/bin && docker network create eqemu | true && docker run --rm -v ${HOST_PROJECT_PATH}/build/bin/db:/bitnami/mariadb -p 3306:3306 -e MARIADB_DATABASE=peq -e MARIADB_USER=eqemu -e MARIADB_PASSWORD=eqemupass -e ALLOW_EMPTY_PASSWORD=yes --name mariadb --network=eqemu bitnami/mariadb:latest",
"command": "docker stop mariadb | true && cd bin && docker network create eqemu | true && docker run --rm -v ${HOST_PROJECT_PATH}/bin/db:/bitnami/mariadb -p 3306:3306 -e MARIADB_DATABASE=peq -e MARIADB_USER=eqemu -e MARIADB_PASSWORD=eqemupass -e ALLOW_EMPTY_PASSWORD=yes --name mariadb --network=eqemu bitnami/mariadb:latest",
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "ucs",
"type": "shell",
"command": "docker stop ucs | true && cd bin && docker network create eqemu | true && docker run --rm -v ${HOST_PROJECT_PATH}/bin:/src -p 7778:7778 --name ucs --network=eqemu eqemu/server:0.0.3 gdb -ex run ./ucs",
"group": {
"kind": "test",
"isDefault": true
+20 -4
View File
@@ -12,7 +12,7 @@ IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD 14)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(CMAKE_CXX_EXTENSIONS OFF)
@@ -55,6 +55,7 @@ FIND_PACKAGE(MariaDB)
FIND_PACKAGE(ZLIB)
FIND_PACKAGE(OpenSSL)
FIND_PACKAGE(Lua51)
FIND_PACKAGE(LuaJit)
FIND_PACKAGE(PerlLibs)
FIND_PACKAGE(Sodium)
FIND_PACKAGE(mbedTLS)
@@ -87,6 +88,12 @@ ELSE()
MESSAGE(STATUS "* Lua: MISSING *")
ENDIF()
IF(LuaJit_FOUND)
MESSAGE(STATUS "* LuaJIT: FOUND *")
ELSE()
MESSAGE(STATUS "* LuaJIT: MISSING *")
ENDIF()
IF(PerlLibs_FOUND)
MESSAGE(STATUS "* Perl: FOUND *")
ELSE()
@@ -122,6 +129,7 @@ OPTION(EQEMU_BUILD_LOGIN "Build the login server." ON)
OPTION(EQEMU_BUILD_HC "Build the headless client." OFF)
OPTION(EQEMU_BUILD_TESTS "Build utility tests." OFF)
OPTION(EQEMU_BUILD_CLIENT_FILES "Build Client Import/Export Data Programs." ON)
OPTION(EQEMU_PREFER_LUA "Build with normal Lua even if LuaJIT is found." OFF)
IF(EQEMU_COMMANDS_LOGGING)
ADD_DEFINITIONS(-DCOMMANDS_LOGGING)
@@ -133,7 +141,7 @@ ENDIF(EQEMU_ENABLE_BOTS)
#database
IF(MySQL_FOUND AND MariaDB_FOUND)
SET(DATABASE_LIBRARY_SELECTION MySQL CACHE STRING "Database library to use:
SET(DATABASE_LIBRARY_SELECTION MariaDB CACHE STRING "Database library to use:
MySQL
MariaDB"
)
@@ -212,7 +220,12 @@ ELSE()
SET(SODIUM_LIBRARY_ENABLED OFF)
ENDIF()
IF(Lua51_FOUND)
IF(LUAJIT_FOUND AND NOT (EQEMU_PREFER_LUA AND Lua51_FOUND))
SET(LUA_LIBRARY_TYPE " LuaJIT")
SET(LUA_LIBRARY_ENABLED ON)
SET(LUA_LIBRARY_LIBS ${LUAJIT_LIBRARY} luabind)
SET(LUA_LIBRARY_INCLUDE ${LUAJIT_INCLUDE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/libs/luabind")
ELSEIF(Lua51_FOUND )
SET(LUA_LIBRARY_TYPE " Lua 5.1")
SET(LUA_LIBRARY_ENABLED ON)
SET(LUA_LIBRARY_LIBS ${LUA_LIBRARY} luabind)
@@ -328,7 +341,10 @@ IF(UNIX)
IF(NOT DARWIN)
SET(SERVER_LIBS ${SERVER_LIBS} "rt")
ENDIF()
SET(SERVER_LIBS ${SERVER_LIBS} "uuid")
# Freebsd provides uuids in the C library
IF(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
SET(SERVER_LIBS ${SERVER_LIBS} "uuid")
ENDIF()
ENDIF()
IF(EQEMU_BUILD_LOGIN AND NOT TLS_LIBRARY_ENABLED)
+9 -4
View File
@@ -1,7 +1,7 @@
# EQEmulator Core Server
|Travis CI (Linux)|Appveyor w/ Bots (Windows) |Appveyor w/o Bots (Windows) |
|Travis CI (Linux)|Appveyor (Windows x86) |Appveyor (Windows x64) |
|:---:|:---:|:---:|
|[![Linux CI](https://travis-ci.org/EQEmu/Server.svg?branch=master)](https://travis-ci.org/EQEmu/Server) |[![Build status](https://ci.appveyor.com/api/projects/status/scr25kmntx36c1ub/branch/master?svg=true)](https://ci.appveyor.com/project/KimLS/server-87crp/branch/master) |[![Build status](https://ci.appveyor.com/api/projects/status/mdwbr4o9l6mxqofj/branch/master?svg=true)](https://ci.appveyor.com/project/KimLS/server-w0pq2/branch/master) |
|[![Linux CI](https://travis-ci.org/EQEmu/Server.svg?branch=master)](https://travis-ci.org/EQEmu/Server) |[![Build status](https://ci.appveyor.com/api/projects/status/v3utuu0dttm2cqd0?svg=true)](https://ci.appveyor.com/project/KimLS/server) |[![Build status](https://ci.appveyor.com/api/projects/status/scr25kmntx36c1ub?svg=true)](https://ci.appveyor.com/project/KimLS/server-87crp) |
***
@@ -17,9 +17,13 @@
|:---:|:---:|:---:|
|**Install Count**|![Windows Install Count](http://analytics.akkadius.com/?install_count&windows_count)|![Linux Install Count](http://analytics.akkadius.com/?install_count&linux_count)|
### > Windows
* [Install](https://eqemu.gitbook.io/server/categories/how-to-guides/installation/server-installation-windows)
* [Install Guide](https://eqemu.gitbook.io/server/categories/installation/server-installation-windows)
### > Debian/Ubuntu/CentOS/Fedora
* [Install Guide](https://eqemu.gitbook.io/server/categories/installation/server-installation-linux)
* You can use curl or wget to kick off the installer (whichever your OS has)
> curl -O https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/linux_installer/install.sh install.sh && chmod 755 install.sh && ./install.sh
@@ -52,7 +56,7 @@ forum, although pull requests will be much quicker and easier on all parties.
## Resources
- [EQEmulator Forums](http://www.eqemulator.org/forums)
- [EQEmulator Wiki](https://github.com/EQEmu/Server/wiki)
- [EQEmulator Wiki](https://eqemu.gitbook.io/)
## Related Repositories
* [ProjectEQ Quests](https://github.com/ProjectEQ/projecteqquests)
@@ -76,3 +80,4 @@ forum, although pull requests will be much quicker and easier on all parties.
<a href="https://github.com/EQEmu/server/graphs/contributors">
<img src="https://contributors-img.firebaseapp.com/image?repo=EQEmu/server" />
</a>
+2 -2
View File
@@ -38,7 +38,7 @@ locations other than lua/
find_path(LUA_INCLUDE_DIR lua.h
HINTS
ENV LUA_DIR
PATH_SUFFIXES include/lua51 include/lua5.1 include/lua-5.1 include/lua include/luajit include
PATH_SUFFIXES include/lua51 include/lua5.1 include/lua-5.1 include/lua include
PATHS
~/Library/Frameworks
/Library/Frameworks
@@ -49,7 +49,7 @@ find_path(LUA_INCLUDE_DIR lua.h
)
find_library(LUA_LIBRARY
NAMES lua51 lua5.1 lua-5.1 lua luajit
NAMES lua51 lua5.1 lua-5.1 lua
HINTS
ENV LUA_DIR
PATH_SUFFIXES lib
+91
View File
@@ -0,0 +1,91 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
# Modified from the FindLua51 that comes with CMake
#[=======================================================================[.rst:
FindLuaJit
---------
Locate LuaJit library This module defines
::
LUAJIT_FOUND, if false, do not try to link to Lua
LUAJIT_LIBRARIES
LUAJIT_INCLUDE_DIR, where to find lua.h
LUAJIT_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
Note that the expected include convention is
::
#include "lua.h"
and not
::
#include <lua/lua.h>
This is because, the lua location is not standardized and may exist in
locations other than lua/
#]=======================================================================]
find_path(LUAJIT_INCLUDE_DIR lua.h
HINTS
ENV LUA_DIR
PATH_SUFFIXES include/luajit include/luajit-2.0 include/luajit-2.1
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
)
find_library(LUAJIT_LIBRARY
NAMES luajit51 luajit5.1 luajit-5.1 luajit
HINTS
ENV LUA_DIR
PATH_SUFFIXES lib
PATHS
~/Library/Frameworks
/Library/Frameworks
/sw
/opt/local
/opt/csw
/opt
)
if(LUAJIT_LIBRARY)
# include the math library for Unix
if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU)
find_library(LUAJIT_MATH_LIBRARY m)
set( LUAJIT_LIBRARIES "${LUAJIT_LIBRARY};${LUAJIT_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
# For Windows and Mac, don't need to explicitly include the math library
else()
set( LUAJIT_LIBRARIES "${LUAJIT_LIBRARY}" CACHE STRING "Lua Libraries")
endif()
endif()
if(LUAJIT_INCLUDE_DIR AND EXISTS "${LUAJIT_INCLUDE_DIR}/lua.h")
file(STRINGS "${LUAJIT_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
string(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUAJIT_VERSION_STRING "${lua_version_str}")
unset(lua_version_str)
endif()
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
# handle the QUIETLY and REQUIRED arguments and set LUAJIT_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaJit
REQUIRED_VARS LUAJIT_LIBRARIES LUAJIT_INCLUDE_DIR
VERSION_VAR LUAJIT_VERSION_STRING)
mark_as_advanced(LUAJIT_INCLUDE_DIR LUAJIT_LIBRARIES LUAJIT_LIBRARY LUAJIT_MATH_LIBRARY)
+14 -18
View File
@@ -131,10 +131,8 @@ SET(repositories
repositories/base/base_adventure_template_entry_flavor_repository.h
repositories/base/base_alternate_currency_repository.h
repositories/base/base_auras_repository.h
repositories/base/base_banned_ips_repository.h
repositories/base/base_base_data_repository.h
repositories/base/base_blocked_spells_repository.h
repositories/base/base_books_repository.h
repositories/base/base_bugs_repository.h
repositories/base/base_bug_reports_repository.h
repositories/base/base_buyer_repository.h
@@ -150,6 +148,7 @@ SET(repositories
repositories/base/base_character_currency_repository.h
repositories/base/base_character_data_repository.h
repositories/base/base_character_disciplines_repository.h
repositories/base/base_character_expedition_lockouts_repository.h
repositories/base/base_character_inspect_messages_repository.h
repositories/base/base_character_item_recast_repository.h
repositories/base/base_character_languages_repository.h
@@ -163,18 +162,21 @@ SET(repositories
repositories/base/base_character_skills_repository.h
repositories/base/base_character_spells_repository.h
repositories/base/base_character_tasks_repository.h
repositories/base/base_character_tribute_repository.h
repositories/base/base_char_create_combinations_repository.h
repositories/base/base_char_create_point_allocations_repository.h
repositories/base/base_char_recipe_list_repository.h
repositories/base/base_chatchannels_repository.h
repositories/base/base_command_settings_repository.h
repositories/base/base_completed_tasks_repository.h
repositories/base/base_content_flags_repository.h
repositories/base/base_damageshieldtypes_repository.h
repositories/base/base_data_buckets_repository.h
repositories/base/base_db_str_repository.h
repositories/base/base_discovered_items_repository.h
repositories/base/base_doors_repository.h
repositories/base/base_dynamic_zones_repository.h
repositories/base/base_eventlog_repository.h
repositories/base/base_expeditions_repository.h
repositories/base/base_expedition_lockouts_repository.h
repositories/base/base_expedition_members_repository.h
repositories/base/base_faction_base_data_repository.h
repositories/base/base_faction_list_repository.h
repositories/base/base_faction_list_mod_repository.h
@@ -196,7 +198,6 @@ SET(repositories
repositories/base/base_guild_ranks_repository.h
repositories/base/base_guild_relations_repository.h
repositories/base/base_hackers_repository.h
repositories/base/base_horses_repository.h
repositories/base/base_instance_list_repository.h
repositories/base/base_instance_list_player_repository.h
repositories/base/base_inventory_repository.h
@@ -204,8 +205,6 @@ SET(repositories
repositories/base/base_ip_exemptions_repository.h
repositories/base/base_items_repository.h
repositories/base/base_item_tick_repository.h
repositories/base/base_launcher_repository.h
repositories/base/base_launcher_zones_repository.h
repositories/base/base_ldon_trap_entries_repository.h
repositories/base/base_ldon_trap_templates_repository.h
repositories/base/base_level_exp_mods_repository.h
@@ -274,7 +273,6 @@ SET(repositories
repositories/base/base_traps_repository.h
repositories/base/base_tributes_repository.h
repositories/base/base_tribute_levels_repository.h
repositories/base/base_variables_repository.h
repositories/base/base_veteran_reward_templates_repository.h
repositories/base/base_zone_repository.h
repositories/base/base_zone_points_repository.h
@@ -296,10 +294,8 @@ SET(repositories
repositories/adventure_template_entry_flavor_repository.h
repositories/alternate_currency_repository.h
repositories/auras_repository.h
repositories/banned_ips_repository.h
repositories/base_data_repository.h
repositories/blocked_spells_repository.h
repositories/books_repository.h
repositories/bugs_repository.h
repositories/bug_reports_repository.h
repositories/buyer_repository.h
@@ -315,6 +311,7 @@ SET(repositories
repositories/character_currency_repository.h
repositories/character_data_repository.h
repositories/character_disciplines_repository.h
repositories/character_expedition_lockouts_repository.h
repositories/character_inspect_messages_repository.h
repositories/character_item_recast_repository.h
repositories/character_languages_repository.h
@@ -328,18 +325,21 @@ SET(repositories
repositories/character_skills_repository.h
repositories/character_spells_repository.h
repositories/character_tasks_repository.h
repositories/character_tribute_repository.h
repositories/char_create_combinations_repository.h
repositories/char_create_point_allocations_repository.h
repositories/char_recipe_list_repository.h
repositories/chatchannels_repository.h
repositories/command_settings_repository.h
repositories/completed_tasks_repository.h
repositories/content_flags_repository.h
repositories/damageshieldtypes_repository.h
repositories/data_buckets_repository.h
repositories/db_str_repository.h
repositories/discovered_items_repository.h
repositories/doors_repository.h
repositories/dynamic_zones_repository.h
repositories/eventlog_repository.h
repositories/expeditions_repository.h
repositories/expedition_lockouts_repository.h
repositories/expedition_members_repository.h
repositories/faction_base_data_repository.h
repositories/faction_list_repository.h
repositories/faction_list_mod_repository.h
@@ -361,7 +361,6 @@ SET(repositories
repositories/guild_ranks_repository.h
repositories/guild_relations_repository.h
repositories/hackers_repository.h
repositories/horses_repository.h
repositories/instance_list_repository.h
repositories/instance_list_player_repository.h
repositories/inventory_repository.h
@@ -369,8 +368,6 @@ SET(repositories
repositories/ip_exemptions_repository.h
repositories/items_repository.h
repositories/item_tick_repository.h
repositories/launcher_repository.h
repositories/launcher_zones_repository.h
repositories/ldon_trap_entries_repository.h
repositories/ldon_trap_templates_repository.h
repositories/level_exp_mods_repository.h
@@ -439,7 +436,6 @@ SET(repositories
repositories/traps_repository.h
repositories/tributes_repository.h
repositories/tribute_levels_repository.h
repositories/variables_repository.h
repositories/veteran_reward_templates_repository.h
repositories/zone_repository.h
repositories/zone_points_repository.h
+2 -2
View File
@@ -24,7 +24,7 @@
* DEALINGS IN THE SOFTWARE.
*/
// EQEmu::Any is a modified version of Boost::Any and as such retains the Boost licensing.
// EQ::Any is a modified version of Boost::Any and as such retains the Boost licensing.
#ifndef EQEMU_COMMON_ANY_H
#define EQEMU_COMMON_ANY_H
@@ -32,7 +32,7 @@
#include <algorithm>
#include <typeinfo>
namespace EQEmu
namespace EQ
{
class Any
{
+14
View File
@@ -378,6 +378,8 @@ const char *GetClassIDName(uint8 class_id, uint8 level)
return "Berserker Guildmaster";
case MERCHANT:
return "Merchant";
case DISCORD_MERCHANT:
return "Discord Merchant";
case ADVENTURERECRUITER:
return "Adventure Recruiter";
case ADVENTUREMERCHANT:
@@ -388,6 +390,18 @@ const char *GetClassIDName(uint8 class_id, uint8 level)
return "Tribute Master";
case GUILD_TRIBUTE_MASTER:
return "Guild Tribute Master";
case GUILD_BANKER:
return "Guild Banker";
case NORRATHS_KEEPERS_MERCHANT:
return "Radiant Crystal Merchant";
case DARK_REIGN_MERCHANT:
return "Ebon Crystal Merchant";
case FELLOWSHIP_MASTER:
return "Fellowship Master";
case ALT_CURRENCY_MERCHANT:
return "Alternate Currency Merchant";
case MERCERNARY_MASTER:
return "Mercenary Liaison";
default:
return "Unknown";
}
+1
View File
@@ -61,6 +61,7 @@
#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 GUILD_BANKER 66
#define NORRATHS_KEEPERS_MERCHANT 67
#define DARK_REIGN_MERCHANT 68
#define FELLOWSHIP_MASTER 69
+4 -4
View File
@@ -77,7 +77,7 @@ namespace EQEmuCommand {
index++;
}
if (!arguments_filled || argc == 2) {
if (!arguments_filled || argc == 2 || cmd[{"-h", "--help"}]) {
std::string arguments_string;
for (auto &arg : arguments) {
arguments_string += " " + arg;
@@ -101,7 +101,7 @@ namespace EQEmuCommand {
std::cout << command_string.str() << std::endl;
exit(1);
exit(0);
}
}
@@ -188,11 +188,11 @@ namespace EQEmuCommand {
std::cout << std::endl;
std::exit(1);
std::exit(0);
}
if (ran_command) {
std::exit(1);
std::exit(0);
}
}
+1 -1
View File
@@ -3,7 +3,7 @@
#include <string.h>
#include <zlib.h>
namespace EQEmu
namespace EQ
{
uint32 EstimateDeflateBuffer(uint32 len) {
z_stream zstream;
+1 -1
View File
@@ -1,6 +1,6 @@
#pragma once
namespace EQEmu
namespace EQ
{
uint32 EstimateDeflateBuffer(uint32 len);
uint32 DeflateData(const char *buffer, uint32 len, char *out_buffer, uint32 out_len_max);
+56 -1
View File
@@ -19,10 +19,14 @@
*/
#include "world_content_service.h"
#include "../database.h"
#include "../rulesys.h"
#include "../eqemu_logsys.h"
WorldContentService::WorldContentService()
{
SetCurrentExpansion(0);
SetCurrentExpansion(Expansion::EXPANSION_ALL);
}
int WorldContentService::GetCurrentExpansion() const
@@ -30,17 +34,68 @@ int WorldContentService::GetCurrentExpansion() const
return current_expansion;
}
void WorldContentService::SetExpansionContext()
{
int expansion = RuleI(Expansion, CurrentExpansion);
if (expansion >= Expansion::Classic && expansion <= Expansion::MaxId) {
content_service.SetCurrentExpansion(expansion);
}
LogInfo(
"Current expansion is [{}] ({})",
GetCurrentExpansion(),
GetCurrentExpansionName()
);
}
std::string WorldContentService::GetCurrentExpansionName()
{
if (content_service.GetCurrentExpansion() == Expansion::EXPANSION_ALL) {
return "All Expansions";
}
if (current_expansion >= Expansion::Classic && current_expansion <= Expansion::MaxId) {
return Expansion::ExpansionName[content_service.GetCurrentExpansion()];
}
return "Unknown Expansion";
}
/**
* @param current_expansion
*/
void WorldContentService::SetCurrentExpansion(int current_expansion)
{
WorldContentService::current_expansion = current_expansion;
}
/**
* @return
*/
const std::vector<std::string> &WorldContentService::GetContentFlags() const
{
return content_flags;
}
/**
* @param content_flags
*/
void WorldContentService::SetContentFlags(std::vector<std::string> content_flags)
{
WorldContentService::content_flags = content_flags;
}
/**
* @param content_flag
* @return
*/
bool WorldContentService::IsContentFlagEnabled(const std::string& content_flag)
{
for (auto &flag : GetContentFlags()) {
if (flag == content_flag) {
return true;
}
}
return false;
}
+34 -28
View File
@@ -25,6 +25,9 @@
#include <vector>
namespace Expansion {
static const int EXPANSION_ALL = -1;
static const int EXPANSION_FILTER_MAX = 99;
enum ExpansionNumber {
Classic = 0,
TheRuinsOfKunark,
@@ -95,36 +98,37 @@ public:
WorldContentService();
std::string GetCurrentExpansionName();
int GetCurrentExpansion() const;
void SetCurrentExpansion(int current_expansion);
bool IsClassicEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::Classic; }
bool IsTheRuinsOfKunarkEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheRuinsOfKunark; }
bool IsTheScarsOfVeliousEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheScarsOfVelious; }
bool IsTheShadowsOfLuclinEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheShadowsOfLuclin; }
bool IsThePlanesOfPowerEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::ThePlanesOfPower; }
bool IsTheLegacyOfYkeshaEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheLegacyOfYkesha; }
bool IsLostDungeonsOfNorrathEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::LostDungeonsOfNorrath; }
bool IsGatesOfDiscordEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::GatesOfDiscord; }
bool IsOmensOfWarEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::OmensOfWar; }
bool IsDragonsOfNorrathEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::DragonsOfNorrath; }
bool IsDepthsOfDarkhollowEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::DepthsOfDarkhollow; }
bool IsProphecyOfRoEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::ProphecyOfRo; }
bool IsTheSerpentsSpineEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheSerpentsSpine; }
bool IsTheBuriedSeaEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheBuriedSea; }
bool IsSecretsOfFaydwerEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::SecretsOfFaydwer; }
bool IsSeedsOfDestructionEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::SeedsOfDestruction; }
bool IsUnderfootEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::Underfoot; }
bool IsHouseOfThuleEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::HouseOfThule; }
bool IsVeilOfAlarisEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::VeilOfAlaris; }
bool IsRainOfFearEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::RainOfFear; }
bool IsCallOfTheForsakenEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::CallOfTheForsaken; }
bool IsTheDarkendSeaEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheDarkendSea; }
bool IsTheBrokenMirrorEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheBrokenMirror; }
bool IsEmpiresOfKunarkEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::EmpiresOfKunark; }
bool IsRingOfScaleEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::RingOfScale; }
bool IsTheBurningLandsEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheBurningLands; }
bool IsTormentOfVeliousEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TormentOfVelious; }
bool IsClassicEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::Classic || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsTheRuinsOfKunarkEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheRuinsOfKunark || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsTheScarsOfVeliousEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheScarsOfVelious || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsTheShadowsOfLuclinEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheShadowsOfLuclin || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsThePlanesOfPowerEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::ThePlanesOfPower || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsTheLegacyOfYkeshaEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheLegacyOfYkesha || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsLostDungeonsOfNorrathEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::LostDungeonsOfNorrath || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsGatesOfDiscordEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::GatesOfDiscord || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsOmensOfWarEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::OmensOfWar || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsDragonsOfNorrathEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::DragonsOfNorrath || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsDepthsOfDarkhollowEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::DepthsOfDarkhollow || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsProphecyOfRoEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::ProphecyOfRo || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsTheSerpentsSpineEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheSerpentsSpine || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsTheBuriedSeaEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheBuriedSea || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsSecretsOfFaydwerEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::SecretsOfFaydwer || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsSeedsOfDestructionEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::SeedsOfDestruction || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsUnderfootEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::Underfoot || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsHouseOfThuleEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::HouseOfThule || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsVeilOfAlarisEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::VeilOfAlaris || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsRainOfFearEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::RainOfFear || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsCallOfTheForsakenEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::CallOfTheForsaken || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsTheDarkendSeaEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheDarkendSea || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsTheBrokenMirrorEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheBrokenMirror || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsEmpiresOfKunarkEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::EmpiresOfKunark || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsRingOfScaleEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::RingOfScale || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsTheBurningLandsEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheBurningLands || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsTormentOfVeliousEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TormentOfVelious || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsCurrentExpansionClassic() { return current_expansion == Expansion::ExpansionNumber::Classic; }
bool IsCurrentExpansionTheRuinsOfKunark() { return current_expansion == Expansion::ExpansionNumber::TheRuinsOfKunark; }
@@ -155,11 +159,13 @@ public:
bool IsCurrentExpansionTormentOfVelious() { return current_expansion == Expansion::ExpansionNumber::TormentOfVelious; }
private:
int current_expansion;
int current_expansion{};
std::vector<std::string> content_flags;
public:
const std::vector<std::string> &GetContentFlags() const;
bool IsContentFlagEnabled(const std::string& content_flag);
void SetContentFlags(std::vector<std::string> content_flags);
void SetExpansionContext();
};
extern WorldContentService content_service;
+5
View File
@@ -118,6 +118,11 @@ void set_exception_handler() {
#include <unistd.h>
#include <sys/fcntl.h>
#ifdef __FreeBSD__
#include <signal.h>
#include <sys/stat.h>
#endif
void print_trace()
{
auto uid = geteuid();
+1 -1
View File
@@ -23,7 +23,7 @@
#include <algorithm>
#include <cmath>
namespace EQEmu {
namespace EQ {
template<typename T>
T Clamp(const T &value, const T &lower, const T &upper)
{
+276 -147
View File
@@ -61,15 +61,15 @@ Database::Database(const char* host, const char* user, const char* passwd, const
Connect(host, user, passwd, database, port);
}
bool Database::Connect(const char* host, const char* user, const char* passwd, const char* database, uint32 port) {
bool Database::Connect(const char* host, const char* user, const char* passwd, const char* database, uint32 port, std::string connection_label) {
uint32 errnum= 0;
char errbuf[MYSQL_ERRMSG_SIZE];
if (!Open(host, user, passwd, database, port, &errnum, errbuf)) {
LogError("Failed to connect to database: Error: {}", errbuf);
LogError("[MySQL] Connection [{}] Failed to connect to database: Error [{}]", connection_label, errbuf);
return false;
}
else {
LogInfo("Using database [{}] at [{}]:[{}]", database, host,port);
LogInfo("[MySQL] Connection [{}] database [{}] at [{}]:[{}]", connection_label, database, host,port);
return true;
}
}
@@ -339,7 +339,7 @@ bool Database::ReserveName(uint32 account_id, char* name) {
query = StringFormat("INSERT INTO `character_data` SET `account_id` = %i, `name` = '%s'", account_id, name);
results = QueryDatabase(query);
if (!results.Success() || results.ErrorMessage() != ""){ return false; }
// Put character into the default guild if rule is being used.
int guild_id = RuleI(Character, DefaultGuild);
@@ -353,7 +353,7 @@ bool Database::ReserveName(uint32 account_id, char* name) {
}
}
}
return true;
}
@@ -512,96 +512,96 @@ bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, Playe
"guild_auto_consent,"
"RestTimer) "
"VALUES ("
"%u," // id
"%u," // account_id
"'%s'," // `name`
"'%s'," // last_name
"%u," // gender
"%u," // race
"%u," // class
"%u," // `level`
"%u," // deity
"%u," // birthday
"%u," // last_login
"%u," // time_played
"%u," // pvp_status
"%u," // level2
"%u," // anon
"%u," // gm
"%u," // intoxication
"%u," // hair_color
"%u," // beard_color
"%u," // eye_color_1
"%u," // eye_color_2
"%u," // hair_style
"%u," // beard
"%u," // ability_time_seconds
"%u," // ability_number
"%u," // ability_time_minutes
"%u," // ability_time_hours
"'%s'," // title
"'%s'," // suffix
"%u," // exp
"%u," // points
"%u," // mana
"%u," // cur_hp
"%u," // str
"%u," // sta
"%u," // cha
"%u," // dex
"%u," // `int`
"%u," // agi
"%u," // wis
"%u," // face
"%f," // y
"%f," // x
"%f," // z
"%f," // heading
"%u," // pvp2
"%u," // pvp_type
"%u," // autosplit_enabled
"%u," // zone_change_count
"%u," // drakkin_heritage
"%u," // drakkin_tattoo
"%u," // drakkin_details
"%i," // toxicity
"%i," // hunger_level
"%i," // thirst_level
"%u," // ability_up
"%u," // zone_id
"%u," // zone_instance
"%u," // leadership_exp_on
"%u," // ldon_points_guk
"%u," // ldon_points_mir
"%u," // ldon_points_mmc
"%u," // ldon_points_ruj
"%u," // ldon_points_tak
"%u," // ldon_points_available
"%u," // id
"%u," // account_id
"'%s'," // `name`
"'%s'," // last_name
"%u," // gender
"%u," // race
"%u," // class
"%u," // `level`
"%u," // deity
"%u," // birthday
"%u," // last_login
"%u," // time_played
"%u," // pvp_status
"%u," // level2
"%u," // anon
"%u," // gm
"%u," // intoxication
"%u," // hair_color
"%u," // beard_color
"%u," // eye_color_1
"%u," // eye_color_2
"%u," // hair_style
"%u," // beard
"%u," // ability_time_seconds
"%u," // ability_number
"%u," // ability_time_minutes
"%u," // ability_time_hours
"'%s'," // title
"'%s'," // suffix
"%u," // exp
"%u," // points
"%u," // mana
"%u," // cur_hp
"%u," // str
"%u," // sta
"%u," // cha
"%u," // dex
"%u," // `int`
"%u," // agi
"%u," // wis
"%u," // face
"%f," // y
"%f," // x
"%f," // z
"%f," // heading
"%u," // pvp2
"%u," // pvp_type
"%u," // autosplit_enabled
"%u," // zone_change_count
"%u," // drakkin_heritage
"%u," // drakkin_tattoo
"%u," // drakkin_details
"%i," // toxicity
"%i," // hunger_level
"%i," // thirst_level
"%u," // ability_up
"%u," // zone_id
"%u," // zone_instance
"%u," // leadership_exp_on
"%u," // ldon_points_guk
"%u," // ldon_points_mir
"%u," // ldon_points_mmc
"%u," // ldon_points_ruj
"%u," // ldon_points_tak
"%u," // ldon_points_available
"%u," // tribute_time_remaining
"%u," // show_helm
"%u," // career_tribute_points
"%u," // tribute_points
"%u," // tribute_active
"%u," // endurance
"%u," // group_leadership_exp
"%u," // raid_leadership_exp
"%u," // show_helm
"%u," // career_tribute_points
"%u," // tribute_points
"%u," // tribute_active
"%u," // endurance
"%u," // group_leadership_exp
"%u," // raid_leadership_exp
"%u," // group_leadership_point
"%u," // raid_leadership_points
"%u," // air_remaining
"%u," // pvp_kills
"%u," // pvp_deaths
"%u," // pvp_current_points
"%u," // pvp_career_points
"%u," // pvp_best_kill_streak
"%u," // air_remaining
"%u," // pvp_kills
"%u," // pvp_deaths
"%u," // pvp_current_points
"%u," // pvp_career_points
"%u," // pvp_best_kill_streak
"%u," // pvp_worst_death_streak
"%u," // pvp_current_kill_strea
"%u," // aa_points_spent
"%u," // aa_exp
"%u," // aa_points
"%u," // group_auto_consent
"%u," // raid_auto_consent
"%u," // guild_auto_consent
"%u" // RestTimer
"%u," // aa_points_spent
"%u," // aa_exp
"%u," // aa_points
"%u," // group_auto_consent
"%u," // raid_auto_consent
"%u," // guild_auto_consent
"%u" // RestTimer
")",
character_id, // " id, "
account_id, // " account_id, "
@@ -870,6 +870,38 @@ void Database::GetCharName(uint32 char_id, char* name) {
}
}
const char* Database::GetCharNameByID(uint32 char_id) {
std::string query = fmt::format("SELECT `name` FROM `character_data` WHERE id = {}", char_id);
auto results = QueryDatabase(query);
if (!results.Success()) {
return "";
}
if (results.RowCount() == 0) {
return "";
}
auto row = results.begin();
return row[0];
}
const char* Database::GetNPCNameByID(uint32 npc_id) {
std::string query = fmt::format("SELECT `name` FROM `npc_types` WHERE id = {}", npc_id);
auto results = QueryDatabase(query);
if (!results.Success()) {
return "";
}
if (results.RowCount() == 0) {
return "";
}
auto row = results.begin();
return row[0];
}
bool Database::LoadVariables() {
auto results = QueryDatabase(StringFormat("SELECT varname, value, unix_timestamp() FROM variables where unix_timestamp(ts) >= %d", varcache.last_update));
@@ -1050,50 +1082,6 @@ bool Database::GetZoneGraveyard(const uint32 graveyard_id, uint32* graveyard_zon
return true;
}
bool Database::LoadZoneNames() {
std::string query("SELECT zoneidnumber, short_name FROM zone");
auto results = QueryDatabase(query);
if (!results.Success())
{
return false;
}
for (auto row= results.begin();row != results.end();++row)
{
uint32 zoneid = atoi(row[0]);
std::string zonename = row[1];
zonename_array.insert(std::pair<uint32,std::string>(zoneid,zonename));
}
return true;
}
uint32 Database::GetZoneID(const char* zonename) {
if (zonename == nullptr)
return 0;
for (auto & iter : zonename_array)
if (strcasecmp(iter.second.c_str(), zonename) == 0)
return iter.first;
return 0;
}
const char* Database::GetZoneName(uint32 zoneID, bool ErrorUnknown) {
auto iter = zonename_array.find(zoneID);
if (iter != zonename_array.end())
return iter->second.c_str();
if (ErrorUnknown)
return "UNKNOWN";
return 0;
}
uint8 Database::GetPEQZone(uint32 zoneID, uint32 version){
std::string query = StringFormat("SELECT peqzone from zone where zoneidnumber='%i' AND (version=%i OR version=0) ORDER BY version DESC", zoneID, version);
@@ -1310,29 +1298,31 @@ uint8 Database::GetServerType() {
return atoi(row[0]);
}
bool Database::MoveCharacterToZone(const char* charname, const char* zonename, uint32 zoneid) {
if(zonename == nullptr || strlen(zonename) == 0)
return false;
bool Database::MoveCharacterToZone(uint32 character_id, uint32 zone_id)
{
std::string query = StringFormat(
"UPDATE `character_data` SET `zone_id` = %i, `x` = -1, `y` = -1, `z` = -1 WHERE `id` = %i",
zone_id,
character_id
);
std::string query = StringFormat("UPDATE `character_data` SET `zone_id` = %i, `x` = -1, `y` = -1, `z` = -1 WHERE `name` = '%s'", zoneid, charname);
auto results = QueryDatabase(query);
if (!results.Success()) {
return false;
}
if (results.RowsAffected() == 0)
return false;
return true;
return results.RowsAffected() != 0;
}
bool Database::MoveCharacterToZone(const char* charname, const char* zonename) {
return MoveCharacterToZone(charname, zonename, GetZoneID(zonename));
}
bool Database::MoveCharacterToZone(const char *charname, uint32 zone_id)
{
std::string query = StringFormat(
"UPDATE `character_data` SET `zone_id` = %i, `x` = -1, `y` = -1, `z` = -1 WHERE `name` = '%s'",
zone_id,
charname
);
bool Database::MoveCharacterToZone(uint32 iCharID, const char* iZonename) {
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()) {
@@ -2318,3 +2308,142 @@ int Database::GetInstanceID(uint32 char_id, uint32 zone_id) {
return 0;
}
/**
* @param source_character_name
* @param destination_character_name
* @param destination_account_name
* @return
*/
bool Database::CopyCharacter(
std::string source_character_name,
std::string destination_character_name,
std::string destination_account_name
)
{
auto results = QueryDatabase(
fmt::format(
"SELECT id FROM character_data WHERE name = '{}' and deleted_at is NULL LIMIT 1",
source_character_name
)
);
if (results.RowCount() == 0) {
LogError("No character found with name [{}]", source_character_name);
}
auto row = results.begin();
std::string source_character_id = row[0];
results = QueryDatabase(
fmt::format(
"SELECT id FROM account WHERE name = '{}' LIMIT 1",
destination_account_name
)
);
if (results.RowCount() == 0) {
LogError("No account found with name [{}]", destination_account_name);
}
row = results.begin();
std::string source_account_id = row[0];
/**
* Fresh ID
*/
results = QueryDatabase("SELECT (MAX(id) + 1) as new_id from character_data");
row = results.begin();
std::string new_character_id = row[0];
TransactionBegin();
for (const auto &iter : DatabaseSchema::GetCharacterTables()) {
std::string table_name = iter.first;
std::string character_id_column_name = iter.second;
/**
* Columns
*/
results = QueryDatabase(fmt::format("SHOW COLUMNS FROM {}", table_name));
std::vector<std::string> columns = {};
int column_count = 0;
for (row = results.begin(); row != results.end(); ++row) {
columns.emplace_back(row[0]);
column_count++;
}
results = QueryDatabase(
fmt::format(
"SELECT {} FROM {} WHERE {} = {}",
implode(",", wrap(columns, "`")),
table_name,
character_id_column_name,
source_character_id
)
);
std::vector<std::vector<std::string>> new_rows;
for (row = results.begin(); row != results.end(); ++row) {
std::vector<std::string> new_values = {};
for (int column_index = 0; column_index < column_count; column_index++) {
std::string column = columns[column_index];
std::string value = row[column_index] ? row[column_index] : "null";
if (column == character_id_column_name) {
value = new_character_id;
}
if (column == "name" && table_name == "character_data") {
value = destination_character_name;
}
if (column == "account_id" && table_name == "character_data") {
value = source_account_id;
}
new_values.emplace_back(value);
}
new_rows.emplace_back(new_values);
}
std::string insert_values;
std::vector<std::string> insert_rows;
for (auto &r: new_rows) {
std::string insert_row = "(" + implode(",", wrap(r, "'")) + ")";
insert_rows.emplace_back(insert_row);
}
if (!insert_rows.empty()) {
QueryDatabase(
fmt::format(
"DELETE FROM {} WHERE {} = {}",
table_name,
character_id_column_name,
new_character_id
)
);
auto insert = QueryDatabase(
fmt::format(
"INSERT INTO {} ({}) VALUES {}",
table_name,
implode(",", wrap(columns, "`")),
implode(",", insert_rows)
)
);
if (!insert.ErrorMessage().empty()) {
TransactionRollback();
return false;
break;
}
}
}
TransactionCommit();
return true;
}
+37 -24
View File
@@ -40,7 +40,7 @@
class MySQLRequestResult;
class Client;
namespace EQEmu
namespace EQ
{
class InventoryProfile;
}
@@ -100,22 +100,40 @@ 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, std::string connection_label = "default");
~Database();
/* Character Creation */
bool AddToNameFilter(const char* name);
bool CreateCharacter(uint32 account_id, char* name, uint16 gender, uint16 race, uint16 class_, uint8 str, uint8 sta, uint8 cha, uint8 dex, uint8 int_, uint8 agi, uint8 wis, uint8 face);
bool DeleteCharacter(char* character_name);
bool MoveCharacterToZone(const char* charname, const char* zonename);
bool MoveCharacterToZone(const char* charname, const char* zonename,uint32 zoneid);
bool MoveCharacterToZone(uint32 iCharID, const char* iZonename);
bool ReserveName(uint32 account_id, char* name);
bool SaveCharacterCreate(uint32 character_id, uint32 account_id, PlayerProfile_Struct* pp);
bool SetHackerFlag(const char* accountname, const char* charactername, const char* hacked);
bool SetMQDetectionFlag(const char* accountname, const char* charactername, const char* hacked, const char* zone);
bool UpdateName(const char* oldname, const char* newname);
bool AddToNameFilter(const char *name);
bool CreateCharacter(
uint32 account_id,
char *name,
uint16 gender,
uint16 race,
uint16 class_,
uint8 str,
uint8 sta,
uint8 cha,
uint8 dex,
uint8 int_,
uint8 agi,
uint8 wis,
uint8 face
);
bool DeleteCharacter(char *character_name);
bool MoveCharacterToZone(const char *charname, uint32 zone_id);
bool MoveCharacterToZone(uint32 character_id, uint32 zone_id);
bool ReserveName(uint32 account_id, char *name);
bool SaveCharacterCreate(uint32 character_id, uint32 account_id, PlayerProfile_Struct *pp);
bool SetHackerFlag(const char *accountname, const char *charactername, const char *hacked);
bool SetMQDetectionFlag(const char *accountname, const char *charactername, const char *hacked, const char *zone);
bool UpdateName(const char *oldname, const char *newname);
bool CopyCharacter(
std::string source_character_name,
std::string destination_character_name,
std::string destination_account_name
);
/* General Information Queries */
@@ -137,6 +155,8 @@ public:
void GetAccountName(uint32 accountid, char* name, uint32* oLSAccountID = 0);
void GetCharName(uint32 char_id, char* name);
const char *GetCharNameByID(uint32 char_id);
const char *GetNPCNameByID(uint32 npc_id);
void LoginIP(uint32 AccountID, const char* LoginIP);
/* Instancing */
@@ -153,7 +173,6 @@ public:
bool VerifyInstanceAlive(uint16 instance_id, uint32 char_id);
bool VerifyZoneInstance(uint32 zone_id, uint16 instance_id);
uint16 GetInstanceID(const char* zone, uint32 charid, int16 version);
uint16 GetInstanceID(uint32 zone, uint32 charid, int16 version);
uint16 GetInstanceVersion(uint16 instance_id);
uint32 GetTimeRemainingInstance(uint16 instance_id, bool &is_perma);
@@ -193,19 +212,19 @@ public:
void GetAccountFromID(uint32 id, char* oAccountName, int16* oStatus);
void SetAgreementFlag(uint32 acctid);
int GetIPExemption(std::string account_ip);
int GetInstanceID(uint32 char_id, uint32 zone_id);
/* Groups */
char* GetGroupLeaderForLogin(const char* name,char* leaderbuf);
char* GetGroupLeadershipInfo(uint32 gid, char* leaderbuf, char* maintank = nullptr, char* assist = nullptr, char* puller = nullptr, char *marknpc = nullptr, char *mentoree = nullptr, int *mentor_percent = nullptr, GroupLeadershipAA_Struct* GLAA = nullptr);
uint32 GetGroupID(const char* name);
void ClearGroup(uint32 gid = 0);
void ClearGroupLeader(uint32 gid = 0);
void SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ismerc = false);
@@ -241,16 +260,11 @@ public:
/* General Queries */
bool GetSafePoints(const char* short_name, uint32 version, float* safe_x = 0, float* safe_y = 0, float* safe_z = 0, int16* minstatus = 0, uint8* minlevel = 0, char *flag_needed = nullptr);
bool GetSafePoints(uint32 zoneID, uint32 version, float* safe_x = 0, float* safe_y = 0, float* safe_z = 0, int16* minstatus = 0, uint8* minlevel = 0, char *flag_needed = nullptr) { return GetSafePoints(GetZoneName(zoneID), version, safe_x, safe_y, safe_z, minstatus, minlevel, flag_needed); }
bool GetZoneGraveyard(const uint32 graveyard_id, uint32* graveyard_zoneid = 0, float* graveyard_x = 0, float* graveyard_y = 0, float* graveyard_z = 0, float* graveyard_heading = 0);
bool GetZoneLongName(const char* short_name, char** long_name, char* file_name = 0, float* safe_x = 0, float* safe_y = 0, float* safe_z = 0, uint32* graveyard_id = 0, uint32* maxclients = 0);
bool LoadPTimers(uint32 charid, PTimerList &into);
bool LoadZoneNames();
const char* GetZoneName(uint32 zoneID, bool ErrorUnknown = false);
uint32 GetZoneGraveyardID(uint32 zone_id, uint32 version);
uint32 GetZoneID(const char* zonename);
uint8 GetPEQZone(uint32 zoneID, uint32 version);
uint8 GetRaceSkill(uint8 skillid, uint8 in_race);
@@ -274,7 +288,6 @@ public:
void LoadLogSettings(EQEmuLogSys::LogSettings* log_settings);
private:
std::map<uint32,std::string> zonename_array;
Mutex Mvarcache;
VarCache_Struct varcache;
+19 -6
View File
@@ -50,7 +50,11 @@ std::string DatabaseDumpService::execute(const std::string &cmd, bool return_res
const char *file_name = "db-exec-result.txt";
if (return_result) {
#ifdef _WINDOWS
std::system((cmd + " > " + file_name + " 2>&1").c_str());
#else
std::system((cmd + " > " + file_name).c_str());
#endif
}
else {
std::system((cmd).c_str());
@@ -95,7 +99,7 @@ bool DatabaseDumpService::IsTarAvailable()
*/
bool DatabaseDumpService::Is7ZipAvailable()
{
std::string version_output = execute("7z -help");
std::string version_output = execute("7z --help");
return version_output.find("7-Zip") != std::string::npos;
}
@@ -124,12 +128,23 @@ std::string DatabaseDumpService::GetMySQLVersion()
std::string DatabaseDumpService::GetBaseMySQLDumpCommand()
{
auto config = EQEmuConfig::get();
if (IsDumpContentTables() && !config->ContentDbHost.empty()) {
return fmt::format(
"mysqldump -u {} -p{} -h {} --port={} {}",
config->ContentDbUsername,
config->ContentDbPassword,
config->ContentDbHost,
config->ContentDbPort,
config->ContentDbName
);
};
return fmt::format(
"mysqldump -u {} -p{} -h {} {}",
"mysqldump -u {} -p{} -h {} --port={} {}",
config->DatabaseUsername,
config->DatabasePassword,
config->DatabaseHost,
config->DatabasePort,
config->DatabaseDB
);
}
@@ -285,8 +300,7 @@ void DatabaseDumpService::Dump()
config->DatabaseUsername
);
std::string options = "--allow-keywords --extended-insert";
std::string options = "--allow-keywords --extended-insert --max-allowed-packet=1G --net-buffer-length=32704";
if (IsDumpWithNoData()) {
options += " --no-data";
}
@@ -396,9 +410,8 @@ void DatabaseDumpService::Dump()
else if (Is7ZipAvailable()) {
execute(
fmt::format(
"7z a -t7z {}.zip -C {} {}.sql",
"7z a -t7z {}.zip {}.sql",
GetDumpFileNameWithPath(),
GetSetDumpPath(),
GetDumpFileNameWithPath()
)
);
+4 -4
View File
@@ -189,7 +189,7 @@ namespace Convert {
/*002*/ uint32 HP;
/*006*/ uint32 Mana;
/*010*/ Convert::SpellBuff_Struct Buffs[BUFF_COUNT];
/*510*/ uint32 Items[EQEmu::textures::materialCount];
/*510*/ uint32 Items[EQ::textures::materialCount];
/*546*/ char Name[64];
/*610*/
};
@@ -230,9 +230,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[EQEmu::textures::materialCount]; // Item texture/material of worn/held items
/*0312*/ uint32 item_material[EQ::textures::materialCount]; // Item texture/material of worn/held items
/*0348*/ uint8 unknown0348[44];
/*0392*/ Convert::Color_Struct item_tint[EQEmu::textures::materialCount];
/*0392*/ Convert::Color_Struct item_tint[EQ::textures::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
@@ -1396,7 +1396,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){
if (rquery != ""){ results = QueryDatabase(rquery); }
/* Run Material Color Convert */
first_entry = 0; rquery = "";
for (i = EQEmu::textures::textureBegin; i < EQEmu::textures::materialCount; i++){
for (i = EQ::textures::textureBegin; i < EQ::textures::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);
+111 -80
View File
@@ -34,6 +34,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define strcasecmp _stricmp
#else
#include "unix.h"
#include "../zone/zonedb.h"
#include <netinet/in.h>
#include <sys/time.h>
#endif
@@ -97,42 +98,53 @@ bool Database::CheckInstanceExists(uint16 instance_id) {
bool Database::CheckInstanceExpired(uint16 instance_id)
{
int32 start_time = 0;
int32 duration = 0;
int32 start_time = 0;
int32 duration = 0;
uint32 never_expires = 0;
std::string query = StringFormat("SELECT start_time, duration, never_expires FROM instance_list WHERE id=%u", instance_id);
std::string query = StringFormat(
"SELECT start_time, duration, never_expires FROM instance_list WHERE id=%u",
instance_id
);
auto results = QueryDatabase(query);
if (!results.Success())
if (!results.Success()) {
return true;
}
if (results.RowCount() == 0)
if (results.RowCount() == 0) {
return true;
}
auto row = results.begin();
start_time = atoi(row[0]);
duration = atoi(row[1]);
start_time = atoi(row[0]);
duration = atoi(row[1]);
never_expires = atoi(row[2]);
if (never_expires == 1)
if (never_expires == 1) {
return false;
}
timeval tv;
timeval tv{};
gettimeofday(&tv, nullptr);
if ((start_time + duration) <= tv.tv_sec)
return true;
return (start_time + duration) <= tv.tv_sec;
return false;
}
bool Database::CreateInstance(uint16 instance_id, uint32 zone_id, uint32 version, uint32 duration)
{
std::string query = StringFormat("INSERT INTO instance_list (id, zone, version, start_time, duration)"
" values(%lu, %lu, %lu, UNIX_TIMESTAMP(), %lu)",
(unsigned long)instance_id, (unsigned long)zone_id, (unsigned long)version, (unsigned long)duration);
std::string query = StringFormat(
"INSERT INTO instance_list (id, zone, version, start_time, duration)"
" values (%u, %u, %u, UNIX_TIMESTAMP(), %u)",
instance_id,
zone_id,
version,
duration
);
auto results = QueryDatabase(query);
return results.Success();
@@ -140,66 +152,84 @@ bool Database::CreateInstance(uint16 instance_id, uint32 zone_id, uint32 version
bool Database::GetUnusedInstanceID(uint16 &instance_id)
{
uint32 count = RuleI(Zone, ReservedInstances);
uint32 max = 65535;
uint32 max_reserved_instance_id = RuleI(Instances, ReservedInstances);
uint32 max = 32000;
std::string query = StringFormat(
"SELECT IFNULL(MAX(id),%u)+1 FROM instance_list WHERE id > %u",
max_reserved_instance_id,
max_reserved_instance_id
);
if (RuleB(Instances, RecycleInstanceIds)) {
query = (
SQL(
SELECT i.id + 1 AS next_available
FROM instance_list i
LEFT JOIN instance_list i2 ON i2.id = i.id + 1
WHERE i2.id IS NULL
ORDER BY i.id
LIMIT 0, 1;
)
);
}
std::string query = StringFormat("SELECT IFNULL(MAX(id),%u)+1 FROM instance_list WHERE id > %u", count, count);
auto results = QueryDatabase(query);
if (!results.Success())
{
if (!results.Success()) {
instance_id = 0;
return false;
}
if (results.RowCount() == 0)
{
instance_id = 0;
return false;
if (results.RowCount() == 0) {
instance_id = max_reserved_instance_id;
return true;
}
auto row = results.begin();
if (atoi(row[0]) <= max)
{
if (atoi(row[0]) <= max) {
instance_id = atoi(row[0]);
return true;
}
query = StringFormat("SELECT id FROM instance_list where id > %u ORDER BY id", count);
if (instance_id < max_reserved_instance_id) {
instance_id = max_reserved_instance_id;
return true;
}
query = StringFormat("SELECT id FROM instance_list where id > %u ORDER BY id", max_reserved_instance_id);
results = QueryDatabase(query);
if (!results.Success())
{
if (!results.Success()) {
instance_id = 0;
return false;
}
if (results.RowCount() == 0)
{
if (results.RowCount() == 0) {
instance_id = 0;
return false;
}
count++;
for (auto row = results.begin(); row != results.end(); ++row)
{
if (count < atoi(row[0]))
{
instance_id = count;
max_reserved_instance_id++;
for (auto row = results.begin(); row != results.end(); ++row) {
if (max_reserved_instance_id < atoi(row[0])) {
instance_id = max_reserved_instance_id;
return true;
}
if (count > max)
{
if (max_reserved_instance_id > max) {
instance_id = 0;
return false;
}
count++;
max_reserved_instance_id++;
}
instance_id = count;
instance_id = max_reserved_instance_id;
return true;
}
@@ -276,36 +306,6 @@ bool Database::VerifyZoneInstance(uint32 zone_id, uint16 instance_id)
return true;
}
uint16 Database::GetInstanceID(const char* zone, uint32 character_id, int16 version) {
std::string query = StringFormat(
"SELECT "
"instance_list.id "
"FROM "
"instance_list, "
"instance_list_player "
"WHERE "
"instance_list.zone = %u "
"AND instance_list.version = %u "
"AND instance_list.id = instance_list_player.id "
"AND instance_list_player.charid = %u "
"LIMIT 1 ",
GetZoneID(zone),
version,
character_id
);
auto results = QueryDatabase(query);
if (!results.Success())
return 0;
if (results.RowCount() == 0)
return 0;
auto row = results.begin();
return atoi(row[0]);
}
uint16 Database::GetInstanceID(uint32 zone, uint32 character_id, int16 version)
{
if (!zone)
@@ -482,9 +482,8 @@ void Database::BuryCorpsesInInstance(uint16 instance_id) {
void Database::DeleteInstance(uint16 instance_id)
{
std::string query = StringFormat("DELETE FROM instance_list WHERE id=%u", instance_id);
QueryDatabase(query);
std::string query;
query = StringFormat("DELETE FROM instance_list_player WHERE id=%u", instance_id);
QueryDatabase(query);
@@ -494,6 +493,9 @@ void Database::DeleteInstance(uint16 instance_id)
query = StringFormat("DELETE FROM spawn_condition_values WHERE instance_id=%u", instance_id);
QueryDatabase(query);
query = fmt::format("DELETE FROM dynamic_zones WHERE instance_id={}", instance_id);
QueryDatabase(query);
BuryCorpsesInInstance(instance_id);
}
@@ -544,17 +546,46 @@ void Database::GetCharactersInInstance(uint16 instance_id, std::list<uint32> &ch
void Database::PurgeExpiredInstances()
{
std::string query("SELECT id FROM instance_list where (start_time+duration) <= UNIX_TIMESTAMP() and never_expires = 0");
/**
* Delay purging by a day so that we can continue using adjacent free instance id's
* from the table without risking the chance we immediately re-allocate a zone that freshly expired but
* has not been fully de-allocated
*/
std::string query =
SQL(
SELECT
id
FROM
instance_list
where
(start_time + duration) <= (UNIX_TIMESTAMP() - 86400)
and never_expires = 0
);
auto results = QueryDatabase(query);
if (!results.Success())
if (!results.Success()) {
return;
}
if (results.RowCount() == 0)
if (results.RowCount() == 0) {
return;
}
for (auto row = results.begin(); row != results.end(); ++row)
DeleteInstance(atoi(row[0]));
std::vector<std::string> instance_ids;
for (auto row = results.begin(); row != results.end(); ++row) {
instance_ids.emplace_back(row[0]);
}
std::string imploded_instance_ids = implode(",", instance_ids);
QueryDatabase(fmt::format("DELETE FROM instance_list WHERE id IN ({})", imploded_instance_ids));
QueryDatabase(fmt::format("DELETE FROM instance_list_player WHERE id IN ({})", imploded_instance_ids));
QueryDatabase(fmt::format("DELETE FROM respawn_times WHERE instance_id IN ({})", imploded_instance_ids));
QueryDatabase(fmt::format("DELETE FROM spawn_condition_values WHERE instance_id IN ({})", imploded_instance_ids));
QueryDatabase(fmt::format("UPDATE character_corpses SET is_buried = 1, instance_id = 0 WHERE instance_id IN ({})", imploded_instance_ids));
QueryDatabase(fmt::format("DELETE FROM dynamic_zones WHERE instance_id IN ({})", imploded_instance_ids));
}
void Database::SetInstanceDuration(uint16 instance_id, uint32 new_duration)
@@ -562,4 +593,4 @@ void Database::SetInstanceDuration(uint16 instance_id, uint32 new_duration)
std::string query = StringFormat("UPDATE `instance_list` SET start_time=UNIX_TIMESTAMP(), "
"duration=%u WHERE id=%u", new_duration, instance_id);
auto results = QueryDatabase(query);
}
}
+9 -1
View File
@@ -50,6 +50,7 @@ namespace DatabaseSchema {
{"character_data", "id"},
{"character_disciplines", "id"},
{"character_enabledtasks", "charid"},
{"character_expedition_lockouts", "character_id"},
{"character_inspect_messages", "id"},
{"character_item_recast", "id"},
{"character_languages", "id"},
@@ -114,6 +115,7 @@ namespace DatabaseSchema {
"character_data",
"character_disciplines",
"character_enabledtasks",
"character_expedition_lockouts",
"character_inspect_messages",
"character_item_recast",
"character_languages",
@@ -179,6 +181,7 @@ namespace DatabaseSchema {
"books",
"char_create_combinations",
"char_create_point_allocations",
"damageshieldtypes",
"doors",
"faction_base_data",
"faction_list",
@@ -218,7 +221,6 @@ namespace DatabaseSchema {
"skill_caps",
"spawn2",
"spawn_conditions",
"spawn_events",
"spawnentry",
"spawngroup",
"spells_new",
@@ -248,11 +250,13 @@ namespace DatabaseSchema {
return {
"chatchannels",
"command_settings",
"content_flags",
"db_str",
"eqtime",
"launcher",
"launcher_zones",
"spawn_condition_values",
"spawn_events",
"level_exp_mods",
"logsys_categories",
"name_filter",
@@ -303,7 +307,11 @@ namespace DatabaseSchema {
"banned_ips",
"bug_reports",
"bugs",
"dynamic_zones",
"eventlog",
"expedition_lockouts",
"expedition_members",
"expeditions",
"gm_ips",
"group_id",
"group_leaders",
+12 -1
View File
@@ -51,7 +51,11 @@ DBcore::~DBcore()
* are re-using the default database connection pointer when we dont have an
* external configuration setup ex: (content_database)
*/
std::string mysql_connection_host = mysql.host;
std::string mysql_connection_host;
if (mysql.host) {
mysql_connection_host = mysql.host;
}
if (GetOriginHost() != mysql_connection_host) {
return;
}
@@ -79,6 +83,13 @@ MySQLRequestResult DBcore::QueryDatabase(std::string query, bool retryOnFailureO
return QueryDatabase(query.c_str(), query.length(), retryOnFailureOnce);
}
bool DBcore::DoesTableExist(std::string table_name)
{
auto results = QueryDatabase(fmt::format("SHOW TABLES LIKE '{}'", table_name));
return results.RowCount() > 0;
}
MySQLRequestResult DBcore::QueryDatabase(const char *query, uint32 querylen, bool retryOnFailureOnce)
{
BenchTimer timer;
+2
View File
@@ -35,6 +35,8 @@ public:
const std::string &GetOriginHost() const;
void SetOriginHost(const std::string &origin_host);
bool DoesTableExist(std::string table_name);
protected:
bool Open(
const char *iHost,
+3 -3
View File
@@ -20,7 +20,7 @@
#include "deity.h"
EQEmu::deity::DeityTypeBit EQEmu::deity::ConvertDeityTypeToDeityTypeBit(DeityType deity_type)
EQ::deity::DeityTypeBit EQ::deity::ConvertDeityTypeToDeityTypeBit(DeityType deity_type)
{
switch (deity_type) {
case DeityBertoxxulous:
@@ -63,7 +63,7 @@ EQEmu::deity::DeityTypeBit EQEmu::deity::ConvertDeityTypeToDeityTypeBit(DeityTyp
};
}
EQEmu::deity::DeityType EQEmu::deity::ConvertDeityTypeBitToDeityType(DeityTypeBit deity_type_bit)
EQ::deity::DeityType EQ::deity::ConvertDeityTypeBitToDeityType(DeityTypeBit deity_type_bit)
{
switch (deity_type_bit) {
case bit_DeityAgnostic:
@@ -105,7 +105,7 @@ EQEmu::deity::DeityType EQEmu::deity::ConvertDeityTypeBitToDeityType(DeityTypeBi
};
}
const char* EQEmu::deity::DeityName(DeityType deity_type)
const char* EQ::deity::DeityName(DeityType deity_type)
{
switch (deity_type) {
case DeityBertoxxulous:
+1 -1
View File
@@ -23,7 +23,7 @@
#include "types.h"
namespace EQEmu
namespace EQ
{
namespace deity {
enum DeityType {
+7 -7
View File
@@ -20,7 +20,7 @@
#include "emu_constants.h"
int16 EQEmu::invtype::GetInvTypeSize(int16 inv_type) {
int16 EQ::invtype::GetInvTypeSize(int16 inv_type) {
static const int16 local_array[] = {
POSSESSIONS_SIZE,
BANK_SIZE,
@@ -55,7 +55,7 @@ int16 EQEmu::invtype::GetInvTypeSize(int16 inv_type) {
return local_array[inv_type];
}
const char* EQEmu::bug::CategoryIDToCategoryName(CategoryID category_id) {
const char* EQ::bug::CategoryIDToCategoryName(CategoryID category_id) {
switch (category_id) {
case catVideo:
return "Video";
@@ -87,7 +87,7 @@ const char* EQEmu::bug::CategoryIDToCategoryName(CategoryID category_id) {
}
}
EQEmu::bug::CategoryID EQEmu::bug::CategoryNameToCategoryID(const char* category_name) {
EQ::bug::CategoryID EQ::bug::CategoryNameToCategoryID(const char* category_name) {
if (!category_name)
return catOther;
@@ -119,7 +119,7 @@ EQEmu::bug::CategoryID EQEmu::bug::CategoryNameToCategoryID(const char* category
return catOther;
}
const char *EQEmu::constants::GetStanceName(StanceType stance_type) {
const char *EQ::constants::GetStanceName(StanceType stance_type) {
switch (stance_type) {
case stanceUnknown:
return "Unknown";
@@ -146,9 +146,9 @@ const char *EQEmu::constants::GetStanceName(StanceType stance_type) {
}
}
int EQEmu::constants::ConvertStanceTypeToIndex(StanceType stance_type) {
if (stance_type >= EQEmu::constants::stancePassive && stance_type <= EQEmu::constants::stanceBurnAE)
return (stance_type - EQEmu::constants::stancePassive);
int EQ::constants::ConvertStanceTypeToIndex(StanceType stance_type) {
if (stance_type >= EQ::constants::stancePassive && stance_type <= EQ::constants::stanceBurnAE)
return (stance_type - EQ::constants::stancePassive);
return 0;
}
+3 -3
View File
@@ -27,7 +27,7 @@
// local definitions are the result of using hybrid-client or server-only values and methods
namespace EQEmu
namespace EQ
{
using RoF2::IINVALID;
using RoF2::INULL;
@@ -193,7 +193,7 @@ namespace EQEmu
} // namespace invaug
namespace constants {
const EQEmu::versions::ClientVersion CHARACTER_CREATION_CLIENT = EQEmu::versions::ClientVersion::Titanium;
const EQ::versions::ClientVersion CHARACTER_CREATION_CLIENT = EQ::versions::ClientVersion::Titanium;
using RoF2::constants::EXPANSION;
using RoF2::constants::EXPANSION_BIT;
@@ -332,6 +332,6 @@ namespace EQEmu
/* hack list to prevent circular references
eq_limits.h:EQEmu::inventory::LookupEntry::InventoryTypeSize[n];
eq_limits.h:EQ::inventory::LookupEntry::InventoryTypeSize[n];
*/
+8 -5
View File
@@ -136,20 +136,22 @@ N(OP_Dye),
N(OP_DynamicWall),
N(OP_DzAddPlayer),
N(OP_DzChooseZone),
N(OP_DzChooseZoneReply),
N(OP_DzCompass),
N(OP_DzExpeditionEndsWarning),
N(OP_DzExpeditionInfo),
N(OP_DzExpeditionList),
N(OP_DzJoinExpeditionConfirm),
N(OP_DzJoinExpeditionReply),
N(OP_DzLeaderStatus),
N(OP_DzExpeditionInvite),
N(OP_DzExpeditionInviteResponse),
N(OP_DzExpeditionLockoutTimers),
N(OP_DzListTimers),
N(OP_DzMakeLeader),
N(OP_DzMemberList),
N(OP_DzMemberStatus),
N(OP_DzMemberListName),
N(OP_DzMemberListStatus),
N(OP_DzPlayerList),
N(OP_DzQuit),
N(OP_DzRemovePlayer),
N(OP_DzSetLeaderName),
N(OP_DzSwapPlayer),
N(OP_Emote),
N(OP_EndLootRequest),
@@ -271,6 +273,7 @@ N(OP_ItemVerifyRequest),
N(OP_ItemViewUnknown),
N(OP_Jump),
N(OP_KeyRing),
N(OP_KickPlayers),
N(OP_KnowledgeBase),
N(OP_LDoNButton),
N(OP_LDoNDisarmTraps),
+31 -31
View File
@@ -21,7 +21,7 @@
#include "emu_constants.h"
bool EQEmu::versions::IsValidClientVersion(ClientVersion client_version)
bool EQ::versions::IsValidClientVersion(ClientVersion client_version)
{
if (client_version <= ClientVersion::Unknown || client_version > LastClientVersion)
return false;
@@ -29,7 +29,7 @@ bool EQEmu::versions::IsValidClientVersion(ClientVersion client_version)
return true;
}
EQEmu::versions::ClientVersion EQEmu::versions::ValidateClientVersion(ClientVersion client_version)
EQ::versions::ClientVersion EQ::versions::ValidateClientVersion(ClientVersion client_version)
{
if (client_version <= ClientVersion::Unknown || client_version > LastClientVersion)
return ClientVersion::Unknown;
@@ -37,7 +37,7 @@ EQEmu::versions::ClientVersion EQEmu::versions::ValidateClientVersion(ClientVers
return client_version;
}
const char* EQEmu::versions::ClientVersionName(ClientVersion client_version)
const char* EQ::versions::ClientVersionName(ClientVersion client_version)
{
switch (client_version) {
case ClientVersion::Unknown:
@@ -61,7 +61,7 @@ const char* EQEmu::versions::ClientVersionName(ClientVersion client_version)
};
}
uint32 EQEmu::versions::ConvertClientVersionToClientVersionBit(ClientVersion client_version)
uint32 EQ::versions::ConvertClientVersionToClientVersionBit(ClientVersion client_version)
{
switch (client_version) {
case ClientVersion::Titanium:
@@ -81,7 +81,7 @@ uint32 EQEmu::versions::ConvertClientVersionToClientVersionBit(ClientVersion cli
}
}
EQEmu::versions::ClientVersion EQEmu::versions::ConvertClientVersionBitToClientVersion(uint32 client_version_bit)
EQ::versions::ClientVersion EQ::versions::ConvertClientVersionBitToClientVersion(uint32 client_version_bit)
{
switch (client_version_bit) {
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::Titanium) - 1)) :
@@ -101,7 +101,7 @@ EQEmu::versions::ClientVersion EQEmu::versions::ConvertClientVersionBitToClientV
}
}
bool EQEmu::versions::IsValidMobVersion(MobVersion mob_version)
bool EQ::versions::IsValidMobVersion(MobVersion mob_version)
{
if (mob_version <= MobVersion::Unknown || mob_version > LastMobVersion)
return false;
@@ -109,7 +109,7 @@ bool EQEmu::versions::IsValidMobVersion(MobVersion mob_version)
return true;
}
bool EQEmu::versions::IsValidPCMobVersion(MobVersion mob_version)
bool EQ::versions::IsValidPCMobVersion(MobVersion mob_version)
{
if (mob_version <= MobVersion::Unknown || mob_version > LastPCMobVersion)
return false;
@@ -117,7 +117,7 @@ bool EQEmu::versions::IsValidPCMobVersion(MobVersion mob_version)
return true;
}
bool EQEmu::versions::IsValidNonPCMobVersion(MobVersion mob_version)
bool EQ::versions::IsValidNonPCMobVersion(MobVersion mob_version)
{
if (mob_version <= LastPCMobVersion || mob_version > LastNonPCMobVersion)
return false;
@@ -125,7 +125,7 @@ bool EQEmu::versions::IsValidNonPCMobVersion(MobVersion mob_version)
return true;
}
bool EQEmu::versions::IsValidOfflinePCMobVersion(MobVersion mob_version)
bool EQ::versions::IsValidOfflinePCMobVersion(MobVersion mob_version)
{
if (mob_version <= LastNonPCMobVersion || mob_version > LastOfflinePCMobVersion)
return false;
@@ -133,7 +133,7 @@ bool EQEmu::versions::IsValidOfflinePCMobVersion(MobVersion mob_version)
return true;
}
EQEmu::versions::MobVersion EQEmu::versions::ValidateMobVersion(MobVersion mob_version)
EQ::versions::MobVersion EQ::versions::ValidateMobVersion(MobVersion mob_version)
{
if (mob_version <= MobVersion::Unknown || mob_version > LastMobVersion)
return MobVersion::Unknown;
@@ -141,7 +141,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ValidateMobVersion(MobVersion mob_v
return mob_version;
}
EQEmu::versions::MobVersion EQEmu::versions::ValidatePCMobVersion(MobVersion mob_version)
EQ::versions::MobVersion EQ::versions::ValidatePCMobVersion(MobVersion mob_version)
{
if (mob_version <= MobVersion::Unknown || mob_version > LastPCMobVersion)
return MobVersion::Unknown;
@@ -149,7 +149,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ValidatePCMobVersion(MobVersion mob
return mob_version;
}
EQEmu::versions::MobVersion EQEmu::versions::ValidateNonPCMobVersion(MobVersion mob_version)
EQ::versions::MobVersion EQ::versions::ValidateNonPCMobVersion(MobVersion mob_version)
{
if (mob_version <= LastPCMobVersion || mob_version > LastNonPCMobVersion)
return MobVersion::Unknown;
@@ -157,7 +157,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ValidateNonPCMobVersion(MobVersion
return mob_version;
}
EQEmu::versions::MobVersion EQEmu::versions::ValidateOfflinePCMobVersion(MobVersion mob_version)
EQ::versions::MobVersion EQ::versions::ValidateOfflinePCMobVersion(MobVersion mob_version)
{
if (mob_version <= LastNonPCMobVersion || mob_version > LastOfflinePCMobVersion)
return MobVersion::Unknown;
@@ -165,7 +165,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ValidateOfflinePCMobVersion(MobVers
return mob_version;
}
const char* EQEmu::versions::MobVersionName(MobVersion mob_version)
const char* EQ::versions::MobVersionName(MobVersion mob_version)
{
switch (mob_version) {
case MobVersion::Unknown:
@@ -217,7 +217,7 @@ const char* EQEmu::versions::MobVersionName(MobVersion mob_version)
};
}
EQEmu::versions::ClientVersion EQEmu::versions::ConvertMobVersionToClientVersion(MobVersion mob_version)
EQ::versions::ClientVersion EQ::versions::ConvertMobVersionToClientVersion(MobVersion mob_version)
{
switch (mob_version) {
case MobVersion::Unknown:
@@ -240,7 +240,7 @@ EQEmu::versions::ClientVersion EQEmu::versions::ConvertMobVersionToClientVersion
}
}
EQEmu::versions::MobVersion EQEmu::versions::ConvertClientVersionToMobVersion(ClientVersion client_version)
EQ::versions::MobVersion EQ::versions::ConvertClientVersionToMobVersion(ClientVersion client_version)
{
switch (client_version) {
case ClientVersion::Unknown:
@@ -263,7 +263,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ConvertClientVersionToMobVersion(Cl
}
}
EQEmu::versions::MobVersion EQEmu::versions::ConvertPCMobVersionToOfflinePCMobVersion(MobVersion mob_version)
EQ::versions::MobVersion EQ::versions::ConvertPCMobVersionToOfflinePCMobVersion(MobVersion mob_version)
{
switch (mob_version) {
case MobVersion::Titanium:
@@ -283,7 +283,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ConvertPCMobVersionToOfflinePCMobVe
}
}
EQEmu::versions::MobVersion EQEmu::versions::ConvertOfflinePCMobVersionToPCMobVersion(MobVersion mob_version)
EQ::versions::MobVersion EQ::versions::ConvertOfflinePCMobVersionToPCMobVersion(MobVersion mob_version)
{
switch (mob_version) {
case MobVersion::OfflineTitanium:
@@ -303,7 +303,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ConvertOfflinePCMobVersionToPCMobVe
}
}
EQEmu::versions::ClientVersion EQEmu::versions::ConvertOfflinePCMobVersionToClientVersion(MobVersion mob_version)
EQ::versions::ClientVersion EQ::versions::ConvertOfflinePCMobVersionToClientVersion(MobVersion mob_version)
{
switch (mob_version) {
case MobVersion::OfflineTitanium:
@@ -323,7 +323,7 @@ EQEmu::versions::ClientVersion EQEmu::versions::ConvertOfflinePCMobVersionToClie
}
}
EQEmu::versions::MobVersion EQEmu::versions::ConvertClientVersionToOfflinePCMobVersion(ClientVersion client_version)
EQ::versions::MobVersion EQ::versions::ConvertClientVersionToOfflinePCMobVersion(ClientVersion client_version)
{
switch (client_version) {
case ClientVersion::Titanium:
@@ -343,7 +343,7 @@ EQEmu::versions::MobVersion EQEmu::versions::ConvertClientVersionToOfflinePCMobV
}
}
const char* EQEmu::expansions::ExpansionName(Expansion expansion)
const char* EQ::expansions::ExpansionName(Expansion expansion)
{
switch (expansion) {
case Expansion::EverQuest:
@@ -393,12 +393,12 @@ const char* EQEmu::expansions::ExpansionName(Expansion expansion)
}
}
const char* EQEmu::expansions::ExpansionName(uint32 expansion_bit)
const char* EQ::expansions::ExpansionName(uint32 expansion_bit)
{
return ExpansionName(ConvertExpansionBitToExpansion(expansion_bit));
}
uint32 EQEmu::expansions::ConvertExpansionToExpansionBit(Expansion expansion)
uint32 EQ::expansions::ConvertExpansionToExpansionBit(Expansion expansion)
{
switch (expansion) {
case Expansion::RoK:
@@ -446,7 +446,7 @@ uint32 EQEmu::expansions::ConvertExpansionToExpansionBit(Expansion expansion)
}
}
EQEmu::expansions::Expansion EQEmu::expansions::ConvertExpansionBitToExpansion(uint32 expansion_bit)
EQ::expansions::Expansion EQ::expansions::ConvertExpansionBitToExpansion(uint32 expansion_bit)
{
switch (expansion_bit) {
case bitRoK:
@@ -494,7 +494,7 @@ EQEmu::expansions::Expansion EQEmu::expansions::ConvertExpansionBitToExpansion(u
}
}
uint32 EQEmu::expansions::ConvertExpansionToExpansionsMask(Expansion expansion)
uint32 EQ::expansions::ConvertExpansionToExpansionsMask(Expansion expansion)
{
switch (expansion) {
case Expansion::RoK:
@@ -542,17 +542,17 @@ uint32 EQEmu::expansions::ConvertExpansionToExpansionsMask(Expansion expansion)
}
}
EQEmu::expansions::Expansion EQEmu::expansions::ConvertClientVersionToExpansion(versions::ClientVersion client_version)
EQ::expansions::Expansion EQ::expansions::ConvertClientVersionToExpansion(versions::ClientVersion client_version)
{
return EQEmu::constants::StaticLookup(client_version)->Expansion;
return EQ::constants::StaticLookup(client_version)->Expansion;
}
uint32 EQEmu::expansions::ConvertClientVersionToExpansionBit(versions::ClientVersion client_version)
uint32 EQ::expansions::ConvertClientVersionToExpansionBit(versions::ClientVersion client_version)
{
return EQEmu::constants::StaticLookup(client_version)->ExpansionBit;
return EQ::constants::StaticLookup(client_version)->ExpansionBit;
}
uint32 EQEmu::expansions::ConvertClientVersionToExpansionsMask(versions::ClientVersion client_version)
uint32 EQ::expansions::ConvertClientVersionToExpansionsMask(versions::ClientVersion client_version)
{
return EQEmu::constants::StaticLookup(client_version)->ExpansionsMask;
return EQ::constants::StaticLookup(client_version)->ExpansionsMask;
}
+1 -1
View File
@@ -25,7 +25,7 @@
#include <stdlib.h>
namespace EQEmu
namespace EQ
{
namespace versions {
enum class ClientVersion : uint32 {
+1 -1
View File
@@ -318,7 +318,7 @@ static const uint8 DamageTypeUnknown = 0xFF;
**
** (indexed by 'Skill' of SkillUseTypes)
*/
static const uint8 SkillDamageTypes[EQEmu::skills::HIGHEST_SKILL + 1] = // change to _SkillServerArraySize once activated
static const uint8 SkillDamageTypes[EQ::skills::HIGHEST_SKILL + 1] = // change to _SkillServerArraySize once activated
{
/*1HBlunt*/ 0,
/*1HSlashing*/ 1,
+168 -168
View File
@@ -25,7 +25,7 @@
static bool global_dictionary_init = false;
void EQEmu::InitializeDynamicLookups() {
void EQ::InitializeDynamicLookups() {
if (global_dictionary_init == true)
return;
@@ -37,12 +37,12 @@ void EQEmu::InitializeDynamicLookups() {
global_dictionary_init = true;
}
static std::unique_ptr<EQEmu::constants::LookupEntry> constants_dynamic_nongm_lookup_entries[EQEmu::versions::ClientVersionCount];
static std::unique_ptr<EQEmu::constants::LookupEntry> constants_dynamic_gm_lookup_entries[EQEmu::versions::ClientVersionCount];
static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu::versions::ClientVersionCount] =
static std::unique_ptr<EQ::constants::LookupEntry> constants_dynamic_nongm_lookup_entries[EQ::versions::ClientVersionCount];
static std::unique_ptr<EQ::constants::LookupEntry> constants_dynamic_gm_lookup_entries[EQ::versions::ClientVersionCount];
static const EQ::constants::LookupEntry constants_static_lookup_entries[EQ::versions::ClientVersionCount] =
{
/*[ClientVersion::Unknown] =*/
EQEmu::constants::LookupEntry(
EQ::constants::LookupEntry(
ClientUnknown::constants::EXPANSION,
ClientUnknown::constants::EXPANSION_BIT,
ClientUnknown::constants::EXPANSIONS_MASK,
@@ -50,7 +50,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
ClientUnknown::INULL
),
/*[ClientVersion::Client62] =*/
EQEmu::constants::LookupEntry(
EQ::constants::LookupEntry(
Client62::constants::EXPANSION,
Client62::constants::EXPANSION_BIT,
Client62::constants::EXPANSIONS_MASK,
@@ -58,7 +58,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
Client62::INULL
),
/*[ClientVersion::Titanium] =*/
EQEmu::constants::LookupEntry(
EQ::constants::LookupEntry(
Titanium::constants::EXPANSION,
Titanium::constants::EXPANSION_BIT,
Titanium::constants::EXPANSIONS_MASK,
@@ -66,7 +66,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
Titanium::constants::SAY_LINK_BODY_SIZE
),
/*[ClientVersion::SoF] =*/
EQEmu::constants::LookupEntry(
EQ::constants::LookupEntry(
SoF::constants::EXPANSION,
SoF::constants::EXPANSION_BIT,
SoF::constants::EXPANSIONS_MASK,
@@ -74,7 +74,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
SoF::constants::SAY_LINK_BODY_SIZE
),
/*[ClientVersion::SoD] =*/
EQEmu::constants::LookupEntry(
EQ::constants::LookupEntry(
SoD::constants::EXPANSION,
SoD::constants::EXPANSION_BIT,
SoD::constants::EXPANSIONS_MASK,
@@ -82,7 +82,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
SoD::constants::SAY_LINK_BODY_SIZE
),
/*[ClientVersion::UF] =*/
EQEmu::constants::LookupEntry(
EQ::constants::LookupEntry(
UF::constants::EXPANSION,
UF::constants::EXPANSION_BIT,
UF::constants::EXPANSIONS_MASK,
@@ -90,7 +90,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
UF::constants::SAY_LINK_BODY_SIZE
),
/*[ClientVersion::RoF] =*/
EQEmu::constants::LookupEntry(
EQ::constants::LookupEntry(
RoF::constants::EXPANSION,
RoF::constants::EXPANSION_BIT,
RoF::constants::EXPANSIONS_MASK,
@@ -98,7 +98,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
RoF::constants::SAY_LINK_BODY_SIZE
),
/*[ClientVersion::RoF2] =*/
EQEmu::constants::LookupEntry(
EQ::constants::LookupEntry(
RoF2::constants::EXPANSION,
RoF2::constants::EXPANSION_BIT,
RoF2::constants::EXPANSIONS_MASK,
@@ -108,7 +108,7 @@ static const EQEmu::constants::LookupEntry constants_static_lookup_entries[EQEmu
};
static bool constants_dictionary_init = false;
void EQEmu::constants::InitializeDynamicLookups() {
void EQ::constants::InitializeDynamicLookups() {
if (constants_dictionary_init == true)
return;
constants_dictionary_init = true;
@@ -119,7 +119,7 @@ void EQEmu::constants::InitializeDynamicLookups() {
// use static references for now
}
const EQEmu::constants::LookupEntry* EQEmu::constants::DynamicLookup(versions::ClientVersion client_version, bool gm_flag)
const EQ::constants::LookupEntry* EQ::constants::DynamicLookup(versions::ClientVersion client_version, bool gm_flag)
{
if (gm_flag)
return DynamicGMLookup(client_version);
@@ -127,7 +127,7 @@ const EQEmu::constants::LookupEntry* EQEmu::constants::DynamicLookup(versions::C
return DynamicNonGMLookup(client_version);
}
const EQEmu::constants::LookupEntry* EQEmu::constants::DynamicNonGMLookup(versions::ClientVersion client_version)
const EQ::constants::LookupEntry* EQ::constants::DynamicNonGMLookup(versions::ClientVersion client_version)
{
client_version = versions::ValidateClientVersion(client_version);
if (constants_dynamic_nongm_lookup_entries[static_cast<int>(client_version)])
@@ -136,7 +136,7 @@ const EQEmu::constants::LookupEntry* EQEmu::constants::DynamicNonGMLookup(versio
return &constants_static_lookup_entries[static_cast<int>(client_version)];
}
const EQEmu::constants::LookupEntry* EQEmu::constants::DynamicGMLookup(versions::ClientVersion client_version)
const EQ::constants::LookupEntry* EQ::constants::DynamicGMLookup(versions::ClientVersion client_version)
{
client_version = versions::ValidateClientVersion(client_version);
if (constants_dynamic_gm_lookup_entries[static_cast<int>(client_version)])
@@ -145,18 +145,18 @@ const EQEmu::constants::LookupEntry* EQEmu::constants::DynamicGMLookup(versions:
return &constants_static_lookup_entries[static_cast<int>(client_version)];
}
const EQEmu::constants::LookupEntry* EQEmu::constants::StaticLookup(versions::ClientVersion client_version)
const EQ::constants::LookupEntry* EQ::constants::StaticLookup(versions::ClientVersion client_version)
{
return &constants_static_lookup_entries[static_cast<int>(versions::ValidateClientVersion(client_version))];
}
static std::unique_ptr<EQEmu::inventory::LookupEntry> inventory_dynamic_nongm_lookup_entries[EQEmu::versions::MobVersionCount];
static std::unique_ptr<EQEmu::inventory::LookupEntry> inventory_dynamic_gm_lookup_entries[EQEmu::versions::MobVersionCount];
static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu::versions::MobVersionCount] =
static std::unique_ptr<EQ::inventory::LookupEntry> inventory_dynamic_nongm_lookup_entries[EQ::versions::MobVersionCount];
static std::unique_ptr<EQ::inventory::LookupEntry> inventory_dynamic_gm_lookup_entries[EQ::versions::MobVersionCount];
static const EQ::inventory::LookupEntry inventory_static_lookup_entries[EQ::versions::MobVersionCount] =
{
/*[MobVersion::Unknown] =*/
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
ClientUnknown::INULL, ClientUnknown::INULL, ClientUnknown::INULL,
ClientUnknown::INULL, ClientUnknown::INULL, ClientUnknown::INULL,
ClientUnknown::INULL, ClientUnknown::INULL, ClientUnknown::INULL,
@@ -182,8 +182,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
false
),
/*[MobVersion::Client62] =*/
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
Client62::INULL, Client62::INULL, Client62::INULL,
Client62::INULL, Client62::INULL, Client62::INULL,
Client62::INULL, Client62::INULL, Client62::INULL,
@@ -209,9 +209,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
false
),
/*[MobVersion::Titanium] =*/
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, Titanium::invtype::BANK_SIZE, Titanium::invtype::SHARED_BANK_SIZE,
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, Titanium::invtype::BANK_SIZE, Titanium::invtype::SHARED_BANK_SIZE,
Titanium::invtype::TRADE_SIZE, Titanium::invtype::WORLD_SIZE, Titanium::invtype::LIMBO_SIZE,
Titanium::invtype::TRIBUTE_SIZE, Titanium::INULL, Titanium::invtype::GUILD_TRIBUTE_SIZE,
Titanium::invtype::MERCHANT_SIZE, Titanium::INULL, Titanium::invtype::CORPSE_SIZE,
@@ -236,9 +236,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
Titanium::inventory::AllowOverLevelEquipment
),
/*[MobVersion::SoF] =*/
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, SoF::invtype::BANK_SIZE, SoF::invtype::SHARED_BANK_SIZE,
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, SoF::invtype::BANK_SIZE, SoF::invtype::SHARED_BANK_SIZE,
SoF::invtype::TRADE_SIZE, SoF::invtype::WORLD_SIZE, SoF::invtype::LIMBO_SIZE,
SoF::invtype::TRIBUTE_SIZE, SoF::INULL, SoF::invtype::GUILD_TRIBUTE_SIZE,
SoF::invtype::MERCHANT_SIZE, SoF::INULL, SoF::invtype::CORPSE_SIZE,
@@ -263,9 +263,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
SoF::inventory::AllowOverLevelEquipment
),
/*[MobVersion::SoD] =*/
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, SoD::invtype::BANK_SIZE, SoD::invtype::SHARED_BANK_SIZE,
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, SoD::invtype::BANK_SIZE, SoD::invtype::SHARED_BANK_SIZE,
SoD::invtype::TRADE_SIZE, SoD::invtype::WORLD_SIZE, SoD::invtype::LIMBO_SIZE,
SoD::invtype::TRIBUTE_SIZE, SoD::INULL, SoD::invtype::GUILD_TRIBUTE_SIZE,
SoD::invtype::MERCHANT_SIZE, SoD::INULL, SoD::invtype::CORPSE_SIZE,
@@ -290,9 +290,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
SoD::inventory::AllowOverLevelEquipment
),
/*[MobVersion::UF] =*/
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, UF::invtype::BANK_SIZE, UF::invtype::SHARED_BANK_SIZE,
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, UF::invtype::BANK_SIZE, UF::invtype::SHARED_BANK_SIZE,
UF::invtype::TRADE_SIZE, UF::invtype::WORLD_SIZE, UF::invtype::LIMBO_SIZE,
UF::invtype::TRIBUTE_SIZE, UF::INULL, UF::invtype::GUILD_TRIBUTE_SIZE,
UF::invtype::MERCHANT_SIZE, UF::INULL, UF::invtype::CORPSE_SIZE,
@@ -317,9 +317,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
UF::inventory::AllowOverLevelEquipment
),
/*[MobVersion::RoF] =*/
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, RoF::invtype::BANK_SIZE, RoF::invtype::SHARED_BANK_SIZE,
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, RoF::invtype::BANK_SIZE, RoF::invtype::SHARED_BANK_SIZE,
RoF::invtype::TRADE_SIZE, RoF::invtype::WORLD_SIZE, RoF::invtype::LIMBO_SIZE,
RoF::invtype::TRIBUTE_SIZE, RoF::invtype::TROPHY_TRIBUTE_SIZE, RoF::invtype::GUILD_TRIBUTE_SIZE,
RoF::invtype::MERCHANT_SIZE, RoF::invtype::DELETED_SIZE, RoF::invtype::CORPSE_SIZE,
@@ -344,9 +344,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
RoF::inventory::AllowOverLevelEquipment
),
/*[MobVersion::RoF2] =*/
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, RoF2::invtype::BANK_SIZE, RoF2::invtype::SHARED_BANK_SIZE,
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, RoF2::invtype::BANK_SIZE, RoF2::invtype::SHARED_BANK_SIZE,
RoF2::invtype::TRADE_SIZE, RoF2::invtype::WORLD_SIZE, RoF2::invtype::LIMBO_SIZE,
RoF2::invtype::TRIBUTE_SIZE, RoF2::invtype::TROPHY_TRIBUTE_SIZE, RoF2::invtype::GUILD_TRIBUTE_SIZE,
RoF2::invtype::MERCHANT_SIZE, RoF2::invtype::DELETED_SIZE, RoF2::invtype::CORPSE_SIZE,
@@ -371,9 +371,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
RoF2::inventory::AllowOverLevelEquipment
),
/*[MobVersion::NPC] =*/
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, EntityLimits::NPC::INULL, EntityLimits::NPC::INULL,
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, EntityLimits::NPC::INULL, EntityLimits::NPC::INULL,
EntityLimits::NPC::invtype::TRADE_SIZE, EntityLimits::NPC::INULL, EntityLimits::NPC::INULL,
EntityLimits::NPC::INULL, EntityLimits::NPC::INULL, EntityLimits::NPC::INULL,
EntityLimits::NPC::INULL, EntityLimits::NPC::INULL, EntityLimits::NPC::INULL, /*InvTypeCorpseSize,*/
@@ -389,8 +389,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
EntityLimits::NPC::INULL,
EntityLimits::NPC::INULL,
EntityLimits::NPC::INULL,
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
false,
false,
@@ -398,9 +398,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
false
),
/*[MobVersion::NPCMerchant] =*/
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL,
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL,
EntityLimits::NPCMerchant::invtype::TRADE_SIZE, EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL,
EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL,
EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL, EntityLimits::NPCMerchant::INULL, /*InvTypeCorpseSize,*/
@@ -416,8 +416,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
EntityLimits::NPCMerchant::INULL,
EntityLimits::NPCMerchant::INULL,
EntityLimits::NPCMerchant::INULL,
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
false,
false,
@@ -425,9 +425,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
false
),
/*[MobVersion::Merc] =*/
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::Merc::INULL, EntityLimits::Merc::INULL,
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::Merc::INULL, EntityLimits::Merc::INULL,
EntityLimits::Merc::invtype::TRADE_SIZE, EntityLimits::Merc::INULL, EntityLimits::Merc::INULL,
EntityLimits::Merc::INULL, EntityLimits::Merc::INULL, EntityLimits::Merc::INULL,
EntityLimits::Merc::INULL, EntityLimits::Merc::INULL, EntityLimits::Merc::INULL, /*InvTypeCorpseSize,*/
@@ -443,8 +443,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
EntityLimits::Merc::INULL,
EntityLimits::Merc::INULL,
EntityLimits::Merc::INULL,
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
false,
false,
@@ -452,9 +452,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
false
),
/*[MobVersion::Bot] =*/
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::Bot::INULL, EntityLimits::Bot::INULL,
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::Bot::INULL, EntityLimits::Bot::INULL,
EntityLimits::Bot::invtype::TRADE_SIZE, EntityLimits::Bot::INULL, EntityLimits::Bot::INULL,
EntityLimits::Bot::INULL, EntityLimits::Bot::INULL, EntityLimits::Bot::INULL,
EntityLimits::Bot::INULL, EntityLimits::Bot::INULL, EntityLimits::Bot::INULL, /*InvTypeCorpseSize,*/
@@ -470,8 +470,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
EntityLimits::Bot::invslot::CURSOR_BITMASK,
EntityLimits::Bot::invslot::POSSESSIONS_BITMASK,
EntityLimits::Bot::INULL,
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
EQEmu::invaug::SOCKET_COUNT, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
EQ::invaug::SOCKET_COUNT, //EQ::inventory::SocketCount, /*ItemAugSize,*/
false,
false,
@@ -479,9 +479,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
false
),
/*[MobVersion::ClientPet] =*/
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL,
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL,
EntityLimits::ClientPet::invtype::TRADE_SIZE, EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL,
EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL,
EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL, EntityLimits::ClientPet::INULL, /*InvTypeCorpseSize,*/
@@ -497,8 +497,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
EntityLimits::ClientPet::INULL,
EntityLimits::ClientPet::INULL,
EntityLimits::ClientPet::INULL,
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
false,
false,
@@ -506,9 +506,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
false
),
/*[MobVersion::NPCPet] =*/
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL,
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL,
EntityLimits::NPCPet::invtype::TRADE_SIZE, EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL,
EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL,
EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL, EntityLimits::NPCPet::INULL, /*InvTypeCorpseSize,*/
@@ -524,8 +524,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
EntityLimits::NPCPet::INULL,
EntityLimits::NPCPet::INULL,
EntityLimits::NPCPet::INULL,
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
false,
false,
@@ -533,9 +533,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
false
),
/*[MobVersion::MercPet] =*/
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL,
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL,
EntityLimits::MercPet::invtype::TRADE_SIZE, EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL,
EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL,
EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL, EntityLimits::MercPet::INULL, /*InvTypeCorpseSize,*/
@@ -551,8 +551,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
EntityLimits::MercPet::INULL,
EntityLimits::MercPet::INULL,
EntityLimits::MercPet::INULL,
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
false,
false,
@@ -560,9 +560,9 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
false
),
/*[MobVersion::BotPet] =*/
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQEmu::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL,
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::invtype::POSSESSIONS_SIZE, /*InvTypePossessionsSize,*/ EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL,
EntityLimits::BotPet::invtype::TRADE_SIZE, EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL,
EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL,
EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL, EntityLimits::BotPet::INULL, /*InvTypeCorpseSize,*/
@@ -578,8 +578,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
EntityLimits::BotPet::INULL,
EntityLimits::BotPet::INULL,
EntityLimits::BotPet::INULL,
0, //EQEmu::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQEmu::inventory::SocketCount, /*ItemAugSize,*/
0, //EQ::inventory::ContainerCount, /*ItemBagSize,*/
0, //EQ::inventory::SocketCount, /*ItemAugSize,*/
false,
false,
@@ -587,8 +587,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
false
),
/*[MobVersion::OfflineTitanium] =*/
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
Titanium::INULL, Titanium::INULL, Titanium::INULL,
Titanium::invtype::TRADE_SIZE, Titanium::INULL, Titanium::INULL,
Titanium::INULL, Titanium::INULL, Titanium::INULL,
@@ -614,8 +614,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
false
),
/*[MobVersion::OfflineSoF] =*/
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
SoF::INULL, SoF::INULL, SoF::INULL,
SoF::invtype::TRADE_SIZE, SoF::INULL, SoF::INULL,
SoF::INULL, SoF::INULL, SoF::INULL,
@@ -641,8 +641,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
false
),
/*[MobVersion::OfflineSoD] =*/
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
SoD::INULL, SoD::INULL, SoD::INULL,
SoD::invtype::TRADE_SIZE, SoD::INULL, SoD::INULL,
SoD::INULL, SoD::INULL, SoD::INULL,
@@ -668,8 +668,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
false
),
/*[MobVersion::OfflineUF] =*/
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
UF::INULL, UF::INULL, UF::INULL,
UF::invtype::TRADE_SIZE, UF::INULL, UF::INULL,
UF::INULL, UF::INULL, UF::INULL,
@@ -695,8 +695,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
false
),
/*[MobVersion::OfflineRoF] =*/
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
RoF::INULL, RoF::INULL, RoF::INULL,
RoF::invtype::TRADE_SIZE, RoF::INULL, RoF::INULL,
RoF::INULL, RoF::INULL, RoF::INULL,
@@ -722,8 +722,8 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
false
),
/*[MobVersion::OfflineRoF2] =*/
EQEmu::inventory::LookupEntry(
EQEmu::inventory::LookupEntry::InventoryTypeSize_Struct(
EQ::inventory::LookupEntry(
EQ::inventory::LookupEntry::InventoryTypeSize_Struct(
RoF2::INULL, RoF2::INULL, RoF2::INULL,
RoF2::invtype::TRADE_SIZE, RoF2::INULL, RoF2::INULL,
RoF2::INULL, RoF2::INULL, RoF2::INULL,
@@ -751,7 +751,7 @@ static const EQEmu::inventory::LookupEntry inventory_static_lookup_entries[EQEmu
};
static bool inventory_dictionary_init = false;
void EQEmu::inventory::InitializeDynamicLookups() {
void EQ::inventory::InitializeDynamicLookups() {
if (inventory_dictionary_init == true)
return;
inventory_dictionary_init = true;
@@ -774,9 +774,9 @@ void EQEmu::inventory::InitializeDynamicLookups() {
const uint32 dynamic_check_mask =
(
EQEmu::expansions::bitPoR |
EQEmu::expansions::bitTBS |
EQEmu::expansions::bitHoT
EQ::expansions::bitPoR |
EQ::expansions::bitTBS |
EQ::expansions::bitHoT
);
// if all of the above expansion bits are present, then static references will suffice
@@ -784,7 +784,7 @@ void EQEmu::inventory::InitializeDynamicLookups() {
return;
// Dynamic Lookups (promotive methodology) (all mob versions allowed)
for (uint32 iter = static_cast<uint32>(EQEmu::versions::MobVersion::Unknown); iter <= static_cast<uint32>(EQEmu::versions::LastPCMobVersion); ++iter) {
for (uint32 iter = static_cast<uint32>(EQ::versions::MobVersion::Unknown); iter <= static_cast<uint32>(EQ::versions::LastPCMobVersion); ++iter) {
// no need to dynamic this condition since it is the lowest compatibility standard
if ((dynamic_check_mask & ~constants_static_lookup_entries[iter].ExpansionsMask) == dynamic_check_mask)
continue;
@@ -803,21 +803,21 @@ void EQEmu::inventory::InitializeDynamicLookups() {
inventory_dynamic_nongm_lookup_entries[iter]->PossessionsBitmask = 0; // we'll fix later
inventory_dynamic_nongm_lookup_entries[iter]->CorpseBitmask = 0; // we'll fix later
if (RuleI(World, ExpansionSettings) & EQEmu::expansions::bitPoR) {
if (RuleI(World, ExpansionSettings) & EQ::expansions::bitPoR) {
// update bank size
if (constants_static_lookup_entries[iter].ExpansionsMask & EQEmu::expansions::bitPoR)
if (constants_static_lookup_entries[iter].ExpansionsMask & EQ::expansions::bitPoR)
inventory_dynamic_nongm_lookup_entries[iter]->InventoryTypeSize.Bank = SoF::invtype::BANK_SIZE;
}
if (RuleI(World, ExpansionSettings) & EQEmu::expansions::bitTBS) {
if (RuleI(World, ExpansionSettings) & EQ::expansions::bitTBS) {
// update power source
if (constants_static_lookup_entries[iter].ExpansionsMask & EQEmu::expansions::bitTBS)
if (constants_static_lookup_entries[iter].ExpansionsMask & EQ::expansions::bitTBS)
inventory_dynamic_nongm_lookup_entries[iter]->EquipmentBitmask = SoF::invslot::EQUIPMENT_BITMASK;
}
if (RuleI(World, ExpansionSettings) & EQEmu::expansions::bitHoT) {
if (RuleI(World, ExpansionSettings) & EQ::expansions::bitHoT) {
// update general size
if (constants_static_lookup_entries[iter].ExpansionsMask & EQEmu::expansions::bitHoT)
if (constants_static_lookup_entries[iter].ExpansionsMask & EQ::expansions::bitHoT)
inventory_dynamic_nongm_lookup_entries[iter]->GeneralBitmask = RoF::invslot::GENERAL_BITMASK;
}
@@ -841,7 +841,7 @@ void EQEmu::inventory::InitializeDynamicLookups() {
}
// Dynamic GM Lookups (demotive methodology) (client-linked mob versions only)
for (uint32 iter = static_cast<uint32>(EQEmu::versions::MobVersion::Unknown); iter <= static_cast<uint32>(EQEmu::versions::LastPCMobVersion); ++iter) {
for (uint32 iter = static_cast<uint32>(EQ::versions::MobVersion::Unknown); iter <= static_cast<uint32>(EQ::versions::LastPCMobVersion); ++iter) {
// no need to dynamic this condition since it is the lowest compatibility standard
if ((dynamic_check_mask & ~constants_static_lookup_entries[iter].ExpansionsMask) == dynamic_check_mask)
continue;
@@ -869,13 +869,13 @@ void EQEmu::inventory::InitializeDynamicLookups() {
inventory_dynamic_gm_lookup_entries[iter]->PossessionsBitmask = 0; // we'll fix later
inventory_dynamic_gm_lookup_entries[iter]->CorpseBitmask = 0; // we'll fix later
if (~RuleI(World, ExpansionSettings) & EQEmu::expansions::bitPoR) {
if (~RuleI(World, ExpansionSettings) & EQ::expansions::bitPoR) {
// update bank size
if (constants_static_lookup_entries[iter].ExpansionsMask & EQEmu::expansions::bitPoR)
if (constants_static_lookup_entries[iter].ExpansionsMask & EQ::expansions::bitPoR)
inventory_dynamic_gm_lookup_entries[iter]->InventoryTypeSize.Bank = Titanium::invtype::BANK_SIZE;
}
if (~RuleI(World, ExpansionSettings) & EQEmu::expansions::bitTBS) {
if (~RuleI(World, ExpansionSettings) & EQ::expansions::bitTBS) {
// update power source
switch (iter) {
case versions::bitUF:
@@ -890,7 +890,7 @@ void EQEmu::inventory::InitializeDynamicLookups() {
}
}
if (~RuleI(World, ExpansionSettings) & EQEmu::expansions::bitHoT) {
if (~RuleI(World, ExpansionSettings) & EQ::expansions::bitHoT) {
// update general size
switch (iter) {
case versions::bitUF:
@@ -927,7 +927,7 @@ void EQEmu::inventory::InitializeDynamicLookups() {
// only client versions that require a change from their static definitions have been given a dynamic (gm) lookup entry
}
const EQEmu::inventory::LookupEntry* EQEmu::inventory::DynamicLookup(versions::MobVersion mob_version, bool gm_flag)
const EQ::inventory::LookupEntry* EQ::inventory::DynamicLookup(versions::MobVersion mob_version, bool gm_flag)
{
if (gm_flag)
return DynamicGMLookup(mob_version);
@@ -935,7 +935,7 @@ const EQEmu::inventory::LookupEntry* EQEmu::inventory::DynamicLookup(versions::M
return DynamicNonGMLookup(mob_version);
}
const EQEmu::inventory::LookupEntry* EQEmu::inventory::DynamicNonGMLookup(versions::MobVersion mob_version)
const EQ::inventory::LookupEntry* EQ::inventory::DynamicNonGMLookup(versions::MobVersion mob_version)
{
mob_version = versions::ValidateMobVersion(mob_version);
if (inventory_dynamic_nongm_lookup_entries[static_cast<int>(mob_version)])
@@ -944,7 +944,7 @@ const EQEmu::inventory::LookupEntry* EQEmu::inventory::DynamicNonGMLookup(versio
return &inventory_static_lookup_entries[static_cast<int>(mob_version)];
}
const EQEmu::inventory::LookupEntry* EQEmu::inventory::DynamicGMLookup(versions::MobVersion mob_version)
const EQ::inventory::LookupEntry* EQ::inventory::DynamicGMLookup(versions::MobVersion mob_version)
{
mob_version = versions::ValidateMobVersion(mob_version);
if (inventory_dynamic_gm_lookup_entries[static_cast<int>(mob_version)])
@@ -953,107 +953,107 @@ const EQEmu::inventory::LookupEntry* EQEmu::inventory::DynamicGMLookup(versions:
return &inventory_static_lookup_entries[static_cast<int>(mob_version)];
}
const EQEmu::inventory::LookupEntry* EQEmu::inventory::StaticLookup(versions::MobVersion mob_version)
const EQ::inventory::LookupEntry* EQ::inventory::StaticLookup(versions::MobVersion mob_version)
{
return &inventory_static_lookup_entries[static_cast<int>(versions::ValidateMobVersion(mob_version))];
}
static std::unique_ptr<EQEmu::behavior::LookupEntry> behavior_dynamic_nongm_lookup_entries[EQEmu::versions::MobVersionCount];
static std::unique_ptr<EQEmu::behavior::LookupEntry> behavior_dynamic_gm_lookup_entries[EQEmu::versions::MobVersionCount];
static const EQEmu::behavior::LookupEntry behavior_static_lookup_entries[EQEmu::versions::MobVersionCount] =
static std::unique_ptr<EQ::behavior::LookupEntry> behavior_dynamic_nongm_lookup_entries[EQ::versions::MobVersionCount];
static std::unique_ptr<EQ::behavior::LookupEntry> behavior_dynamic_gm_lookup_entries[EQ::versions::MobVersionCount];
static const EQ::behavior::LookupEntry behavior_static_lookup_entries[EQ::versions::MobVersionCount] =
{
/*[MobVersion::Unknown] =*/
EQEmu::behavior::LookupEntry(
EQ::behavior::LookupEntry(
true
),
/*[MobVersion::Client62] =*/
EQEmu::behavior::LookupEntry(
EQ::behavior::LookupEntry(
true
),
/*[MobVersion::Titanium] =*/
EQEmu::behavior::LookupEntry(
EQ::behavior::LookupEntry(
Titanium::behavior::CoinHasWeight
),
/*[MobVersion::SoF] =*/
EQEmu::behavior::LookupEntry(
EQ::behavior::LookupEntry(
SoF::behavior::CoinHasWeight
),
/*[MobVersion::SoD] =*/
EQEmu::behavior::LookupEntry(
EQ::behavior::LookupEntry(
SoD::behavior::CoinHasWeight
),
/*[MobVersion::UF] =*/
EQEmu::behavior::LookupEntry(
EQ::behavior::LookupEntry(
UF::behavior::CoinHasWeight
),
/*[MobVersion::RoF] =*/
EQEmu::behavior::LookupEntry(
EQ::behavior::LookupEntry(
RoF::behavior::CoinHasWeight
),
/*[MobVersion::RoF2] =*/
EQEmu::behavior::LookupEntry(
EQ::behavior::LookupEntry(
RoF2::behavior::CoinHasWeight
),
/*[MobVersion::NPC] =*/
EQEmu::behavior::LookupEntry(
EQEmu::behavior::CoinHasWeight
EQ::behavior::LookupEntry(
EQ::behavior::CoinHasWeight
),
/*[MobVersion::NPCMerchant] =*/
EQEmu::behavior::LookupEntry(
EQEmu::behavior::CoinHasWeight
EQ::behavior::LookupEntry(
EQ::behavior::CoinHasWeight
),
/*[MobVersion::Merc] =*/
EQEmu::behavior::LookupEntry(
EQEmu::behavior::CoinHasWeight
EQ::behavior::LookupEntry(
EQ::behavior::CoinHasWeight
),
/*[MobVersion::Bot] =*/
EQEmu::behavior::LookupEntry(
EQEmu::behavior::CoinHasWeight
EQ::behavior::LookupEntry(
EQ::behavior::CoinHasWeight
),
/*[MobVersion::ClientPet] =*/
EQEmu::behavior::LookupEntry(
EQEmu::behavior::CoinHasWeight
EQ::behavior::LookupEntry(
EQ::behavior::CoinHasWeight
),
/*[MobVersion::NPCPet] =*/
EQEmu::behavior::LookupEntry(
EQEmu::behavior::CoinHasWeight
EQ::behavior::LookupEntry(
EQ::behavior::CoinHasWeight
),
/*[MobVersion::MercPet] =*/
EQEmu::behavior::LookupEntry(
EQEmu::behavior::CoinHasWeight
EQ::behavior::LookupEntry(
EQ::behavior::CoinHasWeight
),
/*[MobVersion::BotPet] =*/
EQEmu::behavior::LookupEntry(
EQEmu::behavior::CoinHasWeight
EQ::behavior::LookupEntry(
EQ::behavior::CoinHasWeight
),
/*[MobVersion::OfflineTitanium] =*/
EQEmu::behavior::LookupEntry(
EQ::behavior::LookupEntry(
Titanium::behavior::CoinHasWeight
),
/*[MobVersion::OfflineSoF] =*/
EQEmu::behavior::LookupEntry(
EQ::behavior::LookupEntry(
SoF::behavior::CoinHasWeight
),
/*[MobVersion::OfflineSoD] =*/
EQEmu::behavior::LookupEntry(
EQ::behavior::LookupEntry(
SoD::behavior::CoinHasWeight
),
/*[MobVersion::OfflineUF] =*/
EQEmu::behavior::LookupEntry(
EQ::behavior::LookupEntry(
UF::behavior::CoinHasWeight
),
/*[MobVersion::OfflineRoF] =*/
EQEmu::behavior::LookupEntry(
EQ::behavior::LookupEntry(
RoF::behavior::CoinHasWeight
),
/*[MobVersion::OfflineRoF2] =*/
EQEmu::behavior::LookupEntry(
EQ::behavior::LookupEntry(
RoF2::behavior::CoinHasWeight
)
};
static bool behavior_dictionary_init = false;
void EQEmu::behavior::InitializeDynamicLookups() {
void EQ::behavior::InitializeDynamicLookups() {
if (behavior_dictionary_init == true)
return;
behavior_dictionary_init = true;
@@ -1064,7 +1064,7 @@ void EQEmu::behavior::InitializeDynamicLookups() {
// use static references for now
}
const EQEmu::behavior::LookupEntry* EQEmu::behavior::DynamicLookup(versions::MobVersion mob_version, bool gm_flag)
const EQ::behavior::LookupEntry* EQ::behavior::DynamicLookup(versions::MobVersion mob_version, bool gm_flag)
{
if (gm_flag)
return DynamicGMLookup(mob_version);
@@ -1072,7 +1072,7 @@ const EQEmu::behavior::LookupEntry* EQEmu::behavior::DynamicLookup(versions::Mob
return DynamicNonGMLookup(mob_version);
}
const EQEmu::behavior::LookupEntry* EQEmu::behavior::DynamicNonGMLookup(versions::MobVersion mob_version)
const EQ::behavior::LookupEntry* EQ::behavior::DynamicNonGMLookup(versions::MobVersion mob_version)
{
mob_version = versions::ValidateMobVersion(mob_version);
if (behavior_dynamic_nongm_lookup_entries[static_cast<int>(mob_version)])
@@ -1081,7 +1081,7 @@ const EQEmu::behavior::LookupEntry* EQEmu::behavior::DynamicNonGMLookup(versions
return &behavior_static_lookup_entries[static_cast<int>(mob_version)];
}
const EQEmu::behavior::LookupEntry* EQEmu::behavior::DynamicGMLookup(versions::MobVersion mob_version)
const EQ::behavior::LookupEntry* EQ::behavior::DynamicGMLookup(versions::MobVersion mob_version)
{
mob_version = versions::ValidateMobVersion(mob_version);
if (behavior_dynamic_gm_lookup_entries[static_cast<int>(mob_version)])
@@ -1090,17 +1090,17 @@ const EQEmu::behavior::LookupEntry* EQEmu::behavior::DynamicGMLookup(versions::M
return &behavior_static_lookup_entries[static_cast<int>(mob_version)];
}
const EQEmu::behavior::LookupEntry* EQEmu::behavior::StaticLookup(versions::MobVersion mob_version)
const EQ::behavior::LookupEntry* EQ::behavior::StaticLookup(versions::MobVersion mob_version)
{
return &behavior_static_lookup_entries[static_cast<int>(versions::ValidateMobVersion(mob_version))];
}
static std::unique_ptr<EQEmu::spells::LookupEntry> spells_dynamic_nongm_lookup_entries[EQEmu::versions::ClientVersionCount];
static std::unique_ptr<EQEmu::spells::LookupEntry> spells_dynamic_gm_lookup_entries[EQEmu::versions::ClientVersionCount];
static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::versions::ClientVersionCount] =
static std::unique_ptr<EQ::spells::LookupEntry> spells_dynamic_nongm_lookup_entries[EQ::versions::ClientVersionCount];
static std::unique_ptr<EQ::spells::LookupEntry> spells_dynamic_gm_lookup_entries[EQ::versions::ClientVersionCount];
static const EQ::spells::LookupEntry spells_static_lookup_entries[EQ::versions::ClientVersionCount] =
{
/*[ClientVersion::Unknown] =*/
EQEmu::spells::LookupEntry(
EQ::spells::LookupEntry(
ClientUnknown::INULL,
ClientUnknown::INULL,
ClientUnknown::INULL,
@@ -1113,7 +1113,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
ClientUnknown::INULL
),
/*[ClientVersion::Client62] =*/
EQEmu::spells::LookupEntry(
EQ::spells::LookupEntry(
Client62::INULL,
Client62::INULL,
Client62::INULL,
@@ -1126,7 +1126,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
Client62::INULL
),
/*[ClientVersion::Titanium] =*/
EQEmu::spells::LookupEntry(
EQ::spells::LookupEntry(
Titanium::spells::SPELL_ID_MAX,
Titanium::spells::SPELLBOOK_SIZE,
Titanium::spells::SPELL_GEM_COUNT,
@@ -1139,7 +1139,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
Titanium::spells::MERC_BUFFS
),
/*[ClientVersion::SoF] =*/
EQEmu::spells::LookupEntry(
EQ::spells::LookupEntry(
SoF::spells::SPELL_ID_MAX,
SoF::spells::SPELLBOOK_SIZE,
SoF::spells::SPELL_GEM_COUNT,
@@ -1152,7 +1152,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
SoF::spells::MERC_BUFFS
),
/*[ClientVersion::SoD] =*/
EQEmu::spells::LookupEntry(
EQ::spells::LookupEntry(
SoD::spells::SPELL_ID_MAX,
SoD::spells::SPELLBOOK_SIZE,
SoD::spells::SPELL_GEM_COUNT,
@@ -1165,7 +1165,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
SoD::spells::MERC_BUFFS
),
/*[ClientVersion::UF] =*/
EQEmu::spells::LookupEntry(
EQ::spells::LookupEntry(
UF::spells::SPELL_ID_MAX,
UF::spells::SPELLBOOK_SIZE,
UF::spells::SPELL_GEM_COUNT,
@@ -1178,7 +1178,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
UF::spells::MERC_BUFFS
),
/*[ClientVersion::RoF] =*/
EQEmu::spells::LookupEntry(
EQ::spells::LookupEntry(
RoF::spells::SPELL_ID_MAX,
RoF::spells::SPELLBOOK_SIZE,
UF::spells::SPELL_GEM_COUNT, // client translators are setup to allow the max value a client supports..however, the top 4 indices are not valid in this case
@@ -1191,7 +1191,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
RoF::spells::MERC_BUFFS
),
/*[ClientVersion::RoF2] =*/
EQEmu::spells::LookupEntry(
EQ::spells::LookupEntry(
RoF2::spells::SPELL_ID_MAX,
RoF2::spells::SPELLBOOK_SIZE,
UF::spells::SPELL_GEM_COUNT, // client translators are setup to allow the max value a client supports..however, the top 4 indices are not valid in this case
@@ -1206,7 +1206,7 @@ static const EQEmu::spells::LookupEntry spells_static_lookup_entries[EQEmu::vers
};
static bool spells_dictionary_init = false;
void EQEmu::spells::InitializeDynamicLookups() {
void EQ::spells::InitializeDynamicLookups() {
if (spells_dictionary_init == true)
return;
spells_dictionary_init = true;
@@ -1217,7 +1217,7 @@ void EQEmu::spells::InitializeDynamicLookups() {
// use static references for now
}
const EQEmu::spells::LookupEntry* EQEmu::spells::DynamicLookup(versions::ClientVersion client_version, bool gm_flag)
const EQ::spells::LookupEntry* EQ::spells::DynamicLookup(versions::ClientVersion client_version, bool gm_flag)
{
if (gm_flag)
return DynamicGMLookup(client_version);
@@ -1225,7 +1225,7 @@ const EQEmu::spells::LookupEntry* EQEmu::spells::DynamicLookup(versions::ClientV
return DynamicNonGMLookup(client_version);
}
const EQEmu::spells::LookupEntry* EQEmu::spells::DynamicNonGMLookup(versions::ClientVersion client_version)
const EQ::spells::LookupEntry* EQ::spells::DynamicNonGMLookup(versions::ClientVersion client_version)
{
client_version = versions::ValidateClientVersion(client_version);
if (spells_dynamic_nongm_lookup_entries[static_cast<int>(client_version)])
@@ -1234,7 +1234,7 @@ const EQEmu::spells::LookupEntry* EQEmu::spells::DynamicNonGMLookup(versions::Cl
return &spells_static_lookup_entries[static_cast<int>(client_version)];
}
const EQEmu::spells::LookupEntry* EQEmu::spells::DynamicGMLookup(versions::ClientVersion client_version)
const EQ::spells::LookupEntry* EQ::spells::DynamicGMLookup(versions::ClientVersion client_version)
{
client_version = versions::ValidateClientVersion(client_version);
if (spells_dynamic_gm_lookup_entries[static_cast<int>(client_version)])
@@ -1243,7 +1243,7 @@ const EQEmu::spells::LookupEntry* EQEmu::spells::DynamicGMLookup(versions::Clien
return &spells_static_lookup_entries[static_cast<int>(client_version)];
}
const EQEmu::spells::LookupEntry* EQEmu::spells::StaticLookup(versions::ClientVersion client_version)
const EQ::spells::LookupEntry* EQ::spells::StaticLookup(versions::ClientVersion client_version)
{
return &spells_static_lookup_entries[static_cast<int>(versions::ValidateClientVersion(client_version))];
}
+10 -10
View File
@@ -31,13 +31,13 @@
#include "../common/patches/rof2_limits.h"
namespace EQEmu
namespace EQ
{
void InitializeDynamicLookups();
namespace constants {
struct LookupEntry {
EQEmu::expansions::Expansion Expansion;
EQ::expansions::Expansion Expansion;
uint32 ExpansionBit;
uint32 ExpansionsMask;
int16 CharacterCreationLimit;
@@ -45,7 +45,7 @@ namespace EQEmu
LookupEntry(const LookupEntry *lookup_entry) { }
LookupEntry(
EQEmu::expansions::Expansion Expansion,
EQ::expansions::Expansion Expansion,
uint32 ExpansionBit,
uint32 ExpansionsMask,
int16 CharacterCreationLimit,
@@ -111,7 +111,7 @@ namespace EQEmu
union {
InventoryTypeSize_Struct InventoryTypeSize;
int16 InventoryTypeSizeArray[25]; // should reflect EQEmu::invtype::TYPE_COUNT referenced in emu_constants.h
int16 InventoryTypeSizeArray[25]; // should reflect EQ::invtype::TYPE_COUNT referenced in emu_constants.h
};
uint64 EquipmentBitmask;
@@ -244,9 +244,9 @@ namespace ClientUnknown
const int16 INULL = 0;
namespace constants {
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::EverQuest;
const uint32 EXPANSION_BIT = EQEmu::expansions::bitEverQuest;
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskEverQuest;
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::EverQuest;
const uint32 EXPANSION_BIT = EQ::expansions::bitEverQuest;
const uint32 EXPANSIONS_MASK = EQ::expansions::maskEverQuest;
} // namespace constants
@@ -258,9 +258,9 @@ namespace Client62
const int16 INULL = 0;
namespace constants {
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::EverQuest;
const uint32 EXPANSION_BIT = EQEmu::expansions::bitEverQuest;
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskEverQuest;
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::EverQuest;
const uint32 EXPANSION_BIT = EQ::expansions::bitEverQuest;
const uint32 EXPANSIONS_MASK = EQ::expansions::maskEverQuest;
} // namespace constants
+175 -70
View File
@@ -129,7 +129,7 @@ struct LDoNTrapTemplate
// All clients translate the character select information to some degree
struct CharSelectEquip : EQEmu::textures::Texture_Struct, EQEmu::textures::Tint_Struct {};
struct CharSelectEquip : EQ::textures::Texture_Struct, EQ::textures::Tint_Struct {};
// RoF2-based hybrid struct
struct CharacterSelectEntry_Struct
@@ -144,7 +144,7 @@ struct CharacterSelectEntry_Struct
uint16 Instance;
uint8 Gender;
uint8 Face;
CharSelectEquip Equip[EQEmu::textures::materialCount];
CharSelectEquip Equip[EQ::textures::materialCount];
uint8 Unknown15; // Seen FF
uint8 Unknown19; // Seen FF
uint32 DrakkinTattoo;
@@ -253,7 +253,7 @@ struct Spawn_Struct {
/*0189*/ uint32 petOwnerId; // If this is a pet, the spawn id of owner
/*0193*/ uint8 guildrank; // 0=normal, 1=officer, 2=leader
/*0194*/ uint8 unknown0194[3];
/*0197*/ EQEmu::TextureProfile equipment;
/*0197*/ EQ::TextureProfile equipment;
/*0233*/ float runspeed; // Speed when running
/*0036*/ uint8 afk; // 0=no, 1=afk
/*0238*/ uint32 guildID; // Current guild
@@ -284,7 +284,7 @@ union
/*0340*/ uint32 spawnId; // Spawn Id
/*0344*/ float bounding_radius; // used in melee, overrides calc
/*0347*/ uint8 IsMercenary;
/*0348*/ EQEmu::TintProfile equipment_tint;
/*0348*/ EQ::TintProfile equipment_tint;
/*0384*/ uint8 lfg; // 0=off, 1=lfg on
/*0385*/
@@ -375,13 +375,16 @@ struct NewZone_Struct {
/*0686*/ uint16 zone_instance;
/*0688*/ uint32 unknown688;
/*0692*/ uint8 unknown692[8];
// Titanium doesn't have a translator, but we can still safely add stuff under here without issues since client memcpy's only what it knows
// Just wastes some bandwidth sending to tit clients /shrug
/*0700*/ float fog_density;
/*0704*/ uint32 SuspendBuffs;
/*0708*/ uint32 FastRegenHP;
/*0712*/ uint32 FastRegenMana;
/*0716*/ uint32 FastRegenEndurance;
/*0720*/ uint32 NPCAggroMaxDist;
/*0724*/
/*0724*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, if this value is 0, it prevents you from running off edges that would end up underworld
/*0728*/
};
/*
@@ -736,7 +739,7 @@ struct BandolierItem_Struct
struct Bandolier_Struct
{
char Name[32];
BandolierItem_Struct Items[EQEmu::profile::BANDOLIER_ITEM_COUNT];
BandolierItem_Struct Items[EQ::profile::BANDOLIER_ITEM_COUNT];
};
//len = 72
@@ -750,7 +753,7 @@ struct PotionBeltItem_Struct
//len = 288
struct PotionBelt_Struct
{
PotionBeltItem_Struct Items[EQEmu::profile::POTION_BELT_SIZE];
PotionBeltItem_Struct Items[EQ::profile::POTION_BELT_SIZE];
};
struct MovePotionToBelt_Struct
@@ -841,7 +844,7 @@ struct SuspendedMinion_Struct
/*002*/ uint32 HP;
/*006*/ uint32 Mana;
/*010*/ SpellBuff_Struct Buffs[BUFF_COUNT];
/*510*/ EQEmu::TextureMaterialProfile Items;
/*510*/ EQ::TextureMaterialProfile Items;
/*546*/ char Name[64];
/*610*/
};
@@ -933,7 +936,7 @@ struct PlayerProfile_Struct
/*0245*/ uint8 guildbanker;
/*0246*/ uint8 unknown0246[6]; //
/*0252*/ uint32 intoxication;
/*0256*/ uint32 spellSlotRefresh[EQEmu::spells::SPELL_GEM_COUNT]; //in ms
/*0256*/ uint32 spellSlotRefresh[EQ::spells::SPELL_GEM_COUNT]; //in ms
/*0292*/ uint32 abilitySlotRefresh;
/*0296*/ uint8 haircolor; // Player hair color
/*0297*/ uint8 beardcolor; // Player beard color
@@ -946,9 +949,9 @@ struct PlayerProfile_Struct
/*0304*/ uint8 ability_time_minutes;
/*0305*/ uint8 ability_time_hours; //place holder
/*0306*/ uint8 unknown0306[6]; // @bp Spacer/Flag?
/*0312*/ EQEmu::TextureMaterialProfile item_material; // Item texture/material of worn/held items
/*0312*/ EQ::TextureMaterialProfile item_material; // Item texture/material of worn/held items
/*0348*/ uint8 unknown0348[44];
/*0392*/ EQEmu::TintProfile item_tint;
/*0392*/ EQ::TintProfile item_tint;
/*0428*/ AA_Array aa_array[MAX_PP_AA_ARRAY];
/*2348*/ float unknown2384; //seen ~128, ~47
/*2352*/ char servername[32]; // length probably not right
@@ -972,9 +975,9 @@ struct PlayerProfile_Struct
/*2505*/ uint8 unknown2541[47]; // ?
/*2552*/ uint8 languages[MAX_PP_LANGUAGE];
/*2580*/ uint8 unknown2616[4];
/*2584*/ uint32 spell_book[EQEmu::spells::SPELLBOOK_SIZE];
/*2584*/ uint32 spell_book[EQ::spells::SPELLBOOK_SIZE];
/*4504*/ uint8 unknown4540[128]; // Was [428] all 0xff
/*4632*/ uint32 mem_spells[EQEmu::spells::SPELL_GEM_COUNT];
/*4632*/ uint32 mem_spells[EQ::spells::SPELL_GEM_COUNT];
/*4668*/ uint8 unknown4704[32]; //
/*4700*/ float y; // Player y position
/*4704*/ float x; // Player x position
@@ -1050,7 +1053,7 @@ struct PlayerProfile_Struct
/*7212*/ uint32 tribute_points;
/*7216*/ uint32 unknown7252;
/*7220*/ uint32 tribute_active; //1=active
/*7224*/ Tribute_Struct tributes[EQEmu::invtype::TRIBUTE_SIZE];
/*7224*/ Tribute_Struct tributes[EQ::invtype::TRIBUTE_SIZE];
/*7264*/ Disciplines_Struct disciplines;
/*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use)
/*7744*/ char unknown7780[160];
@@ -1077,7 +1080,7 @@ struct PlayerProfile_Struct
/*12800*/ uint32 expAA;
/*12804*/ uint32 aapoints; //avaliable, unspent
/*12808*/ uint8 unknown12844[36];
/*12844*/ Bandolier_Struct bandoliers[EQEmu::profile::BANDOLIERS_SIZE];
/*12844*/ Bandolier_Struct bandoliers[EQ::profile::BANDOLIERS_SIZE];
/*14124*/ uint8 unknown14160[4506];
/*18630*/ SuspendedMinion_Struct SuspendedMinion; // No longer in use
/*19240*/ uint32 timeentitledonaccount;
@@ -1095,16 +1098,16 @@ struct PlayerProfile_Struct
/*19568*/
// All player profile packets are translated and this overhead is ignored in out-bound packets
PlayerProfile_Struct() : m_player_profile_version(EQEmu::versions::MobVersion::Unknown) { }
PlayerProfile_Struct() : m_player_profile_version(EQ::versions::MobVersion::Unknown) { }
EQEmu::versions::MobVersion PlayerProfileVersion() { return m_player_profile_version; }
void SetPlayerProfileVersion(EQEmu::versions::MobVersion mob_version) { m_player_profile_version = EQEmu::versions::ValidateMobVersion(mob_version); }
void SetPlayerProfileVersion(EQEmu::versions::ClientVersion client_version) { SetPlayerProfileVersion(EQEmu::versions::ConvertClientVersionToMobVersion(client_version)); }
EQ::versions::MobVersion PlayerProfileVersion() { return m_player_profile_version; }
void SetPlayerProfileVersion(EQ::versions::MobVersion mob_version) { m_player_profile_version = EQ::versions::ValidateMobVersion(mob_version); }
void SetPlayerProfileVersion(EQ::versions::ClientVersion client_version) { SetPlayerProfileVersion(EQ::versions::ConvertClientVersionToMobVersion(client_version)); }
private:
// No need for gm flag since pp already has one
// No need for lookup pointer since this struct is not tied to any one system
EQEmu::versions::MobVersion m_player_profile_version;
EQ::versions::MobVersion m_player_profile_version;
};
@@ -1215,7 +1218,7 @@ struct WearChange_Struct {
/*010*/ uint32 elite_material; // 1 for Drakkin Elite Material
/*014*/ uint32 hero_forge_model; // New to VoA
/*018*/ uint32 unknown18; // New to RoF
/*022*/ EQEmu::textures::Tint_Struct color;
/*022*/ EQ::textures::Tint_Struct color;
/*026*/ uint8 wear_slot_id;
/*027*/
};
@@ -2123,7 +2126,7 @@ struct AdventureLeaderboard_Struct
/*struct Item_Shop_Struct {
uint16 merchantid;
uint8 itemtype;
EQEmu::ItemData item;
EQ::ItemData item;
uint8 iss_unknown001[6];
};*/
@@ -2149,7 +2152,7 @@ struct Illusion_Struct { //size: 256 - SoF
/*092*/ uint32 drakkin_heritage; //
/*096*/ uint32 drakkin_tattoo; //
/*100*/ uint32 drakkin_details; //
/*104*/ EQEmu::TintProfile armor_tint; //
/*104*/ EQ::TintProfile armor_tint; //
/*140*/ uint8 eyecolor1; // Field Not Identified in any Illusion Struct
/*141*/ uint8 eyecolor2; // Field Not Identified in any Illusion Struct
/*142*/ uint8 unknown138[114]; //
@@ -3489,8 +3492,8 @@ struct SelectTributeReply_Struct {
struct TributeInfo_Struct {
uint32 active; //0 == inactive, 1 == active
uint32 tributes[EQEmu::invtype::TRIBUTE_SIZE]; //-1 == NONE
uint32 tiers[EQEmu::invtype::TRIBUTE_SIZE]; //all 00's
uint32 tributes[EQ::invtype::TRIBUTE_SIZE]; //-1 == NONE
uint32 tiers[EQ::invtype::TRIBUTE_SIZE]; //all 00's
uint32 tribute_master_id;
};
@@ -4401,7 +4404,7 @@ struct AnnoyingZoneUnknown_Struct {
};
struct LoadSpellSet_Struct {
uint32 spell[EQEmu::spells::SPELL_GEM_COUNT]; // 0xFFFFFFFF if no action, slot number if to unmem starting at 0
uint32 spell[EQ::spells::SPELL_GEM_COUNT]; // 0xFFFFFFFF if no action, slot number if to unmem starting at 0
uint32 unknown; //there seems to be an extra field in this packet...
};
@@ -4832,17 +4835,98 @@ struct BuffIcon_Struct
BuffIconEntry_Struct entries[0];
};
struct ExpeditionInfo_Struct
struct ExpeditionInvite_Struct
{
/*000*/ uint32 max_players;
/*004*/ char expedition_name[128];
/*132*/ char leader_name[64];
/*000*/ uint32 client_id; // unique character id
/*004*/ uint32 unknown004; // added after titanium
/*008*/ char inviter_name[64];
/*072*/ char expedition_name[128];
/*200*/ uint8 swapping; // 0: adding 1: swapping
/*201*/ char swap_name[64]; // if swapping, swap name being removed
/*265*/ uint8 padding[3];
/*268*/ uint16 dz_zone_id; // dz_id zone/instance pair, sent back in reply
/*270*/ uint16 dz_instance_id;
};
struct ExpeditionJoinPrompt_Struct
struct ExpeditionInviteResponse_Struct
{
/*000*/ char player_name[64];
/*064*/ char expedition_name[64];
/*000*/ uint32 unknown000;
/*004*/ uint32 unknown004; // added after titanium
/*008*/ uint16 dz_zone_id; // dz_id pair sent in invite
/*010*/ uint16 dz_instance_id;
/*012*/ uint8 accepted; // 0: declined 1: accepted
/*013*/ uint8 swapping; // 0: adding 1: swapping (sent in invite)
/*014*/ char swap_name[64]; // swap name sent in invite
/*078*/ uint8 unknown078; // padding garbage?
/*079*/ uint8 unknown079; // padding garbage?
};
struct ExpeditionInfo_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 unknown004; // added after titanium
/*008*/ uint32 assigned; // padded bool, 0: not in expedition (clear data), 1: in expedition
/*012*/ uint32 max_players;
/*016*/ char expedition_name[128];
/*144*/ char leader_name[64];
};
struct ExpeditionMemberEntry_Struct
{
/*000*/ char name[64]; // variable length, null terminated, max 0x40 (64)
/*064*/ uint8 expedition_status; // 0: unknown, 1: Online, 2: Offline, 3: In Dynamic Zone, 4: Link Dead
};
struct ExpeditionMemberList_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 member_count;
/*008*/ ExpeditionMemberEntry_Struct members[0]; // variable length
};
struct ExpeditionMemberListName_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 unknown004;
/*008*/ uint32 add_name; // padded bool, 0: remove name, 1: add name with unknown status
/*012*/ char name[64];
};
struct ExpeditionLockoutTimerEntry_Struct
{
/*000*/ char expedition_name[128]; // variable length, null terminated, max 0x80 (128)
/*000*/ uint32 seconds_remaining;
/*000*/ int32 event_type; // seen -1 (0xffffffff) for replay timers and 1 for event timers
/*000*/ char event_name[256]; // variable length, null terminated, max 0x100 (256)
};
struct ExpeditionLockoutTimers_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 count;
/*008*/ ExpeditionLockoutTimerEntry_Struct timers[0];
};
struct ExpeditionSetLeaderName_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 unknown004;
/*008*/ char leader_name[64];
};
struct ExpeditionCommand_Struct
{
/*000*/ uint32 unknown000;
/*004*/ uint32 unknown004;
/*008*/ char name[64];
};
struct ExpeditionCommandSwap_Struct
{
/*000*/ uint32 unknown000;
/*004*/ uint32 unknown004;
/*008*/ char add_player_name[64]; // swap to (player must confirm)
/*072*/ char rem_player_name[64]; // swap from
};
struct ExpeditionExpireWarning
@@ -4850,48 +4934,67 @@ struct ExpeditionExpireWarning
/*008*/ uint32 minutes_remaining;
};
struct ExpeditionCompassEntry_Struct
struct DynamicZoneCompassEntry_Struct
{
/*000*/ uint32 enabled; //guess
/*004*/ float y;
/*008*/ float x;
/*012*/ float z;
/*000*/ uint16 dz_zone_id; // target dz id pair
/*002*/ uint16 dz_instance_id;
/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
/*008*/ uint32 unknown008;
/*012*/ float y;
/*016*/ float x;
/*020*/ float z;
};
struct ExpeditionCompass_Struct
struct DynamicZoneCompass_Struct
{
/*000*/ uint32 client_id;
/*000*/ uint32 count;
/*004*/ ExpeditionCompassEntry_Struct entries[0];
/*004*/ DynamicZoneCompassEntry_Struct entries[0];
};
struct ExpeditionMemberEntry_Struct
struct DynamicZoneChooseZoneEntry_Struct
{
char name[64];
char status;
/*000*/ uint16 dz_zone_id; // dz_id pair
/*002*/ uint16 dz_instance_id;
/*004*/ uint32 unknown_id1; // seen 28 00 00 00 (40), sent back in reply
/*008*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest -- sent back in reply
/*012*/ uint32 unknown_id2; // possibly an id based on dz type, for expeditions this was same as dz_id (zone|instance) but task dz was different
/*016*/ char description[128]; // variable length, null terminated
/*144*/ char leader_name[64]; // variable length, null terminated
};
struct ExpeditionMemberList_Struct
struct DynamicZoneChooseZone_Struct
{
/*000*/ uint32 count;
/*004*/ ExpeditionMemberEntry_Struct entries[0];
/*000*/ uint32 client_id;
/*004*/ uint32 count;
/*008*/ DynamicZoneChooseZoneEntry_Struct choices[0];
};
struct ExpeditionLockoutEntry_Struct
struct DynamicZoneChooseZoneReply_Struct
{
/*000*/ uint32 time_left;
/*004*/ char expedition[128];
/*132*/ char expedition_event[128];
/*000*/ uint32 unknown000; // ff ff ff ff
/*004*/ uint32 unknown004; // seen 69 00 00 00
/*008*/ uint32 unknown008; // ff ff ff ff
/*012*/ uint32 unknown_id1; // from choose zone entry message
/*016*/ uint16 dz_zone_id; // dz_id pair
/*018*/ uint16 dz_instance_id;
/*020*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest
/*024*/ uint32 unknown_id2; // from choose zone entry message
/*028*/ uint32 unknown028; // 00 00 00 00
/*032*/ uint32 unknown032; // always same as unknown044
/*036*/ uint32 unknown036;
/*040*/ uint32 unknown040;
/*044*/ uint32 unknown044; // always same as unknown032
/*048*/ uint32 unknown048; // seen 01 00 00 00 and 02 00 00 00
};
struct ExpeditionLockoutList_Struct
struct KickPlayers_Struct
{
/*000*/ uint32 count;
/*004*/ ExpeditionLockoutEntry_Struct entries[0];
};
struct ExpeditionLeaderSet_Struct
{
/*000*/ char leader_name[64];
/*000*/ char char_name[64];
/*064*/ uint32 unknown064; // always 0
/*068*/ uint8 kick_expedition; // true if /kickplayers exp
/*069*/ uint8 kick_task; // true if /kickplayers task
/*070*/ uint8 padding[2];
};
struct CorpseDrag_Struct
@@ -5341,18 +5444,20 @@ struct MercenaryMerchantResponse_Struct {
struct ServerLootItem_Struct {
uint32 item_id; // uint32 item_id;
int16 equip_slot; // int16 equip_slot;
uint16 charges; // uint8 charges;
uint16 lootslot; // uint16 lootslot;
uint32 aug_1; // uint32 aug_1;
uint32 aug_2; // uint32 aug_2;
uint32 aug_3; // uint32 aug_3;
uint32 aug_4; // uint32 aug_4;
uint32 aug_5; // uint32 aug_5;
uint32 aug_6; // uint32 aug_5;
uint8 attuned;
uint8 min_level;
uint8 max_level;
int16 equip_slot; // int16 equip_slot;
uint16 charges; // uint8 charges;
uint16 lootslot; // uint16 lootslot;
uint32 aug_1; // uint32 aug_1;
uint32 aug_2; // uint32 aug_2;
uint32 aug_3; // uint32 aug_3;
uint32 aug_4; // uint32 aug_4;
uint32 aug_5; // uint32 aug_5;
uint32 aug_6; // uint32 aug_5;
uint8 attuned;
uint16 trivial_min_level;
uint16 trivial_max_level;
uint16 npc_min_level;
uint16 npc_max_level;
};
//Found in client near a ref to the string:
+1 -1
View File
@@ -100,7 +100,7 @@ public:
virtual MatchState CheckSignature(const Signature *sig) { return MatchFailed; }
virtual EQStreamState GetState() = 0;
virtual void SetOpcodeManager(OpcodeManager **opm) = 0;
virtual const EQEmu::versions::ClientVersion ClientVersion() const { return EQEmu::versions::ClientVersion::Unknown; }
virtual const EQ::versions::ClientVersion ClientVersion() const { return EQ::versions::ClientVersion::Unknown; }
virtual Stats GetStats() const = 0;
virtual void ResetStats() = 0;
virtual EQStreamManagerInterface* GetManager() const = 0;
+1 -1
View File
@@ -22,7 +22,7 @@ std::string EQStreamProxy::Describe() const {
return(m_structs->Describe());
}
const EQEmu::versions::ClientVersion EQStreamProxy::ClientVersion() const
const EQ::versions::ClientVersion EQStreamProxy::ClientVersion() const
{
return m_structs->ClientVersion();
}
+1 -1
View File
@@ -28,7 +28,7 @@ public:
virtual void RemoveData();
virtual bool CheckState(EQStreamState state);
virtual std::string Describe() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
virtual const EQ::versions::ClientVersion ClientVersion() const;
virtual EQStreamState GetState();
virtual void SetOpcodeManager(OpcodeManager **opm);
virtual Stats GetStats() const;
+1 -1
View File
@@ -18,7 +18,7 @@
#include "eqemu_exception.h"
namespace EQEmu
namespace EQ
{
Exception::Exception(const char* name, const std::string& description, const char* file, long line)
: line_(line),
+2 -2
View File
@@ -22,7 +22,7 @@
#include <sstream>
#include <exception>
namespace EQEmu
namespace EQ
{
//! EQEmu Exception Class
/*!
@@ -104,7 +104,7 @@ namespace EQEmu
} // EQEmu
#ifndef EQ_EXCEPT
#define EQ_EXCEPT(n, d) throw EQEmu::Exception(n, d, __FILE__, __LINE__)
#define EQ_EXCEPT(n, d) throw EQ::Exception(n, d, __FILE__, __LINE__)
#endif
#endif
+1
View File
@@ -126,6 +126,7 @@ void EQEmuLogSys::LoadLogSettingsDefaults()
log_settings[Logs::NPCScaling].log_to_gmsay = static_cast<uint8>(Logs::General);
log_settings[Logs::HotReload].log_to_gmsay = static_cast<uint8>(Logs::General);
log_settings[Logs::HotReload].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::Loot].log_to_gmsay = static_cast<uint8>(Logs::General);
/**
* RFC 5424
+12
View File
@@ -116,6 +116,12 @@ namespace Logs {
Aura,
HotReload,
Merchants,
ZonePoints,
Loot,
Expeditions,
DynamicZones,
Group,
Adventure,
MaxCategoryID /* Don't Remove this */
};
@@ -191,6 +197,12 @@ namespace Logs {
"Aura",
"HotReload",
"Merchants",
"ZonePoints",
"Loot",
"Expeditions",
"DynamicZones",
"Group",
"Adventure",
};
}
+93 -1
View File
@@ -161,6 +161,16 @@
OutF(LogSys, Logs::Detail, Logs::Doors, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogGroup(message, ...) do {\
if (LogSys.log_settings[Logs::Group].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Group, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogGroupDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Group].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Group, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogGuilds(message, ...) do {\
if (LogSys.log_settings[Logs::Guilds].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Guilds, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
@@ -581,6 +591,61 @@
OutF(LogSys, Logs::Detail, Logs::Merchants, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogZonePoints(message, ...) do {\
if (LogSys.log_settings[Logs::ZonePoints].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::ZonePoints, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogZonePointsDetail(message, ...) do {\
if (LogSys.log_settings[Logs::ZonePoints].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::ZonePoints, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogLoot(message, ...) do {\
if (LogSys.log_settings[Logs::Loot].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Loot, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogLootDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Loot].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Loot, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogExpeditions(message, ...) do {\
if (LogSys.log_settings[Logs::Expeditions].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Expeditions, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogExpeditionsModerate(message, ...) do {\
if (LogSys.log_settings[Logs::Expeditions].is_category_enabled == 1)\
OutF(LogSys, Logs::Moderate, Logs::Expeditions, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogExpeditionsDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Expeditions].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Expeditions, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogDynamicZones(message, ...) do {\
if (LogSys.log_settings[Logs::DynamicZones].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::DynamicZones, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogDynamicZonesDetail(message, ...) do {\
if (LogSys.log_settings[Logs::DynamicZones].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::DynamicZones, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogAdventure(message, ...) do {\
if (LogSys.log_settings[Logs::Adventure].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Adventure, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogAdventureDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Adventure].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Adventure, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define Log(debug_level, log_category, message, ...) do {\
if (LogSys.log_settings[log_category].is_category_enabled == 1)\
LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
@@ -674,6 +739,12 @@
#define LogDoorsDetail(message, ...) do {\
} while (0)
#define LogGroup(message, ...) do {\
} while (0)
#define LogGroupDetail(message, ...) do {\
} while (0)
#define LogGuilds(message, ...) do {\
} while (0)
@@ -926,6 +997,27 @@
#define LogMerchantsDetail(message, ...) do {\
} while (0)
#define LogZonePoints(message, ...) do {\
} while (0)
#define LogZonePointsDetail(message, ...) do {\
} while (0)
#define LogExpeditions(message, ...) do {\
} while (0)
#define LogExpeditionsModerate(message, ...) do {\
} while (0)
#define LogExpeditionsDetail(message, ...) do {\
} while (0)
#define LogDynamicZones(message, ...) do {\
} while (0)
#define LogDynamicZonesDetail(message, ...) do {\
} while (0)
#define Log(debug_level, log_category, message, ...) do {\
} while (0)
@@ -933,4 +1025,4 @@
} while (0)
#endif
#endif //EQEMU_EQEMU_LOGSYS_LOG_ALIASES_H
#endif //EQEMU_EQEMU_LOGSYS_LOG_ALIASES_H
+4
View File
@@ -25,6 +25,10 @@ namespace EQ
uv_run(&m_loop, UV_RUN_DEFAULT);
}
void Shutdown() {
uv_stop(&m_loop);
}
uv_loop_t* Handle() { return &m_loop; }
private:
+3 -3
View File
@@ -8,7 +8,7 @@ namespace EQ {
class Task
{
public:
typedef std::function<void(const EQEmu::Any&)> ResolveFn;
typedef std::function<void(const EQ::Any&)> ResolveFn;
typedef std::function<void(const std::exception&)> RejectFn;
typedef std::function<void()> FinallyFn;
typedef std::function<void(ResolveFn, RejectFn)> TaskFn;
@@ -19,7 +19,7 @@ namespace EQ {
RejectFn on_catch;
FinallyFn on_finally;
bool has_result;
EQEmu::Any result;
EQ::Any result;
bool has_error;
std::exception error;
};
@@ -63,7 +63,7 @@ namespace EQ {
uv_queue_work(EventLoop::Get().Handle(), m_work, [](uv_work_t* req) {
TaskBaton *baton = (TaskBaton*)req->data;
baton->fn([baton](const EQEmu::Any& result) {
baton->fn([baton](const EQ::Any& result) {
baton->has_error = false;
baton->has_result = true;
baton->result = result;
+1 -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 */
EQEmu::TextureMaterialProfile pet_items; /* Not Used */
EQ::TextureMaterialProfile pet_items; /* Not Used */
char merc_name[64]; /* Used */
uint32 aa_effects; /* Used */
+1 -1
View File
@@ -23,7 +23,7 @@
#include "eqemu_exception.h"
#include "types.h"
namespace EQEmu {
namespace EQ {
/*! Simple HashSet designed to be used in fixed memory that may be difficult to use an
allocator for (shared memory), we assume all keys are unsigned int
+1 -1
View File
@@ -23,7 +23,7 @@
#include "eqemu_exception.h"
#include "types.h"
namespace EQEmu {
namespace EQ {
/*! Simple HashSet designed to be used in fixed memory that may be difficult to use an
allocator for (shared memory), we assume all keys are unsigned int, values are a pointer and size
+97 -97
View File
@@ -33,7 +33,7 @@
#include <iostream>
std::list<EQEmu::ItemInstance*> dirty_inst;
std::list<EQ::ItemInstance*> dirty_inst;
//
@@ -48,50 +48,50 @@ ItemInstQueue::~ItemInstQueue()
}
// Put item onto back of queue
void ItemInstQueue::push(EQEmu::ItemInstance* inst)
void ItemInstQueue::push(EQ::ItemInstance* inst)
{
m_list.push_back(inst);
}
// Put item onto front of queue
void ItemInstQueue::push_front(EQEmu::ItemInstance* inst)
void ItemInstQueue::push_front(EQ::ItemInstance* inst)
{
m_list.push_front(inst);
}
// Remove item from front of queue
EQEmu::ItemInstance* ItemInstQueue::pop()
EQ::ItemInstance* ItemInstQueue::pop()
{
if (m_list.empty())
return nullptr;
EQEmu::ItemInstance* inst = m_list.front();
EQ::ItemInstance* inst = m_list.front();
m_list.pop_front();
return inst;
}
// Remove item from back of queue
EQEmu::ItemInstance* ItemInstQueue::pop_back()
EQ::ItemInstance* ItemInstQueue::pop_back()
{
if (m_list.empty())
return nullptr;
EQEmu::ItemInstance* inst = m_list.back();
EQ::ItemInstance* inst = m_list.back();
m_list.pop_back();
return inst;
}
// Look at item at front of queue
EQEmu::ItemInstance* ItemInstQueue::peek_front() const
EQ::ItemInstance* ItemInstQueue::peek_front() const
{
return (m_list.empty()) ? nullptr : m_list.front();
}
//
// class EQEmu::InventoryProfile
// class EQ::InventoryProfile
//
EQEmu::InventoryProfile::~InventoryProfile()
EQ::InventoryProfile::~InventoryProfile()
{
for (auto iter = m_worn.begin(); iter != m_worn.end(); ++iter) {
safe_delete(iter->second);
@@ -119,18 +119,18 @@ EQEmu::InventoryProfile::~InventoryProfile()
m_trade.clear();
}
void EQEmu::InventoryProfile::SetInventoryVersion(versions::MobVersion inventory_version) {
void EQ::InventoryProfile::SetInventoryVersion(versions::MobVersion inventory_version) {
m_mob_version = versions::ValidateMobVersion(inventory_version);
SetGMInventory(m_gm_inventory);
}
void EQEmu::InventoryProfile::SetGMInventory(bool gmi_flag) {
void EQ::InventoryProfile::SetGMInventory(bool gmi_flag) {
m_gm_inventory = gmi_flag;
m_lookup = inventory::DynamicLookup(m_mob_version, gmi_flag);
}
void EQEmu::InventoryProfile::CleanDirty() {
void EQ::InventoryProfile::CleanDirty() {
auto iter = dirty_inst.begin();
while (iter != dirty_inst.end()) {
delete (*iter);
@@ -139,14 +139,14 @@ void EQEmu::InventoryProfile::CleanDirty() {
dirty_inst.clear();
}
void EQEmu::InventoryProfile::MarkDirty(ItemInstance *inst) {
void EQ::InventoryProfile::MarkDirty(ItemInstance *inst) {
if (inst) {
dirty_inst.push_back(inst);
}
}
// Retrieve item at specified slot; returns false if item not found
EQEmu::ItemInstance* EQEmu::InventoryProfile::GetItem(int16 slot_id) const
EQ::ItemInstance* EQ::InventoryProfile::GetItem(int16 slot_id) const
{
ItemInstance* result = nullptr;
@@ -219,31 +219,31 @@ EQEmu::ItemInstance* EQEmu::InventoryProfile::GetItem(int16 slot_id) const
}
// Retrieve item at specified position within bag
EQEmu::ItemInstance* EQEmu::InventoryProfile::GetItem(int16 slot_id, uint8 bagidx) const
EQ::ItemInstance* EQ::InventoryProfile::GetItem(int16 slot_id, uint8 bagidx) const
{
return GetItem(InventoryProfile::CalcSlotId(slot_id, bagidx));
}
// Put an item snto specified slot
int16 EQEmu::InventoryProfile::PutItem(int16 slot_id, const ItemInstance& inst)
int16 EQ::InventoryProfile::PutItem(int16 slot_id, const ItemInstance& inst)
{
if (slot_id <= EQEmu::invslot::POSSESSIONS_END && slot_id >= EQEmu::invslot::POSSESSIONS_BEGIN) {
if (slot_id <= EQ::invslot::POSSESSIONS_END && slot_id >= EQ::invslot::POSSESSIONS_BEGIN) {
if ((((uint64)1 << slot_id) & m_lookup->PossessionsBitmask) == 0)
return EQEmu::invslot::SLOT_INVALID;
return EQ::invslot::SLOT_INVALID;
}
else if (slot_id <= EQEmu::invbag::GENERAL_BAGS_END && slot_id >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
auto temp_slot = EQEmu::invslot::GENERAL_BEGIN + ((slot_id - EQEmu::invbag::GENERAL_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT);
else if (slot_id <= EQ::invbag::GENERAL_BAGS_END && slot_id >= EQ::invbag::GENERAL_BAGS_BEGIN) {
auto temp_slot = EQ::invslot::GENERAL_BEGIN + ((slot_id - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT);
if ((((uint64)1 << temp_slot) & m_lookup->PossessionsBitmask) == 0)
return EQEmu::invslot::SLOT_INVALID;
return EQ::invslot::SLOT_INVALID;
}
else if (slot_id <= EQEmu::invslot::BANK_END && slot_id >= EQEmu::invslot::BANK_BEGIN) {
if ((slot_id - EQEmu::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank)
return EQEmu::invslot::SLOT_INVALID;
else if (slot_id <= EQ::invslot::BANK_END && slot_id >= EQ::invslot::BANK_BEGIN) {
if ((slot_id - EQ::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank)
return EQ::invslot::SLOT_INVALID;
}
else if (slot_id <= EQEmu::invbag::BANK_BAGS_END && slot_id >= EQEmu::invbag::BANK_BAGS_BEGIN) {
auto temp_slot = (slot_id - EQEmu::invbag::BANK_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT;
else if (slot_id <= EQ::invbag::BANK_BAGS_END && slot_id >= EQ::invbag::BANK_BAGS_BEGIN) {
auto temp_slot = (slot_id - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT;
if (temp_slot >= m_lookup->InventoryTypeSize.Bank)
return EQEmu::invslot::SLOT_INVALID;
return EQ::invslot::SLOT_INVALID;
}
// Clean up item already in slot (if exists)
@@ -259,17 +259,17 @@ int16 EQEmu::InventoryProfile::PutItem(int16 slot_id, const ItemInstance& inst)
return _PutItem(slot_id, inst.Clone());
}
int16 EQEmu::InventoryProfile::PushCursor(const ItemInstance &inst) {
int16 EQ::InventoryProfile::PushCursor(const ItemInstance &inst) {
m_cursor.push(inst.Clone());
return invslot::slotCursor;
}
EQEmu::ItemInstance* EQEmu::InventoryProfile::GetCursorItem() {
EQ::ItemInstance* EQ::InventoryProfile::GetCursorItem() {
return m_cursor.peek_front();
}
// Swap items in inventory
bool EQEmu::InventoryProfile::SwapItem(
bool EQ::InventoryProfile::SwapItem(
int16 source_slot,
int16 destination_slot,
SwapItemFailState &fail_state,
@@ -280,54 +280,54 @@ bool EQEmu::InventoryProfile::SwapItem(
) {
fail_state = swapInvalid;
if (source_slot <= EQEmu::invslot::POSSESSIONS_END && source_slot >= EQEmu::invslot::POSSESSIONS_BEGIN) {
if (source_slot <= EQ::invslot::POSSESSIONS_END && source_slot >= EQ::invslot::POSSESSIONS_BEGIN) {
if ((((uint64) 1 << source_slot) & m_lookup->PossessionsBitmask) == 0) {
fail_state = swapNotAllowed;
return false;
}
}
else if (source_slot <= EQEmu::invbag::GENERAL_BAGS_END && source_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
auto temp_slot = EQEmu::invslot::GENERAL_BEGIN + ((source_slot - EQEmu::invbag::GENERAL_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT);
else if (source_slot <= EQ::invbag::GENERAL_BAGS_END && source_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
auto temp_slot = EQ::invslot::GENERAL_BEGIN + ((source_slot - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT);
if ((((uint64)1 << temp_slot) & m_lookup->PossessionsBitmask) == 0) {
fail_state = swapNotAllowed;
return false;
}
}
else if (source_slot <= EQEmu::invslot::BANK_END && source_slot >= EQEmu::invslot::BANK_BEGIN) {
if ((source_slot - EQEmu::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank) {
else if (source_slot <= EQ::invslot::BANK_END && source_slot >= EQ::invslot::BANK_BEGIN) {
if ((source_slot - EQ::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank) {
fail_state = swapNotAllowed;
return false;
}
}
else if (source_slot <= EQEmu::invbag::BANK_BAGS_END && source_slot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
auto temp_slot = (source_slot - EQEmu::invbag::BANK_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT;
else if (source_slot <= EQ::invbag::BANK_BAGS_END && source_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
auto temp_slot = (source_slot - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT;
if (temp_slot >= m_lookup->InventoryTypeSize.Bank) {
fail_state = swapNotAllowed;
return false;
}
}
if (destination_slot <= EQEmu::invslot::POSSESSIONS_END && destination_slot >= EQEmu::invslot::POSSESSIONS_BEGIN) {
if (destination_slot <= EQ::invslot::POSSESSIONS_END && destination_slot >= EQ::invslot::POSSESSIONS_BEGIN) {
if ((((uint64)1 << destination_slot) & m_lookup->PossessionsBitmask) == 0) {
fail_state = swapNotAllowed;
return false;
}
}
else if (destination_slot <= EQEmu::invbag::GENERAL_BAGS_END && destination_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
auto temp_slot = EQEmu::invslot::GENERAL_BEGIN + ((destination_slot - EQEmu::invbag::GENERAL_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT);
else if (destination_slot <= EQ::invbag::GENERAL_BAGS_END && destination_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
auto temp_slot = EQ::invslot::GENERAL_BEGIN + ((destination_slot - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT);
if ((((uint64)1 << temp_slot) & m_lookup->PossessionsBitmask) == 0) {
fail_state = swapNotAllowed;
return false;
}
}
else if (destination_slot <= EQEmu::invslot::BANK_END && destination_slot >= EQEmu::invslot::BANK_BEGIN) {
if ((destination_slot - EQEmu::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank) {
else if (destination_slot <= EQ::invslot::BANK_END && destination_slot >= EQ::invslot::BANK_BEGIN) {
if ((destination_slot - EQ::invslot::BANK_BEGIN) >= m_lookup->InventoryTypeSize.Bank) {
fail_state = swapNotAllowed;
return false;
}
}
else if (destination_slot <= EQEmu::invbag::BANK_BAGS_END && destination_slot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
auto temp_slot = (destination_slot - EQEmu::invbag::BANK_BAGS_BEGIN) / EQEmu::invbag::SLOT_COUNT;
else if (destination_slot <= EQ::invbag::BANK_BAGS_END && destination_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
auto temp_slot = (destination_slot - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT;
if (temp_slot >= m_lookup->InventoryTypeSize.Bank) {
fail_state = swapNotAllowed;
return false;
@@ -399,7 +399,7 @@ bool EQEmu::InventoryProfile::SwapItem(
}
// Remove item from inventory (with memory delete)
bool EQEmu::InventoryProfile::DeleteItem(int16 slot_id, uint8 quantity) {
bool EQ::InventoryProfile::DeleteItem(int16 slot_id, uint8 quantity) {
// Pop item out of inventory map (or queue)
ItemInstance *item_to_delete = PopItem(slot_id);
@@ -434,7 +434,7 @@ bool EQEmu::InventoryProfile::DeleteItem(int16 slot_id, uint8 quantity) {
}
// Checks All items in a bag for No Drop
bool EQEmu::InventoryProfile::CheckNoDrop(int16 slot_id, bool recurse)
bool EQ::InventoryProfile::CheckNoDrop(int16 slot_id, bool recurse)
{
ItemInstance* inst = GetItem(slot_id);
if (!inst)
@@ -445,7 +445,7 @@ bool EQEmu::InventoryProfile::CheckNoDrop(int16 slot_id, bool recurse)
// Remove item from bucket without memory delete
// Returns item pointer if full delete was successful
EQEmu::ItemInstance* EQEmu::InventoryProfile::PopItem(int16 slot_id)
EQ::ItemInstance* EQ::InventoryProfile::PopItem(int16 slot_id)
{
ItemInstance* p = nullptr;
@@ -488,7 +488,7 @@ EQEmu::ItemInstance* EQEmu::InventoryProfile::PopItem(int16 slot_id)
return p;
}
bool EQEmu::InventoryProfile::HasSpaceForItem(const ItemData *ItemToTry, int16 Quantity) {
bool EQ::InventoryProfile::HasSpaceForItem(const ItemData *ItemToTry, int16 Quantity) {
if (ItemToTry->Stackable) {
@@ -592,7 +592,7 @@ bool EQEmu::InventoryProfile::HasSpaceForItem(const ItemData *ItemToTry, int16 Q
//This function has a flaw in that it only returns the last stack that it looked at
//when quantity is greater than 1 and not all of quantity can be found in 1 stack.
int16 EQEmu::InventoryProfile::HasItem(uint32 item_id, uint8 quantity, uint8 where)
int16 EQ::InventoryProfile::HasItem(uint32 item_id, uint8 quantity, uint8 where)
{
int16 slot_id = INVALID_INDEX;
@@ -642,7 +642,7 @@ int16 EQEmu::InventoryProfile::HasItem(uint32 item_id, uint8 quantity, uint8 whe
}
//this function has the same quantity flaw mentioned above in HasItem()
int16 EQEmu::InventoryProfile::HasItemByUse(uint8 use, uint8 quantity, uint8 where)
int16 EQ::InventoryProfile::HasItemByUse(uint8 use, uint8 quantity, uint8 where)
{
int16 slot_id = INVALID_INDEX;
@@ -688,7 +688,7 @@ int16 EQEmu::InventoryProfile::HasItemByUse(uint8 use, uint8 quantity, uint8 whe
return slot_id;
}
int16 EQEmu::InventoryProfile::HasItemByLoreGroup(uint32 loregroup, uint8 where)
int16 EQ::InventoryProfile::HasItemByLoreGroup(uint32 loregroup, uint8 where)
{
int16 slot_id = INVALID_INDEX;
@@ -736,7 +736,7 @@ int16 EQEmu::InventoryProfile::HasItemByLoreGroup(uint32 loregroup, uint8 where)
// Locate an available inventory slot
// Returns slot_id when there's one available, else SLOT_INVALID
int16 EQEmu::InventoryProfile::FindFreeSlot(bool for_bag, bool try_cursor, uint8 min_size, bool is_arrow)
int16 EQ::InventoryProfile::FindFreeSlot(bool for_bag, bool try_cursor, uint8 min_size, bool is_arrow)
{
// Check basic inventory
for (int16 i = invslot::GENERAL_BEGIN; i <= invslot::GENERAL_END; i++) {
@@ -786,7 +786,7 @@ int16 EQEmu::InventoryProfile::FindFreeSlot(bool for_bag, bool try_cursor, uint8
}
// This is a mix of HasSpaceForItem and FindFreeSlot..due to existing coding behavior, it was better to add a new helper function...
int16 EQEmu::InventoryProfile::FindFreeSlotForTradeItem(const ItemInstance* inst, int16 general_start, uint8 bag_start) {
int16 EQ::InventoryProfile::FindFreeSlotForTradeItem(const ItemInstance* inst, int16 general_start, uint8 bag_start) {
// Do not arbitrarily use this function..it is designed for use with Client::ResetTrade() and Client::FinishTrade().
// If you have a need, use it..but, understand it is not a suitable replacement for InventoryProfile::FindFreeSlot().
//
@@ -924,7 +924,7 @@ int16 EQEmu::InventoryProfile::FindFreeSlotForTradeItem(const ItemInstance* inst
}
// Opposite of below: Get parent bag slot_id from a slot inside of bag
int16 EQEmu::InventoryProfile::CalcSlotId(int16 slot_id) {
int16 EQ::InventoryProfile::CalcSlotId(int16 slot_id) {
int16 parent_slot_id = INVALID_INDEX;
// this is not a bag range... using this risks over-writing existing items
@@ -952,7 +952,7 @@ int16 EQEmu::InventoryProfile::CalcSlotId(int16 slot_id) {
}
// Calculate slot_id for an item within a bag
int16 EQEmu::InventoryProfile::CalcSlotId(int16 bagslot_id, uint8 bagidx) {
int16 EQ::InventoryProfile::CalcSlotId(int16 bagslot_id, uint8 bagidx) {
if (!InventoryProfile::SupportsContainers(bagslot_id))
return INVALID_INDEX;
@@ -977,7 +977,7 @@ int16 EQEmu::InventoryProfile::CalcSlotId(int16 bagslot_id, uint8 bagidx) {
return slot_id;
}
uint8 EQEmu::InventoryProfile::CalcBagIdx(int16 slot_id) {
uint8 EQ::InventoryProfile::CalcBagIdx(int16 slot_id) {
uint8 index = 0;
// this is not a bag range... using this risks over-writing existing items
@@ -1006,7 +1006,7 @@ uint8 EQEmu::InventoryProfile::CalcBagIdx(int16 slot_id) {
return index;
}
int16 EQEmu::InventoryProfile::CalcSlotFromMaterial(uint8 material)
int16 EQ::InventoryProfile::CalcSlotFromMaterial(uint8 material)
{
switch (material)
{
@@ -1033,7 +1033,7 @@ int16 EQEmu::InventoryProfile::CalcSlotFromMaterial(uint8 material)
}
}
uint8 EQEmu::InventoryProfile::CalcMaterialFromSlot(int16 equipslot)
uint8 EQ::InventoryProfile::CalcMaterialFromSlot(int16 equipslot)
{
switch (equipslot)
{
@@ -1061,7 +1061,7 @@ uint8 EQEmu::InventoryProfile::CalcMaterialFromSlot(int16 equipslot)
}
}
bool EQEmu::InventoryProfile::CanItemFitInContainer(const ItemData *ItemToTry, const ItemData *Container) {
bool EQ::InventoryProfile::CanItemFitInContainer(const ItemData *ItemToTry, const ItemData *Container) {
if (!ItemToTry || !Container)
return false;
@@ -1078,7 +1078,7 @@ bool EQEmu::InventoryProfile::CanItemFitInContainer(const ItemData *ItemToTry, c
return true;
}
bool EQEmu::InventoryProfile::SupportsClickCasting(int16 slot_id)
bool EQ::InventoryProfile::SupportsClickCasting(int16 slot_id)
{
// there are a few non-potion items that identify as ItemTypePotion..so, we still need to ubiquitously include the equipment range
if (slot_id >= invslot::EQUIPMENT_BEGIN && slot_id <= invslot::EQUIPMENT_END) {
@@ -1095,7 +1095,7 @@ bool EQEmu::InventoryProfile::SupportsClickCasting(int16 slot_id)
return false;
}
bool EQEmu::InventoryProfile::SupportsPotionBeltCasting(int16 slot_id)
bool EQ::InventoryProfile::SupportsPotionBeltCasting(int16 slot_id)
{
// does this have the same criteria as 'SupportsClickCasting' above? (bag clicking per client)
if (slot_id >= invslot::EQUIPMENT_BEGIN && slot_id <= invslot::EQUIPMENT_END) {
@@ -1112,7 +1112,7 @@ bool EQEmu::InventoryProfile::SupportsPotionBeltCasting(int16 slot_id)
}
// Test whether a given slot can support a container item
bool EQEmu::InventoryProfile::SupportsContainers(int16 slot_id)
bool EQ::InventoryProfile::SupportsContainers(int16 slot_id)
{
if ((slot_id == invslot::slotCursor) ||
(slot_id >= invslot::GENERAL_BEGIN && slot_id <= invslot::GENERAL_END) ||
@@ -1126,7 +1126,7 @@ bool EQEmu::InventoryProfile::SupportsContainers(int16 slot_id)
return false;
}
int EQEmu::InventoryProfile::GetSlotByItemInst(ItemInstance *inst) {
int EQ::InventoryProfile::GetSlotByItemInst(ItemInstance *inst) {
if (!inst)
return INVALID_INDEX;
@@ -1162,7 +1162,7 @@ int EQEmu::InventoryProfile::GetSlotByItemInst(ItemInstance *inst) {
return INVALID_INDEX;
}
uint8 EQEmu::InventoryProfile::FindBrightestLightType()
uint8 EQ::InventoryProfile::FindBrightestLightType()
{
uint8 brightest_light_type = 0;
@@ -1213,7 +1213,7 @@ uint8 EQEmu::InventoryProfile::FindBrightestLightType()
return brightest_light_type;
}
void EQEmu::InventoryProfile::dumpEntireInventory() {
void EQ::InventoryProfile::dumpEntireInventory() {
dumpWornItems();
dumpInventory();
@@ -1223,29 +1223,29 @@ void EQEmu::InventoryProfile::dumpEntireInventory() {
std::cout << std::endl;
}
void EQEmu::InventoryProfile::dumpWornItems() {
void EQ::InventoryProfile::dumpWornItems() {
std::cout << "Worn items:" << std::endl;
dumpItemCollection(m_worn);
}
void EQEmu::InventoryProfile::dumpInventory() {
void EQ::InventoryProfile::dumpInventory() {
std::cout << "Inventory items:" << std::endl;
dumpItemCollection(m_inv);
}
void EQEmu::InventoryProfile::dumpBankItems() {
void EQ::InventoryProfile::dumpBankItems() {
std::cout << "Bank items:" << std::endl;
dumpItemCollection(m_bank);
}
void EQEmu::InventoryProfile::dumpSharedBankItems() {
void EQ::InventoryProfile::dumpSharedBankItems() {
std::cout << "Shared Bank items:" << std::endl;
dumpItemCollection(m_shbank);
}
int EQEmu::InventoryProfile::GetSlotByItemInstCollection(const std::map<int16, ItemInstance*> &collection, ItemInstance *inst) {
int EQ::InventoryProfile::GetSlotByItemInstCollection(const std::map<int16, ItemInstance*> &collection, ItemInstance *inst) {
for (auto iter = collection.begin(); iter != collection.end(); ++iter) {
ItemInstance *t_inst = iter->second;
if (t_inst == inst) {
@@ -1261,10 +1261,10 @@ int EQEmu::InventoryProfile::GetSlotByItemInstCollection(const std::map<int16, I
}
}
return EQEmu::invslot::SLOT_INVALID;
return EQ::invslot::SLOT_INVALID;
}
void EQEmu::InventoryProfile::dumpItemCollection(const std::map<int16, ItemInstance*> &collection)
void EQ::InventoryProfile::dumpItemCollection(const std::map<int16, ItemInstance*> &collection)
{
for (auto it = collection.cbegin(); it != collection.cend(); ++it) {
auto inst = it->second;
@@ -1278,7 +1278,7 @@ void EQEmu::InventoryProfile::dumpItemCollection(const std::map<int16, ItemInsta
}
}
void EQEmu::InventoryProfile::dumpBagContents(ItemInstance *inst, std::map<int16, ItemInstance*>::const_iterator *it)
void EQ::InventoryProfile::dumpBagContents(ItemInstance *inst, std::map<int16, ItemInstance*>::const_iterator *it)
{
if (!inst || !inst->IsClassBag())
return;
@@ -1297,14 +1297,14 @@ void EQEmu::InventoryProfile::dumpBagContents(ItemInstance *inst, std::map<int16
}
// Internal Method: Retrieves item within an inventory bucket
EQEmu::ItemInstance* EQEmu::InventoryProfile::_GetItem(const std::map<int16, ItemInstance*>& bucket, int16 slot_id) const
EQ::ItemInstance* EQ::InventoryProfile::_GetItem(const std::map<int16, ItemInstance*>& bucket, int16 slot_id) const
{
if (slot_id <= EQEmu::invslot::POSSESSIONS_END && slot_id >= EQEmu::invslot::POSSESSIONS_BEGIN) {
if (slot_id <= EQ::invslot::POSSESSIONS_END && slot_id >= EQ::invslot::POSSESSIONS_BEGIN) {
if ((((uint64)1 << slot_id) & m_lookup->PossessionsBitmask) == 0)
return nullptr;
}
else if (slot_id <= EQEmu::invslot::BANK_END && slot_id >= EQEmu::invslot::BANK_BEGIN) {
if (slot_id - EQEmu::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
else if (slot_id <= EQ::invslot::BANK_END && slot_id >= EQ::invslot::BANK_BEGIN) {
if (slot_id - EQ::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
return nullptr;
}
@@ -1319,7 +1319,7 @@ EQEmu::ItemInstance* EQEmu::InventoryProfile::_GetItem(const std::map<int16, Ite
// Internal Method: "put" item into bucket, without regard for what is currently in bucket
// Assumes item has already been allocated
int16 EQEmu::InventoryProfile::_PutItem(int16 slot_id, ItemInstance* inst)
int16 EQ::InventoryProfile::_PutItem(int16 slot_id, ItemInstance* inst)
{
// What happens here when we _PutItem(MainCursor)? Bad things..really bad things...
//
@@ -1356,7 +1356,7 @@ int16 EQEmu::InventoryProfile::_PutItem(int16 slot_id, ItemInstance* inst)
result = slot_id;
}
else if (slot_id >= invslot::BANK_BEGIN && slot_id <= invslot::BANK_END) {
if (slot_id - EQEmu::invslot::BANK_BEGIN < m_lookup->InventoryTypeSize.Bank) {
if (slot_id - EQ::invslot::BANK_BEGIN < m_lookup->InventoryTypeSize.Bank) {
m_bank[slot_id] = inst;
result = slot_id;
}
@@ -1389,17 +1389,17 @@ int16 EQEmu::InventoryProfile::_PutItem(int16 slot_id, ItemInstance* inst)
}
// Internal Method: Checks an inventory bucket for a particular item
int16 EQEmu::InventoryProfile::_HasItem(std::map<int16, ItemInstance*>& bucket, uint32 item_id, uint8 quantity)
int16 EQ::InventoryProfile::_HasItem(std::map<int16, ItemInstance*>& bucket, uint32 item_id, uint8 quantity)
{
uint32 quantity_found = 0;
for (auto iter = bucket.begin(); iter != bucket.end(); ++iter) {
if (iter->first <= EQEmu::invslot::POSSESSIONS_END && iter->first >= EQEmu::invslot::POSSESSIONS_BEGIN) {
if (iter->first <= EQ::invslot::POSSESSIONS_END && iter->first >= EQ::invslot::POSSESSIONS_BEGIN) {
if ((((uint64)1 << iter->first) & m_lookup->PossessionsBitmask) == 0)
continue;
}
else if (iter->first <= EQEmu::invslot::BANK_END && iter->first >= EQEmu::invslot::BANK_BEGIN) {
if (iter->first - EQEmu::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
else if (iter->first <= EQ::invslot::BANK_END && iter->first >= EQ::invslot::BANK_BEGIN) {
if (iter->first - EQ::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
continue;
}
@@ -1440,7 +1440,7 @@ int16 EQEmu::InventoryProfile::_HasItem(std::map<int16, ItemInstance*>& bucket,
}
// Internal Method: Checks an inventory queue type bucket for a particular item
int16 EQEmu::InventoryProfile::_HasItem(ItemInstQueue& iqueue, uint32 item_id, uint8 quantity)
int16 EQ::InventoryProfile::_HasItem(ItemInstQueue& iqueue, uint32 item_id, uint8 quantity)
{
// The downfall of this (these) queue procedure is that callers presume that when an item is
// found, it is presented as being available on the cursor. In cases of a parity check, this
@@ -1491,17 +1491,17 @@ int16 EQEmu::InventoryProfile::_HasItem(ItemInstQueue& iqueue, uint32 item_id, u
}
// Internal Method: Checks an inventory bucket for a particular item
int16 EQEmu::InventoryProfile::_HasItemByUse(std::map<int16, ItemInstance*>& bucket, uint8 use, uint8 quantity)
int16 EQ::InventoryProfile::_HasItemByUse(std::map<int16, ItemInstance*>& bucket, uint8 use, uint8 quantity)
{
uint32 quantity_found = 0;
for (auto iter = bucket.begin(); iter != bucket.end(); ++iter) {
if (iter->first <= EQEmu::invslot::POSSESSIONS_END && iter->first >= EQEmu::invslot::POSSESSIONS_BEGIN) {
if (iter->first <= EQ::invslot::POSSESSIONS_END && iter->first >= EQ::invslot::POSSESSIONS_BEGIN) {
if ((((uint64)1 << iter->first) & m_lookup->PossessionsBitmask) == 0)
continue;
}
else if (iter->first <= EQEmu::invslot::BANK_END && iter->first >= EQEmu::invslot::BANK_BEGIN) {
if (iter->first - EQEmu::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
else if (iter->first <= EQ::invslot::BANK_END && iter->first >= EQ::invslot::BANK_BEGIN) {
if (iter->first - EQ::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
continue;
}
@@ -1532,7 +1532,7 @@ int16 EQEmu::InventoryProfile::_HasItemByUse(std::map<int16, ItemInstance*>& buc
}
// Internal Method: Checks an inventory queue type bucket for a particular item
int16 EQEmu::InventoryProfile::_HasItemByUse(ItemInstQueue& iqueue, uint8 use, uint8 quantity)
int16 EQ::InventoryProfile::_HasItemByUse(ItemInstQueue& iqueue, uint8 use, uint8 quantity)
{
uint32 quantity_found = 0;
@@ -1566,15 +1566,15 @@ int16 EQEmu::InventoryProfile::_HasItemByUse(ItemInstQueue& iqueue, uint8 use, u
return INVALID_INDEX;
}
int16 EQEmu::InventoryProfile::_HasItemByLoreGroup(std::map<int16, ItemInstance*>& bucket, uint32 loregroup)
int16 EQ::InventoryProfile::_HasItemByLoreGroup(std::map<int16, ItemInstance*>& bucket, uint32 loregroup)
{
for (auto iter = bucket.begin(); iter != bucket.end(); ++iter) {
if (iter->first <= EQEmu::invslot::POSSESSIONS_END && iter->first >= EQEmu::invslot::POSSESSIONS_BEGIN) {
if (iter->first <= EQ::invslot::POSSESSIONS_END && iter->first >= EQ::invslot::POSSESSIONS_BEGIN) {
if ((((uint64)1 << iter->first) & m_lookup->PossessionsBitmask) == 0)
continue;
}
else if (iter->first <= EQEmu::invslot::BANK_END && iter->first >= EQEmu::invslot::BANK_BEGIN) {
if (iter->first - EQEmu::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
else if (iter->first <= EQ::invslot::BANK_END && iter->first >= EQ::invslot::BANK_BEGIN) {
if (iter->first - EQ::invslot::BANK_BEGIN >= m_lookup->InventoryTypeSize.Bank)
continue;
}
@@ -1611,11 +1611,11 @@ int16 EQEmu::InventoryProfile::_HasItemByLoreGroup(std::map<int16, ItemInstance*
}
}
return EQEmu::invslot::SLOT_INVALID;
return EQ::invslot::SLOT_INVALID;
}
// Internal Method: Checks an inventory queue type bucket for a particular item
int16 EQEmu::InventoryProfile::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup)
int16 EQ::InventoryProfile::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 loregroup)
{
for (auto iter = iqueue.cbegin(); iter != iqueue.cend(); ++iter) {
auto inst = *iter;
@@ -1654,5 +1654,5 @@ int16 EQEmu::InventoryProfile::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32
break;
}
return EQEmu::invslot::SLOT_INVALID;
return EQ::invslot::SLOT_INVALID;
}
+10 -10
View File
@@ -52,30 +52,30 @@ public:
// Public Methods
/////////////////////////
inline std::list<EQEmu::ItemInstance*>::const_iterator cbegin() { return m_list.cbegin(); }
inline std::list<EQEmu::ItemInstance*>::const_iterator cend() { return m_list.cend(); }
inline std::list<EQ::ItemInstance*>::const_iterator cbegin() { return m_list.cbegin(); }
inline std::list<EQ::ItemInstance*>::const_iterator cend() { return m_list.cend(); }
inline int size() { return static_cast<int>(m_list.size()); } // TODO: change to size_t
inline bool empty() { return m_list.empty(); }
void push(EQEmu::ItemInstance* inst);
void push_front(EQEmu::ItemInstance* inst);
EQEmu::ItemInstance* pop();
EQEmu::ItemInstance* pop_back();
EQEmu::ItemInstance* peek_front() const;
void push(EQ::ItemInstance* inst);
void push_front(EQ::ItemInstance* inst);
EQ::ItemInstance* pop();
EQ::ItemInstance* pop_back();
EQ::ItemInstance* peek_front() const;
protected:
/////////////////////////
// Protected Members
/////////////////////////
std::list<EQEmu::ItemInstance*> m_list;
std::list<EQ::ItemInstance*> m_list;
};
// ########################################
// Class: EQEmu::InventoryProfile
// Class: EQ::InventoryProfile
// Character inventory
namespace EQEmu
namespace EQ
{
class InventoryProfile
{
+31 -31
View File
@@ -22,7 +22,7 @@
#include "string_util.h"
int8 EQEmu::inventory::ConvertEquipmentIndexToTextureIndex(int16 slot_index)
int8 EQ::inventory::ConvertEquipmentIndexToTextureIndex(int16 slot_index)
{
switch (slot_index) {
case invslot::slotHead:
@@ -48,7 +48,7 @@ int8 EQEmu::inventory::ConvertEquipmentIndexToTextureIndex(int16 slot_index)
}
}
int8 EQEmu::inventory::ConvertEquipmentSlotToTextureIndex(const InventorySlot& inventory_slot)
int8 EQ::inventory::ConvertEquipmentSlotToTextureIndex(const InventorySlot& inventory_slot)
{
if ((!inventory_slot.Typeless() && !inventory_slot.IsTypeIndex(invtype::typePossessions)) || !inventory_slot.IsContainerIndex(invbag::SLOT_INVALID) || !inventory_slot.IsSocketIndex(invaug::SOCKET_INVALID))
return textures::textureInvalid;
@@ -56,7 +56,7 @@ int8 EQEmu::inventory::ConvertEquipmentSlotToTextureIndex(const InventorySlot& i
return ConvertEquipmentIndexToTextureIndex(inventory_slot.SlotIndex());
}
int16 EQEmu::inventory::ConvertTextureIndexToEquipmentIndex(int8 texture_index)
int16 EQ::inventory::ConvertTextureIndexToEquipmentIndex(int8 texture_index)
{
switch (texture_index) {
case textures::armorHead:
@@ -82,7 +82,7 @@ int16 EQEmu::inventory::ConvertTextureIndexToEquipmentIndex(int8 texture_index)
}
}
bool EQEmu::InventorySlot::IsValidSlot() const
bool EQ::InventorySlot::IsValidSlot() const
{
if (_typeless)
return false;
@@ -100,7 +100,7 @@ bool EQEmu::InventorySlot::IsValidSlot() const
return true;
}
bool EQEmu::InventorySlot::IsDeleteSlot() const
bool EQ::InventorySlot::IsDeleteSlot() const
{
if (_typeless)
return (_slot_index == invslot::SLOT_INVALID && _container_index == invbag::SLOT_INVALID && _socket_index == invaug::SOCKET_INVALID);
@@ -108,7 +108,7 @@ bool EQEmu::InventorySlot::IsDeleteSlot() const
return (_type_index == invtype::TYPE_INVALID && _slot_index == invslot::SLOT_INVALID && _container_index == invbag::SLOT_INVALID && _socket_index == invaug::SOCKET_INVALID);
}
bool EQEmu::InventorySlot::IsEquipmentIndex(int16 slot_index)
bool EQ::InventorySlot::IsEquipmentIndex(int16 slot_index)
{
if (slot_index < invslot::EQUIPMENT_BEGIN || slot_index > invslot::EQUIPMENT_END)
return false;
@@ -116,7 +116,7 @@ bool EQEmu::InventorySlot::IsEquipmentIndex(int16 slot_index)
return true;
}
bool EQEmu::InventorySlot::IsGeneralIndex(int16 slot_index)
bool EQ::InventorySlot::IsGeneralIndex(int16 slot_index)
{
if (slot_index < invslot::GENERAL_BEGIN || slot_index > invslot::GENERAL_END)
return false;
@@ -124,7 +124,7 @@ bool EQEmu::InventorySlot::IsGeneralIndex(int16 slot_index)
return true;
}
bool EQEmu::InventorySlot::IsCursorIndex(int16 slot_index)
bool EQ::InventorySlot::IsCursorIndex(int16 slot_index)
{
if (slot_index == invslot::slotCursor)
return true;
@@ -132,7 +132,7 @@ bool EQEmu::InventorySlot::IsCursorIndex(int16 slot_index)
return false;
}
bool EQEmu::InventorySlot::IsWeaponIndex(int16 slot_index)
bool EQ::InventorySlot::IsWeaponIndex(int16 slot_index)
{
if (slot_index == invslot::slotPrimary || slot_index == invslot::slotSecondary || slot_index == invslot::slotRange)
return true;
@@ -140,7 +140,7 @@ bool EQEmu::InventorySlot::IsWeaponIndex(int16 slot_index)
return false;
}
bool EQEmu::InventorySlot::IsTextureIndex(int16 slot_index)
bool EQ::InventorySlot::IsTextureIndex(int16 slot_index)
{
switch (slot_index) {
case invslot::slotHead:
@@ -158,7 +158,7 @@ bool EQEmu::InventorySlot::IsTextureIndex(int16 slot_index)
}
}
bool EQEmu::InventorySlot::IsTintableIndex(int16 slot_index)
bool EQ::InventorySlot::IsTintableIndex(int16 slot_index)
{
switch (slot_index) {
case invslot::slotHead:
@@ -174,7 +174,7 @@ bool EQEmu::InventorySlot::IsTintableIndex(int16 slot_index)
}
}
bool EQEmu::InventorySlot::IsEquipmentSlot() const
bool EQ::InventorySlot::IsEquipmentSlot() const
{
if (!_typeless && (_type_index != invtype::typePossessions))
return false;
@@ -185,7 +185,7 @@ bool EQEmu::InventorySlot::IsEquipmentSlot() const
return IsEquipmentIndex(_slot_index);
}
bool EQEmu::InventorySlot::IsGeneralSlot() const
bool EQ::InventorySlot::IsGeneralSlot() const
{
if (!_typeless && (_type_index != invtype::typePossessions))
return false;
@@ -196,7 +196,7 @@ bool EQEmu::InventorySlot::IsGeneralSlot() const
return IsGeneralIndex(_socket_index);
}
bool EQEmu::InventorySlot::IsCursorSlot() const
bool EQ::InventorySlot::IsCursorSlot() const
{
if (!_typeless && (_type_index != invtype::typePossessions))
return false;
@@ -207,7 +207,7 @@ bool EQEmu::InventorySlot::IsCursorSlot() const
return IsCursorIndex(_slot_index);
}
bool EQEmu::InventorySlot::IsWeaponSlot() const
bool EQ::InventorySlot::IsWeaponSlot() const
{
if (!_typeless && (_type_index != invtype::typePossessions))
return false;
@@ -218,7 +218,7 @@ bool EQEmu::InventorySlot::IsWeaponSlot() const
return IsWeaponIndex(_slot_index);
}
bool EQEmu::InventorySlot::IsTextureSlot() const
bool EQ::InventorySlot::IsTextureSlot() const
{
if (!_typeless && (_type_index != invtype::typePossessions))
return false;
@@ -229,7 +229,7 @@ bool EQEmu::InventorySlot::IsTextureSlot() const
return IsTextureIndex(_slot_index);
}
bool EQEmu::InventorySlot::IsTintableSlot() const
bool EQ::InventorySlot::IsTintableSlot() const
{
if (!_typeless && (_type_index != invtype::typePossessions))
return false;
@@ -240,7 +240,7 @@ bool EQEmu::InventorySlot::IsTintableSlot() const
return IsTintableIndex(_slot_index);
}
bool EQEmu::InventorySlot::IsSlot() const
bool EQ::InventorySlot::IsSlot() const
{
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
return false;
@@ -254,7 +254,7 @@ bool EQEmu::InventorySlot::IsSlot() const
return true;
}
bool EQEmu::InventorySlot::IsSlotSocket() const
bool EQ::InventorySlot::IsSlotSocket() const
{
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
return false;
@@ -268,7 +268,7 @@ bool EQEmu::InventorySlot::IsSlotSocket() const
return true;
}
bool EQEmu::InventorySlot::IsContainer() const
bool EQ::InventorySlot::IsContainer() const
{
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
return false;
@@ -282,7 +282,7 @@ bool EQEmu::InventorySlot::IsContainer() const
return true;
}
bool EQEmu::InventorySlot::IsContainerSocket() const
bool EQ::InventorySlot::IsContainerSocket() const
{
if (!_typeless && (_type_index == invtype::TYPE_INVALID))
return false;
@@ -296,12 +296,12 @@ bool EQEmu::InventorySlot::IsContainerSocket() const
return true;
}
EQEmu::InventorySlot EQEmu::InventorySlot::ToTopOwner() const
EQ::InventorySlot EQ::InventorySlot::ToTopOwner() const
{
return InventorySlot(_type_index, _slot_index);
}
EQEmu::InventorySlot EQEmu::InventorySlot::ToOwner() const
EQ::InventorySlot EQ::InventorySlot::ToOwner() const
{
if (IsSlot() || IsSlotSocket() || IsContainer())
return InventorySlot(_type_index, _slot_index);
@@ -312,17 +312,17 @@ EQEmu::InventorySlot EQEmu::InventorySlot::ToOwner() const
return InventorySlot();
}
const std::string EQEmu::InventorySlot::ToString() const
const std::string EQ::InventorySlot::ToString() const
{
return StringFormat("(%i%s, %i, %i, %i)", _type_index, (_typeless ? " [typeless]" : ""), _slot_index, _container_index, _socket_index);
}
const std::string EQEmu::InventorySlot::ToName() const
const std::string EQ::InventorySlot::ToName() const
{
return StringFormat("InventorySlot - _type_index: %i%s, _slot_index: %i, _container_index: %i, _socket_index: %i", _type_index, (_typeless ? " [typeless]" : ""), _slot_index, _container_index, _socket_index);
}
void EQEmu::InventorySlot::SetInvalidSlot()
void EQ::InventorySlot::SetInvalidSlot()
{
_type_index = invtype::TYPE_INVALID;
_slot_index = invslot::SLOT_INVALID;
@@ -330,7 +330,7 @@ void EQEmu::InventorySlot::SetInvalidSlot()
_socket_index = invaug::SOCKET_INVALID;
}
//bool EQEmu::InventorySlot::IsBonusIndex(int16 slot_index)
//bool EQ::InventorySlot::IsBonusIndex(int16 slot_index)
//{
// if ((slot_index >= inventory::EquipmentBegin) && (slot_index <= inventory::EquipmentEnd) && (slot_index != inventory::slotAmmo))
// return true;
@@ -338,7 +338,7 @@ void EQEmu::InventorySlot::SetInvalidSlot()
// return false;
//}
//bool EQEmu::InventorySlot::IsBonusSlot() const
//bool EQ::InventorySlot::IsBonusSlot() const
//{
// if ((_type_index != inventory::typePossessions) || (_container_index != inventory::containerInvalid) || (_socket_index != inventory::socketInvalid))
// return false;
@@ -346,7 +346,7 @@ void EQEmu::InventorySlot::SetInvalidSlot()
// return IsBonusIndex(_slot_index);
//}
bool inventory_slot_typeless_lessthan(const EQEmu::InventorySlot& lhs, const EQEmu::InventorySlot& rhs)
bool inventory_slot_typeless_lessthan(const EQ::InventorySlot& lhs, const EQ::InventorySlot& rhs)
{
if (lhs.SlotIndex() < rhs.SlotIndex())
return true;
@@ -360,7 +360,7 @@ bool inventory_slot_typeless_lessthan(const EQEmu::InventorySlot& lhs, const EQE
return false;
}
bool EQEmu::InventorySlot::operator<(const InventorySlot& rhs) const
bool EQ::InventorySlot::operator<(const InventorySlot& rhs) const
{
if (Typeless() || rhs.Typeless())
return inventory_slot_typeless_lessthan(*this, rhs);
@@ -380,7 +380,7 @@ bool EQEmu::InventorySlot::operator<(const InventorySlot& rhs) const
return false;
}
bool EQEmu::operator==(const InventorySlot& lhs, const InventorySlot& rhs)
bool EQ::operator==(const InventorySlot& lhs, const InventorySlot& rhs)
{
if (lhs.Typeless() || rhs.Typeless())
return ((lhs.SlotIndex() == rhs.SlotIndex()) && (lhs.ContainerIndex() == rhs.ContainerIndex()) && (lhs.SocketIndex() == rhs.SocketIndex()));
+1 -1
View File
@@ -23,7 +23,7 @@
#include "emu_constants.h"
namespace EQEmu
namespace EQ
{
class InventorySlot;
+1 -1
View File
@@ -31,7 +31,7 @@
#include "eqemu_exception.h"
#include "eqemu_config.h"
namespace EQEmu {
namespace EQ {
struct IPCMutex::Implementation {
#ifdef _WINDOWS
HANDLE mut_;
+1 -1
View File
@@ -21,7 +21,7 @@
#include <string>
namespace EQEmu {
namespace EQ {
//! Interprocess Named Binary Semaphore (Mutex)
/*!
+10 -10
View File
@@ -23,7 +23,7 @@
//#include "deity.h"
uint32 EQEmu::item::ConvertAugTypeToAugTypeBit(uint8 aug_type)
uint32 EQ::item::ConvertAugTypeToAugTypeBit(uint8 aug_type)
{
switch (aug_type) {
case AugTypeGeneralSingleStat:
@@ -95,7 +95,7 @@ uint32 EQEmu::item::ConvertAugTypeToAugTypeBit(uint8 aug_type)
}
}
uint8 EQEmu::item::ConvertAugTypeBitToAugType(uint32 aug_type_bit)
uint8 EQ::item::ConvertAugTypeBitToAugType(uint32 aug_type_bit)
{
switch (aug_type_bit) {
case bit_AugTypeGeneralSingleStat:
@@ -167,7 +167,7 @@ uint8 EQEmu::item::ConvertAugTypeBitToAugType(uint32 aug_type_bit)
}
}
bool EQEmu::ItemData::IsEquipable(uint16 race_id, uint16 class_id) const
bool EQ::ItemData::IsEquipable(uint16 race_id, uint16 class_id) const
{
if (!(Races & GetPlayerRaceBit(race_id)))
return false;
@@ -178,37 +178,37 @@ bool EQEmu::ItemData::IsEquipable(uint16 race_id, uint16 class_id) const
return true;
}
bool EQEmu::ItemData::IsClassCommon() const
bool EQ::ItemData::IsClassCommon() const
{
return (ItemClass == item::ItemClassCommon);
}
bool EQEmu::ItemData::IsClassBag() const
bool EQ::ItemData::IsClassBag() const
{
return (ItemClass == item::ItemClassBag);
}
bool EQEmu::ItemData::IsClassBook() const
bool EQ::ItemData::IsClassBook() const
{
return (ItemClass == item::ItemClassBook);
}
bool EQEmu::ItemData::IsType1HWeapon() const
bool EQ::ItemData::IsType1HWeapon() const
{
return ((ItemType == item::ItemType1HBlunt) || (ItemType == item::ItemType1HSlash) || (ItemType == item::ItemType1HPiercing) || (ItemType == item::ItemTypeMartial));
}
bool EQEmu::ItemData::IsType2HWeapon() const
bool EQ::ItemData::IsType2HWeapon() const
{
return ((ItemType == item::ItemType2HBlunt) || (ItemType == item::ItemType2HSlash) || (ItemType == item::ItemType2HPiercing));
}
bool EQEmu::ItemData::IsTypeShield() const
bool EQ::ItemData::IsTypeShield() const
{
return (ItemType == item::ItemTypeShield);
}
bool EQEmu::ItemData::CheckLoreConflict(const ItemData* l_item, const ItemData* r_item)
bool EQ::ItemData::CheckLoreConflict(const ItemData* l_item, const ItemData* r_item)
{
if (!l_item || !r_item)
return false;
+2 -1
View File
@@ -47,7 +47,7 @@
#include "emu_constants.h"
namespace EQEmu
namespace EQ
{
namespace item {
enum ItemClass {
@@ -434,6 +434,7 @@ namespace EQEmu
//uint32 Unk054;
int16 MaxCharges; // Maximum charges items can hold: -1 if not a chargeable item
uint8 ItemType; // Item Type/Skill (itemClass* from above)
int32 SubType; // Some items have sub types that can be used for other things (unbreakable fishing poles, SE_FFItemClass)
uint8 Material; // Item material type
uint32 HerosForgeModel;// Hero's Forge Armor Model Type (2-13?)
float SellRate; // Sell rate
+1
View File
@@ -203,3 +203,4 @@ F(procname)
F(wornname)
F(focusname)
F(scrollname)
F(subtype)
+109 -109
View File
@@ -54,9 +54,9 @@ static inline int32 GetNextItemInstSerialNumber() {
}
//
// class EQEmu::ItemInstance
// class EQ::ItemInstance
//
EQEmu::ItemInstance::ItemInstance(const ItemData* item, int16 charges) {
EQ::ItemInstance::ItemInstance(const ItemData* item, int16 charges) {
m_use_type = ItemInstNormal;
if(item) {
m_item = new ItemData(*item);
@@ -87,7 +87,7 @@ EQEmu::ItemInstance::ItemInstance(const ItemData* item, int16 charges) {
m_new_id_file = 0;
}
EQEmu::ItemInstance::ItemInstance(SharedDatabase *db, uint32 item_id, int16 charges) {
EQ::ItemInstance::ItemInstance(SharedDatabase *db, uint32 item_id, int16 charges) {
m_use_type = ItemInstNormal;
m_item = db->GetItem(item_id);
if(m_item) {
@@ -121,7 +121,7 @@ EQEmu::ItemInstance::ItemInstance(SharedDatabase *db, uint32 item_id, int16 char
m_new_id_file = 0;
}
EQEmu::ItemInstance::ItemInstance(ItemInstTypes use_type) {
EQ::ItemInstance::ItemInstance(ItemInstTypes use_type) {
m_use_type = use_type;
m_item = nullptr;
m_charges = 0;
@@ -143,8 +143,8 @@ EQEmu::ItemInstance::ItemInstance(ItemInstTypes use_type) {
m_new_id_file = 0;
}
// Make a copy of an EQEmu::ItemInstance object
EQEmu::ItemInstance::ItemInstance(const ItemInstance& copy)
// Make a copy of an EQ::ItemInstance object
EQ::ItemInstance::ItemInstance(const ItemInstance& copy)
{
m_use_type=copy.m_use_type;
if(copy.m_item)
@@ -202,7 +202,7 @@ EQEmu::ItemInstance::ItemInstance(const ItemInstance& copy)
}
// Clean up container contents
EQEmu::ItemInstance::~ItemInstance()
EQ::ItemInstance::~ItemInstance()
{
Clear();
safe_delete(m_item);
@@ -211,7 +211,7 @@ EQEmu::ItemInstance::~ItemInstance()
}
// Query item type
bool EQEmu::ItemInstance::IsType(item::ItemClass item_class) const
bool EQ::ItemInstance::IsType(item::ItemClass item_class) const
{
// IsType(<ItemClassTypes>) does not protect against 'm_item = nullptr'
@@ -225,23 +225,23 @@ bool EQEmu::ItemInstance::IsType(item::ItemClass item_class) const
return (m_item->ItemClass == item_class);
}
bool EQEmu::ItemInstance::IsClassCommon() const
bool EQ::ItemInstance::IsClassCommon() const
{
return (m_item && m_item->IsClassCommon());
}
bool EQEmu::ItemInstance::IsClassBag() const
bool EQ::ItemInstance::IsClassBag() const
{
return (m_item && m_item->IsClassBag());
}
bool EQEmu::ItemInstance::IsClassBook() const
bool EQ::ItemInstance::IsClassBook() const
{
return (m_item && m_item->IsClassBook());
}
// Is item stackable?
bool EQEmu::ItemInstance::IsStackable() const
bool EQ::ItemInstance::IsStackable() const
{
if (!m_item)
return false;
@@ -249,7 +249,7 @@ bool EQEmu::ItemInstance::IsStackable() const
return m_item->Stackable;
}
bool EQEmu::ItemInstance::IsCharged() const
bool EQ::ItemInstance::IsCharged() const
{
if (!m_item)
return false;
@@ -261,7 +261,7 @@ bool EQEmu::ItemInstance::IsCharged() const
}
// Can item be equipped?
bool EQEmu::ItemInstance::IsEquipable(uint16 race, uint16 class_) const
bool EQ::ItemInstance::IsEquipable(uint16 race, uint16 class_) const
{
if (!m_item || (m_item->Slots == 0))
return false;
@@ -270,18 +270,18 @@ bool EQEmu::ItemInstance::IsEquipable(uint16 race, uint16 class_) const
}
// Can equip at this slot?
bool EQEmu::ItemInstance::IsEquipable(int16 slot_id) const
bool EQ::ItemInstance::IsEquipable(int16 slot_id) const
{
if (!m_item)
return false;
if (slot_id < EQEmu::invslot::EQUIPMENT_BEGIN || slot_id > EQEmu::invslot::EQUIPMENT_END)
if (slot_id < EQ::invslot::EQUIPMENT_BEGIN || slot_id > EQ::invslot::EQUIPMENT_END)
return false;
return ((m_item->Slots & (1 << slot_id)) != 0);
}
bool EQEmu::ItemInstance::IsAugmentable() const
bool EQ::ItemInstance::IsAugmentable() const
{
if (!m_item)
return false;
@@ -294,7 +294,7 @@ bool EQEmu::ItemInstance::IsAugmentable() const
return false;
}
bool EQEmu::ItemInstance::AvailableWearSlot(uint32 aug_wear_slots) const {
bool EQ::ItemInstance::AvailableWearSlot(uint32 aug_wear_slots) const {
if (!m_item || !m_item->IsClassCommon())
return false;
@@ -306,10 +306,10 @@ bool EQEmu::ItemInstance::AvailableWearSlot(uint32 aug_wear_slots) const {
}
}
return (index <= EQEmu::invslot::EQUIPMENT_END);
return (index <= EQ::invslot::EQUIPMENT_END);
}
int8 EQEmu::ItemInstance::AvailableAugmentSlot(int32 augtype) const
int8 EQ::ItemInstance::AvailableAugmentSlot(int32 augtype) const
{
if (!m_item || !m_item->IsClassCommon())
return INVALID_INDEX;
@@ -324,7 +324,7 @@ int8 EQEmu::ItemInstance::AvailableAugmentSlot(int32 augtype) const
return (index <= invaug::SOCKET_END) ? index : INVALID_INDEX;
}
bool EQEmu::ItemInstance::IsAugmentSlotAvailable(int32 augtype, uint8 slot) const
bool EQ::ItemInstance::IsAugmentSlotAvailable(int32 augtype, uint8 slot) const
{
if (!m_item || !m_item->IsClassCommon())
return false;
@@ -336,7 +336,7 @@ bool EQEmu::ItemInstance::IsAugmentSlotAvailable(int32 augtype, uint8 slot) cons
}
// Retrieve item inside container
EQEmu::ItemInstance* EQEmu::ItemInstance::GetItem(uint8 index) const
EQ::ItemInstance* EQ::ItemInstance::GetItem(uint8 index) const
{
auto it = m_contents.find(index);
if (it != m_contents.end()) {
@@ -346,7 +346,7 @@ EQEmu::ItemInstance* EQEmu::ItemInstance::GetItem(uint8 index) const
return nullptr;
}
uint32 EQEmu::ItemInstance::GetItemID(uint8 slot) const
uint32 EQ::ItemInstance::GetItemID(uint8 slot) const
{
ItemInstance *item = GetItem(slot);
if (item)
@@ -355,7 +355,7 @@ uint32 EQEmu::ItemInstance::GetItemID(uint8 slot) const
return 0;
}
void EQEmu::ItemInstance::PutItem(uint8 index, const ItemInstance& inst)
void EQ::ItemInstance::PutItem(uint8 index, const ItemInstance& inst)
{
// Clean up item already in slot (if exists)
DeleteItem(index);
@@ -365,7 +365,7 @@ void EQEmu::ItemInstance::PutItem(uint8 index, const ItemInstance& inst)
}
// Remove item inside container
void EQEmu::ItemInstance::DeleteItem(uint8 index)
void EQ::ItemInstance::DeleteItem(uint8 index)
{
ItemInstance* inst = PopItem(index);
safe_delete(inst);
@@ -373,7 +373,7 @@ void EQEmu::ItemInstance::DeleteItem(uint8 index)
// Remove item from container without memory delete
// Hands over memory ownership to client of this function call
EQEmu::ItemInstance* EQEmu::ItemInstance::PopItem(uint8 index)
EQ::ItemInstance* EQ::ItemInstance::PopItem(uint8 index)
{
auto iter = m_contents.find(index);
if (iter != m_contents.end()) {
@@ -386,7 +386,7 @@ EQEmu::ItemInstance* EQEmu::ItemInstance::PopItem(uint8 index)
}
// Remove all items from container
void EQEmu::ItemInstance::Clear()
void EQ::ItemInstance::Clear()
{
// Destroy container contents
for (auto iter = m_contents.begin(); iter != m_contents.end(); ++iter) {
@@ -396,7 +396,7 @@ void EQEmu::ItemInstance::Clear()
}
// Remove all items from container
void EQEmu::ItemInstance::ClearByFlags(byFlagSetting is_nodrop, byFlagSetting is_norent)
void EQ::ItemInstance::ClearByFlags(byFlagSetting is_nodrop, byFlagSetting is_norent)
{
// TODO: This needs work...
@@ -458,7 +458,7 @@ void EQEmu::ItemInstance::ClearByFlags(byFlagSetting is_nodrop, byFlagSetting is
}
}
uint8 EQEmu::ItemInstance::FirstOpenSlot() const
uint8 EQ::ItemInstance::FirstOpenSlot() const
{
if (!m_item)
return INVALID_INDEX;
@@ -472,7 +472,7 @@ uint8 EQEmu::ItemInstance::FirstOpenSlot() const
return (i < slots) ? i : INVALID_INDEX;
}
uint8 EQEmu::ItemInstance::GetTotalItemCount() const
uint8 EQ::ItemInstance::GetTotalItemCount() const
{
if (!m_item)
return 0;
@@ -486,7 +486,7 @@ uint8 EQEmu::ItemInstance::GetTotalItemCount() const
return item_count;
}
bool EQEmu::ItemInstance::IsNoneEmptyContainer()
bool EQ::ItemInstance::IsNoneEmptyContainer()
{
if (!m_item || !m_item->IsClassBag())
return false;
@@ -500,7 +500,7 @@ bool EQEmu::ItemInstance::IsNoneEmptyContainer()
}
// Retrieve augment inside item
EQEmu::ItemInstance* EQEmu::ItemInstance::GetAugment(uint8 slot) const
EQ::ItemInstance* EQ::ItemInstance::GetAugment(uint8 slot) const
{
if (m_item && m_item->IsClassCommon())
return GetItem(slot);
@@ -508,7 +508,7 @@ EQEmu::ItemInstance* EQEmu::ItemInstance::GetAugment(uint8 slot) const
return nullptr;
}
EQEmu::ItemInstance* EQEmu::ItemInstance::GetOrnamentationAug(int32 ornamentationAugtype) const
EQ::ItemInstance* EQ::ItemInstance::GetOrnamentationAug(int32 ornamentationAugtype) const
{
if (!m_item || !m_item->IsClassCommon()) { return nullptr; }
if (ornamentationAugtype == 0) { return nullptr; }
@@ -533,7 +533,7 @@ EQEmu::ItemInstance* EQEmu::ItemInstance::GetOrnamentationAug(int32 ornamentatio
return nullptr;
}
uint32 EQEmu::ItemInstance::GetOrnamentHeroModel(int32 material_slot) const {
uint32 EQ::ItemInstance::GetOrnamentHeroModel(int32 material_slot) const {
// Not a Hero Forge item.
if (m_ornament_hero_model == 0 || material_slot < 0)
return 0;
@@ -546,7 +546,7 @@ uint32 EQEmu::ItemInstance::GetOrnamentHeroModel(int32 material_slot) const {
return (m_ornament_hero_model * 100) + material_slot;
}
bool EQEmu::ItemInstance::UpdateOrnamentationInfo() {
bool EQ::ItemInstance::UpdateOrnamentationInfo() {
if (!m_item || !m_item->IsClassCommon())
return false;
@@ -582,7 +582,7 @@ bool EQEmu::ItemInstance::UpdateOrnamentationInfo() {
return ornamentSet;
}
bool EQEmu::ItemInstance::CanTransform(const ItemData *ItemToTry, const ItemData *Container, bool AllowAll) {
bool EQ::ItemInstance::CanTransform(const ItemData *ItemToTry, const ItemData *Container, bool AllowAll) {
if (!ItemToTry || !Container) return false;
if (ItemToTry->ItemType == item::ItemTypeArrow || strnlen(Container->CharmFile, 30) == 0)
@@ -629,7 +629,7 @@ bool EQEmu::ItemInstance::CanTransform(const ItemData *ItemToTry, const ItemData
return false;
}
uint32 EQEmu::ItemInstance::GetAugmentItemID(uint8 slot) const
uint32 EQ::ItemInstance::GetAugmentItemID(uint8 slot) const
{
if (!m_item || !m_item->IsClassCommon())
return 0;
@@ -638,7 +638,7 @@ uint32 EQEmu::ItemInstance::GetAugmentItemID(uint8 slot) const
}
// Add an augment to the item
void EQEmu::ItemInstance::PutAugment(uint8 slot, const ItemInstance& augment)
void EQ::ItemInstance::PutAugment(uint8 slot, const ItemInstance& augment)
{
if (!m_item || !m_item->IsClassCommon())
return;
@@ -646,7 +646,7 @@ void EQEmu::ItemInstance::PutAugment(uint8 slot, const ItemInstance& augment)
PutItem(slot, augment);
}
void EQEmu::ItemInstance::PutAugment(SharedDatabase *db, uint8 slot, uint32 item_id)
void EQ::ItemInstance::PutAugment(SharedDatabase *db, uint8 slot, uint32 item_id)
{
if (item_id == 0) { return; }
if (db == nullptr) { return; /* TODO: add log message for nullptr */ }
@@ -659,7 +659,7 @@ void EQEmu::ItemInstance::PutAugment(SharedDatabase *db, uint8 slot, uint32 item
}
// Remove augment from item and destroy it
void EQEmu::ItemInstance::DeleteAugment(uint8 index)
void EQ::ItemInstance::DeleteAugment(uint8 index)
{
if (!m_item || !m_item->IsClassCommon())
return;
@@ -668,7 +668,7 @@ void EQEmu::ItemInstance::DeleteAugment(uint8 index)
}
// Remove augment from item and return it
EQEmu::ItemInstance* EQEmu::ItemInstance::RemoveAugment(uint8 index)
EQ::ItemInstance* EQ::ItemInstance::RemoveAugment(uint8 index)
{
if (!m_item || !m_item->IsClassCommon())
return nullptr;
@@ -676,7 +676,7 @@ EQEmu::ItemInstance* EQEmu::ItemInstance::RemoveAugment(uint8 index)
return PopItem(index);
}
bool EQEmu::ItemInstance::IsAugmented()
bool EQ::ItemInstance::IsAugmented()
{
if (!m_item || !m_item->IsClassCommon())
return false;
@@ -690,7 +690,7 @@ bool EQEmu::ItemInstance::IsAugmented()
}
// Has attack/delay?
bool EQEmu::ItemInstance::IsWeapon() const
bool EQ::ItemInstance::IsWeapon() const
{
if (!m_item || !m_item->IsClassCommon())
return false;
@@ -701,7 +701,7 @@ bool EQEmu::ItemInstance::IsWeapon() const
return ((m_item->Damage != 0) && (m_item->Delay != 0));
}
bool EQEmu::ItemInstance::IsAmmo() const
bool EQ::ItemInstance::IsAmmo() const
{
if (!m_item)
return false;
@@ -717,7 +717,7 @@ bool EQEmu::ItemInstance::IsAmmo() const
}
const EQEmu::ItemData* EQEmu::ItemInstance::GetItem() const
const EQ::ItemData* EQ::ItemInstance::GetItem() const
{
if (!m_item)
return nullptr;
@@ -728,13 +728,13 @@ const EQEmu::ItemData* EQEmu::ItemInstance::GetItem() const
return m_item;
}
const EQEmu::ItemData* EQEmu::ItemInstance::GetUnscaledItem() const
const EQ::ItemData* EQ::ItemInstance::GetUnscaledItem() const
{
// No operator calls and defaults to nullptr
return m_item;
}
std::string EQEmu::ItemInstance::GetCustomDataString() const {
std::string EQ::ItemInstance::GetCustomDataString() const {
std::string ret_val;
auto iter = m_custom_data.begin();
while (iter != m_custom_data.end()) {
@@ -753,7 +753,7 @@ std::string EQEmu::ItemInstance::GetCustomDataString() const {
return ret_val;
}
std::string EQEmu::ItemInstance::GetCustomData(std::string identifier) {
std::string EQ::ItemInstance::GetCustomData(std::string identifier) {
std::map<std::string, std::string>::const_iterator iter = m_custom_data.find(identifier);
if (iter != m_custom_data.end()) {
return iter->second;
@@ -762,49 +762,49 @@ std::string EQEmu::ItemInstance::GetCustomData(std::string identifier) {
return "";
}
void EQEmu::ItemInstance::SetCustomData(std::string identifier, std::string value) {
void EQ::ItemInstance::SetCustomData(std::string identifier, std::string value) {
DeleteCustomData(identifier);
m_custom_data[identifier] = value;
}
void EQEmu::ItemInstance::SetCustomData(std::string identifier, int value) {
void EQ::ItemInstance::SetCustomData(std::string identifier, int value) {
DeleteCustomData(identifier);
std::stringstream ss;
ss << value;
m_custom_data[identifier] = ss.str();
}
void EQEmu::ItemInstance::SetCustomData(std::string identifier, float value) {
void EQ::ItemInstance::SetCustomData(std::string identifier, float value) {
DeleteCustomData(identifier);
std::stringstream ss;
ss << value;
m_custom_data[identifier] = ss.str();
}
void EQEmu::ItemInstance::SetCustomData(std::string identifier, bool value) {
void EQ::ItemInstance::SetCustomData(std::string identifier, bool value) {
DeleteCustomData(identifier);
std::stringstream ss;
ss << value;
m_custom_data[identifier] = ss.str();
}
void EQEmu::ItemInstance::DeleteCustomData(std::string identifier) {
void EQ::ItemInstance::DeleteCustomData(std::string identifier) {
auto iter = m_custom_data.find(identifier);
if (iter != m_custom_data.end()) {
m_custom_data.erase(iter);
}
}
// Clone a type of EQEmu::ItemInstance object
// Clone a type of EQ::ItemInstance object
// c++ doesn't allow a polymorphic copy constructor,
// so we have to resort to a polymorphic Clone()
EQEmu::ItemInstance* EQEmu::ItemInstance::Clone() const
EQ::ItemInstance* EQ::ItemInstance::Clone() const
{
// Pseudo-polymorphic copy constructor
return new ItemInstance(*this);
}
bool EQEmu::ItemInstance::IsSlotAllowed(int16 slot_id) const {
bool EQ::ItemInstance::IsSlotAllowed(int16 slot_id) const {
if (!m_item) { return false; }
else if (InventoryProfile::SupportsContainers(slot_id)) { return true; }
else if (m_item->Slots & (1 << slot_id)) { return true; }
@@ -812,7 +812,7 @@ bool EQEmu::ItemInstance::IsSlotAllowed(int16 slot_id) const {
else { return false; }
}
bool EQEmu::ItemInstance::IsDroppable(bool recurse) const
bool EQ::ItemInstance::IsDroppable(bool recurse) const
{
if (!m_item)
return false;
@@ -838,7 +838,7 @@ bool EQEmu::ItemInstance::IsDroppable(bool recurse) const
return true;
}
void EQEmu::ItemInstance::Initialize(SharedDatabase *db) {
void EQ::ItemInstance::Initialize(SharedDatabase *db) {
// if there's no actual item, don't do anything
if (!m_item)
return;
@@ -855,7 +855,7 @@ void EQEmu::ItemInstance::Initialize(SharedDatabase *db) {
}
}
void EQEmu::ItemInstance::ScaleItem() {
void EQ::ItemInstance::ScaleItem() {
if (!m_item)
return;
@@ -939,18 +939,18 @@ void EQEmu::ItemInstance::ScaleItem() {
m_scaledItem->CharmFileID = 0; // this stops the client from trying to scale the item itself.
}
bool EQEmu::ItemInstance::EvolveOnAllKills() const {
bool EQ::ItemInstance::EvolveOnAllKills() const {
return (m_evolveInfo && m_evolveInfo->AllKills);
}
int8 EQEmu::ItemInstance::GetMaxEvolveLvl() const {
int8 EQ::ItemInstance::GetMaxEvolveLvl() const {
if (m_evolveInfo)
return m_evolveInfo->MaxLvl;
else
return 0;
}
uint32 EQEmu::ItemInstance::GetKillsNeeded(uint8 currentlevel) {
uint32 EQ::ItemInstance::GetKillsNeeded(uint8 currentlevel) {
uint32 kills = -1; // default to -1 (max uint32 value) because this value is usually divided by, so we don't want to ever return zero.
if (m_evolveInfo)
if (currentlevel != m_evolveInfo->MaxLvl)
@@ -962,24 +962,24 @@ uint32 EQEmu::ItemInstance::GetKillsNeeded(uint8 currentlevel) {
return kills;
}
void EQEmu::ItemInstance::SetTimer(std::string name, uint32 time) {
void EQ::ItemInstance::SetTimer(std::string name, uint32 time) {
Timer t(time);
t.Start(time, false);
m_timers[name] = t;
}
void EQEmu::ItemInstance::StopTimer(std::string name) {
void EQ::ItemInstance::StopTimer(std::string name) {
auto iter = m_timers.find(name);
if(iter != m_timers.end()) {
m_timers.erase(iter);
}
}
void EQEmu::ItemInstance::ClearTimers() {
void EQ::ItemInstance::ClearTimers() {
m_timers.clear();
}
int EQEmu::ItemInstance::GetItemArmorClass(bool augments) const
int EQ::ItemInstance::GetItemArmorClass(bool augments) const
{
int ac = 0;
const auto item = GetItem();
@@ -993,7 +993,7 @@ int EQEmu::ItemInstance::GetItemArmorClass(bool augments) const
return ac;
}
int EQEmu::ItemInstance::GetItemElementalDamage(int &magic, int &fire, int &cold, int &poison, int &disease, int &chromatic, int &prismatic, int &physical, int &corruption, bool augments) const
int EQ::ItemInstance::GetItemElementalDamage(int &magic, int &fire, int &cold, int &poison, int &disease, int &chromatic, int &prismatic, int &physical, int &corruption, bool augments) const
{
const auto item = GetItem();
if (item) {
@@ -1035,7 +1035,7 @@ int EQEmu::ItemInstance::GetItemElementalDamage(int &magic, int &fire, int &cold
return magic + fire + cold + poison + disease + chromatic + prismatic + physical + corruption;
}
int EQEmu::ItemInstance::GetItemElementalFlag(bool augments) const
int EQ::ItemInstance::GetItemElementalFlag(bool augments) const
{
int flag = 0;
const auto item = GetItem();
@@ -1056,7 +1056,7 @@ int EQEmu::ItemInstance::GetItemElementalFlag(bool augments) const
return flag;
}
int EQEmu::ItemInstance::GetItemElementalDamage(bool augments) const
int EQ::ItemInstance::GetItemElementalDamage(bool augments) const
{
int damage = 0;
const auto item = GetItem();
@@ -1077,7 +1077,7 @@ int EQEmu::ItemInstance::GetItemElementalDamage(bool augments) const
return damage;
}
int EQEmu::ItemInstance::GetItemRecommendedLevel(bool augments) const
int EQ::ItemInstance::GetItemRecommendedLevel(bool augments) const
{
int level = 0;
const auto item = GetItem();
@@ -1099,7 +1099,7 @@ int EQEmu::ItemInstance::GetItemRecommendedLevel(bool augments) const
return level;
}
int EQEmu::ItemInstance::GetItemRequiredLevel(bool augments) const
int EQ::ItemInstance::GetItemRequiredLevel(bool augments) const
{
int level = 0;
const auto item = GetItem();
@@ -1121,7 +1121,7 @@ int EQEmu::ItemInstance::GetItemRequiredLevel(bool augments) const
return level;
}
int EQEmu::ItemInstance::GetItemWeaponDamage(bool augments) const
int EQ::ItemInstance::GetItemWeaponDamage(bool augments) const
{
int damage = 0;
const auto item = GetItem();
@@ -1137,7 +1137,7 @@ int EQEmu::ItemInstance::GetItemWeaponDamage(bool augments) const
return damage;
}
int EQEmu::ItemInstance::GetItemBackstabDamage(bool augments) const
int EQ::ItemInstance::GetItemBackstabDamage(bool augments) const
{
int damage = 0;
const auto item = GetItem();
@@ -1153,7 +1153,7 @@ int EQEmu::ItemInstance::GetItemBackstabDamage(bool augments) const
return damage;
}
int EQEmu::ItemInstance::GetItemBaneDamageBody(bool augments) const
int EQ::ItemInstance::GetItemBaneDamageBody(bool augments) const
{
int body = 0;
const auto item = GetItem();
@@ -1174,7 +1174,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageBody(bool augments) const
return body;
}
int EQEmu::ItemInstance::GetItemBaneDamageRace(bool augments) const
int EQ::ItemInstance::GetItemBaneDamageRace(bool augments) const
{
int race = 0;
const auto item = GetItem();
@@ -1195,7 +1195,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageRace(bool augments) const
return race;
}
int EQEmu::ItemInstance::GetItemBaneDamageBody(bodyType against, bool augments) const
int EQ::ItemInstance::GetItemBaneDamageBody(bodyType against, bool augments) const
{
int damage = 0;
const auto item = GetItem();
@@ -1212,7 +1212,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageBody(bodyType against, bool augments)
return damage;
}
int EQEmu::ItemInstance::GetItemBaneDamageRace(uint16 against, bool augments) const
int EQ::ItemInstance::GetItemBaneDamageRace(uint16 against, bool augments) const
{
int damage = 0;
const auto item = GetItem();
@@ -1229,7 +1229,7 @@ int EQEmu::ItemInstance::GetItemBaneDamageRace(uint16 against, bool augments) co
return damage;
}
int EQEmu::ItemInstance::GetItemMagical(bool augments) const
int EQ::ItemInstance::GetItemMagical(bool augments) const
{
const auto item = GetItem();
if (item) {
@@ -1245,7 +1245,7 @@ int EQEmu::ItemInstance::GetItemMagical(bool augments) const
return 0;
}
int EQEmu::ItemInstance::GetItemHP(bool augments) const
int EQ::ItemInstance::GetItemHP(bool augments) const
{
int hp = 0;
const auto item = GetItem();
@@ -1259,7 +1259,7 @@ int EQEmu::ItemInstance::GetItemHP(bool augments) const
return hp;
}
int EQEmu::ItemInstance::GetItemMana(bool augments) const
int EQ::ItemInstance::GetItemMana(bool augments) const
{
int mana = 0;
const auto item = GetItem();
@@ -1273,7 +1273,7 @@ int EQEmu::ItemInstance::GetItemMana(bool augments) const
return mana;
}
int EQEmu::ItemInstance::GetItemEndur(bool augments) const
int EQ::ItemInstance::GetItemEndur(bool augments) const
{
int endur = 0;
const auto item = GetItem();
@@ -1287,7 +1287,7 @@ int EQEmu::ItemInstance::GetItemEndur(bool augments) const
return endur;
}
int EQEmu::ItemInstance::GetItemAttack(bool augments) const
int EQ::ItemInstance::GetItemAttack(bool augments) const
{
int atk = 0;
const auto item = GetItem();
@@ -1301,7 +1301,7 @@ int EQEmu::ItemInstance::GetItemAttack(bool augments) const
return atk;
}
int EQEmu::ItemInstance::GetItemStr(bool augments) const
int EQ::ItemInstance::GetItemStr(bool augments) const
{
int str = 0;
const auto item = GetItem();
@@ -1315,7 +1315,7 @@ int EQEmu::ItemInstance::GetItemStr(bool augments) const
return str;
}
int EQEmu::ItemInstance::GetItemSta(bool augments) const
int EQ::ItemInstance::GetItemSta(bool augments) const
{
int sta = 0;
const auto item = GetItem();
@@ -1329,7 +1329,7 @@ int EQEmu::ItemInstance::GetItemSta(bool augments) const
return sta;
}
int EQEmu::ItemInstance::GetItemDex(bool augments) const
int EQ::ItemInstance::GetItemDex(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1343,7 +1343,7 @@ int EQEmu::ItemInstance::GetItemDex(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemAgi(bool augments) const
int EQ::ItemInstance::GetItemAgi(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1357,7 +1357,7 @@ int EQEmu::ItemInstance::GetItemAgi(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemInt(bool augments) const
int EQ::ItemInstance::GetItemInt(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1371,7 +1371,7 @@ int EQEmu::ItemInstance::GetItemInt(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemWis(bool augments) const
int EQ::ItemInstance::GetItemWis(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1385,7 +1385,7 @@ int EQEmu::ItemInstance::GetItemWis(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemCha(bool augments) const
int EQ::ItemInstance::GetItemCha(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1399,7 +1399,7 @@ int EQEmu::ItemInstance::GetItemCha(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemMR(bool augments) const
int EQ::ItemInstance::GetItemMR(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1413,7 +1413,7 @@ int EQEmu::ItemInstance::GetItemMR(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemFR(bool augments) const
int EQ::ItemInstance::GetItemFR(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1427,7 +1427,7 @@ int EQEmu::ItemInstance::GetItemFR(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemCR(bool augments) const
int EQ::ItemInstance::GetItemCR(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1441,7 +1441,7 @@ int EQEmu::ItemInstance::GetItemCR(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemPR(bool augments) const
int EQ::ItemInstance::GetItemPR(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1455,7 +1455,7 @@ int EQEmu::ItemInstance::GetItemPR(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemDR(bool augments) const
int EQ::ItemInstance::GetItemDR(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1469,7 +1469,7 @@ int EQEmu::ItemInstance::GetItemDR(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemCorrup(bool augments) const
int EQ::ItemInstance::GetItemCorrup(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1483,7 +1483,7 @@ int EQEmu::ItemInstance::GetItemCorrup(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemHeroicStr(bool augments) const
int EQ::ItemInstance::GetItemHeroicStr(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1497,7 +1497,7 @@ int EQEmu::ItemInstance::GetItemHeroicStr(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemHeroicSta(bool augments) const
int EQ::ItemInstance::GetItemHeroicSta(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1511,7 +1511,7 @@ int EQEmu::ItemInstance::GetItemHeroicSta(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemHeroicDex(bool augments) const
int EQ::ItemInstance::GetItemHeroicDex(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1525,7 +1525,7 @@ int EQEmu::ItemInstance::GetItemHeroicDex(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemHeroicAgi(bool augments) const
int EQ::ItemInstance::GetItemHeroicAgi(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1539,7 +1539,7 @@ int EQEmu::ItemInstance::GetItemHeroicAgi(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemHeroicInt(bool augments) const
int EQ::ItemInstance::GetItemHeroicInt(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1553,7 +1553,7 @@ int EQEmu::ItemInstance::GetItemHeroicInt(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemHeroicWis(bool augments) const
int EQ::ItemInstance::GetItemHeroicWis(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1567,7 +1567,7 @@ int EQEmu::ItemInstance::GetItemHeroicWis(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemHeroicCha(bool augments) const
int EQ::ItemInstance::GetItemHeroicCha(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1581,7 +1581,7 @@ int EQEmu::ItemInstance::GetItemHeroicCha(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemHeroicMR(bool augments) const
int EQ::ItemInstance::GetItemHeroicMR(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1595,7 +1595,7 @@ int EQEmu::ItemInstance::GetItemHeroicMR(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemHeroicFR(bool augments) const
int EQ::ItemInstance::GetItemHeroicFR(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1609,7 +1609,7 @@ int EQEmu::ItemInstance::GetItemHeroicFR(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemHeroicCR(bool augments) const
int EQ::ItemInstance::GetItemHeroicCR(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1623,7 +1623,7 @@ int EQEmu::ItemInstance::GetItemHeroicCR(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemHeroicPR(bool augments) const
int EQ::ItemInstance::GetItemHeroicPR(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1637,7 +1637,7 @@ int EQEmu::ItemInstance::GetItemHeroicPR(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemHeroicDR(bool augments) const
int EQ::ItemInstance::GetItemHeroicDR(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1651,7 +1651,7 @@ int EQEmu::ItemInstance::GetItemHeroicDR(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemHeroicCorrup(bool augments) const
int EQ::ItemInstance::GetItemHeroicCorrup(bool augments) const
{
int total = 0;
const auto item = GetItem();
@@ -1665,7 +1665,7 @@ int EQEmu::ItemInstance::GetItemHeroicCorrup(bool augments) const
return total;
}
int EQEmu::ItemInstance::GetItemHaste(bool augments) const
int EQ::ItemInstance::GetItemHaste(bool augments) const
{
int total = 0;
const auto item = GetItem();
+7 -7
View File
@@ -38,7 +38,7 @@ class EvolveInfo; // Stores information about an evolving item family
#include <map>
// Specifies usage type for item inside EQEmu::ItemInstance
// Specifies usage type for item inside EQ::ItemInstance
enum ItemInstTypes
{
ItemInstNormal = 0,
@@ -54,14 +54,14 @@ typedef enum {
class SharedDatabase;
// ########################################
// Class: EQEmu::ItemInstance
// Class: EQ::ItemInstance
// Base class for an instance of an item
// An item instance encapsulates item data + data specific
// to an item instance (includes dye, augments, charges, etc)
namespace EQEmu
namespace EQ
{
class InventoryProfile;
class ItemInstance {
public:
/////////////////////////
@@ -222,7 +222,7 @@ namespace EQEmu
inline int32 GetSerialNumber() const { return m_SerialNumber; }
inline void SetSerialNumber(int32 id) { m_SerialNumber = id; }
std::map<std::string, Timer>& GetTimers() { return m_timers; }
std::map<std::string, ::Timer>& GetTimers() { return m_timers; }
void SetTimer(std::string name, uint32 time);
void StopTimer(std::string name);
void ClearTimers();
@@ -316,13 +316,13 @@ namespace EQEmu
// Items inside of this item (augs or contents);
std::map<uint8, ItemInstance*> m_contents; // Zero-based index: min=0, max=9
std::map<std::string, std::string> m_custom_data;
std::map<std::string, Timer> m_timers;
std::map<std::string, ::Timer> m_timers;
};
}
class EvolveInfo {
public:
friend class EQEmu::ItemInstance;
friend class EQ::ItemInstance;
//temporary
uint16 LvlKills[9];
uint32 FirstItem;
+5 -5
View File
@@ -22,7 +22,7 @@
#include <string.h>
uint8 EQEmu::lightsource::TypeToLevel(uint8 light_type)
uint8 EQ::lightsource::TypeToLevel(uint8 light_type)
{
switch (light_type) {
case LightTypeGlobeOfStars:
@@ -55,7 +55,7 @@ uint8 EQEmu::lightsource::TypeToLevel(uint8 light_type)
}
}
bool EQEmu::lightsource::IsLevelGreater(uint8 left_type, uint8 right_type)
bool EQ::lightsource::IsLevelGreater(uint8 left_type, uint8 right_type)
{
static const uint8 light_levels[LightTypeCount] = {
LightLevelUnlit, /* LightTypeNone */
@@ -82,17 +82,17 @@ bool EQEmu::lightsource::IsLevelGreater(uint8 left_type, uint8 right_type)
return (light_levels[left_type] > light_levels[right_type]);
}
EQEmu::LightSource_Struct::LightSource_Struct()
EQ::LightSource_Struct::LightSource_Struct()
{
Clear();
}
void EQEmu::LightSource_Struct::Clear()
void EQ::LightSource_Struct::Clear()
{
memset(&Slot, 0, (sizeof(uint8) * lightsource::LightCount));
}
void EQEmu::LightSourceProfile::Clear()
void EQ::LightSourceProfile::Clear()
{
Type.Clear();
Level.Clear();
+1 -1
View File
@@ -23,7 +23,7 @@
#include "types.h"
namespace EQEmu
namespace EQ
{
namespace lightsource {
enum LightSlot {
+9 -7
View File
@@ -39,13 +39,15 @@ struct LootTable_Struct {
};
struct LootDropEntries_Struct {
uint32 item_id;
int8 item_charges;
uint8 equip_item;
float chance;
uint8 minlevel;
uint8 maxlevel;
uint8 multiplier;
uint32 item_id;
int8 item_charges;
uint8 equip_item;
float chance;
uint16 trivial_min_level;
uint16 trivial_max_level;
uint16 npc_min_level;
uint16 npc_max_level;
uint8 multiplier;
};
struct LootDrop_Struct {
+24 -24
View File
@@ -20,7 +20,7 @@
#include "memory_buffer.h"
EQEmu::MemoryBuffer::MemoryBuffer()
EQ::MemoryBuffer::MemoryBuffer()
{
buffer_ = nullptr;
size_ = 0;
@@ -29,7 +29,7 @@ EQEmu::MemoryBuffer::MemoryBuffer()
write_pos_ = 0;
}
EQEmu::MemoryBuffer::MemoryBuffer(size_t sz)
EQ::MemoryBuffer::MemoryBuffer(size_t sz)
{
buffer_ = nullptr;
size_ = 0;
@@ -39,7 +39,7 @@ EQEmu::MemoryBuffer::MemoryBuffer(size_t sz)
Resize(sz);
}
EQEmu::MemoryBuffer::MemoryBuffer(const MemoryBuffer &other)
EQ::MemoryBuffer::MemoryBuffer(const MemoryBuffer &other)
{
if(other.capacity_) {
buffer_ = new uchar[other.capacity_];
@@ -54,7 +54,7 @@ EQEmu::MemoryBuffer::MemoryBuffer(const MemoryBuffer &other)
read_pos_ = other.read_pos_;
}
EQEmu::MemoryBuffer::MemoryBuffer(MemoryBuffer &&other)
EQ::MemoryBuffer::MemoryBuffer(MemoryBuffer &&other)
{
uchar *tbuf = other.buffer_;
size_t tsz = other.size_;
@@ -75,7 +75,7 @@ EQEmu::MemoryBuffer::MemoryBuffer(MemoryBuffer &&other)
read_pos_ = tread_pos;
}
EQEmu::MemoryBuffer& EQEmu::MemoryBuffer::operator=(const MemoryBuffer &other)
EQ::MemoryBuffer& EQ::MemoryBuffer::operator=(const MemoryBuffer &other)
{
if(this == &other) {
return *this;
@@ -100,7 +100,7 @@ EQEmu::MemoryBuffer& EQEmu::MemoryBuffer::operator=(const MemoryBuffer &other)
return *this;
}
EQEmu::MemoryBuffer& EQEmu::MemoryBuffer::operator=(MemoryBuffer &&other)
EQ::MemoryBuffer& EQ::MemoryBuffer::operator=(MemoryBuffer &&other)
{
uchar *tbuf = other.buffer_;
size_t tsz = other.size_;
@@ -122,7 +122,7 @@ EQEmu::MemoryBuffer& EQEmu::MemoryBuffer::operator=(MemoryBuffer &&other)
return *this;
}
EQEmu::MemoryBuffer& EQEmu::MemoryBuffer::operator+=(const MemoryBuffer &rhs)
EQ::MemoryBuffer& EQ::MemoryBuffer::operator+=(const MemoryBuffer &rhs)
{
if(!rhs.buffer_) {
return *this;
@@ -142,52 +142,52 @@ EQEmu::MemoryBuffer& EQEmu::MemoryBuffer::operator+=(const MemoryBuffer &rhs)
return *this;
}
EQEmu::MemoryBuffer::~MemoryBuffer()
EQ::MemoryBuffer::~MemoryBuffer()
{
Clear();
}
uchar& EQEmu::MemoryBuffer::operator[](size_t pos)
uchar& EQ::MemoryBuffer::operator[](size_t pos)
{
return buffer_[pos];
}
const uchar& EQEmu::MemoryBuffer::operator[](size_t pos) const
const uchar& EQ::MemoryBuffer::operator[](size_t pos) const
{
return buffer_[pos];
}
bool EQEmu::MemoryBuffer::Empty()
bool EQ::MemoryBuffer::Empty()
{
return size_ == 0;
}
bool EQEmu::MemoryBuffer::Empty() const
bool EQ::MemoryBuffer::Empty() const
{
return size_ == 0;
}
size_t EQEmu::MemoryBuffer::Size()
size_t EQ::MemoryBuffer::Size()
{
return size_;
}
size_t EQEmu::MemoryBuffer::Size() const
size_t EQ::MemoryBuffer::Size() const
{
return size_;
}
size_t EQEmu::MemoryBuffer::Capacity()
size_t EQ::MemoryBuffer::Capacity()
{
return capacity_;
}
size_t EQEmu::MemoryBuffer::Capacity() const
size_t EQ::MemoryBuffer::Capacity() const
{
return capacity_;
}
void EQEmu::MemoryBuffer::Resize(size_t sz)
void EQ::MemoryBuffer::Resize(size_t sz)
{
if(!buffer_) {
size_t new_size = sz + 64;
@@ -213,7 +213,7 @@ void EQEmu::MemoryBuffer::Resize(size_t sz)
}
}
void EQEmu::MemoryBuffer::Clear()
void EQ::MemoryBuffer::Clear()
{
if(buffer_) {
delete[] buffer_;
@@ -226,14 +226,14 @@ void EQEmu::MemoryBuffer::Clear()
read_pos_ = 0;
}
void EQEmu::MemoryBuffer::Zero()
void EQ::MemoryBuffer::Zero()
{
if(buffer_) {
memset(buffer_, 0, capacity_);
}
}
void EQEmu::MemoryBuffer::Write(const char *val, size_t len)
void EQ::MemoryBuffer::Write(const char *val, size_t len)
{
size_t size_needed = write_pos_ + len;
Resize(size_needed);
@@ -242,20 +242,20 @@ void EQEmu::MemoryBuffer::Write(const char *val, size_t len)
write_pos_ += len;
}
void EQEmu::MemoryBuffer::Read(uchar *buf, size_t len)
void EQ::MemoryBuffer::Read(uchar *buf, size_t len)
{
memcpy(buf, &buffer_[read_pos_], len);
read_pos_ += len;
}
void EQEmu::MemoryBuffer::Read(char *str)
void EQ::MemoryBuffer::Read(char *str)
{
size_t len = strlen((const char*)&buffer_[read_pos_]);
memcpy(str, &buffer_[read_pos_], len);
read_pos_ += len;
}
void EQEmu::OutBuffer::overwrite(OutBuffer::pos_type position, const char *_Str, std::streamsize _Count)
void EQ::OutBuffer::overwrite(OutBuffer::pos_type position, const char *_Str, std::streamsize _Count)
{
auto last_pos = tellp();
seekp(position);
@@ -263,7 +263,7 @@ void EQEmu::OutBuffer::overwrite(OutBuffer::pos_type position, const char *_Str,
seekp(last_pos);
}
uchar* EQEmu::OutBuffer::detach()
uchar* EQ::OutBuffer::detach()
{
size_t buffer_size = tellp();
if (buffer_size == 0)
+1 -1
View File
@@ -28,7 +28,7 @@
#include <sstream>
namespace EQEmu
namespace EQ
{
class MemoryBuffer {
public:
+1 -1
View File
@@ -33,7 +33,7 @@
#include <sys/stat.h>
#endif
namespace EQEmu {
namespace EQ {
struct MemoryMappedFile::Implementation {
#ifdef _WINDOWS
+1 -1
View File
@@ -22,7 +22,7 @@
#include <string>
#include "types.h"
namespace EQEmu {
namespace EQ {
//! Memory Backed Shared Memory
/*!
+8 -6
View File
@@ -605,6 +605,8 @@ void EQ::Net::DaybreakConnection::ProcessDecodedPacket(const Packet &p)
ProcessDecodedPacket(StaticPacket(current, subpacket_length));
current += subpacket_length;
}
break;
}
case OP_SessionRequest:
@@ -1101,7 +1103,7 @@ void EQ::Net::DaybreakConnection::ProcessResend(int stream)
InternalBufferedSend(p);
entry.second.last_sent = now;
entry.second.times_resent++;
entry.second.resend_delay = EQEmu::Clamp(entry.second.resend_delay * 2, m_owner->m_options.resend_delay_min, m_owner->m_options.resend_delay_max);
entry.second.resend_delay = EQ::Clamp(entry.second.resend_delay * 2, m_owner->m_options.resend_delay_min, m_owner->m_options.resend_delay_max);
resends++;
}
}
@@ -1130,7 +1132,7 @@ void EQ::Net::DaybreakConnection::ProcessResend(int stream)
InternalBufferedSend(p);
entry.second.last_sent = now;
entry.second.times_resent++;
entry.second.resend_delay = EQEmu::Clamp(entry.second.resend_delay * 2, m_owner->m_options.resend_delay_min, m_owner->m_options.resend_delay_max);
entry.second.resend_delay = EQ::Clamp(entry.second.resend_delay * 2, m_owner->m_options.resend_delay_min, m_owner->m_options.resend_delay_max);
resends++;
}
}
@@ -1182,7 +1184,7 @@ void EQ::Net::DaybreakConnection::OutOfOrderAck(int stream, uint16_t seq)
void EQ::Net::DaybreakConnection::UpdateDataBudget(double budget_add)
{
auto outgoing_data_rate = m_owner->m_options.outgoing_data_rate;
m_outgoing_budget = EQEmu::ClampUpper(m_outgoing_budget + budget_add, outgoing_data_rate);
m_outgoing_budget = EQ::ClampUpper(m_outgoing_budget + budget_add, outgoing_data_rate);
}
void EQ::Net::DaybreakConnection::SendAck(int stream_id, uint16_t seq)
@@ -1403,7 +1405,7 @@ void EQ::Net::DaybreakConnection::InternalQueuePacket(Packet &p, int stream_id,
sent.last_sent = Clock::now();
sent.first_sent = Clock::now();
sent.times_resent = 0;
sent.resend_delay = EQEmu::Clamp(
sent.resend_delay = EQ::Clamp(
static_cast<size_t>((m_rolling_ping * m_owner->m_options.resend_delay_factor) + m_owner->m_options.resend_delay_ms),
m_owner->m_options.resend_delay_min,
m_owner->m_options.resend_delay_max);
@@ -1435,7 +1437,7 @@ void EQ::Net::DaybreakConnection::InternalQueuePacket(Packet &p, int stream_id,
sent.last_sent = Clock::now();
sent.first_sent = Clock::now();
sent.times_resent = 0;
sent.resend_delay = EQEmu::Clamp(
sent.resend_delay = EQ::Clamp(
static_cast<size_t>((m_rolling_ping * m_owner->m_options.resend_delay_factor) + m_owner->m_options.resend_delay_ms),
m_owner->m_options.resend_delay_min,
m_owner->m_options.resend_delay_max);
@@ -1459,7 +1461,7 @@ void EQ::Net::DaybreakConnection::InternalQueuePacket(Packet &p, int stream_id,
sent.last_sent = Clock::now();
sent.first_sent = Clock::now();
sent.times_resent = 0;
sent.resend_delay = EQEmu::Clamp(
sent.resend_delay = EQ::Clamp(
static_cast<size_t>((m_rolling_ping * m_owner->m_options.resend_delay_factor) + m_owner->m_options.resend_delay_ms),
m_owner->m_options.resend_delay_min,
m_owner->m_options.resend_delay_max);
+1 -1
View File
@@ -318,7 +318,7 @@ namespace EQ
void Attach(uv_loop_t *loop);
void Detach();
EQEmu::Random m_rand;
EQ::Random m_rand;
uv_timer_t m_timer;
uv_udp_t m_socket;
uv_loop_t *m_attached;
+364 -249
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -43,7 +43,7 @@ namespace RoF
protected:
virtual std::string Describe() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
virtual const EQ::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
+364 -249
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -43,7 +43,7 @@ namespace RoF2
protected:
virtual std::string Describe() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
virtual const EQ::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
+15 -15
View File
@@ -31,7 +31,7 @@ namespace RoF2
const int16 INULL = 0;
namespace inventory {
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::RoF2; }
inline EQ::versions::ClientVersion GetInventoryRef() { return EQ::versions::ClientVersion::RoF2; }
const bool ConcatenateInvTypeLimbo = false;
@@ -43,7 +43,7 @@ namespace RoF2
} /*inventory*/
namespace invtype {
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::RoF2; }
inline EQ::versions::ClientVersion GetInvTypeRef() { return EQ::versions::ClientVersion::RoF2; }
namespace enum_ {
enum InventoryTypes : int16 {
@@ -118,7 +118,7 @@ namespace RoF2
} /*invtype*/
namespace invslot {
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::RoF2; }
inline EQ::versions::ClientVersion GetInvSlotRef() { return EQ::versions::ClientVersion::RoF2; }
namespace enum_ {
enum InventorySlots : int16 {
@@ -196,7 +196,7 @@ namespace RoF2
} /*invslot*/
namespace invbag {
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::RoF2; }
inline EQ::versions::ClientVersion GetInvBagRef() { return EQ::versions::ClientVersion::RoF2; }
const int16 SLOT_INVALID = IINVALID;
const int16 SLOT_BEGIN = INULL;
@@ -208,7 +208,7 @@ namespace RoF2
} /*invbag*/
namespace invaug {
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::RoF2; }
inline EQ::versions::ClientVersion GetInvAugRef() { return EQ::versions::ClientVersion::RoF2; }
const int16 SOCKET_INVALID = IINVALID;
const int16 SOCKET_BEGIN = INULL;
@@ -220,7 +220,7 @@ namespace RoF2
} /*invaug*/
namespace item {
inline EQEmu::versions::ClientVersion GetItemRef() { return EQEmu::versions::ClientVersion::RoF2; }
inline EQ::versions::ClientVersion GetItemRef() { return EQ::versions::ClientVersion::RoF2; }
//enum Unknown : int { // looks like item class..but, RoF has it too - nothing in UF-
// Unknown1 = 0,
@@ -249,7 +249,7 @@ namespace RoF2
} /*item*/
namespace profile {
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::RoF2; }
inline EQ::versions::ClientVersion GetProfileRef() { return EQ::versions::ClientVersion::RoF2; }
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
@@ -261,11 +261,11 @@ namespace RoF2
} /*profile*/
namespace constants {
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::RoF2; }
inline EQ::versions::ClientVersion GetConstantsRef() { return EQ::versions::ClientVersion::RoF2; }
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::RoF;
const uint32 EXPANSION_BIT = EQEmu::expansions::bitRoF;
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskRoF;
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::RoF;
const uint32 EXPANSION_BIT = EQ::expansions::bitRoF;
const uint32 EXPANSIONS_MASK = EQ::expansions::maskRoF;
const size_t CHARACTER_CREATION_LIMIT = 12;
@@ -274,21 +274,21 @@ namespace RoF2
} /*constants*/
namespace behavior {
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::RoF2; }
inline EQ::versions::ClientVersion GetBehaviorRef() { return EQ::versions::ClientVersion::RoF2; }
const bool CoinHasWeight = false;
} /*behavior*/
namespace skills {
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::RoF2; }
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::RoF2; }
const size_t LastUsableSkill = EQEmu::skills::Skill2HPiercing;
const size_t LastUsableSkill = EQ::skills::Skill2HPiercing;
} /*skills*/
namespace spells {
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::RoF2; }
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::RoF2; }
enum class CastingSlot : uint32 {
Gem1 = 0,
+12 -3
View File
@@ -58,13 +58,16 @@ E(OP_DeleteCharge)
E(OP_DeleteItem)
E(OP_DeleteSpawn)
E(OP_DisciplineUpdate)
E(OP_DzChooseZone)
E(OP_DzCompass)
E(OP_DzExpeditionEndsWarning)
E(OP_DzExpeditionInfo)
E(OP_DzExpeditionList)
E(OP_DzJoinExpeditionConfirm)
E(OP_DzLeaderStatus)
E(OP_DzExpeditionInvite)
E(OP_DzExpeditionLockoutTimers)
E(OP_DzMemberList)
E(OP_DzMemberListName)
E(OP_DzMemberListStatus)
E(OP_DzSetLeaderName)
E(OP_Emote)
E(OP_ExpansionInfo)
E(OP_FormattedMessage)
@@ -159,6 +162,12 @@ D(OP_ConsiderCorpse)
D(OP_Consume)
D(OP_Damage)
D(OP_DeleteItem)
D(OP_DzAddPlayer)
D(OP_DzChooseZoneReply)
D(OP_DzExpeditionInviteResponse)
D(OP_DzMakeLeader)
D(OP_DzRemovePlayer)
D(OP_DzSwapPlayer)
D(OP_Emote)
D(OP_EnvDamage)
D(OP_FaceChange)
+150 -33
View File
@@ -190,7 +190,7 @@ struct TintProfile
Tint_Struct Primary;
Tint_Struct Secondary;
};
Tint_Struct Slot[EQEmu::textures::materialCount];
Tint_Struct Slot[EQ::textures::materialCount];
};
};
@@ -222,7 +222,7 @@ struct Texture_Struct
// Texture_Struct Primary;
// Texture_Struct Secondary;
// };
// Texture_Struct Slot[EQEmu::textures::TextureCount];
// Texture_Struct Slot[EQ::textures::TextureCount];
// };
//
// TextureProfile();
@@ -628,7 +628,7 @@ struct NewZone_Struct {
/*0856*/ uint32 scriptNPCReceivedanItem;
/*0860*/ uint32 bCheck; // padded bool
/*0864*/ uint32 scriptIDSomething;
/*0868*/ uint32 scriptIDSomething2;
/*0868*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
/*0872*/ uint32 scriptIDSomething3;
/*0876*/ uint32 SuspendBuffs; // padded bool
/*0880*/ uint32 LavaDamage; // LavaDamage value
@@ -1113,7 +1113,7 @@ union
/*00184*/ Texture_Struct equipment[22]; // Total Slots
};
/*00624*/ uint32 equip2_count; // Seen 9
/*00628*/ Texture_Struct equipment2[EQEmu::textures::materialCount]; // Appears to be Visible slots, but all 0s
/*00628*/ Texture_Struct equipment2[EQ::textures::materialCount]; // Appears to be Visible slots, but all 0s
/*00808*/ uint32 tint_count; // Seen 9
/*00812*/ TintProfile item_tint; // RR GG BB 00
/*00848*/ uint32 tint_count2; // Seen 9
@@ -4804,8 +4804,8 @@ struct ItemQuaternaryBodyStruct
int32 HealAmt;
int32 SpellDmg;
int32 Clairvoyance;
uint8 unknown18; //Power Source Capacity or evolve filename?
uint32 evolve_string; // Some String, but being evolution related is just a guess
int32 SubType;
uint8 evolve_string; // Some String, but being evolution related is just a guess
uint8 unknown19;
uint16 unknown20;
uint8 unknown21;
@@ -4882,52 +4882,169 @@ struct VeteranClaim
/*076*/ uint32 action;
};
struct ExpeditionEntryHeader_Struct
struct ExpeditionInvite_Struct
{
/*000*/ uint32 client_id; // unique character id
/*004*/ uint32 unknown004;
/*008*/ char inviter_name[64];
/*072*/ char expedition_name[128];
/*200*/ uint8 swapping; // 0: adding 1: swapping
/*201*/ char swap_name[64]; // if swapping, swap name being removed
/*265*/ uint8 padding[3];
/*268*/ uint16 dz_zone_id; // dz_id zone/instance pair, sent back in reply
/*270*/ uint16 dz_instance_id;
};
struct ExpeditionInviteResponse_Struct
{
/*000*/ uint32 unknown000;
/*000*/ uint32 number_of_entries;
};
struct ExpeditionJoinPrompt_Struct
{
/*000*/ uint32 clientid;
/*004*/ uint32 unknown004;
/*008*/ char player_name[64];
/*072*/ char expedition_name[64];
};
struct ExpeditionExpireWarning
{
/*000*/ uint32 clientid;
/*004*/ uint32 unknown004;
/*008*/ uint32 minutes_remaining;
/*008*/ uint16 dz_zone_id; // dz_id pair sent in invite
/*010*/ uint16 dz_instance_id;
/*012*/ uint8 accepted; // 0: declined 1: accepted
/*013*/ uint8 swapping; // 0: adding 1: swapping (sent in invite)
/*014*/ char swap_name[64]; // swap name sent in invite
/*078*/ uint8 unknown078; // padding garbage?
/*079*/ uint8 unknown079; // padding garbage?
};
struct ExpeditionInfo_Struct
{
/*000*/ uint32 clientid;
/*000*/ uint32 client_id;
/*004*/ uint32 unknown004;
/*008*/ uint32 unknown008;
/*008*/ uint32 assigned; // padded bool, 0: not in expedition (clear data), 1: in expedition
/*012*/ uint32 max_players;
/*016*/ char expedition_name[128];
/*142*/ char leader_name[64];
/*016*/ char expedition_name[128];
/*144*/ char leader_name[64];
//*208*/ uint32 unknown208; // live sends 01 00 00 00 here but client doesn't read it
};
struct ExpeditionCompassEntry_Struct
struct ExpeditionMemberEntry_Struct
{
/*000*/ float unknown000; //seen *((uint32*)) = 1584791871
/*004*/ uint32 enabled; //guess
/*008*/ uint32 unknown008; //seen 1019
/*000*/ char name[1]; // variable length, null terminated, max 0x40 (64)
/*000*/ uint8 expedition_status; // 0: unknown 1: Online, 2: Offline, 3: In Dynamic Zone, 4: Link Dead
};
struct ExpeditionMemberList_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 member_count; // number of players in window
/*008*/ ExpeditionMemberEntry_Struct members[0]; // variable length
};
struct ExpeditionMemberListName_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 unknown004;
/*008*/ uint32 add_name; // padded bool, 0: remove name, 1: add name with unknown status
/*012*/ char name[64];
};
struct ExpeditionLockoutTimerEntry_Struct
{
/*000*/ char expedition_name[1]; // variable length, null terminated, max 0x80 (128)
/*000*/ uint32 seconds_remaining;
/*000*/ int32 event_type; // seen -1 (0xffffffff) for replay timers and 1 for event timers
/*000*/ char event_name[1]; // variable length, null terminated, max 0x100 (256)
};
struct ExpeditionLockoutTimers_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 count;
/*008*/ ExpeditionLockoutTimerEntry_Struct timers[0];
};
struct ExpeditionSetLeaderName_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 unknown004;
/*008*/ char leader_name[64];
};
struct ExpeditionCommand_Struct
{
/*000*/ uint32 unknown000;
/*004*/ uint32 unknown004;
/*008*/ char name[64];
};
struct ExpeditionCommandSwap_Struct
{
/*000*/ uint32 unknown000;
/*004*/ uint32 unknown004;
/*008*/ char add_player_name[64]; // swap to (player must confirm)
/*072*/ char rem_player_name[64]; // swap from
};
struct ExpeditionExpireWarning
{
/*000*/ uint32 client_id;
/*004*/ uint32 unknown004;
/*008*/ uint32 minutes_remaining;
};
struct DynamicZoneCompassEntry_Struct
{
/*000*/ uint16 dz_zone_id; // target dz id pair
/*002*/ uint16 dz_instance_id;
/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
/*008*/ uint32 unknown008;
/*012*/ float y;
/*016*/ float x;
/*020*/ float z;
};
struct ExpeditionCompass_Struct
struct DynamicZoneCompass_Struct
{
/*000*/ uint32 clientid;
/*000*/ uint32 client_id;
/*004*/ uint32 count;
/*008*/ ExpeditionCompassEntry_Struct entries[0];
/*008*/ DynamicZoneCompassEntry_Struct entries[0];
};
struct DynamicZoneChooseZoneEntry_Struct
{
/*000*/ uint16 dz_zone_id; // dz_id pair
/*002*/ uint16 dz_instance_id;
/*004*/ uint32 unknown_id1; // seen 28 00 00 00 (40), sent back in reply
/*008*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest -- sent back in reply
/*012*/ uint32 unknown_id2; // possibly an id based on dz type, for expeditions this was same as dz_id (zone|instance) but task dz was different
/*016*/ char description[1]; // variable length, null terminated, max 0x80 (128)
/*000*/ char leader_name[1]; // variable length, null terminated, max 0x40 (64)
};
struct DynamicZoneChooseZone_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 count;
/*008*/ DynamicZoneChooseZoneEntry_Struct choices[0];
};
struct DynamicZoneChooseZoneReply_Struct
{
/*000*/ uint32 unknown000; // ff ff ff ff
/*004*/ uint32 unknown004; // seen 69 00 00 00
/*008*/ uint32 unknown008; // ff ff ff ff
/*012*/ uint32 unknown_id1; // from choose zone entry message
/*016*/ uint16 dz_zone_id; // dz_id pair
/*018*/ uint16 dz_instance_id;
/*020*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest
/*024*/ uint32 unknown_id2; // from choose zone entry message
/*028*/ uint32 unknown028; // 00 00 00 00
/*032*/ uint32 unknown032; // always same as unknown044
/*036*/ uint32 unknown036;
/*040*/ uint32 unknown040;
/*044*/ uint32 unknown044; // always same as unknown032
/*048*/ uint32 unknown048; // seen 01 00 00 00 and 02 00 00 00
};
struct KickPlayers_Struct
{
/*000*/ char char_name[64];
/*064*/ uint32 unknown064; // always 0
/*068*/ uint8 kick_expedition; // true if /kickplayers exp
/*069*/ uint8 kick_task; // true if /kickplayers task
/*070*/ uint8 padding[2];
};
struct MaxCharacters_Struct
+15 -15
View File
@@ -31,7 +31,7 @@ namespace RoF
const int16 INULL = 0;
namespace inventory {
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::RoF; }
inline EQ::versions::ClientVersion GetInventoryRef() { return EQ::versions::ClientVersion::RoF; }
const bool ConcatenateInvTypeLimbo = false;
@@ -43,7 +43,7 @@ namespace RoF
} /*inventory*/
namespace invtype {
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::RoF; }
inline EQ::versions::ClientVersion GetInvTypeRef() { return EQ::versions::ClientVersion::RoF; }
namespace enum_ {
enum InventoryTypes : int16 {
@@ -116,7 +116,7 @@ namespace RoF
} /*invtype*/
namespace invslot {
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::RoF; }
inline EQ::versions::ClientVersion GetInvSlotRef() { return EQ::versions::ClientVersion::RoF; }
namespace enum_ {
enum InventorySlots : int16 {
@@ -194,7 +194,7 @@ namespace RoF
} /*invslot*/
namespace invbag {
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::RoF; }
inline EQ::versions::ClientVersion GetInvBagRef() { return EQ::versions::ClientVersion::RoF; }
const int16 SLOT_INVALID = IINVALID;
const int16 SLOT_BEGIN = INULL;
@@ -206,7 +206,7 @@ namespace RoF
} /*invbag*/
namespace invaug {
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::RoF; }
inline EQ::versions::ClientVersion GetInvAugRef() { return EQ::versions::ClientVersion::RoF; }
const int16 SOCKET_INVALID = IINVALID;
const int16 SOCKET_BEGIN = INULL;
@@ -218,7 +218,7 @@ namespace RoF
} /*invaug*/
namespace item {
inline EQEmu::versions::ClientVersion GetItemRef() { return EQEmu::versions::ClientVersion::RoF; }
inline EQ::versions::ClientVersion GetItemRef() { return EQ::versions::ClientVersion::RoF; }
enum ItemPacketType : int {
ItemPacketMerchant = 100,
@@ -240,7 +240,7 @@ namespace RoF
} /*item*/
namespace profile {
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::RoF; }
inline EQ::versions::ClientVersion GetProfileRef() { return EQ::versions::ClientVersion::RoF; }
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
@@ -252,11 +252,11 @@ namespace RoF
} /*profile*/
namespace constants {
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::RoF; }
inline EQ::versions::ClientVersion GetConstantsRef() { return EQ::versions::ClientVersion::RoF; }
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::RoF;
const uint32 EXPANSION_BIT = EQEmu::expansions::bitRoF;
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskRoF;
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::RoF;
const uint32 EXPANSION_BIT = EQ::expansions::bitRoF;
const uint32 EXPANSIONS_MASK = EQ::expansions::maskRoF;
const size_t CHARACTER_CREATION_LIMIT = 12;
@@ -265,21 +265,21 @@ namespace RoF
} /*constants*/
namespace behavior {
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::RoF; }
inline EQ::versions::ClientVersion GetBehaviorRef() { return EQ::versions::ClientVersion::RoF; }
const bool CoinHasWeight = false;
} /*behavior*/
namespace skills {
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::RoF; }
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::RoF; }
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
const size_t LastUsableSkill = EQ::skills::SkillTripleAttack;
} /*skills*/
namespace spells {
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::RoF; }
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::RoF; }
enum class CastingSlot : uint32 {
Gem1 = 0,
+12 -3
View File
@@ -44,13 +44,16 @@ E(OP_DeleteCharge)
E(OP_DeleteItem)
E(OP_DeleteSpawn)
E(OP_DisciplineUpdate)
E(OP_DzChooseZone)
E(OP_DzCompass)
E(OP_DzExpeditionEndsWarning)
E(OP_DzExpeditionInfo)
E(OP_DzExpeditionList)
E(OP_DzJoinExpeditionConfirm)
E(OP_DzLeaderStatus)
E(OP_DzExpeditionInvite)
E(OP_DzExpeditionLockoutTimers)
E(OP_DzMemberList)
E(OP_DzMemberListName)
E(OP_DzMemberListStatus)
E(OP_DzSetLeaderName)
E(OP_Emote)
E(OP_ExpansionInfo)
E(OP_FormattedMessage)
@@ -145,6 +148,12 @@ D(OP_ConsiderCorpse)
D(OP_Consume)
D(OP_Damage)
D(OP_DeleteItem)
D(OP_DzAddPlayer)
D(OP_DzChooseZoneReply)
D(OP_DzExpeditionInviteResponse)
D(OP_DzMakeLeader)
D(OP_DzRemovePlayer)
D(OP_DzSwapPlayer)
D(OP_Emote)
D(OP_EnvDamage)
D(OP_FaceChange)
+143 -32
View File
@@ -190,7 +190,7 @@ struct TintProfile
Tint_Struct Primary;
Tint_Struct Secondary;
};
Tint_Struct Slot[EQEmu::textures::materialCount];
Tint_Struct Slot[EQ::textures::materialCount];
};
};
@@ -222,7 +222,7 @@ struct Texture_Struct
// Texture_Struct Primary;
// Texture_Struct Secondary;
// };
// Texture_Struct Slot[EQEmu::textures::TextureCount];
// Texture_Struct Slot[EQ::textures::TextureCount];
// };
//
// TextureProfile();
@@ -575,7 +575,11 @@ struct NewZone_Struct {
/*0848*/ int32 unknown848;
/*0852*/ uint16 zone_id;
/*0854*/ uint16 zone_instance;
/*0856*/ char unknown856[20];
/*0856*/ uint32 scriptNPCReceivedanItem;
/*0860*/ uint32 bCheck; // padded bool
/*0864*/ uint32 scriptIDSomething;
/*0868*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
/*0872*/ uint32 scriptIDSomething3;
/*0876*/ uint32 SuspendBuffs;
/*0880*/ uint32 unknown880; // Seen 50
/*0884*/ uint32 unknown884; // Seen 10
@@ -4744,8 +4748,8 @@ struct ItemQuaternaryBodyStruct
int32 HealAmt;
int32 SpellDmg;
int32 Clairvoyance;
uint8 unknown18; //Power Source Capacity or evolve filename?
uint32 evolve_string; // Some String, but being evolution related is just a guess
int32 SubType;
uint8 evolve_string; // Some String, but being evolution related is just a guess
uint8 unknown19;
uint32 unknown20; // Bard Stuff?
//uint32 unknown21;
@@ -4811,52 +4815,159 @@ struct VeteranClaim
/*076*/ uint32 action;
};
struct ExpeditionEntryHeader_Struct
struct ExpeditionInvite_Struct
{
/*000*/ uint32 client_id; // unique character id
/*004*/ uint32 unknown004;
/*008*/ char inviter_name[64];
/*072*/ char expedition_name[128];
/*200*/ uint8 swapping; // 0: adding 1: swapping
/*201*/ char swap_name[64]; // if swapping, swap name being removed
/*265*/ uint8 padding[3];
/*268*/ uint16 dz_zone_id; // dz_id zone/instance pair, sent back in reply
/*270*/ uint16 dz_instance_id;
};
struct ExpeditionInviteResponse_Struct
{
/*000*/ uint32 unknown000;
/*000*/ uint32 number_of_entries;
};
struct ExpeditionJoinPrompt_Struct
{
/*000*/ uint32 clientid;
/*004*/ uint32 unknown004;
/*008*/ char player_name[64];
/*072*/ char expedition_name[64];
};
struct ExpeditionExpireWarning
{
/*000*/ uint32 clientid;
/*004*/ uint32 unknown004;
/*008*/ uint32 minutes_remaining;
/*008*/ uint16 dz_zone_id; // dz_id pair sent in invite
/*010*/ uint16 dz_instance_id;
/*012*/ uint8 accepted; // 0: declined 1: accepted
/*013*/ uint8 swapping; // 0: adding 1: swapping (sent in invite)
/*014*/ char swap_name[64]; // swap name sent in invite
/*078*/ uint8 unknown078; // padding garbage?
/*079*/ uint8 unknown079; // padding garbage?
};
struct ExpeditionInfo_Struct
{
/*000*/ uint32 clientid;
/*000*/ uint32 client_id;
/*004*/ uint32 unknown004;
/*008*/ uint32 unknown008;
/*008*/ uint32 assigned; // padded bool
/*012*/ uint32 max_players;
/*016*/ char expedition_name[128];
/*142*/ char leader_name[64];
/*016*/ char expedition_name[128];
/*144*/ char leader_name[64];
};
struct ExpeditionCompassEntry_Struct
struct ExpeditionMemberEntry_Struct
{
/*000*/ float unknown000; //seen *((uint32*)) = 1584791871
/*004*/ uint32 enabled; //guess
/*008*/ uint32 unknown008; //seen 1019
/*000*/ char name[1]; // variable length, null terminated, max 0x40 (64)
/*000*/ uint8 expedition_status; // 0: unknown 1: Online, 2: Offline, 3: In Dynamic Zone, 4: Link Dead
};
struct ExpeditionMemberList_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 member_count; // number of players in window
/*008*/ ExpeditionMemberEntry_Struct members[0]; // variable length
};
struct ExpeditionMemberListName_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 unknown004;
/*008*/ uint32 add_name; // padded bool, 0: remove name, 1: add name with unknown status
/*012*/ char name[64];
};
struct ExpeditionLockoutTimerEntry_Struct
{
/*000*/ char expedition_name[1]; // variable length, null terminated, max 0x80 (128)
/*000*/ uint32 seconds_remaining;
/*000*/ int32 event_type; // seen -1 (0xffffffff) for replay timers and 1 for event timers
/*000*/ char event_name[1]; // variable length, null terminated, max 0x100 (256)
};
struct ExpeditionLockoutTimers_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 count;
/*008*/ ExpeditionLockoutTimerEntry_Struct timers[0];
};
struct ExpeditionSetLeaderName_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 unknown004;
/*008*/ char leader_name[64];
};
struct ExpeditionCommand_Struct
{
/*000*/ uint32 unknown000;
/*004*/ uint32 unknown004;
/*008*/ char name[64];
};
struct ExpeditionCommandSwap_Struct
{
/*000*/ uint32 unknown000;
/*004*/ uint32 unknown004;
/*008*/ char add_player_name[64]; // swap to (player must confirm)
/*072*/ char rem_player_name[64]; // swap from
};
struct ExpeditionExpireWarning
{
/*000*/ uint32 client_id;
/*004*/ uint32 unknown004;
/*008*/ uint32 minutes_remaining;
};
struct DynamicZoneCompassEntry_Struct
{
/*000*/ uint16 dz_zone_id; // target dz id pair
/*002*/ uint16 dz_instance_id;
/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
/*008*/ uint32 unknown008;
/*012*/ float y;
/*016*/ float x;
/*020*/ float z;
};
struct ExpeditionCompass_Struct
struct DynamicZoneCompass_Struct
{
/*000*/ uint32 clientid;
/*000*/ uint32 client_id;
/*004*/ uint32 count;
/*008*/ ExpeditionCompassEntry_Struct entries[0];
/*008*/ DynamicZoneCompassEntry_Struct entries[0];
};
struct DynamicZoneChooseZoneEntry_Struct
{
/*000*/ uint16 dz_zone_id; // dz_id pair
/*002*/ uint16 dz_instance_id;
/*004*/ uint32 unknown_id1; // sent back in reply
/*008*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest -- sent back in reply
/*012*/ uint32 unknown_id2; // possibly an id based on dz type, for expeditions this was same as dz_id (zone|instance) but task dz was different
/*016*/ char description[1]; // variable length, null terminated, max 0x80 (128)
/*000*/ char leader_name[1]; // variable length, null terminated, max 0x40 (64)
};
struct DynamicZoneChooseZone_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 count;
/*008*/ DynamicZoneChooseZoneEntry_Struct choices[0];
};
struct DynamicZoneChooseZoneReply_Struct
{
/*000*/ uint32 unknown000; // ff ff ff ff
/*004*/ uint32 unknown004; // seen 69 00 00 00
/*008*/ uint32 unknown008; // ff ff ff ff
/*012*/ uint32 unknown_id1; // from choose zone entry message
/*016*/ uint16 dz_zone_id; // dz_id pair
/*018*/ uint16 dz_instance_id;
/*020*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest
/*024*/ uint32 unknown_id2; // from choose zone entry message
/*028*/ uint32 unknown028; // 00 00 00 00
/*032*/ uint32 unknown032; // always same as unknown044
/*036*/ uint32 unknown036;
/*040*/ uint32 unknown040;
/*044*/ uint32 unknown044; // always same as unknown032
/*048*/ uint32 unknown048; // seen 01 00 00 00 and 02 00 00 00
};
struct MaxCharacters_Struct
+291 -176
View File
@@ -43,7 +43,7 @@ namespace SoD
static OpcodeManager *opcodes = nullptr;
static Strategy struct_strategy;
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id, uint8 depth);
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id, uint8 depth);
// server to client inventory location converters
static inline uint32 ServerToSoDSlot(uint32 server_slot);
@@ -59,8 +59,8 @@ namespace SoD
// client to server say link converter
static inline void SoDToServerSayLink(std::string &server_saylink, const std::string &sod_saylink);
static inline spells::CastingSlot ServerToSoDCastingSlot(EQEmu::spells::CastingSlot slot);
static inline EQEmu::spells::CastingSlot SoDToServerCastingSlot(spells::CastingSlot slot);
static inline spells::CastingSlot ServerToSoDCastingSlot(EQ::spells::CastingSlot slot);
static inline EQ::spells::CastingSlot SoDToServerCastingSlot(spells::CastingSlot slot);
static inline int ServerToSoDBuffSlot(int index);
static inline int SoDToServerBuffSlot(int index);
@@ -144,9 +144,9 @@ namespace SoD
return(r);
}
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
const EQ::versions::ClientVersion Strategy::ClientVersion() const
{
return EQEmu::versions::ClientVersion::SoD;
return EQ::versions::ClientVersion::SoD;
}
#include "ss_define.h"
@@ -381,24 +381,24 @@ namespace SoD
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
int item_count = in->size / sizeof(EQ::InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(EQ::InternalSerializedItem_Struct)) != 0) {
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQ::InternalSerializedItem_Struct));
delete in;
return;
}
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
EQ::InternalSerializedItem_Struct* eq = (EQ::InternalSerializedItem_Struct*)in->pBuffer;
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
EQ::OutBuffer ob;
EQ::OutBuffer::pos_type last_pos = ob.tellp();
ob.write((const char*)&item_count, sizeof(uint32));
for (int index = 0; index < item_count; ++index, ++eq) {
SerializeItem(ob, (const EQEmu::ItemInstance*)eq->inst, eq->slot_id, 0);
SerializeItem(ob, (const EQ::ItemInstance*)eq->inst, eq->slot_id, 0);
if (ob.tellp() == last_pos)
LogNetcode("SoD::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
@@ -483,15 +483,48 @@ namespace SoD
FINISH_ENCODE();
}
ENCODE(OP_DzChooseZone)
{
SETUP_VAR_ENCODE(DynamicZoneChooseZone_Struct);
SerializeBuffer buf;
buf.WriteUInt32(emu->client_id);
buf.WriteUInt32(emu->count);
for (uint32 i = 0; i < emu->count; ++i)
{
buf.WriteUInt16(emu->choices[i].dz_zone_id);
buf.WriteUInt16(emu->choices[i].dz_instance_id);
buf.WriteUInt32(emu->choices[i].unknown_id1);
buf.WriteUInt32(emu->choices[i].dz_type);
buf.WriteUInt32(emu->choices[i].unknown_id2);
buf.WriteString(emu->choices[i].description);
buf.WriteString(emu->choices[i].leader_name);
}
__packet->size = buf.size();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
FINISH_ENCODE();
}
ENCODE(OP_DzCompass)
{
SETUP_VAR_ENCODE(ExpeditionCompass_Struct);
ALLOC_VAR_ENCODE(structs::ExpeditionCompass_Struct, sizeof(structs::ExpeditionInfo_Struct) + sizeof(structs::ExpeditionCompassEntry_Struct) * emu->count);
SETUP_VAR_ENCODE(DynamicZoneCompass_Struct);
ALLOC_VAR_ENCODE(structs::DynamicZoneCompass_Struct,
sizeof(structs::DynamicZoneCompass_Struct) +
sizeof(structs::DynamicZoneCompassEntry_Struct) * emu->count
);
OUT(client_id);
OUT(count);
for (uint32 i = 0; i < emu->count; ++i)
{
OUT(entries[i].dz_zone_id);
OUT(entries[i].dz_instance_id);
OUT(entries[i].dz_type);
OUT(entries[i].x);
OUT(entries[i].y);
OUT(entries[i].z);
@@ -515,81 +548,60 @@ namespace SoD
ENCODE_LENGTH_EXACT(ExpeditionInfo_Struct);
SETUP_DIRECT_ENCODE(ExpeditionInfo_Struct, structs::ExpeditionInfo_Struct);
OUT(client_id);
OUT(assigned);
OUT(max_players);
eq->unknown004 = 785316192;
eq->unknown008 = 435601;
strcpy(eq->expedition_name, emu->expedition_name);
strcpy(eq->leader_name, emu->leader_name);
strn0cpy(eq->expedition_name, emu->expedition_name, sizeof(eq->expedition_name));
strn0cpy(eq->leader_name, emu->leader_name, sizeof(eq->leader_name));
FINISH_ENCODE();
}
ENCODE(OP_DzExpeditionList)
ENCODE(OP_DzExpeditionInvite)
{
SETUP_VAR_ENCODE(ExpeditionLockoutList_Struct);
ENCODE_LENGTH_EXACT(ExpeditionInvite_Struct);
SETUP_DIRECT_ENCODE(ExpeditionInvite_Struct, structs::ExpeditionInvite_Struct);
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
uint32 client_id = 0;
uint8 null_term = 0;
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&emu->count, sizeof(uint32));
OUT(client_id);
strn0cpy(eq->inviter_name, emu->inviter_name, sizeof(eq->inviter_name));
strn0cpy(eq->expedition_name, emu->expedition_name, sizeof(eq->expedition_name));
OUT(swapping);
strn0cpy(eq->swap_name, emu->swap_name, sizeof(eq->swap_name));
OUT(dz_zone_id);
OUT(dz_instance_id);
FINISH_ENCODE();
}
ENCODE(OP_DzExpeditionLockoutTimers)
{
SETUP_VAR_ENCODE(ExpeditionLockoutTimers_Struct);
SerializeBuffer buf;
buf.WriteUInt32(emu->client_id);
buf.WriteUInt32(emu->count);
for (uint32 i = 0; i < emu->count; ++i)
{
ss.write(emu->entries[i].expedition, strlen(emu->entries[i].expedition));
ss.write((const char*)&null_term, sizeof(char));
ss.write((const char*)&emu->entries[i].time_left, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write(emu->entries[i].expedition_event, strlen(emu->entries[i].expedition_event));
ss.write((const char*)&null_term, sizeof(char));
buf.WriteString(emu->timers[i].expedition_name);
buf.WriteUInt32(emu->timers[i].seconds_remaining);
buf.WriteInt32(emu->timers[i].event_type);
buf.WriteString(emu->timers[i].event_name);
}
__packet->size = ss.str().length();
__packet->size = buf.size();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
FINISH_ENCODE();
}
ENCODE(OP_DzJoinExpeditionConfirm)
ENCODE(OP_DzSetLeaderName)
{
ENCODE_LENGTH_EXACT(ExpeditionJoinPrompt_Struct);
SETUP_DIRECT_ENCODE(ExpeditionJoinPrompt_Struct, structs::ExpeditionJoinPrompt_Struct);
ENCODE_LENGTH_EXACT(ExpeditionSetLeaderName_Struct);
SETUP_DIRECT_ENCODE(ExpeditionSetLeaderName_Struct, structs::ExpeditionSetLeaderName_Struct);
strcpy(eq->expedition_name, emu->expedition_name);
strcpy(eq->player_name, emu->player_name);
FINISH_ENCODE();
}
ENCODE(OP_DzLeaderStatus)
{
SETUP_VAR_ENCODE(ExpeditionLeaderSet_Struct);
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
uint32 client_id = 0;
uint8 null_term = 0;
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write(emu->leader_name, strlen(emu->leader_name));
ss.write((const char*)&null_term, sizeof(char));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));//0xffffffff
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));//1
ss.write((const char*)&client_id, sizeof(uint32));
__packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
OUT(client_id);
strn0cpy(eq->leader_name, emu->leader_name, sizeof(eq->leader_name));
FINISH_ENCODE();
}
@@ -598,26 +610,44 @@ namespace SoD
{
SETUP_VAR_ENCODE(ExpeditionMemberList_Struct);
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
uint32 client_id = 0;
uint8 null_term = 0;
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&emu->count, sizeof(uint32));
for (uint32 i = 0; i < emu->count; ++i)
SerializeBuffer buf;
buf.WriteUInt32(emu->client_id);
buf.WriteUInt32(emu->member_count);
for (uint32 i = 0; i < emu->member_count; ++i)
{
ss.write(emu->entries[i].name, strlen(emu->entries[i].name));
ss.write((const char*)&null_term, sizeof(char));
ss.write((const char*)&emu->entries[i].status, sizeof(char));
buf.WriteString(emu->members[i].name);
buf.WriteUInt8(emu->members[i].expedition_status);
}
__packet->size = ss.str().length();
__packet->size = buf.size();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
FINISH_ENCODE();
}
ENCODE(OP_DzMemberListName)
{
ENCODE_LENGTH_EXACT(ExpeditionMemberListName_Struct);
SETUP_DIRECT_ENCODE(ExpeditionMemberListName_Struct, structs::ExpeditionMemberListName_Struct);
OUT(client_id);
OUT(add_name);
strn0cpy(eq->name, emu->name, sizeof(eq->name));
FINISH_ENCODE();
}
ENCODE(OP_DzMemberListStatus)
{
auto emu = reinterpret_cast<ExpeditionMemberList_Struct*>((*p)->pBuffer);
if (emu->member_count == 1)
{
ENCODE_FORWARD(OP_DzMemberList);
}
}
ENCODE(OP_Emote)
{
EQApplicationPacket *in = *p;
@@ -1060,14 +1090,14 @@ namespace SoD
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
EQEmu::InternalSerializedItem_Struct* int_struct = (EQEmu::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQ::InternalSerializedItem_Struct* int_struct = (EQ::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
EQ::OutBuffer ob;
EQ::OutBuffer::pos_type last_pos = ob.tellp();
ob.write((const char*)__emu_buffer, 4);
SerializeItem(ob, (const EQEmu::ItemInstance*)int_struct->inst, int_struct->slot_id, 0);
SerializeItem(ob, (const EQ::ItemInstance*)int_struct->inst, int_struct->slot_id, 0);
if (ob.tellp() == last_pos) {
LogNetcode("SoD::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
delete in;
@@ -1353,6 +1383,7 @@ namespace SoD
OUT(FastRegenHP);
OUT(FastRegenMana);
OUT(FastRegenEndurance);
OUT(underworld_teleport_index);
/*fill in some unknowns with observed values, hopefully it will help */
eq->unknown800 = -1;
@@ -1463,7 +1494,7 @@ namespace SoD
OUT(hairstyle);
OUT(beard);
// OUT(unknown00178[10]);
for (r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++) {
for (r = EQ::textures::textureBegin; r < EQ::textures::materialCount; r++) {
eq->equipment.Slot[r].Material = emu->item_material.Slot[r].Material;
eq->equipment.Slot[r].Unknown1 = 0;
eq->equipment.Slot[r].EliteMaterial = 0;
@@ -1493,7 +1524,7 @@ namespace SoD
OUT(face);
// OUT(unknown02264[47]);
if (spells::SPELLBOOK_SIZE <= EQEmu::spells::SPELLBOOK_SIZE) {
if (spells::SPELLBOOK_SIZE <= EQ::spells::SPELLBOOK_SIZE) {
for (uint32 r = 0; r < spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
eq->spell_book[r] = emu->spell_book[r];
@@ -1502,14 +1533,14 @@ namespace SoD
}
}
else {
for (uint32 r = 0; r < EQEmu::spells::SPELLBOOK_SIZE; r++) {
for (uint32 r = 0; r < EQ::spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
eq->spell_book[r] = emu->spell_book[r];
else
eq->spell_book[r] = 0xFFFFFFFFU;
}
// invalidate the rest of the spellbook slots
memset(&eq->spell_book[EQEmu::spells::SPELLBOOK_SIZE], 0xFF, (sizeof(uint32) * (spells::SPELLBOOK_SIZE - EQEmu::spells::SPELLBOOK_SIZE)));
memset(&eq->spell_book[EQ::spells::SPELLBOOK_SIZE], 0xFF, (sizeof(uint32) * (spells::SPELLBOOK_SIZE - EQ::spells::SPELLBOOK_SIZE)));
}
// OUT(unknown4184[128]);
@@ -1553,7 +1584,7 @@ namespace SoD
// OUT(unknown06160[4]);
// Copy bandoliers where server and client indices converge
for (r = 0; r < EQEmu::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
for (r = 0; r < EQ::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
OUT_str(bandoliers[r].Name);
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
OUT(bandoliers[r].Items[k].ID);
@@ -1562,7 +1593,7 @@ namespace SoD
}
}
// Nullify bandoliers where server and client indices diverge, with a client bias
for (r = EQEmu::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
for (r = EQ::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
eq->bandoliers[r].Name[0] = '\0';
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
eq->bandoliers[r].Items[k].ID = 0;
@@ -1574,13 +1605,13 @@ namespace SoD
// OUT(unknown07444[5120]);
// Copy potion belt where server and client indices converge
for (r = 0; r < EQEmu::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
for (r = 0; r < EQ::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
OUT(potionbelt.Items[r].ID);
OUT(potionbelt.Items[r].Icon);
OUT_str(potionbelt.Items[r].Name);
}
// Nullify potion belt where server and client indices diverge, with a client bias
for (r = EQEmu::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
for (r = EQ::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
eq->potionbelt.Items[r].ID = 0;
eq->potionbelt.Items[r].Icon = 0;
eq->potionbelt.Items[r].Name[0] = '\0';
@@ -1923,7 +1954,7 @@ namespace SoD
eq_cse->HairColor = emu_cse->HairColor;
eq_cse->Face = emu_cse->Face;
for (int equip_index = EQEmu::textures::textureBegin; equip_index < EQEmu::textures::materialCount; equip_index++) {
for (int equip_index = EQ::textures::textureBegin; equip_index < EQ::textures::materialCount; equip_index++) {
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
@@ -2484,7 +2515,7 @@ namespace SoD
float SpawnSize = emu->size;
if (!((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522)))
{
PacketSize -= (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
PacketSize -= (sizeof(structs::Texture_Struct) * EQ::textures::materialCount);
if (emu->size == 0)
{
@@ -2681,7 +2712,7 @@ namespace SoD
if ((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
{
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; ++k)
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; ++k)
{
{
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment_tint.Slot[k].Color);
@@ -2708,13 +2739,13 @@ namespace SoD
{
structs::Texture_Struct *Equipment = (structs::Texture_Struct *)Buffer;
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; k++) {
Equipment[k].Material = emu->equipment.Slot[k].Material;
Equipment[k].Unknown1 = emu->equipment.Slot[k].Unknown1;
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
}
Buffer += (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
Buffer += (sizeof(structs::Texture_Struct) * EQ::textures::materialCount);
}
if (strlen(emu->title))
{
@@ -2973,6 +3004,84 @@ namespace SoD
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzAddPlayer)
{
DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
strn0cpy(emu->name, eq->name, sizeof(emu->name));
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzChooseZoneReply)
{
DECODE_LENGTH_EXACT(structs::DynamicZoneChooseZoneReply_Struct);
SETUP_DIRECT_DECODE(DynamicZoneChooseZoneReply_Struct, structs::DynamicZoneChooseZoneReply_Struct);
IN(unknown000);
IN(unknown004);
IN(unknown008);
IN(unknown_id1);
IN(dz_zone_id);
IN(dz_instance_id);
IN(dz_type);
IN(unknown_id2);
IN(unknown028);
IN(unknown032);
IN(unknown036);
IN(unknown040);
IN(unknown044);
IN(unknown048);
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzExpeditionInviteResponse)
{
DECODE_LENGTH_EXACT(structs::ExpeditionInviteResponse_Struct);
SETUP_DIRECT_DECODE(ExpeditionInviteResponse_Struct, structs::ExpeditionInviteResponse_Struct);
IN(dz_zone_id);
IN(dz_instance_id);
IN(accepted);
IN(swapping);
strn0cpy(emu->swap_name, eq->swap_name, sizeof(emu->swap_name));
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzMakeLeader)
{
DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
strn0cpy(emu->name, eq->name, sizeof(emu->name));
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzRemovePlayer)
{
DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
strn0cpy(emu->name, eq->name, sizeof(emu->name));
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzSwapPlayer)
{
DECODE_LENGTH_EXACT(structs::ExpeditionCommandSwap_Struct);
SETUP_DIRECT_DECODE(ExpeditionCommandSwap_Struct, structs::ExpeditionCommandSwap_Struct);
strn0cpy(emu->add_player_name, eq->add_player_name, sizeof(emu->add_player_name));
strn0cpy(emu->rem_player_name, eq->rem_player_name, sizeof(emu->rem_player_name));
FINISH_DIRECT_DECODE();
}
DECODE(OP_Emote)
{
unsigned char *__eq_buffer = __packet->pBuffer;
@@ -3146,7 +3255,7 @@ namespace SoD
for (int i = 0; i < spells::SPELL_GEM_COUNT; ++i)
emu->spell[i] = eq->spell[i];
for (int i = spells::SPELL_GEM_COUNT; i < EQEmu::spells::SPELL_GEM_COUNT; ++i)
for (int i = spells::SPELL_GEM_COUNT; i < EQ::spells::SPELL_GEM_COUNT; ++i)
emu->spell[i] = 0xFFFFFFFF;
FINISH_DIRECT_DECODE();
@@ -3440,9 +3549,9 @@ namespace SoD
return NextItemInstSerialNumber;
}
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id_in, uint8 depth)
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id_in, uint8 depth)
{
const EQEmu::ItemData *item = inst->GetUnscaledItem();
const EQ::ItemData *item = inst->GetUnscaledItem();
SoD::structs::ItemSerializationHeader hdr;
@@ -3631,6 +3740,12 @@ namespace SoD
itbs.no_transfer = item->NoTransfer;
itbs.expendablearrow = item->ExpendableArrow;
// Done to hack older clients to label expendable fishing poles as such
// July 28th, 2018 patch
if (item->ItemType == EQ::item::ItemTypeFishingPole && item->SubType == 0) {
itbs.expendablearrow = 1;
}
ob.write((const char*)&itbs, sizeof(SoD::structs::ItemTertiaryBodyStruct));
// Effect Structures Broken down to allow variable length strings for effect names
@@ -3751,30 +3866,30 @@ namespace SoD
ob.write((const char*)&iqbs, sizeof(SoD::structs::ItemQuaternaryBodyStruct));
EQEmu::OutBuffer::pos_type count_pos = ob.tellp();
EQ::OutBuffer::pos_type count_pos = ob.tellp();
uint32 subitem_count = 0;
ob.write((const char*)&subitem_count, sizeof(uint32));
// moved outside of loop since it is not modified within that scope
int16 SubSlotNumber = EQEmu::invbag::SLOT_INVALID;
int16 SubSlotNumber = EQ::invbag::SLOT_INVALID;
if (slot_id_in <= EQEmu::invslot::slotGeneral8 && slot_id_in >= EQEmu::invslot::GENERAL_BEGIN)
SubSlotNumber = EQEmu::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
else if (slot_id_in <= EQEmu::invslot::GENERAL_END && slot_id_in >= EQEmu::invslot::slotGeneral9)
SubSlotNumber = EQEmu::invbag::SLOT_INVALID;
else if (slot_id_in == EQEmu::invslot::slotCursor)
SubSlotNumber = EQEmu::invbag::CURSOR_BAG_BEGIN;
else if (slot_id_in <= EQEmu::invslot::BANK_END && slot_id_in >= EQEmu::invslot::BANK_BEGIN)
SubSlotNumber = EQEmu::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
else if (slot_id_in <= EQEmu::invslot::SHARED_BANK_END && slot_id_in >= EQEmu::invslot::SHARED_BANK_BEGIN)
SubSlotNumber = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::SHARED_BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
if (slot_id_in <= EQ::invslot::slotGeneral8 && slot_id_in >= EQ::invslot::GENERAL_BEGIN)
SubSlotNumber = EQ::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQ::invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
else if (slot_id_in <= EQ::invslot::GENERAL_END && slot_id_in >= EQ::invslot::slotGeneral9)
SubSlotNumber = EQ::invbag::SLOT_INVALID;
else if (slot_id_in == EQ::invslot::slotCursor)
SubSlotNumber = EQ::invbag::CURSOR_BAG_BEGIN;
else if (slot_id_in <= EQ::invslot::BANK_END && slot_id_in >= EQ::invslot::BANK_BEGIN)
SubSlotNumber = EQ::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
else if (slot_id_in <= EQ::invslot::SHARED_BANK_END && slot_id_in >= EQ::invslot::SHARED_BANK_BEGIN)
SubSlotNumber = EQ::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::SHARED_BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
else
SubSlotNumber = slot_id_in; // not sure if this is the best way to handle this..leaving for now
if (SubSlotNumber != EQEmu::invbag::SLOT_INVALID) {
for (uint32 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; ++index) {
EQEmu::ItemInstance* sub = inst->GetItem(index);
if (SubSlotNumber != EQ::invbag::SLOT_INVALID) {
for (uint32 index = EQ::invbag::SLOT_BEGIN; index <= EQ::invbag::SLOT_END; ++index) {
EQ::ItemInstance* sub = inst->GetItem(index);
if (!sub)
continue;
@@ -3793,59 +3908,59 @@ namespace SoD
{
uint32 SoDSlot = invslot::SLOT_INVALID;
if (serverSlot <= EQEmu::invslot::slotGeneral8) {
if (serverSlot <= EQ::invslot::slotGeneral8) {
SoDSlot = serverSlot;
}
else if (serverSlot <= EQEmu::invslot::CORPSE_END && serverSlot >= EQEmu::invslot::slotCursor) {
else if (serverSlot <= EQ::invslot::CORPSE_END && serverSlot >= EQ::invslot::slotCursor) {
SoDSlot = serverSlot - 2;
}
else if (serverSlot <= EQEmu::invbag::GENERAL_BAGS_8_END && serverSlot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
else if (serverSlot <= EQ::invbag::GENERAL_BAGS_8_END && serverSlot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
SoDSlot = serverSlot + 11;
}
else if (serverSlot <= EQEmu::invbag::CURSOR_BAG_END && serverSlot >= EQEmu::invbag::CURSOR_BAG_BEGIN) {
else if (serverSlot <= EQ::invbag::CURSOR_BAG_END && serverSlot >= EQ::invbag::CURSOR_BAG_BEGIN) {
SoDSlot = serverSlot - 9;
}
else if (serverSlot <= EQEmu::invslot::TRIBUTE_END && serverSlot >= EQEmu::invslot::TRIBUTE_BEGIN) {
else if (serverSlot <= EQ::invslot::TRIBUTE_END && serverSlot >= EQ::invslot::TRIBUTE_BEGIN) {
SoDSlot = serverSlot;
}
else if (serverSlot <= EQEmu::invslot::GUILD_TRIBUTE_END && serverSlot >= EQEmu::invslot::GUILD_TRIBUTE_BEGIN) {
else if (serverSlot <= EQ::invslot::GUILD_TRIBUTE_END && serverSlot >= EQ::invslot::GUILD_TRIBUTE_BEGIN) {
SoDSlot = serverSlot;
}
else if (serverSlot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
else if (serverSlot == EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
SoDSlot = serverSlot;
}
else if (serverSlot <= EQEmu::invslot::BANK_END && serverSlot >= EQEmu::invslot::BANK_BEGIN) {
else if (serverSlot <= EQ::invslot::BANK_END && serverSlot >= EQ::invslot::BANK_BEGIN) {
SoDSlot = serverSlot;
}
else if (serverSlot <= EQEmu::invbag::BANK_BAGS_END && serverSlot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
else if (serverSlot <= EQ::invbag::BANK_BAGS_END && serverSlot >= EQ::invbag::BANK_BAGS_BEGIN) {
SoDSlot = serverSlot + 1;
}
else if (serverSlot <= EQEmu::invslot::SHARED_BANK_END && serverSlot >= EQEmu::invslot::SHARED_BANK_BEGIN) {
else if (serverSlot <= EQ::invslot::SHARED_BANK_END && serverSlot >= EQ::invslot::SHARED_BANK_BEGIN) {
SoDSlot = serverSlot;
}
else if (serverSlot <= EQEmu::invbag::SHARED_BANK_BAGS_END && serverSlot >= EQEmu::invbag::SHARED_BANK_BAGS_BEGIN) {
else if (serverSlot <= EQ::invbag::SHARED_BANK_BAGS_END && serverSlot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
SoDSlot = serverSlot + 1;
}
else if (serverSlot <= EQEmu::invslot::TRADE_END && serverSlot >= EQEmu::invslot::TRADE_BEGIN) {
else if (serverSlot <= EQ::invslot::TRADE_END && serverSlot >= EQ::invslot::TRADE_BEGIN) {
SoDSlot = serverSlot;
}
else if (serverSlot <= EQEmu::invbag::TRADE_BAGS_END && serverSlot >= EQEmu::invbag::TRADE_BAGS_BEGIN) {
else if (serverSlot <= EQ::invbag::TRADE_BAGS_END && serverSlot >= EQ::invbag::TRADE_BAGS_BEGIN) {
SoDSlot = serverSlot;
}
else if (serverSlot <= EQEmu::invslot::WORLD_END && serverSlot >= EQEmu::invslot::WORLD_BEGIN) {
else if (serverSlot <= EQ::invslot::WORLD_END && serverSlot >= EQ::invslot::WORLD_BEGIN) {
SoDSlot = serverSlot;
}
@@ -3858,11 +3973,11 @@ namespace SoD
{
uint32 SoDSlot = invslot::SLOT_INVALID;
if (server_corpse_slot <= EQEmu::invslot::slotGeneral8 && server_corpse_slot >= EQEmu::invslot::slotGeneral1) {
if (server_corpse_slot <= EQ::invslot::slotGeneral8 && server_corpse_slot >= EQ::invslot::slotGeneral1) {
SoDSlot = server_corpse_slot;
}
else if (server_corpse_slot <= EQEmu::invslot::CORPSE_END && server_corpse_slot >= EQEmu::invslot::slotCursor) {
else if (server_corpse_slot <= EQ::invslot::CORPSE_END && server_corpse_slot >= EQ::invslot::slotCursor) {
SoDSlot = server_corpse_slot - 2;
}
@@ -3873,7 +3988,7 @@ namespace SoD
static inline uint32 SoDToServerSlot(uint32 sod_slot)
{
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
uint32 server_slot = EQ::invslot::SLOT_INVALID;
if (sod_slot <= invslot::slotGeneral8) {
server_slot = sod_slot;
@@ -3938,7 +4053,7 @@ namespace SoD
static inline uint32 SoDToServerCorpseSlot(uint32 sod_corpse_slot)
{
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
uint32 server_slot = EQ::invslot::SLOT_INVALID;
if (sod_corpse_slot <= invslot::slotGeneral8 && sod_corpse_slot >= invslot::slotGeneral1) {
server_slot = sod_corpse_slot;
@@ -3955,7 +4070,7 @@ namespace SoD
static inline void ServerToSoDSayLink(std::string &sod_saylink, const std::string &server_saylink)
{
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
if ((constants::SAY_LINK_BODY_SIZE == EQ::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
sod_saylink = server_saylink;
return;
}
@@ -3964,7 +4079,7 @@ namespace SoD
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::constants::SAY_LINK_BODY_SIZE) {
if (segments[segment_iter].length() <= EQ::constants::SAY_LINK_BODY_SIZE) {
sod_saylink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
@@ -3995,7 +4110,7 @@ namespace SoD
static inline void SoDToServerSayLink(std::string &server_saylink, const std::string &sod_saylink)
{
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (sod_saylink.find('\x12') == std::string::npos)) {
if ((EQ::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (sod_saylink.find('\x12') == std::string::npos)) {
server_saylink = sod_saylink;
return;
}
@@ -4029,84 +4144,84 @@ namespace SoD
}
}
static inline spells::CastingSlot ServerToSoDCastingSlot(EQEmu::spells::CastingSlot slot)
static inline spells::CastingSlot ServerToSoDCastingSlot(EQ::spells::CastingSlot slot)
{
switch (slot) {
case EQEmu::spells::CastingSlot::Gem1:
case EQ::spells::CastingSlot::Gem1:
return spells::CastingSlot::Gem1;
case EQEmu::spells::CastingSlot::Gem2:
case EQ::spells::CastingSlot::Gem2:
return spells::CastingSlot::Gem2;
case EQEmu::spells::CastingSlot::Gem3:
case EQ::spells::CastingSlot::Gem3:
return spells::CastingSlot::Gem3;
case EQEmu::spells::CastingSlot::Gem4:
case EQ::spells::CastingSlot::Gem4:
return spells::CastingSlot::Gem4;
case EQEmu::spells::CastingSlot::Gem5:
case EQ::spells::CastingSlot::Gem5:
return spells::CastingSlot::Gem5;
case EQEmu::spells::CastingSlot::Gem6:
case EQ::spells::CastingSlot::Gem6:
return spells::CastingSlot::Gem6;
case EQEmu::spells::CastingSlot::Gem7:
case EQ::spells::CastingSlot::Gem7:
return spells::CastingSlot::Gem7;
case EQEmu::spells::CastingSlot::Gem8:
case EQ::spells::CastingSlot::Gem8:
return spells::CastingSlot::Gem8;
case EQEmu::spells::CastingSlot::Gem9:
case EQ::spells::CastingSlot::Gem9:
return spells::CastingSlot::Gem9;
case EQEmu::spells::CastingSlot::Gem10:
case EQ::spells::CastingSlot::Gem10:
return spells::CastingSlot::Gem10;
case EQEmu::spells::CastingSlot::Item:
case EQEmu::spells::CastingSlot::PotionBelt:
case EQ::spells::CastingSlot::Item:
case EQ::spells::CastingSlot::PotionBelt:
return spells::CastingSlot::Item;
case EQEmu::spells::CastingSlot::Discipline:
case EQ::spells::CastingSlot::Discipline:
return spells::CastingSlot::Discipline;
case EQEmu::spells::CastingSlot::AltAbility:
case EQ::spells::CastingSlot::AltAbility:
return spells::CastingSlot::AltAbility;
default: // we shouldn't have any issues with other slots ... just return something
return spells::CastingSlot::Discipline;
}
}
static inline EQEmu::spells::CastingSlot SoDToServerCastingSlot(spells::CastingSlot slot)
static inline EQ::spells::CastingSlot SoDToServerCastingSlot(spells::CastingSlot slot)
{
switch (slot) {
case spells::CastingSlot::Gem1:
return EQEmu::spells::CastingSlot::Gem1;
return EQ::spells::CastingSlot::Gem1;
case spells::CastingSlot::Gem2:
return EQEmu::spells::CastingSlot::Gem2;
return EQ::spells::CastingSlot::Gem2;
case spells::CastingSlot::Gem3:
return EQEmu::spells::CastingSlot::Gem3;
return EQ::spells::CastingSlot::Gem3;
case spells::CastingSlot::Gem4:
return EQEmu::spells::CastingSlot::Gem4;
return EQ::spells::CastingSlot::Gem4;
case spells::CastingSlot::Gem5:
return EQEmu::spells::CastingSlot::Gem5;
return EQ::spells::CastingSlot::Gem5;
case spells::CastingSlot::Gem6:
return EQEmu::spells::CastingSlot::Gem6;
return EQ::spells::CastingSlot::Gem6;
case spells::CastingSlot::Gem7:
return EQEmu::spells::CastingSlot::Gem7;
return EQ::spells::CastingSlot::Gem7;
case spells::CastingSlot::Gem8:
return EQEmu::spells::CastingSlot::Gem8;
return EQ::spells::CastingSlot::Gem8;
case spells::CastingSlot::Gem9:
return EQEmu::spells::CastingSlot::Gem9;
return EQ::spells::CastingSlot::Gem9;
case spells::CastingSlot::Gem10:
return EQEmu::spells::CastingSlot::Gem10;
return EQ::spells::CastingSlot::Gem10;
case spells::CastingSlot::Discipline:
return EQEmu::spells::CastingSlot::Discipline;
return EQ::spells::CastingSlot::Discipline;
case spells::CastingSlot::Item:
return EQEmu::spells::CastingSlot::Item;
return EQ::spells::CastingSlot::Item;
case spells::CastingSlot::AltAbility:
return EQEmu::spells::CastingSlot::AltAbility;
return EQ::spells::CastingSlot::AltAbility;
default: // we shouldn't have any issues with other slots ... just return something
return EQEmu::spells::CastingSlot::Discipline;
return EQ::spells::CastingSlot::Discipline;
}
}
static inline int ServerToSoDBuffSlot(int index)
{
// we're a disc
if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
spells::LONG_BUFFS + spells::SHORT_BUFFS;
// we're a song
if (index >= EQEmu::spells::LONG_BUFFS)
return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
if (index >= EQ::spells::LONG_BUFFS)
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
@@ -4115,11 +4230,11 @@ namespace SoD
{
// we're a disc
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
EQEmu::spells::SHORT_BUFFS;
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQ::spells::LONG_BUFFS +
EQ::spells::SHORT_BUFFS;
// we're a song
if (index >= spells::LONG_BUFFS)
return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS;
return index - spells::LONG_BUFFS + EQ::spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
+1 -1
View File
@@ -43,7 +43,7 @@ namespace SoD
protected:
virtual std::string Describe() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
virtual const EQ::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
+15 -15
View File
@@ -31,7 +31,7 @@ namespace SoD
const int16 INULL = 0;
namespace inventory {
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::SoD; }
inline EQ::versions::ClientVersion GetInventoryRef() { return EQ::versions::ClientVersion::SoD; }
const bool ConcatenateInvTypeLimbo = true;
@@ -43,7 +43,7 @@ namespace SoD
} /*inventory*/
namespace invtype {
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::SoD; }
inline EQ::versions::ClientVersion GetInvTypeRef() { return EQ::versions::ClientVersion::SoD; }
namespace enum_ {
enum InventoryTypes : int16 {
@@ -106,7 +106,7 @@ namespace SoD
} /*invtype*/
namespace invslot {
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::SoD; }
inline EQ::versions::ClientVersion GetInvSlotRef() { return EQ::versions::ClientVersion::SoD; }
namespace enum_ {
enum InventorySlots : int16 {
@@ -205,7 +205,7 @@ namespace SoD
} /*invslot*/
namespace invbag {
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::SoD; }
inline EQ::versions::ClientVersion GetInvBagRef() { return EQ::versions::ClientVersion::SoD; }
const int16 SLOT_INVALID = IINVALID;
const int16 SLOT_BEGIN = INULL;
@@ -237,7 +237,7 @@ namespace SoD
} /*invbag*/
namespace invaug {
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::SoD; }
inline EQ::versions::ClientVersion GetInvAugRef() { return EQ::versions::ClientVersion::SoD; }
const int16 SOCKET_INVALID = IINVALID;
const int16 SOCKET_BEGIN = INULL;
@@ -249,7 +249,7 @@ namespace SoD
} /*invaug*/
namespace item {
inline EQEmu::versions::ClientVersion GetItemRef() { return EQEmu::versions::ClientVersion::SoD; }
inline EQ::versions::ClientVersion GetItemRef() { return EQ::versions::ClientVersion::SoD; }
enum ItemPacketType : int {
ItemPacketMerchant = 100,
@@ -267,7 +267,7 @@ namespace SoD
} /*item*/
namespace profile {
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::SoD; }
inline EQ::versions::ClientVersion GetProfileRef() { return EQ::versions::ClientVersion::SoD; }
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
@@ -279,11 +279,11 @@ namespace SoD
} /*profile*/
namespace constants {
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::SoD; }
inline EQ::versions::ClientVersion GetConstantsRef() { return EQ::versions::ClientVersion::SoD; }
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::SoD;
const uint32 EXPANSION_BIT = EQEmu::expansions::bitSoD;
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskSoD;
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::SoD;
const uint32 EXPANSION_BIT = EQ::expansions::bitSoD;
const uint32 EXPANSIONS_MASK = EQ::expansions::maskSoD;
const size_t CHARACTER_CREATION_LIMIT = 12;
@@ -292,21 +292,21 @@ namespace SoD
} /*constants*/
namespace behavior {
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::SoD; }
inline EQ::versions::ClientVersion GetBehaviorRef() { return EQ::versions::ClientVersion::SoD; }
const bool CoinHasWeight = false;
} /*behavior*/
namespace skills {
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::SoD; }
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::SoD; }
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
const size_t LastUsableSkill = EQ::skills::SkillTripleAttack;
} /*skills*/
namespace spells {
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::SoD; }
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::SoD; }
enum class CastingSlot : uint32 {
Gem1 = 0,
+12 -3
View File
@@ -35,13 +35,16 @@ E(OP_Consider)
E(OP_Damage)
E(OP_DeleteCharge)
E(OP_DeleteItem)
E(OP_DzChooseZone)
E(OP_DzCompass)
E(OP_DzExpeditionEndsWarning)
E(OP_DzExpeditionInfo)
E(OP_DzExpeditionList)
E(OP_DzJoinExpeditionConfirm)
E(OP_DzLeaderStatus)
E(OP_DzExpeditionInvite)
E(OP_DzExpeditionLockoutTimers)
E(OP_DzMemberList)
E(OP_DzMemberListName)
E(OP_DzMemberListStatus)
E(OP_DzSetLeaderName)
E(OP_Emote)
E(OP_ExpansionInfo)
E(OP_FormattedMessage)
@@ -111,6 +114,12 @@ D(OP_Consider)
D(OP_ConsiderCorpse)
D(OP_Consume)
D(OP_DeleteItem)
D(OP_DzAddPlayer)
D(OP_DzChooseZoneReply)
D(OP_DzExpeditionInviteResponse)
D(OP_DzMakeLeader)
D(OP_DzRemovePlayer)
D(OP_DzSwapPlayer)
D(OP_Emote)
D(OP_FaceChange)
D(OP_FindPersonRequest)
+143 -31
View File
@@ -149,7 +149,7 @@ struct TintProfile
Tint_Struct Primary;
Tint_Struct Secondary;
};
Tint_Struct Slot[EQEmu::textures::materialCount];
Tint_Struct Slot[EQ::textures::materialCount];
};
};
@@ -178,7 +178,7 @@ struct TextureProfile
Texture_Struct Primary;
Texture_Struct Secondary;
};
Texture_Struct Slot[EQEmu::textures::materialCount];
Texture_Struct Slot[EQ::textures::materialCount];
};
TextureProfile();
@@ -195,7 +195,7 @@ struct CharacterSelectEntry_Struct
/*0000*/ uint8 Beard; //
/*0001*/ uint8 HairColor; //
/*0000*/ uint8 Face; //
/*0000*/ CharSelectEquip Equip[EQEmu::textures::materialCount];
/*0000*/ CharSelectEquip Equip[EQ::textures::materialCount];
/*0000*/ uint32 PrimaryIDFile; //
/*0000*/ uint32 SecondaryIDFile; //
/*0000*/ uint8 Unknown15; // 0xff
@@ -444,7 +444,11 @@ struct NewZone_Struct {
/*0848*/ int32 unknown848;
/*0852*/ uint16 zone_id;
/*0854*/ uint16 zone_instance;
/*0856*/ char unknown856[20];
/*0856*/ uint32 scriptNPCReceivedanItem;
/*0860*/ uint32 bCheck; // padded bool
/*0864*/ uint32 scriptIDSomething;
/*0868*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
/*0872*/ uint32 scriptIDSomething3;
/*0876*/ uint32 SuspendBuffs;
/*0880*/ uint32 unknown880; //seen 50
/*0884*/ uint32 unknown884; //seen 10
@@ -4165,52 +4169,160 @@ struct VeteranReward
/*012*/ VeteranRewardItem items[8];
};
struct ExpeditionEntryHeader_Struct
struct ExpeditionInvite_Struct
{
/*000*/ uint32 client_id; // unique character id
/*004*/ uint32 unknown004;
/*008*/ char inviter_name[64];
/*072*/ char expedition_name[128];
/*200*/ uint8 swapping; // 0: adding 1: swapping
/*201*/ char swap_name[64]; // if swapping, swap name being removed
/*265*/ uint8 padding[3];
/*268*/ uint16 dz_zone_id; // dz_id zone/instance pair, sent back in reply
/*270*/ uint16 dz_instance_id;
};
struct ExpeditionInviteResponse_Struct
{
/*000*/ uint32 unknown000;
/*000*/ uint32 number_of_entries;
};
struct ExpeditionJoinPrompt_Struct
{
/*000*/ uint32 clientid;
/*004*/ uint32 unknown004;
/*008*/ char player_name[64];
/*072*/ char expedition_name[64];
};
struct ExpeditionExpireWarning
{
/*000*/ uint32 clientid;
/*004*/ uint32 unknown004;
/*008*/ uint32 minutes_remaining;
/*008*/ uint16 dz_zone_id; // dz_id pair sent in invite
/*010*/ uint16 dz_instance_id;
/*012*/ uint8 accepted; // 0: declined 1: accepted
/*013*/ uint8 swapping; // 0: adding 1: swapping (sent in invite)
/*014*/ char swap_name[64]; // swap name sent in invite
/*078*/ uint8 unknown078; // padding garbage?
/*079*/ uint8 unknown079; // padding garbage?
};
struct ExpeditionInfo_Struct
{
/*000*/ uint32 clientid;
/*000*/ uint32 client_id;
/*004*/ uint32 unknown004;
/*008*/ uint32 unknown008;
/*008*/ uint32 assigned; // padded bool
/*012*/ uint32 max_players;
/*016*/ char expedition_name[128];
/*142*/ char leader_name[64];
/*016*/ char expedition_name[128];
/*144*/ char leader_name[64];
};
struct ExpeditionCompassEntry_Struct
struct ExpeditionMemberEntry_Struct
{
/*000*/ float unknown000; //seen *((uint32*)) = 1584791871
/*004*/ uint32 enabled; //guess
/*008*/ uint32 unknown008; //seen 1019
/*000*/ char name[1]; // variable length, null terminated, max 0x40 (64)
/*000*/ uint8 expedition_status; // 0: unknown 1: Online, 2: Offline, 3: In Dynamic Zone, 4: Link Dead
};
struct ExpeditionMemberList_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 member_count; // number of players in window
/*008*/ ExpeditionMemberEntry_Struct members[0]; // variable length
};
struct ExpeditionMemberListName_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 unknown004;
/*008*/ uint32 add_name; // padded bool, 0: remove name, 1: add name with unknown status
/*012*/ char name[64];
};
struct ExpeditionLockoutTimerEntry_Struct
{
/*000*/ char expedition_name[1]; // variable length, null terminated, max 0x80 (128)
/*000*/ uint32 seconds_remaining;
/*000*/ int32 event_type; // seen -1 (0xffffffff) for replay timers and 1 for event timers
/*000*/ char event_name[1]; // variable length, null terminated, max 0x100 (256)
};
struct ExpeditionLockoutTimers_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 count;
/*008*/ ExpeditionLockoutTimerEntry_Struct timers[0];
};
struct ExpeditionSetLeaderName_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 unknown004;
/*008*/ char leader_name[64];
};
struct ExpeditionCommand_Struct
{
/*000*/ uint32 unknown000;
/*004*/ uint32 unknown004;
/*008*/ char name[64];
};
struct ExpeditionCommandSwap_Struct
{
/*000*/ uint32 unknown000;
/*004*/ uint32 unknown004;
/*008*/ char add_player_name[64]; // swap to (player must confirm)
/*072*/ char rem_player_name[64]; // swap from
};
struct ExpeditionExpireWarning
{
/*000*/ uint32 client_id;
/*004*/ uint32 unknown004;
/*008*/ uint32 minutes_remaining;
};
struct DynamicZoneCompassEntry_Struct
{
/*000*/ uint16 dz_zone_id; // target dz id pair
/*002*/ uint16 dz_instance_id;
/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
/*008*/ uint32 unknown008;
/*012*/ float y;
/*016*/ float x;
/*020*/ float z;
};
struct ExpeditionCompass_Struct
struct DynamicZoneCompass_Struct
{
/*000*/ uint32 clientid;
/*000*/ uint32 client_id;
/*004*/ uint32 count;
/*008*/ ExpeditionCompassEntry_Struct entries[0];
/*008*/ DynamicZoneCompassEntry_Struct entries[0];
};
struct DynamicZoneChooseZoneEntry_Struct
{
/*000*/ uint16 dz_zone_id; // dz_id pair
/*002*/ uint16 dz_instance_id;
/*004*/ uint32 unknown_id1; // sent back in reply
/*008*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest -- sent back in reply
/*012*/ uint32 unknown_id2; // possibly an id based on dz type, for expeditions this was same as dz_id (zone|instance) but task dz was different
/*016*/ char description[1]; // variable length, null terminated, max 0x80 (128)
/*000*/ char leader_name[1]; // variable length, null terminated, max 0x40 (64)
};
struct DynamicZoneChooseZone_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 count;
/*008*/ DynamicZoneChooseZoneEntry_Struct choices[0];
};
struct DynamicZoneChooseZoneReply_Struct
{
/*000*/ uint32 unknown000; // ff ff ff ff
/*004*/ uint32 unknown004; // seen 69 00 00 00
/*008*/ uint32 unknown008; // ff ff ff ff
/*012*/ uint32 unknown_id1; // from choose zone entry message
/*016*/ uint16 dz_zone_id; // dz_id pair
/*018*/ uint16 dz_instance_id;
/*020*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest
/*024*/ uint32 unknown_id2; // from choose zone entry message
/*028*/ uint32 unknown028; // 00 00 00 00
/*032*/ uint32 unknown032; // always same as unknown044
/*036*/ uint32 unknown036;
/*040*/ uint32 unknown040;
/*044*/ uint32 unknown044; // always same as unknown032
/*048*/ uint32 unknown048; // seen 01 00 00 00 and 02 00 00 00
};
struct AltCurrencySelectItem_Struct {
+291 -176
View File
@@ -43,7 +43,7 @@ namespace SoF
static OpcodeManager *opcodes = nullptr;
static Strategy struct_strategy;
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id, uint8 depth);
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id, uint8 depth);
// server to client inventory location converters
static inline uint32 ServerToSoFSlot(uint32 server_slot);
@@ -59,8 +59,8 @@ namespace SoF
// client to server say link converter
static inline void SoFToServerSayLink(std::string &server_saylink, const std::string &sof_saylink);
static inline spells::CastingSlot ServerToSoFCastingSlot(EQEmu::spells::CastingSlot slot);
static inline EQEmu::spells::CastingSlot SoFToServerCastingSlot(spells::CastingSlot slot, uint32 item_location);
static inline spells::CastingSlot ServerToSoFCastingSlot(EQ::spells::CastingSlot slot);
static inline EQ::spells::CastingSlot SoFToServerCastingSlot(spells::CastingSlot slot, uint32 item_location);
static inline int ServerToSoFBuffSlot(int index);
static inline int SoFToServerBuffSlot(int index);
@@ -142,9 +142,9 @@ namespace SoF
return(r);
}
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
const EQ::versions::ClientVersion Strategy::ClientVersion() const
{
return EQEmu::versions::ClientVersion::SoF;
return EQ::versions::ClientVersion::SoF;
}
#include "ss_define.h"
@@ -361,24 +361,24 @@ namespace SoF
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
int item_count = in->size / sizeof(EQ::InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(EQ::InternalSerializedItem_Struct)) != 0) {
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQ::InternalSerializedItem_Struct));
delete in;
return;
}
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
EQ::InternalSerializedItem_Struct* eq = (EQ::InternalSerializedItem_Struct*)in->pBuffer;
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
EQ::OutBuffer ob;
EQ::OutBuffer::pos_type last_pos = ob.tellp();
ob.write((const char*)&item_count, sizeof(uint32));
for (int index = 0; index < item_count; ++index, ++eq) {
SerializeItem(ob, (const EQEmu::ItemInstance*)eq->inst, eq->slot_id, 0);
SerializeItem(ob, (const EQ::ItemInstance*)eq->inst, eq->slot_id, 0);
if (ob.tellp() == last_pos)
LogNetcode("SoF::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
@@ -471,14 +471,48 @@ namespace SoF
FINISH_ENCODE();
}
ENCODE(OP_DzChooseZone)
{
SETUP_VAR_ENCODE(DynamicZoneChooseZone_Struct);
SerializeBuffer buf;
buf.WriteUInt32(emu->client_id);
buf.WriteUInt32(emu->count);
for (uint32 i = 0; i < emu->count; ++i)
{
buf.WriteUInt16(emu->choices[i].dz_zone_id);
buf.WriteUInt16(emu->choices[i].dz_instance_id);
buf.WriteUInt32(emu->choices[i].unknown_id1);
buf.WriteUInt32(emu->choices[i].dz_type);
buf.WriteUInt32(emu->choices[i].unknown_id2);
buf.WriteString(emu->choices[i].description);
buf.WriteString(emu->choices[i].leader_name);
}
__packet->size = buf.size();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
FINISH_ENCODE();
}
ENCODE(OP_DzCompass)
{
SETUP_VAR_ENCODE(ExpeditionCompass_Struct);
ALLOC_VAR_ENCODE(structs::ExpeditionCompass_Struct, sizeof(structs::ExpeditionInfo_Struct) + sizeof(structs::ExpeditionCompassEntry_Struct) * emu->count);
SETUP_VAR_ENCODE(DynamicZoneCompass_Struct);
ALLOC_VAR_ENCODE(structs::DynamicZoneCompass_Struct,
sizeof(structs::DynamicZoneCompass_Struct) +
sizeof(structs::DynamicZoneCompassEntry_Struct) * emu->count
);
OUT(client_id);
OUT(count);
for (uint32 i = 0; i < emu->count; ++i)
{
OUT(entries[i].dz_zone_id);
OUT(entries[i].dz_instance_id);
OUT(entries[i].dz_type);
OUT(entries[i].x);
OUT(entries[i].y);
OUT(entries[i].z);
@@ -502,80 +536,60 @@ namespace SoF
ENCODE_LENGTH_EXACT(ExpeditionInfo_Struct);
SETUP_DIRECT_ENCODE(ExpeditionInfo_Struct, structs::ExpeditionInfo_Struct);
OUT(client_id);
OUT(assigned);
OUT(max_players);
eq->enabled_max = 1;
strcpy(eq->expedition_name, emu->expedition_name);
strcpy(eq->leader_name, emu->leader_name);
strn0cpy(eq->expedition_name, emu->expedition_name, sizeof(eq->expedition_name));
strn0cpy(eq->leader_name, emu->leader_name, sizeof(eq->leader_name));
FINISH_ENCODE();
}
ENCODE(OP_DzExpeditionList)
ENCODE(OP_DzExpeditionInvite)
{
SETUP_VAR_ENCODE(ExpeditionLockoutList_Struct);
ENCODE_LENGTH_EXACT(ExpeditionInvite_Struct);
SETUP_DIRECT_ENCODE(ExpeditionInvite_Struct, structs::ExpeditionInvite_Struct);
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
uint32 client_id = 0;
uint8 null_term = 0;
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&emu->count, sizeof(uint32));
for (int i = 0; i < emu->count; ++i)
OUT(client_id);
strn0cpy(eq->inviter_name, emu->inviter_name, sizeof(eq->inviter_name));
strn0cpy(eq->expedition_name, emu->expedition_name, sizeof(eq->expedition_name));
OUT(swapping);
strn0cpy(eq->swap_name, emu->swap_name, sizeof(eq->swap_name));
OUT(dz_zone_id);
OUT(dz_instance_id);
FINISH_ENCODE();
}
ENCODE(OP_DzExpeditionLockoutTimers)
{
SETUP_VAR_ENCODE(ExpeditionLockoutTimers_Struct);
SerializeBuffer buf;
buf.WriteUInt32(emu->client_id);
buf.WriteUInt32(emu->count);
for (uint32 i = 0; i < emu->count; ++i)
{
ss.write(emu->entries[i].expedition, strlen(emu->entries[i].expedition));
ss.write((const char*)&null_term, sizeof(char));
ss.write((const char*)&emu->entries[i].time_left, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write(emu->entries[i].expedition_event, strlen(emu->entries[i].expedition_event));
ss.write((const char*)&null_term, sizeof(char));
buf.WriteString(emu->timers[i].expedition_name);
buf.WriteUInt32(emu->timers[i].seconds_remaining);
buf.WriteInt32(emu->timers[i].event_type);
buf.WriteString(emu->timers[i].event_name);
}
__packet->size = ss.str().length();
__packet->size = buf.size();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
FINISH_ENCODE();
}
ENCODE(OP_DzJoinExpeditionConfirm)
ENCODE(OP_DzSetLeaderName)
{
ENCODE_LENGTH_EXACT(ExpeditionJoinPrompt_Struct);
SETUP_DIRECT_ENCODE(ExpeditionJoinPrompt_Struct, structs::ExpeditionJoinPrompt_Struct);
ENCODE_LENGTH_EXACT(ExpeditionSetLeaderName_Struct);
SETUP_DIRECT_ENCODE(ExpeditionSetLeaderName_Struct, structs::ExpeditionSetLeaderName_Struct);
strcpy(eq->expedition_name, emu->expedition_name);
strcpy(eq->player_name, emu->player_name);
FINISH_ENCODE();
}
ENCODE(OP_DzLeaderStatus)
{
SETUP_VAR_ENCODE(ExpeditionLeaderSet_Struct);
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
uint32 client_id = 0;
uint8 null_term = 0;
ss.write((const char*)&client_id, sizeof(uint32));
//ss.write((const char*)&client_id, sizeof(uint32));
ss.write(emu->leader_name, strlen(emu->leader_name));
ss.write((const char*)&null_term, sizeof(char));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));//0xffffffff
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));//1
ss.write((const char*)&client_id, sizeof(uint32));
__packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
OUT(client_id);
strn0cpy(eq->leader_name, emu->leader_name, sizeof(eq->leader_name));
FINISH_ENCODE();
}
@@ -584,26 +598,43 @@ namespace SoF
{
SETUP_VAR_ENCODE(ExpeditionMemberList_Struct);
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
uint32 client_id = 0;
uint8 null_term = 0;
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&emu->count, sizeof(uint32));
for (uint32 i = 0; i < emu->count; ++i)
SerializeBuffer buf;
buf.WriteUInt32(emu->client_id);
buf.WriteUInt32(emu->member_count);
for (uint32 i = 0; i < emu->member_count; ++i)
{
ss.write(emu->entries[i].name, strlen(emu->entries[i].name));
ss.write((const char*)&null_term, sizeof(char));
ss.write((const char*)&emu->entries[i].status, sizeof(char));
buf.WriteString(emu->members[i].name);
buf.WriteUInt8(emu->members[i].expedition_status);
}
__packet->size = ss.str().length();
__packet->size = buf.size();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
FINISH_ENCODE();
}
ENCODE(OP_DzMemberListName)
{
ENCODE_LENGTH_EXACT(ExpeditionMemberListName_Struct);
SETUP_DIRECT_ENCODE(ExpeditionMemberListName_Struct, structs::ExpeditionMemberListName_Struct);
OUT(client_id);
OUT(add_name);
strn0cpy(eq->name, emu->name, sizeof(eq->name));
FINISH_ENCODE();
}
ENCODE(OP_DzMemberListStatus)
{
auto emu = reinterpret_cast<ExpeditionMemberList_Struct*>((*p)->pBuffer);
if (emu->member_count == 1)
{
ENCODE_FORWARD(OP_DzMemberList);
}
}
ENCODE(OP_Emote)
{
EQApplicationPacket *in = *p;
@@ -855,14 +886,14 @@ namespace SoF
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
EQEmu::InternalSerializedItem_Struct* int_struct = (EQEmu::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQ::InternalSerializedItem_Struct* int_struct = (EQ::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
EQ::OutBuffer ob;
EQ::OutBuffer::pos_type last_pos = ob.tellp();
ob.write((const char*)__emu_buffer, 4);
SerializeItem(ob, (const EQEmu::ItemInstance*)int_struct->inst, int_struct->slot_id, 0);
SerializeItem(ob, (const EQ::ItemInstance*)int_struct->inst, int_struct->slot_id, 0);
if (ob.tellp() == last_pos) {
LogNetcode("SoF::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
delete in;
@@ -956,7 +987,7 @@ namespace SoF
// Since HT/LoH are translated up, we need to translate down only for memSpellSpellbar case
if (emu->scribing == 3)
eq->slot = static_cast<uint32>(ServerToSoFCastingSlot(static_cast<EQEmu::spells::CastingSlot>(emu->slot)));
eq->slot = static_cast<uint32>(ServerToSoFCastingSlot(static_cast<EQ::spells::CastingSlot>(emu->slot)));
else
OUT(slot);
OUT(spell_id);
@@ -1030,6 +1061,7 @@ namespace SoF
OUT(FastRegenHP);
OUT(FastRegenMana);
OUT(FastRegenEndurance);
OUT(underworld_teleport_index);
/*fill in some unknowns with observed values, hopefully it will help */
eq->unknown796 = -1;
@@ -1130,7 +1162,7 @@ namespace SoF
OUT(hairstyle);
OUT(beard);
// OUT(unknown00178[10]);
for (r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++) {
for (r = EQ::textures::textureBegin; r < EQ::textures::materialCount; r++) {
eq->equipment.Slot[r].Material = emu->item_material.Slot[r].Material;
eq->equipment.Slot[r].Unknown1 = 0;
eq->equipment.Slot[r].EliteMaterial = 0;
@@ -1160,7 +1192,7 @@ namespace SoF
OUT(face);
// OUT(unknown02264[47]);
if (spells::SPELLBOOK_SIZE <= EQEmu::spells::SPELLBOOK_SIZE) {
if (spells::SPELLBOOK_SIZE <= EQ::spells::SPELLBOOK_SIZE) {
for (uint32 r = 0; r < spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
eq->spell_book[r] = emu->spell_book[r];
@@ -1169,14 +1201,14 @@ namespace SoF
}
}
else {
for (uint32 r = 0; r < EQEmu::spells::SPELLBOOK_SIZE; r++) {
for (uint32 r = 0; r < EQ::spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
eq->spell_book[r] = emu->spell_book[r];
else
eq->spell_book[r] = 0xFFFFFFFFU;
}
// invalidate the rest of the spellbook slots
memset(&eq->spell_book[EQEmu::spells::SPELLBOOK_SIZE], 0xFF, (sizeof(uint32) * (spells::SPELLBOOK_SIZE - EQEmu::spells::SPELLBOOK_SIZE)));
memset(&eq->spell_book[EQ::spells::SPELLBOOK_SIZE], 0xFF, (sizeof(uint32) * (spells::SPELLBOOK_SIZE - EQ::spells::SPELLBOOK_SIZE)));
}
// OUT(unknown4184[128]);
@@ -1223,7 +1255,7 @@ namespace SoF
// OUT(unknown06160[4]);
// Copy bandoliers where server and client indices converge
for (r = 0; r < EQEmu::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
for (r = 0; r < EQ::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
OUT_str(bandoliers[r].Name);
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
OUT(bandoliers[r].Items[k].ID);
@@ -1232,7 +1264,7 @@ namespace SoF
}
}
// Nullify bandoliers where server and client indices diverge, with a client bias
for (r = EQEmu::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
for (r = EQ::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
eq->bandoliers[r].Name[0] = '\0';
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
eq->bandoliers[r].Items[k].ID = 0;
@@ -1244,13 +1276,13 @@ namespace SoF
// OUT(unknown07444[5120]);
// Copy potion belt where server and client indices converge
for (r = 0; r < EQEmu::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
for (r = 0; r < EQ::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
OUT(potionbelt.Items[r].ID);
OUT(potionbelt.Items[r].Icon);
OUT_str(potionbelt.Items[r].Name);
}
// Nullify potion belt where server and client indices diverge, with a client bias
for (r = EQEmu::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
for (r = EQ::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
eq->potionbelt.Items[r].ID = 0;
eq->potionbelt.Items[r].Icon = 0;
eq->potionbelt.Items[r].Name[0] = '\0';
@@ -1593,7 +1625,7 @@ namespace SoF
eq_cse->HairColor = emu_cse->HairColor;
eq_cse->Face = emu_cse->Face;
for (int equip_index = EQEmu::textures::textureBegin; equip_index < EQEmu::textures::materialCount; equip_index++) {
for (int equip_index = EQ::textures::textureBegin; equip_index < EQ::textures::materialCount; equip_index++) {
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
@@ -2015,7 +2047,7 @@ namespace SoF
eq->deity = emu->deity;
eq->drakkin_heritage = emu->drakkin_heritage;
eq->gender = emu->gender;
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; k++) {
eq->equipment.Slot[k].Material = emu->equipment.Slot[k].Material;
eq->equipment.Slot[k].Unknown1 = emu->equipment.Slot[k].Unknown1;
eq->equipment.Slot[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
@@ -2081,7 +2113,7 @@ namespace SoF
strcpy(eq->name, emu->name);
eq->petOwnerId = emu->petOwnerId;
eq->pvp = 0; // 0 = non-pvp colored name, 1 = red pvp name
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; k++) {
eq->equipment_tint.Slot[k].Color = emu->equipment_tint.Slot[k].Color;
}
eq->anon = emu->anon;
@@ -2300,7 +2332,7 @@ namespace SoF
DECODE_LENGTH_EXACT(structs::BugReport_Struct);
SETUP_DIRECT_DECODE(BugReport_Struct, structs::BugReport_Struct);
emu->category_id = EQEmu::bug::CategoryNameToCategoryID(eq->category_name);
emu->category_id = EQ::bug::CategoryNameToCategoryID(eq->category_name);
memcpy(emu->category_name, eq, sizeof(structs::BugReport_Struct));
FINISH_DIRECT_DECODE();
@@ -2434,6 +2466,83 @@ namespace SoF
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzAddPlayer)
{
DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
strn0cpy(emu->name, eq->name, sizeof(emu->name));
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzChooseZoneReply)
{
DECODE_LENGTH_EXACT(structs::DynamicZoneChooseZoneReply_Struct);
SETUP_DIRECT_DECODE(DynamicZoneChooseZoneReply_Struct, structs::DynamicZoneChooseZoneReply_Struct);
emu->unknown000 = eq->unknown000;
emu->unknown008 = eq->unknown004;
IN(unknown_id1);
IN(dz_zone_id);
IN(dz_instance_id);
IN(dz_type);
IN(unknown_id2);
emu->unknown028 = eq->unknown024;
emu->unknown032 = eq->unknown028;
emu->unknown036 = eq->unknown032;
emu->unknown040 = eq->unknown036;
emu->unknown044 = eq->unknown040;
emu->unknown048 = eq->unknown044;
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzExpeditionInviteResponse)
{
DECODE_LENGTH_EXACT(structs::ExpeditionInviteResponse_Struct);
SETUP_DIRECT_DECODE(ExpeditionInviteResponse_Struct, structs::ExpeditionInviteResponse_Struct);
IN(dz_zone_id);
IN(dz_instance_id);
IN(accepted);
IN(swapping);
strn0cpy(emu->swap_name, eq->swap_name, sizeof(emu->swap_name));
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzMakeLeader)
{
DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
strn0cpy(emu->name, eq->name, sizeof(emu->name));
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzRemovePlayer)
{
DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
strn0cpy(emu->name, eq->name, sizeof(emu->name));
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzSwapPlayer)
{
DECODE_LENGTH_EXACT(structs::ExpeditionCommandSwap_Struct);
SETUP_DIRECT_DECODE(ExpeditionCommandSwap_Struct, structs::ExpeditionCommandSwap_Struct);
strn0cpy(emu->add_player_name, eq->add_player_name, sizeof(emu->add_player_name));
strn0cpy(emu->rem_player_name, eq->rem_player_name, sizeof(emu->rem_player_name));
FINISH_DIRECT_DECODE();
}
DECODE(OP_Emote)
{
unsigned char *__eq_buffer = __packet->pBuffer;
@@ -2556,7 +2665,7 @@ namespace SoF
for (int i = 0; i < spells::SPELL_GEM_COUNT; ++i)
IN(spell[i]);
for (int i = spells::SPELL_GEM_COUNT; i < EQEmu::spells::SPELL_GEM_COUNT; ++i)
for (int i = spells::SPELL_GEM_COUNT; i < EQ::spells::SPELL_GEM_COUNT; ++i)
emu->spell[i] = 0xFFFFFFFF;
IN(unknown);
@@ -2838,9 +2947,9 @@ namespace SoF
return NextItemInstSerialNumber;
}
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id_in, uint8 depth)
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id_in, uint8 depth)
{
const EQEmu::ItemData *item = inst->GetUnscaledItem();
const EQ::ItemData *item = inst->GetUnscaledItem();
SoF::structs::ItemSerializationHeader hdr;
@@ -3028,6 +3137,12 @@ namespace SoF
itbs.no_transfer = item->NoTransfer;
itbs.expendablearrow = item->ExpendableArrow;
// Done to hack older clients to label expendable fishing poles as such
// July 28th, 2018 patch
if (item->ItemType == EQ::item::ItemTypeFishingPole && item->SubType == 0) {
itbs.expendablearrow = 1;
}
ob.write((const char*)&itbs, sizeof(SoF::structs::ItemTertiaryBodyStruct));
// Effect Structures Broken down to allow variable length strings for effect names
@@ -3147,30 +3262,30 @@ namespace SoF
ob.write((const char*)&iqbs, sizeof(SoF::structs::ItemQuaternaryBodyStruct));
EQEmu::OutBuffer::pos_type count_pos = ob.tellp();
EQ::OutBuffer::pos_type count_pos = ob.tellp();
uint32 subitem_count = 0;
ob.write((const char*)&subitem_count, sizeof(uint32));
// moved outside of loop since it is not modified within that scope
int16 SubSlotNumber = EQEmu::invbag::SLOT_INVALID;
int16 SubSlotNumber = EQ::invbag::SLOT_INVALID;
if (slot_id_in <= EQEmu::invslot::slotGeneral8 && slot_id_in >= EQEmu::invslot::GENERAL_BEGIN)
SubSlotNumber = EQEmu::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
else if (slot_id_in <= EQEmu::invslot::GENERAL_END && slot_id_in >= EQEmu::invslot::slotGeneral9)
SubSlotNumber = EQEmu::invbag::SLOT_INVALID;
else if (slot_id_in == EQEmu::invslot::slotCursor)
SubSlotNumber = EQEmu::invbag::CURSOR_BAG_BEGIN;
else if (slot_id_in <= EQEmu::invslot::BANK_END && slot_id_in >= EQEmu::invslot::BANK_BEGIN)
SubSlotNumber = EQEmu::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
else if (slot_id_in <= EQEmu::invslot::SHARED_BANK_END && slot_id_in >= EQEmu::invslot::SHARED_BANK_BEGIN)
SubSlotNumber = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::SHARED_BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
if (slot_id_in <= EQ::invslot::slotGeneral8 && slot_id_in >= EQ::invslot::GENERAL_BEGIN)
SubSlotNumber = EQ::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQ::invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
else if (slot_id_in <= EQ::invslot::GENERAL_END && slot_id_in >= EQ::invslot::slotGeneral9)
SubSlotNumber = EQ::invbag::SLOT_INVALID;
else if (slot_id_in == EQ::invslot::slotCursor)
SubSlotNumber = EQ::invbag::CURSOR_BAG_BEGIN;
else if (slot_id_in <= EQ::invslot::BANK_END && slot_id_in >= EQ::invslot::BANK_BEGIN)
SubSlotNumber = EQ::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
else if (slot_id_in <= EQ::invslot::SHARED_BANK_END && slot_id_in >= EQ::invslot::SHARED_BANK_BEGIN)
SubSlotNumber = EQ::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::SHARED_BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
else
SubSlotNumber = slot_id_in; // not sure if this is the best way to handle this..leaving for now
if (SubSlotNumber != EQEmu::invbag::SLOT_INVALID) {
for (uint32 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; ++index) {
EQEmu::ItemInstance* sub = inst->GetItem(index);
if (SubSlotNumber != EQ::invbag::SLOT_INVALID) {
for (uint32 index = EQ::invbag::SLOT_BEGIN; index <= EQ::invbag::SLOT_END; ++index) {
EQ::ItemInstance* sub = inst->GetItem(index);
if (!sub)
continue;
@@ -3189,59 +3304,59 @@ namespace SoF
{
uint32 sof_slot = invslot::SLOT_INVALID;
if (server_slot <= EQEmu::invslot::slotGeneral8) {
if (server_slot <= EQ::invslot::slotGeneral8) {
sof_slot = server_slot;
}
else if (server_slot <= EQEmu::invslot::CORPSE_END && server_slot >= EQEmu::invslot::slotCursor) {
else if (server_slot <= EQ::invslot::CORPSE_END && server_slot >= EQ::invslot::slotCursor) {
sof_slot = server_slot - 2;
}
else if (server_slot <= EQEmu::invbag::GENERAL_BAGS_8_END && server_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
else if (server_slot <= EQ::invbag::GENERAL_BAGS_8_END && server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
sof_slot = server_slot + 11;
}
else if (server_slot <= EQEmu::invbag::CURSOR_BAG_END && server_slot >= EQEmu::invbag::CURSOR_BAG_BEGIN) {
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::CURSOR_BAG_BEGIN) {
sof_slot = server_slot - 9;
}
else if (server_slot <= EQEmu::invslot::TRIBUTE_END && server_slot >= EQEmu::invslot::TRIBUTE_BEGIN) {
else if (server_slot <= EQ::invslot::TRIBUTE_END && server_slot >= EQ::invslot::TRIBUTE_BEGIN) {
sof_slot = server_slot;
}
else if (server_slot <= EQEmu::invslot::GUILD_TRIBUTE_END && server_slot >= EQEmu::invslot::GUILD_TRIBUTE_BEGIN) {
else if (server_slot <= EQ::invslot::GUILD_TRIBUTE_END && server_slot >= EQ::invslot::GUILD_TRIBUTE_BEGIN) {
sof_slot = server_slot;
}
else if (server_slot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
else if (server_slot == EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
sof_slot = server_slot;
}
else if (server_slot <= EQEmu::invslot::BANK_END && server_slot >= EQEmu::invslot::BANK_BEGIN) {
else if (server_slot <= EQ::invslot::BANK_END && server_slot >= EQ::invslot::BANK_BEGIN) {
sof_slot = server_slot;
}
else if (server_slot <= EQEmu::invbag::BANK_BAGS_END && server_slot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
else if (server_slot <= EQ::invbag::BANK_BAGS_END && server_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
sof_slot = server_slot + 1;
}
else if (server_slot <= EQEmu::invslot::SHARED_BANK_END && server_slot >= EQEmu::invslot::SHARED_BANK_BEGIN) {
else if (server_slot <= EQ::invslot::SHARED_BANK_END && server_slot >= EQ::invslot::SHARED_BANK_BEGIN) {
sof_slot = server_slot;
}
else if (server_slot <= EQEmu::invbag::SHARED_BANK_BAGS_END && server_slot >= EQEmu::invbag::SHARED_BANK_BAGS_BEGIN) {
else if (server_slot <= EQ::invbag::SHARED_BANK_BAGS_END && server_slot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
sof_slot = server_slot + 1;
}
else if (server_slot <= EQEmu::invslot::TRADE_END && server_slot >= EQEmu::invslot::TRADE_BEGIN) {
else if (server_slot <= EQ::invslot::TRADE_END && server_slot >= EQ::invslot::TRADE_BEGIN) {
sof_slot = server_slot;
}
else if (server_slot <= EQEmu::invbag::TRADE_BAGS_END && server_slot >= EQEmu::invbag::TRADE_BAGS_BEGIN) {
else if (server_slot <= EQ::invbag::TRADE_BAGS_END && server_slot >= EQ::invbag::TRADE_BAGS_BEGIN) {
sof_slot = server_slot;
}
else if (server_slot <= EQEmu::invslot::WORLD_END && server_slot >= EQEmu::invslot::WORLD_BEGIN) {
else if (server_slot <= EQ::invslot::WORLD_END && server_slot >= EQ::invslot::WORLD_BEGIN) {
sof_slot = server_slot;
}
@@ -3254,11 +3369,11 @@ namespace SoF
{
uint32 SoFSlot = invslot::SLOT_INVALID;
if (server_corpse_slot <= EQEmu::invslot::slotGeneral8 && server_corpse_slot >= EQEmu::invslot::slotGeneral1) {
if (server_corpse_slot <= EQ::invslot::slotGeneral8 && server_corpse_slot >= EQ::invslot::slotGeneral1) {
SoFSlot = server_corpse_slot;
}
else if (server_corpse_slot <= EQEmu::invslot::CORPSE_END && server_corpse_slot >= EQEmu::invslot::slotCursor) {
else if (server_corpse_slot <= EQ::invslot::CORPSE_END && server_corpse_slot >= EQ::invslot::slotCursor) {
SoFSlot = server_corpse_slot - 2;
}
@@ -3273,7 +3388,7 @@ namespace SoF
static inline uint32 SoFToServerSlot(uint32 sof_slot)
{
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
uint32 server_slot = EQ::invslot::SLOT_INVALID;
if (sof_slot <= invslot::slotGeneral8) {
server_slot = sof_slot;
@@ -3338,7 +3453,7 @@ namespace SoF
static inline uint32 SoFToServerCorpseSlot(uint32 sof_corpse_slot)
{
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
uint32 server_slot = EQ::invslot::SLOT_INVALID;
if (sof_corpse_slot <= invslot::slotGeneral8 && sof_corpse_slot >= invslot::slotGeneral1) {
server_slot = sof_corpse_slot;
@@ -3359,7 +3474,7 @@ namespace SoF
static inline void ServerToSoFSayLink(std::string &sof_saylink, const std::string &server_saylink)
{
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
if ((constants::SAY_LINK_BODY_SIZE == EQ::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
sof_saylink = server_saylink;
return;
}
@@ -3368,7 +3483,7 @@ namespace SoF
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::constants::SAY_LINK_BODY_SIZE) {
if (segments[segment_iter].length() <= EQ::constants::SAY_LINK_BODY_SIZE) {
sof_saylink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
@@ -3399,7 +3514,7 @@ namespace SoF
static inline void SoFToServerSayLink(std::string &server_saylink, const std::string &sof_saylink)
{
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (sof_saylink.find('\x12') == std::string::npos)) {
if ((EQ::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (sof_saylink.find('\x12') == std::string::npos)) {
server_saylink = sof_saylink;
return;
}
@@ -3433,84 +3548,84 @@ namespace SoF
}
}
static inline spells::CastingSlot ServerToSoFCastingSlot(EQEmu::spells::CastingSlot slot) {
static inline spells::CastingSlot ServerToSoFCastingSlot(EQ::spells::CastingSlot slot) {
switch (slot) {
case EQEmu::spells::CastingSlot::Gem1:
case EQ::spells::CastingSlot::Gem1:
return spells::CastingSlot::Gem1;
case EQEmu::spells::CastingSlot::Gem2:
case EQ::spells::CastingSlot::Gem2:
return spells::CastingSlot::Gem2;
case EQEmu::spells::CastingSlot::Gem3:
case EQ::spells::CastingSlot::Gem3:
return spells::CastingSlot::Gem3;
case EQEmu::spells::CastingSlot::Gem4:
case EQ::spells::CastingSlot::Gem4:
return spells::CastingSlot::Gem4;
case EQEmu::spells::CastingSlot::Gem5:
case EQ::spells::CastingSlot::Gem5:
return spells::CastingSlot::Gem5;
case EQEmu::spells::CastingSlot::Gem6:
case EQ::spells::CastingSlot::Gem6:
return spells::CastingSlot::Gem6;
case EQEmu::spells::CastingSlot::Gem7:
case EQ::spells::CastingSlot::Gem7:
return spells::CastingSlot::Gem7;
case EQEmu::spells::CastingSlot::Gem8:
case EQ::spells::CastingSlot::Gem8:
return spells::CastingSlot::Gem8;
case EQEmu::spells::CastingSlot::Gem9:
case EQ::spells::CastingSlot::Gem9:
return spells::CastingSlot::Gem9;
case EQEmu::spells::CastingSlot::Item:
case EQ::spells::CastingSlot::Item:
return spells::CastingSlot::Item;
case EQEmu::spells::CastingSlot::PotionBelt:
case EQ::spells::CastingSlot::PotionBelt:
return spells::CastingSlot::PotionBelt;
case EQEmu::spells::CastingSlot::Discipline:
case EQ::spells::CastingSlot::Discipline:
return spells::CastingSlot::Discipline;
case EQEmu::spells::CastingSlot::AltAbility:
case EQ::spells::CastingSlot::AltAbility:
return spells::CastingSlot::AltAbility;
default: // we shouldn't have any issues with other slots ... just return something
return spells::CastingSlot::Discipline;
}
}
static inline EQEmu::spells::CastingSlot SoFToServerCastingSlot(spells::CastingSlot slot, uint32 item_location) {
static inline EQ::spells::CastingSlot SoFToServerCastingSlot(spells::CastingSlot slot, uint32 item_location) {
switch (slot) {
case spells::CastingSlot::Gem1:
return EQEmu::spells::CastingSlot::Gem1;
return EQ::spells::CastingSlot::Gem1;
case spells::CastingSlot::Gem2:
return EQEmu::spells::CastingSlot::Gem2;
return EQ::spells::CastingSlot::Gem2;
case spells::CastingSlot::Gem3:
return EQEmu::spells::CastingSlot::Gem3;
return EQ::spells::CastingSlot::Gem3;
case spells::CastingSlot::Gem4:
return EQEmu::spells::CastingSlot::Gem4;
return EQ::spells::CastingSlot::Gem4;
case spells::CastingSlot::Gem5:
return EQEmu::spells::CastingSlot::Gem5;
return EQ::spells::CastingSlot::Gem5;
case spells::CastingSlot::Gem6:
return EQEmu::spells::CastingSlot::Gem6;
return EQ::spells::CastingSlot::Gem6;
case spells::CastingSlot::Gem7:
return EQEmu::spells::CastingSlot::Gem7;
return EQ::spells::CastingSlot::Gem7;
case spells::CastingSlot::Gem8:
return EQEmu::spells::CastingSlot::Gem8;
return EQ::spells::CastingSlot::Gem8;
case spells::CastingSlot::Gem9:
return EQEmu::spells::CastingSlot::Gem9;
return EQ::spells::CastingSlot::Gem9;
case spells::CastingSlot::Ability:
return EQEmu::spells::CastingSlot::Ability;
return EQ::spells::CastingSlot::Ability;
// Tit uses 10 for item and discipline casting, but items have a valid location
case spells::CastingSlot::Item:
if (item_location == INVALID_INDEX)
return EQEmu::spells::CastingSlot::Discipline;
return EQ::spells::CastingSlot::Discipline;
else
return EQEmu::spells::CastingSlot::Item;
return EQ::spells::CastingSlot::Item;
case spells::CastingSlot::PotionBelt:
return EQEmu::spells::CastingSlot::PotionBelt;
return EQ::spells::CastingSlot::PotionBelt;
case spells::CastingSlot::AltAbility:
return EQEmu::spells::CastingSlot::AltAbility;
return EQ::spells::CastingSlot::AltAbility;
default: // we shouldn't have any issues with other slots ... just return something
return EQEmu::spells::CastingSlot::Discipline;
return EQ::spells::CastingSlot::Discipline;
}
}
static inline int ServerToSoFBuffSlot(int index) {
// we're a disc
if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
spells::LONG_BUFFS + spells::SHORT_BUFFS;
// we're a song
if (index >= EQEmu::spells::LONG_BUFFS)
return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
if (index >= EQ::spells::LONG_BUFFS)
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
@@ -3519,11 +3634,11 @@ namespace SoF
{
// we're a disc
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
EQEmu::spells::SHORT_BUFFS;
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQ::spells::LONG_BUFFS +
EQ::spells::SHORT_BUFFS;
// we're a song
if (index >= spells::LONG_BUFFS)
return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS;
return index - spells::LONG_BUFFS + EQ::spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
+1 -1
View File
@@ -43,7 +43,7 @@ namespace SoF
protected:
virtual std::string Describe() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
virtual const EQ::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
+15 -15
View File
@@ -31,7 +31,7 @@ namespace SoF
const int16 INULL = 0;
namespace inventory {
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::SoF; }
inline EQ::versions::ClientVersion GetInventoryRef() { return EQ::versions::ClientVersion::SoF; }
const bool ConcatenateInvTypeLimbo = true;
@@ -43,7 +43,7 @@ namespace SoF
} /*inventory*/
namespace invtype {
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::SoF; }
inline EQ::versions::ClientVersion GetInvTypeRef() { return EQ::versions::ClientVersion::SoF; }
namespace enum_ {
enum InventoryTypes : int16 {
@@ -106,7 +106,7 @@ namespace SoF
} /*invtype*/
namespace invslot {
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::SoF; }
inline EQ::versions::ClientVersion GetInvSlotRef() { return EQ::versions::ClientVersion::SoF; }
namespace enum_ {
enum InventorySlots : int16 {
@@ -205,7 +205,7 @@ namespace SoF
} /*invslot*/
namespace invbag {
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::SoF; }
inline EQ::versions::ClientVersion GetInvBagRef() { return EQ::versions::ClientVersion::SoF; }
const int16 SLOT_INVALID = IINVALID;
const int16 SLOT_BEGIN = INULL;
@@ -237,7 +237,7 @@ namespace SoF
} /*invbag*/
namespace invaug {
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::SoF; }
inline EQ::versions::ClientVersion GetInvAugRef() { return EQ::versions::ClientVersion::SoF; }
const int16 SOCKET_INVALID = IINVALID;
const int16 SOCKET_BEGIN = INULL;
@@ -249,7 +249,7 @@ namespace SoF
} /*invaug*/
namespace item {
inline EQEmu::versions::ClientVersion GetItemRef() { return EQEmu::versions::ClientVersion::SoF; }
inline EQ::versions::ClientVersion GetItemRef() { return EQ::versions::ClientVersion::SoF; }
enum ItemPacketType : int {
ItemPacketMerchant = 100,
@@ -267,7 +267,7 @@ namespace SoF
} /*item*/
namespace profile {
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::SoF; }
inline EQ::versions::ClientVersion GetProfileRef() { return EQ::versions::ClientVersion::SoF; }
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
@@ -279,11 +279,11 @@ namespace SoF
} /*profile*/
namespace constants {
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::SoF; }
inline EQ::versions::ClientVersion GetConstantsRef() { return EQ::versions::ClientVersion::SoF; }
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::SoF;
const uint32 EXPANSION_BIT = EQEmu::expansions::bitSoF;
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskSoF;
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::SoF;
const uint32 EXPANSION_BIT = EQ::expansions::bitSoF;
const uint32 EXPANSIONS_MASK = EQ::expansions::maskSoF;
const size_t CHARACTER_CREATION_LIMIT = 12;
@@ -292,21 +292,21 @@ namespace SoF
} /*constants*/
namespace behavior {
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::SoF; }
inline EQ::versions::ClientVersion GetBehaviorRef() { return EQ::versions::ClientVersion::SoF; }
const bool CoinHasWeight = true;
} /*behavior*/
namespace skills {
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::SoF; }
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::SoF; }
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
const size_t LastUsableSkill = EQ::skills::SkillTripleAttack;
} /*skills*/
namespace spells {
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::SoF; }
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::SoF; }
enum class CastingSlot : uint32 {
Gem1 = 0,
+12 -3
View File
@@ -36,13 +36,16 @@ E(OP_Damage)
E(OP_DeleteCharge)
E(OP_DeleteItem)
E(OP_DeleteSpawn)
E(OP_DzChooseZone)
E(OP_DzCompass)
E(OP_DzExpeditionEndsWarning)
E(OP_DzExpeditionInfo)
E(OP_DzExpeditionList)
E(OP_DzJoinExpeditionConfirm)
E(OP_DzLeaderStatus)
E(OP_DzExpeditionInvite)
E(OP_DzExpeditionLockoutTimers)
E(OP_DzMemberList)
E(OP_DzMemberListName)
E(OP_DzMemberListStatus)
E(OP_DzSetLeaderName)
E(OP_Emote)
E(OP_ExpansionInfo)
E(OP_FormattedMessage)
@@ -103,6 +106,12 @@ D(OP_Consider)
D(OP_ConsiderCorpse)
D(OP_Consume)
D(OP_DeleteItem)
D(OP_DzAddPlayer)
D(OP_DzChooseZoneReply)
D(OP_DzExpeditionInviteResponse)
D(OP_DzMakeLeader)
D(OP_DzRemovePlayer)
D(OP_DzSwapPlayer)
D(OP_Emote)
D(OP_FaceChange)
D(OP_FindPersonRequest)
+132 -21
View File
@@ -168,7 +168,7 @@ struct TintProfile
Tint_Struct Primary;
Tint_Struct Secondary;
};
Tint_Struct Slot[EQEmu::textures::materialCount];
Tint_Struct Slot[EQ::textures::materialCount];
};
};
@@ -197,7 +197,7 @@ struct TextureProfile
Texture_Struct Primary;
Texture_Struct Secondary;
};
Texture_Struct Slot[EQEmu::textures::materialCount];
Texture_Struct Slot[EQ::textures::materialCount];
};
TextureProfile();
@@ -214,7 +214,7 @@ struct CharacterSelectEntry_Struct
/*0000*/ uint8 Beard; //
/*0001*/ uint8 HairColor; //
/*0000*/ uint8 Face; //
/*0000*/ CharSelectEquip Equip[EQEmu::textures::materialCount];
/*0000*/ CharSelectEquip Equip[EQ::textures::materialCount];
/*0000*/ uint32 PrimaryIDFile; //
/*0000*/ uint32 SecondaryIDFile; //
/*0000*/ uint8 Unknown15; // 0xff
@@ -448,7 +448,11 @@ struct NewZone_Struct {
/*0844*/ int32 unknown844;
/*0848*/ uint16 zone_id;
/*0850*/ uint16 zone_instance;
/*0852*/ char unknown852[20];
/*0852*/ uint32 scriptNPCReceivedanItem;
/*0856*/ uint32 bCheck; // padded bool
/*0860*/ uint32 scriptIDSomething;
/*0864*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
/*0868*/ uint32 scriptIDSomething3;
/*0872*/ uint32 SuspendBuffs;
/*0876*/ uint32 unknown876; //seen 50
/*0880*/ uint32 unknown880; //seen 10
@@ -4084,43 +4088,150 @@ struct VeteranReward
/*012*/ VeteranRewardItem items[8];
};
struct ExpeditionExpireWarning
struct ExpeditionInvite_Struct
{
/*000*/ uint32 client_id;
/*004*/ char inviter_name[64];
/*068*/ char expedition_name[128];
/*196*/ uint8 swapping; // 0: adding 1: swapping
/*197*/ char swap_name[64]; // if swapping, swap name being removed
/*261*/ uint8 padding[3];
/*264*/ uint16 dz_zone_id; // dz_id zone/instance pair, sent back in reply
/*268*/ uint16 dz_instance_id;
};
struct ExpeditionInviteResponse_Struct
{
/*000*/ uint32 unknown000;
/*004*/ uint32 minutes_remaining;
/*004*/ uint16 dz_zone_id; // dz_id pair sent in invite
/*006*/ uint16 dz_instance_id;
/*008*/ uint8 accepted; // 0: declined 1: accepted
/*009*/ uint8 swapping; // 0: adding 1: swapping (sent in invite)
/*010*/ char swap_name[64]; // swap name sent in invite
/*074*/ uint8 unknown078; // padding/garbage?
/*075*/ uint8 unknown079; // padding/garbage?
};
struct ExpeditionInfo_Struct
{
/*000*/ uint32 clientid;
/*004*/ uint32 enabled_max;
/*000*/ uint32 client_id;
/*004*/ uint32 assigned; // padded bool
/*008*/ uint32 max_players;
/*012*/ char expedition_name[128];
/*142*/ char leader_name[64];
/*012*/ char expedition_name[128];
/*140*/ char leader_name[64];
};
struct ExpeditionCompassEntry_Struct
struct ExpeditionMemberEntry_Struct
{
/*000*/ float unknown000; //seen *((uint32*)) = 1584791871
/*004*/ uint32 enabled; //guess
/*008*/ uint32 unknown008; //seen 1019
/*000*/ char name[1]; // variable length, null terminated, max 0x40 (64)
/*000*/ uint8 expedition_status; // 0: unknown 1: Online, 2: Offline, 3: In Dynamic Zone, 4: Link Dead
};
struct ExpeditionMemberList_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 member_count;
/*008*/ ExpeditionMemberEntry_Struct members[0]; // variable length
};
struct ExpeditionMemberListName_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 add_name; // padded bool, 0: remove name, 1: add name with unknown status
/*008*/ char name[64];
};
struct ExpeditionLockoutTimerEntry_Struct
{
/*000*/ char expedition_name[1]; // variable length, null terminated, max 0x80 (128)
/*000*/ uint32 seconds_remaining;
/*000*/ int32 event_type; // seen -1 (0xffffffff) for replay timers and 1 for event timers
/*000*/ char event_name[1]; // variable length, null terminated, max 0x100 (256)
};
struct ExpeditionLockoutTimers_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 count;
/*008*/ ExpeditionLockoutTimerEntry_Struct timers[0];
};
struct ExpeditionSetLeaderName_Struct
{
/*000*/ uint32 client_id;
/*004*/ char leader_name[64];
};
struct ExpeditionCommand_Struct
{
/*000*/ uint32 unknown000;
/*004*/ char name[64];
};
struct ExpeditionCommandSwap_Struct
{
/*000*/ uint32 unknown000;
/*004*/ char add_player_name[64]; // swap to (player must confirm)
/*068*/ char rem_player_name[64]; // swap from
};
struct ExpeditionExpireWarning
{
/*000*/ uint32 client_id;
/*004*/ uint32 minutes_remaining;
};
struct DynamicZoneCompassEntry_Struct
{
/*000*/ uint16 dz_zone_id; // target dz id pair
/*002*/ uint16 dz_instance_id;
/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
/*008*/ uint32 unknown008;
/*012*/ float y;
/*016*/ float x;
/*020*/ float z;
};
struct ExpeditionCompass_Struct
struct DynamicZoneCompass_Struct
{
/*000*/ uint32 clientid;
/*000*/ uint32 client_id;
/*004*/ uint32 count;
/*008*/ ExpeditionCompassEntry_Struct entries[0];
/*008*/ DynamicZoneCompassEntry_Struct entries[0];
};
struct ExpeditionJoinPrompt_Struct
struct DynamicZoneChooseZoneEntry_Struct
{
/*000*/ uint32 clientid;
/*004*/ char player_name[64];
/*068*/ char expedition_name[64];
/*000*/ uint16 dz_zone_id; // dz_id pair
/*002*/ uint16 dz_instance_id;
/*004*/ uint32 unknown_id1; // sent back in reply
/*008*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest -- sent back in reply
/*012*/ uint32 unknown_id2; // possibly an id based on dz type, for expeditions this was same as dz_id (zone|instance) but task dz was different
/*016*/ char description[1]; // variable length, null terminated, max 0x80 (128)
/*000*/ char leader_name[1]; // variable length, null terminated, max 0x40 (64)
};
struct DynamicZoneChooseZone_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 count;
/*008*/ DynamicZoneChooseZoneEntry_Struct choices[0];
};
struct DynamicZoneChooseZoneReply_Struct
{
/*000*/ uint32 unknown000;
/*004*/ uint32 unknown004;
/*008*/ uint32 unknown_id1;
/*012*/ uint16 dz_zone_id;
/*014*/ uint16 dz_instance_id;
/*016*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest
/*020*/ uint32 unknown_id2;
/*024*/ uint32 unknown024;
/*028*/ uint32 unknown028; // always same as unknown040
/*032*/ uint32 unknown032;
/*036*/ uint32 unknown036;
/*040*/ uint32 unknown040; // always same as unknown028
/*044*/ uint32 unknown044;
};
struct AltCurrencySelectItem_Struct {
+288 -181
View File
@@ -42,7 +42,7 @@ namespace Titanium
static OpcodeManager *opcodes = nullptr;
static Strategy struct_strategy;
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id_in, uint8 depth);
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id_in, uint8 depth);
// server to client inventory location converters
static inline int16 ServerToTitaniumSlot(uint32 server_slot);
@@ -58,8 +58,8 @@ namespace Titanium
// client to server say link converter
static inline void TitaniumToServerSayLink(std::string &server_saylink, const std::string &titanium_saylink);
static inline spells::CastingSlot ServerToTitaniumCastingSlot(EQEmu::spells::CastingSlot slot);
static inline EQEmu::spells::CastingSlot TitaniumToServerCastingSlot(spells::CastingSlot slot, uint32 item_location);
static inline spells::CastingSlot ServerToTitaniumCastingSlot(EQ::spells::CastingSlot slot);
static inline EQ::spells::CastingSlot TitaniumToServerCastingSlot(spells::CastingSlot slot, uint32 item_location);
static inline int ServerToTitaniumBuffSlot(int index);
static inline int TitaniumToServerBuffSlot(int index);
@@ -143,9 +143,9 @@ namespace Titanium
return(r);
}
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
const EQ::versions::ClientVersion Strategy::ClientVersion() const
{
return EQEmu::versions::ClientVersion::Titanium;
return EQ::versions::ClientVersion::Titanium;
}
#include "ss_define.h"
@@ -320,22 +320,22 @@ namespace Titanium
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
int itemcount = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
if (itemcount == 0 || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
int itemcount = in->size / sizeof(EQ::InternalSerializedItem_Struct);
if (itemcount == 0 || (in->size % sizeof(EQ::InternalSerializedItem_Struct)) != 0) {
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQ::InternalSerializedItem_Struct));
delete in;
return;
}
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
EQ::InternalSerializedItem_Struct* eq = (EQ::InternalSerializedItem_Struct*)in->pBuffer;
//do the transform...
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
EQ::OutBuffer ob;
EQ::OutBuffer::pos_type last_pos = ob.tellp();
for (int r = 0; r < itemcount; r++, eq++) {
SerializeItem(ob, (const EQEmu::ItemInstance*)eq->inst, ServerToTitaniumSlot(eq->slot_id), 0);
SerializeItem(ob, (const EQ::ItemInstance*)eq->inst, ServerToTitaniumSlot(eq->slot_id), 0);
if (ob.tellp() == last_pos)
LogNetcode("Titanium::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
@@ -414,15 +414,48 @@ namespace Titanium
FINISH_ENCODE();
}
ENCODE(OP_DzChooseZone)
{
SETUP_VAR_ENCODE(DynamicZoneChooseZone_Struct);
SerializeBuffer buf;
buf.WriteUInt32(emu->client_id);
buf.WriteUInt32(emu->count);
for (uint32 i = 0; i < emu->count; ++i)
{
buf.WriteUInt16(emu->choices[i].dz_zone_id);
buf.WriteUInt16(emu->choices[i].dz_instance_id);
buf.WriteUInt32(emu->choices[i].unknown_id1);
buf.WriteUInt32(emu->choices[i].dz_type);
buf.WriteUInt32(emu->choices[i].unknown_id2);
buf.WriteString(emu->choices[i].description);
buf.WriteString(emu->choices[i].leader_name);
}
__packet->size = buf.size();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
FINISH_ENCODE();
}
ENCODE(OP_DzCompass)
{
SETUP_VAR_ENCODE(ExpeditionCompass_Struct);
ALLOC_VAR_ENCODE(structs::ExpeditionCompass_Struct, sizeof(structs::ExpeditionInfo_Struct) + sizeof(structs::ExpeditionCompassEntry_Struct) * emu->count);
SETUP_VAR_ENCODE(DynamicZoneCompass_Struct);
ALLOC_VAR_ENCODE(structs::DynamicZoneCompass_Struct,
sizeof(structs::DynamicZoneCompass_Struct) +
sizeof(structs::DynamicZoneCompassEntry_Struct) * emu->count
);
OUT(client_id);
OUT(count);
for (uint32 i = 0; i < emu->count; ++i)
{
OUT(entries[i].dz_zone_id);
OUT(entries[i].dz_instance_id);
OUT(entries[i].dz_type);
OUT(entries[i].x);
OUT(entries[i].y);
OUT(entries[i].z);
@@ -446,80 +479,60 @@ namespace Titanium
ENCODE_LENGTH_EXACT(ExpeditionInfo_Struct);
SETUP_DIRECT_ENCODE(ExpeditionInfo_Struct, structs::ExpeditionInfo_Struct);
OUT(client_id);
OUT(assigned);
OUT(max_players);
eq->enabled_max = 1;
strcpy(eq->expedition_name, emu->expedition_name);
strcpy(eq->leader_name, emu->leader_name);
strn0cpy(eq->expedition_name, emu->expedition_name, sizeof(eq->expedition_name));
strn0cpy(eq->leader_name, emu->leader_name, sizeof(eq->leader_name));
FINISH_ENCODE();
}
ENCODE(OP_DzExpeditionList)
ENCODE(OP_DzExpeditionInvite)
{
SETUP_VAR_ENCODE(ExpeditionLockoutList_Struct);
ENCODE_LENGTH_EXACT(ExpeditionInvite_Struct);
SETUP_DIRECT_ENCODE(ExpeditionInvite_Struct, structs::ExpeditionInvite_Struct);
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
uint32 client_id = 0;
uint8 null_term = 0;
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&emu->count, sizeof(uint32));
OUT(client_id);
strn0cpy(eq->inviter_name, emu->inviter_name, sizeof(eq->inviter_name));
strn0cpy(eq->expedition_name, emu->expedition_name, sizeof(eq->expedition_name));
OUT(swapping);
strn0cpy(eq->swap_name, emu->swap_name, sizeof(eq->swap_name));
OUT(dz_zone_id);
OUT(dz_instance_id);
FINISH_ENCODE();
}
ENCODE(OP_DzExpeditionLockoutTimers)
{
SETUP_VAR_ENCODE(ExpeditionLockoutTimers_Struct);
SerializeBuffer buf;
buf.WriteUInt32(emu->client_id);
buf.WriteUInt32(emu->count);
for (uint32 i = 0; i < emu->count; ++i)
{
ss.write(emu->entries[i].expedition, strlen(emu->entries[i].expedition));
ss.write((const char*)&null_term, sizeof(char));
ss.write((const char*)&emu->entries[i].time_left, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write(emu->entries[i].expedition_event, strlen(emu->entries[i].expedition_event));
ss.write((const char*)&null_term, sizeof(char));
buf.WriteString(emu->timers[i].expedition_name);
buf.WriteUInt32(emu->timers[i].seconds_remaining);
buf.WriteInt32(emu->timers[i].event_type);
buf.WriteString(emu->timers[i].event_name);
}
__packet->size = ss.str().length();
__packet->size = buf.size();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
FINISH_ENCODE();
}
ENCODE(OP_DzJoinExpeditionConfirm)
ENCODE(OP_DzSetLeaderName)
{
ENCODE_LENGTH_EXACT(ExpeditionJoinPrompt_Struct);
SETUP_DIRECT_ENCODE(ExpeditionJoinPrompt_Struct, structs::ExpeditionJoinPrompt_Struct);
ENCODE_LENGTH_EXACT(ExpeditionSetLeaderName_Struct);
SETUP_DIRECT_ENCODE(ExpeditionSetLeaderName_Struct, structs::ExpeditionSetLeaderName_Struct);
strcpy(eq->expedition_name, emu->expedition_name);
strcpy(eq->player_name, emu->player_name);
FINISH_ENCODE();
}
ENCODE(OP_DzLeaderStatus)
{
SETUP_VAR_ENCODE(ExpeditionLeaderSet_Struct);
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
uint32 client_id = 0;
uint8 null_term = 0;
ss.write((const char*)&client_id, sizeof(uint32));
//ss.write((const char*)&client_id, sizeof(uint32));
ss.write(emu->leader_name, strlen(emu->leader_name));
ss.write((const char*)&null_term, sizeof(char));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));//0xffffffff
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));//1
ss.write((const char*)&client_id, sizeof(uint32));
__packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
OUT(client_id);
strn0cpy(eq->leader_name, emu->leader_name, sizeof(eq->leader_name));
FINISH_ENCODE();
}
@@ -528,26 +541,43 @@ namespace Titanium
{
SETUP_VAR_ENCODE(ExpeditionMemberList_Struct);
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
uint32 client_id = 0;
uint8 null_term = 0;
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&emu->count, sizeof(uint32));
for (uint32 i = 0; i < emu->count; ++i)
SerializeBuffer buf;
buf.WriteUInt32(emu->client_id);
buf.WriteUInt32(emu->member_count);
for (uint32 i = 0; i < emu->member_count; ++i)
{
ss.write(emu->entries[i].name, strlen(emu->entries[i].name));
ss.write((const char*)&null_term, sizeof(char));
ss.write((const char*)&emu->entries[i].status, sizeof(char));
buf.WriteString(emu->members[i].name);
buf.WriteUInt8(emu->members[i].expedition_status);
}
__packet->size = ss.str().length();
__packet->size = buf.size();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
FINISH_ENCODE();
}
ENCODE(OP_DzMemberListName)
{
ENCODE_LENGTH_EXACT(ExpeditionMemberListName_Struct);
SETUP_DIRECT_ENCODE(ExpeditionMemberListName_Struct, structs::ExpeditionMemberListName_Struct);
OUT(client_id);
OUT(add_name);
strn0cpy(eq->name, emu->name, sizeof(eq->name));
FINISH_ENCODE();
}
ENCODE(OP_DzMemberListStatus)
{
auto emu = reinterpret_cast<ExpeditionMemberList_Struct*>((*p)->pBuffer);
if (emu->member_count == 1)
{
ENCODE_FORWARD(OP_DzMemberList);
}
}
ENCODE(OP_Emote)
{
EQApplicationPacket *in = *p;
@@ -796,14 +826,14 @@ namespace Titanium
OUT(TargetID);
OUT(playerid);
for (int i = EQEmu::invslot::slotCharm; i <= EQEmu::invslot::slotWaist; ++i) {
for (int i = EQ::invslot::slotCharm; i <= EQ::invslot::slotWaist; ++i) {
strn0cpy(eq->itemnames[i], emu->itemnames[i], sizeof(eq->itemnames[i]));
OUT(itemicons[i]);
}
// move ammo down to last element in titanium array
strn0cpy(eq->itemnames[invslot::slotAmmo], emu->itemnames[EQEmu::invslot::slotAmmo], sizeof(eq->itemnames[invslot::slotAmmo]));
eq->itemicons[invslot::slotAmmo] = emu->itemicons[EQEmu::invslot::slotAmmo];
strn0cpy(eq->itemnames[invslot::slotAmmo], emu->itemnames[EQ::invslot::slotAmmo], sizeof(eq->itemnames[invslot::slotAmmo]));
eq->itemicons[invslot::slotAmmo] = emu->itemicons[EQ::invslot::slotAmmo];
strn0cpy(eq->text, emu->text, sizeof(eq->text));
@@ -832,14 +862,14 @@ namespace Titanium
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
EQEmu::InternalSerializedItem_Struct* int_struct = (EQEmu::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQ::InternalSerializedItem_Struct* int_struct = (EQ::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
EQ::OutBuffer ob;
EQ::OutBuffer::pos_type last_pos = ob.tellp();
ob.write((const char*)__emu_buffer, 4);
SerializeItem(ob, (const EQEmu::ItemInstance*)int_struct->inst, ServerToTitaniumSlot(int_struct->slot_id), 0);
SerializeItem(ob, (const EQ::ItemInstance*)int_struct->inst, ServerToTitaniumSlot(int_struct->slot_id), 0);
if (ob.tellp() == last_pos) {
LogNetcode("Titanium::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
delete in;
@@ -909,7 +939,7 @@ namespace Titanium
// Since HT/LoH are translated up, we need to translate down only for memSpellSpellbar case
if (emu->scribing == 3)
eq->slot = static_cast<uint32>(ServerToTitaniumCastingSlot(static_cast<EQEmu::spells::CastingSlot>(emu->slot)));
eq->slot = static_cast<uint32>(ServerToTitaniumCastingSlot(static_cast<EQ::spells::CastingSlot>(emu->slot)));
else
OUT(slot);
OUT(spell_id);
@@ -1009,7 +1039,7 @@ namespace Titanium
OUT(hairstyle);
OUT(beard);
// OUT(unknown00178[10]);
for (r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++) {
for (r = EQ::textures::textureBegin; r < EQ::textures::materialCount; r++) {
OUT(item_material.Slot[r].Material);
OUT(item_tint.Slot[r].Color);
}
@@ -1032,7 +1062,7 @@ namespace Titanium
OUT(face);
// OUT(unknown02264[47]);
if (spells::SPELLBOOK_SIZE <= EQEmu::spells::SPELLBOOK_SIZE) {
if (spells::SPELLBOOK_SIZE <= EQ::spells::SPELLBOOK_SIZE) {
for (uint32 r = 0; r < spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
eq->spell_book[r] = emu->spell_book[r];
@@ -1041,14 +1071,14 @@ namespace Titanium
}
}
else {
for (uint32 r = 0; r < EQEmu::spells::SPELLBOOK_SIZE; r++) {
for (uint32 r = 0; r < EQ::spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
eq->spell_book[r] = emu->spell_book[r];
else
eq->spell_book[r] = 0xFFFFFFFFU;
}
// invalidate the rest of the spellbook slots
memset(&eq->spell_book[EQEmu::spells::SPELLBOOK_SIZE], 0xFF, (sizeof(uint32) * (spells::SPELLBOOK_SIZE - EQEmu::spells::SPELLBOOK_SIZE)));
memset(&eq->spell_book[EQ::spells::SPELLBOOK_SIZE], 0xFF, (sizeof(uint32) * (spells::SPELLBOOK_SIZE - EQ::spells::SPELLBOOK_SIZE)));
}
// OUT(unknown4184[448]);
@@ -1092,7 +1122,7 @@ namespace Titanium
// OUT(unknown06160[4]);
// Copy bandoliers where server and client indices converge
for (r = 0; r < EQEmu::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
for (r = 0; r < EQ::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
OUT_str(bandoliers[r].Name);
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
OUT(bandoliers[r].Items[k].ID);
@@ -1101,7 +1131,7 @@ namespace Titanium
}
}
// Nullify bandoliers where server and client indices diverge, with a client bias
for (r = EQEmu::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
for (r = EQ::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
eq->bandoliers[r].Name[0] = '\0';
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
eq->bandoliers[r].Items[k].ID = 0;
@@ -1113,13 +1143,13 @@ namespace Titanium
// OUT(unknown07444[5120]);
// Copy potion belt where server and client indices converge
for (r = 0; r < EQEmu::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
for (r = 0; r < EQ::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
OUT(potionbelt.Items[r].ID);
OUT(potionbelt.Items[r].Icon);
OUT_str(potionbelt.Items[r].Name);
}
// Nullify potion belt where server and client indices diverge, with a client bias
for (r = EQEmu::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
for (r = EQ::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
eq->potionbelt.Items[r].ID = 0;
eq->potionbelt.Items[r].Icon = 0;
eq->potionbelt.Items[r].Name[0] = '\0';
@@ -1349,14 +1379,14 @@ namespace Titanium
if (eq->Race[char_index] > 473)
eq->Race[char_index] = 1;
for (int index = 0; index < EQEmu::textures::materialCount; ++index) {
for (int index = 0; index < EQ::textures::materialCount; ++index) {
eq->CS_Colors[char_index].Slot[index].Color = emu_cse->Equip[index].Color;
}
eq->BeardColor[char_index] = emu_cse->BeardColor;
eq->HairStyle[char_index] = emu_cse->HairStyle;
for (int index = 0; index < EQEmu::textures::materialCount; ++index) {
for (int index = 0; index < EQ::textures::materialCount; ++index) {
eq->Equip[char_index].Slot[index].Material = emu_cse->Equip[index].Material;
}
@@ -1386,14 +1416,14 @@ namespace Titanium
for (; char_index < 10; ++char_index) {
eq->Race[char_index] = 0;
for (int index = 0; index < EQEmu::textures::materialCount; ++index) {
for (int index = 0; index < EQ::textures::materialCount; ++index) {
eq->CS_Colors[char_index].Slot[index].Color = 0;
}
eq->BeardColor[char_index] = 0;
eq->HairStyle[char_index] = 0;
for (int index = 0; index < EQEmu::textures::materialCount; ++index) {
for (int index = 0; index < EQ::textures::materialCount; ++index) {
eq->Equip[char_index].Slot[index].Material = 0;
}
@@ -1717,7 +1747,7 @@ namespace Titanium
eq->petOwnerId = emu->petOwnerId;
eq->guildrank = emu->guildrank;
// eq->unknown0194[3] = emu->unknown0194[3];
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; k++) {
eq->equipment.Slot[k].Material = emu->equipment.Slot[k].Material;
eq->equipment_tint.Slot[k].Color = emu->equipment_tint.Slot[k].Color;
}
@@ -1830,7 +1860,7 @@ namespace Titanium
DECODE_LENGTH_EXACT(structs::BugReport_Struct);
SETUP_DIRECT_DECODE(BugReport_Struct, structs::BugReport_Struct);
emu->category_id = EQEmu::bug::CategoryNameToCategoryID(eq->category_name);
emu->category_id = EQ::bug::CategoryNameToCategoryID(eq->category_name);
memcpy(emu->category_name, eq, sizeof(structs::BugReport_Struct));
FINISH_DIRECT_DECODE();
@@ -1943,6 +1973,83 @@ namespace Titanium
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzAddPlayer)
{
DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
strn0cpy(emu->name, eq->name, sizeof(emu->name));
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzChooseZoneReply)
{
DECODE_LENGTH_EXACT(structs::DynamicZoneChooseZoneReply_Struct);
SETUP_DIRECT_DECODE(DynamicZoneChooseZoneReply_Struct, structs::DynamicZoneChooseZoneReply_Struct);
emu->unknown000 = eq->unknown000;
emu->unknown008 = eq->unknown004;
IN(unknown_id1);
IN(dz_zone_id);
IN(dz_instance_id);
IN(dz_type);
IN(unknown_id2);
emu->unknown028 = eq->unknown024;
emu->unknown032 = eq->unknown028;
emu->unknown036 = eq->unknown032;
emu->unknown040 = eq->unknown036;
emu->unknown044 = eq->unknown040;
emu->unknown048 = eq->unknown044;
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzExpeditionInviteResponse)
{
DECODE_LENGTH_EXACT(structs::ExpeditionInviteResponse_Struct);
SETUP_DIRECT_DECODE(ExpeditionInviteResponse_Struct, structs::ExpeditionInviteResponse_Struct);
IN(dz_zone_id);
IN(dz_instance_id);
IN(accepted);
IN(swapping);
strn0cpy(emu->swap_name, eq->swap_name, sizeof(emu->swap_name));
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzMakeLeader)
{
DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
strn0cpy(emu->name, eq->name, sizeof(emu->name));
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzRemovePlayer)
{
DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
strn0cpy(emu->name, eq->name, sizeof(emu->name));
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzSwapPlayer)
{
DECODE_LENGTH_EXACT(structs::ExpeditionCommandSwap_Struct);
SETUP_DIRECT_DECODE(ExpeditionCommandSwap_Struct, structs::ExpeditionCommandSwap_Struct);
strn0cpy(emu->add_player_name, eq->add_player_name, sizeof(emu->add_player_name));
strn0cpy(emu->rem_player_name, eq->rem_player_name, sizeof(emu->rem_player_name));
FINISH_DIRECT_DECODE();
}
DECODE(OP_Emote)
{
unsigned char *__eq_buffer = __packet->pBuffer;
@@ -1993,12 +2100,12 @@ namespace Titanium
}
// move ammo up to last element in server array
strn0cpy(emu->itemnames[EQEmu::invslot::slotAmmo], eq->itemnames[invslot::slotAmmo], sizeof(emu->itemnames[EQEmu::invslot::slotAmmo]));
emu->itemicons[EQEmu::invslot::slotAmmo] = eq->itemicons[invslot::slotAmmo];
strn0cpy(emu->itemnames[EQ::invslot::slotAmmo], eq->itemnames[invslot::slotAmmo], sizeof(emu->itemnames[EQ::invslot::slotAmmo]));
emu->itemicons[EQ::invslot::slotAmmo] = eq->itemicons[invslot::slotAmmo];
// nullify power source element in server array
strn0cpy(emu->itemnames[EQEmu::invslot::slotPowerSource], "", sizeof(emu->itemnames[EQEmu::invslot::slotPowerSource]));
emu->itemicons[EQEmu::invslot::slotPowerSource] = 0xFFFFFFFF;
strn0cpy(emu->itemnames[EQ::invslot::slotPowerSource], "", sizeof(emu->itemnames[EQ::invslot::slotPowerSource]));
emu->itemicons[EQ::invslot::slotPowerSource] = 0xFFFFFFFF;
strn0cpy(emu->text, eq->text, sizeof(emu->text));
@@ -2053,7 +2160,7 @@ namespace Titanium
for (int i = 0; i < spells::SPELL_GEM_COUNT; ++i)
IN(spell[i]);
for (int i = spells::SPELL_GEM_COUNT; i < EQEmu::spells::SPELL_GEM_COUNT; ++i)
for (int i = spells::SPELL_GEM_COUNT; i < EQ::spells::SPELL_GEM_COUNT; ++i)
emu->spell[i] = 0xFFFFFFFF;
IN(unknown);
@@ -2273,9 +2380,9 @@ namespace Titanium
}
// file scope helper methods
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id_in, uint8 depth) {
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id_in, uint8 depth) {
const char *protection = "\\\\\\\\\\";
const EQEmu::ItemData *item = inst->GetUnscaledItem();
const EQ::ItemData *item = inst->GetUnscaledItem();
ob << StringFormat(
"%.*s%s",
@@ -2293,7 +2400,7 @@ namespace Titanium
ob << '|' << itoa((!inst->GetMerchantSlot() ? inst->GetSerialNumber()
: inst->GetMerchantSlot())); // merchant serial number
ob << '|' << itoa(inst->GetRecastTimestamp()); // recast timestamp
ob << '|' << itoa(((inst->IsStackable() ? ((inst->GetItem()->ItemType == EQEmu::item::ItemTypePotion) ? 1 : 0)
ob << '|' << itoa(((inst->IsStackable() ? ((inst->GetItem()->ItemType == EQ::item::ItemTypePotion) ? 1 : 0)
: inst->GetCharges()))); // charge count
ob << '|' << itoa((inst->IsAttuned() ? 1 : 0)); // inst attuned
ob << '|' << itoa(0); // unknown
@@ -2502,10 +2609,10 @@ namespace Titanium
ob << StringFormat("%.*s\"", depth, protection); // Quotes (and protection, if needed) around static data
// Sub data
for (int index = EQEmu::invbag::SLOT_BEGIN; index <= invbag::SLOT_END; ++index) {
for (int index = EQ::invbag::SLOT_BEGIN; index <= invbag::SLOT_END; ++index) {
ob << '|';
EQEmu::ItemInstance *sub = inst->GetItem(index);
EQ::ItemInstance *sub = inst->GetItem(index);
if (!sub)
continue;
@@ -2525,59 +2632,59 @@ namespace Titanium
static inline int16 ServerToTitaniumSlot(uint32 server_slot) {
int16 titanium_slot = invslot::SLOT_INVALID;
if (server_slot <= EQEmu::invslot::slotWaist) {
if (server_slot <= EQ::invslot::slotWaist) {
titanium_slot = server_slot;
}
else if (server_slot == EQEmu::invslot::slotAmmo) {
else if (server_slot == EQ::invslot::slotAmmo) {
titanium_slot = server_slot - 1;
}
else if (server_slot <= EQEmu::invslot::slotGeneral8 && server_slot >= EQEmu::invslot::slotGeneral1) {
else if (server_slot <= EQ::invslot::slotGeneral8 && server_slot >= EQ::invslot::slotGeneral1) {
titanium_slot = server_slot - 1;
}
else if (server_slot <= (EQEmu::invslot::POSSESSIONS_COUNT + EQEmu::invslot::slotWaist) &&
server_slot >= EQEmu::invslot::slotCursor) {
else if (server_slot <= (EQ::invslot::POSSESSIONS_COUNT + EQ::invslot::slotWaist) &&
server_slot >= EQ::invslot::slotCursor) {
titanium_slot = server_slot - 3;
}
else if (server_slot == (EQEmu::invslot::POSSESSIONS_COUNT + EQEmu::invslot::slotAmmo)) {
else if (server_slot == (EQ::invslot::POSSESSIONS_COUNT + EQ::invslot::slotAmmo)) {
titanium_slot = server_slot - 4;
}
else if (server_slot <= EQEmu::invbag::GENERAL_BAGS_8_END &&
server_slot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
else if (server_slot <= EQ::invbag::GENERAL_BAGS_8_END &&
server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
titanium_slot = server_slot;
}
else if (server_slot <= EQEmu::invbag::CURSOR_BAG_END && server_slot >= EQEmu::invbag::CURSOR_BAG_BEGIN) {
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::CURSOR_BAG_BEGIN) {
titanium_slot = server_slot - 20;
}
else if (server_slot <= EQEmu::invslot::TRIBUTE_END && server_slot >= EQEmu::invslot::TRIBUTE_BEGIN) {
else if (server_slot <= EQ::invslot::TRIBUTE_END && server_slot >= EQ::invslot::TRIBUTE_BEGIN) {
titanium_slot = server_slot;
}
else if (server_slot <= EQEmu::invslot::GUILD_TRIBUTE_END &&
server_slot >= EQEmu::invslot::GUILD_TRIBUTE_BEGIN) {
else if (server_slot <= EQ::invslot::GUILD_TRIBUTE_END &&
server_slot >= EQ::invslot::GUILD_TRIBUTE_BEGIN) {
titanium_slot = server_slot;
}
else if (server_slot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
else if (server_slot == EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
titanium_slot = server_slot;
}
else if (server_slot <= EQEmu::invslot::BANK_END && server_slot >= EQEmu::invslot::BANK_BEGIN) {
else if (server_slot <= EQ::invslot::BANK_END && server_slot >= EQ::invslot::BANK_BEGIN) {
titanium_slot = server_slot;
}
else if (server_slot <= EQEmu::invbag::BANK_BAGS_16_END && server_slot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
else if (server_slot <= EQ::invbag::BANK_BAGS_16_END && server_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
titanium_slot = server_slot;
}
else if (server_slot <= EQEmu::invslot::SHARED_BANK_END && server_slot >= EQEmu::invslot::SHARED_BANK_BEGIN) {
else if (server_slot <= EQ::invslot::SHARED_BANK_END && server_slot >= EQ::invslot::SHARED_BANK_BEGIN) {
titanium_slot = server_slot;
}
else if (server_slot <= EQEmu::invbag::SHARED_BANK_BAGS_END &&
server_slot >= EQEmu::invbag::SHARED_BANK_BAGS_BEGIN) {
else if (server_slot <= EQ::invbag::SHARED_BANK_BAGS_END &&
server_slot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
titanium_slot = server_slot;
}
else if (server_slot <= EQEmu::invslot::TRADE_END && server_slot >= EQEmu::invslot::TRADE_BEGIN) {
else if (server_slot <= EQ::invslot::TRADE_END && server_slot >= EQ::invslot::TRADE_BEGIN) {
titanium_slot = server_slot;
}
else if (server_slot <= EQEmu::invbag::TRADE_BAGS_END && server_slot >= EQEmu::invbag::TRADE_BAGS_BEGIN) {
else if (server_slot <= EQ::invbag::TRADE_BAGS_END && server_slot >= EQ::invbag::TRADE_BAGS_BEGIN) {
titanium_slot = server_slot;
}
else if (server_slot <= EQEmu::invslot::WORLD_END && server_slot >= EQEmu::invslot::WORLD_BEGIN) {
else if (server_slot <= EQ::invslot::WORLD_END && server_slot >= EQ::invslot::WORLD_BEGIN) {
titanium_slot = server_slot;
}
@@ -2590,16 +2697,16 @@ namespace Titanium
static inline int16 ServerToTitaniumCorpseSlot(uint32 server_corpse_slot) {
int16 titanium_slot = invslot::SLOT_INVALID;
if (server_corpse_slot <= EQEmu::invslot::slotGeneral8 && server_corpse_slot >= EQEmu::invslot::slotGeneral1) {
if (server_corpse_slot <= EQ::invslot::slotGeneral8 && server_corpse_slot >= EQ::invslot::slotGeneral1) {
titanium_slot = server_corpse_slot - 1;
}
else if (server_corpse_slot <= (EQEmu::invslot::POSSESSIONS_COUNT + EQEmu::invslot::slotWaist) &&
server_corpse_slot >= EQEmu::invslot::slotCursor) {
else if (server_corpse_slot <= (EQ::invslot::POSSESSIONS_COUNT + EQ::invslot::slotWaist) &&
server_corpse_slot >= EQ::invslot::slotCursor) {
titanium_slot = server_corpse_slot - 3;
}
else if (server_corpse_slot == (EQEmu::invslot::POSSESSIONS_COUNT + EQEmu::invslot::slotAmmo)) {
else if (server_corpse_slot == (EQ::invslot::POSSESSIONS_COUNT + EQ::invslot::slotAmmo)) {
titanium_slot = server_corpse_slot - 4;
}
@@ -2613,7 +2720,7 @@ namespace Titanium
}
static inline uint32 TitaniumToServerSlot(int16 titanium_slot) {
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
uint32 server_slot = EQ::invslot::SLOT_INVALID;
if (titanium_slot <= invslot::slotWaist) {
server_slot = titanium_slot;
@@ -2675,7 +2782,7 @@ namespace Titanium
static inline uint32 TitaniumToServerCorpseSlot(int16 titanium_corpse_slot)
{
uint32 server_slot = EQEmu::invslot::SLOT_INVALID;
uint32 server_slot = EQ::invslot::SLOT_INVALID;
if (titanium_corpse_slot <= invslot::slotGeneral8 && titanium_corpse_slot >= invslot::slotGeneral1) {
server_slot = titanium_corpse_slot + 1;
@@ -2696,7 +2803,7 @@ namespace Titanium
static inline void ServerToTitaniumSayLink(std::string &titanium_saylink, const std::string &server_saylink)
{
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
if ((constants::SAY_LINK_BODY_SIZE == EQ::constants::SAY_LINK_BODY_SIZE) || (server_saylink.find('\x12') == std::string::npos)) {
titanium_saylink = server_saylink;
return;
}
@@ -2705,7 +2812,7 @@ namespace Titanium
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::constants::SAY_LINK_BODY_SIZE) {
if (segments[segment_iter].length() <= EQ::constants::SAY_LINK_BODY_SIZE) {
titanium_saylink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
@@ -2736,7 +2843,7 @@ namespace Titanium
static inline void TitaniumToServerSayLink(std::string &server_saylink, const std::string &titanium_saylink)
{
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (titanium_saylink.find('\x12') == std::string::npos)) {
if ((EQ::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (titanium_saylink.find('\x12') == std::string::npos)) {
server_saylink = titanium_saylink;
return;
}
@@ -2772,85 +2879,85 @@ namespace Titanium
}
}
static inline spells::CastingSlot ServerToTitaniumCastingSlot(EQEmu::spells::CastingSlot slot) {
static inline spells::CastingSlot ServerToTitaniumCastingSlot(EQ::spells::CastingSlot slot) {
switch (slot) {
case EQEmu::spells::CastingSlot::Gem1:
case EQ::spells::CastingSlot::Gem1:
return spells::CastingSlot::Gem1;
case EQEmu::spells::CastingSlot::Gem2:
case EQ::spells::CastingSlot::Gem2:
return spells::CastingSlot::Gem2;
case EQEmu::spells::CastingSlot::Gem3:
case EQ::spells::CastingSlot::Gem3:
return spells::CastingSlot::Gem3;
case EQEmu::spells::CastingSlot::Gem4:
case EQ::spells::CastingSlot::Gem4:
return spells::CastingSlot::Gem4;
case EQEmu::spells::CastingSlot::Gem5:
case EQ::spells::CastingSlot::Gem5:
return spells::CastingSlot::Gem5;
case EQEmu::spells::CastingSlot::Gem6:
case EQ::spells::CastingSlot::Gem6:
return spells::CastingSlot::Gem6;
case EQEmu::spells::CastingSlot::Gem7:
case EQ::spells::CastingSlot::Gem7:
return spells::CastingSlot::Gem7;
case EQEmu::spells::CastingSlot::Gem8:
case EQ::spells::CastingSlot::Gem8:
return spells::CastingSlot::Gem8;
case EQEmu::spells::CastingSlot::Gem9:
case EQ::spells::CastingSlot::Gem9:
return spells::CastingSlot::Gem9;
case EQEmu::spells::CastingSlot::Item:
case EQ::spells::CastingSlot::Item:
return spells::CastingSlot::Item;
case EQEmu::spells::CastingSlot::PotionBelt:
case EQ::spells::CastingSlot::PotionBelt:
return spells::CastingSlot::PotionBelt;
case EQEmu::spells::CastingSlot::Discipline:
case EQ::spells::CastingSlot::Discipline:
return spells::CastingSlot::Discipline;
case EQEmu::spells::CastingSlot::AltAbility:
case EQ::spells::CastingSlot::AltAbility:
return spells::CastingSlot::AltAbility;
default: // we shouldn't have any issues with other slots ... just return something
return spells::CastingSlot::Discipline;
}
}
static inline EQEmu::spells::CastingSlot TitaniumToServerCastingSlot(spells::CastingSlot slot, uint32 item_location) {
static inline EQ::spells::CastingSlot TitaniumToServerCastingSlot(spells::CastingSlot slot, uint32 item_location) {
switch (slot) {
case spells::CastingSlot::Gem1:
return EQEmu::spells::CastingSlot::Gem1;
return EQ::spells::CastingSlot::Gem1;
case spells::CastingSlot::Gem2:
return EQEmu::spells::CastingSlot::Gem2;
return EQ::spells::CastingSlot::Gem2;
case spells::CastingSlot::Gem3:
return EQEmu::spells::CastingSlot::Gem3;
return EQ::spells::CastingSlot::Gem3;
case spells::CastingSlot::Gem4:
return EQEmu::spells::CastingSlot::Gem4;
return EQ::spells::CastingSlot::Gem4;
case spells::CastingSlot::Gem5:
return EQEmu::spells::CastingSlot::Gem5;
return EQ::spells::CastingSlot::Gem5;
case spells::CastingSlot::Gem6:
return EQEmu::spells::CastingSlot::Gem6;
return EQ::spells::CastingSlot::Gem6;
case spells::CastingSlot::Gem7:
return EQEmu::spells::CastingSlot::Gem7;
return EQ::spells::CastingSlot::Gem7;
case spells::CastingSlot::Gem8:
return EQEmu::spells::CastingSlot::Gem8;
return EQ::spells::CastingSlot::Gem8;
case spells::CastingSlot::Gem9:
return EQEmu::spells::CastingSlot::Gem9;
return EQ::spells::CastingSlot::Gem9;
case spells::CastingSlot::Ability:
return EQEmu::spells::CastingSlot::Ability;
return EQ::spells::CastingSlot::Ability;
// Tit uses 10 for item and discipline casting, but items have a valid location
case spells::CastingSlot::Item:
if (item_location == INVALID_INDEX)
return EQEmu::spells::CastingSlot::Discipline;
return EQ::spells::CastingSlot::Discipline;
else
return EQEmu::spells::CastingSlot::Item;
return EQ::spells::CastingSlot::Item;
case spells::CastingSlot::PotionBelt:
return EQEmu::spells::CastingSlot::PotionBelt;
return EQ::spells::CastingSlot::PotionBelt;
case spells::CastingSlot::AltAbility:
return EQEmu::spells::CastingSlot::AltAbility;
return EQ::spells::CastingSlot::AltAbility;
default: // we shouldn't have any issues with other slots ... just return something
return EQEmu::spells::CastingSlot::Discipline;
return EQ::spells::CastingSlot::Discipline;
}
}
static inline int ServerToTitaniumBuffSlot(int index)
{
// we're a disc
if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
spells::LONG_BUFFS + spells::SHORT_BUFFS;
// we're a song
if (index >= EQEmu::spells::LONG_BUFFS)
return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
if (index >= EQ::spells::LONG_BUFFS)
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
@@ -2859,11 +2966,11 @@ namespace Titanium
{
// we're a disc
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
EQEmu::spells::SHORT_BUFFS;
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQ::spells::LONG_BUFFS +
EQ::spells::SHORT_BUFFS;
// we're a song
if (index >= spells::LONG_BUFFS)
return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS;
return index - spells::LONG_BUFFS + EQ::spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
+1 -1
View File
@@ -43,7 +43,7 @@ namespace Titanium
protected:
virtual std::string Describe() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
virtual const EQ::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
+15 -15
View File
@@ -31,7 +31,7 @@ namespace Titanium
const int16 INULL = 0;
namespace inventory {
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::Titanium; }
inline EQ::versions::ClientVersion GetInventoryRef() { return EQ::versions::ClientVersion::Titanium; }
const bool ConcatenateInvTypeLimbo = true;
@@ -43,7 +43,7 @@ namespace Titanium
} /*inventory*/
namespace invtype {
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::Titanium; }
inline EQ::versions::ClientVersion GetInvTypeRef() { return EQ::versions::ClientVersion::Titanium; }
namespace enum_ {
enum InventoryTypes : int16 {
@@ -106,7 +106,7 @@ namespace Titanium
} /*invtype*/
namespace invslot {
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::Titanium; }
inline EQ::versions::ClientVersion GetInvSlotRef() { return EQ::versions::ClientVersion::Titanium; }
namespace enum_ {
enum InventorySlots : int16 {
@@ -204,7 +204,7 @@ namespace Titanium
} /*invslot*/
namespace invbag {
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::Titanium; }
inline EQ::versions::ClientVersion GetInvBagRef() { return EQ::versions::ClientVersion::Titanium; }
const int16 SLOT_INVALID = IINVALID;
const int16 SLOT_BEGIN = INULL;
@@ -236,7 +236,7 @@ namespace Titanium
} /*invbag*/
namespace invaug {
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::Titanium; }
inline EQ::versions::ClientVersion GetInvAugRef() { return EQ::versions::ClientVersion::Titanium; }
const int16 SOCKET_INVALID = IINVALID;
const int16 SOCKET_BEGIN = INULL;
@@ -248,7 +248,7 @@ namespace Titanium
} /*invaug*/
namespace item {
inline EQEmu::versions::ClientVersion GetItemRef() { return EQEmu::versions::ClientVersion::Titanium; }
inline EQ::versions::ClientVersion GetItemRef() { return EQ::versions::ClientVersion::Titanium; }
enum ItemPacketType : int {
ItemPacketMerchant = 100,
@@ -266,7 +266,7 @@ namespace Titanium
} /*item*/
namespace profile {
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::Titanium; }
inline EQ::versions::ClientVersion GetProfileRef() { return EQ::versions::ClientVersion::Titanium; }
const int16 BANDOLIERS_SIZE = 4; // number of bandolier instances
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
@@ -278,11 +278,11 @@ namespace Titanium
} /*profile*/
namespace constants {
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::Titanium; }
inline EQ::versions::ClientVersion GetConstantsRef() { return EQ::versions::ClientVersion::Titanium; }
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::DoD; // Someone had this as PoR in another section...
const uint32 EXPANSION_BIT = EQEmu::expansions::bitDoD;
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskDoD;
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::DoD; // Someone had this as PoR in another section...
const uint32 EXPANSION_BIT = EQ::expansions::bitDoD;
const uint32 EXPANSIONS_MASK = EQ::expansions::maskDoD;
const size_t CHARACTER_CREATION_LIMIT = 8; // Hard-coded in client - DO NOT ALTER
@@ -291,21 +291,21 @@ namespace Titanium
} /*constants*/
namespace behavior {
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::Titanium; }
inline EQ::versions::ClientVersion GetBehaviorRef() { return EQ::versions::ClientVersion::Titanium; }
const bool CoinHasWeight = true;
} /*behavior*/
namespace skills {
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::Titanium; }
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::Titanium; }
const size_t LastUsableSkill = EQEmu::skills::SkillFrenzy;
const size_t LastUsableSkill = EQ::skills::SkillFrenzy;
} /*skills*/
namespace spells {
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::Titanium; }
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::Titanium; }
enum class CastingSlot : uint32 {
Gem1 = 0,
+12 -3
View File
@@ -32,13 +32,16 @@ E(OP_Damage)
E(OP_DeleteCharge)
E(OP_DeleteItem)
E(OP_DeleteSpawn)
E(OP_DzChooseZone)
E(OP_DzCompass)
E(OP_DzExpeditionEndsWarning)
E(OP_DzExpeditionInfo)
E(OP_DzExpeditionList)
E(OP_DzJoinExpeditionConfirm)
E(OP_DzLeaderStatus)
E(OP_DzExpeditionInvite)
E(OP_DzExpeditionLockoutTimers)
E(OP_DzMemberList)
E(OP_DzMemberListName)
E(OP_DzMemberListStatus)
E(OP_DzSetLeaderName)
E(OP_Emote)
E(OP_FormattedMessage)
E(OP_GroundSpawn)
@@ -86,6 +89,12 @@ D(OP_CharacterCreate)
D(OP_ClientUpdate)
D(OP_Consume)
D(OP_DeleteItem)
D(OP_DzAddPlayer)
D(OP_DzChooseZoneReply)
D(OP_DzExpeditionInviteResponse)
D(OP_DzMakeLeader)
D(OP_DzRemovePlayer)
D(OP_DzSwapPlayer)
D(OP_Emote)
D(OP_FaceChange)
D(OP_InspectAnswer)
+126 -19
View File
@@ -161,7 +161,7 @@ struct TintProfile {
Tint_Struct Primary;
Tint_Struct Secondary;
};
Tint_Struct Slot[EQEmu::textures::materialCount];
Tint_Struct Slot[EQ::textures::materialCount];
};
};
@@ -184,7 +184,7 @@ struct TextureProfile
Texture_Struct Primary;
Texture_Struct Secondary;
};
Texture_Struct Slot[EQEmu::textures::materialCount];
Texture_Struct Slot[EQ::textures::materialCount];
};
TextureProfile();
@@ -3299,43 +3299,150 @@ struct VeteranReward
/*004*/ VeteranRewardItem item;
};
struct ExpeditionExpireWarning
struct ExpeditionInvite_Struct
{
/*000*/ uint32 client_id;
/*004*/ char inviter_name[64];
/*068*/ char expedition_name[128];
/*196*/ uint8 swapping; // 0: adding 1: swapping
/*197*/ char swap_name[64]; // if swapping, swap name being removed
/*261*/ uint8 padding[3];
/*264*/ uint16 dz_zone_id; // dz_id zone/instance pair, sent back in reply
/*268*/ uint16 dz_instance_id;
};
struct ExpeditionInviteResponse_Struct
{
/*000*/ uint32 unknown000;
/*004*/ uint32 minutes_remaining;
/*004*/ uint16 dz_zone_id; // dz_id pair sent in invite
/*006*/ uint16 dz_instance_id;
/*008*/ uint8 accepted; // 0: declined 1: accepted
/*009*/ uint8 swapping; // 0: adding 1: swapping (sent in invite)
/*010*/ char swap_name[64]; // swap name sent in invite
/*074*/ uint8 unknown078; // padding/garbage?
/*075*/ uint8 unknown079; // padding/garbage?
};
struct ExpeditionInfo_Struct
{
/*000*/ uint32 clientid;
/*004*/ uint32 enabled_max;
/*000*/ uint32 client_id;
/*004*/ uint32 assigned; // padded bool
/*008*/ uint32 max_players;
/*012*/ char expedition_name[128];
/*142*/ char leader_name[64];
/*012*/ char expedition_name[128];
/*140*/ char leader_name[64];
};
struct ExpeditionCompassEntry_Struct
struct ExpeditionMemberEntry_Struct
{
/*000*/ float unknown000; //seen *((uint32*)) = 1584791871
/*004*/ uint32 enabled; //guess
/*008*/ uint32 unknown008; //seen 1019
/*000*/ char name[1]; // variable length, null terminated, max 0x40 (64)
/*000*/ uint8 expedition_status; // 0: unknown 1: Online, 2: Offline, 3: In Dynamic Zone, 4: Link Dead
};
struct ExpeditionMemberList_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 member_count;
/*008*/ ExpeditionMemberEntry_Struct members[0]; // variable length
};
struct ExpeditionMemberListName_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 add_name; // padded bool, 0: remove name, 1: add name with unknown status
/*008*/ char name[64];
};
struct ExpeditionLockoutTimerEntry_Struct
{
/*000*/ char expedition_name[1]; // variable length, null terminated, max 0x80 (128)
/*000*/ uint32 seconds_remaining;
/*000*/ int32 event_type; // seen -1 (0xffffffff) for replay timers and 1 for event timers
/*000*/ char event_name[1]; // variable length, null terminated, max 0x100 (256)
};
struct ExpeditionLockoutTimers_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 count;
/*008*/ ExpeditionLockoutTimerEntry_Struct timers[0];
};
struct ExpeditionSetLeaderName_Struct
{
/*000*/ uint32 client_id;
/*004*/ char leader_name[64];
};
struct ExpeditionCommand_Struct
{
/*000*/ uint32 unknown000;
/*004*/ char name[64];
};
struct ExpeditionCommandSwap_Struct
{
/*000*/ uint32 unknown000;
/*004*/ char add_player_name[64]; // swap to (player must confirm)
/*068*/ char rem_player_name[64]; // swap from
};
struct ExpeditionExpireWarning
{
/*000*/ uint32 client_id;
/*004*/ uint32 minutes_remaining;
};
struct DynamicZoneCompassEntry_Struct
{
/*000*/ uint16 dz_zone_id; // target dz id pair
/*002*/ uint16 dz_instance_id;
/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
/*008*/ uint32 unknown008;
/*012*/ float y;
/*016*/ float x;
/*020*/ float z;
};
struct ExpeditionCompass_Struct
struct DynamicZoneCompass_Struct
{
/*000*/ uint32 clientid;
/*000*/ uint32 client_id;
/*004*/ uint32 count;
/*008*/ ExpeditionCompassEntry_Struct entries[0];
/*008*/ DynamicZoneCompassEntry_Struct entries[0];
};
struct ExpeditionJoinPrompt_Struct
struct DynamicZoneChooseZoneEntry_Struct
{
/*000*/ uint32 clientid;
/*004*/ char player_name[64];
/*068*/ char expedition_name[64];
/*000*/ uint16 dz_zone_id; // dz_id pair
/*002*/ uint16 dz_instance_id;
/*004*/ uint32 unknown_id1; // sent back in reply
/*008*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest -- sent back in reply
/*012*/ uint32 unknown_id2; // possibly an id based on dz type, for expeditions this was same as dz_id (zone|instance) but task dz was different
/*016*/ char description[1]; // variable length, null terminated, max 0x80 (128)
/*000*/ char leader_name[1]; // variable length, null terminated, max 0x40 (64)
};
struct DynamicZoneChooseZone_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 count;
/*008*/ DynamicZoneChooseZoneEntry_Struct choices[0];
};
struct DynamicZoneChooseZoneReply_Struct
{
/*000*/ uint32 unknown000;
/*004*/ uint32 unknown004;
/*008*/ uint32 unknown_id1;
/*012*/ uint16 dz_zone_id;
/*014*/ uint16 dz_instance_id;
/*016*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest
/*020*/ uint32 unknown_id2;
/*024*/ uint32 unknown024;
/*028*/ uint32 unknown028; // always same as unknown040
/*032*/ uint32 unknown032;
/*036*/ uint32 unknown036;
/*040*/ uint32 unknown040; // always same as unknown028
/*044*/ uint32 unknown044;
};
struct LFGuild_SearchPlayer_Struct
+298 -182
View File
@@ -43,7 +43,7 @@ namespace UF
static OpcodeManager *opcodes = nullptr;
static Strategy struct_strategy;
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id, uint8 depth);
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id, uint8 depth);
// server to client inventory location converters
static inline uint32 ServerToUFSlot(uint32 serverSlot);
@@ -59,8 +59,8 @@ namespace UF
// client to server say link converter
static inline void UFToServerSayLink(std::string& serverSayLink, const std::string& ufSayLink);
static inline spells::CastingSlot ServerToUFCastingSlot(EQEmu::spells::CastingSlot slot);
static inline EQEmu::spells::CastingSlot UFToServerCastingSlot(spells::CastingSlot slot);
static inline spells::CastingSlot ServerToUFCastingSlot(EQ::spells::CastingSlot slot);
static inline EQ::spells::CastingSlot UFToServerCastingSlot(spells::CastingSlot slot);
static inline int ServerToUFBuffSlot(int index);
static inline int UFToServerBuffSlot(int index);
@@ -144,9 +144,9 @@ namespace UF
return(r);
}
const EQEmu::versions::ClientVersion Strategy::ClientVersion() const
const EQ::versions::ClientVersion Strategy::ClientVersion() const
{
return EQEmu::versions::ClientVersion::UF;
return EQ::versions::ClientVersion::UF;
}
#include "ss_define.h"
@@ -501,24 +501,24 @@ namespace UF
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
int item_count = in->size / sizeof(EQ::InternalSerializedItem_Struct);
if (!item_count || (in->size % sizeof(EQ::InternalSerializedItem_Struct)) != 0) {
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQ::InternalSerializedItem_Struct));
delete in;
return;
}
EQEmu::InternalSerializedItem_Struct* eq = (EQEmu::InternalSerializedItem_Struct*)in->pBuffer;
EQ::InternalSerializedItem_Struct* eq = (EQ::InternalSerializedItem_Struct*)in->pBuffer;
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
EQ::OutBuffer ob;
EQ::OutBuffer::pos_type last_pos = ob.tellp();
ob.write((const char*)&item_count, sizeof(uint32));
for (int index = 0; index < item_count; ++index, ++eq) {
SerializeItem(ob, (const EQEmu::ItemInstance*)eq->inst, eq->slot_id, 0);
SerializeItem(ob, (const EQ::ItemInstance*)eq->inst, eq->slot_id, 0);
if (ob.tellp() == last_pos)
LogNetcode("UF::ENCODE(OP_CharInventory) Serialization failed on item slot [{}] during OP_CharInventory. Item skipped", eq->slot_id);
@@ -613,14 +613,48 @@ namespace UF
FINISH_ENCODE();
}
ENCODE(OP_DzChooseZone)
{
SETUP_VAR_ENCODE(DynamicZoneChooseZone_Struct);
SerializeBuffer buf;
buf.WriteUInt32(emu->client_id);
buf.WriteUInt32(emu->count);
for (uint32 i = 0; i < emu->count; ++i)
{
buf.WriteUInt16(emu->choices[i].dz_zone_id);
buf.WriteUInt16(emu->choices[i].dz_instance_id);
buf.WriteUInt32(emu->choices[i].unknown_id1);
buf.WriteUInt32(emu->choices[i].dz_type);
buf.WriteUInt32(emu->choices[i].unknown_id2);
buf.WriteString(emu->choices[i].description);
buf.WriteString(emu->choices[i].leader_name);
}
__packet->size = buf.size();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
FINISH_ENCODE();
}
ENCODE(OP_DzCompass)
{
SETUP_VAR_ENCODE(ExpeditionCompass_Struct);
ALLOC_VAR_ENCODE(structs::ExpeditionCompass_Struct, sizeof(structs::ExpeditionInfo_Struct) + sizeof(structs::ExpeditionCompassEntry_Struct) * emu->count);
SETUP_VAR_ENCODE(DynamicZoneCompass_Struct);
ALLOC_VAR_ENCODE(structs::DynamicZoneCompass_Struct,
sizeof(structs::DynamicZoneCompass_Struct) +
sizeof(structs::DynamicZoneCompassEntry_Struct) * emu->count
);
OUT(client_id);
OUT(count);
for (uint32 i = 0; i < emu->count; ++i)
{
OUT(entries[i].dz_zone_id);
OUT(entries[i].dz_instance_id);
OUT(entries[i].dz_type);
OUT(entries[i].x);
OUT(entries[i].y);
OUT(entries[i].z);
@@ -644,81 +678,60 @@ namespace UF
ENCODE_LENGTH_EXACT(ExpeditionInfo_Struct);
SETUP_DIRECT_ENCODE(ExpeditionInfo_Struct, structs::ExpeditionInfo_Struct);
OUT(client_id);
OUT(assigned);
OUT(max_players);
eq->unknown004 = 785316192;
eq->unknown008 = 435601;
strcpy(eq->expedition_name, emu->expedition_name);
strcpy(eq->leader_name, emu->leader_name);
strn0cpy(eq->expedition_name, emu->expedition_name, sizeof(eq->expedition_name));
strn0cpy(eq->leader_name, emu->leader_name, sizeof(eq->leader_name));
FINISH_ENCODE();
}
ENCODE(OP_DzExpeditionList)
ENCODE(OP_DzExpeditionInvite)
{
SETUP_VAR_ENCODE(ExpeditionLockoutList_Struct);
ENCODE_LENGTH_EXACT(ExpeditionInvite_Struct);
SETUP_DIRECT_ENCODE(ExpeditionInvite_Struct, structs::ExpeditionInvite_Struct);
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
uint32 client_id = 0;
uint8 null_term = 0;
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&emu->count, sizeof(uint32));
OUT(client_id);
strn0cpy(eq->inviter_name, emu->inviter_name, sizeof(eq->inviter_name));
strn0cpy(eq->expedition_name, emu->expedition_name, sizeof(eq->expedition_name));
OUT(swapping);
strn0cpy(eq->swap_name, emu->swap_name, sizeof(eq->swap_name));
OUT(dz_zone_id);
OUT(dz_instance_id);
FINISH_ENCODE();
}
ENCODE(OP_DzExpeditionLockoutTimers)
{
SETUP_VAR_ENCODE(ExpeditionLockoutTimers_Struct);
SerializeBuffer buf;
buf.WriteUInt32(emu->client_id);
buf.WriteUInt32(emu->count);
for (uint32 i = 0; i < emu->count; ++i)
{
ss.write(emu->entries[i].expedition, strlen(emu->entries[i].expedition));
ss.write((const char*)&null_term, sizeof(char));
ss.write((const char*)&emu->entries[i].time_left, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write(emu->entries[i].expedition_event, strlen(emu->entries[i].expedition_event));
ss.write((const char*)&null_term, sizeof(char));
buf.WriteString(emu->timers[i].expedition_name);
buf.WriteUInt32(emu->timers[i].seconds_remaining);
buf.WriteInt32(emu->timers[i].event_type);
buf.WriteString(emu->timers[i].event_name);
}
__packet->size = ss.str().length();
__packet->size = buf.size();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
FINISH_ENCODE();
}
ENCODE(OP_DzJoinExpeditionConfirm)
ENCODE(OP_DzSetLeaderName)
{
ENCODE_LENGTH_EXACT(ExpeditionJoinPrompt_Struct);
SETUP_DIRECT_ENCODE(ExpeditionJoinPrompt_Struct, structs::ExpeditionJoinPrompt_Struct);
ENCODE_LENGTH_EXACT(ExpeditionSetLeaderName_Struct);
SETUP_DIRECT_ENCODE(ExpeditionSetLeaderName_Struct, structs::ExpeditionSetLeaderName_Struct);
strcpy(eq->expedition_name, emu->expedition_name);
strcpy(eq->player_name, emu->player_name);
FINISH_ENCODE();
}
ENCODE(OP_DzLeaderStatus)
{
SETUP_VAR_ENCODE(ExpeditionLeaderSet_Struct);
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
uint32 client_id = 0;
uint8 null_term = 0;
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write(emu->leader_name, strlen(emu->leader_name));
ss.write((const char*)&null_term, sizeof(char));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));//0xffffffff
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&client_id, sizeof(uint32));//1
ss.write((const char*)&client_id, sizeof(uint32));
__packet->size = ss.str().length();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
OUT(client_id);
strn0cpy(eq->leader_name, emu->leader_name, sizeof(eq->leader_name));
FINISH_ENCODE();
}
@@ -727,26 +740,43 @@ namespace UF
{
SETUP_VAR_ENCODE(ExpeditionMemberList_Struct);
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
uint32 client_id = 0;
uint8 null_term = 0;
ss.write((const char*)&client_id, sizeof(uint32));
ss.write((const char*)&emu->count, sizeof(uint32));
for (uint32 i = 0; i < emu->count; ++i)
SerializeBuffer buf;
buf.WriteUInt32(emu->client_id);
buf.WriteUInt32(emu->member_count);
for (uint32 i = 0; i < emu->member_count; ++i)
{
ss.write(emu->entries[i].name, strlen(emu->entries[i].name));
ss.write((const char*)&null_term, sizeof(char));
ss.write((const char*)&emu->entries[i].status, sizeof(char));
buf.WriteString(emu->members[i].name);
buf.WriteUInt8(emu->members[i].expedition_status);
}
__packet->size = ss.str().length();
__packet->size = buf.size();
__packet->pBuffer = new unsigned char[__packet->size];
memcpy(__packet->pBuffer, ss.str().c_str(), __packet->size);
memcpy(__packet->pBuffer, buf.buffer(), __packet->size);
FINISH_ENCODE();
}
ENCODE(OP_DzMemberListName)
{
ENCODE_LENGTH_EXACT(ExpeditionMemberListName_Struct);
SETUP_DIRECT_ENCODE(ExpeditionMemberListName_Struct, structs::ExpeditionMemberListName_Struct);
OUT(client_id);
OUT(add_name);
strn0cpy(eq->name, emu->name, sizeof(eq->name));
FINISH_ENCODE();
}
ENCODE(OP_DzMemberListStatus)
{
auto emu = reinterpret_cast<ExpeditionMemberList_Struct*>((*p)->pBuffer);
if (emu->member_count == 1)
{
ENCODE_FORWARD(OP_DzMemberList);
}
}
ENCODE(OP_Emote)
{
EQApplicationPacket *in = *p;
@@ -1268,14 +1298,14 @@ namespace UF
//store away the emu struct
uchar* __emu_buffer = in->pBuffer;
EQEmu::InternalSerializedItem_Struct* int_struct = (EQEmu::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQ::InternalSerializedItem_Struct* int_struct = (EQ::InternalSerializedItem_Struct*)(&__emu_buffer[4]);
EQEmu::OutBuffer ob;
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
EQ::OutBuffer ob;
EQ::OutBuffer::pos_type last_pos = ob.tellp();
ob.write((const char*)__emu_buffer, 4);
SerializeItem(ob, (const EQEmu::ItemInstance*)int_struct->inst, int_struct->slot_id, 0);
SerializeItem(ob, (const EQ::ItemInstance*)int_struct->inst, int_struct->slot_id, 0);
if (ob.tellp() == last_pos) {
LogNetcode("UF::ENCODE(OP_ItemPacket) Serialization failed on item slot [{}]", int_struct->slot_id);
delete in;
@@ -1577,6 +1607,7 @@ namespace UF
OUT(FastRegenHP);
OUT(FastRegenMana);
OUT(FastRegenEndurance);
OUT(underworld_teleport_index);
eq->FogDensity = emu->fog_density;
@@ -1693,7 +1724,7 @@ namespace UF
OUT(hairstyle);
OUT(beard);
// OUT(unknown00178[10]);
for (r = EQEmu::textures::textureBegin; r < EQEmu::textures::materialCount; r++) {
for (r = EQ::textures::textureBegin; r < EQ::textures::materialCount; r++) {
eq->equipment.Slot[r].Material = emu->item_material.Slot[r].Material;
eq->equipment.Slot[r].Unknown1 = 0;
eq->equipment.Slot[r].EliteMaterial = 0;
@@ -1725,7 +1756,7 @@ namespace UF
OUT(face);
// OUT(unknown02264[47]);
if (spells::SPELLBOOK_SIZE <= EQEmu::spells::SPELLBOOK_SIZE) {
if (spells::SPELLBOOK_SIZE <= EQ::spells::SPELLBOOK_SIZE) {
for (uint32 r = 0; r < spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
eq->spell_book[r] = emu->spell_book[r];
@@ -1734,14 +1765,14 @@ namespace UF
}
}
else {
for (uint32 r = 0; r < EQEmu::spells::SPELLBOOK_SIZE; r++) {
for (uint32 r = 0; r < EQ::spells::SPELLBOOK_SIZE; r++) {
if (emu->spell_book[r] <= spells::SPELL_ID_MAX)
eq->spell_book[r] = emu->spell_book[r];
else
eq->spell_book[r] = 0xFFFFFFFFU;
}
// invalidate the rest of the spellbook slots
memset(&eq->spell_book[EQEmu::spells::SPELLBOOK_SIZE], 0xFF, (sizeof(uint32) * (spells::SPELLBOOK_SIZE - EQEmu::spells::SPELLBOOK_SIZE)));
memset(&eq->spell_book[EQ::spells::SPELLBOOK_SIZE], 0xFF, (sizeof(uint32) * (spells::SPELLBOOK_SIZE - EQ::spells::SPELLBOOK_SIZE)));
}
// OUT(unknown4184[128]);
@@ -1797,7 +1828,7 @@ namespace UF
// OUT(unknown06160[4]);
// Copy bandoliers where server and client indices converge
for (r = 0; r < EQEmu::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
for (r = 0; r < EQ::profile::BANDOLIERS_SIZE && r < profile::BANDOLIERS_SIZE; ++r) {
OUT_str(bandoliers[r].Name);
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
OUT(bandoliers[r].Items[k].ID);
@@ -1806,7 +1837,7 @@ namespace UF
}
}
// Nullify bandoliers where server and client indices diverge, with a client bias
for (r = EQEmu::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
for (r = EQ::profile::BANDOLIERS_SIZE; r < profile::BANDOLIERS_SIZE; ++r) {
eq->bandoliers[r].Name[0] = '\0';
for (uint32 k = 0; k < profile::BANDOLIER_ITEM_COUNT; ++k) { // Will need adjusting if 'server != client' is ever true
eq->bandoliers[r].Items[k].ID = 0;
@@ -1818,13 +1849,13 @@ namespace UF
// OUT(unknown07444[5120]);
// Copy potion belt where server and client indices converge
for (r = 0; r < EQEmu::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
for (r = 0; r < EQ::profile::POTION_BELT_SIZE && r < profile::POTION_BELT_SIZE; ++r) {
OUT(potionbelt.Items[r].ID);
OUT(potionbelt.Items[r].Icon);
OUT_str(potionbelt.Items[r].Name);
}
// Nullify potion belt where server and client indices diverge, with a client bias
for (r = EQEmu::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
for (r = EQ::profile::POTION_BELT_SIZE; r < profile::POTION_BELT_SIZE; ++r) {
eq->potionbelt.Items[r].ID = 0;
eq->potionbelt.Items[r].Icon = 0;
eq->potionbelt.Items[r].Name[0] = '\0';
@@ -2196,7 +2227,7 @@ namespace UF
eq_cse->HairColor = emu_cse->HairColor;
eq_cse->Face = emu_cse->Face;
for (int equip_index = EQEmu::textures::textureBegin; equip_index < EQEmu::textures::materialCount; equip_index++) {
for (int equip_index = EQ::textures::textureBegin; equip_index < EQ::textures::materialCount; equip_index++) {
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteModel;
@@ -2755,7 +2786,7 @@ namespace UF
float SpawnSize = emu->size;
if (!((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522)))
{
PacketSize -= (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
PacketSize -= (sizeof(structs::Texture_Struct) * EQ::textures::materialCount);
if (emu->size == 0)
{
@@ -2954,7 +2985,7 @@ namespace UF
if ((emu->NPC == 0) || (emu->race <= 12) || (emu->race == 128) || (emu->race == 130) || (emu->race == 330) || (emu->race == 522))
{
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; ++k)
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; ++k)
{
{
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->equipment_tint.Slot[k].Color);
@@ -2990,7 +3021,7 @@ namespace UF
{
structs::Texture_Struct *Equipment = (structs::Texture_Struct *)Buffer;
for (k = EQEmu::textures::textureBegin; k < EQEmu::textures::materialCount; k++) {
for (k = EQ::textures::textureBegin; k < EQ::textures::materialCount; k++) {
if (emu->equipment.Slot[k].Material > 99999) {
Equipment[k].Material = 63;
} else {
@@ -3000,7 +3031,7 @@ namespace UF
Equipment[k].EliteMaterial = emu->equipment.Slot[k].EliteModel;
}
Buffer += (sizeof(structs::Texture_Struct) * EQEmu::textures::materialCount);
Buffer += (sizeof(structs::Texture_Struct) * EQ::textures::materialCount);
}
if (strlen(emu->title))
{
@@ -3314,6 +3345,84 @@ namespace UF
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzAddPlayer)
{
DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
strn0cpy(emu->name, eq->name, sizeof(emu->name));
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzChooseZoneReply)
{
DECODE_LENGTH_EXACT(structs::DynamicZoneChooseZoneReply_Struct);
SETUP_DIRECT_DECODE(DynamicZoneChooseZoneReply_Struct, structs::DynamicZoneChooseZoneReply_Struct);
IN(unknown000);
IN(unknown004);
IN(unknown008);
IN(unknown_id1);
IN(dz_zone_id);
IN(dz_instance_id);
IN(dz_type);
IN(unknown_id2);
IN(unknown028);
IN(unknown032);
IN(unknown036);
IN(unknown040);
IN(unknown044);
IN(unknown048);
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzExpeditionInviteResponse)
{
DECODE_LENGTH_EXACT(structs::ExpeditionInviteResponse_Struct);
SETUP_DIRECT_DECODE(ExpeditionInviteResponse_Struct, structs::ExpeditionInviteResponse_Struct);
IN(dz_zone_id);
IN(dz_instance_id);
IN(accepted);
IN(swapping);
strn0cpy(emu->swap_name, eq->swap_name, sizeof(emu->swap_name));
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzMakeLeader)
{
DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
strn0cpy(emu->name, eq->name, sizeof(emu->name));
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzRemovePlayer)
{
DECODE_LENGTH_EXACT(structs::ExpeditionCommand_Struct);
SETUP_DIRECT_DECODE(ExpeditionCommand_Struct, structs::ExpeditionCommand_Struct);
strn0cpy(emu->name, eq->name, sizeof(emu->name));
FINISH_DIRECT_DECODE();
}
DECODE(OP_DzSwapPlayer)
{
DECODE_LENGTH_EXACT(structs::ExpeditionCommandSwap_Struct);
SETUP_DIRECT_DECODE(ExpeditionCommandSwap_Struct, structs::ExpeditionCommandSwap_Struct);
strn0cpy(emu->add_player_name, eq->add_player_name, sizeof(emu->add_player_name));
strn0cpy(emu->rem_player_name, eq->rem_player_name, sizeof(emu->rem_player_name));
FINISH_DIRECT_DECODE();
}
DECODE(OP_Emote)
{
unsigned char *__eq_buffer = __packet->pBuffer;
@@ -3498,7 +3607,7 @@ namespace UF
DECODE_LENGTH_EXACT(structs::LoadSpellSet_Struct);
SETUP_DIRECT_DECODE(LoadSpellSet_Struct, structs::LoadSpellSet_Struct);
for (unsigned int i = 0; i < EQEmu::spells::SPELL_GEM_COUNT; ++i)
for (unsigned int i = 0; i < EQ::spells::SPELL_GEM_COUNT; ++i)
if (eq->spell[i] == 0)
emu->spell[i] = 0xFFFFFFFF;
else
@@ -3737,9 +3846,9 @@ namespace UF
return NextItemInstSerialNumber;
}
void SerializeItem(EQEmu::OutBuffer& ob, const EQEmu::ItemInstance *inst, int16 slot_id_in, uint8 depth)
void SerializeItem(EQ::OutBuffer& ob, const EQ::ItemInstance *inst, int16 slot_id_in, uint8 depth)
{
const EQEmu::ItemData *item = inst->GetUnscaledItem();
const EQ::ItemData *item = inst->GetUnscaledItem();
UF::structs::ItemSerializationHeader hdr;
@@ -3783,7 +3892,7 @@ namespace UF
int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
uint16 ornaIcon = 0;
if (inst->GetOrnamentationAug(ornamentationAugtype)) {
const EQEmu::ItemData *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
const EQ::ItemData *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
ornaIcon = aug_weap->Icon;
ob.write(aug_weap->IDFile, strlen(aug_weap->IDFile));
@@ -3966,6 +4075,12 @@ namespace UF
itbs.no_transfer = item->NoTransfer;
itbs.expendablearrow = item->ExpendableArrow;
// Done to hack older clients to label expendable fishing poles as such
// July 28th, 2018 patch
if (item->ItemType == EQ::item::ItemTypeFishingPole && item->SubType == 0) {
itbs.expendablearrow = 1;
}
ob.write((const char*)&itbs, sizeof(UF::structs::ItemTertiaryBodyStruct));
// Effect Structures Broken down to allow variable length strings for effect names
@@ -4106,33 +4221,34 @@ namespace UF
iqbs.HealAmt = item->HealAmt;
iqbs.SpellDmg = item->SpellDmg;
iqbs.Clairvoyance = item->Clairvoyance;
iqbs.SubType = item->SubType;
ob.write((const char*)&iqbs, sizeof(UF::structs::ItemQuaternaryBodyStruct));
EQEmu::OutBuffer::pos_type count_pos = ob.tellp();
EQ::OutBuffer::pos_type count_pos = ob.tellp();
uint32 subitem_count = 0;
ob.write((const char*)&subitem_count, sizeof(uint32));
// moved outside of loop since it is not modified within that scope
int16 SubSlotNumber = EQEmu::invbag::SLOT_INVALID;
int16 SubSlotNumber = EQ::invbag::SLOT_INVALID;
if (slot_id_in <= EQEmu::invslot::slotGeneral8 && slot_id_in >= EQEmu::invslot::GENERAL_BEGIN)
SubSlotNumber = EQEmu::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::GENERAL_BEGIN) * EQEmu::invbag::SLOT_COUNT);
else if (slot_id_in <= EQEmu::invslot::GENERAL_END && slot_id_in >= EQEmu::invslot::slotGeneral9)
SubSlotNumber = EQEmu::invbag::SLOT_INVALID;
else if (slot_id_in == EQEmu::invslot::slotCursor)
SubSlotNumber = EQEmu::invbag::CURSOR_BAG_BEGIN;
else if (slot_id_in <= EQEmu::invslot::BANK_END && slot_id_in >= EQEmu::invslot::BANK_BEGIN)
SubSlotNumber = EQEmu::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
else if (slot_id_in <= EQEmu::invslot::SHARED_BANK_END && slot_id_in >= EQEmu::invslot::SHARED_BANK_BEGIN)
SubSlotNumber = EQEmu::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQEmu::invslot::SHARED_BANK_BEGIN) * EQEmu::invbag::SLOT_COUNT);
if (slot_id_in <= EQ::invslot::slotGeneral8 && slot_id_in >= EQ::invslot::GENERAL_BEGIN)
SubSlotNumber = EQ::invbag::GENERAL_BAGS_BEGIN + ((slot_id_in - EQ::invslot::GENERAL_BEGIN) * EQ::invbag::SLOT_COUNT);
else if (slot_id_in <= EQ::invslot::GENERAL_END && slot_id_in >= EQ::invslot::slotGeneral9)
SubSlotNumber = EQ::invbag::SLOT_INVALID;
else if (slot_id_in == EQ::invslot::slotCursor)
SubSlotNumber = EQ::invbag::CURSOR_BAG_BEGIN;
else if (slot_id_in <= EQ::invslot::BANK_END && slot_id_in >= EQ::invslot::BANK_BEGIN)
SubSlotNumber = EQ::invbag::BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
else if (slot_id_in <= EQ::invslot::SHARED_BANK_END && slot_id_in >= EQ::invslot::SHARED_BANK_BEGIN)
SubSlotNumber = EQ::invbag::SHARED_BANK_BAGS_BEGIN + ((slot_id_in - EQ::invslot::SHARED_BANK_BEGIN) * EQ::invbag::SLOT_COUNT);
else
SubSlotNumber = slot_id_in; // not sure if this is the best way to handle this..leaving for now
if (SubSlotNumber != EQEmu::invbag::SLOT_INVALID) {
for (uint32 index = EQEmu::invbag::SLOT_BEGIN; index <= EQEmu::invbag::SLOT_END; ++index) {
EQEmu::ItemInstance* sub = inst->GetItem(index);
if (SubSlotNumber != EQ::invbag::SLOT_INVALID) {
for (uint32 index = EQ::invbag::SLOT_BEGIN; index <= EQ::invbag::SLOT_END; ++index) {
EQ::ItemInstance* sub = inst->GetItem(index);
if (!sub)
continue;
@@ -4151,59 +4267,59 @@ namespace UF
{
uint32 UFSlot = invslot::SLOT_INVALID;
if (serverSlot <= EQEmu::invslot::slotGeneral8) {
if (serverSlot <= EQ::invslot::slotGeneral8) {
UFSlot = serverSlot;
}
else if (serverSlot <= EQEmu::invslot::CORPSE_END && serverSlot >= EQEmu::invslot::slotCursor) {
else if (serverSlot <= EQ::invslot::CORPSE_END && serverSlot >= EQ::invslot::slotCursor) {
UFSlot = serverSlot - 2;
}
else if (serverSlot <= EQEmu::invbag::GENERAL_BAGS_8_END && serverSlot >= EQEmu::invbag::GENERAL_BAGS_BEGIN) {
else if (serverSlot <= EQ::invbag::GENERAL_BAGS_8_END && serverSlot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
UFSlot = serverSlot + 11;
}
else if (serverSlot <= EQEmu::invbag::CURSOR_BAG_END && serverSlot >= EQEmu::invbag::CURSOR_BAG_BEGIN) {
else if (serverSlot <= EQ::invbag::CURSOR_BAG_END && serverSlot >= EQ::invbag::CURSOR_BAG_BEGIN) {
UFSlot = serverSlot - 9;
}
else if (serverSlot <= EQEmu::invslot::TRIBUTE_END && serverSlot >= EQEmu::invslot::TRIBUTE_BEGIN) {
else if (serverSlot <= EQ::invslot::TRIBUTE_END && serverSlot >= EQ::invslot::TRIBUTE_BEGIN) {
UFSlot = serverSlot;
}
else if (serverSlot <= EQEmu::invslot::GUILD_TRIBUTE_END && serverSlot >= EQEmu::invslot::GUILD_TRIBUTE_BEGIN) {
else if (serverSlot <= EQ::invslot::GUILD_TRIBUTE_END && serverSlot >= EQ::invslot::GUILD_TRIBUTE_BEGIN) {
UFSlot = serverSlot;
}
else if (serverSlot == EQEmu::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
else if (serverSlot == EQ::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE) {
UFSlot = serverSlot;
}
else if (serverSlot <= EQEmu::invslot::BANK_END && serverSlot >= EQEmu::invslot::BANK_BEGIN) {
else if (serverSlot <= EQ::invslot::BANK_END && serverSlot >= EQ::invslot::BANK_BEGIN) {
UFSlot = serverSlot;
}
else if (serverSlot <= EQEmu::invbag::BANK_BAGS_END && serverSlot >= EQEmu::invbag::BANK_BAGS_BEGIN) {
else if (serverSlot <= EQ::invbag::BANK_BAGS_END && serverSlot >= EQ::invbag::BANK_BAGS_BEGIN) {
UFSlot = serverSlot + 1;
}
else if (serverSlot <= EQEmu::invslot::SHARED_BANK_END && serverSlot >= EQEmu::invslot::SHARED_BANK_BEGIN) {
else if (serverSlot <= EQ::invslot::SHARED_BANK_END && serverSlot >= EQ::invslot::SHARED_BANK_BEGIN) {
UFSlot = serverSlot;
}
else if (serverSlot <= EQEmu::invbag::SHARED_BANK_BAGS_END && serverSlot >= EQEmu::invbag::SHARED_BANK_BAGS_BEGIN) {
else if (serverSlot <= EQ::invbag::SHARED_BANK_BAGS_END && serverSlot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
UFSlot = serverSlot + 1;
}
else if (serverSlot <= EQEmu::invslot::TRADE_END && serverSlot >= EQEmu::invslot::TRADE_BEGIN) {
else if (serverSlot <= EQ::invslot::TRADE_END && serverSlot >= EQ::invslot::TRADE_BEGIN) {
UFSlot = serverSlot;
}
else if (serverSlot <= EQEmu::invbag::TRADE_BAGS_END && serverSlot >= EQEmu::invbag::TRADE_BAGS_BEGIN) {
else if (serverSlot <= EQ::invbag::TRADE_BAGS_END && serverSlot >= EQ::invbag::TRADE_BAGS_BEGIN) {
UFSlot = serverSlot;
}
else if (serverSlot <= EQEmu::invslot::WORLD_END && serverSlot >= EQEmu::invslot::WORLD_BEGIN) {
else if (serverSlot <= EQ::invslot::WORLD_END && serverSlot >= EQ::invslot::WORLD_BEGIN) {
UFSlot = serverSlot;
}
@@ -4216,11 +4332,11 @@ namespace UF
{
uint32 UFSlot = invslot::SLOT_INVALID;
if (serverCorpseSlot <= EQEmu::invslot::slotGeneral8 && serverCorpseSlot >= EQEmu::invslot::slotGeneral1) {
if (serverCorpseSlot <= EQ::invslot::slotGeneral8 && serverCorpseSlot >= EQ::invslot::slotGeneral1) {
UFSlot = serverCorpseSlot;
}
else if (serverCorpseSlot <= EQEmu::invslot::CORPSE_END && serverCorpseSlot >= EQEmu::invslot::slotCursor) {
else if (serverCorpseSlot <= EQ::invslot::CORPSE_END && serverCorpseSlot >= EQ::invslot::slotCursor) {
UFSlot = serverCorpseSlot - 2;
}
@@ -4231,7 +4347,7 @@ namespace UF
static inline uint32 UFToServerSlot(uint32 ufSlot)
{
uint32 ServerSlot = EQEmu::invslot::SLOT_INVALID;
uint32 ServerSlot = EQ::invslot::SLOT_INVALID;
if (ufSlot <= invslot::slotGeneral8) {
ServerSlot = ufSlot;
@@ -4296,7 +4412,7 @@ namespace UF
static inline uint32 UFToServerCorpseSlot(uint32 ufCorpseSlot)
{
uint32 ServerSlot = EQEmu::invslot::SLOT_INVALID;
uint32 ServerSlot = EQ::invslot::SLOT_INVALID;
if (ufCorpseSlot <= invslot::slotGeneral8 && ufCorpseSlot >= invslot::slotGeneral1) {
ServerSlot = ufCorpseSlot;
@@ -4313,7 +4429,7 @@ namespace UF
static inline void ServerToUFSayLink(std::string& ufSayLink, const std::string& serverSayLink)
{
if ((constants::SAY_LINK_BODY_SIZE == EQEmu::constants::SAY_LINK_BODY_SIZE) || (serverSayLink.find('\x12') == std::string::npos)) {
if ((constants::SAY_LINK_BODY_SIZE == EQ::constants::SAY_LINK_BODY_SIZE) || (serverSayLink.find('\x12') == std::string::npos)) {
ufSayLink = serverSayLink;
return;
}
@@ -4322,7 +4438,7 @@ namespace UF
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::constants::SAY_LINK_BODY_SIZE) {
if (segments[segment_iter].length() <= EQ::constants::SAY_LINK_BODY_SIZE) {
ufSayLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
@@ -4353,7 +4469,7 @@ namespace UF
static inline void UFToServerSayLink(std::string& serverSayLink, const std::string& ufSayLink)
{
if ((EQEmu::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (ufSayLink.find('\x12') == std::string::npos)) {
if ((EQ::constants::SAY_LINK_BODY_SIZE == constants::SAY_LINK_BODY_SIZE) || (ufSayLink.find('\x12') == std::string::npos)) {
serverSayLink = ufSayLink;
return;
}
@@ -4387,92 +4503,92 @@ namespace UF
}
}
static inline spells::CastingSlot ServerToUFCastingSlot(EQEmu::spells::CastingSlot slot)
static inline spells::CastingSlot ServerToUFCastingSlot(EQ::spells::CastingSlot slot)
{
switch (slot) {
case EQEmu::spells::CastingSlot::Gem1:
case EQ::spells::CastingSlot::Gem1:
return spells::CastingSlot::Gem1;
case EQEmu::spells::CastingSlot::Gem2:
case EQ::spells::CastingSlot::Gem2:
return spells::CastingSlot::Gem2;
case EQEmu::spells::CastingSlot::Gem3:
case EQ::spells::CastingSlot::Gem3:
return spells::CastingSlot::Gem3;
case EQEmu::spells::CastingSlot::Gem4:
case EQ::spells::CastingSlot::Gem4:
return spells::CastingSlot::Gem4;
case EQEmu::spells::CastingSlot::Gem5:
case EQ::spells::CastingSlot::Gem5:
return spells::CastingSlot::Gem5;
case EQEmu::spells::CastingSlot::Gem6:
case EQ::spells::CastingSlot::Gem6:
return spells::CastingSlot::Gem6;
case EQEmu::spells::CastingSlot::Gem7:
case EQ::spells::CastingSlot::Gem7:
return spells::CastingSlot::Gem7;
case EQEmu::spells::CastingSlot::Gem8:
case EQ::spells::CastingSlot::Gem8:
return spells::CastingSlot::Gem8;
case EQEmu::spells::CastingSlot::Gem9:
case EQ::spells::CastingSlot::Gem9:
return spells::CastingSlot::Gem9;
case EQEmu::spells::CastingSlot::Gem10:
case EQ::spells::CastingSlot::Gem10:
return spells::CastingSlot::Gem10;
case EQEmu::spells::CastingSlot::Gem11:
case EQ::spells::CastingSlot::Gem11:
return spells::CastingSlot::Gem11;
case EQEmu::spells::CastingSlot::Gem12:
case EQ::spells::CastingSlot::Gem12:
return spells::CastingSlot::Gem12;
case EQEmu::spells::CastingSlot::Item:
case EQEmu::spells::CastingSlot::PotionBelt:
case EQ::spells::CastingSlot::Item:
case EQ::spells::CastingSlot::PotionBelt:
return spells::CastingSlot::Item;
case EQEmu::spells::CastingSlot::Discipline:
case EQ::spells::CastingSlot::Discipline:
return spells::CastingSlot::Discipline;
case EQEmu::spells::CastingSlot::AltAbility:
case EQ::spells::CastingSlot::AltAbility:
return spells::CastingSlot::AltAbility;
default: // we shouldn't have any issues with other slots ... just return something
return spells::CastingSlot::Discipline;
}
}
static inline EQEmu::spells::CastingSlot UFToServerCastingSlot(spells::CastingSlot slot)
static inline EQ::spells::CastingSlot UFToServerCastingSlot(spells::CastingSlot slot)
{
switch (slot) {
case spells::CastingSlot::Gem1:
return EQEmu::spells::CastingSlot::Gem1;
return EQ::spells::CastingSlot::Gem1;
case spells::CastingSlot::Gem2:
return EQEmu::spells::CastingSlot::Gem2;
return EQ::spells::CastingSlot::Gem2;
case spells::CastingSlot::Gem3:
return EQEmu::spells::CastingSlot::Gem3;
return EQ::spells::CastingSlot::Gem3;
case spells::CastingSlot::Gem4:
return EQEmu::spells::CastingSlot::Gem4;
return EQ::spells::CastingSlot::Gem4;
case spells::CastingSlot::Gem5:
return EQEmu::spells::CastingSlot::Gem5;
return EQ::spells::CastingSlot::Gem5;
case spells::CastingSlot::Gem6:
return EQEmu::spells::CastingSlot::Gem6;
return EQ::spells::CastingSlot::Gem6;
case spells::CastingSlot::Gem7:
return EQEmu::spells::CastingSlot::Gem7;
return EQ::spells::CastingSlot::Gem7;
case spells::CastingSlot::Gem8:
return EQEmu::spells::CastingSlot::Gem8;
return EQ::spells::CastingSlot::Gem8;
case spells::CastingSlot::Gem9:
return EQEmu::spells::CastingSlot::Gem9;
return EQ::spells::CastingSlot::Gem9;
case spells::CastingSlot::Gem10:
return EQEmu::spells::CastingSlot::Gem10;
return EQ::spells::CastingSlot::Gem10;
case spells::CastingSlot::Gem11:
return EQEmu::spells::CastingSlot::Gem11;
return EQ::spells::CastingSlot::Gem11;
case spells::CastingSlot::Gem12:
return EQEmu::spells::CastingSlot::Gem12;
return EQ::spells::CastingSlot::Gem12;
case spells::CastingSlot::Discipline:
return EQEmu::spells::CastingSlot::Discipline;
return EQ::spells::CastingSlot::Discipline;
case spells::CastingSlot::Item:
return EQEmu::spells::CastingSlot::Item;
return EQ::spells::CastingSlot::Item;
case spells::CastingSlot::AltAbility:
return EQEmu::spells::CastingSlot::AltAbility;
return EQ::spells::CastingSlot::AltAbility;
default: // we shouldn't have any issues with other slots ... just return something
return EQEmu::spells::CastingSlot::Discipline;
return EQ::spells::CastingSlot::Discipline;
}
}
static inline int ServerToUFBuffSlot(int index)
{
// we're a disc
if (index >= EQEmu::spells::LONG_BUFFS + EQEmu::spells::SHORT_BUFFS)
return index - EQEmu::spells::LONG_BUFFS - EQEmu::spells::SHORT_BUFFS +
if (index >= EQ::spells::LONG_BUFFS + EQ::spells::SHORT_BUFFS)
return index - EQ::spells::LONG_BUFFS - EQ::spells::SHORT_BUFFS +
spells::LONG_BUFFS + spells::SHORT_BUFFS;
// we're a song
if (index >= EQEmu::spells::LONG_BUFFS)
return index - EQEmu::spells::LONG_BUFFS + spells::LONG_BUFFS;
if (index >= EQ::spells::LONG_BUFFS)
return index - EQ::spells::LONG_BUFFS + spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
@@ -4481,11 +4597,11 @@ namespace UF
{
// we're a disc
if (index >= spells::LONG_BUFFS + spells::SHORT_BUFFS)
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQEmu::spells::LONG_BUFFS +
EQEmu::spells::SHORT_BUFFS;
return index - spells::LONG_BUFFS - spells::SHORT_BUFFS + EQ::spells::LONG_BUFFS +
EQ::spells::SHORT_BUFFS;
// we're a song
if (index >= spells::LONG_BUFFS)
return index - spells::LONG_BUFFS + EQEmu::spells::LONG_BUFFS;
return index - spells::LONG_BUFFS + EQ::spells::LONG_BUFFS;
// we're a normal buff
return index; // as long as we guard against bad slots server side, we should be fine
}
+1 -1
View File
@@ -43,7 +43,7 @@ namespace UF
protected:
virtual std::string Describe() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
virtual const EQ::versions::ClientVersion ClientVersion() const;
//magic macro to declare our opcode processors
#include "ss_declare.h"
+15 -15
View File
@@ -31,7 +31,7 @@ namespace UF
const int16 INULL = 0;
namespace inventory {
inline EQEmu::versions::ClientVersion GetInventoryRef() { return EQEmu::versions::ClientVersion::UF; }
inline EQ::versions::ClientVersion GetInventoryRef() { return EQ::versions::ClientVersion::UF; }
const bool ConcatenateInvTypeLimbo = true;
@@ -43,7 +43,7 @@ namespace UF
} /*inventory*/
namespace invtype {
inline EQEmu::versions::ClientVersion GetInvTypeRef() { return EQEmu::versions::ClientVersion::UF; }
inline EQ::versions::ClientVersion GetInvTypeRef() { return EQ::versions::ClientVersion::UF; }
namespace enum_ {
enum InventoryTypes : int16 {
@@ -106,7 +106,7 @@ namespace UF
} /*invtype*/
namespace invslot {
inline EQEmu::versions::ClientVersion GetInvSlotRef() { return EQEmu::versions::ClientVersion::UF; }
inline EQ::versions::ClientVersion GetInvSlotRef() { return EQ::versions::ClientVersion::UF; }
namespace enum_ {
enum InventorySlots : int16 {
@@ -205,7 +205,7 @@ namespace UF
} /*invslot*/
namespace invbag {
inline EQEmu::versions::ClientVersion GetInvBagRef() { return EQEmu::versions::ClientVersion::UF; }
inline EQ::versions::ClientVersion GetInvBagRef() { return EQ::versions::ClientVersion::UF; }
const int16 SLOT_INVALID = IINVALID;
const int16 SLOT_BEGIN = INULL;
@@ -237,7 +237,7 @@ namespace UF
} /*invbag*/
namespace invaug {
inline EQEmu::versions::ClientVersion GetInvAugRef() { return EQEmu::versions::ClientVersion::UF; }
inline EQ::versions::ClientVersion GetInvAugRef() { return EQ::versions::ClientVersion::UF; }
const int16 SOCKET_INVALID = IINVALID;
const int16 SOCKET_BEGIN = INULL;
@@ -249,7 +249,7 @@ namespace UF
} /*invaug*/
namespace item {
inline EQEmu::versions::ClientVersion GetItemRef() { return EQEmu::versions::ClientVersion::UF; }
inline EQ::versions::ClientVersion GetItemRef() { return EQ::versions::ClientVersion::UF; }
enum ItemPacketType : int {
ItemPacketMerchant = 100,
@@ -268,7 +268,7 @@ namespace UF
} /*item*/
namespace profile {
inline EQEmu::versions::ClientVersion GetProfileRef() { return EQEmu::versions::ClientVersion::UF; }
inline EQ::versions::ClientVersion GetProfileRef() { return EQ::versions::ClientVersion::UF; }
const int16 BANDOLIERS_SIZE = 20; // number of bandolier instances
const int16 BANDOLIER_ITEM_COUNT = 4; // number of equipment slots in bandolier instance
@@ -280,11 +280,11 @@ namespace UF
} /*profile*/
namespace constants {
inline EQEmu::versions::ClientVersion GetConstantsRef() { return EQEmu::versions::ClientVersion::UF; }
inline EQ::versions::ClientVersion GetConstantsRef() { return EQ::versions::ClientVersion::UF; }
const EQEmu::expansions::Expansion EXPANSION = EQEmu::expansions::Expansion::UF;
const uint32 EXPANSION_BIT = EQEmu::expansions::bitUF;
const uint32 EXPANSIONS_MASK = EQEmu::expansions::maskUF;
const EQ::expansions::Expansion EXPANSION = EQ::expansions::Expansion::UF;
const uint32 EXPANSION_BIT = EQ::expansions::bitUF;
const uint32 EXPANSIONS_MASK = EQ::expansions::maskUF;
const size_t CHARACTER_CREATION_LIMIT = 12;
@@ -293,21 +293,21 @@ namespace UF
} /*constants*/
namespace behavior {
inline EQEmu::versions::ClientVersion GetBehaviorRef() { return EQEmu::versions::ClientVersion::UF; }
inline EQ::versions::ClientVersion GetBehaviorRef() { return EQ::versions::ClientVersion::UF; }
const bool CoinHasWeight = false;
} /*behavior*/
namespace skills {
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::UF; }
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::UF; }
const size_t LastUsableSkill = EQEmu::skills::SkillTripleAttack;
const size_t LastUsableSkill = EQ::skills::SkillTripleAttack;
} /*skills*/
namespace spells {
inline EQEmu::versions::ClientVersion GetSkillsRef() { return EQEmu::versions::ClientVersion::UF; }
inline EQ::versions::ClientVersion GetSkillsRef() { return EQ::versions::ClientVersion::UF; }
enum class CastingSlot : uint32 {
Gem1 = 0,
+12 -3
View File
@@ -38,13 +38,16 @@ E(OP_Damage)
E(OP_DeleteCharge)
E(OP_DeleteItem)
E(OP_DisciplineUpdate)
E(OP_DzChooseZone)
E(OP_DzCompass)
E(OP_DzExpeditionEndsWarning)
E(OP_DzExpeditionInfo)
E(OP_DzExpeditionList)
E(OP_DzJoinExpeditionConfirm)
E(OP_DzLeaderStatus)
E(OP_DzExpeditionInvite)
E(OP_DzExpeditionLockoutTimers)
E(OP_DzMemberList)
E(OP_DzMemberListName)
E(OP_DzMemberListStatus)
E(OP_DzSetLeaderName)
E(OP_Emote)
E(OP_ExpansionInfo)
E(OP_FormattedMessage)
@@ -120,6 +123,12 @@ D(OP_ConsiderCorpse)
D(OP_Consume)
D(OP_Damage)
D(OP_DeleteItem)
D(OP_DzAddPlayer)
D(OP_DzChooseZoneReply)
D(OP_DzExpeditionInviteResponse)
D(OP_DzMakeLeader)
D(OP_DzRemovePlayer)
D(OP_DzSwapPlayer)
D(OP_Emote)
D(OP_EnvDamage)
D(OP_FaceChange)
+145 -33
View File
@@ -149,7 +149,7 @@ struct TintProfile
Tint_Struct Primary;
Tint_Struct Secondary;
};
Tint_Struct Slot[EQEmu::textures::materialCount];
Tint_Struct Slot[EQ::textures::materialCount];
};
};
@@ -178,7 +178,7 @@ struct TextureProfile
Texture_Struct Primary;
Texture_Struct Secondary;
};
Texture_Struct Slot[EQEmu::textures::materialCount];
Texture_Struct Slot[EQ::textures::materialCount];
};
TextureProfile();
@@ -195,7 +195,7 @@ struct CharacterSelectEntry_Struct
/*0000*/ uint8 Beard; //
/*0001*/ uint8 HairColor; //
/*0000*/ uint8 Face; //
/*0000*/ CharSelectEquip Equip[EQEmu::textures::materialCount];
/*0000*/ CharSelectEquip Equip[EQ::textures::materialCount];
/*0000*/ uint32 PrimaryIDFile; //
/*0000*/ uint32 SecondaryIDFile; //
/*0000*/ uint8 Unknown15; // 0xff
@@ -444,7 +444,11 @@ struct NewZone_Struct {
/*0848*/ int32 unknown848;
/*0852*/ uint16 zone_id;
/*0854*/ uint16 zone_instance;
/*0856*/ char unknown856[20];
/*0856*/ uint32 scriptNPCReceivedanItem;
/*0860*/ uint32 bCheck; // padded bool
/*0864*/ uint32 scriptIDSomething;
/*0868*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
/*0872*/ uint32 scriptIDSomething3;
/*0876*/ uint32 SuspendBuffs;
/*0880*/ uint32 unknown880; //seen 50
/*0884*/ uint32 unknown884; //seen 10
@@ -4215,8 +4219,8 @@ struct ItemQuaternaryBodyStruct
int32 HealAmt;
int32 SpellDmg;
int32 Clairvoyance;
uint8 unknown18; //Power Source Capacity or evolve filename?
uint32 evolve_string; // Some String, but being evolution related is just a guess
int32 SubType;
uint8 evolve_string; // Some String, but being evolution related is just a guess
uint8 unknown19;
uint32 unknown20; // Bard Stuff?
uint32 unknown21;
@@ -4246,52 +4250,160 @@ struct VeteranReward
/*012*/ VeteranRewardItem items[8];
};
struct ExpeditionEntryHeader_Struct
struct ExpeditionInvite_Struct
{
/*000*/ uint32 client_id; // unique character id
/*004*/ uint32 unknown004;
/*008*/ char inviter_name[64];
/*072*/ char expedition_name[128];
/*200*/ uint8 swapping; // 0: adding 1: swapping
/*201*/ char swap_name[64]; // if swapping, swap name being removed
/*265*/ uint8 padding[3];
/*268*/ uint16 dz_zone_id; // dz_id zone/instance pair, sent back in reply
/*270*/ uint16 dz_instance_id;
};
struct ExpeditionInviteResponse_Struct
{
/*000*/ uint32 unknown000;
/*000*/ uint32 number_of_entries;
};
struct ExpeditionJoinPrompt_Struct
{
/*000*/ uint32 clientid;
/*004*/ uint32 unknown004;
/*008*/ char player_name[64];
/*072*/ char expedition_name[64];
};
struct ExpeditionExpireWarning
{
/*000*/ uint32 clientid;
/*004*/ uint32 unknown004;
/*008*/ uint32 minutes_remaining;
/*008*/ uint16 dz_zone_id; // dz_id pair sent in invite
/*010*/ uint16 dz_instance_id;
/*012*/ uint8 accepted; // 0: declined 1: accepted
/*013*/ uint8 swapping; // 0: adding 1: swapping (sent in invite)
/*014*/ char swap_name[64]; // swap name sent in invite
/*078*/ uint8 unknown078; // padding garbage?
/*079*/ uint8 unknown079; // padding garbage?
};
struct ExpeditionInfo_Struct
{
/*000*/ uint32 clientid;
/*000*/ uint32 client_id;
/*004*/ uint32 unknown004;
/*008*/ uint32 unknown008;
/*008*/ uint32 assigned; // padded bool
/*012*/ uint32 max_players;
/*016*/ char expedition_name[128];
/*142*/ char leader_name[64];
/*016*/ char expedition_name[128];
/*144*/ char leader_name[64];
};
struct ExpeditionCompassEntry_Struct
struct ExpeditionMemberEntry_Struct
{
/*000*/ float unknown000; //seen *((uint32*)) = 1584791871
/*004*/ uint32 enabled; //guess
/*008*/ uint32 unknown008; //seen 1019
/*000*/ char name[1]; // variable length, null terminated, max 0x40 (64)
/*000*/ uint8 expedition_status; // 0: unknown 1: Online, 2: Offline, 3: In Dynamic Zone, 4: Link Dead
};
struct ExpeditionMemberList_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 member_count; // number of players in window
/*008*/ ExpeditionMemberEntry_Struct members[0]; // variable length
};
struct ExpeditionMemberListName_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 unknown004;
/*008*/ uint32 add_name; // padded bool, 0: remove name, 1: add name with unknown status
/*012*/ char name[64];
};
struct ExpeditionLockoutTimerEntry_Struct
{
/*000*/ char expedition_name[1]; // variable length, null terminated, max 0x80 (128)
/*000*/ uint32 seconds_remaining;
/*000*/ int32 event_type; // seen -1 (0xffffffff) for replay timers and 1 for event timers
/*000*/ char event_name[1]; // variable length, null terminated, max 0x100 (256)
};
struct ExpeditionLockoutTimers_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 count;
/*008*/ ExpeditionLockoutTimerEntry_Struct timers[0];
};
struct ExpeditionSetLeaderName_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 unknown004;
/*008*/ char leader_name[64];
};
struct ExpeditionCommand_Struct
{
/*000*/ uint32 unknown000;
/*004*/ uint32 unknown004;
/*008*/ char name[64];
};
struct ExpeditionCommandSwap_Struct
{
/*000*/ uint32 unknown000;
/*004*/ uint32 unknown004;
/*008*/ char add_player_name[64]; // swap to (player must confirm)
/*072*/ char rem_player_name[64]; // swap from
};
struct ExpeditionExpireWarning
{
/*000*/ uint32 client_id;
/*004*/ uint32 unknown004;
/*008*/ uint32 minutes_remaining;
};
struct DynamicZoneCompassEntry_Struct
{
/*000*/ uint16 dz_zone_id; // target dz id pair
/*002*/ uint16 dz_instance_id;
/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
/*008*/ uint32 unknown008;
/*012*/ float y;
/*016*/ float x;
/*020*/ float z;
};
struct ExpeditionCompass_Struct
struct DynamicZoneCompass_Struct
{
/*000*/ uint32 clientid;
/*000*/ uint32 client_id;
/*004*/ uint32 count;
/*008*/ ExpeditionCompassEntry_Struct entries[0];
/*008*/ DynamicZoneCompassEntry_Struct entries[0];
};
struct DynamicZoneChooseZoneEntry_Struct
{
/*000*/ uint16 dz_zone_id; // dz_id pair
/*002*/ uint16 dz_instance_id;
/*004*/ uint32 unknown_id1; // sent back in reply
/*008*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest -- sent back in reply
/*012*/ uint32 unknown_id2; // possibly an id based on dz type, for expeditions this was same as dz_id (zone|instance) but task dz was different
/*016*/ char description[1]; // variable length, null terminated, max 0x80 (128)
/*000*/ char leader_name[1]; // variable length, null terminated, max 0x40 (64)
};
struct DynamicZoneChooseZone_Struct
{
/*000*/ uint32 client_id;
/*004*/ uint32 count;
/*008*/ DynamicZoneChooseZoneEntry_Struct choices[0];
};
struct DynamicZoneChooseZoneReply_Struct
{
/*000*/ uint32 unknown000; // ff ff ff ff
/*004*/ uint32 unknown004; // seen 69 00 00 00
/*008*/ uint32 unknown008; // ff ff ff ff
/*012*/ uint32 unknown_id1; // from choose zone entry message
/*016*/ uint16 dz_zone_id; // dz_id pair
/*018*/ uint16 dz_instance_id;
/*020*/ uint32 dz_type; // 1: Expedition, 2: Tutorial, 3: Task, 4: Mission, 5: Quest
/*024*/ uint32 unknown_id2; // from choose zone entry message
/*028*/ uint32 unknown028; // 00 00 00 00
/*032*/ uint32 unknown032; // always same as unknown044
/*036*/ uint32 unknown036;
/*040*/ uint32 unknown040;
/*044*/ uint32 unknown044; // always same as unknown032
/*048*/ uint32 unknown048; // seen 01 00 00 00 and 02 00 00 00
};
struct AltCurrencySelectItem_Struct {

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