Compare commits

..

2537 Commits

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Misc updates:
Exported some variables to perl, including:

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

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

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

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

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

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

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

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

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

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

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

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

OP_WeaponEquip2 and OP_WeaponUnequip2 renamed to OP_PlayerStateAdd
and OP_PlayerStateRemove

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

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

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

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

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

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

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

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

Test case target a corpse and /ttell it :P
2015-02-11 13:20:32 -05:00
KayenEQ 7f65080c45 Merge pull request #373 from KayenEQ/Development
numhits issue fix
2015-02-10 23:25:16 -05:00
KayenEQ c8acb7bd43 numhits issue fix 2015-02-10 23:24:41 -05:00
Trevius 69d727cbe5 (SoF+) Removed duplicate packets being sent to client on zone (Take #2)! 2015-02-10 19:22:42 -06:00
KimLS 9daf572ea7 Fix for no factions in database crashing the server and shared memory 2015-02-10 11:53:39 -08:00
Michael Cook (mackal) f613d12c61 Revert "(SoF+) Removed duplicate packets being sent to client on zone."
This reverts commit e6eb4e16d1.
2015-02-10 12:49:32 -05:00
Trevius 927e4f83ff (RoF2) Updated Expedition Opcodes 2015-02-09 20:07:04 -06:00
Trevius 82b9af3956 (RoF+) Guild Invites between RoF+ and previous Clients is now functional. 2015-02-09 19:54:14 -06:00
KimLS 82933a80d1 Merge branch 'master' of github.com:EQEmu/Server 2015-02-09 17:48:20 -08:00
KimLS 543e265b0a Adjustments to OP_SpawnAppearance, as well as updating import client files to handle newer spell files 2015-02-09 17:48:07 -08:00
Trevius c4eb6e2881 (RoF+) Setting Alt flag on characters in the Guild Management Window is now saved and functional for filtering. 2015-02-09 18:52:17 -06:00
Trevius e6eb4e16d1 (SoF+) Removed duplicate packets being sent to client on zone. 2015-02-09 17:23:43 -06:00
Michael Cook (mackal) 95b66583b3 Merge pull request #367 from JohnsonAskot/master
Sanity checking
2015-02-09 17:54:08 -05:00
Paul Coene 8cde649e39 A non magical weapon with an augment tagged as magical now registers
as a magig weapon when attacking a creature requiring magic
2015-02-09 17:04:44 -05:00
Michael Cook (mackal) 45e7ff9193 Fix RoF2 item hotkeys
This string thing needs to be longer! Still no idea what it is
2015-02-09 03:02:25 -05:00
KayenEQ 48c65628d8 Merge pull request #371 from KayenEQ/Development
npc special ability (44) COUNTER_AVOID_DAMAGE
2015-02-08 20:30:41 -05:00
KayenEQ 0521cae8d0 Implemented npc specialability (44) COUNTER_AVOID_DAMAGE which when applied to the ATTACKING NPC will make their attacks more difficult to be avoided by riposte/dodge/parry/block.
Parama0: Negative modifer value that affects ALL avoid damage types dodge/parry/riposte/block) chance on defender. Ie (44,50 = 50 pct reduction to ALL)
Parama1: Negative modifer value that affects RIPOSTE chance on defender. Ie (44,1,0,50 = 50 pct reduction to riposte chance)
Parama2: Negative modifer value that affects PARRY chance on defender.  Ie (44,1,0,0,50 = 50 pct reduction to parry chance)
Parama3: Negative modifer value that affects BLOCK chance on defender.  Ie (44,1,0,0,0,50 = 50 pct reduction to block chance)
Parama4: Negative modifer value that affects DODGE chance on defender.  e (44,1,0,0,0,0,50 = 50 pct reduction to dodge chance)
Example of usage: Player has Improved Dodge V (+50 pct dodge chance), you want to negate this bonus you would set 44,1,0,0,0,0,50 on your NPC.

Clean up and minor fixes to AvoidDamage function.
Added support to a few AA bonuses there.
2015-02-08 20:17:51 -05:00
KayenEQ 4629c7c8c4 Merge git://github.com/EQEmu/Server into Development 2015-02-08 19:04:06 -05:00
Akkadius 8b925f549b derp [skip ci] 2015-02-08 06:19:14 -06:00
Akkadius cb81d956f6 Reduced #repop time dramatically by taking down hundreds of individual SELECT/DELETE/INSERT queries in routines and bringing it down to very few
See: https://www.youtube.com/watch?v=9kSFbyTBuAk
2015-02-08 05:01:58 -06:00
KayenEQ 1149f04389 Merge pull request #370 from KayenEQ/Development
bonus fix
2015-02-07 20:20:48 -05:00
KayenEQ 9aac1b0081 Merge git://github.com/EQEmu/Server into Development 2015-02-07 20:19:58 -05:00
KayenEQ 3392f4b1c3 bonus fix 2015-02-07 20:16:27 -05:00
KayenEQ 20712ce0e6 Merge pull request #369 from KayenEQ/Development
Should fix spell bonuses not being applied properly
2015-02-07 20:08:27 -05:00
KayenEQ 9a15361e93 Should fix spell bonuses not being applied properly 2015-02-07 20:07:46 -05:00
KimLS 452b1a1eae Added throttling to some appearance packets, also removed responding to client light packets. With the new light code we'll tell the client when the light has changed not the other way around. 2015-02-07 15:55:01 -08:00
JJ edbd055277 Revert b96e5a7f4d to search for better fix. 2015-02-07 17:27:48 -05:00
JohnsonAskot 7bf054bd58 Name removed from comments 2015-02-07 14:35:43 -05:00
Michael Cook (mackal) 67ee327f5b Better sanity checking in Client::BuyTraderItem to prevent potential exploits 2015-02-07 12:39:46 -05:00
JohnsonAskot 63810d5c1b Exploit fixes
Bind Wound was spammable via packet sending. You could buy a larger
stack than the max StackSize of an item from merchants that had
unlimited of those stackable items.
2015-02-07 12:34:50 -05:00
Akkadius d5047da637 Fix an issue that is slowing repops down and unecessarily causing more work for respawn timer code 2015-02-06 19:55:00 -06:00
Uleat 9446d75444 Merge branch 'master' of https://github.com/EQEmu/Server
Conflicts:
	changelog.txt
2015-02-06 13:20:32 -05:00
Uleat c9cd733d9a Updated command #iteminfo 2015-02-06 12:09:26 -05:00
Uleat 5a619bddaf Excluded limbo (cursor buffer) from HasItem checks 2015-02-06 09:58:57 -05:00
Uleat 5d64012d74 Removed iter_inst and iter_contents typedefs 2015-02-06 08:52:41 -05:00
Uleat 2bf2485b4c Enforced const_interator returns on const_iterator return types in Inventory and ItemInst 2015-02-06 07:57:15 -05:00
KayenEQ 8acaa47b8f Merge pull request #366 from KayenEQ/Development
Optional additive worn effect bonus rule
2015-02-06 03:06:04 -05:00
KayenEQ bc6199a86f Implemented a better method for developers who want to have additivie
worn bonuses than what was prior implemented.

Removed old rule RuleB(Spells, AdditiveBonusValues)

Replaced with new rule RuleI(AdditiveBonusWornType)

The rule value denotes a specific 'worntype' that is to be
checked on items. If the items 'worntype' matches the rules worntype
then any worn effect on that item will be cacluated additively
instead of taking the highest value. This will also stack with
regular worn effects that take highest value. Unless the value
is set to (2) which is what all live items use. If set to 2 then
all worn effects will be calculated additively (same as what the old
rule did).

In laymans terms. You can take 3 Cleave I items and put them on a character
and they will all add together if you set the worn type = 3 and the rule = 3.
Which would also add to any regular cleave set to worn type = 2.

Hope you enjoyed the novel.
2015-02-06 02:49:42 -05:00
Trevius f26d303ee1 Fixed Environmental Damage for RoF2. 2015-02-05 22:34:55 -06:00
JJ b96e5a7f4d Group leader is not always member 0. 2015-02-05 19:18:51 -05:00
Michael Cook (mackal) 36d53f69d6 Fix query in Database::SetRaidGroupLeaderInfo 2015-02-05 18:11:38 -05:00
Akkadius ef5d475978 Correct db manifest [skip ci] 2015-02-05 06:05:49 -06:00
Akkadius dce6ccf4de GetTaskActivityDoneCountFromTaskID crash fix 2015-02-05 05:43:36 -06:00
KayenEQ b169544711 Merge pull request #365 from KayenEQ/Development
Calc focus effects from worn slots, for an additive foci bonus [NOT LIVE LIKE]
2015-02-05 06:24:43 -05:00
KayenEQ 1495eb42a3 sql 2015-02-05 04:27:52 -05:00
KayenEQ dd17597c92 Implemented non-live like feature to allow focus effects to be placed in worn slot
to provide an additive focus bonus that stacks with regular focus effects.
This is opposed to how regular focus effects work in which the highest
value is always taken. Please note, focus calculated from worn slot
will only use only the focuses base value (ie ignores all limit checks).

Example (Hypothetical).
Improved Heal I (10 pct focus) in Helm Worn Slot
Improved Heal I (10 pct focus) in Glove Worn Slot
Improved Heal V (50 pct focus) in Glove Focus Slot
Total Heal Focus would be 50 + 10 + 10

Added optional rule which is OFF by default.
UseAdditiveFocusFromWornSlot
2015-02-05 04:27:33 -05:00
Alex 54c3f9ab94 Merge pull request #364 from EQEmu/loot
Loot Upgrade
2015-02-05 00:06:38 -08:00
KimLS ecd05d821e Merge and fix the loot update branch, ready for merge I think 2015-02-04 23:13:02 -08:00
KayenEQ 4bd2e04482 Merge pull request #363 from KayenEQ/Development
Added perl function function: CanClassEquipItem(item_id)
2015-02-04 22:46:47 -05:00
KayenEQ cafd0eaba1 Added perl function function: CanClassEquipItem(item_id)
Returns a bool if can equip or not.
2015-02-04 22:46:02 -05:00
Uleat facd7d357d Light source exclusion tweak (helps with strobing effects) 2015-02-03 22:43:03 -05:00
Trevius 8bc5e5eee1 Crashfix for TempName() when numbers are passed at the end of the name. 2015-02-03 17:23:29 -06:00
KayenEQ bfa6bd3458 Merge pull request #362 from KayenEQ/Development
Improvements to the pet type (5) code.
2015-02-03 08:01:15 -05:00
KayenEQ 33767aeb91 Improvements to the pet type (5) code. 2015-02-03 07:59:29 -05:00
KayenEQ ff8a19b1cb Merge pull request #361 from KayenEQ/Development
Implemented pet type 5 (petTargetLock)
2015-02-03 07:10:41 -05:00
KayenEQ 356316db84 Optional SQL to convert all(?) live pets that should use the new pet type (5). 2015-02-03 07:09:24 -05:00
KayenEQ 379219aff1 Implemented new pet type (5) which summons a regular pet that locks onto
the casters target exclusively until the target dies, when target dies
the pet is killed. (Pets don't respond to commands except get lost).
This does not stack with regular pets.

Note: On live these pets cast an actual spell (Unsummon) that kills them for 20k damage,
due to how limiting that is to be hard coded, the pets will simply just
kill themselves instead.

Pending, will needd to add an optional SQL to update pet tables to convert
known live spells that use this.
2015-02-03 06:40:51 -05:00
KayenEQ a677d40f6d Merge pull request #360 from KayenEQ/Development
Fix to allow for PBAE/Targeted AE spells to check the 'npc_no_los' field...
2015-02-02 03:02:14 -05:00
KayenEQ aed3d9ef85 Fix to allow for PBAE/Targeted AE spells to check the 'npc_no_los' field in spell file
to disable LOS checks.
2015-02-02 03:01:37 -05:00
Akkadius f2667cee23 Implement Packet logs with dumps
- Category: 41: Packet: Server -> Client With Dump
	- Category: 42: Packet: Server -> Client With Dump
	See: http://wiki.eqemulator.org/p?Logging_System_Overhaul#packet-logging-levels
2015-02-02 00:10:22 -06:00
Michael Cook (mackal) e1c49f93e2 Out of bounds bandoleer fix 2015-02-02 00:18:29 -05:00
Akkadius d2b9d4ab20 find_replace fix for real 2015-02-01 22:40:56 -06:00
Akkadius 20c99e36d8 find_replace fix 2015-02-01 22:29:04 -06:00
Akkadius 3ec39ce06b Changelog 2015-02-01 22:00:21 -06:00
Akkadius 10e3c31ad6 Packet Logging database version update 2015-02-01 21:56:45 -06:00
Akkadius 4b08c75527 Add some 'is_category_enabled' before some more core logging function calls 2015-02-01 21:47:41 -06:00
Akkadius 8aa8982b66 Add File 2015_02_01_logsys_packet_logs.sql 2015-02-01 21:43:50 -06:00
Akkadius 5daa29aa3f Merge branch 'master' of https://github.com/EQEmu/Server 2015-02-01 21:42:53 -06:00
Akkadius 75c48e5800 Add category prefix in file based log messages 2015-02-01 21:42:43 -06:00
JJ 6c982179bc Merge pull request #358 from noudess/master
Repair min/max faction issues.
2015-02-01 20:59:23 -05:00
Akkadius 02e56331ec Have is_category_enabled update appropriately when settings are set via #logs 2015-02-01 19:57:02 -06:00
Akkadius 774e429d87 Get Logs::Client_Server_Packet_Unhandled to show raw opcodes 2015-02-01 19:56:32 -06:00
Michael Cook (mackal) 3340d01902 Merge pull request #359 from KinglyKrab/master
Added new rule to make the UnmemSpellAll on death optional.
2015-02-01 19:40:15 -05:00
Kinglykrab 180612bb21 Added new rule to make the UnmemSpellAll on death optional.
- New Rule: Character:UnmemSpellsOnDeath (default true)
2015-02-01 18:57:26 -05:00
Michael Cook (mackal) 8649ed1dcb Add quest debugging to lua 2015-02-01 17:25:16 -05:00
Akkadius f9ba99e99f Merge branch 'master' of https://github.com/EQEmu/Server
Conflicts:
	common/eqemu_logsys.h
2015-02-01 15:56:05 -06:00
Paul Coene 1d40f20da0 Remove incorrect use of before_hit 2015-02-01 16:14:05 -05:00
Michael Cook (mackal) cced57f56a Fix lua events 2015-02-01 15:11:27 -05:00
Paul Coene 614014a238 Faction update 2015-02-01 15:02:14 -05:00
Paul Coene 1ff2a043f4 Merge branch 'master' of https://github.com/EQEmu/Server 2015-02-01 09:34:04 -05:00
Paul Coene 115d0d14ac Fix issues with faction where chars were not allowed to earn faction to
offset starting faction values.
2015-02-01 09:31:07 -05:00
KayenEQ 7df541ea1c Merge pull request #357 from KayenEQ/Development
Pets can now cast group spells on self will now affect group.
2015-02-01 06:35:08 -05:00
KayenEQ 73ac566c17 remove debug... 2015-02-01 06:32:56 -05:00
KayenEQ cc4c6b6339 Fix/Implemented - Pets who cast group spells (Target Type 43) will now have the spell
affect entire group instead of just the pet.

This used to work at some point, no clue when it broke...
2015-02-01 06:31:53 -05:00
Akkadius b3ea1a9da7 Some changes 2015-02-01 04:05:32 -06:00
Akkadius 5fcd3eb38e Implement stable Server -> Client packet logging 2015-02-01 03:25:16 -06:00
Akkadius e35205eaf4 Add Packet :: Server -> Client logging 2015-02-01 02:13:47 -06:00
Akkadius 081a61a948 Add Packet :: Server -> Client category 2015-02-01 02:11:58 -06:00
Akkadius d75c632d73 Chnage netcode logging check to use is_category_enabled instead of just checking for console 2015-02-01 02:10:18 -06:00
Akkadius d9c47fcd41 Add a category check pre Logs::Client_Server_Packet trigger 2015-02-01 02:09:24 -06:00
Akkadius 387b445685 Fix the 'is_category_enabled' in each of the database loaders 2015-02-01 02:08:46 -06:00
Akkadius 46ac254b3a Add struct member LogSettings::is_category_enabled so that it can be used for fast checking in intense portions of code 2015-02-01 01:58:10 -06:00
Akkadius 5f64b1e1c8 Modify category descriptor Packet :: Client -> Server 2015-02-01 01:06:19 -06:00
Akkadius 5c729e65c9 Add sanity checks to GMSayHookCallBackProcess 2015-02-01 01:05:39 -06:00
Akkadius 4f4eee2b16 Re-Order string_util.h 2015-02-01 01:03:30 -06:00
Akkadius ed9bdaf60c Add to string_util.h void find_replace(std::string& string_subject, std::string& search_string, std::string& replace_string) { 2015-02-01 01:00:05 -06:00
Michael Cook (mackal) b590eb2dc4 Send item recast timestamps picking up ground spawns 2015-01-31 20:54:56 -05:00
Michael Cook (mackal) 5be1bd2ffb Make items with long reuse timers show the timer after zone
This adds a new table to store the timers in. This may seem
odd but the timers are associated with the player, not the
item, they're just included in the item header in the packet

Currently trading still needs to be handled
2015-01-31 17:53:50 -05:00
Michael Cook (mackal) b5d45effec Fix some zone/npc.cpp functions 2015-01-31 17:33:41 -05:00
JJ 96925f0dde Some minor cleanup. [skip ci] 2015-01-31 17:03:44 -05:00
Michael Cook (mackal) c06c69c420 Merge pull request #356 from clucksoft/rof_merchantlist
Rof merchantlist
2015-01-31 16:22:39 -05:00
JJ 17d276cd4e Finish proper SQL. [skip ci] 2015-01-31 15:22:03 -05:00
Russell Kinasz 2763fe36a3 RoF+ can send 200 items in merchantlist 2015-01-31 11:17:28 -08:00
Russell Kinasz 1e8916ee98 RoF+ can send 200 items in merchantlist 2015-01-31 11:11:06 -08:00
Trevius fe6fa75385 Fixed FindGroundZ() and GetGroundZ() to once again utilize the X and Y arguments that are passed to them. 2015-01-31 11:44:25 -06:00
Michael Cook (mackal) eb7d77bcac Shared Bank bug fix? 2015-01-31 03:48:59 -05:00
Akkadius a6b95aeceb At point in which Client -> Server packet logging is working, will do more prechecking to declare that anything actually is subscribed to this category before outputting 2015-01-31 02:23:58 -06:00
Michael Cook (mackal) 0bdbc5f5c9 More clang-formatting 2015-01-31 01:22:40 -05:00
Akkadius 3c08af5ca1 (Bobaski) Add PoK New Merchant sql/git/optional/2015_01_30_poknowledge_spell_vendors.sql 2015-01-30 23:43:35 -06:00
Akkadius 7a3399e510 WOOPS! (That's what he said) 2015-01-30 23:17:11 -06:00
Akkadius 877d2cab4e Merge branch 'master' of https://github.com/EQEmu/Server 2015-01-30 23:16:08 -06:00
Akkadius 39a47ceb93 Implemented LUA counterpart of EVENT_ENVIRONMENTAL_DAMAGE 2015-01-30 23:15:48 -06:00
Akkadius 8229a578ee Implemented event type "EVENT_ENVIRONMENTAL_DAMAGE"
- This event triggers when taking any sort of environmental damage. Example use:
	sub EVENT_ENVIRONMENTAL_DAMAGE{
		quest::debug("EVENT_ENVIRONMENTAL_DAMAGE");
		quest::debug("env_damage is " . $env_damage);
		quest::debug("env_damage_type is " . $env_damage_type);
		quest::debug("env_final_damage is " . $env_final_damage);
	}
	Result: (Test falling in Velks): http://i.imgur.com/tPRL7yL.png
2015-01-30 23:01:31 -06:00
Michael Cook (mackal) 0f1b504ed6 Some clang-formatting 2015-01-31 00:00:02 -05:00
Akkadius 62197d7d33 Merge branch 'master' of https://github.com/EQEmu/Server 2015-01-30 22:58:52 -06:00
Michael Cook (mackal) a18cb6f61e Another tell_queue leak fix 2015-01-30 22:00:39 -05:00
Michael Cook (mackal) 18fb507f24 Tell queue memleak fix 2015-01-30 20:23:17 -05:00
KayenEQ db948b3653 Merge pull request #355 from KayenEQ/Development
remove debug
2015-01-30 19:32:17 -05:00
KayenEQ e8553576f7 remove debug 2015-01-30 19:28:16 -05:00
KayenEQ 867b57bcf6 removed debug msg 2015-01-30 19:21:24 -05:00
Akkadius ee57568c5d Implement Rule Based Environment damage multiplier 2015-01-30 18:12:00 -06:00
KayenEQ d93f3bdd9e Merge pull request #354 from KayenEQ/Development
Charm/Paci fixes
2015-01-30 18:48:38 -05:00
KayenEQ ccbaf337f4 Fix for minimum charm and root resist chances (was always returning 0).
Fix for pacification not doing a proper second resist check upon resisting intial pacification.
2015-01-30 18:47:27 -05:00
Michael Cook (mackal) b592d2e786 clang format some stuff in zone/command.cpp 2015-01-30 18:32:28 -05:00
KimLS 9a664476b0 Merge branch 'eqstream_ptr' 2015-01-30 15:03:40 -08:00
KimLS f388a605dd Spelling errors and revised my cle change to put it much lower so it shouldn't have any side effects other than avoiding the crash 2015-01-30 15:03:02 -08:00
Alex 01c0a87cee Merge pull request #353 from EQEmu/eqstream_ptr
Change EQStream raw pointers to be std::shared_ptr
2015-01-30 13:41:49 -08:00
KimLS faaa98d3f0 Crash fix for crash we saw on peq 2015-01-30 13:04:51 -08:00
Michael Cook (mackal) 769987ca33 unique_ptr is a better fit here 2015-01-30 02:34:33 -05:00
Michael Cook (mackal) 8086eecfe2 Fix db manifest 2015-01-30 01:38:26 -05:00
Michael Cook (mackal) 8ec1cb949a Fix merc attack delay 2015-01-30 01:33:55 -05:00
KimLS 5e1a886e8f Merge branch 'master' into eqstream_ptr 2015-01-29 22:13:41 -08:00
Trevius 0aba2d578a Added more information to Mercenary Logging.
Added potential fix for Mercenaries that fail to unsuspend.
Added a new "statscale" field to the merc_stats table that can be used to quickly balance Mercenary Stats based on Level.
The new "statscale" field now combines with the Mercs::ScaleRate rule value (default 100 percent for both).
2015-01-29 23:04:41 -06:00
KayenEQ dd980ab8ad Merge pull request #352 from KayenEQ/Development
Fix for range procs
2015-01-28 23:54:38 -05:00
KayenEQ 30dbe34f78 Fix for range procs 2015-01-28 23:53:52 -05:00
Akkadius 5d465a4d49 UCS Crash Fix 2015-01-28 22:47:43 -06:00
Akkadius 0c934272c0 Added Logs::DebugQuest category per request from Trevius (Great idea)
- Exported quest::debug(log_message, [debug_level = 1)
	- Example:
		quest::debug("This is a test debug message, level 1 (default)");
		quest::debug("This is a test debug message, level 1", 1);
		quest::debug("This is a test debug message, level 2", 2);
		quest::debug("This is a test debug message, level 3", 3);

		Result: http://i.imgur.com/6VoafGE.png
	- Uses traditional logging system to output this category
	- Required MySQL Source in Database version 9070
2015-01-28 20:00:03 -06:00
Akkadius 61e9160d47 Update eqemu_update.pl to download patch_UF.conf instead of patch_Underfoot.conf 2015-01-28 00:05:29 -06:00
KimLS 7dbe6a7426 Many tweaks to stream memory allocation, including but not limited to streams now are shared_ptrs. 2015-01-27 21:12:44 -08:00
Michael Cook (mackal) 5f545df312 Remove const 2015-01-27 21:48:11 -05:00
Michael Cook (mackal) 99164fe3f9 Switch AI timers to smart pointers 2015-01-27 21:28:38 -05:00
Akkadius 2211a63fe7 Some minor format changes to SaveCharacterCorpse 2015-01-27 20:24:43 -06:00
Akkadius 0f196cc995 Fix for ZoneDatabase::SaveCharacterCorpse where a corpse was empty and two individual corpses would be created 2015-01-27 19:46:31 -06:00
Michael Cook (mackal) a12011ca1e Fix some bugs with starting AI in mercs
The vtable ptr is that of the current constructor the code is in ...
2015-01-27 19:53:13 -05:00
Michael Cook (mackal) 7dcd12fb9d clang-modernize use-nullptr on zone/mob_ai.cpp 2015-01-27 19:32:49 -05:00
Uleat d037bc9dcc Merge branch 'master' of https://github.com/EQEmu/Server 2015-01-27 18:40:04 -05:00
Uleat dd9f419735 Merge branch 'master' of https://github.com/EQEmu/Server
Conflicts:
	changelog.txt
2015-01-27 18:34:43 -05:00
Michael Cook (mackal) 62d1b0c2bd Merc NPCType memleak fix 2015-01-27 18:32:32 -05:00
Uleat 4832acde0b Finished ClientVersion naming conventions (don't forget to copy the renamed patch_UF.conf file) 2015-01-27 05:09:35 -05:00
Trevius f17fb2a8e1 Removed "Mercenary Debug:" from the Mercenary Log entries.
Resolved duplicate "You have no Mercenaries" messages when zoning without owning a Mercenary.
Mercenaries should now always be able to unsuspend if the timer is up.
More work on Mercenaries and Grouping to reduce bugs and redundant queries.
2015-01-27 00:35:39 -06:00
JJ fab3a988ae Remove specified user/database. [skip ci] 2015-01-26 21:26:01 -05:00
JJ 6a43fd3b45 Merge pull request #351 from noudess/master
Repair Faction System Messaging
2015-01-26 20:55:17 -05:00
Uleat 64c302b07a Merge branch 'master' of https://github.com/EQEmu/Server 2015-01-26 19:44:50 -05:00
Uleat 89f8006f11 Changed the return type of Corpse::MoveItemToCorpse() to void and added a 'by address' parameter to replace it -- Fixed a bug that would 'unattune' soulbound items inside of bags 2015-01-26 19:44:33 -05:00
Paul Coene 5f3baf3649 Merge remote-tracking branch 'upstream/master' 2015-01-26 14:30:21 -05:00
Natedog2012 f67382c024 Allow ranged procs to work again 2015-01-26 13:58:54 -05:00
Akkadius e1e53b926f Merge branch 'master' of https://github.com/EQEmu/Server 2015-01-26 01:53:37 -06:00
Akkadius 26a766335f Fix for GetCharactersInInstance post-cleanup 2015-01-26 01:51:29 -06:00
Michael Cook (mackal) 03a27ca9ed Merge pull request #350 from addtheice/dead_code_removal
Dead code removal
2015-01-26 01:13:25 -05:00
Michael Cook (mackal) 6e295a1102 Rewrite StringFormat to take advantage of RVO
The standard stipulates that if RVO doesn't take place, that it should
return an rvalue anyways, so move semantics should take place without
the std::move, which were just forcing RVO to not be attempted.

Also removed duplicate code

The only thing that /might/ be slower is the output.clear() but that's
an edge case anyways.
2015-01-26 00:31:50 -05:00
Akkadius a698eff106 Natedog: Fix #gassign to work more appropriately and simplify the function 2015-01-25 23:27:44 -06:00
Akkadius d63f137a9f Now that versioning works, set script back to V 2 [skip ci] 2015-01-25 21:26:25 -06:00
Akkadius a5b77981b7 Rename db_update.pl to eqemu_update.pl so that the script is more of a generic upgrade script for future add-ons as well as implementing versioning without waiting for everyone to download the copy of the script that successfully self-updates. [skip ci] 2015-01-25 21:23:50 -06:00
Akkadius 38aa7134ad Update db_update.pl verbiage [ci skip] 2015-01-25 20:54:45 -06:00
Akkadius 9d9df6931e Re-Implement file check for db_update.pl in Database::CheckDatabaseConversions() so when the file exists it isn't re-downloaded
Increment db_update.pl current version to version 2
Update Database::CheckDatabaseConversions() to check for version 2 of db_update.pl
2015-01-25 20:48:30 -06:00
Akkadius d51271dc6d Fail safe for db_update.pl so that the menu loop does not loop forever, it will exit after 50 loops
Add --no-check-certificate to Linux wget for method GetRemoteFile in db_update.pl
Add a case where if the actual database version is greater than what world reports as the binary_database_version that it will simply continue booting up
2015-01-25 20:39:54 -06:00
Akkadius 58b5f6b88f Update db_dumper.pl to allow remote host backups 2015-01-25 16:51:58 -06:00
KimLS 0c7a861caf Fix for spell target det crash. Also added a command line arg to world ignore_db that lets you ignore the db conversion process for servers that dont need it. 2015-01-25 14:18:30 -08:00
Trevius fc5266e115 Added Logs::Mercenaries to the new Logging System. Logging of Mercenary information is off by default with the required SQL. 2015-01-25 12:31:07 -06:00
Paul Coene cad4ebc6f3 Procedure for peqdb users to see all faction information for their character. 2015-01-25 12:42:19 -05:00
Trevius 966acb25b3 Fixed an issue where Mercenaries were causing several DB queries per second while suspended. 2015-01-25 11:28:34 -06:00
Paul Coene 60412276da Report repair as well as change from Update Personal Faction. 2015-01-25 09:55:41 -05:00
Paul Coene 22de30bab3 Repair faction messaging code.
The messages were being based on total faction rather than personal faction.
The personal faction range is all that is needed to detremine which message.

There were several bugs as well.  Fixed several edge conditions
2015-01-25 09:46:00 -05:00
Akkadius 5266d7b25c Add extra checking at the root of Log.Out to check if the category is subscribed to any of the output methods before trying to parse message strings and then pass them to the sub output functions and THEN perform log_setting checks and debug_level checks.
I performed a unit test of 1,000,000 log writes, there is hardly any difference.

#::: Before Checks
[01-25-2015 :: 03:15:35] [999999] Test #2... Took 17.940001 seconds

#::: With Checks
[01-25-2015 :: 04:10:55] [999999] Test #2... Took 18.018000 seconds
2015-01-25 04:24:05 -06:00
Akkadius 4f19fe9f91 Travis compile fix for real? 2015-01-25 02:27:30 -06:00
Akkadius 5e107a9936 Help Travis figure out what time of day it is 2015-01-25 02:23:05 -06:00
Akkadius 6212045dcd Add database_instances.cpp 2015-01-25 02:16:11 -06:00
Akkadius 1d462bfd0f Revert some entity related CastTo changes 2015-01-25 01:42:46 -06:00
Akkadius daa3b5d257 DeleteCharacter remove whitespaces in line endings 2015-01-24 23:55:01 -06:00
Akkadius 7b3d1c3252 DeleteCharacter formatting changes 2015-01-24 23:52:48 -06:00
Akkadius 60e17bbeaa Misc formatting changes 2015-01-24 23:49:29 -06:00
Akkadius 06b8ce6017 Cleanup database.h header and add database_conversions.cpp file 2015-01-24 23:43:00 -06:00
Akkadius 968e936114 Create database_conversions.cpp and move all of the conversion code to it 2015-01-24 23:34:14 -06:00
Akkadius 0af719e3a2 Cleanup Database::GetMiniLoginAccount 2015-01-24 23:10:55 -06:00
Akkadius 0ae5784c99 Cleanup Database::AddClientToInstance 2015-01-24 23:08:40 -06:00
Akkadius 00ae27136c Cleanup Database::CheckInstanceExists 2015-01-24 23:05:41 -06:00
Akkadius e5f22f1f00 Cleanup Database::BuryCorpsesInInstance 2015-01-24 23:04:55 -06:00
Akkadius 3b7ea7fe24 Cleanup Database::CheckInstanceExists, use just one column instead of * as storing more results than you need to is generally slower 2015-01-24 23:02:51 -06:00
Akkadius f4a25b0331 Cleanup Database::GetAdventureStats 2015-01-24 22:59:52 -06:00
Akkadius 00d3939ece Cleanup Database::GlobalInstance 2015-01-24 22:58:14 -06:00
Akkadius 5aadfc5577 Cleanup Database::AssignRaidToInstance 2015-01-24 22:56:18 -06:00
Akkadius 003b56bc39 Cleanup Database::AssignGroupToInstance 2015-01-24 22:55:51 -06:00
Akkadius 64192fa1d7 Cleanup Database::GetCharactersInInstance 2015-01-24 22:55:15 -06:00
Akkadius 3428540d01 Cleanup Database::GetInstanceID, the 2nd version 2015-01-24 22:54:16 -06:00
Akkadius 10ab806859 Cleanup Database::GetInstanceID 2015-01-24 22:51:49 -06:00
Akkadius 13af3e35e2 Removed COMMANDS_LOGGING ifdef 2015-01-24 22:48:06 -06:00
Akkadius 36e01cb9f1 Adjust some commands that default to 0, change Log commands to Commands category instead of Error 2015-01-24 22:46:40 -06:00
Akkadius 9c92cbb780 Remove redundant MySQL error message in ClearRaidLeader 2015-01-24 22:42:51 -06:00
Akkadius e7b4a38e69 Remove redundant MySQL error message in ClearAllRaidLeaders 2015-01-24 22:40:58 -06:00
Akkadius 5585b50601 Remove redundant MySQL error message in SetRaidGroupLeaderInfo 2015-01-24 22:38:35 -06:00
Akkadius 8d30ca51ca Cleanup Database::GetRaidLeaderName log Messages 2015-01-24 22:37:40 -06:00
Akkadius f39afc51c7 Suppress Error message for GetRaidID (Unable to get raid id, char not found) because it will happen for any player who is not in a raid anyways which makes it pointless 2015-01-24 22:29:23 -06:00
Akkadius 8ed1d5042a Suppress Error message for GetRaidID (Unable to get raid id, char not found) because it will happen for any player who is not in a raid anyways which makes it pointless 2015-01-24 22:29:15 -06:00
Akkadius 609cad72d9 Convert Entity::CastToNPC to Log.Out with EQDEBUG remove 2015-01-24 22:22:30 -06:00
Akkadius a31ad485e4 Convert Entity::CastToClient to Log.Out 2015-01-24 22:20:58 -06:00
Akkadius 1b1c82a3e7 Doors::HandleClick and remove #EQDEBUG check, convert log 2015-01-24 22:09:58 -06:00
Akkadius ecf354e2c9 Update database table to the real defaults that it was intended to have 2015-01-24 22:05:29 -06:00
Akkadius 62d9de3074 Cleanup logging in Client::Handle_OP_CastSpell as well as some more conversions 2015-01-24 22:01:37 -06:00
Akkadius d3fb59b3e5 Cleanup logging in Client::Handle_OP_CastSpell 2015-01-24 22:00:20 -06:00
Uleat 1a5b211d07 Added more to changelog notes for equipment light source commit 2015-01-24 22:10:17 -05:00
Uleat cc1d7d54c2 Implemented mob equipment light sources 2015-01-24 22:00:06 -05:00
Uleat 7e980e1e7c Added 'NoDrop Hack' check log message to Client::SwapItem() 2015-01-24 20:46:48 -05:00
Arthur Ice c16ad9e111 removed unused code win_getopt.cpp/h 2015-01-24 14:03:31 -08:00
Arthur Ice 7e9d9b87b7 removed unused code seperator-2.h 2015-01-24 14:00:30 -08:00
Arthur Ice 21c6688f0d removed unused code queues.h 2015-01-24 13:58:03 -08:00
Arthur Ice a3536ec7f7 removed unused code dbmemshare.cpp 2015-01-24 13:53:13 -08:00
Arthur Ice 04dadbf56e removed unused code breakdowns.h 2015-01-24 13:48:57 -08:00
Alex 262ccf3d06 Merge pull request #349 from EQEmu/db_types
Merge of db_types branch.
2015-01-24 12:24:07 -08:00
KimLS 73c6a0bb1d Fix for bug with usage of IsOrigin, bug from when i was just doing glm::dot(pos, pos) == 0 2015-01-24 12:01:42 -08:00
KimLS 8d30e4b8a6 Merge branch 'master' into db_types 2015-01-24 11:50:20 -08:00
Alex 854f7d6575 Merge pull request #348 from addtheice/moremath
removed moremath.cpp/h
2015-01-24 11:50:09 -08:00
KimLS 34bec5913b Merge plus changed getposition to return a reference 2015-01-24 11:48:06 -08:00
Natedog2012 069572fe15 Fix for CastSpell if the spellID is invalid thus not having a name 2015-01-24 14:08:56 -05:00
Akkadius 26018ec898 astyle client_mods.cpp 2015-01-24 05:11:19 -06:00
Akkadius 6300cbb6b8 Client::CalcMaxMana Log adjust 2015-01-24 05:03:27 -06:00
Akkadius 91fe63537b Client::ACMod Log adjust 2015-01-24 05:01:23 -06:00
Akkadius 7b6b3c8094 Removed EQDEBUG preprocessor check in TextLink::GenerateLink 2015-01-24 04:58:16 -06:00
Akkadius dfeb6e62a4 Changed a log entry to use Trade category instead of none 2015-01-24 04:55:03 -06:00
Akkadius e24b67cbb4 Fixed DumpTrade to filter through trading Debug level 3 logs. Removed preprocessor checks 2015-01-24 04:54:02 -06:00
Akkadius dbabd06ce5 Remove EQDEBUG preprocessor from PersistentTimer::Load 2015-01-24 04:40:45 -06:00
Akkadius d0595e3794 Remove log junk from command_spawn 2015-01-24 04:38:22 -06:00
Akkadius 04623b2c0c Remove preprocessor and convert log message 2015-01-24 04:31:09 -06:00
Akkadius e18a49a974 Cleanup in command_guild 2015-01-24 04:28:41 -06:00
Akkadius 50ccb52465 Adjust logging in command_time 2015-01-24 04:27:32 -06:00
Akkadius d7a2387f3d Sort command_init alphabetically and cleanup 2015-01-24 04:22:33 -06:00
Akkadius 734a2c42b2 Remove some processor and cleanup logging around Commands 2015-01-24 04:17:58 -06:00
Akkadius b2dbc3923c Remove occurence of ChangeSQLLog 2015-01-24 03:59:52 -06:00
Akkadius 5cb0fe0a6f Remove Client::ChangeSQLLog 2015-01-24 03:51:48 -06:00
Akkadius d5714cdcb0 Remove Client::LogSQL 2015-01-24 03:51:19 -06:00
Akkadius ce161c2583 Some fixes from replace removal of LogSQL 2015-01-24 03:50:33 -06:00
Akkadius e1747c43b9 Remove occurrences of LogSQL 2015-01-24 03:49:20 -06:00
Akkadius 8ba8a1e6fa Remove occurrences of LogSQL 2015-01-24 03:49:14 -06:00
Akkadius 4e9cfa7c30 Remove occurrences of LogSQL 2015-01-24 03:49:13 -06:00
Akkadius 2d24b1f37e Remove occurrences of LogSQL 2015-01-24 03:49:12 -06:00
Akkadius c218419ecc Remove occurrences of LogSQL 2015-01-24 03:49:12 -06:00
Akkadius c88bf64bd5 Remove occurrences of LogSQL 2015-01-24 03:49:11 -06:00
Akkadius 377c071918 Remove occurrences of LogSQL 2015-01-24 03:49:10 -06:00
Akkadius d2011e58b4 Remove occurrences of LogSQL 2015-01-24 03:49:09 -06:00
Akkadius 384c041ea9 Remove occurrences of LogSQL 2015-01-24 03:49:09 -06:00
Akkadius d78b9ff2a1 Remove occurrences of LogSQL 2015-01-24 03:49:08 -06:00
Akkadius c28570f92e Remove occurrences of LogSQL 2015-01-24 03:49:07 -06:00
Akkadius 71f0d86767 Remove occurrences of LogSQL 2015-01-24 03:49:06 -06:00
Akkadius fcd4923938 Remove occurrences of LogSQL 2015-01-24 03:49:05 -06:00
Akkadius f18b9d79da Remove occurrences of LogSQL 2015-01-24 03:49:05 -06:00
Akkadius 2457f5f455 Remove occurrences of LogSQL 2015-01-24 03:49:03 -06:00
Akkadius acb78cec17 Remove command_logsql as it is completely unecessary now 2015-01-24 03:40:11 -06:00
Akkadius 443e3bf8a7 Fix Database::ReserveName so that it no longer relies on a failed insert into the character_data table to return false; on character creation. Log message for Logs::World_Server added for the same 2015-01-24 01:20:04 -06:00
Akkadius 66008f4475 Fix situation where someone will add a player to an instance for sanity sake (twice) and INSERT will fail, this is merely suppressing logsby doing a REPLACE INTO via Database::AddClientToInstance 2015-01-24 00:57:36 -06:00
Arthur Ice 010778f937 removed moremath.cpp/h 2015-01-23 21:13:20 -08:00
Natedog2012 057f4ed1f4 Fix for incorrect formatting type 2015-01-23 23:17:23 -05:00
KimLS 669bca8da8 Fix for bots compile 2015-01-23 18:24:53 -08:00
KimLS a7710c027b Fix for polluted headers that were messing with glm 2015-01-23 17:58:03 -08:00
Trevius c822990213 Reverting last push due to zone crash from double deletes. 2015-01-23 17:13:21 -06:00
Trevius bfca9c0383 Added deletes to RoF2 Patch file for potential mem-leaks. 2015-01-23 16:43:35 -06:00
KimLS 17af9e3808 Merge fixes, hopefully didn't break anything. 2015-01-23 13:36:27 -08:00
Michael Cook (mackal) 06ff4823d3 Minor tweaking to new logsys 2015-01-23 15:48:20 -05:00
KimLS 143c0cf0f9 Fix for x and y swapped on water maps 2015-01-23 12:23:24 -08:00
Natedog2012 451983ffc9 Fix formatting on this.. which caused major zone crashes 2015-01-23 14:16:16 -05:00
KimLS 269d56e1d0 Switched out our kinda juryrigged vector types for glm::vec types since we use that as a 3d math library already but never switched out the types 2015-01-23 00:01:10 -08:00
Michael Cook (mackal) f702e953e7 Some std::abs usage and a bit of clang-formatting 2015-01-22 22:59:52 -05:00
KimLS 03286f540a Updated version of glm 2015-01-22 16:52:50 -08:00
Alex 45ca5520fe Merge pull request #332 from addtheice/range_based_for_prepared
modified mysql results/row to be ready for range based for
2015-01-22 16:50:52 -08:00
Alex 7bfc3a48a8 Merge pull request #343 from noudess/master
Made familiars persistent.
2015-01-22 16:48:38 -08:00
Akkadius 65397cf03e Compile fix for Loginserver 2015-01-22 16:48:10 -06:00
Akkadius 908c7b1464 Re-Fix Skills log message print types 2015-01-22 15:56:03 -06:00
Akkadius ec121e5ec8 Re-Fix db_update_manifest.txt and Binary Database Version 2015-01-22 15:53:30 -06:00
Akkadius 78a1926d72 Fix .SQL file for logsys categories so that the manifest does not have issues (Again) 2015-01-22 15:47:47 -06:00
Akkadius 82fb69eed4 Changelog entry 2015-01-22 02:54:53 -06:00
Akkadius 570bd1bd00 Change .txt file write extension to .log more appropriately 2015-01-22 02:40:35 -06:00
Akkadius 7d70afd4c9 Change crash location to logs/crashes/<> 2015-01-22 02:36:55 -06:00
Akkadius 4f931c45fb Adjusting #logs verbiage 2015-01-22 02:21:41 -06:00
Akkadius 90653a9d17 Comment up EQEmuLogSys class header. Change some string copys to rather pass by reference because its not necessary 2015-01-22 01:44:52 -06:00
Akkadius d8926861b6 My GCC built fine, but lets make Travis happy 2015-01-22 00:46:45 -06:00
Akkadius 83e90ddc6d Merge remote-tracking branch 'remotes/origin/logging_changes' 2015-01-22 00:34:58 -06:00
Akkadius 50b3c2e39f Re-add 2015_01_21_npc_types_update.sql because Git was being weird 2015-01-22 00:15:47 -06:00
Akkadius 49409810df Update manifest, delete SQL File 2015-01-22 00:15:14 -06:00
Uleat ca3502758e Added script for non-existent light column 2015-01-21 23:07:29 -05:00
KayenEQ 26b91a0a97 Merge pull request #346 from KayenEQ/Development
removed extra semi colon..
2015-01-21 22:03:03 -05:00
KayenEQ d25b750c2c removed extra semi colon.. 2015-01-21 22:02:05 -05:00
Akkadius b93bbc64fd Merge remote-tracking branch 'remotes/origin/master' into logging_changes 2015-01-21 20:04:17 -06:00
Akkadius b4ff915cbb Change zone file log name format once it boots up 2015-01-21 19:39:51 -06:00
Akkadius 376bba5156 Some log changes 2015-01-21 19:37:54 -06:00
Akkadius e1bfbfa30c Change some world server Logging to General (Level 1) debugging 2015-01-21 19:15:36 -06:00
Akkadius 9f25b52f9a Change some zone server Logging to General (Level 1) debugging 2015-01-21 19:08:43 -06:00
Akkadius 46010fbfdf Rename LoadLogSysSettings to LoadLogSettings 2015-01-21 19:04:13 -06:00
Uleat b186b0538a Activated light field load from npctypes table 2015-01-21 20:01:59 -05:00
Akkadius 43a9a4742c Add proper file log closing to export 2015-01-21 18:54:40 -06:00
Akkadius ae5887b915 Add proper file log closing to shared_memory 2015-01-21 18:54:12 -06:00
Akkadius 0cab51b68b Add proper file log closing to eq_launch 2015-01-21 18:53:39 -06:00
Akkadius cb99f92287 Add properl file log closing to import and UCS 2015-01-21 18:52:59 -06:00
Akkadius ab82fc1702 Add properl file log closing to queryserv 2015-01-21 18:51:26 -06:00
Akkadius 37b5442028 Cleanup some log entries in world 2015-01-21 18:47:36 -06:00
Akkadius 92737339b3 Properly close process files in zone and world 2015-01-21 18:46:56 -06:00
Akkadius 7ce5acf701 Cleanup CloseFileLogs() 2015-01-21 18:43:47 -06:00
Akkadius 683a81a6c8 Post merge fixes 2015-01-21 18:39:36 -06:00
Akkadius c5447778a6 Merge remote-tracking branch 'remotes/origin/master' into logging_changes
Conflicts:
	world/client.cpp
	world/worlddb.cpp
	zone/aggro.cpp
	zone/bot.cpp
	zone/client.cpp
	zone/client_packet.cpp
	zone/client_process.cpp
	zone/doors.cpp
	zone/entity.cpp
	zone/inventory.cpp
	zone/mob_ai.cpp
	zone/perl_client.cpp
	zone/spells.cpp
	zone/waypoints.cpp
	zone/zone.cpp
	zone/zonedb.cpp
	zone/zoning.cpp
2015-01-21 17:29:30 -06:00
Akkadius 51b3ae9e0a Add shownumhits command back in from merge 2015-01-21 16:55:56 -06:00
Akkadius 1e59416f33 Post merge manual fixes 2015-01-21 16:49:25 -06:00
Akkadius 3d74035e24 Merge remote-tracking branch 'remotes/origin/master' into logging_changes
Conflicts:
	zone/command.cpp
	zone/command.h
	zone/inventory.cpp
2015-01-21 16:40:46 -06:00
Akkadius a59138d2d9 Implement #logs reload_all - To reload world and zone their log settings from the database 2015-01-21 03:01:21 -06:00
Akkadius ef0d383de9 Adjust #logs set 2015-01-21 02:12:22 -06:00
Akkadius 47bb4c0b2b Implement #logs set [console|file|gmsay] <category_id> <debug_level (1-3)> 2015-01-21 01:26:33 -06:00
Akkadius 6cfe9e301b Preliminary log setting commands 2015-01-21 00:01:28 -06:00
Akkadius d4460b94be Rename #log to #logs after thinking deeply about it 2015-01-20 23:21:32 -06:00
Akkadius 1871c3f24f Implement first pieces of #log 2015-01-20 23:18:23 -06:00
Akkadius 7101d84b27 Remove garbage in commit 2015-01-20 20:01:44 -06:00
Akkadius 38c94f6dda Push table update 2015-01-20 20:00:48 -06:00
Akkadius c202b9e7b6 Linux fix in worldserver.cpp with __FUNCTION__ 2015-01-20 19:54:08 -06:00
Akkadius 013216ff2b Remove Unneeded DebugBreak 2015-01-20 19:41:30 -06:00
Akkadius a6a86f030c Remove Unneeded DebugBreak 2015-01-20 19:41:29 -06:00
Akkadius 56b0a2aa4f Remove Unneeded DebugBreak 2015-01-20 19:41:28 -06:00
Akkadius 07d2eab183 Remove Unneeded DebugBreak 2015-01-20 19:41:27 -06:00
Akkadius 90dd9f8aeb Remove Unneeded DebugBreak 2015-01-20 19:41:26 -06:00
Akkadius 32cba9083c Remove Unneeded DebugBreak 2015-01-20 19:41:25 -06:00
Akkadius 26b65a05a9 Remove Unneeded DebugBreak 2015-01-20 19:41:24 -06:00
Akkadius 0db638c8c0 Remove Unneeded DebugBreak 2015-01-20 19:41:23 -06:00
Akkadius 456356d626 Remove Unneeded DebugBreak 2015-01-20 19:41:22 -06:00
Akkadius 29fe791ad0 Remove Unneeded DebugBreak 2015-01-20 19:41:21 -06:00
Akkadius 6c545a144c Remove Unneeded DebugBreak 2015-01-20 19:41:20 -06:00
Akkadius 6e582fb68f Remove Unneeded DebugBreak 2015-01-20 19:41:19 -06:00
Akkadius a19f7f702c Remove Unneeded DebugBreak 2015-01-20 19:41:18 -06:00
Akkadius f44155a317 Remove Unneeded DebugBreak 2015-01-20 19:41:17 -06:00
Akkadius 7fef8de50a Remove Unneeded DebugBreak 2015-01-20 19:41:14 -06:00
Akkadius 440ca97a79 Remove Unneeded DebugBreak: 2015-01-20 19:40:55 -06:00
Akkadius 98f0d4df49 UpdateAdmin Linux build fix 2015-01-20 19:22:28 -06:00
Akkadius ce3d4e678f Push something that apparently didn't make its way through before 2015-01-20 19:19:57 -06:00
Akkadius bd757417d5 Platform changes for getpid() 2015-01-20 19:05:11 -06:00
Akkadius f7ca12f7cc Changed defaults to use enum 2015-01-20 18:47:20 -06:00
KayenEQ a71690b725 Merge pull request #344 from KayenEQ/Development
Fix for compile issue with vs2012
2015-01-20 17:36:49 -05:00
KayenEQ ad711b0b5a Fix for compile issue with vs2012 2015-01-20 17:35:39 -05:00
Uleat 1b91750902 Merge branch 'master' of https://github.com/EQEmu/Server 2015-01-20 17:08:21 -05:00
JJ a84f480ffc ... and lang. 2015-01-20 15:51:00 -05:00
JJ ee108b5b74 Skill gain logging fix. (iluvseq) 2015-01-20 15:33:26 -05:00
Akkadius 8ae2d86962 rename process_file_name to platform_file_name for consistency 2015-01-20 06:49:31 -06:00
Akkadius f4847607fd More work on process logging 2015-01-20 06:26:12 -06:00
Akkadius e4829225f6 Add file log handling in every process 2015-01-20 06:15:56 -06:00
Akkadius 9ae28d7619 More process based logging work 2015-01-20 06:13:12 -06:00
Akkadius 01940ee5ed Implement crash logging, 'crash_processname_pid.log' at the root of logs/ 2015-01-20 05:52:50 -06:00
Akkadius ad5d1e4814 Some EQEmuLogSys changes regarding class variables 2015-01-20 05:36:15 -06:00
Akkadius a64c21eb96 Undo Queryserv refactoring because our database class stuff is stupid 2015-01-20 05:30:19 -06:00
Akkadius 7f2f6a8612 Placing Log defaults after RegisterExecutablePlatform and installing database log setting loads right after database connection for all processes 2015-01-20 05:22:15 -06:00
Akkadius 931134688a Add a copy of load log settings to UCS because of how split Database classes are laid out 2015-01-20 05:18:44 -06:00
Akkadius e4797d04f0 Change some defaults for logs 2015-01-20 05:18:21 -06:00
Akkadius c730519e27 Fix some categories from before convert 2015-01-20 05:07:22 -06:00
Akkadius 9bfe45ddbd QueryServ adjustments 2015-01-20 05:04:16 -06:00
Akkadius 0110755c47 Adjust defaults for LoadLogSettingsDefault 2015-01-20 04:56:13 -06:00
Akkadius d5018029a4 Add LoadLogSysSettings to client export utility 2015-01-20 04:45:44 -06:00
Akkadius d191086d3e Add LoadLogSysSettings to other processes 2015-01-20 04:45:14 -06:00
Akkadius 1bbbb28218 Refactor some of the database stuff for QueryServ for uniformity, should probably be done right later 2015-01-20 04:30:27 -06:00
Akkadius cdde408602 Some adjustments to file writing routines 2015-01-20 04:10:39 -06:00
Akkadius 8b096e65af logtest adjustments 2015-01-20 03:46:27 -06:00
Akkadius 42dffec4ae Various logging adjustments 2015-01-20 03:20:40 -06:00
Akkadius e79c1c1a5a Fix Linux compiles 2015-01-20 03:07:33 -06:00
Akkadius b2ffcf1cf6 Implement debug_level checking for ProcessGMSay 2015-01-20 03:02:41 -06:00
Akkadius aeff650649 Implement debug_level checking for ProcessLogWrite 2015-01-20 03:02:15 -06:00
Akkadius f09e1d037f Implement debug_level checking for ProcessConsoleMessage 2015-01-20 03:01:41 -06:00
Akkadius f5b1f678a1 Pass debug_level to subprocess commands 2015-01-20 03:00:00 -06:00
Akkadius cc1735bc39 Add uint16 debug_level to ProcessGMSay 2015-01-20 02:59:32 -06:00
Akkadius 9faa2117d5 Add uint16 debug_level to ProcessLogWrite 2015-01-20 02:59:06 -06:00
Akkadius e48234b2af Add uint16 debug_level to ProcessConsoleMessage 2015-01-20 02:58:33 -06:00
Akkadius ff5e82c50f Fix some indents 2015-01-20 02:57:31 -06:00
Akkadius 39626159a5 Implement Linux ANSI colors 2015-01-20 02:53:10 -06:00
Akkadius 32437a21eb Add ANSI color defines for Linux 2015-01-20 02:45:38 -06:00
Akkadius 0bb013bafb Convert DeleteCharacter to Log.Out 2015-01-20 02:36:47 -06:00
Akkadius fc0e760b02 Convert DeleteAccount to Log.Out 2015-01-20 02:33:55 -06:00
Akkadius ec2a8c4a1b Convert CreateAccount to Log.Out 2015-01-20 02:33:15 -06:00
Akkadius 29774d9765 Database:;ClearMerchantTemp cleanup 2015-01-20 02:16:53 -06:00
Akkadius 3fbac46ee6 Remove Duplicative MySQL Error: 2015-01-20 02:14:36 -06:00
Akkadius 5ec3d58e32 Remove Duplicative MySQL Error: Error updating LFP for character %i : %s 2015-01-20 02:13:25 -06:00
Akkadius c5dbbd1f07 Remove Duplicative MySQL Error: Error updating LFP for character %i : %s 2015-01-20 02:12:59 -06:00
Akkadius 8ede80b69d Remove Duplicative MySQL Error: Error updating LFP for character %i : %s 2015-01-20 02:12:01 -06:00
Akkadius d3fdacf548 Remove Duplicative MySQL Error: Error updating firstlogon for character %i : %s 2015-01-20 02:11:31 -06:00
Akkadius e626bb527f Remove Duplicative MySQL Error: Error adding a report for %s: %s 2015-01-20 02:10:54 -06:00
Akkadius 40d23ab35a Remove Duplicative MySQL Error: Error adding character to group id: %s 2015-01-20 02:10:16 -06:00
Akkadius f4c8eb6d88 Remove Duplicative MySQL Error: Unable to clear groups: 2015-01-20 02:09:36 -06:00
Akkadius 5a8e45faab Remove Duplicative MySQL Error: Unable to clear groups: 2015-01-20 02:09:23 -06:00
Akkadius b14c3c8674 Remove Duplicative MySQL Error: Log.Out(Logs::General, Logs::Error, Error 2015-01-20 02:08:25 -06:00
Akkadius 2b091206bd Remove Duplicative MySQL Error: Unable to clear groups: 2015-01-20 02:07:39 -06:00
Akkadius c9fd7e45e8 Remove excess MySQL error message in GetSafePoints 2015-01-20 02:03:45 -06:00
Akkadius 0092d0c894 Fix ClearMerchantTemp from error message removal 2015-01-20 01:50:35 -06:00
Akkadius b77a586d14 Fix RemoveTempFactions from error message removal 2015-01-20 01:49:38 -06:00
Akkadius 1530bd7937 Fix InsertDoor from error message removal 2015-01-20 01:49:20 -06:00
Akkadius 54868922ef Fix UpdateKarma from error message removal 2015-01-20 01:49:03 -06:00
Akkadius 00db3d270c Fix DeleteMerchantTemp from error message removal 2015-01-20 01:48:39 -06:00
Akkadius 4efa8a18eb Fix SaveMerchantTemp from error message removal 2015-01-20 01:48:06 -06:00
Akkadius b800dd04c6 Fix UpdateBug from error message removal 2015-01-20 01:47:41 -06:00
Akkadius 1c6a0f054a Fix UpdateBug from error message removal 2015-01-20 01:47:24 -06:00
Akkadius c86fc62132 Fix SetBotInspectMesssage from error message removal 2015-01-20 01:46:50 -06:00
Akkadius 5fa42ce90f Fix LoginIP from erorr message removal 2015-01-20 01:46:06 -06:00
Akkadius 48caf1e413 Remove Duplicative MySQL Error: Error in GetGuildIDByChar query ' 2015-01-20 01:42:43 -06:00
Akkadius 3156efae63 Remove Duplicative MySQL Error: Error in GetLiveChar query ' 2015-01-20 01:42:42 -06:00
Akkadius 3473e11376 Remove Duplicative MySQL Error: Error in UpdateLiveChar query ' 2015-01-20 01:42:40 -06:00
Akkadius 78746a40fa Remove Duplicative MySQL Error: Error in GetCharacterInfo query ' 2015-01-20 01:42:39 -06:00
Akkadius 9cbe0d4b34 Remove Duplicative MySQL Error: Error in SetMQDetectionFlag query ' 2015-01-20 01:42:36 -06:00
Akkadius 032de7f6ce Remove Duplicative MySQL Error: Error in SetHackerFlag query ' 2015-01-20 01:42:35 -06:00
Akkadius de531af354 Remove Duplicative MySQL Error: Error in MoveCharacterToZone(id) query ' 2015-01-20 01:42:34 -06:00
Akkadius c892bc4e2b Remove Duplicative MySQL Error: Error in MoveCharacterToZone(name) query ' 2015-01-20 01:42:33 -06:00
Akkadius 835c7d0fce Remove Duplicative MySQL Error: Error in GetServerType query ' 2015-01-20 01:42:32 -06:00
Akkadius 11357f7e91 Remove Duplicative MySQL Error: Error in CheckUsedName query ' 2015-01-20 01:42:31 -06:00
Akkadius 7b7ddb25fa Remove Duplicative MySQL Error: Error in ClearMerchantTemp query ' 2015-01-20 01:42:30 -06:00
Akkadius a1895b9cb3 Remove Duplicative MySQL Error: Error in GetAccountFromID query ' 2015-01-20 01:42:28 -06:00
Akkadius a269aa4409 Remove Duplicative MySQL Error: Error in GetAccountIDFromLSID query ' 2015-01-20 01:42:26 -06:00
Akkadius 8186d43cad Remove Duplicative MySQL Error: Error in LoadFactionData ' 2015-01-20 01:42:25 -06:00
Akkadius 8d7de051c5 Remove Duplicative MySQL Error: Error in AddToNameFilter query ' 2015-01-20 01:42:25 -06:00
Akkadius c9ece3480c Remove Duplicative MySQL Error: Error in LoadFactionData ' 2015-01-20 01:42:24 -06:00
Akkadius a3dc49c504 Remove Duplicative MySQL Error: Error in CheckNameFilter query ' 2015-01-20 01:42:24 -06:00
Akkadius b4a6184c88 Remove Duplicative MySQL Error: Error in SetCharacterFactionLevel query ' 2015-01-20 01:42:23 -06:00
Akkadius 78bbb9b03d Remove Duplicative MySQL Error: Error in GetPEQZone query ' 2015-01-20 01:42:22 -06:00
Akkadius f4fad223d0 Remove Duplicative MySQL Error: Error in SetCharacterFactionLevel query ' 2015-01-20 01:42:22 -06:00
Akkadius e127b01640 Remove Duplicative MySQL Error: Error in LoadZoneNames query ' 2015-01-20 01:42:21 -06:00
Akkadius 2c36b9070e Remove Duplicative MySQL Error: Error in RemoveTempFactions query ' 2015-01-20 01:42:20 -06:00
Akkadius 8e64a8b1c5 Remove Duplicative MySQL Error: Error in GetZoneGraveyard query ' 2015-01-20 01:42:20 -06:00
Akkadius dbeef12a4f Remove Duplicative MySQL Error: Error in InsertDoor 2015-01-20 01:42:19 -06:00
Akkadius cb18d3d1b5 Remove Duplicative MySQL Error: Error in GetZoneGraveyardID query ' 2015-01-20 01:42:19 -06:00
Akkadius 8f96f52c04 Remove Duplicative MySQL Error: Error in UpdateKarma query ' 2015-01-20 01:42:18 -06:00
Akkadius 245db04c4c Remove Duplicative MySQL Error: Error in GetZoneLongName query ' 2015-01-20 01:42:18 -06:00
Akkadius 56dfc97517 Remove Duplicative MySQL Error: Error in getZoneShutDownDelay query ' 2015-01-20 01:42:16 -06:00
Akkadius d3f265116e Remove Duplicative MySQL Error: Error in GetSafePoint query ' 2015-01-20 01:42:15 -06:00
Akkadius 5aba5c8473 Remove Duplicative MySQL Error: Error in LoadBlockedSpells query ' 2015-01-20 01:42:14 -06:00
Akkadius 4c3058b0d9 Remove Duplicative MySQL Error: Error in GetMiniLoginAccount query ' 2015-01-20 01:42:14 -06:00
Akkadius 94e63885fb Remove Duplicative MySQL Error: Error in GetBlockedSpellsCount query ' 2015-01-20 01:42:12 -06:00
Akkadius edbed7184f Remove Duplicative MySQL Error: Error in SetVariable query ' 2015-01-20 01:42:12 -06:00
Akkadius 77a2737ad0 Remove Duplicative MySQL Error: Error in group update query: %s\n 2015-01-20 01:42:11 -06:00
Akkadius 8160768fcc Remove Duplicative MySQL Error: Error in LoadVariables query ' 2015-01-20 01:42:11 -06:00
Akkadius 992f99303e Remove Duplicative MySQL Error: Error in SetZoneTZ query ' 2015-01-20 01:42:09 -06:00
Akkadius 63682510a8 Remove Duplicative MySQL Error: Error in GetCharName query ' 2015-01-20 01:42:09 -06:00
Akkadius 9574e91669 Remove Duplicative MySQL Error: Error in GetZoneTZ query ' 2015-01-20 01:42:08 -06:00
Akkadius c3233c02db Remove Duplicative MySQL Error: Error in GetAccountName query ' 2015-01-20 01:42:08 -06:00
Akkadius d46ede8db1 Remove Duplicative MySQL Error: Error in GetUseCFGSafeCoords query ' 2015-01-20 01:42:07 -06:00
Akkadius 9f9253220c Remove Duplicative MySQL Error: Error in GetAccountIDByAcc query ' 2015-01-20 01:42:07 -06:00
Akkadius ffed0514d2 Remove Duplicative MySQL Error: Error in DeleteMerchantTemp query ' 2015-01-20 01:42:06 -06:00
Akkadius 28506839c0 Remove Duplicative MySQL Error: Error in GetAccountIDByChar query ' 2015-01-20 01:42:05 -06:00
Akkadius 04754c67a7 Remove Duplicative MySQL Error: Error in SaveMerchantTemp query ' 2015-01-20 01:42:04 -06:00
Akkadius 590fa78539 Remove Duplicative MySQL Error: Error in SetBotInspectMessage query ' 2015-01-20 01:42:04 -06:00
Akkadius efaff32153 Remove Duplicative MySQL Error: Error in SetLocalPassword query ' 2015-01-20 01:42:04 -06:00
Akkadius 396621e32e Remove Duplicative MySQL Error: Error in GetGridType query ' 2015-01-20 01:42:02 -06:00
Akkadius abab487d7e Remove Duplicative MySQL Error: Error in GetBotInspectMessage query ' 2015-01-20 01:42:02 -06:00
Akkadius 539f216ca6 Remove Duplicative MySQL Error: Error in DeleteAccount query ' 2015-01-20 01:42:02 -06:00
Akkadius ca21aa70cf Remove Duplicative MySQL Error: Error loading Mercenaries from database. Bad query: 2015-01-20 01:41:58 -06:00
Akkadius 8697b9a630 Remove Duplicative MySQL Error: Error in SetDynamicCount query: %s 2015-01-20 01:41:58 -06:00
Akkadius a2514c9d64 Remove Duplicative MySQL Error: Error in GetCommands query ' 2015-01-20 01:41:58 -06:00
Akkadius e2bc4ec647 Remove Duplicative MySQL Error: Error in CreateAccount query ' 2015-01-20 01:41:58 -06:00
Akkadius c765003ef2 Remove Duplicative MySQL Error: Error loading NPCs from database. Bad query: 2015-01-20 01:41:54 -06:00
Akkadius 00cfd77c26 Remove Duplicative MySQL Error: Error in DeleteStaticZone query: %s 2015-01-20 01:41:54 -06:00
Akkadius 5f34f7e1a2 Remove Duplicative MySQL Error: Error in GetBook query ' 2015-01-20 01:41:54 -06:00
Akkadius 9dd35679e5 Remove Duplicative MySQL Error: Error in CreateAccount query ' 2015-01-20 01:41:54 -06:00
Akkadius f1fd957e90 Remove Duplicative MySQL Error: ERROR Potionbelt Save: 2015-01-20 01:41:47 -06:00
Akkadius 22feb20def Remove Duplicative MySQL Error: Error in GetMaxNPCSpellsEffectsID query ' 2015-01-20 01:41:47 -06:00
Akkadius 04ed14f424 Remove Duplicative MySQL Error: Error in SetAccountFlags query ' 2015-01-20 01:41:47 -06:00
Akkadius 9d89ad53de Remove Duplicative MySQL Error: Error in ChangeStaticZone query: %s 2015-01-20 01:41:47 -06:00
Akkadius f15221784c Remove Duplicative MySQL Error: Error in SetSharedPlatinum query ' 2015-01-20 01:41:47 -06:00
Akkadius 3a3cc8a8f6 Remove Duplicative MySQL Error: Error in CheckStatus query ' 2015-01-20 01:41:46 -06:00
Akkadius 6dcbccc0b6 Remove Duplicative MySQL Error: ERROR Bandolier Save: 2015-01-20 01:41:45 -06:00
Akkadius 0313ab2ac2 Remove Duplicative MySQL Error: Error in AddNPCSpells query1 ' 2015-01-20 01:41:45 -06:00
Akkadius be4f8196c6 Remove Duplicative MySQL Error: Error in DBLoadDoors query ' 2015-01-20 01:41:45 -06:00
Akkadius 7f76ee04b0 Remove Duplicative MySQL Error: Error in LoadAccountFlags query ' 2015-01-20 01:41:44 -06:00
Akkadius bdc3834f5a Remove Duplicative MySQL Error: Error in BootStaticZone query: %s 2015-01-20 01:41:44 -06:00
Akkadius 487c53794c Remove Duplicative MySQL Error: Error in GetSharedPlatinum query ' 2015-01-20 01:41:44 -06:00
Akkadius f0197219ab Remove Duplicative MySQL Error: Error in Log IP query ' 2015-01-20 01:41:44 -06:00
Akkadius 38723fc4bf Remove Duplicative MySQL Error: Error in UpdateBug ' 2015-01-20 01:41:35 -06:00
Akkadius 0e229895ec Remove Duplicative MySQL Error: Error in GetMaxNPCSpellsID query ' 2015-01-20 01:41:35 -06:00
Akkadius 71fee1ddb6 Remove Duplicative MySQL Error: Error in GetDoorsCountPlusOne query ' 2015-01-20 01:41:35 -06:00
Akkadius 6decdb6788 Remove Duplicative MySQL Error: Error in IsDiscovered query ' 2015-01-20 01:41:35 -06:00
Akkadius cb78ee6ccd Remove Duplicative MySQL Error: Error in DeleteLauncher 2nd query: %s 2015-01-20 01:41:34 -06:00
Akkadius 7a90d52e62 Remove Duplicative MySQL Error: Error in SetGMSpeed query ' 2015-01-20 01:41:34 -06:00
Akkadius 611e6e7d4e Remove Duplicative MySQL Error: Error in Database::AddBannedIP query ' 2015-01-20 01:41:34 -06:00
Akkadius c82ada6dc4 Remove Duplicative MySQL Error: 2015-01-20 01:38:43 -06:00
Akkadius ef312b7b48 Remove Duplicative MySQL Error: 2015-01-20 01:38:43 -06:00
Akkadius fb03e8c67d Remove Duplicative MySQL Error: Error querying database for monster summoning pet in zone %s (%s) 2015-01-20 01:37:58 -06:00
Akkadius 60d7b59ac8 Remove Duplicative MySQL Error: Unable to query zone flags: %s 2015-01-20 01:37:58 -06:00
Akkadius 8ecbf7c4dc Remove Duplicative MySQL Error: Query failed: %s. 2015-01-20 01:37:58 -06:00
Akkadius e271049fad Remove Duplicative MySQL Error: Error in CreateLauncher query: %s 2015-01-20 01:37:57 -06:00
Akkadius d566bb4728 Remove commented printf : Used up to slot %d of %d in links\n 2015-01-20 01:35:04 -06:00
Akkadius 9ed412e056 Remove commented printf : \tLinkTo %d: dest %d, reach %d\n 2015-01-20 01:35:03 -06:00
Akkadius 5dfb66bd63 Remove commented printf : \tLinkFrom %d: dest %d, reach %d\n 2015-01-20 01:35:02 -06:00
Akkadius dc44c1c361 Remove commented printf : Node %d: (%.2f,%.2f,%.2f) LO %d, D %d\n 2015-01-20 01:35:01 -06:00
Akkadius 2ccfc5b52d Remove commented printf : Filling node %d/%d n=0x%x, lb=0x%x, curl=0x%x/0x%x\n 2015-01-20 01:34:59 -06:00
Akkadius 33a840a0e7 Remove commented printf : Started With node index %d (0x%x)\n 2015-01-20 01:34:58 -06:00
Akkadius 6243a53e5c Remove commented printf : Edge crosses %d edges.\n 2015-01-20 01:34:53 -06:00
Akkadius e4025545fe Remove commented printf : Checking combine LOS on %d, with %d edges.\n 2015-01-20 01:34:51 -06:00
Akkadius f8300693b4 Remove commented printf : Adding item2: %i 2015-01-20 01:34:50 -06:00
Akkadius ed4f2c7e14 Remove commented printf : Distbbb %f, ce2 %f, (%f,%f), (%f,%f)\n 2015-01-20 01:34:49 -06:00
Akkadius 69c4bc0dbd Remove commented printf : Client Spell casted on %s\n 2015-01-20 01:34:48 -06:00
Akkadius bc84e4e80e Remove commented printf : Dist %f, ce2 %f\n 2015-01-20 01:34:48 -06:00
Akkadius 146d7d46a9 Remove commented printf : NPC AE, fall thru. spell_id:%i, Target type:%x\n 2015-01-20 01:34:46 -06:00
Akkadius 725a2d29a2 Remove commented printf : Starting clean at pos %d with %d nodes\n 2015-01-20 01:34:46 -06:00
Akkadius d5cdfdc33c Remove commented printf : IPC mgb/aebard spell casted on %s\n 2015-01-20 01:34:44 -06:00
Akkadius 40453f605d Remove commented printf : (%.3f,%.3f,%.3f) -> (%.3f,%.3f,%.3f) d2=%.3f\n 2015-01-20 01:34:44 -06:00
Akkadius bbbb63ecf5 Remove commented printf : IPC Spell casted on %s\n 2015-01-20 01:34:43 -06:00
Akkadius e7cfaf8bae Remove commented printf : IIN: (%.3f,%.3f) in (%.3f -> %.3f, %.3f -> %.3f)\n 2015-01-20 01:34:42 -06:00
Akkadius d5401b41de Remove commented printf : Cut (%.3f,%.3f,%.3f) -> (%.3f,%.3f,%.3f) d2=%.3f\n 2015-01-20 01:34:42 -06:00
Akkadius 29a19b8f9e Remove commented printf : Closed packet file.\n 2015-01-20 01:34:42 -06:00
Akkadius 138436f46d Remove commented printf : NPC AE, fall thru. spell_id:%i, Target type:%x\n 2015-01-20 01:34:40 -06:00
Akkadius 04bd05162c Remove commented printf : Got to node index %d (0x%x)\n 2015-01-20 01:34:40 -06:00
Akkadius 236e3e0d72 Remove commented printf : Node %d's distance from root is %d\n 2015-01-20 01:34:40 -06:00
Akkadius 767781bd0a Remove commented printf : trail = 0x%x(0x%x) (%.3f, %.3f, %.3f)\n 2015-01-20 01:34:40 -06:00
Akkadius b746385e45 Remove commented printf : Opening packet file: %s\n 2015-01-20 01:34:40 -06:00
Akkadius 245351e351 Remove commented printf : NPC mgb/aebard spell casted on %s\n 2015-01-20 01:34:38 -06:00
Akkadius b31c8c7a8f Remove commented printf : Proc %s(%d): %p\n 2015-01-20 01:34:38 -06:00
Akkadius 63496fd33c Remove commented printf : ;\n 2015-01-20 01:34:38 -06:00
Akkadius 5553c874ec Remove commented printf : ;\n 2015-01-20 01:34:37 -06:00
Akkadius 53b866d35c Remove commented printf : Frag 36 reference?: %ld\n 2015-01-20 01:34:37 -06:00
Akkadius 965f8bbbba Remove commented printf : Final node with %u faces, list offset %lu.\n 2015-01-20 01:34:37 -06:00
Akkadius db4426c435 Remove commented printf : Find Region %ld in node %ld\n 2015-01-20 01:34:37 -06:00
Akkadius 6ba30c3fb2 Remove commented printf : Look for %s: got %s\n 2015-01-20 01:34:37 -06:00
Akkadius 562f7c1360 Remove commented printf : Final node with %u faces, list offset %lu.\n 2015-01-20 01:34:37 -06:00
Akkadius 8594d3d550 Remove commented printf : Find Region %ld in node %ld\n 2015-01-20 01:34:37 -06:00
Akkadius 34f1df1163 Remove commented printf : Final node with %u nodes, list offset %lu.\n 2015-01-20 01:34:37 -06:00
Akkadius 880b1e7a0d Remove commented printf : Node %d's longest path is %d\n 2015-01-20 01:34:36 -06:00
Akkadius b1497cac56 Remove commented printf : pos=%d/%d\n 2015-01-20 01:34:36 -06:00
Akkadius 4c1227165c Remove commented printf : Write @ %d(%d). %d bytes.\n 2015-01-20 01:34:36 -06:00
Akkadius f73f764f2a Remove commented printf : Closed packet file.\n 2015-01-20 01:34:36 -06:00
Akkadius ff9bc4e953 Remove commented printf : NPC Spell casted on %s\n 2015-01-20 01:33:31 -06:00
Akkadius afbc8b0765 Remove commented printf : Spawning object %s at %f,%f,%f\n 2015-01-20 01:33:31 -06:00
Akkadius ce517f3bdc Remove commented printf : Spawned Merc with ID %i\n 2015-01-20 01:33:31 -06:00
Akkadius 2e763a77f7 Remove commented printf : ProcP %d: %p\n 2015-01-20 01:33:31 -06:00
Akkadius 7c3502d5f2 Remove commented printf : 2015-01-20 01:33:31 -06:00
Akkadius 6bf8c217ad Remove commented printf : 2015-01-20 01:33:31 -06:00
Akkadius 072339d24c Remove commented printf : Opening %s.mod\n 2015-01-20 01:33:31 -06:00
Akkadius 0fc5247279 Remove commented printf : fnlen is %d, %s\n 2015-01-20 01:33:30 -06:00
Akkadius 2e4fd5f983 Remove commented printf : Returning %s\n 2015-01-20 01:33:30 -06:00
Akkadius 55cb66762c Remove commented printf : Node %u: (%.2f -> %.2f, %.2f -> %.2f)\n 2015-01-20 01:33:30 -06:00
Akkadius 9c6ba3164d Remove commented printf : Find Region %ld in node %ld\n 2015-01-20 01:33:30 -06:00
Akkadius c1dca8f6a9 Remove commented printf : v1=%d, v2=%d, v3=%d, g=%d, unk=%d\n 2015-01-20 01:33:30 -06:00
Akkadius 63ab54bf1f Remove commented printf : Look for %s: got %s\n 2015-01-20 01:33:30 -06:00
Akkadius 36dda4ee0a Remove commented printf : Node %u: (%.2f -> %.2f, %.2f -> %.2f)\n 2015-01-20 01:33:30 -06:00
Akkadius 467272c334 Remove commented printf : Find Region %ld in node %ld\n 2015-01-20 01:33:29 -06:00
Akkadius cc9b0ff089 Remove commented printf : Node %u: (%.2f -> %.2f, %.2f -> %.2f)\n 2015-01-20 01:33:29 -06:00
Akkadius afdaba60fe Remove commented printf : New Color at: (%.3f,%.3f,%.3f)\n 2015-01-20 01:33:29 -06:00
Akkadius db5778916e Remove commented printf : Missed: (%.3f, %.3f, %.3f)\n 2015-01-20 01:33:29 -06:00
Akkadius cfe4aeb289 Remove commented printf : ReadMemory: hProcess: %p, baseAddr: %p, buffer: %p, size: %d, read: %d, result: %d\n 2015-01-20 01:33:29 -06:00
Akkadius b15656b32b Remove commented printf : Read @ %d(%d). %d bytes. (%c)\n 2015-01-20 01:33:29 -06:00
Akkadius 4e19cf0b5d Remove commented printf : Got %d bytes: %.*s\n 2015-01-20 01:33:29 -06:00
Akkadius 82c898f6bf Remove commented printf : Opening packet file: %s\n 2015-01-20 01:33:29 -06:00
Akkadius 84be3458b1 Remove commented printf : Named: %s\n 2015-01-20 01:33:21 -06:00
Akkadius 76586b5dbb Remove commented printf : %i: Basetex: %s\n 2015-01-20 01:33:19 -06:00
Akkadius 3138f0f9bc Remove commented printf : %s %s\n 2015-01-20 01:33:17 -06:00
Akkadius f29ca568df Remove commented printf : %s ID: %i profile mismatch, not converting. PP %u - Profile Length %u \n 2015-01-20 01:33:17 -06:00
Akkadius c33ac2981b Remove commented std::cout : \n 2015-01-20 01:32:27 -06:00
Akkadius 96a06f1cee Remove commented std::cout : Awake from condition, must have a stream now 2015-01-20 01:31:06 -06:00
Akkadius 1a2b3b50ce Remove commented std::cout : No streams, waiting on condition 2015-01-20 01:31:05 -06:00
Akkadius 421ecf6fce Remove commented std::cout : Removing connection 2015-01-20 01:31:04 -06:00
Akkadius 91e9163602 Remove commented std::cout : Push(): Unlocking MNewStreams 2015-01-20 01:31:03 -06:00
Akkadius 2c191fce7c Remove commented std::cout : Push():Locking MNewStreams 2015-01-20 01:31:02 -06:00
Akkadius f6e2829892 Remove commented std::cout : Pop(): Unlocking MNewStreams 2015-01-20 01:31:00 -06:00
Akkadius dacad2e154 Remove commented std::cout : Pop():Locking MNewStreams 2015-01-20 01:30:58 -06:00
Akkadius fb5e988ed8 Remove commented std::cout : Tlevel: 2015-01-20 01:30:56 -06:00
Akkadius b5fe23a4c3 Remove commented std::cout : CastToTrap error 2015-01-20 01:30:56 -06:00
Akkadius 4ffc09b306 Remove commented std::cout : Starting factory Writer 2015-01-20 01:30:56 -06:00
Akkadius 47b0f6ca9e Remove commented std::cout : Gender in: 2015-01-20 01:30:53 -06:00
Akkadius 849ec2850f Remove commented std::cout : CastToTrap error 2015-01-20 01:30:53 -06:00
Akkadius b2e4c98848 Remove commented std::cout : Sending mana update: 2015-01-20 01:30:53 -06:00
Akkadius 716b377378 Remove commented std::cout : Starting factory Reader 2015-01-20 01:30:53 -06:00
Akkadius 35fcc69639 Remove commented std::cout : Got OP_SessionRequest 2015-01-20 01:30:53 -06:00
Akkadius 951f98a63e Re-Implement GMSay colors: http://i.imgur.com/tQbuKUM.jpg 2015-01-20 00:53:52 -06:00
Akkadius 4c18b96aa5 Remove some old MySQL debugging 2015-01-20 00:25:14 -06:00
Akkadius 4a6305f8cb MySQL Query Logging add rows returned 2015-01-20 00:21:00 -06:00
Uleat 4b0f5064f6 Fix for Inventory::_HasItemByUse(bucket) using the parent container when searching for bag container items 2015-01-20 01:19:08 -05:00
Akkadius 1ad210ff29 Add MySQL Query logging at root 2015-01-20 00:14:18 -06:00
Akkadius 1928be9dd3 Remove some old MySQL logging for errors 2015-01-19 23:59:59 -06:00
Akkadius f239b113b9 Add MySQL query category 2015-01-19 23:52:11 -06:00
Akkadius 45560f6654 Remove some old MySQL logging for errors 2015-01-19 23:48:30 -06:00
Michael Cook (mackal) 5c56929a23 Fix compile error with GCC 2015-01-20 00:04:22 -05:00
Uleat e70e443950 Implemented 'enum class ClientVersion' -- added 'RoF2' to lua client version enumeration 2015-01-19 23:32:57 -05:00
Paul Coene b96be9d5b8 Made familiars persistent. 2015-01-19 13:07:37 -05:00
JJ 52eb287082 Update to 6535690a69 to make explicit #include rather than implicit. 2015-01-19 11:00:05 -05:00
Akkadius 9546023101 Add console color for MySQL Error logging 2015-01-19 05:58:59 -06:00
Akkadius 99dc83a9fd Convert MySQL Error logging to EQEmuLogSys and create MySQL Error category 2015-01-19 05:58:03 -06:00
Akkadius acb677a4ba More cleanup of some QueryDatabase references that no longer need auto results 2015-01-19 05:40:27 -06:00
Akkadius 98a49ad086 More cleanup of some QueryDatabase references that no longer need auto results 2015-01-19 05:39:51 -06:00
Akkadius 99baba4762 More cleanup of some QueryDatabase references that no longer need auto results 2015-01-19 05:38:23 -06:00
Akkadius 5ab131dcd6 More cleanup of some QueryDatabase references that no longer need auto results 2015-01-19 05:35:28 -06:00
Akkadius f20ff5c6e3 Cleanup of some QueryDatabase references that no longer need auto results 2015-01-19 05:32:34 -06:00
Akkadius e4200abc4f Remove Duplicative MySQL Error: Error executing query '%s': %s 2015-01-19 05:26:19 -06:00
Akkadius d608b5afd6 Remove Duplicative MySQL Error: Error getting loot drop info from database: %s, %s 2015-01-19 05:26:18 -06:00
Akkadius 7c52755eac Remove Duplicative MySQL Error: Error loading guild member '%s': %s 2015-01-19 05:26:18 -06:00
Akkadius 5930510274 Remove Duplicative MySQL Error: Error getting loot table info from database: %s, %s 2015-01-19 05:26:17 -06:00
Akkadius 28285d6c59 Remove Duplicative MySQL Error: Error loading guild member '%s': %s 2015-01-19 05:26:16 -06:00
Akkadius f4e74705cf Remove Duplicative MySQL Error: Error getting loot table info from database: %s, %s 2015-01-19 05:26:15 -06:00
Akkadius 417777a6f1 Remove Duplicative MySQL Error: Error loading guild member list '%s': %s 2015-01-19 05:26:15 -06:00
Akkadius 9ad299fa68 Remove Duplicative MySQL Error: Error getting loot table info from database: %s, %s 2015-01-19 05:26:13 -06:00
Akkadius 315f5e0ca4 Remove Duplicative MySQL Error: Error %s: '%s': %s 2015-01-19 05:26:13 -06:00
Akkadius cacf9df269 Remove Duplicative MySQL Error: Error in GetHighestWaypoint query '%s': %s 2015-01-19 05:26:10 -06:00
Akkadius 1e30a75cdc Remove Duplicative MySQL Error: Error in LoadBaseData query '%s' %s 2015-01-19 05:26:10 -06:00
Akkadius 85659dd200 Remove Duplicative MySQL Error: Error setting public note for char %d '%s': %s 2015-01-19 05:26:10 -06:00
Akkadius 499364e9fe Remove Duplicative MySQL Error: Error in GetFreeGrid query '%s': %s 2015-01-19 05:26:09 -06:00
Akkadius b603344ecd Remove Duplicative MySQL Error: Error in GetMaxBaseDataLevel query '%s' %s 2015-01-19 05:26:09 -06:00
Akkadius 3f3368e60c Remove Duplicative MySQL Error: Error retrieving alt flag '%s': %s 2015-01-19 05:26:08 -06:00
Akkadius 2ef8f79338 Remove Duplicative MySQL Error: Error adding grid entry '%s': '%s' 2015-01-19 05:26:08 -06:00
Akkadius 27d16a0a3e Remove Duplicative MySQL Error: Error in LoadSpells query '%s' %s 2015-01-19 05:26:07 -06:00
Akkadius bf7c40d7a5 Remove Duplicative MySQL Error: Error retrieving banker flag '%s': %s 2015-01-19 05:26:07 -06:00
Akkadius 6cde969780 Remove Duplicative MySQL Error: Error in LoadPetInfo query '%s': %s 2015-01-19 05:26:06 -06:00
Akkadius ca53c40899 Remove Duplicative MySQL Error: Error getting next waypoint id '%s': '%s' 2015-01-19 05:26:06 -06:00
Akkadius 626aa140da Remove Duplicative MySQL Error: Error in GetMaxSpellID query '%s' %s 2015-01-19 05:26:06 -06:00
Akkadius 6ae05eef38 Remove Duplicative MySQL Error: Error removing char %d from guild '%s': %s 2015-01-19 05:26:06 -06:00
Akkadius f7f34d8d30 Remove Duplicative MySQL Error: Error in LoadPetInfo query '%s': %s 2015-01-19 05:26:05 -06:00
Akkadius 05aba517c2 Remove Duplicative MySQL Error: Error updating spawn2 pathing '%s': '%s' 2015-01-19 05:26:05 -06:00
Akkadius b8f7d88219 Remove Duplicative MySQL Error: Error in LoadDamageShieldTypes: %s %s 2015-01-19 05:26:05 -06:00
Akkadius 5df58973a8 Remove Duplicative MySQL Error: Error Changing char %d to guild %d '%s': %s 2015-01-19 05:26:05 -06:00
Akkadius 02d034b046 Remove Duplicative MySQL Error: Error in LoadPetInfo query '%s': %s 2015-01-19 05:26:04 -06:00
Akkadius 9003276f23 Remove Duplicative MySQL Error: Error adding grid '%s': '%s' 2015-01-19 05:26:04 -06:00
Akkadius 056b172d7d Remove Duplicative MySQL Error: GetFriendsAndIgnore query error %s, %s 2015-01-19 05:26:03 -06:00
Akkadius f43211afad Remove Duplicative MySQL Error: Error getting npc faction info from database: %s, %s 2015-01-19 05:26:03 -06:00
Akkadius 6753517bb1 Remove Duplicative MySQL Error: Error setting Channel for guild %d '%s': %s 2015-01-19 05:26:03 -06:00
Akkadius 4de2c0e99b Remove Duplicative MySQL Error: Error in LoadBuffs query '%s': %s 2015-01-19 05:26:02 -06:00
Akkadius e5dd2634f9 Remove Duplicative MySQL Error: Error setting pathgrid '%s': '%s' 2015-01-19 05:26:02 -06:00
Akkadius 6f48d84b82 Remove Duplicative MySQL Error: Error adding friend/ignore, query was %s : %s 2015-01-19 05:26:02 -06:00
Akkadius beeba6c8be Remove Duplicative MySQL Error: Error getting npc faction info from database: %s, %s 2015-01-19 05:26:02 -06:00
Akkadius e726c7356a Remove Duplicative MySQL Error: Error setting URL for guild %d '%s': %s 2015-01-19 05:26:02 -06:00
Akkadius fac715012b Remove Duplicative MySQL Error: Error in SaveBuffs query '%s': %s 2015-01-19 05:26:01 -06:00
Akkadius 1595395f69 Remove Duplicative MySQL Error: Error deleting waypoint '%s': '%s' 2015-01-19 05:26:01 -06:00
Akkadius 729283ad01 Remove Duplicative MySQL Error: Error expiring unread messages, %s %s 2015-01-19 05:26:00 -06:00
Akkadius d4c0947280 Remove Duplicative MySQL Error: LoadItems '%s', %s 2015-01-19 05:26:00 -06:00
Akkadius 30b87fb2ea Remove Duplicative MySQL Error: Error setting MOTD for guild %d '%s': %s 2015-01-19 05:26:00 -06:00
Akkadius e15b551164 Remove Duplicative MySQL Error: Error in LoadAltCurrencyValues query '%s': %s 2015-01-19 05:25:59 -06:00
Akkadius 3f75eba5e0 Remove Duplicative MySQL Error: Error adding waypoint '%s': '%s' 2015-01-19 05:25:59 -06:00
Akkadius 75ea162c2b Remove Duplicative MySQL Error: Error in DisableRecipe query '%s': %s 2015-01-19 05:25:59 -06:00
Akkadius 363a4b95c1 Remove Duplicative MySQL Error: Error in LoadSpawnConditions events query '%s': %s 2015-01-19 05:25:58 -06:00
Akkadius af0e80fbf3 Remove Duplicative MySQL Error: Error expiring read messages, %s %s 2015-01-19 05:25:58 -06:00
Akkadius 9d1da53d97 Remove Duplicative MySQL Error: Error in GetItemsCount '%s': '%s' 2015-01-19 05:25:58 -06:00
Akkadius ad70e4f051 Remove Duplicative MySQL Error: Error changing leader on guild %d '%s': %s 2015-01-19 05:25:58 -06:00
Akkadius 06bef2fc6d Remove Duplicative MySQL Error: Error in ZoneDatabase::RaidGroupCount query '%s': %s 2015-01-19 05:25:56 -06:00
Akkadius a04aecae0e Remove Duplicative MySQL Error: Error in Zone::LoadTickItems: %s (%s) 2015-01-19 05:25:56 -06:00
Akkadius 99dd77cff0 Remove Duplicative MySQL Error: Error deleting grid entries '%s': '%s' 2015-01-19 05:25:56 -06:00
Akkadius dfec624b8d Remove Duplicative MySQL Error: Error in EnableRecipe query '%s': %s 2015-01-19 05:25:56 -06:00
Akkadius 2a3b9b65fc Remove Duplicative MySQL Error: Error in LoadSpawnConditions query '%s': %s 2015-01-19 05:25:56 -06:00
Akkadius 8c629529d7 Remove Duplicative MySQL Error: Error in GetAASkillVars '%s': %s 2015-01-19 05:25:56 -06:00
Akkadius b866b98989 Remove Duplicative MySQL Error: Error expiring trash messages, %s %s 2015-01-19 05:25:55 -06:00
Akkadius a128c74090 Remove Duplicative MySQL Error: GetInventory query '%s' %s 2015-01-19 05:25:55 -06:00
Akkadius fa1e73fa03 Remove Duplicative MySQL Error: Error in _GetFreeGuildID query '%s': %s 2015-01-19 05:25:55 -06:00
Akkadius 102c0416f8 Remove Duplicative MySQL Error: Error in ZoneDatabase::GroupCount query '%s': %s 2015-01-19 05:25:54 -06:00
Akkadius 800378d944 Remove Duplicative MySQL Error: Error in Zone::LoadNPCEmotes: %s (%s) 2015-01-19 05:25:53 -06:00
Akkadius 430263de9c Remove Duplicative MySQL Error: Error deleting grid '%s': '%s' 2015-01-19 05:25:53 -06:00
Akkadius c4ebfa8890 Remove Duplicative MySQL Error: Error in LearnRecipe query '%s': %s 2015-01-19 05:25:53 -06:00
Akkadius 82951fb82d Remove Duplicative MySQL Error: Error in LoadSpawnConditions query '%s': %s 2015-01-19 05:25:53 -06:00
Akkadius 5bce113bd7 Remove Duplicative MySQL Error: CreateNewNPCSpawnGroupCommand Error: %s %s 2015-01-19 05:25:53 -06:00
Akkadius 4ecbc5d2db Remove Duplicative MySQL Error: Error in GetAASkillVars '%s': %s 2015-01-19 05:25:53 -06:00
Akkadius 5faeecd82b Remove Duplicative MySQL Error: Unable to get message count from database. %s %s 2015-01-19 05:25:53 -06:00
Akkadius 756e90b683 Remove Duplicative MySQL Error: GetInventory query '%s' %s 2015-01-19 05:25:52 -06:00
Akkadius ddae2f3d16 Remove Duplicative MySQL Error: Error inserting new guild rank record when storing %d for %d. Giving up. '%s': %s 2015-01-19 05:25:52 -06:00
Akkadius 2ad99b8c23 Remove Duplicative MySQL Error: ERROR Bind Home Save: %s. %s 2015-01-19 05:25:44 -06:00
Akkadius e74666fa3b Remove Duplicative MySQL Error: Error in Zone::LoadAdventureFlavor: %s (%s) 2015-01-19 05:25:44 -06:00
Akkadius e549ae11f2 Remove Duplicative MySQL Error: Error creating grid entry '%s': '%s' 2015-01-19 05:25:44 -06:00
Akkadius 50fd74a2d2 Remove Duplicative MySQL Error: Error in Client::LearnRecipe query '%s': %s 2015-01-19 05:25:44 -06:00
Akkadius 04ae8b1707 Remove Duplicative MySQL Error: Error in LoadDBEvent query '%s': %s 2015-01-19 05:25:44 -06:00
Akkadius 405d025322 Remove Duplicative MySQL Error: CreateNewNPCSpawnGroupCommand Error: %s %s 2015-01-19 05:25:44 -06:00
Akkadius 39c7d30e46 Remove Duplicative MySQL Error: Update item quantity failed. %s : %s 2015-01-19 05:25:44 -06:00
Akkadius 882e7a9802 Remove Duplicative MySQL Error: Error in ZoneDatabase::LoadAAs query '%s': %s 2015-01-19 05:25:43 -06:00
Akkadius d800bd87c4 Remove Duplicative MySQL Error: Error updating status %s, %s 2015-01-19 05:25:43 -06:00
Akkadius 633b953fd3 Remove Duplicative MySQL Error: Error removing guild LFGuild entry, query was %s, %s 2015-01-19 05:25:43 -06:00
Akkadius 912de7704d Remove Duplicative MySQL Error: DeleteSharedBankSlot, bags query '%s': %s 2015-01-19 05:25:43 -06:00
Akkadius 233320330f Remove Duplicative MySQL Error: Error inserting new guild record when storing %d. Giving up. '%s': %s 2015-01-19 05:25:43 -06:00
Akkadius a992ece323 Remove Duplicative MySQL Error: Error in UpdateSpawn2Status query %s: %s 2015-01-19 05:25:37 -06:00
Akkadius 17d51b3ff4 Remove Duplicative MySQL Error: Error in Zone::LoadAlternateCurrencies: %s (%s) 2015-01-19 05:25:37 -06:00
Akkadius 526075a767 Remove Duplicative MySQL Error: Error updating spawn2 '%s': '%s' 2015-01-19 05:25:37 -06:00
Akkadius 590634ebef Remove Duplicative MySQL Error: Error in UpdateRecipeMadecount query '%s': %s 2015-01-19 05:25:37 -06:00
Akkadius 1661691bc9 Remove Duplicative MySQL Error: Error in TaskProximityManager::LoadProximities %s %s 2015-01-19 05:25:37 -06:00
Akkadius db65661a10 Remove Duplicative MySQL Error: Unable to update spawn condition '%s': %s\n 2015-01-19 05:25:37 -06:00
Akkadius 9561634ed8 Remove Duplicative MySQL Error: CreateNewNPCSpawnGroupCommand Error: %s %s 2015-01-19 05:25:36 -06:00
Akkadius e406d1e20c Remove Duplicative MySQL Error: Update item failed. %s : %s 2015-01-19 05:25:36 -06:00
Akkadius e88d0a8a2d Remove Duplicative MySQL Error: Error in ZoneDatabase::LoadAAs query '%s': %s 2015-01-19 05:25:36 -06:00
Akkadius 3a91ae92ab Remove Duplicative MySQL Error: SendMail: Query %s failed with error %s 2015-01-19 05:25:36 -06:00
Akkadius 7cceee14a1 Remove Duplicative MySQL Error: Error expiring player LFGuild entry, query was %s, %s 2015-01-19 05:25:36 -06:00
Akkadius 51fc8d61cc Remove Duplicative MySQL Error: DeleteSharedBankSlot query '%s': %s 2015-01-19 05:25:36 -06:00
Akkadius 30a351a3b8 Remove Duplicative MySQL Error: Error in ListRulesets query %s: %s 2015-01-19 05:25:36 -06:00
Akkadius 7e4eedbebc Remove Duplicative MySQL Error: Error clearing old guild_ranks records when storing %d '%s': %s 2015-01-19 05:25:35 -06:00
Akkadius 63b2f706e4 Remove Duplicative MySQL Error: Error in GetSpawnTimeLeft query '%s': %s 2015-01-19 05:25:33 -06:00
Akkadius 6bf5b5a7fb Remove Duplicative MySQL Error: Error in Zone::LoadVeteranRewards: %s (%s) 2015-01-19 05:25:33 -06:00
Akkadius 598848f4fc Remove Duplicative MySQL Error: Error querying fuzzy spawn2 '%s': '%s' 2015-01-19 05:25:33 -06:00
Akkadius 21ad8e1e7c Remove Duplicative MySQL Error: Error in GetTradeRecept success query '%s': %s 2015-01-19 05:25:33 -06:00
Akkadius be3acf583f Remove Duplicative MySQL Error: Error in RemoveTitle query '%s': %s 2015-01-19 05:25:33 -06:00
Akkadius 2196053f8a Remove Duplicative MySQL Error: 2015-01-19 05:25:32 -06:00
Akkadius 650f7366ab Remove Duplicative MySQL Error: Unable to update spawn event '%s': %s\n 2015-01-19 05:25:32 -06:00
Akkadius 69bb54fd9c Remove Duplicative MySQL Error: NPCSpawnDB Error: %s %s 2015-01-19 05:25:32 -06:00
Akkadius 4fadff785c Remove Duplicative MySQL Error: Delete item failed. %s : %s 2015-01-19 05:25:32 -06:00
Akkadius 9d7b3d0c08 Remove Duplicative MySQL Error: Error in ZoneDatabase::CountAALevels query '%s': %s 2015-01-19 05:25:32 -06:00
Akkadius 86c82718ec Remove Duplicative MySQL Error: Error updating Owner in database: %s, %s 2015-01-19 05:25:32 -06:00
Akkadius aae4691a6e Remove Duplicative MySQL Error: Error inserting guild into LFGuild table, query was %s, %s 2015-01-19 05:25:32 -06:00
Akkadius 4c804e8515 Remove Duplicative MySQL Error: DeleteInventorySlot, bags query '%s': %s 2015-01-19 05:25:31 -06:00
Akkadius 154bd186b1 Remove Duplicative MySQL Error: Error in LoadRules query %s: %s 2015-01-19 05:25:31 -06:00
Akkadius 48a43b0555 Remove Duplicative MySQL Error: Error clearing old guild record when storing %d '%s': %s 2015-01-19 05:25:31 -06:00
Akkadius 22fa5b6ce9 Remove Duplicative MySQL Error: Error in UpdateTimeLeft query %s: %s 2015-01-19 05:25:27 -06:00
Akkadius 8e5541acce Remove Duplicative MySQL Error: Error in Zone::LoadLDoNTrapEntries: %s (%s) 2015-01-19 05:25:26 -06:00
Akkadius 1b99e3e4d1 Remove Duplicative MySQL Error: Error querying spawn2 '%s': '%s' 2015-01-19 05:25:26 -06:00
Akkadius 636f090ce3 Remove Duplicative MySQL Error: Error in tradeskill verify query: '%s': %s 2015-01-19 05:25:26 -06:00
Akkadius d9f492f4e2 Remove Duplicative MySQL Error: Error in CheckTitle query '%s': %s 2015-01-19 05:25:26 -06:00
Akkadius 9cb3762102 Remove Duplicative MySQL Error: 2015-01-19 05:25:26 -06:00
Akkadius 9d23f69a10 Remove Duplicative MySQL Error: Error in CreateSpawn2 query '%s': %s 2015-01-19 05:25:26 -06:00
Akkadius 2ef9e342f7 Remove Duplicative MySQL Error: Error in RefreshPetitionsFromDB query '%s': %s 2015-01-19 05:25:26 -06:00
Akkadius 7bf57fca87 Remove Duplicative MySQL Error: NPCSpawnDB Error: %s %s 2015-01-19 05:25:25 -06:00
Akkadius 6e5b8170c5 Remove Duplicative MySQL Error: error changing permissions: %s : %s 2015-01-19 05:25:25 -06:00
Akkadius bd6f6579ef Remove Duplicative MySQL Error: Error in Client::TryReward(): %s (%s) 2015-01-19 05:25:25 -06:00
Akkadius b312663fd1 Remove Duplicative MySQL Error: Error in ZoneDatabase::CountAAs query '%s': %s 2015-01-19 05:25:25 -06:00
Akkadius 7d27d1ccb1 Remove Duplicative MySQL Error: Error updating password in database: %s, %s 2015-01-19 05:25:25 -06:00
Akkadius 4820288633 Remove Duplicative MySQL Error: Error removing guild from LFGuild table, query was %s, %s 2015-01-19 05:25:25 -06:00
Akkadius 3040a8b1a1 Remove Duplicative MySQL Error: DeleteInventorySlot query '%s': %s 2015-01-19 05:25:25 -06:00
Akkadius 65e9f571af Remove Duplicative MySQL Error: Fauled to create rule set in the database: %s: %s 2015-01-19 05:25:24 -06:00
Akkadius adf3a7ea0e Remove Duplicative MySQL Error: Error reloading guild ranks '%s': %s 2015-01-19 05:25:24 -06:00
Akkadius 09d32d92af Remove Duplicative MySQL Error: Error in UpdateTimeLeft query %s: %s 2015-01-19 05:25:23 -06:00
Akkadius 5645d21082 Remove Duplicative MySQL Error: Error in Zone::LoadLDoNTraps: %s (%s) 2015-01-19 05:25:23 -06:00
Akkadius cec0b5760d Remove Duplicative MySQL Error: Error in GetWaypoints query '%s': %s 2015-01-19 05:25:22 -06:00
Akkadius 6d3b9ae40b Remove Duplicative MySQL Error: 2015-01-19 05:25:22 -06:00
Akkadius 71497f0674 Remove Duplicative MySQL Error: Error in SendTradeskillDetails query '%s': %s 2015-01-19 05:25:22 -06:00
Akkadius 4bcfe5444b Remove Duplicative MySQL Error: Error adding title suffix: %s %s 2015-01-19 05:25:22 -06:00
Akkadius 8756b976bb Remove Duplicative MySQL Error: 2015-01-19 05:25:22 -06:00
Akkadius d4b35740be Remove Duplicative MySQL Error: Error in LoadSpawn2 query '%s': %s 2015-01-19 05:25:21 -06:00
Akkadius 2ae6050a77 Remove Duplicative MySQL Error: Error in GetBasePetItems query '%s': %s 2015-01-19 05:25:21 -06:00
Akkadius cdc449eb7c Remove Duplicative MySQL Error: Error in InsertPetitionToDB query '%s': %s 2015-01-19 05:25:21 -06:00
Akkadius 47752634c0 Remove Duplicative MySQL Error: NPCSpawnDB Error: %s %s 2015-01-19 05:25:21 -06:00
Akkadius e8824e5d14 Remove Duplicative MySQL Error: error promoting item: %s : %s 2015-01-19 05:25:21 -06:00
Akkadius 71842c62de Remove Duplicative MySQL Error: Error in Client::TryReward(): %s (%s) 2015-01-19 05:25:21 -06:00
Akkadius d6ba9d7108 Remove Duplicative MySQL Error: Error in GetTotalAALevels '%s: %s 2015-01-19 05:25:21 -06:00
Akkadius 7878755831 Remove Duplicative MySQL Error: Error in AdventureManager:::GetLeaderboardInfo: %s (%s) 2015-01-19 05:25:20 -06:00
Akkadius 8b5a623c75 Remove Duplicative MySQL Error: Failed to load channels. %s %s 2015-01-19 05:25:20 -06:00
Akkadius 72359b54f0 Remove Duplicative MySQL Error: Error inserting player into LFGuild table, query was %s, %s 2015-01-19 05:25:20 -06:00
Akkadius 807dd5198c Remove Duplicative MySQL Error: UpdateSharedBankSlot query '%s': %s 2015-01-19 05:25:20 -06:00
Akkadius 220daed2c8 Remove Duplicative MySQL Error: Error in LoadRules query %s: %s 2015-01-19 05:25:20 -06:00
Akkadius 5443e879a5 Remove Duplicative MySQL Error: Error reloading guilds '%s': %s 2015-01-19 05:25:20 -06:00
Akkadius 34269c5b69 Remove Duplicative MySQL Error: Error in GetCharactersInInstace query '%s': %s 2015-01-19 05:25:20 -06:00
Akkadius cf655a2907 Remove Duplicative MySQL Error: Error in GetZoneCFG query %s: %s 2015-01-19 05:25:18 -06:00
Akkadius ca27159223 Remove Duplicative MySQL Error: Error in LoadNewMerchantData query '%s' %s 2015-01-19 05:25:18 -06:00
Akkadius 8ac846e32e Remove Duplicative MySQL Error: Error in GetGridType2 query '%s': %s 2015-01-19 05:25:17 -06:00
Akkadius f57509113b Remove Duplicative MySQL Error: Error in LoadTributes level query '%s': %s 2015-01-19 05:25:17 -06:00
Akkadius 8ccb1ca3e7 Remove Duplicative MySQL Error: 2015-01-19 05:25:17 -06:00
Akkadius 0133dd5688 Remove Duplicative MySQL Error: Error in TradeskillSearchResults query '%s': %s 2015-01-19 05:25:17 -06:00
Akkadius d3b00c142d Remove Duplicative MySQL Error: Error adding title: %s %s 2015-01-19 05:25:17 -06:00
Akkadius 380510ff44 Remove Duplicative MySQL Error: 2015-01-19 05:25:17 -06:00
Akkadius 0917eb00b1 Remove Duplicative MySQL Error: Error in LoadSpawn2 query '%s': %s 2015-01-19 05:25:17 -06:00
Akkadius 52553e507f Remove Duplicative MySQL Error: Error in GetBasePetItems query '%s': %s 2015-01-19 05:25:16 -06:00
Akkadius 8cb8aed9b4 Remove Duplicative MySQL Error: Error in UpdatePetitionToDB query '%s': %s 2015-01-19 05:25:16 -06:00
Akkadius 525a513871 Remove Duplicative MySQL Error: NPCSpawnDB Error: %s %s 2015-01-19 05:25:16 -06:00
Akkadius 1f8d483bad Remove Duplicative MySQL Error: Insert Error: %s : %s 2015-01-19 05:25:16 -06:00
Akkadius 0b330b7312 Remove Duplicative MySQL Error: Error in SetGuildDoor query '%s': %s 2015-01-19 05:25:16 -06:00
Akkadius 19dfc9e92d Remove Duplicative MySQL Error: Error in Client::TryReward(): %s (%s) 2015-01-19 05:25:16 -06:00
Akkadius ee0a68fed2 Remove Duplicative MySQL Error: Error in LoadAAEffects query '%s': %s 2015-01-19 05:25:15 -06:00
Akkadius 2b3d14f0ba Remove Duplicative MySQL Error: SoF Start zone query failed: %s : %s\n 2015-01-19 05:25:15 -06:00
Akkadius 03b0fac838 Remove Duplicative MySQL Error: Error in AdventureManager:::LoadAdventureEntries: %s (%s) 2015-01-19 05:25:15 -06:00
Akkadius 50d0bb0d03 Remove Duplicative MySQL Error: Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s) 2015-01-19 05:25:15 -06:00
Akkadius 61a6edc1d0 Remove Duplicative MySQL Error: Unable to get message count from database. %s %s 2015-01-19 05:25:15 -06:00
Akkadius 384d9a4748 Remove Duplicative MySQL Error: Error removing player from LFGuild table, query was %s, %s 2015-01-19 05:25:15 -06:00
Akkadius 4d15ddfc8a Remove Duplicative MySQL Error: UpdateInventorySlot query '%s': %s 2015-01-19 05:25:15 -06:00
Akkadius d8510e7876 Remove Duplicative MySQL Error: Fauled to set rule in the database: %s: %s 2015-01-19 05:25:15 -06:00
Akkadius 382fdc5d18 Remove Duplicative MySQL Error: Error loading guild ranks '%s': %s 2015-01-19 05:25:14 -06:00
Akkadius 9749d7c3af Remove Duplicative MySQL Error: Error in GetAccountIDByChar query '%s': %s 2015-01-19 05:25:14 -06:00
Akkadius 3f0fcefdb4 Remove Duplicative MySQL Error: Error in SaveZoneCFG query %s: %s 2015-01-19 05:25:09 -06:00
Akkadius c81eb674bb Remove Duplicative MySQL Error: Error in LoadTempMerchantData query '%s' %s 2015-01-19 05:25:09 -06:00
Akkadius fa4fb72263 Remove Duplicative MySQL Error: Error in GetHighestGrid query '%s': %s 2015-01-19 05:25:09 -06:00
Akkadius df9f031536 Remove Duplicative MySQL Error: Error in LoadTributes first query '%s': %s 2015-01-19 05:25:09 -06:00
Akkadius e81b03917a Remove Duplicative MySQL Error: Error in LoadTraps query '%s': %s 2015-01-19 05:25:08 -06:00
Akkadius 9fdc22f78b Remove Duplicative MySQL Error: 2015-01-19 05:25:08 -06:00
Akkadius 0c5a902032 Remove Duplicative MySQL Error: Error in HandleAutoCombine query '%s': %s 2015-01-19 05:25:08 -06:00
Akkadius 82af0550df Remove Duplicative MySQL Error: Unable to load titles: %s : %s 2015-01-19 05:25:08 -06:00
Akkadius 346a1b2bb7 Remove Duplicative MySQL Error: 2015-01-19 05:25:08 -06:00
Akkadius ac2b53c94b Remove Duplicative MySQL Error: Error while querying Spell ID %i spell_globals table query '%s': %s 2015-01-19 05:25:08 -06:00
Akkadius 9837e172ac Remove Duplicative MySQL Error: Error in PopulateZoneLists query '%s': %s 2015-01-19 05:25:08 -06:00
Akkadius 41fc0f7f02 Remove Duplicative MySQL Error: Error in GetPoweredPetEntry query '%s': %s 2015-01-19 05:25:07 -06:00
Akkadius 8df0ec05e1 Remove Duplicative MySQL Error: Error in DeletePetitionFromDB query '%s': %s 2015-01-19 05:25:07 -06:00
Akkadius 6cd08b8f27 Remove Duplicative MySQL Error: NPCSpawnDB Error: %s %s 2015-01-19 05:25:07 -06:00
Akkadius be37525414 Remove Duplicative MySQL Error: Error in Mount query '%s': %s 2015-01-19 05:25:07 -06:00
Akkadius de0de39e08 Remove Duplicative MySQL Error: Error Loading guild bank: %s, %s 2015-01-19 05:25:07 -06:00
Akkadius 0491f22e2b Remove Duplicative MySQL Error: Error in CheckGuildDoor query '%s': %s 2015-01-19 05:25:07 -06:00
Akkadius 43da95e784 Remove Duplicative MySQL Error: Error in Forage query '%s': %s 2015-01-19 05:25:06 -06:00
Akkadius 381749933a Remove Duplicative MySQL Error: Error in Client::SendRewards(): %s (%s) 2015-01-19 05:25:06 -06:00
Akkadius 209adc2828 Remove Duplicative MySQL Error: Error in ZoneDatabase::LoadAAEffects2 query: '%s': %s 2015-01-19 05:25:06 -06:00
Akkadius 0832361729 Remove Duplicative MySQL Error: Start zone query failed: %s : %s\n 2015-01-19 05:25:06 -06:00
Akkadius b6b9e388b3 Remove Duplicative MySQL Error: Error in AdventureManager:::LoadAdventures: %s (%s) 2015-01-19 05:25:06 -06:00
Akkadius 5bf3d40570 Remove Duplicative MySQL Error: Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s) 2015-01-19 05:25:06 -06:00
Akkadius 408baba7aa Remove Duplicative MySQL Error: FindCharacter failed. %s %s 2015-01-19 05:25:06 -06:00
Akkadius 8494543164 Remove Duplicative MySQL Error: Failed to load LFGuild info from database. %s %s 2015-01-19 05:25:06 -06:00
Akkadius 34c6022101 Remove Duplicative MySQL Error: Error runing inventory verification query '%s': %s 2015-01-19 05:25:05 -06:00
Akkadius 3f8926d316 Remove Duplicative MySQL Error: Error in LoadRules query %s: %s 2015-01-19 05:25:05 -06:00
Akkadius 3c02cc454d Remove Duplicative MySQL Error: Error loading guilds '%s': %s 2015-01-19 05:25:05 -06:00
Akkadius 32901297e1 Remove Duplicative MySQL Error: StoreCharacter inventory failed. Query '%s' %s 2015-01-19 05:25:05 -06:00
Akkadius 2e8d9ed6a1 Remove Duplicative MySQL Error: Error in GetSpellColumns query '%s' %s 2015-01-19 05:25:05 -06:00
Akkadius 5604230b55 Remove Duplicative MySQL Error: Error in ExportBaseData query '%s' %s 2015-01-19 05:24:59 -06:00
Akkadius 792cf68a1c Remove Duplicative MySQL Error: Error in get_skill query '%s' %s 2015-01-19 05:24:54 -06:00
Akkadius ed09893a0e Remove Duplicative MySQL Error: Error in skill_usable query '%s' %s 2015-01-19 05:24:48 -06:00
Akkadius 53dce15822 Remove Duplicative MySQL Error: Error in ExportSpells query '%s' %s 2015-01-19 05:24:38 -06:00
Akkadius 56a4459aa8 More stuff 2015-01-19 04:27:22 -06:00
Akkadius f9ba4739f5 add global_define.h 2015-01-19 04:12:30 -06:00
Akkadius 0d9b6703a6 Rename debug.h to global_define.h, update cmakelists and such 2015-01-19 04:12:09 -06:00
Akkadius 0b70706a64 Stuff 2015-01-19 04:09:02 -06:00
Akkadius d41ba853cf Added types.h to more files that relied on mutex.h to get to debug.h to get to types.h 2015-01-19 04:04:50 -06:00
Akkadius 045125d328 Add types.h to a bunch of files 2015-01-19 04:02:45 -06:00
Akkadius 89b16512d5 Delete debug.cpp file and from cmake 2015-01-19 03:49:25 -06:00
Akkadius 62ff6453ef Remove EQDEBUG preprocessor from debug 2015-01-19 03:43:30 -06:00
Akkadius fa83809130 Removal of client_logs.h from #includes 2015-01-19 03:40:09 -06:00
Akkadius dda1806dfb File deletion of client_logs and CMakeLists.txt update 2015-01-19 03:38:07 -06:00
Akkadius d7d1f9757b Removal of client_logs.cpp/.h 2015-01-19 03:37:12 -06:00
Akkadius 4d6c2be191 Gut more of debug.cpp/.h 2015-01-19 03:36:50 -06:00
Akkadius 2a6a3e419c Remove logtypes.h from header includes and the file itself 2015-01-19 03:33:15 -06:00
Akkadius 7503e29211 Remove LogSettingsFile from config parsers which removes log.ini completely 2015-01-19 03:28:00 -06:00
Akkadius d45bc6d26a General cleanup 2015-01-19 03:25:46 -06:00
Akkadius ab4595f56d Remove QueryPerformanceCounter code 2015-01-19 03:22:23 -06:00
Akkadius e428b373ac Adjust category names 2015-01-19 03:02:00 -06:00
Akkadius abc2f9cace Convert 'Dropping client:' to Zone Status 2015-01-19 03:00:32 -06:00
Akkadius b3eadea473 Convert 'Client linkdead' to Zone Status 2015-01-19 02:59:02 -06:00
Akkadius 1c47e6b90d Convert 'Unable to get raid id, char not found!' to Error Category 2015-01-19 02:56:52 -06:00
Akkadius af53666fed Convert TimeBroadcast debug message to zone_server category 2015-01-19 02:54:28 -06:00
Akkadius b546848313 Implement EQEmuLogSys::GetConsoleColorFromCategory in ProcessConsoleMessage 2015-01-19 02:54:01 -06:00
Akkadius 2f74f07be7 Add EQEmuLogSys::GetConsoleColorFromCategory(uint16 log_category) to replace the static map 2015-01-19 02:47:51 -06:00
Akkadius 2ecb91d075 Remove Log.Hex completely for real 2015-01-19 02:35:28 -06:00
Akkadius 87e212046f Remove another Log.Hex straggler 2015-01-19 02:33:52 -06:00
Akkadius bf62d1fd26 Sort header functions 2015-01-19 02:32:46 -06:00
Akkadius e554278811 Remove Log.Raw function 2015-01-19 02:32:24 -06:00
Akkadius ee1c55a813 Remove Log.Hex remaining entries 2015-01-19 02:32:09 -06:00
Akkadius 55d73f0b07 Remove Log.Hex references because we're not going to use them anyways per KLS 2015-01-19 02:30:36 -06:00
Trevius 96820c4a31 Some work on RoF Guild Banks (still not functional). 2015-01-18 23:04:21 -06:00
JJ 5465d76d20 VS would like us to return values. 2015-01-18 19:48:32 -05:00
Michael Cook (mackal) f4224b296a We don't need to cast these anymore 2015-01-18 18:29:37 -05:00
JJ 8cde35ca88 Merge pull request #342 from addtheice/data_bundling2
Looks fine on initial review.
2015-01-18 18:04:33 -05:00
Arthur Ice 53862713f9 Switched to position based GetReciprocalHeading instead of Mob::GetReciprocalHeading 2015-01-18 12:38:27 -08:00
Arthur Ice cc802f2e74 Added 'GetReciprocalHeading' to position.cpp/h 2015-01-18 12:23:55 -08:00
Michael Cook (mackal) 7374313fd9 Fix overflow error in lua_create_npc 2015-01-18 14:41:23 -05:00
JJ c471fbe38f Merge pull request #341 from af4t/master
MS Visual Studio vs. position.cpp
2015-01-18 10:57:38 -05:00
Arthur Ice 0aefc0453d Removed Mob::DistNoRootNoZ 2015-01-18 03:54:49 -08:00
Arthur Ice 2ccac25004 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 03:52:17 -08:00
Arthur Ice 97d7d69623 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 03:49:40 -08:00
Arthur Ice ae4e1ef0d0 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 03:44:08 -08:00
Arthur Ice 8a1e03ced4 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 03:37:26 -08:00
Arthur Ice dc275b3b1e Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 03:35:20 -08:00
Arthur Ice 517c084657 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 03:32:28 -08:00
Arthur Ice 99783fd871 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 03:31:07 -08:00
Arthur Ice 69a6a6f3f8 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 03:25:54 -08:00
Arthur Ice 90e011ad99 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 03:24:40 -08:00
Arthur Ice f54c698ffe Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 03:12:08 -08:00
Arthur Ice f33eb9f8f3 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 03:09:08 -08:00
Arthur Ice e58a022e25 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 03:05:35 -08:00
Arthur Ice 8e112aac03 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 03:03:46 -08:00
Arthur Ice 013518cdb5 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 02:59:27 -08:00
Arthur Ice e728280c58 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 02:49:44 -08:00
Arthur Ice 9c3b66df93 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 02:46:30 -08:00
Arthur Ice 83413178c2 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 02:44:49 -08:00
Arthur Ice e5ee13bde0 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 02:43:16 -08:00
Arthur Ice 3f83bc7771 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 02:41:11 -08:00
Akkadius bc4aa08adf Add crashtest command back in for crash log testing 2015-01-18 04:33:04 -06:00
Arthur Ice 9dc24735a4 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 02:25:09 -08:00
Arthur Ice 39e059e256 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 02:21:13 -08:00
Arthur Ice 46eab011f1 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 02:16:56 -08:00
Akkadius d1572790b1 Remove eqemu_error.cpp/.h as they are useless 2015-01-18 04:15:26 -06:00
Arthur Ice 261feabb7d Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 02:14:59 -08:00
Arthur Ice c340fc9c39 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 02:10:42 -08:00
Arthur Ice 095f5d2587 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 02:08:18 -08:00
Arthur Ice 7c7250ee53 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 02:07:01 -08:00
Arthur Ice 952459a313 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 02:05:09 -08:00
Akkadius b6587cc9e2 Removal of logsys.h from #include(s) 2015-01-18 04:03:45 -06:00
Arthur Ice 4abe2fc6ff Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 02:03:44 -08:00
Arthur Ice c6b3060687 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 02:01:20 -08:00
Akkadius a4e96b46ca Delete logsys.cpp and logsys.h 2015-01-18 03:59:51 -06:00
Arthur Ice 0f1be1ecbf Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 01:54:54 -08:00
Akkadius 83906af9b6 Buildable state with converting hex packet dumps 2015-01-18 03:53:35 -06:00
Arthur Ice 4ced883373 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 01:51:36 -08:00
Arthur Ice 3290ddaffa Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 01:44:54 -08:00
Arthur Ice 4431aa0197 Removed Mob::DistNoRootNoZ 2015-01-18 01:39:17 -08:00
Arthur Ice 8619a0b518 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 01:38:30 -08:00
Arthur Ice d9b3d59729 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 01:33:54 -08:00
Arthur Ice baf53890b9 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 01:31:24 -08:00
Arthur Ice 121328b188 Removed a usage of Mob::DistNoRootNoZ and used ComparativeDistanceNoZ instead 2015-01-18 01:27:47 -08:00
Akkadius 14bac9f8c0 Remove occurrences of _pkt 2015-01-18 03:25:52 -06:00
Akkadius b3bedef7af Bunch of crazy changes to remove logsys 2015-01-18 03:23:36 -06:00
Arthur Ice 3ed365cd43 Removed mob:DistNoRoot 2015-01-18 01:22:59 -08:00
Arthur Ice 94261700d9 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-18 01:21:19 -08:00
Arthur Ice 53ad34b060 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-18 01:19:45 -08:00
Arthur Ice 309240de43 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-18 01:18:20 -08:00
Arthur Ice eac35f802a Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-18 01:17:17 -08:00
Arthur Ice 72bad478d6 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-18 01:12:15 -08:00
Arthur Ice 5926c993be Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-18 01:09:21 -08:00
Arthur Ice 3c1ee5970e Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-18 01:07:35 -08:00
Arthur Ice dd70ee13a3 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-18 01:04:37 -08:00
Arthur Ice a6ba08c598 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-18 01:01:44 -08:00
Arthur Ice dd52259dcf Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-18 01:00:00 -08:00
Arthur Ice 9bd4007fd6 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-18 00:58:53 -08:00
Arthur Ice 469b27890b Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-18 00:57:34 -08:00
Akkadius 7fac4d5f52 More gutting of logsys.cpp/h 2015-01-18 02:56:51 -06:00
Arthur Ice 263c9b6d3f Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-18 00:53:24 -08:00
Akkadius f81a8b716b Rip out load_log_settings in all projects 2015-01-18 02:52:32 -06:00
Arthur Ice 9dcdd93549 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-18 00:51:25 -08:00
Arthur Ice a0d012a6d6 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-18 00:48:51 -08:00
Akkadius 9eb05ff999 Delete zone/zone_logsys.cpp 2015-01-18 02:46:34 -06:00
Akkadius e5f641d6b2 Delete logsys_eqemu.cpp 2015-01-18 02:45:18 -06:00
Akkadius b71f808cb8 Gut some more debug functions 2015-01-18 02:43:11 -06:00
Akkadius 3320867b10 delete world/world_logsys.cpp 2015-01-18 02:40:58 -06:00
Akkadius 1ae69aa180 Update debug levels 2015-01-18 02:35:15 -06:00
Akkadius 467b359d0c Moved all EQEmuLogSys:: enum references used in Log.Out to a namespace 'Logs' for shortening of syntax 2015-01-18 02:20:16 -06:00
Kemmler 6535690a69 MS Visual Studio needs help finding std::min and std::max 2015-01-18 03:08:12 -05:00
Akkadius c025765283 Renamed DoLog to Out as the aggregate logging function for simplicity of use and shortened syntax of Log.Out 2015-01-18 02:00:15 -06:00
Arthur Ice 37e4829ac4 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 23:55:16 -08:00
Akkadius 1c048cb1d1 Renamed DebugCategory to DoLog as the aggregate logging function for simplicity of use and shortened syntax of Log.DoLog 2015-01-18 01:54:09 -06:00
Akkadius af8ab89a36 Compile state 2015-01-18 01:50:05 -06:00
Arthur Ice 864e9ba8ef Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 23:48:44 -08:00
Akkadius b15e5f7913 Refactor GMSayHookCallBackProcess to use category instead of type 2015-01-18 01:48:07 -06:00
Akkadius 40d12d952e Refactor ProcessConsoleMessage to no longer use type 2015-01-18 01:45:58 -06:00
Akkadius 564bff07fe Refactor ProcessLogWrite to no longer use type 2015-01-18 01:42:23 -06:00
Akkadius 0926a5ded3 Refactor ProcessGMSay to no longer use type 2015-01-18 01:41:11 -06:00
Akkadius 57ac6c0e98 Remove EQEmuLogSys::Log from consolidation of types into categories 2015-01-18 01:39:01 -06:00
Akkadius 063a9214ae Consolidate 'LogType' Debug logs over to 'LogCategory' 2015-01-18 01:37:54 -06:00
Arthur Ice fccd767330 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 23:37:00 -08:00
Akkadius 375f4af946 Consolidate 'LogType' Error (Straggler) logs over to 'LogCategory' 2015-01-18 01:36:10 -06:00
Akkadius b511857333 Consolidate 'LogType' Commands logs over to 'LogCategory' 2015-01-18 01:34:31 -06:00
Arthur Ice f047ed232d Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 23:33:34 -08:00
Akkadius 40d0fba63f Consolidate 'LogType' Quest logs over to 'LogCategory' 2015-01-18 01:32:57 -06:00
Akkadius ec7fd9b4e7 Consolidate 'LogType' Normal logs over to 'LogCategory' 2015-01-18 01:32:18 -06:00
Arthur Ice 0088d353d3 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 23:31:57 -08:00
Akkadius e691735a2d Consolidate 'LogType' Error logs over to 'LogCategory' 2015-01-18 01:30:25 -06:00
Arthur Ice 1bb4ff2d6a Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 23:30:18 -08:00
Akkadius b3fc0ab06d Consolidate 'LogType' Crash logs over to 'LogCategory' 2015-01-18 01:29:28 -06:00
Arthur Ice 9aa46a9af2 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 23:27:57 -08:00
Akkadius e9f8d5fa6d Port Status messages from Type to Category 2015-01-18 01:27:52 -06:00
Arthur Ice c5f38ee700 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 23:26:22 -08:00
Akkadius 975c298c85 Consolidate 'LogType' over to 'LogCategory' 2015-01-18 01:24:35 -06:00
Arthur Ice 81f36675b3 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 23:19:56 -08:00
Arthur Ice 80941d23bd Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 23:16:11 -08:00
Arthur Ice a9c0920bc6 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 23:15:06 -08:00
Arthur Ice fa50ab8a18 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 23:12:25 -08:00
Arthur Ice dc2534e38c Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 23:08:48 -08:00
Arthur Ice a9c5f80968 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 23:07:04 -08:00
Akkadius ef04c90d8e Remove new log prefix from console output 2015-01-18 01:04:59 -06:00
Akkadius 1496f14843 Remove old function code from consolidation 2015-01-18 00:56:26 -06:00
Arthur Ice 15bd08b365 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 22:52:33 -08:00
Akkadius 7dbde36b03 Rename reference logger to Log 2015-01-18 00:41:18 -06:00
Arthur Ice 55024a8615 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 22:41:04 -08:00
Arthur Ice 30eb545b0b Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 22:37:28 -08:00
Arthur Ice d01f307edc Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 22:34:49 -08:00
Akkadius 126eca2ad6 Add opcode name lookup on unhandled client opcode log message 2015-01-18 00:32:11 -06:00
Akkadius 0b687e4779 Fix some unhandled opcode output messages 2015-01-18 00:25:23 -06:00
Arthur Ice 84c82ca4ab Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 22:12:36 -08:00
Arthur Ice 91221db4c9 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 22:07:17 -08:00
Akkadius 726b3a33f5 Consolidate EQEmuLogsys::Debug stragglers to DebugCategory for further refactoring 2015-01-18 00:06:01 -06:00
Akkadius 58d0b86a67 Consolidate EQEmuLogsys::Debug General calls into DebugCategory 2015-01-18 00:00:03 -06:00
Akkadius d45ed9befa Consolidate EQEmuLogsys::Debug calls into DebugCategory 2015-01-17 23:59:06 -06:00
Arthur Ice 7dce5c4e6f Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 21:45:31 -08:00
Arthur Ice 3f37aef41c Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 21:41:53 -08:00
Arthur Ice 8eea92654f Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 21:38:44 -08:00
Arthur Ice 93c5422966 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 21:35:30 -08:00
Arthur Ice 4fa102cb24 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 20:53:08 -08:00
Arthur Ice ef68b46c9c Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 20:49:09 -08:00
Arthur Ice 608809a5dc Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 20:45:32 -08:00
Arthur Ice e44d9ce77f Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 20:14:05 -08:00
Arthur Ice 2b72a50f91 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 20:08:29 -08:00
Arthur Ice a5521badb1 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 20:03:11 -08:00
Arthur Ice dc1db1fa0d Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 19:45:42 -08:00
Arthur Ice 0351ea2d33 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 19:35:39 -08:00
Arthur Ice 6d7e8d7e9a Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 19:32:34 -08:00
Arthur Ice 4174036ce7 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 19:22:59 -08:00
Arthur Ice 0c3efc3c4f Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 19:16:45 -08:00
Arthur Ice 80154d0661 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 19:13:47 -08:00
Arthur Ice 6b979d1c5d Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 19:09:32 -08:00
Arthur Ice bcc4c1e4b6 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 19:07:25 -08:00
Arthur Ice 6f209fd8b9 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 19:00:57 -08:00
Arthur Ice 926cba2cdc Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 18:57:52 -08:00
Arthur Ice 6b3099daac Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 18:54:57 -08:00
Arthur Ice e54cdad85d Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 18:51:06 -08:00
Arthur Ice 8efb9e75f8 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 18:49:24 -08:00
Arthur Ice 65bd2cf8ac Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 18:42:59 -08:00
Arthur Ice e8144cb3ee Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 18:39:59 -08:00
Arthur Ice 9400b860a3 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 18:37:01 -08:00
Arthur Ice 78eb852ed3 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 18:32:41 -08:00
Arthur Ice 1303a297c0 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 18:26:14 -08:00
Arthur Ice 86639f924d Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 18:22:48 -08:00
Arthur Ice d71fc61511 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 18:20:29 -08:00
Arthur Ice 815a208492 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 18:18:35 -08:00
Arthur Ice 262ae383c9 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 18:15:48 -08:00
Arthur Ice 64bd24d5f9 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 18:13:34 -08:00
Arthur Ice f79bad8b4b Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 18:09:43 -08:00
Arthur Ice f43bf5542f Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 18:07:16 -08:00
Arthur Ice 254ec5997c Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 18:05:03 -08:00
Arthur Ice f1937335dd Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 18:01:20 -08:00
Arthur Ice eb2eaa4d68 Removed a usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 17:57:36 -08:00
Arthur Ice 1e2198f5f4 Removed Mob::DistNoZ 2015-01-17 17:53:41 -08:00
Arthur Ice 2d7297dc67 Removed a usage of Mob::DistNoZ and used DistanceNoZ instead 2015-01-17 17:51:52 -08:00
Arthur Ice bff17cddf9 Removed a usage of Mob::DistNoZ and used DistanceNoZ instead 2015-01-17 17:50:08 -08:00
Arthur Ice ee0b9edc21 Removed Mob::Dist 2015-01-17 17:49:16 -08:00
Arthur Ice 8895dd599e Removed usage of Mod::Dist and used Distance instead 2015-01-17 17:44:17 -08:00
Arthur Ice a60c37098c Removed usage of Mod::Dist and used Distance instead 2015-01-17 17:41:26 -08:00
Arthur Ice 1bd4d38537 Removed usage of Mod::Dist and used Distance instead 2015-01-17 17:39:12 -08:00
Arthur Ice 76afc11199 Overloads of xyz_heading means no longer need the static cast here 2015-01-17 16:12:30 -08:00
Arthur Ice a135a3d597 Added explicit xyz_heading overrides for the 4 distance functions 2015-01-17 16:08:45 -08:00
Michael Cook (mackal) 6e06110b75 Remove more extra and incorrect memsets 2015-01-17 19:03:13 -05:00
Arthur Ice 77badffa29 Removed a usage of Mob::Dist and used Distance instead 2015-01-17 16:00:12 -08:00
Arthur Ice 2eaeb38138 Removed a usage of Mob::Dist and used Distance instead 2015-01-17 15:56:06 -08:00
Arthur Ice f1759421d1 Removed Mob::DistNoRoot(x,y,z) 2015-01-17 15:51:26 -08:00
Arthur Ice 70a9a4e7cd Removed usage of Mob::DistNoRoot and used ComparativeDistance instead 2015-01-17 15:42:58 -08:00
Arthur Ice 91b2e23e56 removed usage of mob->distnoroot and switched to ComparativeDistance 2015-01-17 15:37:24 -08:00
Arthur Ice e653a3943a removed usage of mob distnoroot and used ComparativeDistance instead 2015-01-17 15:32:04 -08:00
Arthur Ice 9f8dad894c Added 'GetTargetRingLocation' which will eventualy replace the individual GetTargetRing methods 2015-01-17 15:22:46 -08:00
Arthur Ice 136dee691a removed unused macro debug message 2015-01-17 14:55:41 -08:00
Michael Cook (mackal) fd77fbf163 Merge pull request #313 from addtheice/data_bundling
Data bundling
2015-01-17 17:30:14 -05:00
Arthur Ice 53f3fbfb4d 16 char copy not 32 2015-01-17 14:16:23 -08:00
Michael Cook (mackal) f9a7da61b8 Switch NUMHIT_ enum to a strongly typed enum 2015-01-17 16:18:09 -05:00
Akkadius 7d14fad782 Remove zlog completely 2015-01-17 02:59:49 -06:00
Akkadius 551aadd27a Replace all zlog calls 2015-01-17 02:59:10 -06:00
Akkadius 1069b13992 Remove clog completely 2015-01-17 02:57:47 -06:00
Akkadius bcaaaac090 Replace all clog calls, (Mostly WORLD__) 2015-01-17 02:56:10 -06:00
Akkadius 3d5434b91d Remove mlog and _log completely 2015-01-17 02:54:02 -06:00
Akkadius d490209c9e Convert skill mlog call 2015-01-17 02:52:30 -06:00
Akkadius 483086dc3a Convert OPGMTrainSkill mlogs 2015-01-17 02:50:29 -06:00
Akkadius b0412101b0 Convert Client::HandlePaclet 2015-01-17 02:48:50 -06:00
Akkadius 0641be187d Convert Client unhandled incoming opcodes 2015-01-17 02:46:26 -06:00
Akkadius 648494ec16 port mlog '*PATHING*' category to new log system 2015-01-17 02:33:48 -06:00
Akkadius a46c0ee7e2 Add 'Pathing' log category 2015-01-17 02:32:45 -06:00
Akkadius 5b41bdeec6 port mlog 'CLIENT__TRADING' category to new log system 2015-01-17 02:30:58 -06:00
Akkadius 1405d9e114 port mlog 'CLIENT__SPELLS' category to new log system 2015-01-17 02:28:25 -06:00
Akkadius 6a567288ae port mlog 'Combat' category to new log system 2015-01-17 02:22:53 -06:00
Akkadius c9589dce21 Add 'Combat' log category 2015-01-17 02:21:51 -06:00
Akkadius d4f2e0ce5f port mlog 'AI' category to new log system 2015-01-17 02:20:01 -06:00
Akkadius 97e87f53db port mlog 'Guilds' category to new log system 2015-01-17 02:16:44 -06:00
Akkadius 25642f924e port mlog 'Inventory' category to new log system 2015-01-17 02:04:43 -06:00
Akkadius cae6a70a2c port mlog 'Spells' category to new log system 2015-01-17 02:01:20 -06:00
Akkadius aec39d2650 Port mlog AA category to new log system 2015-01-17 01:59:18 -06:00
Akkadius b06d1b9050 Strip newlines that pipe from quest logs 2015-01-17 01:52:12 -06:00
Akkadius 647874d424 Remove occurrences of mkpt 2015-01-16 22:12:36 -06:00
Akkadius 449c12d6c2 Delete mpkt and some calls to it 2015-01-16 22:04:40 -06:00
Akkadius a6c521a73e Keep mlog happy until it is completely replaced 2015-01-16 21:58:08 -06:00
Akkadius 2bc6ed17c7 Remove command_mlog 2015-01-16 21:54:51 -06:00
Akkadius d21466566e Remove some mlog related functions in Mob:: 2015-01-16 21:53:56 -06:00
Akkadius 79ac3f9b44 added debug.cpp/.h back in temporarily because of stupid dependencies 2015-01-16 21:40:47 -06:00
Akkadius 7c78cf5ab7 More debug changes 2015-01-16 21:39:51 -06:00
Akkadius 50b686b162 Remove debug.cpp/.h files and from CMakeLists.txt 2015-01-16 21:30:41 -06:00
Akkadius a4dbe13c3d Remove EQEmuLog::Dump 2015-01-16 21:26:37 -06:00
Akkadius 5161cb6bd2 Remove more old Callback code 2015-01-16 21:23:50 -06:00
Akkadius d3de7c9237 Remove EQEmuLog writebuf 2015-01-16 21:21:53 -06:00
Akkadius 1fcc1f6193 Convert Perl Quest Logging to the new system 2015-01-16 21:19:53 -06:00
Akkadius ef4847555a Add 'Quests' Category 2015-01-16 21:19:19 -06:00
Akkadius bfd73e5b96 Remove some more old log callbacks 2015-01-16 20:58:13 -06:00
Michael Cook (mackal) 7547d7610f Merge pull request #336 from RicardoCampos/master
Clean up of start zone overrides
2015-01-16 20:18:39 -05:00
Uleat 0eb7eefcb5 Fix for possible race/crash condition in ItemInst::ClearByFlags() 2015-01-16 18:07:19 -05:00
Uleat 4978999d78 Pre-p'd a bot iter 2015-01-16 17:15:33 -05:00
Akkadius f410b270ad Fix Callback in zone, some stragglers in the renaming of function 2015-01-16 03:22:23 -06:00
Akkadius 132fbbb0c6 Rename LogDebugType to DebugCategory 2015-01-16 03:09:02 -06:00
Akkadius 5a3b40c503 Remove my test code in net.cpp 2015-01-16 03:02:30 -06:00
Akkadius d1d26437e5 Cleaning up Zone net.cpp 2015-01-16 03:00:49 -06:00
Akkadius 78e08e5327 Move GMSayHookCallBackProcess out of client logs and into Zone Class 2015-01-16 02:56:39 -06:00
Akkadius a1df2b8f64 Rip out Client Log functions that were used in Callbacks 2015-01-16 02:51:29 -06:00
Akkadius d9626e392e Rip out Client Log Callbacks from zone 2015-01-16 02:49:23 -06:00
Akkadius 7173fc5db3 Remove command_logs 2015-01-16 02:45:18 -06:00
Akkadius 82407ba86d Remove command_nologs 2015-01-16 02:44:30 -06:00
Akkadius 7c8e5645f0 Remove command_log 2015-01-16 02:43:24 -06:00
Akkadius 168e6ec80d Convert Client::SendAllPackets to new debug log 2015-01-16 02:26:19 -06:00
Akkadius 00bab96717 Convert Bot::CalcBotFocusEffect Debug to new 2015-01-16 02:25:04 -06:00
Akkadius c9e7e77d4c Merge branch 'logging_changes' of https://github.com/EQEmu/Server into logging_changes 2015-01-16 02:21:14 -06:00
Akkadius 59f90aede9 Another convert 2015-01-16 02:18:30 -06:00
Akkadius 2828d51308 Converted mlogs in Mob::CheckHitChance to new logs 2015-01-16 02:16:07 -06:00
Akkadius c10f5b2cbc Removed #ATTACK_DEBUG Mob::CheckHitChance and converted debug 2015-01-16 02:12:19 -06:00
Akkadius f957d27fa5 Removed #EQDEBUG Mob::CheckHitChance and converted debug 2015-01-16 02:11:28 -06:00
Akkadius 488e94df56 Removed #EQDEBUG Mob::AttackAnimation 2015-01-16 02:10:10 -06:00
Akkadius 1e741c1b92 Add 'Attack' Category 2015-01-16 02:09:13 -06:00
Akkadius edd871353d Removed attack.cpp #EQDEBUG 2015-01-16 02:08:04 -06:00
Akkadius 4851fe1791 Converted more Aggro Debugs 2015-01-16 02:07:19 -06:00
Akkadius f760597684 Removed preprocessor EQDEBUG in CheckWillAggro and converted log message 2015-01-16 02:06:22 -06:00
Akkadius c23a5008e2 Add 'Aggro' Category 2015-01-16 02:04:52 -06:00
Akkadius bd4e15609a astyle the terrible sin that is maxskill.h 2015-01-16 01:59:57 -06:00
Michael Cook (mackal) ba2b91a548 Fix loginserver 2015-01-16 02:56:14 -05:00
Akkadius 3c9a2702b5 Removed preprocessor EQDEBUG from EQStream from unknown opcode to Application map for PopRawPacket 2015-01-16 01:48:43 -06:00
Akkadius bab8e2ef33 Removed preprocessor EQDEBUG from EQStream from unknown opcode to Application map 2015-01-16 01:47:27 -06:00
Akkadius 5902330bc5 ChannelMesssageReceived debug convert from preprocessor 2015-01-16 01:46:17 -06:00
Michael Cook (mackal) 0c905226e1 Fix linux compile (partially) 2015-01-16 02:32:46 -05:00
Akkadius d77ec9b466 Add Client_Server_Packet Category 2015-01-16 01:26:36 -06:00
Akkadius 08d05d8aae ServerOP_ZAAuthFailed cout message to LogDebugType 2015-01-16 01:21:58 -06:00
Akkadius 295fa30a35 Adjust World to zone port assignment message 2015-01-16 01:21:02 -06:00
Akkadius 5b51f69753 Fix for 'is a GM' convert (Derp) 2015-01-16 01:16:17 -06:00
Akkadius d42a63b72d TCPConnection Loop add to TCP Category 2015-01-16 01:08:26 -06:00
Akkadius 3c22b106ef TCPConnection LogCategory Add 2015-01-16 01:07:29 -06:00
Akkadius 04f13bbf4b Fix for tcp_connection.cpp logger references 2015-01-16 01:03:15 -06:00
Akkadius 32a3666170 Add Linux chmod mask 0755 for mkdir 2015-01-16 00:54:27 -06:00
Akkadius 2cb3a491e0 Add include to eq_stream_factory.cpp for EQEmuLogSys 2015-01-16 00:53:31 -06:00
Akkadius af1fc55393 Comment defaults debugging 2015-01-16 00:52:00 -06:00
Akkadius cd7e9d40bf Re-Index Log Categories to avoid bugginies with index references 2015-01-16 00:50:16 -06:00
Akkadius 055f1523c7 Comment defaults debugging 2015-01-16 00:44:28 -06:00
Akkadius e69486d905 Converted 'is a GM' debug 2015-01-16 00:40:43 -06:00
Akkadius cdc249dde3 Converted SyncWorldtime std::cout 2015-01-16 00:37:36 -06:00
Akkadius 829dd8ddaf Correct log_settings checks 2015-01-16 00:15:34 -06:00
Akkadius 73b54ffabb Implement log_settings for ProcessConsoleMessage 2015-01-16 00:14:49 -06:00
Akkadius 0b661a6347 Implement log_settings for ProcessLogWrite 2015-01-16 00:14:16 -06:00
Akkadius 2fb50fa5cc Implement log_settings for ProcessGMSay 2015-01-16 00:13:56 -06:00
Akkadius 70fbf23d27 Rename LoadLogSettings to LoadLogSettingsDefaults 2015-01-16 00:07:30 -06:00
Akkadius 0d2c396680 zone LoadLogSysSettings 2015-01-16 00:06:12 -06:00
Akkadius 44b65d1ee5 Add Database::LoadLogSysSettings function 2015-01-15 23:49:20 -06:00
Akkadius 3a24372009 Added 2015_1_15_logsys_categories_table.sql 2015-01-15 23:10:45 -06:00
Akkadius 362de5084f Add category processing to ProcessGMSay so we don't get a zone crash from feedback loop of GMSay outputting packets, then those packets going to GMSay. This would make a log inside of a log inside of a log, I call it, log inception 2015-01-15 22:44:27 -06:00
Akkadius dbdfb23cc3 Add category to ProcessLogWrite 2015-01-15 22:38:24 -06:00
Akkadius 723b87bba4 Add category to ProcessConsoleMessage 2015-01-15 22:37:36 -06:00
Akkadius 1e10e088ad Add category to ProcessGMSay 2015-01-15 22:35:58 -06:00
Akkadius 6eae464211 Some EQEmuLogSys changes 2015-01-15 22:17:37 -06:00
Uleat 636a259c4c Patchwork of changes..mostly related tracing a cursor queue bug (see changelog) 2015-01-15 21:24:26 -05:00
ricardocampos23 75501fbb5d corrected comment 2015-01-15 21:03:06 +00:00
ricardocampos23 8f3ffe4e6e Merge remote-tracking branch 'upstream/master' 2015-01-15 20:44:59 +00:00
KayenEQ c4c86fd057 Merge pull request #337 from KayenEQ/Development
Fix for beneficial spells that decrease hit points over time
2015-01-15 00:07:22 -05:00
KayenEQ d694940b80 Fix for beneficial spells that do decrease hit point over time to start working again. 2015-01-14 23:47:33 -05:00
JJ 2f32950364 Fix in npc save feature sql. (iluvseq) 2015-01-14 18:32:53 -05:00
Michael Cook (mackal) aa405df0e9 Fix clang compile 2015-01-14 15:32:42 -05:00
Akkadius bdd170df6c More moving around of internal EQEmuLogSys functions 2015-01-14 05:12:01 -06:00
Trevius af42bfdb02 (RoF2) Guild invites now add new members as members instead of recruits, and /guild chat works properly.
(RoF2) Guild Promote is now functional.
2015-01-13 23:37:35 -06:00
Uleat 87bf191fad Placed an upper limit on the cursor queue save loop 2015-01-13 23:48:34 -05:00
RicardoCampos d64b1ed457 Merge remote-tracking branch 'upstream/master' 2015-01-13 21:51:52 +00:00
RicardoCampos ea7453946c Altered the way that start zone overrides work. These now no longer use an entry in the variables table, but rather use TitaniumStartZoneID, and SofStartZoneID in the rule_values table.
If this is set, it will look for a match in the start_zones based on race/class/deity and the zone id. If it finds a matching row (by zone_id), it will use that row's details. If not, it will use a default.
2015-01-13 21:47:51 +00:00
Akkadius 99a0012bdd Removal of rule based settings, moving to separate DB table 2015-01-13 15:13:12 -06:00
Akkadius 72b53ee2a5 EQEmuLogSys internal function consolidation 2015-01-13 15:11:01 -06:00
Akkadius 4bf2bfc8e3 Debug message function updates 2015-01-13 13:43:41 -06:00
Michael Cook (mackal) e0602efca2 Fix out of bounds in Mob::ResourceTap 2015-01-13 00:36:25 -05:00
Akkadius b219d73163 _log replacements in various spots 2015-01-12 23:08:35 -06:00
Akkadius 733159923a Convert 'COMMON' debugging _log to logger.LogDebugType 2015-01-12 23:01:01 -06:00
Akkadius 6d8f64da57 Convert 'TASKS' debugging _log to logger.LogDebugType 2015-01-12 22:58:13 -06:00
Akkadius ae6bf5a227 Convert 'Skills' debugging _log to logger.LogDebugType 2015-01-12 22:57:38 -06:00
Akkadius 44b6e9aa3f Convert 'AA' debugging _log to logger.LogDebugType 2015-01-12 22:57:04 -06:00
Akkadius 509bd2d652 Convert 'TRADESKILLS' debugging _log to logger.LogDebugType 2015-01-12 22:55:44 -06:00
Akkadius 53db4771f7 Convert 'DOORS' debugging _log to logger.LogDebugType 2015-01-12 22:54:16 -06:00
Akkadius 463b358992 Convert 'INVENTORY' debugging _log to logger.LogDebugType 2015-01-12 22:53:46 -06:00
Akkadius eaf2da1171 Convert 'TRIBUTE' debugging _log to logger.LogDebugType 2015-01-12 22:53:17 -06:00
Akkadius 3693868acf Convert 'SPAWNS' debugging _log to logger.LogDebugType 2015-01-12 22:52:46 -06:00
Akkadius 683ff1ea60 Convert 'SPELLS' debugging _log to logger.LogDebugType 2015-01-12 22:52:11 -06:00
Akkadius 3390164aea Convert 'TRADING' debugging _log to logger.LogDebugType 2015-01-12 22:51:35 -06:00
Akkadius 49ecd69b34 Convert 'LAUNCHER' debugging _log to logger.LogDebugType 2015-01-12 22:50:09 -06:00
Akkadius 4c50025f13 Convert 'ZoneServer' debugging _log to logger.LogDebugType 2015-01-12 22:47:37 -06:00
Akkadius 40d32fc1e5 Convert 'UCS' debugging _log to logger.LogDebugType 2015-01-12 22:44:47 -06:00
Akkadius f26f49c2a1 Convert 'QueryServ' debugging _log to logger.LogDebugType 2015-01-12 22:37:20 -06:00
Akkadius c288ca5204 Convert 'Guilds' debugging _log to logger.LogDebugType 2015-01-12 22:32:44 -06:00
Akkadius 6c0e2631dc Convert rules debugging _log to logger.LogDebugType 2015-01-12 22:29:56 -06:00
Akkadius 6e11baf308 Convert world debugging _log to logger.LogDebugType 2015-01-12 22:28:16 -06:00
Akkadius bc02d7c31a More netcode debugging _log to logger.LogDebugType 2015-01-12 22:20:11 -06:00
Akkadius 34f30b974e More netcode debugging _log to logger.LogDebugType 2015-01-12 22:07:16 -06:00
Akkadius ffdce868c1 Convert netcode debugging _log to logger.LogDebugType 2015-01-12 21:45:49 -06:00
Uleat 390681e0d0 Fix for missing names in StringID-based messages 2015-01-12 22:26:33 -05:00
Akkadius 4811631127 Convert _log from TASKS category 2015-01-12 21:19:19 -06:00
Akkadius b1939aaa3e Remove Save from LogTypes 2015-01-12 20:58:17 -06:00
Uleat ec4d96ea79 Merge branch 'master' of https://github.com/EQEmu/Server 2015-01-12 21:16:13 -05:00
Uleat e84cebe375 Changed OP_FormattedMessage code to eliminate possible oob error 2015-01-12 21:15:12 -05:00
Akkadius 9d355f0f99 Add zone callback for client messages so log messages can be piped to it 2015-01-12 20:11:23 -06:00
Michael Cook (mackal) 5cb2b14645 Fix issue with SharedDatabase::LoadCharacterInspectMessage 2015-01-12 17:00:55 -05:00
Uleat a6148565e5 Fix for load_bots.sql using '\\' as a delimiter (Changed to '$$') 2015-01-12 15:53:33 -05:00
Uleat d5b24543e8 Added text link translators for OP_TaskDescription (RoF+ -- all clients current) 2015-01-12 14:35:38 -05:00
Akkadius 08a23265f8 Make some log functions less process specific in naming 2015-01-12 12:37:33 -06:00
Akkadius fac1361d36 logger.LoadLogSettings() added after each platform executable registry
Added int return for platform executable
2015-01-12 05:15:31 -06:00
Akkadius 2e397b1383 static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID]
enum LogCategory
2015-01-12 05:14:46 -06:00
Akkadius 489f24a80a Preliminary addition of log settings map 2015-01-12 02:16:57 -06:00
Uleat 51fe41bf51 Merge branch 'master' of https://github.com/EQEmu/Server 2015-01-12 01:42:46 -05:00
Uleat f612082f5d Fix for OP_FormattedMessage text link server crashes 2015-01-12 01:42:27 -05:00
Akkadius 3c53d907da Fix double construction of EQEmuLogSys 2015-01-11 22:41:44 -06:00
Michael Cook (mackal) 2c97d98963 Remove unnecessary and incorrect memset 2015-01-11 23:34:00 -05:00
KayenEQ d6bc32f7fd Merge pull request #335 from KayenEQ/Development
#tune command fix
2015-01-11 23:10:45 -05:00
KayenEQ 48199f3744 #tune command fix 2015-01-11 23:09:28 -05:00
Uleat 21e5ccdf88 Fixed conditional criteria for size mismatch check 2015-01-11 22:51:31 -05:00
Uleat 7794ea4a33 Merge branch 'master' of https://github.com/EQEmu/Server 2015-01-11 20:57:26 -05:00
Uleat add346b8dc Added text link body size mismatch checks to translators 2015-01-11 20:57:04 -05:00
Akkadius 73c29fc2f0 Added host parameter for folks using different hosts cause one is not enough 2015-01-11 19:13:38 -06:00
Uleat 5c761d3a57 Merge branch 'master' of https://github.com/EQEmu/Server 2015-01-11 16:44:30 -05:00
Uleat 756d4f4c5c Added text link translators for OP_TaskDescription (Ti thru UF..RoF+ in-work) 2015-01-11 15:49:54 -05:00
Uleat 8f1c227125 Tweaked client text link translators 2015-01-11 12:25:58 -05:00
KayenEQ c84dc13d53 Merge pull request #334 from KayenEQ/Development
Command #tune
2015-01-11 01:21:02 -05:00
Akkadius 855f7ac2a0 Quote fix 2015-01-11 00:20:43 -06:00
KayenEQ d57d463818 New Command
#tune
Used to return ideal values for tuning NPC/Client combat statistics.
2015-01-11 00:45:37 -05:00
Akkadius 108d3110b6 RULE_BOOL(Logging, EnableConsoleLogging, true) /* Turns on or off ALL logging to console */
RULE_BOOL(Logging, EnableFileLogging, true)	/* Turns on or off ALL forms of file logging */
2015-01-10 23:26:10 -06:00
Akkadius 2159a56b17 Add log test command #logtest 2015-01-10 23:25:50 -06:00
Akkadius b1fbcc51e0 linux compile fix 2015-01-10 20:52:51 -06:00
Akkadius ce0a5cf7b8 Add LogDebugType(DebugLevel debug_level, uint16 log_type, std::string message, ...) 2015-01-10 20:14:27 -06:00
Akkadius 17d9b9199c Replace rest of EQEmuLog->write with EQEmuLogSys Log 2015-01-10 19:36:15 -06:00
Akkadius 167e11426f Log Message reword for zone and world bootup failure 2015-01-10 19:32:07 -06:00
Akkadius 7e7c59967c _log error convert to logger.Log(EQEmuLogSys::Error 2015-01-10 19:05:46 -06:00
Akkadius b2a1597e73 More _log Client replacements 2015-01-10 18:52:27 -06:00
Akkadius d459c144fe replace mlog with logger.LogDebug 2015-01-10 18:38:04 -06:00
Akkadius fc76e5c8ac pathing _log to logger.LogDebug 2015-01-10 18:29:27 -06:00
Akkadius 7a9860fdd1 Added EQEmuLogSys logger; pointer to the rest of the projects 2015-01-10 18:12:58 -06:00
Akkadius b7ade8bf1b EQEmuLog::Dump preprocessor remove 2015-01-10 17:27:24 -06:00
Akkadius 26b550dd0d More log replacements 2015-01-10 16:01:43 -06:00
Akkadius 18c837c398 Replaced various other log calls in zone 2015-01-10 15:59:32 -06:00
Akkadius 4bf74348a1 Replaced Error calls 2015-01-10 15:56:09 -06:00
Akkadius a92233240c Replaced Normal calls 2015-01-10 15:55:10 -06:00
Akkadius fdbd76e4ad Replaced Status log calls 2015-01-10 15:54:37 -06:00
Akkadius b76e179d75 Fix spacing 2015-01-10 15:47:36 -06:00
Akkadius 6844645dfb Replace LogFile->write(EQEmuLog::Error, with logger.logevents(EQEmuLogSys::Error 2015-01-10 15:44:35 -06:00
Akkadius dadae1a71f Replaced Debug messages: LogFile->write with logger.LogDebug 2015-01-10 15:26:38 -06:00
Akkadius ebb2659630 Line changes 2015-01-10 15:08:30 -06:00
Akkadius 9e4ef74dd5 RULE_INT(Logging, DebugLogLevel, 0) /* Sets Debug Level, -1 = OFF, 0 = Low Level, 1 = Info, 2 = Extreme */ 2015-01-10 14:59:32 -06:00
Akkadius 84741e4cb1 log_sys to logger
enum DebugLevel {
		General = 0,	/* 0 - Low-Level general debugging, useful info on single line */
		Moderate,		/* 1 - Informational based, used in functions, when particular things load */
		Detail,			/* 2 - Use this for extreme detail in logging, usually in extreme debugging in the stack or interprocess communication */
	};
void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...)
2015-01-10 14:40:47 -06:00
Akkadius b8ed29c600 Add RULE_CATEGORY(Logging)
RULE_BOOL(Logging, ConsoleLogCommands, false)  /* Turns on or off console logs */
RULE_BOOL(Logging, LogFileCommands, false)
RULE_CATEGORY_END()
2015-01-10 14:37:33 -06:00
Akkadius 01ca81a177 Remove debugging and generalize the Log function 2015-01-10 13:35:02 -06:00
Akkadius f4e33f6faa Changed some console colors 2015-01-10 13:34:39 -06:00
Uleat bbb3e1a1bd Merge branch 'master' of https://github.com/EQEmu/Server 2015-01-10 14:31:18 -05:00
Uleat ce54071296 Added text link translators for OP_Emote 2015-01-10 13:50:48 -05:00
Akkadius 5b4cf79b04 Create console colors type map from Console::Color LogColors 2015-01-10 03:56:52 -06:00
Akkadius 2aacc7323e Backport logging from debug.cpp EQEmuLog::write back to EQEmuLogSys::WriteZoneLog
Logs being written to logs/zone/ currently
2015-01-10 03:44:49 -06:00
Akkadius 80d11d4ca9 Added eqemu_logsys.cpp/.h 2015-01-10 03:43:44 -06:00
Michael Cook (mackal) 5b78acc45e Make the AI stopping a little less silly on zone shutdown 2015-01-10 02:34:38 -05:00
KayenEQ 00ba6e761e Merge pull request #333 from KayenEQ/Development
Fix for spell projectiles (target type 1) being applied as melee damage.
2015-01-10 00:14:39 -05:00
KayenEQ 999a6501e0 Fix for spell projectiles (target type 1) being applied as melee damage.
Resolves those random 1 million damage hits that have been reported
2015-01-09 22:33:41 -05:00
Trevius f799b8ef68 Changed some console logging for slot and group errors. 2015-01-09 20:16:23 -06:00
Uleat bf8f70342b Added text link translators for OP_FormattedMessage 2015-01-09 17:56:46 -05:00
Michael Cook (mackal) 7e72f10a3b clang-modernize -use-nullptr for ucs/worldserver.cpp 2015-01-09 13:18:49 -05:00
Michael Cook (mackal) b398d65eb8 clang-modernize -use-nullptr for ucs/ucs.cpp 2015-01-09 13:18:49 -05:00
Michael Cook (mackal) bf9b126eef clang-modernize -use-nullptr for ucs/clientlist.cpp 2015-01-09 13:18:49 -05:00
Michael Cook (mackal) f3f9997adf Packets are already memset to 0 2015-01-09 12:59:48 -05:00
Michael Cook (mackal) 1b8711bce9 Minor tweaking to zone/entity.cpp 2015-01-09 12:59:13 -05:00
Michael Cook (mackal) b0e59e112d clang-modernize -use-auto convert for world/zoneserver.cpp 2015-01-09 03:05:15 -05:00
Michael Cook (mackal) c6388d8c5d clang-modernize -use-auto convert for world/zonelist.cpp 2015-01-09 03:05:15 -05:00
Michael Cook (mackal) e87a3096f4 clang-modernize -use-auto convert for world/wguild_mgr.cpp 2015-01-09 03:05:15 -05:00
Michael Cook (mackal) ca0a8fd974 clang-modernize -use-auto convert for world/ucs.cpp 2015-01-09 03:05:15 -05:00
Michael Cook (mackal) c9a75dcf64 clang-modernize -use-auto convert for world/queryserv.cpp 2015-01-09 03:05:15 -05:00
Michael Cook (mackal) 7e2661bbc1 clang-modernize -use-auto convert for world/net.cpp 2015-01-09 03:05:14 -05:00
Michael Cook (mackal) 8f18672690 clang-modernize -use-auto convert for world/login_server_list.cpp 2015-01-09 03:05:14 -05:00
Michael Cook (mackal) 6b75e03d72 clang-modernize -use-auto convert for world/login_server.cpp 2015-01-09 03:05:14 -05:00
Michael Cook (mackal) 1770862b10 clang-modernize -use-auto convert for world/lfplist.cpp 2015-01-09 03:05:14 -05:00
Michael Cook (mackal) 3df27a9379 clang-modernize -use-auto convert for world/launcher_list.cpp 2015-01-09 03:05:14 -05:00
Michael Cook (mackal) da13affebc clang-modernize -use-auto convert for world/launcher_link.cpp 2015-01-09 03:05:14 -05:00
Michael Cook (mackal) 446b085d6c clang-modernize -use-auto convert for world/eqw_parser.cpp 2015-01-09 03:05:14 -05:00
Michael Cook (mackal) 0956575292 clang-modernize -use-auto convert for world/eqw_http_handler.cpp 2015-01-09 03:05:13 -05:00
Michael Cook (mackal) 0ed10ec102 clang-modernize -use-auto convert for world/console.cpp 2015-01-09 03:05:13 -05:00
Michael Cook (mackal) 81a48cac6c clang-modernize -use-auto convert for world/clientlist.cpp 2015-01-09 03:05:13 -05:00
Michael Cook (mackal) bb37dd1b16 clang-modernize -use-auto convert for world/cliententry.cpp 2015-01-09 03:05:13 -05:00
Michael Cook (mackal) c2936a893e clang-modernize -use-auto convert for world/client.cpp 2015-01-09 03:05:13 -05:00
Michael Cook (mackal) 64be231fe6 clang-modernize -use-auto convert for world/adventure_manager.cpp 2015-01-09 03:05:13 -05:00
Michael Cook (mackal) 28680a4695 clang-modernize -use-auto convert for world/adventure.cpp 2015-01-09 03:05:13 -05:00
Michael Cook (mackal) 502bb6ca79 clang-modernize -use-auto convert for ucs/worldserver.cpp 2015-01-09 02:57:00 -05:00
Michael Cook (mackal) 09f37323d1 clang-modernize -use-auto convert for ucs/database.cpp 2015-01-09 02:57:00 -05:00
Michael Cook (mackal) b34b26c423 clang-modernize -use-auto convert for ucs/clientlist.cpp 2015-01-09 02:57:00 -05:00
Michael Cook (mackal) 1873b1d739 Ranged-based for for ucs/clientlist.cpp 2015-01-09 02:50:13 -05:00
Michael Cook (mackal) c33973f20a Optimize EntityList::RemoveGroup/RemoveRaid
lambdas are cheating btw.
2015-01-09 02:44:20 -05:00
Trevius 4c9653d204 Potential crash/bug fixes for Groups and Mercs. 2015-01-08 23:28:22 -06:00
Arthur Ice f6166bcb94 modified mysql results/row to be ready for range based for 2015-01-08 21:20:56 -08:00
Arthur Ice cd9ca65587 merge upstream 2015-01-08 19:40:00 -08:00
Michael Cook (mackal) 4808dcadcf Range-based for for world/zonelist.cpp 2015-01-08 22:01:37 -05:00
Michael Cook (mackal) 4fde4bba72 Range-based for for world/lfplist.cpp 2015-01-08 22:01:21 -05:00
Michael Cook (mackal) 4f643c7201 Range-based for for world/adventure_manager.cpp 2015-01-08 22:01:02 -05:00
Michael Cook (mackal) 784a6974d1 Range-based for for world/adventure.cpp 2015-01-08 22:00:36 -05:00
Akkadius 732fa17afb Merge branch 'master' of https://github.com/EQEmu/Server
Conflicts:
	zone/groups.cpp
2015-01-08 19:50:48 -06:00
Akkadius be381b4e56 Renamed EQEMuLog class to EQEmuLog 2015-01-08 19:46:28 -06:00
Trevius 94be9e9162 Added some extra checks and clean-up related to Groups and Mercenaries. 2015-01-08 17:08:20 -06:00
Michael Cook (mackal) c8278608a3 Merge pull request #331 from af4t/master
Work-around for "strange ADL issues" not needed if using Boost 1.57.0
2015-01-08 12:31:02 -05:00
Kemmler 77f9cf9f63 Work-around for "strange ADL issues" not needed if using Boost 1.57.0 (was required through 1.56.0, thus test for less than 1.57.0). Tested on VS2013. 2015-01-08 09:49:46 -05:00
Trevius 3b2fbd337f Query fix for group_leaders table. This may resolve some crashes/bugs related to Mercs/Bots and Groups. 2015-01-07 23:45:44 -06:00
Trevius a83d536712 Mercenaries now load directly from tables only. The vwMercNpcTypes view is no longer required and can be deleted. 2015-01-07 22:20:44 -06:00
Uleat a6dd14b09f Merge branch 'master' of https://github.com/EQEmu/Server 2015-01-07 14:57:38 -05:00
Uleat 0552220f00 Excluded text link body from message scrambling in Client::GarbleMessage() 2015-01-07 11:13:48 -05:00
Akkadius 2e55c98e90 Merge branch 'master' of https://github.com/EQEmu/Server 2015-01-07 08:45:30 -06:00
Akkadius 66cc498421 Added colors to windows consoles, the logging system still needs to be overhauled but this crap code should make debugging easier until the rest of it is cleaned up 2015-01-07 08:45:04 -06:00
Uleat b27737bfcd Rework of the text link translator code (Known bug with broadcast message link size not in OP_ChannelMessage or OP_SpecialMesg) 2015-01-06 23:19:41 -05:00
Trevius 2c43e6f68d Added defines for all remaining pet commands and some support for them as well. 2015-01-06 19:14:06 -06:00
JJ 6717014601 Lua declaration as well... 2015-01-06 16:10:29 -05:00
JJ 364f2f6bf8 Forgot prototype declaration from previous commit. Also fix corruption declaration. 2015-01-06 15:09:18 -05:00
JJ cde406a496 Add PhR to #showstats and a few places that can/should be implemented in the future. 2015-01-06 13:51:36 -05:00
Trevius f1a73d4da2 Changed the pet command #defines to be based on RoF2 list of pet commands and added decodes to Titanium, SoF and SoD.
(RoF+) The /pet focus on/off and /pet hold on/off commands are now functional.
Added more toggle and on/off support for pet commands.
2015-01-06 01:19:33 -06:00
Uleat 668823eaf2 Fix for text link issues with items whose loregroup is '-1' 2015-01-05 23:11:38 -05:00
Uleat 4b133c808c It helps if you actually push more than the changelog message... 2015-01-05 13:50:03 -05:00
Uleat 7557cfd845 Added text link translators for all supported clients - currently, only OP_ChannelMessage and OP_SpecialMesg are translated. 2015-01-05 13:44:16 -05:00
Trevius 179f47dbe3 RoF+ - Added the "Your race, class, or deity cannot use this item." message since it no longer exists in the eqstr_us.txt file. 2015-01-04 20:42:45 -06:00
Akkadius ac09636a73 Readability: embparser_api.cpp macro section A-Z sort 2015-01-04 07:01:16 -06:00
Akkadius 8491e3ce9b Pro-active adjustment of quest::updatetaskactivity to include ignore_quest_update
quest::updatetaskactivity(task, activity, [count], [ignore_quest_update])
2015-01-04 06:58:30 -06:00
Akkadius a56e9ccda6 Remove iostream from debug output 2015-01-04 02:55:38 -06:00
Akkadius 9419bc8d54 True fix for $client->UpdateTaskActivity(TaskID, ActivityID, Count, [ignore_quest_update]) 2015-01-04 02:54:50 -06:00
Michael Cook (mackal) 85a27cdd74 Fix account_creation 2015-01-04 01:52:46 -05:00
Michael Cook (mackal) a75db63cbc Fix EVENT_CONNECT 2015-01-04 01:48:31 -05:00
Michael Cook (mackal) f8b6ee296c Fix memleak in Mob::TypesTemporaryPets 2015-01-03 18:48:38 -05:00
Michael Cook (mackal) 09d76605f5 Fix memleak in Mob::TemporaryPets 2015-01-03 18:42:28 -05:00
Michael Cook (mackal) 6897aef4b5 Need to set this to 1 again before the perl_destruct 2015-01-03 15:14:12 -05:00
Michael Cook (mackal) 77b8e9ec6e Perl memleak fix
This may need more test!!
2015-01-03 13:54:31 -05:00
Michael Cook (mackal) ea6ab5b10f Virtualize WaterMap's destructor (memleak fix) 2015-01-03 12:33:53 -05:00
Michael Cook (mackal) 9b8598c566 Group/raid memleaks 2015-01-03 02:57:55 -05:00
Michael Cook (mackal) 1b5db0684e Fix memleak in OP_RaidJoin 2015-01-03 02:39:44 -05:00
Trevius 3da3b5641f (RoF2) /shield (shielding) and /key (key ring) are both now functional after opcode updates. 2015-01-03 01:31:44 -06:00
Michael Cook (mackal) 7cbefa4ec2 Fix memleak in OP_RaidUpdate 2015-01-03 01:52:24 -05:00
Michael Cook (mackal) 6a2260f106 Memleak in Map 2015-01-03 01:26:46 -05:00
Akkadius a8d28cbed5 True optional fix for UpdateTaskActivity now that I've had time to take care of it 2015-01-02 17:51:55 -06:00
Trevius 3c6c5b9732 (RoF2) *Hopefully* Fixed looting incorrect items from NPCs. Please report any issues!
(RoF2) Now able to loot items past the 10th slot on NPC corpses.
Attuned Items can now be auto-looted and will equip properly.
Mercenaries and Bots will no longer take a share from /split or /autosplit.
2015-01-02 01:42:52 -06:00
Trevius f0d2fb796f Aug Type 21 fix for RoF client. 2015-01-01 20:00:16 -06:00
JJ fc544e164c Update default npc_types values for previous NULL entries. 2014-12-31 20:53:12 -05:00
Michael Cook (mackal) d93edd7393 Make NPCs less jumpy
We actually didn't want that +2.0f
2014-12-31 17:49:12 -05:00
Trevius 16a8d15909 (RoF2) Aug Type 21 no longer shows the "Buy Now" button in the aug slot of items.
(RoF2) Identified the "Copied" item flag with the help of Uleat.
2014-12-30 00:27:23 -06:00
Michael Cook (mackal) 5df65427b1 Merge pull request #330 from KinglyKrab/master
Made fifth argument of UpdateTaskActivity truly optional.
2014-12-29 17:30:17 -05:00
Kinglykrab 72823182f6 Made fifth argument of UpdateTaskActivity truly optional. 2014-12-29 17:29:45 -05:00
Akkadius 81dfffadf6 Updated $client->UpdateTaskActivity to have optional argument ignore_quest_update IE: Client::UpdateTaskActivity(THIS, TaskID, ActivityID, Count, [ignore_quest_update])
Also updated internal UpdateTaskActivity methods to optionally ignore quest based task updates to prevent feedback
2014-12-29 05:35:50 -06:00
Trevius 33e88bffe9 (RoF2) Identified a few Item Fields and resolved an issue with cloth armor not accepting certain augments that they should. 2014-12-29 00:29:49 -06:00
Uleat dab3d1181e Implemented class Client::TextLink 2014-12-28 12:49:14 -05:00
Uleat 4fb1a3ff3f Merge branch 'master' of https://github.com/EQEmu/Server into item_link
Conflicts:
	changelog.txt
2014-12-28 11:57:51 -05:00
Akkadius 2dadc9ff24 Change SetOwner to SetHateOwner refactor 2014-12-28 00:06:51 -06:00
Akkadius 4af3834715 Some more refactoring of hate_list 2014-12-27 23:52:44 -06:00
Akkadius 18f9a06f06 Re-Push Refactoring changes before without broken functionality 2014-12-27 23:44:15 -06:00
Akkadius 4f65066274 Reverting some hate stuff so things work again 2014-12-27 23:19:48 -06:00
Akkadius 8983953d7d Remove debugging from hate changes 2014-12-27 20:25:20 -06:00
Akkadius 73fe229e25 More hate changes 2014-12-27 20:23:49 -06:00
Akkadius 21ce6efc73 Merge branch 'master' of https://github.com/EQEmu/Server 2014-12-27 18:25:00 -06:00
Akkadius 3a488e3a61 Changed hate counter to uint32 to prevent negative rollback, this most likely can will be an issue but more uncommon
Renamed and refactored most functions and variables in hate_list.h/cpp for readability
Refactored how hate works in some local functions mixing the use of hate variable and split it out into different status variables
hate_list.cpp/.h style cleanup
hate_list.h header function sort, comment erase
functions should clearly state their function
2014-12-27 18:24:42 -06:00
KayenEQ 7ecea56caf Merge pull request #329 from KayenEQ/Development
NPC special ability (43) CASTING_RESIST_DIFF
2014-12-27 18:47:54 -05:00
KayenEQ 9666f1e25e Implemened npc special ability (43) CASTING_RESIST_DIFF which sets innate resist modifier on
ALL spells used by that NPC. Ie. 43,1,-200 will set a -200 innate resist diff, so if your npc cast
a spell that has a -10 resist modifier the final resist diff would be -210.
2014-12-27 18:43:59 -05:00
Trevius 05c943779d (RoF2) Fixed dropping items on the ground so they go to ground level instead of camera height.
Show Helm Option should be functional again.
2014-12-27 15:46:30 -06:00
Akkadius b63dbd50a8 Fix changelog.txt merge 2014-12-27 01:09:14 -06:00
Akkadius d7b529d2af Add option to automatic database upgrade script 5) Download latest Opcodes from Github 2014-12-27 01:07:58 -06:00
Uleat 00ac9a05d5 Merge branch 'master' of https://github.com/EQEmu/Server into item_link 2014-12-26 23:52:25 -05:00
Trevius 47e98a4b62 Fixed Mercenaries so they can spawn again after table field renames from recent change. 2014-12-26 00:11:51 -06:00
Uleat d9dc2eb4e3 Thought something looked like it was missing! 2014-12-25 21:45:38 -05:00
Uleat 270fe3389c Updated item/say links for all clients. They should be a little easier to keep track of now. 2014-12-25 11:04:01 -05:00
Uleat 15fbb722eb Added a new Client::MakeItemLink() method that uses Item_Struct instead of ItemInst. Changed the way that NPC::QueryLoot() builds its links. 2014-12-25 00:00:57 -05:00
Michael Cook (mackal) 8522542ae2 Use lambdas in sort functions (for zone at least) 2014-12-24 18:29:23 -05:00
Michael Cook (mackal) 811872c17f Rework Bot::GetBotArcheryRange 2014-12-24 17:42:35 -05:00
Trevius baf2f23ce6 (RoF+) Implemented Hero's Forge Armor for NPCs. Set the herosforgemodel field in npc_types table to the model (example: 84 for full set, or 12107 for robe).
(RoF+) Hero's Forge Armor now overrides NPC texture settings.  To display Hero's Forge Armor Helms, set helmtexture field to anything other than 0.
Fixed some NPC loading from the database that was incorrect after adding herosforgemodel.
2014-12-24 12:02:30 -06:00
Akkadius bc25d90441 Merge pull request #328 from KinglyKrab/master
#npcedit Changes.
2014-12-24 04:21:43 -06:00
Kinglykrab 13a3349614 Edited #npcedit to include more options and changed a few to be multiple arguments rather than separate commands.
- #npcedit wep1/#npcedit wep2 is now #npcedit weapon [primary] [secondary]
- #npcedit mindmg/#npcedit maxdmg is now #npcedit damage [minimum] [maximum]
- #npcedit meleetype [primary] [secondary]
- #npcedit rangedtype
- #npcedit ammoidfile
- #npcedit trackable
- #npcedit attackcount
- #npcedit avoidance
- #npcedit walkspeed
- #npcedit armtexture
- #npcedit bracertexture
- #npcedit handtexture
- #npcedit legtexture
- #npcedit feettexture
- #npcedit herosforgemodel
- #npcedit slow_mitigation
2014-12-24 04:49:54 -05:00
Trevius c48d2d9888 (RoF+) Added herosforgemodel field to the npc_types table. Not fully functional yet for NPCs (currently only displays helm correctly).
(RoF2) Updated item links from #npcstat command output.
2014-12-24 02:31:37 -06:00
Akkadius f6dc138dc8 Merge pull request #327 from KinglyKrab/master
Update npc_types table.
2014-12-24 00:38:30 -06:00
Kinglykrab 1329a2f9ba Update npc_types table.
- d_meele_texture1 -> d_melee_texture1
- d_meele_texture2 -> d_melee_texture2
- Required SQL: 2014_12_24_npc_types_update.sql
2014-12-24 01:26:07 -05:00
Trevius 3bb816ad1d Clean up of RoF+ Item Packets. 2014-12-23 23:18:59 -06:00
Trevius a0972e7564 Updated changelog.txt 2014-12-23 23:15:05 -06:00
Trevius 8c3751befa Merge branch 'master' of https://github.com/EQEmu/Server 2014-12-23 23:13:34 -06:00
Trevius 27fe90d02d (RoF+) Added support for Hero's Forge Robe Models. Set herosforgemodel field in items table to exact model such as 11607, 11707, etc. 2014-12-23 23:13:22 -06:00
Uleat a0c99647fa Added item information to logfile writes for failed ItemInst creations 2014-12-23 23:01:59 -05:00
Michael Cook (mackal) 7742892377 Fix issue with Mob::MakeNewPositionAndSendUpdate 2014-12-23 22:26:36 -05:00
Michael Cook (mackal) 5e34b06952 Merge pull request #326 from KinglyKrab/master
Bot Crash Fixes.
2014-12-23 22:15:58 -05:00
Kinglykrab c10bccebdb Two bot crash fixes (#bot bardoutofcombat and #bot setinspectmessage). 2014-12-23 22:10:35 -05:00
Uleat cdd624e7a8 Hack fix for zone shutdown crashes involving HateList::GetTop() 2014-12-23 10:22:03 -05:00
Uleat 34ab3e10f5 Added some nullptr checks for ItemInst* in a few places (tradeskills.cpp - particularly augments - needs a better review) 2014-12-23 10:14:45 -05:00
Trevius ed257b0ef3 (RoF+) Added a work-around for the cursor buffer issue. 2014-12-22 20:51:56 -06:00
Trevius b072f5873d Merge branch 'master' of https://github.com/EQEmu/Server 2014-12-22 20:51:04 -06:00
Trevius cba68645a8 More work on RoF+ Cursor Buffer. 2014-12-22 19:47:02 -06:00
Trevius d454763cd1 RoF+ Cursor Buffer SummonItem Initial Test Change 2014-12-22 19:47:01 -06:00
Michael Cook (mackal) 36c1f50e1b Use lambda expression for compare instead 2014-12-22 17:51:59 -05:00
Trevius 6e192b1794 (RoF2) Fixed Tracking. 2014-12-22 16:09:11 -06:00
akkadius ce3d513ca0 Script used to parse crashes in logs folder and give an ordered summary 2014-12-22 14:12:26 -06:00
Michael Cook (mackal) 62ae7ba1de Fix RoF2 rez response 2014-12-22 13:42:22 -05:00
Akkadius cfbecc1d1b Merge pull request #325 from KinglyKrab/master
Modified #reloadworld. Example: #reloadworld 1 - repops globally and rel...
2014-12-22 04:41:12 -06:00
Kinglykrab a4febbb648 Modified #reloadworld. Example: #reloadworld 1 - repops globally and reloads quests globally. #reloadworld or #reloadworld 0 - reloads quests globally. 2014-12-22 04:47:51 -05:00
Michael Cook (mackal) 18fb86a560 Force changing the timer_time for attack timers
Should fix issues with waiting for a slow timer after a cure
2014-12-22 01:58:54 -05:00
Trevius b9fab9bc1b (RoF/RoF2) Fixed Guild Rank in the Player Profile, which prevents the guild rank message on login/zone. 2014-12-21 23:00:06 -06:00
Michael Cook (mackal) a7cdb4c0af Add a few missing bonus recalcs 2014-12-21 23:53:02 -05:00
Michael Cook (mackal) de3f9f7276 Fix missing {} in SE_*Counter bonus processing 2014-12-21 23:48:18 -05:00
Akkadius cee7a9a0fd variable rename, readability 2014-12-21 21:39:04 -06:00
Arthur Ice f409d39f1a merge upstream 2014-12-21 13:57:20 -08:00
Trevius f588c54d52 (RoF2) Fixed Extended Targets Window by correcting opcodes. 2014-12-21 12:23:11 -06:00
Trevius 7d95f3f582 Fix for RoF2 Selling to Merchant. 2014-12-21 00:32:01 -06:00
Trevius df342d419c Merge branch 'master' of https://github.com/EQEmu/Server 2014-12-20 17:35:29 -06:00
Trevius b682a2f97a Potential fix for RoF2 random crashes during zoning. 2014-12-20 17:34:47 -06:00
Akkadius 812ad530d1 Updated #cvs to display RoF2 Client Stream count 2014-12-20 00:49:14 -06:00
Trevius 4ef3c7a9f4 Fixed Selling for Alternate Currency Merchants for RoF and RoF2. 2014-12-19 23:20:10 -06:00
Michael Cook (mackal) cedec3d872 Revert "Cleared clientversions.h and eq_dictionary files of Client6.2 references"
This reverts commit d4506363b8.
2014-12-19 23:08:44 -05:00
Uleat d4506363b8 Cleared clientversions.h and eq_dictionary files of Client6.2 references 2014-12-19 21:25:44 -05:00
Trevius da75007b0f (RoF2) Fixed Rest Timer, Show Helm Option, Auto-Consent Options, and identified Krono in the PP. 2014-12-19 19:42:55 -06:00
Michael Cook (mackal) dabe550966 Fix eq_dictionary.cpp from 62 removal
Note: 62 references in clientversion.h need to be cleaned up
before we can remove them from other files
2014-12-19 17:22:05 -05:00
Trevius ef287bc857 Fixed Armor Tinting (players and NPCs) that was broken during a previous update. 2014-12-19 15:46:01 -06:00
Trevius fce52d7186 (RoF2) Fixed Leadership AA Purchasing and Recipe Search by correcting opcodes. 2014-12-19 02:02:31 -06:00
Michael Cook (mackal) 1261aac036 Check DivineAura in TryWeaponProc, should resolve #321 2014-12-18 18:50:38 -05:00
Trevius 8aea6da7df Fixed zoning after death for RoF2. 2014-12-18 17:48:15 -06:00
Trevius ba5e5058f9 Finished lining up the RoF2 Player Profile Struct. Zone times are now normal, and everything from the PP is accurate in game now. 2014-12-18 13:13:03 -06:00
KayenEQ 45e71ff6d1 Merge pull request #320 from KayenEQ/Development
Clients will now receive exp / faction from their swarm pets kills ect.
2014-12-18 04:58:23 -05:00
Michael Cook (mackal) ce9bcef620 std::deque is a much better fit, should have bit better performance 2014-12-18 02:20:03 -05:00
Uleat fe4872c921 Debug >= 11 compile fail fix 2014-12-17 20:09:53 -05:00
KayenEQ 7dad77c080 Clients will now receive exp / faction from their swarm pets kills ect. 2014-12-17 20:09:41 -05:00
SecretsOTheP d721580c9f EQStream changes as recommended by a community member in private. 2014-12-17 17:55:21 -05:00
KayenEQ 4f242f01c1 Merge pull request #319 from KayenEQ/Development
NPC ranged attack projectiles will now do damage on impact.
2014-12-17 12:00:03 -05:00
KayenEQ cd33307975 NPC ranged attack projectiles will now do damage on impact.
Uses same rule as the client version.
2014-12-17 10:59:23 -05:00
KayenEQ 26e87c999b Merge pull request #318 from KayenEQ/Development
Misc fixes / Perl exports
2014-12-17 06:09:29 -05:00
KayenEQ 29ef1527e7 update 2014-12-17 06:09:04 -05:00
KayenEQ d69552d4df Perl: NPC AddRangedProc(spellid, chance)
Perl: NPC AddDefensiveProc(spellid, chance)
2014-12-17 05:57:16 -05:00
Trevius ad61eda7e0 RoF2 fix for being unable to close bags by right clicking or open multiple bags. 2014-12-17 01:27:30 -06:00
Michael Cook (mackal) a14f8058da Switch path stuff to vectors
This should be more CPU cache friendly compared to lists so should
be faster. (profiling looked promising)
2014-12-17 01:52:00 -05:00
KayenEQ ab5d0ad43f Fix for NPC ranged procs 2014-12-16 20:20:22 -05:00
Michael Cook (mackal) 5099010840 Merge pull request #317 from Leere/chargesfix
Fix for stackable items being unmoveable when charges=0
2014-12-16 18:53:56 -05:00
KayenEQ fc306bbc1d Fix for special attack NPC_CHASE_DISTANCE to now work correctly
Perl export: NPC GetAttackDelay
Perl export: NPC GetAvoidanceRating
Perl export: NPC AddMeleeProc
Special Attacks will no longer be able to hit immune to melee / bane only flagged NPCs.
2014-12-16 18:53:15 -05:00
Leere 7d39ea59e8 Fix for stackable items being unmoveable when charges=0 2014-12-17 00:24:47 +01:00
Akkadius ad8e834fe8 Dropping client 6.2 support 2014-12-15 23:14:55 -06:00
Akkadius 0b89c95ab2 tcp_server.cpp linux build fix for not fake 2014-12-15 23:00:29 -06:00
Akkadius 5b49ecf072 worldconn.cpp header include cleanup 2014-12-15 22:56:55 -06:00
Akkadius 25ee643aeb timer.cpp include header cleanup 2014-12-15 22:56:44 -06:00
Akkadius ef3d4ae51a string_util linux build fix 2014-12-15 22:56:29 -06:00
Akkadius f4609101d5 tcp_server.cpp include header cleanup 2014-12-15 22:52:03 -06:00
Akkadius 6b485273d1 tcp_connection.cpp & .h header include cleanup 2014-12-15 22:50:33 -06:00
Akkadius 40377447ac string_util.cpp & .h header include cleanup 2014-12-15 22:47:48 -06:00
Akkadius a55b2ca557 spdat.cpp header include cleanup 2014-12-15 22:45:37 -06:00
Akkadius b687fb2439 shareddb.cpp header include cleanup 2014-12-15 22:43:58 -06:00
Akkadius f3ebb2e5d8 rdtsc.cpp header include cleanup 2014-12-15 22:42:59 -06:00
Akkadius 12206c0e50 races.cpp header include cleanup 2014-12-15 22:42:44 -06:00
Akkadius 689f95b430 shareddb.cpp & .h header include cleanup 2014-12-15 22:42:34 -06:00
Akkadius 62d8fb538b ptimer.cpp header include cleanup 2014-12-15 22:42:19 -06:00
Akkadius fab6b602a8 packet_dump_file cleanup 2014-12-15 22:28:15 -06:00
Akkadius 1c665653ea packet_dump cleanup 2014-12-15 22:26:58 -06:00
Akkadius 5c903c6ee3 opcodemgr.cpp cleanup 2014-12-15 22:25:46 -06:00
Akkadius ffe447859a opcode_map.cpp readability 2014-12-15 22:23:49 -06:00
Akkadius c1e5d8b7dc misc cleanup 2014-12-15 22:21:57 -06:00
Akkadius f8a1825845 misc_functions cleanup 2014-12-15 22:21:44 -06:00
Akkadius de32970d6f add <string> back in for linux 2014-12-15 22:16:30 -06:00
Akkadius e9b72e0f7d logsys_eqemu .cpp & .h include cleanup 2014-12-15 22:15:17 -06:00
Akkadius 7887511589 faction linux build fix for real 2014-12-15 22:12:56 -06:00
Akkadius 6d0b44d69e item.cpp & .h header include cleanup 2014-12-15 22:10:06 -06:00
Akkadius edec2ad24c faction.cpp linux build fix 2014-12-15 22:04:39 -06:00
Akkadius 20200fd028 guild_base.cpp & .h include header cleanup 2014-12-15 21:59:23 -06:00
Akkadius 0c21f56ff3 faction.cpp & .h header include cleanup and faction.cpp code structure style change 2014-12-15 21:57:07 -06:00
Akkadius 3d8777084c db_update_manifest.txt fix 2014-12-15 21:10:14 -06:00
Akkadius a612f289e7 Another Linux fix 2014-12-15 21:05:35 -06:00
Akkadius 6f747c3678 eqemu_config.cpp code structure cleanup 2014-12-15 21:03:09 -06:00
Akkadius bbea7f4f53 eqemu_config.cpp & .h header cleanup, code style cleanup of eqemu_config.h 2014-12-15 21:01:52 -06:00
Akkadius e048c5cf17 eq_stream_ident.h header include cleanup 2014-12-15 20:32:03 -06:00
Akkadius 968b0adc1d eq_stream_factory.cpp & .h header include cleanup/forward declare 2014-12-15 20:30:53 -06:00
Akkadius 5e31b8f96e eq_stream.cpp & .h include header cleanup 2014-12-15 20:28:27 -06:00
Akkadius 1a6a50c810 eq_packet.cpp & .h header include cleanup 2014-12-15 20:24:38 -06:00
Akkadius 677c6b5750 emu_tcp_connection.cpp & .h include header cleanup and forward declare 2014-12-15 20:21:54 -06:00
Akkadius 41f6349804 linux build fix 2014-12-15 20:09:36 -06:00
Akkadius 359bbb8df1 dbcore.cpp * .h header include cleanup 2014-12-15 20:04:49 -06:00
Akkadius b1623cf696 database.cpp & .h header include cleanup and forward declaration 2014-12-15 20:02:55 -06:00
Akkadius e5f300baaf condition.cpp header include cleanup 2014-12-15 19:49:49 -06:00
Akkadius 5af34a9245 classes.cpp header include cleanup 2014-12-15 19:49:12 -06:00
Akkadius 453dcd8af3 Merge branch 'master' of https://github.com/EQEmu/Server 2014-12-15 19:47:23 -06:00
Akkadius 3edda155c6 Linux build fix 2014-12-15 19:47:08 -06:00
Trevius 00d145199b Corrected check in db_update_manifest.txt 2014-12-15 19:34:42 -06:00
Akkadius 53b9f8d0fd base_packet.cpp & .h header cleanup 2014-12-15 19:30:18 -06:00
Akkadius a3a1f05718 zonedb and zoning header spacing 2014-12-15 19:17:31 -06:00
Akkadius 7f1ba17894 zone_logsys structure clean 2014-12-15 19:17:07 -06:00
Akkadius def95b6584 zone_config structure clean 2014-12-15 19:16:53 -06:00
Akkadius c646a6c43a zone.cpp & .h include header cleanup 2014-12-15 19:14:41 -06:00
Akkadius 9ef0fa13c7 Merge branch 'master' of https://github.com/EQEmu/Server 2014-12-15 19:12:23 -06:00
Akkadius de243cd5d7 worldserver.cpp header include cleanup 2014-12-15 19:12:04 -06:00
Michael Cook (mackal) b5c60d8123 Bot compile fix 2014-12-15 20:08:46 -05:00
Akkadius 6a6e91abc5 waypoints.cpp header include cleanup 2014-12-15 19:07:31 -06:00
Akkadius 6fd2c2915a water_map.cpp header include cleanup 2014-12-15 19:05:52 -06:00
Akkadius 8ebfa36f00 tribute.cpp header include cleanup 2014-12-15 19:03:24 -06:00
Akkadius 537af79c8e trap.cpp & .h header include cleanup and forward declare 2014-12-15 19:01:54 -06:00
Akkadius a9226c00d8 trading.cpp header include cleanup 2014-12-15 18:59:21 -06:00
Akkadius c5c33f6f49 tradeskills.cpp header include cleanup 2014-12-15 18:57:09 -06:00
Akkadius e218ebb92f titles.cpp & .h header cleanup and forward declare 2014-12-15 18:56:23 -06:00
Akkadius 856eadc628 tasks.cpp & .h header include cleanup 2014-12-15 18:54:23 -06:00
Akkadius 1ec2ce7e26 spells.cpp header include cleanup 2014-12-15 18:48:42 -06:00
Akkadius 020dfbf538 spell_effects header include cleanup 2014-12-15 18:47:22 -06:00
Akkadius b945729d1a special_attacks.cpp header cleanup 2014-12-15 18:46:41 -06:00
Akkadius 24f9e8d181 spawngroup.cpp & .h header include cleanup 2014-12-15 18:44:36 -06:00
Akkadius c25e17f3bc spawn2.cpp & .h header include cleanup 2014-12-15 18:42:14 -06:00
Akkadius 34ce09afd1 raids.cpp & .h header include cleanup and forward declare 2014-12-15 18:38:54 -06:00
Akkadius c43377100e questmgr.cpp & .h include cleanup 2014-12-15 18:35:27 -06:00
Akkadius 87fd99a3e7 queryserv.cpp header cleanup 2014-12-15 18:33:39 -06:00
Akkadius e7911df851 quest_parser_collection.cpp & .h header include cleanup 2014-12-15 18:33:23 -06:00
Akkadius 7dc69b7755 qglobals.cpp & .h include header cleanup 2014-12-15 18:22:27 -06:00
Akkadius 24503bd0ee petitions.cpp & .h header include cleanup 2014-12-15 18:14:56 -06:00
Akkadius 250d9d1fb5 pets.cpp & .h include header cleanup 2014-12-15 18:14:39 -06:00
Akkadius 631d8cb015 pathing.cpp & .h header include cleanup 2014-12-15 18:10:45 -06:00
Akkadius 0e581f38d2 Merge branch 'master' of https://github.com/EQEmu/Server 2014-12-15 18:07:52 -06:00
Michael Cook (mackal) c1baade00f Fix build failure 2014-12-15 19:06:38 -05:00
Akkadius d44e982eaf object.cpp & .h header cleanup 2014-12-15 18:03:33 -06:00
Akkadius ec43a9248b mob_ai.cpp header cleanup 2014-12-15 17:57:03 -06:00
Trevius 21b6001351 Merge branch 'master' of https://github.com/EQEmu/Server 2014-12-15 17:56:28 -06:00
Trevius 200027bf89 (RoF+) Implemented the 6th Augment Slot for Items.
Player Corpses now saved attuned settings for Items.
Renamed IsInstNoDrop() and SetInstNoDrop() to IsAttuned() and SetAttuned() respectively.
2014-12-15 17:55:23 -06:00
Akkadius 782b6fee94 merc.cpp header include cleanup 2014-12-15 17:54:23 -06:00
Akkadius 55b495826c masterentity.h include order revert for linux 2014-12-15 17:48:18 -06:00
Akkadius 8584895427 merc.h header cleanup and forward declare 2014-12-15 17:47:52 -06:00
Akkadius 85b7cc6330 map.cpp & .h header cleanup 2014-12-15 17:44:46 -06:00
Akkadius 95c95525ba loottables.cpp & .h header include cleanup and forward declare 2014-12-15 17:41:14 -06:00
Akkadius abe471af64 horse.cpp & .h header cleanup and forward declare 2014-12-15 17:39:16 -06:00
Akkadius b733e96aea masterentity.h header order cleanup
hate_list.cpp & .h header cleanup and forward declare
2014-12-15 17:34:19 -06:00
Akkadius 1fcb8235c5 guild_mgr.cpp header cleanup 2014-12-15 17:28:04 -06:00
Akkadius 756e5ee139 groups.cpp & .h header cleanup and forward declare 2014-12-15 17:26:51 -06:00
Akkadius 494e250514 fearpath.cpp header cleanup 2014-12-15 17:23:13 -06:00
Akkadius 430f04775b exp.cpp header cleanup 2014-12-15 17:22:13 -06:00
Akkadius 9cbaedc64f entity.cpp & .h header cleanup & forward declare 2014-12-15 17:19:49 -06:00
Akkadius 4be92db77a embparser_api.cpp header org 2014-12-15 17:04:31 -06:00
Akkadius 9e4605d528 Merge branch 'master' of https://github.com/EQEmu/Server 2014-12-15 17:02:55 -06:00
Akkadius c5d23c5f1b effects.cpp header cleanup 2014-12-15 17:02:26 -06:00
Akkadius 1c7acbdbd9 doors.cpp & .h header cleanup & forward declaration 2014-12-15 16:53:53 -06:00
Akkadius 5b6eb885a0 corpse.cpp & .h header cleanup & forward declarations 2014-12-15 16:50:02 -06:00
Akkadius b90897c513 client_mods.cpp header cleanup 2014-12-15 16:41:04 -06:00
Akkadius d20c9c9ac6 client_logs.cpp header cleanup 2014-12-15 16:39:01 -06:00
JJ 905961d278 Linux fix for Mob type in AA_SwarmPetInfo. 2014-12-15 11:06:53 -05:00
Akkadius 0fd87d344c client.h cleanup 2014-12-15 05:13:45 -06:00
Akkadius ed63c92839 bonuses.cpp header cleanup 2014-12-15 04:58:53 -06:00
Akkadius ee4935566b beacon.h/cpp header cleanup 2014-12-15 04:56:01 -06:00
Akkadius 123da175e1 aa.cpp/.h cleanup 2014-12-15 04:49:45 -06:00
Michael Cook (mackal) 62181ff08c Add Random::Shuffle
This is just a wrapper to std::shuffle since it requires a random
engine and ours lives in a class

Must pass random access iterators (array, vector, deque, etc)

ex:

std::vector<int> v;
/* init ... */
random.Shuffle(v.begin(), v.end());
2014-12-15 02:53:58 -05:00
Michael Cook (mackal) 026d5e71fa Adjust common/random.h based on N3551 2014-12-14 19:38:23 -05:00
Trevius c85cbb2f08 Fixed bots build. 2014-12-13 14:09:44 -06:00
Trevius 250ad31038 Added required SQL. Without it, there will be item loss using the last commit! 2014-12-13 14:01:12 -06:00
Trevius 9056008342 (RoF+) Implemented Armor Ornamentation using Hero's Forge Armor Models. To use, create an ornamentation augment and set the herosforgemodel field in the items table.
(RoF+) Added command #heromodel (#hm for short) - Usage: #heromodel [hero forge model] [ [slot] ] (example: #heromodel 63)
2014-12-13 13:53:55 -06:00
Michael Cook (mackal) 80a67f9ebc Fix guild rank spam 2014-12-13 03:18:30 -05:00
Michael Cook (mackal) 118d587064 Implement IGNORE_ROOT_AGGRO_RULES (special attack 42)
This allows you to have a mob be rooted but still try to attack the
target with the most amount of hate instead of attacking the closest
2014-12-12 18:55:43 -05:00
Michael Cook (mackal) 0e54019fd5 Set the no_target_hotkey data as well 2014-12-10 02:18:57 -05:00
Michael Cook (mackal) d9a1bcb3fd Clean up SoF+ swarm pet F8 hack 2014-12-10 02:15:15 -05:00
Michael Cook (mackal) 820f99067d Make use of the targetable_with_hotkey flag for SoF+ 2014-12-10 01:19:44 -05:00
Michael Cook (mackal) 2d1999c961 Update version too 2014-12-10 00:59:54 -05:00
Michael Cook (mackal) 4c9befee22 Some clean ups due thanks to clang's warnings 2014-12-09 23:41:19 -05:00
Michael Cook (mackal) 362bfc79d6 Fix compile error 2014-12-09 22:33:09 -05:00
Trevius 37951d09c7 (RoF+) Implemented Hero's Forge Armor Models for Items. To use, set herosforgemodel field in the item table to a model number such as 63 (for example). 2014-12-09 21:18:56 -06:00
KayenEQ 4161ab3051 Merge pull request #316 from KayenEQ/Development
Fix for completely broken skill proc function.
2014-12-09 00:39:26 -05:00
KayenEQ 4047c70de1 Fix for completely broken skill proc function. 2014-12-09 00:38:20 -05:00
Michael Cook (mackal) 7e7ec8e3d2 Be more explicit about what we are checking
(This removes a crap ton of clang warnings)
2014-12-08 20:58:49 -05:00
KayenEQ 449b1f9d35 Merge pull request #315 from KayenEQ/Development
ADD FD check before adding projectile generated hate.
2014-12-08 19:18:59 -05:00
KayenEQ ba2aefc572 NPC Focus Effects Optional Rules SQL 2014-12-08 18:55:23 -05:00
KayenEQ 8df6e7e26b ADD FD check before adding projectile generated hate. 2014-12-08 18:44:37 -05:00
KayenEQ 2a33da248b Merge pull request #314 from KayenEQ/Development
Support for NPC's to use focus effects.
2014-12-08 18:12:41 -05:00
SecretsOTheP 9db39b5eec Added a feature that allows an EQ client to log in directly to World without having to enter the LoginServer, provided the 'password' field is set in WorldServer.
Mainly used for administration purposes. A DLL hack is needed to utilize this feature, and the DLL itself will be posted (source included) on the EQEmulator forums. It uses Microsoft Detours 1.5. Up to you guys if you want to add the source to this program here.
2014-12-08 05:46:10 -05:00
KayenEQ a4df155219 update 2014-12-08 01:47:29 -05:00
KayenEQ 70f570dbd9 Implemented support for allowing most focus effects to now be usable
by NPCs (ie Heal/Damage focus, cast time, spell range ect) from
both spell buffs and items.
Rule for enabling spell focus is TRUE by default
Rule for enabling item focus is FALSE by default.

Consilidated a number of redundant client / mob functions
to use the same pathway for calculating effect values.
2014-12-08 01:22:01 -05:00
Akkadius f81f62670e Header cleanup of aggro.cpp 2014-12-07 03:08:27 -06:00
Akkadius afd3b9acdc Header and code cleanup of debug.cpp 2014-12-07 03:02:57 -06:00
Michael Cook (mackal) 3e73df2c72 Clean up common/misc_functions.h 2014-12-06 21:56:14 -05:00
Michael Cook (mackal) eed666c8c2 OP_ClearAA and OP_ClearLeadershipAbilities for RoF2 2014-12-06 20:12:19 -05:00
Natedog2012 6b9a408b46 Don't allow AA to be bought that you cant use 2014-12-06 20:04:42 -05:00
Trevius 5713dc2de1 Guild Names now display properly in RoF2. 2014-12-06 18:18:49 -06:00
Trevius 4138e6f82c More RoF2 Opcodes identified. 2014-12-06 14:53:05 -06:00
Trevius 206bbe9e62 Merge branch 'master' of https://github.com/EQEmu/Server 2014-12-06 14:39:32 -06:00
Trevius 97a34b5793 The RoF2 client is now enabled by default. It is almost caught up to RoF Client compatibility. 2014-12-06 14:38:34 -06:00
Arthur Ice f0e22c9ff9 merged, removed mistake 'orig' files 2014-12-05 20:20:54 -08:00
Arthur Ice 2aa287fe3c Merge 2014-12-05 20:16:13 -08:00
Michael Cook (mackal) ce7a995223 Fix previous commit 2014-12-05 22:31:36 -05:00
Michael Cook (mackal) 51b997aa27 Implement OP_ClearAA and OP_ClearLeadershipAbilities for SoF+
This is nice since #resetaa will no longer require a kick
2014-12-05 22:29:41 -05:00
Michael Cook (mackal) 1ac92c603e Add OP_ClearLeadershipAbilties 2014-12-05 22:27:39 -05:00
Michael Cook (mackal) 57a196a50c Rename OP_ShroudClearAA to OP_ClearAA 2014-12-05 22:26:01 -05:00
Arthur Ice 100eca203f GetClosestZonePoint converted to xyz_location 2014-12-05 17:57:07 -08:00
Arthur Ice 523562c152 GetClosestZonePoint converted to xyz_location (id version) 2014-12-02 21:46:16 -08:00
Arthur Ice f00cddd67e graveyard_x(), graveyard_y(), graveyard_z(), and graveyard_heading() converted to GetGraveyardPoint() 2014-12-02 21:00:31 -08:00
Arthur Ice ff1942245b Added GetGraveyardPoint() to Zone 2014-12-02 20:25:38 -08:00
Arthur Ice e64e131c9c Removed safe_x(), safe_y(), safe_z() from Zone 2014-12-02 20:19:12 -08:00
Arthur Ice 0275e9646c Added GetSafePoint to Zone 2014-12-02 19:55:29 -08:00
Arthur Ice 75c1a302c9 Converted Corpse constructor to xyz_heading 2014-12-02 19:38:15 -08:00
Arthur Ice 7c211e1e11 simplified SummonAllCorpses 2014-12-02 19:29:43 -08:00
Arthur Ice ad506ece4d Added distance functions for position 2014-12-02 19:28:28 -08:00
Arthur Ice 2b7ecfdb2c ModifyWP converted to xyz_location 2014-12-02 18:24:56 -08:00
Arthur Ice e58dc94b2c AddWPForSpawn converted to xyz_heading 2014-12-02 18:17:13 -08:00
Arthur Ice 6206133729 AddWP converted to xyz_heading 2014-12-02 17:41:01 -08:00
Arthur Ice 2da6dfa931 CreateSpawn2 converted to xyz_heading 2014-12-02 16:53:52 -08:00
Arthur Ice cafa266c89 UpdateZoneSafeCoords converted to xyz_heading 2014-12-02 16:42:19 -08:00
Arthur Ice 275f2aa80f UpdateCharacterCorpse converted to xyz_heading 2014-12-02 16:21:20 -08:00
Arthur Ice 4243ce8582 SaveCharacterCorpse converted to xyz_heading 2014-12-02 16:02:12 -08:00
Arthur Ice 76210e1f0e CreateGraveyardRecord converted to xyz_heading 2014-12-02 15:42:30 -08:00
Arthur Ice d22f136eea SendCharacterCorpseToGraveyard to xyz_heading 2014-12-02 15:27:43 -08:00
Arthur Ice 361b4d1c62 UnburyCharacterCorpse converted to xyz_heading 2014-12-02 15:18:16 -08:00
Arthur Ice eb6c963c70 SummonAllGraveyardCorpses converted to xyz_heading 2014-12-02 15:04:13 -08:00
Arthur Ice f6c98132f0 SummonAllCorpses converted to xyz_heading 2014-12-02 14:50:48 -08:00
Arthur Ice 4daf4ab507 QuestManager::unique_spawn converted to xyz_heading 2014-12-02 14:36:51 -08:00
Arthur Ice 2e0cfa86bf QuestManager::spawn2 converted to xyz_heading 2014-12-02 13:27:01 -08:00
Arthur Ice 0ad62461f0 CorpseLoadFromDBData converted to xyz_heading 2014-12-02 13:13:04 -08:00
Arthur Ice 3791c38f97 SummonAllCharacterCorpses converted to xyz_heading 2014-12-02 12:52:40 -08:00
Arthur Ice 7a74df5ff1 summonallplayercorpses converted to xyz_heading 2014-12-02 12:42:47 -08:00
Arthur Ice dd5265dc02 SummonBuriedCharacterCorpses converted to xyz_heading 2014-12-02 12:19:27 -08:00
Arthur Ice efc4ba0e27 summonburriedplayercorpse converted to xyz_heading 2014-12-02 12:00:45 -08:00
Arthur Ice 04e24ddce4 moveto converted to xyz_heading 2014-12-02 11:20:10 -08:00
Arthur Ice 9d6a89c65d rebind converted to xyz_location 2014-12-02 10:56:02 -08:00
Arthur Ice 7ce7af05f3 SetBindPoint converted to xyz_location 2014-12-02 10:47:46 -08:00
Arthur Ice 2995b20d62 SaveCharacterBindPoint converted to xyz_heading 2014-12-02 10:29:35 -08:00
Arthur Ice 14608c972a SetGraveyard to xyz_header 2014-12-01 23:34:41 -08:00
Arthur Ice c3333a46c9 pgraveyard_x, pgraveyard_y, pgraveyard_z, and pgraveyard_heading converted to xyz_heading as m_Graveyard 2014-12-01 23:12:19 -08:00
Arthur Ice 40ec1f805f psafe_x, psafe_y, and psafe_z replaced with xyz_location m_SafePoint 2014-12-01 22:35:46 -08:00
Arthur Ice f5a94ed07b IsSpellBlocked converted to use xyz_location 2014-12-01 16:00:48 -08:00
Arthur Ice b06647b763 Zone::GetSpellBlockedMessage convered to use IsWithinAxisAlignedBox 2014-12-01 15:48:59 -08:00
Arthur Ice feac1728dc Added two axis aligned bounding box check functions 2014-12-01 15:39:53 -08:00
Arthur Ice fb9d76f851 GetSpellBlockedMessage converted to xyz_location 2014-12-01 14:16:53 -08:00
Arthur Ice 81d2e7d242 xdiff, ydiff, and zdiff in ZoneSpellsBlocked converted to xyz_location m_Difference 2014-12-01 13:32:19 -08:00
Arthur Ice 2fe80d32f9 ZoneSpellsBlocked converted x,y, and z to m_Location as xyz_location 2014-12-01 13:05:40 -08:00
Arthur Ice 31d32682b0 ZoneDatabase::InsertDoor converted to xyz_heading 2014-12-01 12:30:07 -08:00
Arthur Ice 5af1998167 aa_los_them converted to xyz_location m_AutoAttackTargetLocation 2014-12-01 01:23:58 -08:00
Arthur Ice f973d256dc aa_los_me and aa_los_me_heading converted xyz_heading m_AutoAttackPosition 2014-12-01 01:19:18 -08:00
Arthur Ice 0a685d316d zonesummon_x, zonesummon_y, and zonesummon_z converted to xyz_location m_ZoneSummonLocation 2014-12-01 00:26:35 -08:00
Arthur Ice fb1d5842ea proximity_x, proximity_y, and proximity_z converted to xyz_location m_Proximity 2014-12-01 00:03:59 -08:00
Arthur Ice e31c95670a EntityList::ProcessMove converted to xyz_location 2014-11-30 23:50:24 -08:00
Arthur Ice 54f3f7f343 EntityList::GetRandomClient converted to xyz_location 2014-11-30 22:28:17 -08:00
Arthur Ice 8b7a09dbc1 QuestMgr::movePCInstance converted to xyz_heading 2014-11-30 22:14:57 -08:00
Arthur Ice c8063c31ed QuestMgr::CreateObjectFromModel converted to xyz_heading 2014-11-30 22:05:34 -08:00
Arthur Ice 4c5117cabe QuestManager::CreateGroundObject converted to xyz_heading 2014-11-30 21:42:59 -08:00
Arthur Ice c3471ed88e EntityList::CreateGroundObject converted to xyz_heading 2014-11-30 21:30:16 -08:00
Arthur Ice d54215ea18 EntityList::CreateGroundObjectFromModel converted to to xyz_heading 2014-11-30 21:20:46 -08:00
Arthur Ice 4f03ebb3af EntityList::CreateDoor converted to xyz_heading 2014-11-30 21:04:39 -08:00
Arthur Ice 7ac9a5c5a6 Doors constructor converted to xyz_heading 2014-11-30 20:49:48 -08:00
Arthur Ice 7239a1339e Replaced SetX(), SetY(), SetZ(), and SetHeading() with SetPosition() on Doors 2014-11-30 20:37:43 -08:00
Arthur Ice a70eadecf4 Replaced GetX(), GetY(), GetZ(), and GetHeading() in Doors with GetPosition() 2014-11-30 20:23:18 -08:00
Arthur Ice 40d26b5bcf replaced GetDestX(), GetDestY(), GetDestZ(), and GetDestHeading() with GetDestination in Doors 2014-11-30 20:05:51 -08:00
Arthur Ice 95f7bd94f3 replaced dest_x, dest_y, dest_z, and dest_headingg in Doors with xyz_heading m_Destination 2014-11-30 19:58:56 -08:00
Arthur Ice 9f62f0e485 replaced pos_x, pos_y, pos_z, heading in Doors with xyz_heading m_Position 2014-11-30 19:47:49 -08:00
Arthur Ice 70d26a532c SetPreSummonX(), SetPreSummonY(), and SetPreSummonZ() converted to SetPreSummonLocation() 2014-11-30 19:34:44 -08:00
Arthur Ice 98a8ddbb21 Replace GetPreSummonX(), GetPreSummonY(), GetPreSummonZ() with GetPreSummonLocation as xyz_location 2014-11-30 19:23:35 -08:00
Arthur Ice 381dc7574f replaced _preSummonX, _preSummonY, and _preSummonZ in bot with xyz_location m_PreSummonlocation 2014-11-30 19:14:24 -08:00
Arthur Ice 6b1b083802 mob constructor converted to xyz_heading 2014-11-30 18:57:50 -08:00
Arthur Ice 708b4f3bfb Horse constructor converted to xyz_heading 2014-11-30 18:33:45 -08:00
Arthur Ice 51d6ea622e Switched to c++11 based abs instead of hacky custom version 2014-11-30 18:13:28 -08:00
Arthur Ice 2546c6c226 Trap converted to use xyz_location as m_Position instead of x, y, z 2014-11-30 18:10:50 -08:00
Arthur Ice 54bc1b06e4 NPC constructor converted to use xyz_heading 2014-11-30 17:32:11 -08:00
Arthur Ice 0570722b3b MoveTo converted to xyz_heading 2014-11-30 16:30:09 -08:00
Arthur Ice e6d23228e5 GetSpawnPointX(), GetSpawnPointY(), GetSpawnPointZ(), and GetSpawnPointH(), converted to GetSpawnPoint() 2014-11-30 15:58:44 -08:00
Arthur Ice 2e6711916e GetClosestWaypoint converted to xyz_location 2014-11-30 15:40:24 -08:00
Arthur Ice 69dbdb2485 GetSpawnPointX(). GetSpawnPointY(), GetSpawnPointZ(), and GetSpawnPointH() replaced with GetSpawnPoint() 2014-11-30 15:29:13 -08:00
Arthur Ice f9036ddc6a GetGuardPointX(), GetGuardPointY(), GetGuardPointZ(), and GetGuardPointH() replaced with GetGuardPoint() 2014-11-30 15:05:50 -08:00
Arthur Ice c060723762 guard_x_saved, guard_y_saved, guard_z_saved, guard_heading_saved converted to m_GuardPointSaved 2014-11-30 14:34:27 -08:00
Arthur Ice 4b71d28747 guard_x, guard_y, guard_z, guard_heading converted to xyz_heading as m_GuardPoint 2014-11-30 14:17:14 -08:00
Arthur Ice 6ffd7203ff org_x, org_y, org_z, and org_heading converted to xyz_heading as m_SpawnPoint 2014-11-30 13:51:57 -08:00
Arthur Ice 82cc830297 converted Warp to xyz_location instead of x,y,z 2014-11-29 21:24:57 -08:00
Arthur Ice 4b48ed7cbc SetDeltas converted to SetDelta 2014-11-29 21:07:08 -08:00
Arthur Ice 607e28dcbf added GetPosition to mob 2014-11-29 16:43:24 -08:00
Arthur Ice 11ecf77c85 added constness to operators 2014-11-29 16:22:36 -08:00
Arthur Ice 5b783e84e9 added automatic conversion of Map::Vertex into xyz_location 2014-11-26 21:25:09 -08:00
Arthur Ice 4094d43c49 InLiquid converted to xyz_location 2014-11-26 19:39:39 -08:00
Arthur Ice 2f203fa6bb InLava converted to xyz_location 2014-11-26 19:38:53 -08:00
Arthur Ice 5140e6fabf InVWater converted to xyz_location 2014-11-26 19:37:32 -08:00
Arthur Ice ef18458480 ReturnRegionType converted to xyz_location 2014-11-26 19:36:47 -08:00
Arthur Ice 6cd614a05e InLiquid converted to xyz_location 2014-11-26 19:32:46 -08:00
Arthur Ice 29573d7d19 InLava converted to xyz_location 2014-11-26 19:24:28 -08:00
Arthur Ice d8692c1dc7 InVWater converted to xyz_location 2014-11-26 19:22:41 -08:00
Arthur Ice c0faaa9c20 ReturnRegionType converted to xyz_location 2014-11-26 19:20:41 -08:00
Arthur Ice f9e65acf78 InWater(y,x,z) converted to InWater(xyz_location) 2014-11-26 19:18:06 -08:00
Arthur Ice d9d89ba9b3 GetCWPX(), GetCWPY(), GetCWPZ(), GetCWPH() converted to GetCurrentWayPoint 2014-11-26 17:34:45 -08:00
Arthur Ice f63c5ab6ba Added overloads for to_string to handle xyz_heading, xyz_location, and xy_location 2014-11-26 17:21:33 -08:00
Arthur Ice 408fdc7178 tarv_x, tarv_y. tarv_z converted to xyz_location 2014-11-26 15:58:29 -08:00
Arthur Ice 75543e68e3 tarx, tary, tarz converted to m_TargetLocation as xyz_location 2014-11-26 15:10:49 -08:00
Arthur Ice a6177859ff fear_walkto_x, fear_walkto_y, fear_walkto_z replaced with m_FearWalkTarget converted to xyz_location 2014-11-26 14:57:12 -08:00
Arthur Ice 09f75c09b8 rewind_x, rewind_y,rewind_z replaced with m_RewindLocation of type xyz_location 2014-11-26 00:56:07 -08:00
Arthur Ice cab1f986f1 targetring_x, targetring_y, targetring_z replaced with m_TargetRing as an xyz_location 2014-11-25 23:44:02 -08:00
Arthur Ice d25c5b1fa0 cur_wp_x, cur_wp_y, cur_wp_z, cur_wp_heading replaced with m_CurrentWayPoint 2014-11-25 23:24:17 -08:00
Arthur Ice 65ad5b5c99 Removed use of initializer lists. so less pretty 2014-11-25 21:45:41 -08:00
Arthur Ice 5115a29bb7 spell_x,spell_y, spell_z converted to m_SpellLocation, xyz_location 2014-11-25 21:06:13 -08:00
Arthur Ice 096cbaf1bb delta_x, delta_y, delta_z, and int delta_heading converted to m_Delta 2014-11-25 20:43:09 -08:00
Arthur Ice 53602e3c61 heading, x_pos, y_pos, and z_pos replaced with m_Position in Mob 2014-11-25 20:16:04 -08:00
Arthur Ice 640aea24bc xyz_heading, xyz_location, and xy_location built 2014-11-25 02:44:40 -08:00
KimLS 54fae508c5 Merge branch 'master' into loot 2014-10-02 10:16:15 -07:00
KimLS 0cd320dd75 Merge branch 'master' into loot 2014-09-29 19:24:12 -07:00
KimLS 725c5633f6 Fix for avg_coin 2014-09-29 17:13:32 -07:00
KimLS ef082b9144 Merge branch 'master' into loot 2014-09-27 20:09:13 -07:00
KimLS 7fed01ddea initial rewrite of loot code 2014-09-27 19:57:45 -07:00
861 changed files with 148657 additions and 85643 deletions
+10 -4
View File
@@ -1,11 +1,17 @@
language: cpp
compiler: gcc
before_install:
- sudo apt-get update -qq
- sudo apt-get install -y libmysqlclient-dev libperl-dev libboost-dev liblua5.1-0-dev zlib1g-dev
sudo: false
addons:
apt:
packages:
- libmysqlclient-dev
- libperl-dev
- libboost-dev
- liblua5.1-0-dev
- zlib1g-dev
script:
- cmake -G "Unix Makefiles" -DEQEMU_BUILD_TESTS=ON -DEQEMU_ENABLE_BOTS=ON
- make
- make -j8
- ./bin/tests
branches:
only:
+1 -1
View File
@@ -325,7 +325,7 @@ IF(EQEMU_BUILD_LUA)
ENDIF(EQEMU_SANITIZE_LUA_LIBS)
ENDIF(EQEMU_BUILD_LUA)
INCLUDE_DIRECTORIES(SYSTEM "${ZLIB_INCLUDE_DIRS}" "${MySQL_INCLUDE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/common/glm/glm")
INCLUDE_DIRECTORIES(SYSTEM "${ZLIB_INCLUDE_DIRS}" "${MySQL_INCLUDE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/common/glm")
IF(EQEMU_BUILD_LUA)
ADD_SUBDIRECTORY(luabind)
+904 -200
View File
File diff suppressed because it is too large Load Diff
+59 -22
View File
@@ -17,7 +17,9 @@
*/
#include <stdio.h>
#include "../../common/debug.h"
#include "../../common/eqemu_logsys.h"
#include "../../common/global_define.h"
#include "../../common/shareddb.h"
#include "../../common/eqemu_config.h"
#include "../../common/platform.h"
@@ -25,47 +27,55 @@
#include "../../common/rulesys.h"
#include "../../common/string_util.h"
EQEmuLogSys Log;
void ExportSpells(SharedDatabase *db);
void ExportSkillCaps(SharedDatabase *db);
void ExportBaseData(SharedDatabase *db);
void ExportDBStrings(SharedDatabase *db);
int main(int argc, char **argv) {
RegisterExecutablePlatform(ExePlatformClientExport);
Log.LoadLogSettingsDefaults();
set_exception_handler();
LogFile->write(EQEMuLog::Status, "Client Files Export Utility");
Log.Out(Logs::General, Logs::Status, "Client Files Export Utility");
if(!EQEmuConfig::LoadConfig()) {
LogFile->write(EQEMuLog::Error, "Unable to load configuration file.");
Log.Out(Logs::General, Logs::Error, "Unable to load configuration file.");
return 1;
}
const EQEmuConfig *config = EQEmuConfig::get();
if(!load_log_settings(config->LogSettingsFile.c_str())) {
LogFile->write(EQEMuLog::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str());
}
auto Config = EQEmuConfig::get();
SharedDatabase database;
LogFile->write(EQEMuLog::Status, "Connecting to database...");
if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(),
config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) {
LogFile->write(EQEMuLog::Error, "Unable to connect to the database, cannot continue without a "
Log.Out(Logs::General, Logs::Status, "Connecting to database...");
if(!database.Connect(Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(),
Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) {
Log.Out(Logs::General, Logs::Error, "Unable to connect to the database, cannot continue without a "
"database connection");
return 1;
}
/* Register Log System and Settings */
database.LoadLogSettings(Log.log_settings);
Log.StartFileLogs();
ExportSpells(&database);
ExportSkillCaps(&database);
ExportBaseData(&database);
ExportDBStrings(&database);
Log.CloseFileLogs();
return 0;
}
void ExportSpells(SharedDatabase *db) {
LogFile->write(EQEMuLog::Status, "Exporting Spells...");
Log.Out(Logs::General, Logs::Status, "Exporting Spells...");
FILE *f = fopen("export/spells_us.txt", "w");
if(!f) {
LogFile->write(EQEMuLog::Error, "Unable to open export/spells_us.txt to write, skipping.");
Log.Out(Logs::General, Logs::Error, "Unable to open export/spells_us.txt to write, skipping.");
return;
}
@@ -89,7 +99,6 @@ void ExportSpells(SharedDatabase *db) {
fprintf(f, "%s\n", line.c_str());
}
} else {
LogFile->write(EQEMuLog::Error, "Error in ExportSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
}
fclose(f);
@@ -103,7 +112,6 @@ bool SkillUsable(SharedDatabase *db, int skill_id, int class_id) {
class_id, skill_id);
auto results = db->QueryDatabase(query);
if(!results.Success()) {
LogFile->write(EQEMuLog::Error, "Error in skill_usable query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
return false;
}
@@ -123,7 +131,6 @@ int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) {
class_id, skill_id, level);
auto results = db->QueryDatabase(query);
if (!results.Success()) {
LogFile->write(EQEMuLog::Error, "Error in get_skill query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
return 0;
}
@@ -135,11 +142,11 @@ int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) {
}
void ExportSkillCaps(SharedDatabase *db) {
LogFile->write(EQEMuLog::Status, "Exporting Skill Caps...");
Log.Out(Logs::General, Logs::Status, "Exporting Skill Caps...");
FILE *f = fopen("export/SkillCaps.txt", "w");
if(!f) {
LogFile->write(EQEMuLog::Error, "Unable to open export/SkillCaps.txt to write, skipping.");
Log.Out(Logs::General, Logs::Error, "Unable to open export/SkillCaps.txt to write, skipping.");
return;
}
@@ -164,11 +171,11 @@ void ExportSkillCaps(SharedDatabase *db) {
}
void ExportBaseData(SharedDatabase *db) {
LogFile->write(EQEMuLog::Status, "Exporting Base Data...");
Log.Out(Logs::General, Logs::Status, "Exporting Base Data...");
FILE *f = fopen("export/BaseData.txt", "w");
if(!f) {
LogFile->write(EQEMuLog::Error, "Unable to open export/BaseData.txt to write, skipping.");
Log.Out(Logs::General, Logs::Error, "Unable to open export/BaseData.txt to write, skipping.");
return;
}
@@ -189,8 +196,38 @@ void ExportBaseData(SharedDatabase *db) {
fprintf(f, "%s\n", line.c_str());
}
} else {
LogFile->write(EQEMuLog::Error, "Error in ExportBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
}
fclose(f);
}
void ExportDBStrings(SharedDatabase *db) {
Log.Out(Logs::General, Logs::Status, "Exporting DB Strings...");
FILE *f = fopen("export/dbstr_us.txt", "w");
if(!f) {
Log.Out(Logs::General, Logs::Error, "Unable to open export/dbstr_us.txt to write, skipping.");
return;
}
fprintf(f, "Major^Minor^String(New)\n");
const std::string query = "SELECT * FROM db_str ORDER BY id, type";
auto results = db->QueryDatabase(query);
if(results.Success()) {
for(auto row = results.begin(); row != results.end(); ++row) {
std::string line;
unsigned int fields = results.ColumnCount();
for(unsigned int rowIndex = 0; rowIndex < fields; ++rowIndex) {
if(rowIndex != 0)
line.push_back('^');
if(row[rowIndex] != nullptr) {
line += row[rowIndex];
}
}
fprintf(f, "%s\n", line.c_str());
}
}
fclose(f);
+110 -23
View File
@@ -16,7 +16,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../../common/debug.h"
#include "../../common/eqemu_logsys.h"
#include "../../common/global_define.h"
#include "../../common/shareddb.h"
#include "../../common/eqemu_config.h"
#include "../../common/platform.h"
@@ -24,38 +25,45 @@
#include "../../common/rulesys.h"
#include "../../common/string_util.h"
EQEmuLogSys Log;
void ImportSpells(SharedDatabase *db);
void ImportSkillCaps(SharedDatabase *db);
void ImportBaseData(SharedDatabase *db);
void ImportDBStrings(SharedDatabase *db);
int main(int argc, char **argv) {
RegisterExecutablePlatform(ExePlatformClientImport);
Log.LoadLogSettingsDefaults();
set_exception_handler();
LogFile->write(EQEMuLog::Status, "Client Files Import Utility");
Log.Out(Logs::General, Logs::Status, "Client Files Import Utility");
if(!EQEmuConfig::LoadConfig()) {
LogFile->write(EQEMuLog::Error, "Unable to load configuration file.");
Log.Out(Logs::General, Logs::Error, "Unable to load configuration file.");
return 1;
}
const EQEmuConfig *config = EQEmuConfig::get();
if(!load_log_settings(config->LogSettingsFile.c_str())) {
LogFile->write(EQEMuLog::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str());
}
auto Config = EQEmuConfig::get();
SharedDatabase database;
LogFile->write(EQEMuLog::Status, "Connecting to database...");
if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(),
config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) {
LogFile->write(EQEMuLog::Error, "Unable to connect to the database, cannot continue without a "
Log.Out(Logs::General, Logs::Status, "Connecting to database...");
if(!database.Connect(Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(),
Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) {
Log.Out(Logs::General, Logs::Error, "Unable to connect to the database, cannot continue without a "
"database connection");
return 1;
}
database.LoadLogSettings(Log.log_settings);
Log.StartFileLogs();
ImportSpells(&database);
ImportSkillCaps(&database);
ImportBaseData(&database);
ImportDBStrings(&database);
Log.CloseFileLogs();
return 0;
}
@@ -64,18 +72,35 @@ int GetSpellColumns(SharedDatabase *db) {
const std::string query = "DESCRIBE spells_new";
auto results = db->QueryDatabase(query);
if(!results.Success()) {
LogFile->write(EQEMuLog::Error, "Error in GetSpellColumns query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
return 0;
}
return results.RowCount();
}
bool IsStringField(int i) {
switch(i)
{
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
return true;
break;
default:
return false;
}
}
void ImportSpells(SharedDatabase *db) {
LogFile->write(EQEMuLog::Status, "Importing Spells...");
Log.Out(Logs::General, Logs::Status, "Importing Spells...");
FILE *f = fopen("import/spells_us.txt", "r");
if(!f) {
LogFile->write(EQEMuLog::Error, "Unable to open import/spells_us.txt to read, skipping.");
Log.Out(Logs::General, Logs::Error, "Unable to open import/spells_us.txt to read, skipping.");
return;
}
@@ -108,7 +133,12 @@ void ImportSpells(SharedDatabase *db) {
sql += "'";
}
sql += split[i];
if(split[i].compare("") == 0 && !IsStringField(i)) {
sql += "0";
}
else {
sql += split[i];
}
sql += "'";
}
@@ -123,7 +153,12 @@ void ImportSpells(SharedDatabase *db) {
sql += "'";
}
sql += split[i];
if(split[i].compare("") == 0 && !IsStringField(i)) {
sql += "0";
} else {
sql += split[i];
}
sql += "'";
}
@@ -138,23 +173,23 @@ void ImportSpells(SharedDatabase *db) {
spells_imported++;
if(spells_imported % 1000 == 0) {
LogFile->write(EQEMuLog::Status, "%d spells imported.", spells_imported);
Log.Out(Logs::General, Logs::Status, "%d spells imported.", spells_imported);
}
}
if(spells_imported % 1000 != 0) {
LogFile->write(EQEMuLog::Status, "%d spells imported.", spells_imported);
Log.Out(Logs::General, Logs::Status, "%d spells imported.", spells_imported);
}
fclose(f);
}
void ImportSkillCaps(SharedDatabase *db) {
LogFile->write(EQEMuLog::Status, "Importing Skill Caps...");
Log.Out(Logs::General, Logs::Status, "Importing Skill Caps...");
FILE *f = fopen("import/SkillCaps.txt", "r");
if(!f) {
LogFile->write(EQEMuLog::Error, "Unable to open import/SkillCaps.txt to read, skipping.");
Log.Out(Logs::General, Logs::Error, "Unable to open import/SkillCaps.txt to read, skipping.");
return;
}
@@ -169,7 +204,6 @@ void ImportSkillCaps(SharedDatabase *db) {
continue;
}
int class_id, skill_id, level, cap;
class_id = atoi(split[0].c_str());
skill_id = atoi(split[1].c_str());
@@ -186,11 +220,11 @@ void ImportSkillCaps(SharedDatabase *db) {
}
void ImportBaseData(SharedDatabase *db) {
LogFile->write(EQEMuLog::Status, "Importing Base Data...");
Log.Out(Logs::General, Logs::Status, "Importing Base Data...");
FILE *f = fopen("import/BaseData.txt", "r");
if(!f) {
LogFile->write(EQEMuLog::Error, "Unable to open import/BaseData.txt to read, skipping.");
Log.Out(Logs::General, Logs::Error, "Unable to open import/BaseData.txt to read, skipping.");
return;
}
@@ -229,3 +263,56 @@ void ImportBaseData(SharedDatabase *db) {
fclose(f);
}
void ImportDBStrings(SharedDatabase *db) {
Log.Out(Logs::General, Logs::Status, "Importing DB Strings...");
FILE *f = fopen("import/dbstr_us.txt", "r");
if(!f) {
Log.Out(Logs::General, Logs::Error, "Unable to open import/dbstr_us.txt to read, skipping.");
return;
}
std::string delete_sql = "DELETE FROM db_str";
db->QueryDatabase(delete_sql);
char buffer[2048];
bool first = true;
while(fgets(buffer, 2048, f)) {
if(first) {
first = false;
continue;
}
for(int i = 0; i < 2048; ++i) {
if(buffer[i] == '\n') {
buffer[i] = 0;
break;
}
}
auto split = SplitString(buffer, '^');
if(split.size() < 2) {
continue;
}
std::string sql;
int id, type;
std::string value;
id = atoi(split[0].c_str());
type = atoi(split[1].c_str());
if(split.size() >= 3) {
value = ::EscapeString(split[2]);
}
sql = StringFormat("INSERT INTO db_str(id, type, value) VALUES(%u, %u, '%s')",
id, type, value.c_str());
db->QueryDatabase(sql);
}
fclose(f);
}
+23 -20
View File
@@ -21,6 +21,12 @@ IF(MYSQL_ROOT)
NAMES mysql.h
PATHS ${MYSQL_ROOT}/include
PATH_SUFFIXES mysql
NO_DEFAULT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
)
FIND_PATH(MySQL_INCLUDE_DIR
NAMES mysql.h
PATH_SUFFIXES mysql
)
ELSE(MYSQL_ROOT)
FIND_PATH(MySQL_INCLUDE_DIR
@@ -30,49 +36,46 @@ ELSE(MYSQL_ROOT)
ENDIF(MYSQL_ROOT)
# Library
SET(MySQL_NAMES mysqlclient_r mysqlclient)
SET(MySQL_NAMES libmysql)
IF(MYSQL_ROOT)
FIND_LIBRARY(MySQL_LIBRARY_DEBUG
FIND_LIBRARY(MySQL_LIBRARY
NAMES ${MySQL_NAMES}
PATHS ${MYSQL_ROOT}/lib/debug /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64
PATHS ${MYSQL_ROOT}/lib
PATH_SUFFIXES mysql
NO_DEFAULT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
)
FIND_LIBRARY(MySQL_LIBRARY_RELEASE
FIND_LIBRARY(MySQL_LIBRARY
NAMES ${MySQL_NAMES}
PATHS ${MYSQL_ROOT}/lib /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64
PATH_SUFFIXES mysql
)
ELSE(MYSQL_ROOT)
FIND_LIBRARY(MySQL_LIBRARY_DEBUG
NAMES ${MySQL_NAMES}
PATHS /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64
PATH_SUFFIXES mysql
)
FIND_LIBRARY(MySQL_LIBRARY_RELEASE
NAMES ${MySQL_NAMES}
FIND_LIBRARY(MySQL_LIBRARY
NAMES ${MySQL_NAMES} mysqlclient_r mysqlclient
PATHS /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64
PATH_SUFFIXES mysql
)
ENDIF(MYSQL_ROOT)
IF (MySQL_INCLUDE_DIR AND MySQL_LIBRARY_DEBUG AND MySQL_LIBRARY_RELEASE)
IF (MySQL_INCLUDE_DIR AND MySQL_LIBRARY)
SET(MySQL_FOUND TRUE)
SET( MySQL_LIBRARIES ${MySQL_LIBRARY_DEBUG} ${MySQL_LIBRARY_RELEASE} )
ELSE (MySQL_INCLUDE_DIR AND MySQL_LIBRARY_DEBUG AND MySQL_LIBRARY_RELEASE)
SET( MySQL_LIBRARIES ${MySQL_LIBRARY} )
ELSE (MySQL_INCLUDE_DIR AND MySQL_LIBRARY)
SET(MySQL_FOUND FALSE)
SET( MySQL_LIBRARIES )
ENDIF (MySQL_INCLUDE_DIR AND MySQL_LIBRARY_DEBUG AND MySQL_LIBRARY_RELEASE)
ENDIF (MySQL_INCLUDE_DIR AND MySQL_LIBRARY)
# handle the QUIETLY and REQUIRED arguments and set MySQL_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MySQL DEFAULT_MSG MySQL_LIBRARY_DEBUG MySQL_LIBRARY_RELEASE MySQL_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MySQL DEFAULT_MSG MySQL_LIBRARY MySQL_INCLUDE_DIR)
IF(MySQL_FOUND)
SET( MySQL_LIBRARIES ${MySQL_LIBRARY_DEBUG} ${MySQL_LIBRARY_RELEASE} )
SET( MySQL_LIBRARY_RELEASE ${MySQL_LIBRARY} )
SET( MySQL_LIBRARY_DEBUG ${MySQL_LIBRARY} )
SET( MySQL_LIBRARIES ${MySQL_LIBRARY_RELEASE} ${MySQL_LIBRARY_DEBUG} )
ELSE(MySQL_FOUND)
SET( MySQL_LIBRARIES )
ENDIF(MySQL_FOUND)
+72 -60
View File
@@ -3,22 +3,28 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
SET(common_sources
base_packet.cpp
classes.cpp
client_version.cpp
condition.cpp
crash.cpp
crc16.cpp
crc32.cpp
database.cpp
database_conversions.cpp
database_instances.cpp
dbcore.cpp
debug.cpp
deity.cpp
emu_constants.cpp
emu_legacy.cpp
emu_limits.cpp
emu_opcodes.cpp
emu_tcp_connection.cpp
emu_tcp_server.cpp
eq_dictionary.cpp
eqdb.cpp
eqdb_res.cpp
eqemu_exception.cpp
eqemu_config.cpp
eqemu_error.cpp
eqemu_logsys.cpp
eq_limits.cpp
eq_packet.cpp
eq_stream.cpp
eq_stream_factory.cpp
@@ -29,15 +35,15 @@ SET(common_sources
faction.cpp
guild_base.cpp
guilds.cpp
inventory_version.cpp
ipc_mutex.cpp
item.cpp
logsys.cpp
logsys_eqemu.cpp
item_struct.cpp
light_source.cpp
md5.cpp
memory_mapped_file.cpp
misc.cpp
misc_functions.cpp
moremath.cpp
mutex.cpp
mysql_request_result.cpp
mysql_request_row.cpp
@@ -53,6 +59,7 @@ SET(common_sources
races.cpp
rdtsc.cpp
rulesys.cpp
say_link.cpp
serverinfo.cpp
shareddb.cpp
skills.cpp
@@ -67,14 +74,19 @@ SET(common_sources
worldconn.cpp
xml_parser.cpp
platform.cpp
patches/client62.cpp
patches/patches.cpp
patches/sod.cpp
patches/sod_limits.cpp
patches/sof.cpp
patches/sof_limits.cpp
patches/rof.cpp
patches/rof_limits.cpp
patches/rof2.cpp
patches/rof2_limits.cpp
patches/titanium.cpp
patches/underfoot.cpp
patches/titanium_limits.cpp
patches/uf.cpp
patches/uf_limits.cpp
SocketLib/Base64.cpp
SocketLib/File.cpp
SocketLib/HttpdCookies.cpp
@@ -98,8 +110,8 @@ SET(common_headers
base_packet.h
base_data.h
bodytypes.h
breakdowns.h
classes.h
client_version.h
condition.h
crash.h
crc16.h
@@ -107,21 +119,23 @@ SET(common_headers
data_verification.h
database.h
dbcore.h
debug.h
deity.h
emu_constants.h
emu_legacy.h
emu_limits.h
emu_opcodes.h
emu_oplist.h
emu_tcp_connection.h
emu_tcp_server.h
eq_constants.h
eq_dictionary.h
eq_packet_structs.h
eqdb.h
eqdb_res.h
eqemu_exception.h
eqemu_config.h
eqemu_config_elements.h
eqemu_error.h
eqemu_logsys.h
eq_limits.h
eq_packet.h
eq_stream.h
eq_stream_factory.h
@@ -137,23 +151,23 @@ SET(common_headers
features.h
fixed_memory_hash_set.h
fixed_memory_variable_hash_set.h
global_define.h
guild_base.h
guilds.h
inventory_version.h
ipc_mutex.h
item.h
item_fieldlist.h
item_struct.h
languages.h
light_source.h
linked_list.h
logsys.h
logtypes.h
loottable.h
mail_oplist.h
md5.h
memory_mapped_file.h
misc.h
misc_functions.h
moremath.h
mutex.h
mysql_request_result.h
mysql_request_row.h
@@ -173,6 +187,7 @@ SET(common_headers
rdtsc.h
rulesys.h
ruletypes.h
say_link.h
seperator.h
serverinfo.h
servertalk.h
@@ -193,46 +208,42 @@ SET(common_headers
worldconn.h
xml_parser.h
zone_numbers.h
patches/client62.h
patches/client62_constants.h
patches/client62_itemfields.h
patches/client62_ops.h
patches/client62_structs.h
patches/patches.h
patches/sod.h
patches/sod_constants.h
patches/sod_itemfields.h
# patches/sod_itemfields.h
patches/sod_limits.h
patches/sod_ops.h
patches/sod_structs.h
patches/sof.h
patches/sof_constants.h
patches/sof_itemfields.h
patches/sof_opcode_list.h
# patches/sof_itemfields.h
patches/sof_limits.h
# patches/sof_opcode_list.h
patches/sof_ops.h
patches/sof_structs.h
patches/ss_declare.h
patches/ss_define.h
patches/ss_register.h
patches/rof.h
patches/rof_constants.h
patches/rof_itemfields.h
# patches/rof_itemfields.h
patches/rof_limits.h
patches/rof_ops.h
patches/rof_structs.h
patches/rof2.h
patches/rof2_constants.h
patches/rof2_itemfields.h
# patches/rof2_itemfields.h
patches/rof2_limits.h
patches/rof2_ops.h
patches/rof2_structs.h
patches/titanium.h
patches/titanium_constants.h
patches/titanium_itemfields.h
# patches/titanium_itemfields_a.h
# patches/titanium_itemfields_b.h
patches/titanium_limits.h
patches/titanium_ops.h
patches/titanium_structs.h
patches/underfoot.h
patches/underfoot_constants.h
patches/underfoot_itemfields.h
patches/underfoot_ops.h
patches/underfoot_structs.h
patches/uf.h
# patches/uf_itemfields.h
patches/uf_limits.h
patches/uf_ops.h
patches/uf_structs.h
SocketLib/Base64.h
SocketLib/File.h
SocketLib/HttpdCookies.h
@@ -251,54 +262,55 @@ SET(common_headers
)
SOURCE_GROUP(Patches FILES
patches/client62.h
patches/client62_itemfields.h
patches/client62_ops.h
patches/client62_constants.h
patches/client62_structs.h
patches/patches.h
patches/sod.h
patches/sod_itemfields.h
# patches/sod_itemfields.h
patches/sod_limits.h
patches/sod_ops.h
patches/sod_constants.h
patches/sod_structs.h
patches/sof.h
patches/sof_itemfields.h
patches/sof_opcode_list.h
# patches/sof_itemfields.h
patches/sof_limits.h
# patches/sof_opcode_list.h
patches/sof_ops.h
patches/sof_constants.h
patches/sof_structs.h
patches/ss_declare.h
patches/ss_define.h
patches/ss_register.h
patches/rof.h
patches/rof_itemfields.h
# patches/rof_itemfields.h
patches/rof_limits.h
patches/rof_ops.h
patches/rof_constants.h
patches/rof_structs.h
patches/rof2.h
patches/rof2_itemfields.h
# patches/rof2_itemfields.h
patches/rof2_limits.h
patches/rof2_ops.h
patches/rof2_constants.h
patches/rof2_structs.h
patches/titanium.h
patches/titanium_itemfields.h
# patches/titanium_itemfields_a.h
# patches/titanium_itemfields_b.h
patches/titanium_limits.h
patches/titanium_ops.h
patches/titanium_constants.h
patches/titanium_structs.h
patches/underfoot.h
patches/underfoot_itemfields.h
patches/underfoot_ops.h
patches/underfoot_constants.h
patches/underfoot_structs.h
patches/client62.cpp
patches/uf.h
# patches/uf_itemfields.h
patches/uf_limits.h
patches/uf_ops.h
patches/uf_structs.h
patches/patches.cpp
patches/sod.cpp
patches/sod_limits.cpp
patches/sof.cpp
patches/sof_limits.cpp
patches/rof.cpp
patches/rof_limits.cpp
patches/rof2.cpp
patches/rof2_limits.cpp
patches/titanium.cpp
patches/underfoot.cpp
patches/titanium_limits.cpp
patches/uf.cpp
patches/uf_limits.cpp
)
SOURCE_GROUP(SocketLib FILES
@@ -348,7 +360,7 @@ ADD_LIBRARY(common ${common_sources} ${common_headers})
IF(UNIX)
ADD_DEFINITIONS(-fPIC)
SET_SOURCE_FILES_PROPERTIES("SocketLib/Mime.cpp" PROPERTY COMPILE_FLAGS -Wno-unused-result)
SET_SOURCE_FILES_PROPERTIES("patches/sod.cpp" "patches/sof.cpp" "patches/rof.cpp" "patches/rof2.cpp" "patches/underfoot.cpp" PROPERTIES COMPILE_FLAGS -O0)
SET_SOURCE_FILES_PROPERTIES("patches/sod.cpp" "patches/sof.cpp" "patches/rof.cpp" "patches/rof2.cpp" "patches/uf.cpp" PROPERTIES COMPILE_FLAGS -O0)
ENDIF(UNIX)
+1 -1
View File
@@ -40,7 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifdef _WIN32
#pragma warning(disable:4786)
#endif
#include "../debug.h"
#include "../global_define.h"
#include <stdio.h>
#include <string>
#include <stdarg.h>
+1 -1
View File
@@ -26,7 +26,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../debug.h"
#include "../global_define.h"
#ifdef _WIN32
#pragma warning(disable:4786)
#endif
+1 -2
View File
@@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifdef _WIN32
#pragma warning(disable:4786)
#endif
#include "../debug.h"
#include "../global_define.h"
#include "Utility.h"
#include "HttpdCookies.h"
#include "HttpdForm.h"
@@ -194,7 +194,6 @@ void HttpdSocket::OnHeaderComplete()
void HttpdSocket::OnData(const char *p,size_t l)
{
//printf("Got %d bytes: %.*s\n", l, l, p);
if (m_file)
{
m_file -> fwrite(p,1,l);
-2
View File
@@ -110,7 +110,6 @@ size_t MemFile::fread(char *ptr, size_t size, size_t nmemb)
size_t sz = size * nmemb;
if (p + sz < BLOCKSIZE)
{
//printf("Read @ %d(%d). %d bytes. (%c)\n", m_read_ptr, p, sz, *(m_current_read -> data + p));
memcpy(ptr, m_current_read -> data + p, sz);
m_read_ptr += sz;
}
@@ -142,7 +141,6 @@ size_t MemFile::fwrite(const char *ptr, size_t size, size_t nmemb)
size_t sz = size * nmemb;
if (p + sz < BLOCKSIZE)
{
//printf("Write @ %d(%d). %d bytes.\n", m_write_ptr, p, sz);
memcpy(m_current_write -> data + p, ptr, sz);
m_write_ptr += sz;
}
-1
View File
@@ -1128,7 +1128,6 @@ BOOL __stdcall StackWalker::myReadProcMem(
SIZE_T st;
BOOL bRet = ReadProcessMemory(hProcess, (LPVOID) qwBaseAddress, lpBuffer, nSize, &st);
*lpNumberOfBytesRead = (DWORD) st;
//printf("ReadMemory: hProcess: %p, baseAddr: %p, buffer: %p, size: %d, read: %d, result: %d\n", hProcess, (LPVOID) qwBaseAddress, lpBuffer, nSize, (DWORD) st, (DWORD) bRet);
return bRet;
}
else
+2 -3
View File
@@ -15,13 +15,12 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "debug.h"
#include "global_define.h"
#include "base_packet.h"
#include "misc.h"
#include "packet_dump.h"
BasePacket::BasePacket(const unsigned char *buf, uint32 len)
{
this->pBuffer=nullptr;
+5 -3
View File
@@ -21,12 +21,11 @@
#include "types.h"
#include <stdio.h>
#include <string.h>
#include <string>
#ifdef WIN32
#ifdef _WINDOWS
#include <time.h>
#include <windows.h>
#include <winsock2.h>
#include <windows.h>
#else
#include <sys/time.h>
#include <netinet/in.h>
@@ -64,9 +63,12 @@ public:
void WriteFloat(float value) { *(float *)(pBuffer + _wpos) = value; _wpos += sizeof(float); }
void WriteDouble(double value) { *(double *)(pBuffer + _wpos) = value; _wpos += sizeof(double); }
void WriteString(const char * str) { uint32 len = static_cast<uint32>(strlen(str)) + 1; memcpy(pBuffer + _wpos, str, len); _wpos += len; }
void WriteData(const void *ptr, size_t n) { memcpy(pBuffer + _wpos, ptr, n); _wpos += n; }
uint8 ReadUInt8() { uint8 value = *(uint8 *)(pBuffer + _rpos); _rpos += sizeof(uint8); return value; }
uint8 ReadUInt8(uint32 Offset) const { uint8 value = *(uint8 *)(pBuffer + Offset); return value; }
uint16 ReadUInt16() { uint16 value = *(uint16 *)(pBuffer + _rpos); _rpos += sizeof(uint16); return value; }
uint16 ReadUInt16(uint32 Offset) const { uint16 value = *(uint16 *)(pBuffer + Offset); return value; }
uint32 ReadUInt32() { uint32 value = *(uint32 *)(pBuffer + _rpos); _rpos += sizeof(uint32); return value; }
uint32 ReadUInt32(uint32 Offset) const { uint32 value = *(uint32 *)(pBuffer + Offset); return value; }
void ReadString(char *str) { uint32 len = static_cast<uint32>(strlen((char *)(pBuffer + _rpos))) + 1; memcpy(str, pBuffer + _rpos, len); _rpos += len; }
-134
View File
@@ -1,134 +0,0 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef BREAKDOWNS_H_
#define BREAKDOWNS_H_
#include "types.h"
#pragma pack(1)
struct uint16_breakdown {
union {
uint16 all;
struct {
uint8 b1;
uint8 b2;
} bytes;
};
inline uint16& operator=(const uint16& val) { return (all=val); }
inline uint16* operator&() { return &all; }
inline operator uint16&() { return all; }
inline uint8& b1() { return bytes.b1; }
inline uint8& b2() { return bytes.b2; }
};
struct uint32_breakdown {
union {
uint32 all;
struct {
uint16 w1;
uint16 w2;
} words;
struct {
uint8 b1;
union {
struct {
uint8 b2;
uint8 b3;
} middle;
uint16 w2_3; // word bytes 2 to 3
};
uint8 b4;
} bytes;
};
inline uint32& operator=(const uint32& val) { return (all=val); }
inline uint32* operator&() { return &all; }
inline operator uint32&() { return all; }
inline uint16& w1() { return words.w1; }
inline uint16& w2() { return words.w2; }
inline uint16& w2_3() { return bytes.w2_3; }
inline uint8& b1() { return bytes.b1; }
inline uint8& b2() { return bytes.middle.b2; }
inline uint8& b3() { return bytes.middle.b3; }
inline uint8& b4() { return bytes.b4; }
};
/*
struct uint64_breakdown {
union {
uint64 all;
struct {
uint16 w1; // 1 2
uint16 w2; // 3 4
uint16 w3; // 5 6
uint16 w4; // 7 8
};
struct {
uint32 dw1; // 1 4
uint32 dw2; // 5 6
};
struct {
uint8 b1;
union {
struct {
uint16 w2_3;
uint16 w4_5;
uint16 w6_7;
};
uint32 dw2_5;
struct {
uint8 b2;
union {
uint32 dw3_6;
struct {
uint8 b3;
union {
uint32 dw4_7;
struct {
uint8 b4;
uint8 b5;
uint8 b6;
uint8 b7;
};
};
};
};
};
};
};
};
inline uint64* operator&() { return &all; }
inline operator uint64&() { return all; }
};
*/
#pragma pack()
#endif /*BREAKDOWNS_H_*/
+573 -272
View File
@@ -1,5 +1,5 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemu.org)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,279 +14,580 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
*/
#include "../common/global_define.h"
#include "../common/classes.h"
const char* GetEQClassName(uint8 class_, uint8 level) {
switch(class_) {
case WARRIOR:
if (level >= 70)
return "Vanquisher";
else if (level >= 65)
return "Overlord"; //Baron-Sprite: LEAVE MY CLASSES ALONE.
else if (level >= 60)
return "Warlord";
else if (level >= 55)
return "Myrmidon";
else if (level >= 51)
return "Champion";
else
return "Warrior";
case CLERIC:
if (level >= 70)
return "Prelate";
else if (level >= 65)
return "Archon";
else if (level >= 60)
return "High Priest";
else if (level >= 55)
return "Templar";
else if (level >= 51)
return "Vicar";
else
return "Cleric";
case PALADIN:
if (level >= 70)
return "Lord";
else if (level >= 65)
return "Lord Protector";
else if (level >= 60)
return "Crusader";
else if (level >= 55)
return "Knight";
else if (level >= 51)
return "Cavalier";
else
return "Paladin";
case RANGER:
if (level >= 70)
return "Plainswalker";
else if (level >= 65)
return "Forest Stalker";
else if (level >= 60)
return "Warder";
else if (level >= 55)
return "Outrider";
else if (level >= 51)
return "Pathfinder";
else
return "Ranger";
case SHADOWKNIGHT:
if (level >= 70)
return "Scourge Knight";
else if (level >= 65)
return "Dread Lord";
else if (level >= 60)
return "Grave Lord";
else if (level >= 55)
return "Revenant";
else if (level >= 51)
return "Reaver";
else
return "Shadowknight";
case DRUID:
if (level >= 70)
return "Natureguard";
else if (level >= 65)
return "Storm Warden";
else if (level >= 60)
return "Hierophant";
else if (level >= 55)
return "Preserver";
else if (level >= 51)
return "Wanderer";
else
return "Druid";
case MONK:
if (level >= 70)
return "Stone Fist";
else if (level >= 65)
return "Transcendent";
else if (level >= 60)
return "Grandmaster";
else if (level >= 55)
return "Master";
else if (level >= 51)
return "Disciple";
else
return "Monk";
case BARD:
if (level >= 70)
return "Performer";
else if (level >= 65)
return "Maestro";
else if (level >= 60)
return "Virtuoso";
else if (level >= 55)
return "Troubadour";
else if (level >= 51)
return "Minstrel";
else
return "Bard";
case ROGUE:
if (level >= 70)
return "Nemesis";
else if (level >= 65)
return "Deceiver";
else if (level >= 60)
return "Assassin";
else if (level >= 55)
return "Blackguard";
else if (level >= 51)
return "Rake";
else
return "Rogue";
case SHAMAN:
if (level >= 70)
return "Soothsayer";
else if (level >= 65)
return "Prophet";
else if (level >= 60)
return "Oracle";
else if (level >= 55)
return "Luminary";
else if (level >= 51)
return "Mystic";
else
return "Shaman";
case NECROMANCER:
if (level >= 70)
return "Wraith";
else if (level >= 65)
return "Arch Lich";
else if (level >= 60)
return "Warlock";
else if (level >= 55)
return "Defiler";
else if (level >= 51)
return "Heretic";
else
return "Necromancer";
case WIZARD:
if (level >= 70)
return "Grand Arcanist";
else if (level >= 65)
return "Arcanist";
else if (level >= 60)
return "Sorcerer";
else if (level >= 55)
return "Evoker";
else if (level >= 51)
return "Channeler";
else
return "Wizard";
case MAGICIAN:
if (level >= 70)
return "Arch Magus";
else if (level >= 65)
return "Arch Convoker";
else if (level >= 60)
return "Arch Mage";
else if (level >= 55)
return "Conjurer";
if (level >= 51)
return "Elementalist";
else
return "Magician";
case ENCHANTER:
if (level >= 70)
return "Bedazzler";
else if (level >= 65)
return "Coercer";
else if (level >= 60)
return "Phantasmist";
else if (level >= 55)
return "Beguiler";
else if (level >= 51)
return "Illusionist";
else
return "Enchanter";
case BEASTLORD:
if (level >= 70)
return "Wildblood";
else if (level >= 65)
return "Feral Lord";
else if (level >= 60)
return "Savage Lord";
else if (level >= 55)
return "Animist";
else if (level >= 51)
return "Primalist";
else
return "Beastlord";
case BERSERKER:
if (level >= 70)
return "Ravager";
else if (level >= 65)
return "Fury";
else if (level >= 60)
return "Rager";
else if (level >= 55)
return "Vehement";
else if (level >= 51)
return "Brawler";
else
return "Berserker";
case BANKER:
if (level >= 70)
return "Master Banker";
else if (level >= 65)
return "Elder Banker";
else if (level >= 60)
return "Oldest Banker";
else if (level >= 55)
return "Older Banker";
else if (level >= 51)
return "Old Banker";
else
return "Banker";
case WARRIORGM:
return "Warrior Guildmaster";
case CLERICGM:
return "Cleric Guildmaster";
case PALADINGM:
return "Paladin Guildmaster";
case RANGERGM:
return "Ranger Guildmaster";
case SHADOWKNIGHTGM:
return "Shadowknight Guildmaster";
case DRUIDGM:
return "Druid Guildmaster";
case MONKGM:
return "Monk Guildmaster";
case BARDGM:
return "Bard Guildmaster";
case ROGUEGM:
return "Rogue Guildmaster";
case SHAMANGM:
return "Shaman Guildmaster";
case NECROMANCERGM:
return "Necromancer Guildmaster";
case WIZARDGM:
return "Wizard Guildmaster";
case MAGICIANGM:
return "Magician Guildmaster";
case ENCHANTERGM:
return "Enchanter Guildmaster";
case BEASTLORDGM:
return "Beastlord Guildmaster";
case BERSERKERGM:
return "Berserker Guildmaster";
case MERCHANT:
return "Merchant";
case ADVENTURERECRUITER:
return "Adventure Recruiter";
case ADVENTUREMERCHANT:
return "Adventure Merchant";
case CORPSE_CLASS:
return "Corpse Class";
case TRIBUTE_MASTER:
return "Tribute Master";
case GUILD_TRIBUTE_MASTER:
return "Guild Tribute Master";
default:
return "Unknown";
const char* GetClassIDName(uint8 class_id, uint8 level)
{
switch (class_id) {
case WARRIOR:
if (level >= 70)
return "Vanquisher";
else if (level >= 65)
return "Overlord"; //Baron-Sprite: LEAVE MY CLASSES ALONE.
else if (level >= 60)
return "Warlord";
else if (level >= 55)
return "Myrmidon";
else if (level >= 51)
return "Champion";
else
return "Warrior";
case CLERIC:
if (level >= 70)
return "Prelate";
else if (level >= 65)
return "Archon";
else if (level >= 60)
return "High Priest";
else if (level >= 55)
return "Templar";
else if (level >= 51)
return "Vicar";
else
return "Cleric";
case PALADIN:
if (level >= 70)
return "Lord";
else if (level >= 65)
return "Lord Protector";
else if (level >= 60)
return "Crusader";
else if (level >= 55)
return "Knight";
else if (level >= 51)
return "Cavalier";
else
return "Paladin";
case RANGER:
if (level >= 70)
return "Plainswalker";
else if (level >= 65)
return "Forest Stalker";
else if (level >= 60)
return "Warder";
else if (level >= 55)
return "Outrider";
else if (level >= 51)
return "Pathfinder";
else
return "Ranger";
case SHADOWKNIGHT:
if (level >= 70)
return "Scourge Knight";
else if (level >= 65)
return "Dread Lord";
else if (level >= 60)
return "Grave Lord";
else if (level >= 55)
return "Revenant";
else if (level >= 51)
return "Reaver";
else
return "Shadowknight";
case DRUID:
if (level >= 70)
return "Natureguard";
else if (level >= 65)
return "Storm Warden";
else if (level >= 60)
return "Hierophant";
else if (level >= 55)
return "Preserver";
else if (level >= 51)
return "Wanderer";
else
return "Druid";
case MONK:
if (level >= 70)
return "Stone Fist";
else if (level >= 65)
return "Transcendent";
else if (level >= 60)
return "Grandmaster";
else if (level >= 55)
return "Master";
else if (level >= 51)
return "Disciple";
else
return "Monk";
case BARD:
if (level >= 70)
return "Performer";
else if (level >= 65)
return "Maestro";
else if (level >= 60)
return "Virtuoso";
else if (level >= 55)
return "Troubadour";
else if (level >= 51)
return "Minstrel";
else
return "Bard";
case ROGUE:
if (level >= 70)
return "Nemesis";
else if (level >= 65)
return "Deceiver";
else if (level >= 60)
return "Assassin";
else if (level >= 55)
return "Blackguard";
else if (level >= 51)
return "Rake";
else
return "Rogue";
case SHAMAN:
if (level >= 70)
return "Soothsayer";
else if (level >= 65)
return "Prophet";
else if (level >= 60)
return "Oracle";
else if (level >= 55)
return "Luminary";
else if (level >= 51)
return "Mystic";
else
return "Shaman";
case NECROMANCER:
if (level >= 70)
return "Wraith";
else if (level >= 65)
return "Arch Lich";
else if (level >= 60)
return "Warlock";
else if (level >= 55)
return "Defiler";
else if (level >= 51)
return "Heretic";
else
return "Necromancer";
case WIZARD:
if (level >= 70)
return "Grand Arcanist";
else if (level >= 65)
return "Arcanist";
else if (level >= 60)
return "Sorcerer";
else if (level >= 55)
return "Evoker";
else if (level >= 51)
return "Channeler";
else
return "Wizard";
case MAGICIAN:
if (level >= 70)
return "Arch Magus";
else if (level >= 65)
return "Arch Convoker";
else if (level >= 60)
return "Arch Mage";
else if (level >= 55)
return "Conjurer";
if (level >= 51)
return "Elementalist";
else
return "Magician";
case ENCHANTER:
if (level >= 70)
return "Bedazzler";
else if (level >= 65)
return "Coercer";
else if (level >= 60)
return "Phantasmist";
else if (level >= 55)
return "Beguiler";
else if (level >= 51)
return "Illusionist";
else
return "Enchanter";
case BEASTLORD:
if (level >= 70)
return "Wildblood";
else if (level >= 65)
return "Feral Lord";
else if (level >= 60)
return "Savage Lord";
else if (level >= 55)
return "Animist";
else if (level >= 51)
return "Primalist";
else
return "Beastlord";
case BERSERKER:
if (level >= 70)
return "Ravager";
else if (level >= 65)
return "Fury";
else if (level >= 60)
return "Rager";
else if (level >= 55)
return "Vehement";
else if (level >= 51)
return "Brawler";
else
return "Berserker";
case BANKER:
if (level >= 70)
return "Master Banker";
else if (level >= 65)
return "Elder Banker";
else if (level >= 60)
return "Oldest Banker";
else if (level >= 55)
return "Older Banker";
else if (level >= 51)
return "Old Banker";
else
return "Banker";
case WARRIORGM:
return "Warrior Guildmaster";
case CLERICGM:
return "Cleric Guildmaster";
case PALADINGM:
return "Paladin Guildmaster";
case RANGERGM:
return "Ranger Guildmaster";
case SHADOWKNIGHTGM:
return "Shadowknight Guildmaster";
case DRUIDGM:
return "Druid Guildmaster";
case MONKGM:
return "Monk Guildmaster";
case BARDGM:
return "Bard Guildmaster";
case ROGUEGM:
return "Rogue Guildmaster";
case SHAMANGM:
return "Shaman Guildmaster";
case NECROMANCERGM:
return "Necromancer Guildmaster";
case WIZARDGM:
return "Wizard Guildmaster";
case MAGICIANGM:
return "Magician Guildmaster";
case ENCHANTERGM:
return "Enchanter Guildmaster";
case BEASTLORDGM:
return "Beastlord Guildmaster";
case BERSERKERGM:
return "Berserker Guildmaster";
case MERCHANT:
return "Merchant";
case ADVENTURERECRUITER:
return "Adventure Recruiter";
case ADVENTUREMERCHANT:
return "Adventure Merchant";
case CORPSE_CLASS:
return "Corpse Class";
case TRIBUTE_MASTER:
return "Tribute Master";
case GUILD_TRIBUTE_MASTER:
return "Guild Tribute Master";
default:
return "Unknown";
}
}
const char* GetPlayerClassName(uint32 player_class_value, uint8 level)
{
return GetClassIDName(GetClassIDFromPlayerClassValue(player_class_value), level);
}
uint32 GetPlayerClassValue(uint8 class_id)
{
switch (class_id) {
case WARRIOR:
case CLERIC:
case PALADIN:
case RANGER:
case SHADOWKNIGHT:
case DRUID:
case MONK:
case BARD:
case ROGUE:
case SHAMAN:
case NECROMANCER:
case WIZARD:
case MAGICIAN:
case ENCHANTER:
case BEASTLORD:
case BERSERKER:
return class_id;
default:
return PLAYER_CLASS_UNKNOWN; // watch
}
}
uint32 GetPlayerClassBit(uint8 class_id)
{
switch (class_id) {
case WARRIOR:
return PLAYER_CLASS_WARRIOR_BIT;
case CLERIC:
return PLAYER_CLASS_CLERIC_BIT;
case PALADIN:
return PLAYER_CLASS_PALADIN_BIT;
case RANGER:
return PLAYER_CLASS_RANGER_BIT;
case SHADOWKNIGHT:
return PLAYER_CLASS_SHADOWKNIGHT_BIT;
case DRUID:
return PLAYER_CLASS_DRUID_BIT;
case MONK:
return PLAYER_CLASS_MONK_BIT;
case BARD:
return PLAYER_CLASS_BARD_BIT;
case ROGUE:
return PLAYER_CLASS_ROGUE_BIT;
case SHAMAN:
return PLAYER_CLASS_SHAMAN_BIT;
case NECROMANCER:
return PLAYER_CLASS_NECROMANCER_BIT;
case WIZARD:
return PLAYER_CLASS_WIZARD_BIT;
case MAGICIAN:
return PLAYER_CLASS_MAGICIAN_BIT;
case ENCHANTER:
return PLAYER_CLASS_ENCHANTER_BIT;
case BEASTLORD:
return PLAYER_CLASS_BEASTLORD_BIT;
case BERSERKER:
return PLAYER_CLASS_BERSERKER_BIT;
default:
return PLAYER_CLASS_UNKNOWN_BIT;
}
}
uint8 GetClassIDFromPlayerClassValue(uint32 player_class_value)
{
switch (player_class_value) {
case PLAYER_CLASS_WARRIOR:
case PLAYER_CLASS_CLERIC:
case PLAYER_CLASS_PALADIN:
case PLAYER_CLASS_RANGER:
case PLAYER_CLASS_SHADOWKNIGHT:
case PLAYER_CLASS_DRUID:
case PLAYER_CLASS_MONK:
case PLAYER_CLASS_BARD:
case PLAYER_CLASS_ROGUE:
case PLAYER_CLASS_SHAMAN:
case PLAYER_CLASS_NECROMANCER:
case PLAYER_CLASS_WIZARD:
case PLAYER_CLASS_MAGICIAN:
case PLAYER_CLASS_ENCHANTER:
case PLAYER_CLASS_BEASTLORD:
case PLAYER_CLASS_BERSERKER:
return player_class_value;
default:
return PLAYER_CLASS_UNKNOWN; // watch
}
}
uint8 GetClassIDFromPlayerClassBit(uint32 player_class_bit)
{
switch (player_class_bit) {
case PLAYER_CLASS_WARRIOR_BIT:
return WARRIOR;
case PLAYER_CLASS_CLERIC_BIT:
return CLERIC;
case PLAYER_CLASS_PALADIN_BIT:
return PALADIN;
case PLAYER_CLASS_RANGER_BIT:
return RANGER;
case PLAYER_CLASS_SHADOWKNIGHT_BIT:
return SHADOWKNIGHT;
case PLAYER_CLASS_DRUID_BIT:
return DRUID;
case PLAYER_CLASS_MONK_BIT:
return MONK;
case PLAYER_CLASS_BARD_BIT:
return BARD;
case PLAYER_CLASS_ROGUE_BIT:
return ROGUE;
case PLAYER_CLASS_SHAMAN_BIT:
return SHAMAN;
case PLAYER_CLASS_NECROMANCER_BIT:
return NECROMANCER;
case PLAYER_CLASS_WIZARD_BIT:
return WIZARD;
case PLAYER_CLASS_MAGICIAN_BIT:
return MAGICIAN;
case PLAYER_CLASS_ENCHANTER_BIT:
return ENCHANTER;
case PLAYER_CLASS_BEASTLORD_BIT:
return BEASTLORD;
case PLAYER_CLASS_BERSERKER_BIT:
return BERSERKER;
default:
return PLAYER_CLASS_UNKNOWN; // watch
}
}
bool IsFighterClass(uint8 class_id)
{
switch (class_id) {
case WARRIOR:
case PALADIN:
case RANGER:
case SHADOWKNIGHT:
case MONK:
case BARD:
case ROGUE:
case BEASTLORD:
case BERSERKER:
return true;
default:
return false;
}
}
bool IsSpellFighterClass(uint8 class_id)
{
switch (class_id) {
case PALADIN:
case RANGER:
case SHADOWKNIGHT:
case BEASTLORD:
return true;
default:
return false;
}
}
bool IsNonSpellFighterClass(uint8 class_id)
{
switch (class_id) {
case WARRIOR:
case MONK:
case BARD:
case ROGUE:
case BERSERKER:
return true;
default:
return false;
}
}
bool IsCasterClass(uint8 class_id)
{
switch (class_id) {
case CLERIC:
case DRUID:
case SHAMAN:
case NECROMANCER:
case WIZARD:
case MAGICIAN:
case ENCHANTER:
return true;
default:
return false;
}
}
bool IsINTCasterClass(uint8 class_id)
{
switch (class_id) {
case NECROMANCER:
case WIZARD:
case MAGICIAN:
case ENCHANTER:
return true;
default:
return false;
}
}
bool IsWISCasterClass(uint8 class_id)
{
switch (class_id) {
case CLERIC:
case DRUID:
case SHAMAN:
return true;
default:
return false;
}
}
bool IsPlateClass(uint8 class_id)
{
switch (class_id) {
case WARRIOR:
case CLERIC:
case PALADIN:
case SHADOWKNIGHT:
case BARD:
return true;
default:
return false;
}
}
bool IsChainClass(uint8 class_id)
{
switch (class_id) {
case RANGER:
case ROGUE:
case SHAMAN:
case BERSERKER:
return true;
default:
return false;
}
}
bool IsLeatherClass(uint8 class_id)
{
switch (class_id) {
case DRUID:
case MONK:
case BEASTLORD:
return true;
default:
return false;
}
}
bool IsClothClass(uint8 class_id)
{
switch (class_id) {
case NECROMANCER:
case WIZARD:
case MAGICIAN:
case ENCHANTER:
return true;
default:
return false;
}
}
uint8 ClassArmorType(uint8 class_id)
{
switch (class_id) {
case WARRIOR:
case CLERIC:
case PALADIN:
case SHADOWKNIGHT:
case BARD:
return ARMOR_TYPE_PLATE;
case RANGER:
case ROGUE:
case SHAMAN:
case BERSERKER:
return ARMOR_TYPE_CHAIN;
case DRUID:
case MONK:
case BEASTLORD:
return ARMOR_TYPE_LEATHER;
case NECROMANCER:
case WIZARD:
case MAGICIAN:
case ENCHANTER:
return ARMOR_TYPE_CLOTH;
default:
return ARMOR_TYPE_UNKNOWN;
}
}
+100 -42
View File
@@ -1,5 +1,5 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemu.org)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,26 +17,25 @@
*/
#ifndef CLASSES_CH
#define CLASSES_CH
#include "../common/types.h"
#define Array_Class_UNKNOWN 0
#define WARRIOR 1
#define CLERIC 2
#define PALADIN 3
#define RANGER 4
#define SHADOWKNIGHT 5
#define DRUID 6
#define MONK 7
#define BARD 8
#define ROGUE 9
#define SHAMAN 10
#define NECROMANCER 11
#define WIZARD 12
#define MAGICIAN 13
#define ENCHANTER 14
#define BEASTLORD 15
#define BERSERKER 16
#define PLAYER_CLASS_COUNT 16 // used for array defines, must be the count of playable classes
#define WARRIOR 1
#define CLERIC 2
#define PALADIN 3
#define RANGER 4
#define SHADOWKNIGHT 5
#define DRUID 6
#define MONK 7
#define BARD 8
#define ROGUE 9
#define SHAMAN 10
#define NECROMANCER 11
#define WIZARD 12
#define MAGICIAN 13
#define ENCHANTER 14
#define BEASTLORD 15
#define BERSERKER 16
#define WARRIORGM 20
#define CLERICGM 21
#define PALADINGM 22
@@ -58,33 +57,92 @@
#define DISCORD_MERCHANT 59
#define ADVENTURERECRUITER 60
#define ADVENTUREMERCHANT 61
#define LDON_TREASURE 62 //objects you can use /open on first seen in LDONs
#define CORPSE_CLASS 62 //only seen on Danvi's Corpse in Akheva so far..
#define TRIBUTE_MASTER 63
#define GUILD_TRIBUTE_MASTER 64 //not sure
#define LDON_TREASURE 62 // objects you can use /open on first seen in LDONs
#define CORPSE_CLASS 62 // only seen on Danvi's Corpse in Akheva so far..
#define TRIBUTE_MASTER 63
#define GUILD_TRIBUTE_MASTER 64 // not sure
#define NORRATHS_KEEPERS_MERCHANT 67
#define DARK_REIGN_MERCHANT 68
#define FELLOWSHIP_MASTER 69
#define ALT_CURRENCY_MERCHANT 70
#define MERCERNARY_MASTER 71
#define warrior_1 1
#define monk_1 64
#define paladin_1 4
#define shadow_1 16
#define bard_1 128
#define cleric_1 2
#define necromancer_1 1024
#define ranger_1 8
#define druid_1 32
#define mage_1 4096
#define wizard_1 2048
#define enchanter_1 8192
#define rogue_1 256
#define shaman_1 512
#define beastlord_1 16384
#define berserker_1 32768
#define call_1 65536
const char* GetEQClassName(uint8 class_, uint8 level = 0);
// player class values
#define PLAYER_CLASS_UNKNOWN 0
#define PLAYER_CLASS_WARRIOR 1
#define PLAYER_CLASS_CLERIC 2
#define PLAYER_CLASS_PALADIN 3
#define PLAYER_CLASS_RANGER 4
#define PLAYER_CLASS_SHADOWKNIGHT 5
#define PLAYER_CLASS_DRUID 6
#define PLAYER_CLASS_MONK 7
#define PLAYER_CLASS_BARD 8
#define PLAYER_CLASS_ROGUE 9
#define PLAYER_CLASS_SHAMAN 10
#define PLAYER_CLASS_NECROMANCER 11
#define PLAYER_CLASS_WIZARD 12
#define PLAYER_CLASS_MAGICIAN 13
#define PLAYER_CLASS_ENCHANTER 14
#define PLAYER_CLASS_BEASTLORD 15
#define PLAYER_CLASS_BERSERKER 16
#define PLAYER_CLASS_COUNT 16
// player class bits
#define PLAYER_CLASS_UNKNOWN_BIT 0
#define PLAYER_CLASS_WARRIOR_BIT 1
#define PLAYER_CLASS_CLERIC_BIT 2
#define PLAYER_CLASS_PALADIN_BIT 4
#define PLAYER_CLASS_RANGER_BIT 8
#define PLAYER_CLASS_SHADOWKNIGHT_BIT 16
#define PLAYER_CLASS_DRUID_BIT 32
#define PLAYER_CLASS_MONK_BIT 64
#define PLAYER_CLASS_BARD_BIT 128
#define PLAYER_CLASS_ROGUE_BIT 256
#define PLAYER_CLASS_SHAMAN_BIT 512
#define PLAYER_CLASS_NECROMANCER_BIT 1024
#define PLAYER_CLASS_WIZARD_BIT 2048
#define PLAYER_CLASS_MAGICIAN_BIT 4096
#define PLAYER_CLASS_ENCHANTER_BIT 8192
#define PLAYER_CLASS_BEASTLORD_BIT 16384
#define PLAYER_CLASS_BERSERKER_BIT 32768
#define PLAYER_CLASS_ALL_MASK 65535 // was 65536
#define ARMOR_TYPE_UNKNOWN 0
#define ARMOR_TYPE_CLOTH 1
#define ARMOR_TYPE_LEATHER 2
#define ARMOR_TYPE_CHAIN 3
#define ARMOR_TYPE_PLATE 4
#define ARMOR_TYPE_FIRST ARMOR_TYPE_UNKNOWN
#define ARMOR_TYPE_LAST ARMOR_TYPE_PLATE
#define ARMOR_TYPE_COUNT 5
const char* GetClassIDName(uint8 class_id, uint8 level = 0);
const char* GetPlayerClassName(uint32 player_class_value, uint8 level = 0);
uint32 GetPlayerClassValue(uint8 class_id);
uint32 GetPlayerClassBit(uint8 class_id);
uint8 GetClassIDFromPlayerClassValue(uint32 player_class_value);
uint8 GetClassIDFromPlayerClassBit(uint32 player_class_bit);
bool IsFighterClass(uint8 class_id);
bool IsSpellFighterClass(uint8 class_id);
bool IsNonSpellFighterClass(uint8 class_id);
bool IsCasterClass(uint8 class_id);
bool IsINTCasterClass(uint8 class_id);
bool IsWISCasterClass(uint8 class_id);
bool IsPlateClass(uint8 class_id);
bool IsChainClass(uint8 class_id);
bool IsLeatherClass(uint8 class_id);
bool IsClothClass(uint8 class_id);
uint8 ClassArmorType(uint8 class_id);
#endif
+128
View File
@@ -0,0 +1,128 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "client_version.h"
bool EQEmu::versions::IsValidClientVersion(ClientVersion client_version)
{
if (client_version <= ClientVersion::Unknown || client_version > LastClientVersion)
return false;
return true;
}
EQEmu::versions::ClientVersion EQEmu::versions::ValidateClientVersion(ClientVersion client_version)
{
if (client_version <= ClientVersion::Unknown || client_version > LastClientVersion)
return ClientVersion::Unknown;
return client_version;
}
const char* EQEmu::versions::ClientVersionName(ClientVersion client_version)
{
switch (client_version) {
case ClientVersion::Unknown:
return "Unknown Version";
case ClientVersion::Client62:
return "Client 6.2";
case ClientVersion::Titanium:
return "Titanium";
case ClientVersion::SoF:
return "SoF";
case ClientVersion::SoD:
return "SoD";
case ClientVersion::UF:
return "UF";
case ClientVersion::RoF:
return "RoF";
case ClientVersion::RoF2:
return "RoF2";
default:
return "Invalid Version";
};
}
uint32 EQEmu::versions::ConvertClientVersionToClientVersionBit(ClientVersion client_version)
{
switch (client_version) {
case ClientVersion::Unknown:
case ClientVersion::Client62:
return bit_Unknown;
case ClientVersion::Titanium:
return bit_Titanium;
case ClientVersion::SoF:
return bit_SoF;
case ClientVersion::SoD:
return bit_SoD;
case ClientVersion::UF:
return bit_UF;
case ClientVersion::RoF:
return bit_RoF;
case ClientVersion::RoF2:
return bit_RoF2;
default:
return bit_Unknown;
}
}
EQEmu::versions::ClientVersion EQEmu::versions::ConvertClientVersionBitToClientVersion(uint32 client_version_bit)
{
switch (client_version_bit) {
case (uint32)static_cast<unsigned int>(ClientVersion::Unknown) :
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::Client62) - 1)) :
return ClientVersion::Unknown;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::Titanium) - 1)) :
return ClientVersion::Titanium;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::SoF) - 1)) :
return ClientVersion::SoF;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::SoD) - 1)) :
return ClientVersion::SoD;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::UF) - 1)) :
return ClientVersion::UF;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::RoF) - 1)) :
return ClientVersion::RoF;
case ((uint32)1 << (static_cast<unsigned int>(ClientVersion::RoF2) - 1)) :
return ClientVersion::RoF2;
default:
return ClientVersion::Unknown;
}
}
uint32 EQEmu::versions::ConvertClientVersionToExpansion(ClientVersion client_version)
{
switch (client_version) {
case ClientVersion::Unknown:
case ClientVersion::Client62:
case ClientVersion::Titanium:
return 0x000007FFU;
case ClientVersion::SoF:
return 0x00007FFFU;
case ClientVersion::SoD:
return 0x0000FFFFU;
case ClientVersion::UF:
return 0x0001FFFFU;
case ClientVersion::RoF:
case ClientVersion::RoF2:
return 0x000FFFFFU;
default:
return 0;
}
}
+78
View File
@@ -0,0 +1,78 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef COMMON_CLIENT_VERSION_H
#define COMMON_CLIENT_VERSION_H
#include "types.h"
#include <stdlib.h>
namespace EQEmu
{
namespace versions {
enum class ClientVersion {
Unknown = 0,
Client62, // Build: 'Aug 4 2005 15:40:59'
Titanium, // Build: 'Oct 31 2005 10:33:37'
SoF, // Build: 'Sep 7 2007 09:11:49'
SoD, // Build: 'Dec 19 2008 15:22:49'
UF, // Build: 'Jun 8 2010 16:44:32'
RoF, // Build: 'Dec 10 2012 17:35:44'
RoF2 // Build: 'May 10 2013 23:30:08'
};
enum ClientVersionBit : uint32 {
bit_Unknown = 0,
bit_Client62 = 0x00000001, // unsupported (placeholder for scripts)
bit_Titanium = 0x00000002,
bit_SoF = 0x00000004,
bit_SoD = 0x00000008,
bit_UF = 0x00000010,
bit_RoF = 0x00000020,
bit_RoF2 = 0x00000040,
bit_TitaniumAndEarlier = 0x00000003,
bit_SoFAndEarlier = 0x00000007,
bit_SoDAndEarlier = 0x0000000F,
bit_UFAndEarlier = 0x0000001F,
bit_RoFAndEarlier = 0x0000003F,
bit_SoFAndLater = 0xFFFFFFFC,
bit_SoDAndLater = 0xFFFFFFF8,
bit_UFAndLater = 0xFFFFFFF0,
bit_RoFAndLater = 0xFFFFFFE0,
bit_RoF2AndLater = 0xFFFFFFC0,
bit_AllClients = 0xFFFFFFFF
};
static const ClientVersion LastClientVersion = ClientVersion::RoF2;
static const size_t ClientVersionCount = (static_cast<size_t>(LastClientVersion) + 1);
extern bool IsValidClientVersion(ClientVersion client_version);
extern ClientVersion ValidateClientVersion(ClientVersion client_version);
extern const char* ClientVersionName(ClientVersion client_version);
extern uint32 ConvertClientVersionToClientVersionBit(ClientVersion client_version);
extern ClientVersion ConvertClientVersionBitToClientVersion(uint32 client_version_bit);
extern uint32 ConvertClientVersionToExpansion(ClientVersion client_version);
} /*versions*/
} /*EQEmu*/
#endif /*COMMON_CLIENT_VERSION_H*/
-76
View File
@@ -1,76 +0,0 @@
#ifndef CLIENTVERSIONS_H
#define CLIENTVERSIONS_H
static const uint32 BIT_Client62 = 1;
static const uint32 BIT_Titanium = 2;
static const uint32 BIT_SoF = 4;
static const uint32 BIT_SoD = 8;
static const uint32 BIT_Underfoot = 16;
static const uint32 BIT_RoF = 32;
static const uint32 BIT_RoF2 = 64;
static const uint32 BIT_TitaniumAndEarlier = 0x00000003;
static const uint32 BIT_SoFAndLater = 0xFFFFFFFC;
static const uint32 BIT_SoDAndLater = 0xFFFFFFF8;
static const uint32 BIT_UnderfootAndLater = 0xFFFFFFF0;
static const uint32 BIT_RoFAndLater = 0xFFFFFFE0;
static const uint32 BIT_RoF2AndLater = 0xFFFFFFC0;
static const uint32 BIT_AllClients = 0xFFFFFFFF;
typedef enum
{
EQClientUnknown = 0,
EQClient62, // Build: 'Aug 4 2005 15:40:59'
EQClientTitanium, // Build: 'Oct 31 2005 10:33:37'
EQClientSoF, // Build: 'Sep 7 2007 09:11:49'
EQClientSoD, // Build: 'Dec 19 2008 15:22:49'
EQClientUnderfoot, // Build: 'Jun 8 2010 16:44:32'
EQClientRoF, // Build: 'Dec 10 2012 17:35:44'
EQClientRoF2, // Build: 'May 10 2013 23:30:08'
_EQClientCount, // place new clients before this point (preferably, in release/attribute order)
// Values below are not implemented, as yet...
EmuNPC = _EQClientCount,
EmuMerc,
EmuBot,
EmuPet,
_EmuClientCount // array size for EQLimits
} EQClientVersion;
static const char* EQClientVersionName(EQClientVersion version)
{
switch (version)
{
case EQClientUnknown:
return "EQClientUnknown";
case EQClient62:
return "EQClient62";
case EQClientTitanium:
return "EQClientTitanium";
case EQClientSoF:
return "EQClientSoF";
case EQClientSoD:
return "EQClientSoD";
case EQClientUnderfoot:
return "EQClientUnderfoot";
case EQClientRoF:
return "EQClientRoF";
case EQClientRoF2:
return "EQClientRoF2";
case EmuNPC:
return "EmuNPC";
case EmuMerc:
return "EmuMerc";
case EmuBot:
return "EmuBot";
case EmuPet:
return "EmuPet";
default:
return "ERROR: Invalid EQClientVersion";
};
}
#endif /* CLIENTVERSIONS_H */
-1
View File
@@ -16,7 +16,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "debug.h"
#include "condition.h"
#ifdef _WINDOWS
+2 -1
View File
@@ -18,7 +18,8 @@
#ifndef __CONDITION_H
#define __CONDITION_H
#include "debug.h"
#include "global_define.h"
#include "mutex.h"
#ifndef WIN32
#include <pthread.h>
#endif
+24 -23
View File
@@ -1,4 +1,5 @@
#include "debug.h"
#include "global_define.h"
#include "eqemu_logsys.h"
#include "crash.h"
#if defined(_WINDOWS) && defined(CRASH_LOGGING)
@@ -24,7 +25,7 @@ public:
}
}
LogFile->write(EQEMuLog::Crash, buffer);
Log.Out(Logs::General, Logs::Crash, buffer);
StackWalker::OnOutput(szText);
}
};
@@ -34,67 +35,67 @@ LONG WINAPI windows_exception_handler(EXCEPTION_POINTERS *ExceptionInfo)
switch(ExceptionInfo->ExceptionRecord->ExceptionCode)
{
case EXCEPTION_ACCESS_VIOLATION:
LogFile->write(EQEMuLog::Crash, "EXCEPTION_ACCESS_VIOLATION");
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_ACCESS_VIOLATION");
break;
case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
LogFile->write(EQEMuLog::Crash, "EXCEPTION_ARRAY_BOUNDS_EXCEEDED");
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_ARRAY_BOUNDS_EXCEEDED");
break;
case EXCEPTION_BREAKPOINT:
LogFile->write(EQEMuLog::Crash, "EXCEPTION_BREAKPOINT");
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_BREAKPOINT");
break;
case EXCEPTION_DATATYPE_MISALIGNMENT:
LogFile->write(EQEMuLog::Crash, "EXCEPTION_DATATYPE_MISALIGNMENT");
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_DATATYPE_MISALIGNMENT");
break;
case EXCEPTION_FLT_DENORMAL_OPERAND:
LogFile->write(EQEMuLog::Crash, "EXCEPTION_FLT_DENORMAL_OPERAND");
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_FLT_DENORMAL_OPERAND");
break;
case EXCEPTION_FLT_DIVIDE_BY_ZERO:
LogFile->write(EQEMuLog::Crash, "EXCEPTION_FLT_DIVIDE_BY_ZERO");
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_FLT_DIVIDE_BY_ZERO");
break;
case EXCEPTION_FLT_INEXACT_RESULT:
LogFile->write(EQEMuLog::Crash, "EXCEPTION_FLT_INEXACT_RESULT");
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_FLT_INEXACT_RESULT");
break;
case EXCEPTION_FLT_INVALID_OPERATION:
LogFile->write(EQEMuLog::Crash, "EXCEPTION_FLT_INVALID_OPERATION");
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_FLT_INVALID_OPERATION");
break;
case EXCEPTION_FLT_OVERFLOW:
LogFile->write(EQEMuLog::Crash, "EXCEPTION_FLT_OVERFLOW");
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_FLT_OVERFLOW");
break;
case EXCEPTION_FLT_STACK_CHECK:
LogFile->write(EQEMuLog::Crash, "EXCEPTION_FLT_STACK_CHECK");
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_FLT_STACK_CHECK");
break;
case EXCEPTION_FLT_UNDERFLOW:
LogFile->write(EQEMuLog::Crash, "EXCEPTION_FLT_UNDERFLOW");
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_FLT_UNDERFLOW");
break;
case EXCEPTION_ILLEGAL_INSTRUCTION:
LogFile->write(EQEMuLog::Crash, "EXCEPTION_ILLEGAL_INSTRUCTION");
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_ILLEGAL_INSTRUCTION");
break;
case EXCEPTION_IN_PAGE_ERROR:
LogFile->write(EQEMuLog::Crash, "EXCEPTION_IN_PAGE_ERROR");
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_IN_PAGE_ERROR");
break;
case EXCEPTION_INT_DIVIDE_BY_ZERO:
LogFile->write(EQEMuLog::Crash, "EXCEPTION_INT_DIVIDE_BY_ZERO");
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_INT_DIVIDE_BY_ZERO");
break;
case EXCEPTION_INT_OVERFLOW:
LogFile->write(EQEMuLog::Crash, "EXCEPTION_INT_OVERFLOW");
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_INT_OVERFLOW");
break;
case EXCEPTION_INVALID_DISPOSITION:
LogFile->write(EQEMuLog::Crash, "EXCEPTION_INVALID_DISPOSITION");
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_INVALID_DISPOSITION");
break;
case EXCEPTION_NONCONTINUABLE_EXCEPTION:
LogFile->write(EQEMuLog::Crash, "EXCEPTION_NONCONTINUABLE_EXCEPTION");
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_NONCONTINUABLE_EXCEPTION");
break;
case EXCEPTION_PRIV_INSTRUCTION:
LogFile->write(EQEMuLog::Crash, "EXCEPTION_PRIV_INSTRUCTION");
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_PRIV_INSTRUCTION");
break;
case EXCEPTION_SINGLE_STEP:
LogFile->write(EQEMuLog::Crash, "EXCEPTION_SINGLE_STEP");
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_SINGLE_STEP");
break;
case EXCEPTION_STACK_OVERFLOW:
LogFile->write(EQEMuLog::Crash, "EXCEPTION_STACK_OVERFLOW");
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_STACK_OVERFLOW");
break;
default:
LogFile->write(EQEMuLog::Crash, "Unknown Exception");
Log.Out(Logs::General, Logs::Crash, "Unknown Exception");
break;
}
+281 -2392
View File
File diff suppressed because it is too large Load Diff
+139 -549
View File
@@ -1,5 +1,5 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2003 EQEMu Development Team (http://eqemulator.net)
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,11 +21,15 @@
#define AUTHENTICATION_TIMEOUT 60
#define INVALID_ID 0xFFFFFFFF
#include "debug.h"
#include "global_define.h"
#include "eqemu_logsys.h"
#include "types.h"
#include "dbcore.h"
#include "linked_list.h"
#include "eq_packet_structs.h"
#include <cmath>
#include <string>
#include <vector>
#include <map>
@@ -33,23 +37,9 @@
//atoi is not uint32 or uint32 safe!!!!
#define atoul(str) strtoul(str, nullptr, 10)
//class Spawn;
class Corpse;
class Spawn2;
class NPC;
class SpawnGroupList;
class Petition;
class Client;
class Merc;
class MySQLRequestResult;
struct Combine_Struct;
//struct Faction;
//struct FactionMods;
//struct FactionValue;
struct ZonePoint;
struct NPCType;
class Inventory;
class ItemInst;
class MySQLRequestResult;
class Client;
struct EventLogDetails_Struct {
uint32 id;
@@ -64,9 +54,9 @@ struct EventLogDetails_Struct {
};
struct CharacterEventLog_Struct {
uint32 count;
uint8 eventid;
EventLogDetails_Struct eld[255];
uint32 count;
uint8 eventid;
EventLogDetails_Struct eld[255];
};
struct npcDecayTimes_Struct {
@@ -77,609 +67,209 @@ struct npcDecayTimes_Struct {
struct VarCache_Struct {
char varname[26];
char value[0];
std::map<std::string, std::string> m_cache;
uint32 last_update;
VarCache_Struct() : last_update(0) { }
void Add(const std::string &key, const std::string &value) { m_cache[key] = value; }
const std::string *Get(const std::string &key) {
auto it = m_cache.find(key);
return (it != m_cache.end() ? &it->second : nullptr);
}
};
struct PlayerProfile_Struct;
struct GuildRankLevel_Struct;
struct GuildRanks_Struct;
struct ExtendedProfile_Struct;
struct GuildMember_Struct;
class PTimerList;
#pragma pack(1)
/* Conversion Structs */
namespace Convert {
struct BindStruct {
/*000*/ uint32 zoneId;
/*004*/ float x;
/*008*/ float y;
/*012*/ float z;
/*016*/ float heading;
};
struct Color_Struct
{
union
{
struct
{
uint8 blue;
uint8 green;
uint8 red;
uint8 use_tint; // if there's a tint this is FF
} rgb;
uint32 color;
};
};
struct AA_Array
{
uint32 AA;
uint32 value;
};
struct SpellBuff_Struct
{
/*000*/ uint8 slotid; //badly named... seems to be 2 for a real buff, 0 otherwise
/*001*/ uint8 level;
/*002*/ uint8 bard_modifier;
/*003*/ uint8 effect; //not real
/*004*/ uint32 spellid;
/*008*/ uint32 duration;
/*012*/ uint32 counters;
/*016*/ uint32 player_id; //'global' ID of the caster, for wearoff messages
/*020*/
};
struct Tribute_Struct {
uint32 tribute;
uint32 tier;
};
struct Disciplines_Struct {
uint32 values[MAX_PP_DISCIPLINES];
};
struct GroupLeadershipAA_Struct {
union {
struct {
uint32 groupAAMarkNPC;
uint32 groupAANPCHealth;
uint32 groupAADelegateMainAssist;
uint32 groupAADelegateMarkNPC;
uint32 groupAA4;
uint32 groupAA5;
uint32 groupAAInspectBuffs;
uint32 groupAA7;
uint32 groupAASpellAwareness;
uint32 groupAAOffenseEnhancement;
uint32 groupAAManaEnhancement;
uint32 groupAAHealthEnhancement;
uint32 groupAAHealthRegeneration;
uint32 groupAAFindPathToPC;
uint32 groupAAHealthOfTargetsTarget;
uint32 groupAA15;
};
uint32 ranks[MAX_GROUP_LEADERSHIP_AA_ARRAY];
};
};
struct RaidLeadershipAA_Struct {
union {
struct {
uint32 raidAAMarkNPC;
uint32 raidAANPCHealth;
uint32 raidAADelegateMainAssist;
uint32 raidAADelegateMarkNPC;
uint32 raidAA4;
uint32 raidAA5;
uint32 raidAA6;
uint32 raidAASpellAwareness;
uint32 raidAAOffenseEnhancement;
uint32 raidAAManaEnhancement;
uint32 raidAAHealthEnhancement;
uint32 raidAAHealthRegeneration;
uint32 raidAAFindPathToPC;
uint32 raidAAHealthOfTargetsTarget;
uint32 raidAA14;
uint32 raidAA15;
};
uint32 ranks[MAX_RAID_LEADERSHIP_AA_ARRAY];
};
};
struct LeadershipAA_Struct {
union {
struct {
Convert::GroupLeadershipAA_Struct group;
Convert::RaidLeadershipAA_Struct raid;
};
uint32 ranks[MAX_LEADERSHIP_AA_ARRAY];
};
};
typedef struct
{
/*00*/ char Name[64];
/*64*/ uint32 Level;
/*68*/ uint32 Race;
/*72*/ uint32 Class;
/*76*/ uint32 Zone;
/*80*/ uint32 Time;
/*84*/ uint32 Points;
/*88*/
} PVPStatsEntry_Struct;
struct BandolierItem_Struct {
uint32 item_id;
uint32 icon;
char item_name[64];
};
struct Bandolier_Struct {
char name[32];
Convert::BandolierItem_Struct items[EmuConstants::BANDOLIER_SIZE];
};
struct PotionBelt_Struct {
Convert::BandolierItem_Struct items[EmuConstants::POTION_BELT_SIZE];
};
struct SuspendedMinion_Struct
{
/*000*/ uint16 SpellID;
/*002*/ uint32 HP;
/*006*/ uint32 Mana;
/*010*/ Convert::SpellBuff_Struct Buffs[BUFF_COUNT];
/*510*/ uint32 Items[_MaterialCount];
/*546*/ char Name[64];
/*610*/
};
struct PlayerProfile_Struct {
/*0000*/ uint32 checksum; // Checksum from CRC32::SetEQChecksum
/*0004*/ char name[64]; // Name of player sizes not right
/*0068*/ char last_name[32]; // Last name of player sizes not right
/*0100*/ uint32 gender; // Player Gender - 0 Male, 1 Female
/*0104*/ uint32 race; // Player race
/*0108*/ uint32 class_; // Player class
/*0112*/ uint32 unknown0112; //
/*0116*/ uint32 level; // Level of player (might be one byte)
/*0120*/ Convert::BindStruct binds[5]; // Bind points (primary is first, home city is fifth)
/*0220*/ uint32 deity; // deity
/*0224*/ uint32 guild_id;
/*0228*/ uint32 birthday; // characters bday
/*0232*/ uint32 lastlogin; // last login or zone time
/*0236*/ uint32 timePlayedMin; // in minutes
/*0240*/ uint8 pvp;
/*0241*/ uint8 level2; //no idea why this is here, but thats how it is on live
/*0242*/ uint8 anon; // 2=roleplay, 1=anon, 0=not anon
/*0243*/ uint8 gm;
/*0244*/ uint8 guildrank;
/*0245*/ uint8 guildbanker;
/*0246*/ uint8 unknown0246[6]; //
/*0252*/ uint32 intoxication;
/*0256*/ uint32 spellSlotRefresh[MAX_PP_REF_MEMSPELL]; //in ms
/*0292*/ uint32 abilitySlotRefresh;
/*0296*/ uint8 haircolor; // Player hair color
/*0297*/ uint8 beardcolor; // Player beard color
/*0298*/ uint8 eyecolor1; // Player left eye color
/*0299*/ uint8 eyecolor2; // Player right eye color
/*0300*/ uint8 hairstyle; // Player hair style
/*0301*/ uint8 beard; // Beard type
/*0302*/ uint8 ability_time_seconds; //The following four spots are unknown right now.....
/*0303*/ uint8 ability_number; //ability used
/*0304*/ uint8 ability_time_minutes;
/*0305*/ uint8 ability_time_hours; //place holder
/*0306*/ uint8 unknown0306[6]; // @bp Spacer/Flag?
/*0312*/ uint32 item_material[_MaterialCount]; // Item texture/material of worn/held items
/*0348*/ uint8 unknown0348[44];
/*0392*/ Convert::Color_Struct item_tint[_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
/*2384*/ char title[32]; // length might be wrong
/*2416*/ char suffix[32]; // length might be wrong
/*2448*/ uint32 guildid2; //
/*2452*/ uint32 exp; // Current Experience
/*2456*/ uint32 unknown2492;
/*2460*/ uint32 points; // Unspent Practice points
/*2464*/ uint32 mana; // current mana
/*2468*/ uint32 cur_hp; // current hp
/*2472*/ uint32 unknown2508; // 0x05
/*2476*/ uint32 STR; // Strength
/*2480*/ uint32 STA; // Stamina
/*2484*/ uint32 CHA; // Charisma
/*2488*/ uint32 DEX; // Dexterity
/*2492*/ uint32 INT; // Intelligence
/*2496*/ uint32 AGI; // Agility
/*2500*/ uint32 WIS; // Wisdom
/*2504*/ uint8 face; // Player face
/*2505*/ uint8 unknown2541[47]; // ?
/*2552*/ uint8 languages[MAX_PP_LANGUAGE];
/*2580*/ uint8 unknown2616[4];
/*2584*/ uint32 spell_book[MAX_PP_REF_SPELLBOOK];
/*4504*/ uint8 unknown4540[128]; // Was [428] all 0xff
/*4632*/ uint32 mem_spells[MAX_PP_REF_MEMSPELL];
/*4668*/ uint8 unknown4704[32]; //
/*4700*/ float y; // Player y position
/*4704*/ float x; // Player x position
/*4708*/ float z; // Player z position
/*4712*/ float heading; // Direction player is facing
/*4716*/ uint8 unknown4752[4]; //
/*4720*/ int32 platinum; // Platinum Pieces on player
/*4724*/ int32 gold; // Gold Pieces on player
/*4728*/ int32 silver; // Silver Pieces on player
/*4732*/ int32 copper; // Copper Pieces on player
/*4736*/ int32 platinum_bank; // Platinum Pieces in Bank
/*4740*/ int32 gold_bank; // Gold Pieces in Bank
/*4744*/ int32 silver_bank; // Silver Pieces in Bank
/*4748*/ int32 copper_bank; // Copper Pieces in Bank
/*4752*/ int32 platinum_cursor; // Platinum on cursor
/*4756*/ int32 gold_cursor; // Gold on cursor
/*4760*/ int32 silver_cursor; // Silver on cursor
/*4764*/ int32 copper_cursor; // Copper on cursor
/*4768*/ int32 platinum_shared; // Platinum shared between characters
/*4772*/ uint8 unknown4808[24];
/*4796*/ uint32 skills[MAX_PP_SKILL]; // [400] List of skills // 100 dword buffer
/*5196*/ uint8 unknown5132[184];
/*5380*/ uint32 pvp2; //
/*5384*/ uint32 unknown5420; //
/*5388*/ uint32 pvptype; //
/*5392*/ uint32 unknown5428; //
/*5396*/ uint32 ability_down; // Guessing
/*5400*/ uint8 unknown5436[8]; //
/*5408*/ uint32 autosplit; //not used right now
/*5412*/ uint8 unknown5448[8];
/*5420*/ uint32 zone_change_count; // Number of times user has zoned in their career (guessing)
/*5424*/ uint8 unknown5460[16]; //
/*5440*/ uint32 drakkin_heritage; //
/*5444*/ uint32 drakkin_tattoo; //
/*5448*/ uint32 drakkin_details; //
/*5452*/ uint32 expansions; // expansion setting, bit field of expansions avaliable
/*5456*/ int32 toxicity; //from drinking potions, seems to increase by 3 each time you drink
/*5460*/ char unknown5496[16]; //
/*5476*/ int32 hunger_level;
/*5480*/ int32 thirst_level;
/*5484*/ uint32 ability_up;
/*5488*/ char unknown5524[16];
/*5504*/ uint16 zone_id; // Current zone of the player
/*5506*/ uint16 zoneInstance; // Instance ID
/*5508*/ Convert::SpellBuff_Struct buffs[BUFF_COUNT]; // Buffs currently on the player
/*6008*/ char groupMembers[6][64];//
/*6392*/ char unknown6428[656];
/*7048*/ uint32 entityid;
/*7052*/ uint32 leadAAActive;
/*7056*/ uint32 unknown7092;
/*7060*/ int32 ldon_points_guk; //client uses these as signed
/*7064*/ int32 ldon_points_mir;
/*7068*/ int32 ldon_points_mmc;
/*7072*/ int32 ldon_points_ruj;
/*7076*/ int32 ldon_points_tak;
/*7080*/ int32 ldon_points_available;
/*7084*/ int32 ldon_wins_guk;
/*7088*/ int32 ldon_wins_mir;
/*7092*/ int32 ldon_wins_mmc;
/*7096*/ int32 ldon_wins_ruj;
/*7100*/ int32 ldon_wins_tak;
/*7104*/ int32 ldon_losses_guk;
/*7108*/ int32 ldon_losses_mir;
/*7112*/ int32 ldon_losses_mmc;
/*7116*/ int32 ldon_losses_ruj;
/*7120*/ int32 ldon_losses_tak;
/*7124*/ uint8 unknown7160[72];
/*7196*/ uint32 tribute_time_remaining; //in miliseconds
/*7200*/ uint32 showhelm;
/*7204*/ uint32 career_tribute_points;
/*7208*/ uint32 unknown7244;
/*7212*/ uint32 tribute_points;
/*7216*/ uint32 unknown7252;
/*7220*/ uint32 tribute_active; //1=active
/*7224*/ Convert::Tribute_Struct tributes[EmuConstants::TRIBUTE_SIZE];
/*7264*/ Convert::Disciplines_Struct disciplines;
/*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use)
/*7744*/ char unknown7780[160];
/*7904*/ uint32 endurance;
/*7908*/ uint32 group_leadership_exp; //0-1000
/*7912*/ uint32 raid_leadership_exp; //0-2000
/*7916*/ uint32 group_leadership_points;
/*7920*/ uint32 raid_leadership_points;
/*7924*/ Convert::LeadershipAA_Struct leader_abilities;
/*8052*/ uint8 unknown8088[132];
/*8184*/ uint32 air_remaining;
/*8188*/ uint32 PVPKills;
/*8192*/ uint32 PVPDeaths;
/*8196*/ uint32 PVPCurrentPoints;
/*8200*/ uint32 PVPCareerPoints;
/*8204*/ uint32 PVPBestKillStreak;
/*8208*/ uint32 PVPWorstDeathStreak;
/*8212*/ uint32 PVPCurrentKillStreak;
/*8216*/ Convert::PVPStatsEntry_Struct PVPLastKill;
/*8304*/ Convert::PVPStatsEntry_Struct PVPLastDeath;
/*8392*/ uint32 PVPNumberOfKillsInLast24Hours;
/*8396*/ Convert::PVPStatsEntry_Struct PVPRecentKills[50];
/*12796*/ uint32 aapoints_spent;
/*12800*/ uint32 expAA;
/*12804*/ uint32 aapoints; //avaliable, unspent
/*12808*/ uint8 unknown12844[36];
/*12844*/ Convert::Bandolier_Struct bandoliers[EmuConstants::BANDOLIERS_COUNT];
/*14124*/ uint8 unknown14160[4506];
/*18630*/ Convert::SuspendedMinion_Struct SuspendedMinion; // No longer in use
/*19240*/ uint32 timeentitledonaccount;
/*19244*/ Convert::PotionBelt_Struct potionbelt; //there should be 3 more of these
/*19532*/ uint8 unknown19568[8];
/*19540*/ uint32 currentRadCrystals; // Current count of radiant crystals
/*19544*/ uint32 careerRadCrystals; // Total count of radiant crystals ever
/*19548*/ uint32 currentEbonCrystals;// Current count of ebon crystals
/*19552*/ uint32 careerEbonCrystals; // Total count of ebon crystals ever
/*19556*/ uint8 groupAutoconsent; // 0=off, 1=on
/*19557*/ uint8 raidAutoconsent; // 0=off, 1=on
/*19558*/ uint8 guildAutoconsent; // 0=off, 1=on
/*19559*/ uint8 unknown19595[5]; // ***Placeholder (6/29/2005)
/*19564*/ uint32 RestTimer;
/*19568*/
};
namespace player_lootitem_temp
{
struct ServerLootItem_Struct_temp {
uint32 item_id;
int16 equipSlot;
uint8 charges;
uint16 lootslot;
uint32 aug1;
uint32 aug2;
uint32 aug3;
uint32 aug4;
uint32 aug5;
};
}
struct DBPlayerCorpse_Struct_temp {
uint32 crc;
bool locked;
uint32 itemcount;
uint32 exp;
float size;
uint8 level;
uint8 race;
uint8 gender;
uint8 class_;
uint8 deity;
uint8 texture;
uint8 helmtexture;
uint32 copper;
uint32 silver;
uint32 gold;
uint32 plat;
Color_Struct item_tint[9];
uint8 haircolor;
uint8 beardcolor;
uint8 eyecolor1;
uint8 eyecolor2;
uint8 hairstyle;
uint8 face;
uint8 beard;
uint32 drakkin_heritage;
uint32 drakkin_tattoo;
uint32 drakkin_details;
player_lootitem_temp::ServerLootItem_Struct_temp items[0];
};
namespace classic_db_temp {
struct DBPlayerCorpse_Struct_temp {
uint32 crc;
bool locked;
uint32 itemcount;
uint32 exp;
float size;
uint8 level;
uint8 race;
uint8 gender;
uint8 class_;
uint8 deity;
uint8 texture;
uint8 helmtexture;
uint32 copper;
uint32 silver;
uint32 gold;
uint32 plat;
Color_Struct item_tint[9];
uint8 haircolor;
uint8 beardcolor;
uint8 eyecolor1;
uint8 eyecolor2;
uint8 hairstyle;
uint8 face;
uint8 beard;
player_lootitem_temp::ServerLootItem_Struct_temp items[0];
};
}
}
#pragma pack()
#ifdef _WINDOWS
#if _MSC_VER > 1700 // greater than 2012 (2013+)
# define _ISNAN_(a) std::isnan(a)
#else
# include <float.h>
# define _ISNAN_(a) _isnan(a)
#endif
#else
# define _ISNAN_(a) std::isnan(a)
#endif
class Database : public DBcore {
public:
Database();
Database(const char* host, const char* user, const char* passwd, const char* database,uint32 port);
bool Connect(const char* host, const char* user, const char* passwd, const char* database,uint32 port);
bool Connect(const char* host, const char* user, const char* passwd, const char* database, uint32 port);
~Database();
/*
* General Character Related Stuff
*/
/* Character Creation */
bool SaveCharacterCreate(uint32 character_id, uint32 account_id, PlayerProfile_Struct* pp);
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* 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 UpdateName(const char* oldname, const char* newname);
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 AddToNameFilter(const char* name);
bool ReserveName(uint32 account_id, 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 StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inventory* inv);
bool DeleteCharacter(char* name);
bool UpdateName(const char* oldname, const char* newname);
/*
* General Information Getting Queries
*/
/* General Information Queries */
bool AddBannedIP(char* bannedIP, const char* notes); //Add IP address to the Banned_IPs table.
bool AddGMIP(char* ip_address, char* name);
bool CheckBannedIPs(const char* loginIP); //Check incoming connection against banned IP table.
bool CheckGMIPs(const char* loginIP, uint32 account_id);
bool CheckNameFilter(const char* name, bool surname = false);
bool CheckUsedName(const char* name);
uint32 GetAccountIDByChar(const char* charname, uint32* oCharID = 0);
uint32 GetAccountIDByChar(uint32 char_id);
uint32 GetAccountIDByName(const char* accname, int16* status = 0, uint32* lsid = 0);
uint32 GetCharacterID(const char *name);
uint32 GetCharacterInfo(const char* iName, uint32* oAccID = 0, uint32* oZoneID = 0, uint32* oInstanceID = 0, float* oX = 0, float* oY = 0, float* oZ = 0);
uint32 GetGuildIDByCharID(uint32 char_id);
void GetAccountName(uint32 accountid, char* name, uint32* oLSAccountID = 0);
void GetCharName(uint32 char_id, char* name);
uint32 GetCharacterInfo(const char* iName, uint32* oAccID = 0, uint32* oZoneID = 0, uint32* oInstanceID = 0,float* oX = 0, float* oY = 0, float* oZ = 0);
uint32 GetCharacterID(const char *name);
bool CheckBannedIPs(const char* loginIP); //Lieka Edit: Check incomming connection against banned IP table.
bool AddBannedIP(char* bannedIP, const char* notes); //Lieka Edit: Add IP address to the Banned_IPs table.
bool CheckGMIPs(const char* loginIP, uint32 account_id);
bool AddGMIP(char* ip_address, char* name);
void LoginIP(uint32 AccountID, const char* LoginIP);
/*
* Instancing Stuff
*/
bool VerifyZoneInstance(uint32 zone_id, uint16 instance_id);
bool VerifyInstanceAlive(uint16 instance_id, uint32 char_id);
bool CharacterInInstanceGroup(uint16 instance_id, uint32 char_id);
void DeleteInstance(uint16 instance_id);
bool CheckInstanceExpired(uint16 instance_id);
uint32 ZoneIDFromInstanceID(uint16 instance_id);
uint32 VersionFromInstanceID(uint16 instance_id);
uint32 GetTimeRemainingInstance(uint16 instance_id, bool &is_perma);
bool GetUnusedInstanceID(uint16 &instance_id);
bool CreateInstance(uint16 instance_id, uint32 zone_id, uint32 version, uint32 duration);
void PurgeExpiredInstances();
/* Instancing */
bool AddClientToInstance(uint16 instance_id, uint32 char_id);
bool CharacterInInstanceGroup(uint16 instance_id, uint32 char_id);
bool CheckInstanceExists(uint16 instance_id);
bool CheckInstanceExpired(uint16 instance_id);
bool CreateInstance(uint16 instance_id, uint32 zone_id, uint32 version, uint32 duration);
bool GetUnusedInstanceID(uint16 &instance_id);
bool GlobalInstance(uint16 instance_id);
bool RemoveClientFromInstance(uint16 instance_id, uint32 char_id);
bool RemoveClientsFromInstance(uint16 instance_id);
bool CheckInstanceExists(uint16 instance_id);
void BuryCorpsesInInstance(uint16 instance_id);
uint16 GetInstanceVersion(uint16 instance_id);
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);
void GetCharactersInInstance(uint16 instance_id, std::list<uint32> &charid_list);
uint16 GetInstanceVersion(uint16 instance_id);
uint32 GetTimeRemainingInstance(uint16 instance_id, bool &is_perma);
uint32 VersionFromInstanceID(uint16 instance_id);
uint32 ZoneIDFromInstanceID(uint16 instance_id);
void AssignGroupToInstance(uint32 gid, uint32 instance_id);
void AssignRaidToInstance(uint32 rid, uint32 instance_id);
void BuryCorpsesInInstance(uint16 instance_id);
void DeleteInstance(uint16 instance_id);
void FlagInstanceByGroupLeader(uint32 zone, int16 version, uint32 charid, uint32 gid);
void FlagInstanceByRaidLeader(uint32 zone, int16 version, uint32 charid, uint32 rid);
void GetCharactersInInstance(uint16 instance_id, std::list<uint32> &charid_list);
void PurgeExpiredInstances();
void SetInstanceDuration(uint16 instance_id, uint32 new_duration);
bool GlobalInstance(uint16 instance_id);
/*
* Adventure related.
*/
/* Adventure related. */
void UpdateAdventureStatsEntry(uint32 char_id, uint8 theme, bool win);
bool GetAdventureStats(uint32 char_id, AdventureStats_Struct *as);
/*
* Account Related
*/
uint32 GetMiniLoginAccount(char* ip);
void GetAccountFromID(uint32 id, char* oAccountName, int16* oStatus);
uint32 CheckLogin(const char* name, const char* password, int16* oStatus = 0);
int16 CheckStatus(uint32 account_id);
uint32 CreateAccount(const char* name, const char* password, int16 status, uint32 lsaccount_id = 0);
/* Account Related */
bool DeleteAccount(const char* name);
bool GetLiveChar(uint32 account_id, char* cname);
bool SetAccountStatus(const char* name, int16 status);
bool SetLocalPassword(uint32 accid, const char* password);
bool UpdateLiveChar(char* charname, uint32 lsaccount_id);
int16 CheckStatus(uint32 account_id);
uint32 CheckLogin(const char* name, const char* password, int16* oStatus = 0);
uint32 CreateAccount(const char* name, const char* password, int16 status, uint32 lsaccount_id = 0);
uint32 GetAccountIDFromLSID(uint32 iLSID, char* oAccountName = 0, int16* oStatus = 0);
bool UpdateLiveChar(char* charname,uint32 lsaccount_id);
bool GetLiveChar(uint32 account_id, char* cname);
uint32 GetMiniLoginAccount(char* ip);
uint8 GetAgreementFlag(uint32 acctid);
void GetAccountFromID(uint32 id, char* oAccountName, int16* oStatus);
void SetAgreementFlag(uint32 acctid);
/*
* Groups
*/
uint32 GetGroupID(const char* name);
void SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ismerc = false);
void ClearGroup(uint32 gid = 0);
char* GetGroupLeaderForLogin(const char* name,char* leaderbuf);
void SetGroupLeaderName(uint32 gid, const char* name);
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);
void ClearGroupLeader(uint32 gid = 0);
/* 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);
void SetGroupLeaderName(uint32 gid, const char* name);
/* Raids */
const char *GetRaidLeaderName(uint32 rid);
uint32 GetRaidID(const char* name);
/*
* Raids
*/
void ClearRaid(uint32 rid = 0);
void ClearRaidDetails(uint32 rid = 0);
uint32 GetRaidID(const char* name);
const char *GetRaidLeaderName(uint32 rid);
void GetGroupLeadershipInfo(uint32 gid, uint32 rid, char* maintank = nullptr, char* assist = nullptr, char* puller = nullptr, char *marknpc = nullptr,
char *mentoree = nullptr, int *mentor_percent = nullptr, GroupLeadershipAA_Struct* GLAA = nullptr);
void GetRaidLeadershipInfo(uint32 rid, char* maintank = nullptr, char* assist = nullptr, char* puller = nullptr, char *marknpc = nullptr,
RaidLeadershipAA_Struct* RLAA = nullptr);
void SetRaidGroupLeaderInfo(uint32 gid, uint32 rid);
void ClearRaidLeader(uint32 gid = 0xFFFFFFFF, uint32 rid = 0);
void GetGroupLeadershipInfo(uint32 gid, uint32 rid, char* maintank = nullptr, char* assist = nullptr, char* puller = nullptr, char *marknpc = nullptr, char *mentoree = nullptr, int *mentor_percent = nullptr, GroupLeadershipAA_Struct* GLAA = nullptr);
void GetRaidLeadershipInfo(uint32 rid, char* maintank = nullptr, char* assist = nullptr, char* puller = nullptr, char *marknpc = nullptr, RaidLeadershipAA_Struct* RLAA = nullptr);
void SetRaidGroupLeaderInfo(uint32 gid, uint32 rid);
/* Database Conversions 'database_conversions.cpp' */
/* Database Conversions*/
bool CheckDatabaseConversions();
bool CheckDatabaseConvertPPDeblob();
bool CheckDatabaseConvertCorpseDeblob();
bool CheckDatabaseConvertBotsPostPPDeblob();
bool CheckDatabaseConvertPPDeblob();
/*
* Database Variables
*/
bool GetVariable(const char* varname, char* varvalue, uint16 varvalue_len);
bool SetVariable(const char* varname, const char* varvalue);
/* Database Variables */
bool GetVariable(std::string varname, std::string &varvalue);
bool SetVariable(const std::string varname, const std::string &varvalue);
bool LoadVariables();
uint32 LoadVariables_MQ(char** query);
bool LoadVariables_result(MySQLRequestResult results);
/*
* General Queries
*/
bool LoadZoneNames();
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 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);
uint32 GetZoneGraveyardID(uint32 zone_id, uint32 version);
uint32 GetZoneID(const char* zonename);
uint8 GetPEQZone(uint32 zoneID, uint32 version);
const char* GetZoneName(uint32 zoneID, bool ErrorUnknown = false);
uint8 GetServerType();
/* 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); }
uint8 GetSkillCap(uint8 skillid, uint8 in_race, uint8 in_class, uint16 in_level);
uint8 GetRaceSkill(uint8 skillid, uint8 in_race);
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);
void ClearPTimers(uint32 charid);
void ClearMerchantTemp();
void SetLFP(uint32 CharID, bool LFP);
void SetLFG(uint32 CharID, bool LFG);
void SetFirstLogon(uint32 CharID, uint8 firstlogon);
void SetLoginFlags(uint32 CharID, bool LFP, bool LFG, uint8 firstlogon);
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);
uint8 GetServerType();
uint8 GetSkillCap(uint8 skillid, uint8 in_race, uint8 in_class, uint16 in_level);
void AddReport(std::string who, std::string against, std::string lines);
struct TimeOfDay_Struct LoadTime(time_t &realtime);
bool SaveTime(int8 minute, int8 hour, int8 day, int8 month, int16 year);
void ClearMerchantTemp();
void ClearPTimers(uint32 charid);
void SetFirstLogon(uint32 CharID, uint8 firstlogon);
void SetLFG(uint32 CharID, bool LFG);
void SetLFP(uint32 CharID, bool LFP);
void SetLoginFlags(uint32 CharID, bool LFP, bool LFG, uint8 firstlogon);
void ClearInvSnapshots(bool use_rule = true);
/* EQEmuLogSys */
void LoadLogSettings(EQEmuLogSys::LogSettings* log_settings);
private:
void DBInitVars();
std::map<uint32,std::string> zonename_array;
Mutex Mvarcache;
uint32 varcache_max;
VarCache_Struct** varcache_array;
uint32 varcache_lastupdate;
Mutex Mvarcache;
VarCache_Struct varcache;
/*
* Groups, utility methods.
*/
/* Groups, utility methods. */
void ClearAllGroupLeaders();
void ClearAllGroups();
/*
* Raid, utility methods.
*/
/* Raid, utility methods. */
void ClearAllRaids();
void ClearAllRaidDetails();
void ClearAllRaidLeaders();
File diff suppressed because it is too large Load Diff
+562
View File
@@ -0,0 +1,562 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2015 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/global_define.h"
#include "../common/rulesys.h"
#include "../common/string_util.h"
#include "../common/timer.h"
#include "database.h"
#include <iomanip>
#include <iostream>
// Disgrace: for windows compile
#ifdef _WINDOWS
#include <windows.h>
#define snprintf _snprintf
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
#else
#include "unix.h"
#include <netinet/in.h>
#include <sys/time.h>
#endif
bool Database::AddClientToInstance(uint16 instance_id, uint32 char_id)
{
std::string query = StringFormat(
"REPLACE INTO `instance_list_player` (id, charid) "
"VALUES "
"(%lu, %lu)",
(unsigned long)instance_id,
(unsigned long)char_id
);
auto results = QueryDatabase(query);
return results.Success();
}
bool Database::CharacterInInstanceGroup(uint16 instance_id, uint32 char_id)
{
std::string query = StringFormat("SELECT charid FROM instance_list_player where id=%u AND charid=%u", instance_id, char_id);
auto results = QueryDatabase(query);
if (!results.Success())
return false;
if (results.RowCount() != 1)
return false;
return true;
}
bool Database::CheckInstanceExists(uint16 instance_id) {
std::string query = StringFormat(
"SELECT "
"`id` "
"FROM "
"`instance_list` "
"WHERE "
"`id` = %u",
instance_id
);
auto results = QueryDatabase(query);
if (!results.Success())
return false;
if (results.RowCount() == 0)
return false;
return true;
}
bool Database::CheckInstanceExpired(uint16 instance_id)
{
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);
auto results = QueryDatabase(query);
if (!results.Success())
return true;
if (results.RowCount() == 0)
return true;
auto row = results.begin();
start_time = atoi(row[0]);
duration = atoi(row[1]);
never_expires = atoi(row[2]);
if (never_expires == 1)
return false;
timeval tv;
gettimeofday(&tv, nullptr);
if ((start_time + duration) <= tv.tv_sec)
return true;
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);
auto results = QueryDatabase(query);
return results.Success();
}
bool Database::GetUnusedInstanceID(uint16 &instance_id)
{
uint32 count = RuleI(Zone, ReservedInstances);
uint32 max = 65535;
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())
{
instance_id = 0;
return false;
}
if (results.RowCount() == 0)
{
instance_id = 0;
return false;
}
auto row = results.begin();
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);
results = QueryDatabase(query);
if (!results.Success())
{
instance_id = 0;
return false;
}
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;
return true;
}
if (count > max)
{
instance_id = 0;
return false;
}
count++;
}
instance_id = count;
return true;
}
bool Database::GlobalInstance(uint16 instance_id)
{
std::string query = StringFormat(
"SELECT "
"is_global "
"FROM "
"instance_list "
"WHERE "
"id = %u "
"LIMIT 1 ",
instance_id
);
auto results = QueryDatabase(query);
if (!results.Success())
return false;
if (results.RowCount() == 0)
return false;
auto row = results.begin();
return (atoi(row[0]) == 1) ? true : false;
}
bool Database::RemoveClientFromInstance(uint16 instance_id, uint32 char_id)
{
std::string query = StringFormat("DELETE FROM instance_list_player WHERE id=%lu AND charid=%lu",
(unsigned long)instance_id, (unsigned long)char_id);
auto results = QueryDatabase(query);
return results.Success();
}
bool Database::RemoveClientsFromInstance(uint16 instance_id)
{
std::string query = StringFormat("DELETE FROM instance_list_player WHERE id=%lu", (unsigned long)instance_id);
auto results = QueryDatabase(query);
return results.Success();
}
bool Database::VerifyInstanceAlive(uint16 instance_id, uint32 char_id)
{
//we are not saved to this instance so set our instance to 0
if (!GlobalInstance(instance_id) && !CharacterInInstanceGroup(instance_id, char_id))
return false;
if (CheckInstanceExpired(instance_id))
{
DeleteInstance(instance_id);
return false;
}
return true;
}
bool Database::VerifyZoneInstance(uint32 zone_id, uint16 instance_id)
{
std::string query = StringFormat("SELECT id FROM instance_list where id=%u AND zone=%u", instance_id, zone_id);
auto results = QueryDatabase(query);
if (!results.Success())
return false;
if (results.RowCount() == 0)
return false;
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)
return 0;
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; ",
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::GetInstanceVersion(uint16 instance_id) {
if (instance_id == 0)
return 0;
std::string query = StringFormat("SELECT version FROM instance_list where id=%u", instance_id);
auto results = QueryDatabase(query);
if (!results.Success())
return 0;
if (results.RowCount() == 0)
return 0;
auto row = results.begin();
return atoi(row[0]);
}
uint32 Database::GetTimeRemainingInstance(uint16 instance_id, bool &is_perma)
{
uint32 start_time = 0;
uint32 duration = 0;
uint32 never_expires = 0;
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())
{
is_perma = false;
return 0;
}
if (results.RowCount() == 0)
{
is_perma = false;
return 0;
}
auto row = results.begin();
start_time = atoi(row[0]);
duration = atoi(row[1]);
never_expires = atoi(row[2]);
if (never_expires == 1)
{
is_perma = true;
return 0;
}
is_perma = false;
timeval tv;
gettimeofday(&tv, nullptr);
return ((start_time + duration) - tv.tv_sec);
}
uint32 Database::VersionFromInstanceID(uint16 instance_id)
{
std::string query = StringFormat("SELECT version FROM instance_list where id=%u", instance_id);
auto results = QueryDatabase(query);
if (!results.Success())
return 0;
if (results.RowCount() == 0)
return 0;
auto row = results.begin();
return atoi(row[0]);
}
uint32 Database::ZoneIDFromInstanceID(uint16 instance_id)
{
std::string query = StringFormat("SELECT zone FROM instance_list where id=%u", instance_id);
auto results = QueryDatabase(query);
if (!results.Success())
return 0;
if (results.RowCount() == 0)
return 0;
auto row = results.begin();
return atoi(row[0]);
}
void Database::AssignGroupToInstance(uint32 group_id, uint32 instance_id)
{
uint32 zone_id = ZoneIDFromInstanceID(instance_id);
uint16 version = VersionFromInstanceID(instance_id);
std::string query = StringFormat("SELECT `charid` FROM `group_id` WHERE `groupid` = %u", group_id);
auto results = QueryDatabase(query);
if (!results.Success())
return;
for (auto row = results.begin(); row != results.end(); ++row)
{
uint32 charid = atoi(row[0]);
if (GetInstanceID(zone_id, charid, version) == 0)
AddClientToInstance(instance_id, charid);
}
}
void Database::AssignRaidToInstance(uint32 raid_id, uint32 instance_id)
{
uint32 zone_id = ZoneIDFromInstanceID(instance_id);
uint16 version = VersionFromInstanceID(instance_id);
std::string query = StringFormat("SELECT `charid` FROM `raid_members` WHERE `raidid` = %u", raid_id);
auto results = QueryDatabase(query);
if (!results.Success())
return;
for (auto row = results.begin(); row != results.end(); ++row)
{
uint32 charid = atoi(row[0]);
if (GetInstanceID(zone_id, charid, version) == 0)
AddClientToInstance(instance_id, charid);
}
}
void Database::BuryCorpsesInInstance(uint16 instance_id) {
std::string query = StringFormat(
"UPDATE `character_corpses` "
"SET `is_buried` = 1, "
"`instance_id` = 0 "
"WHERE "
"`instance_id` = %u ",
instance_id
);
auto results = QueryDatabase(query);
}
void Database::DeleteInstance(uint16 instance_id)
{
std::string query = StringFormat("DELETE FROM instance_list WHERE id=%u", instance_id);
QueryDatabase(query);
query = StringFormat("DELETE FROM instance_list_player WHERE id=%u", instance_id);
QueryDatabase(query);
query = StringFormat("DELETE FROM respawn_times WHERE instance_id=%u", instance_id);
QueryDatabase(query);
query = StringFormat("DELETE FROM spawn_condition_values WHERE instance_id=%u", instance_id);
QueryDatabase(query);
BuryCorpsesInInstance(instance_id);
}
void Database::FlagInstanceByGroupLeader(uint32 zone, int16 version, uint32 charid, uint32 gid)
{
uint16 id = GetInstanceID(zone, charid, version);
if (id != 0)
return;
char ln[128];
memset(ln, 0, 128);
strcpy(ln, GetGroupLeadershipInfo(gid, ln));
uint32 l_charid = GetCharacterID((const char*)ln);
uint16 l_id = GetInstanceID(zone, l_charid, version);
if (l_id == 0)
return;
AddClientToInstance(l_id, charid);
}
void Database::FlagInstanceByRaidLeader(uint32 zone, int16 version, uint32 charid, uint32 rid)
{
uint16 id = GetInstanceID(zone, charid, version);
if (id != 0)
return;
uint32 l_charid = GetCharacterID(GetRaidLeaderName(rid));
uint16 l_id = GetInstanceID(zone, l_charid, version);
if (l_id == 0)
return;
AddClientToInstance(l_id, charid);
}
void Database::GetCharactersInInstance(uint16 instance_id, std::list<uint32> &charid_list) {
std::string query = StringFormat("SELECT `charid` FROM `instance_list_player` WHERE `id` = %u", instance_id);
auto results = QueryDatabase(query);
if (!results.Success())
return;
for (auto row = results.begin(); row != results.end(); ++row)
charid_list.push_back(atoi(row[0]));
}
void Database::PurgeExpiredInstances()
{
std::string query("SELECT id FROM instance_list where (start_time+duration) <= UNIX_TIMESTAMP() and never_expires = 0");
auto results = QueryDatabase(query);
if (!results.Success())
return;
if (results.RowCount() == 0)
return;
for (auto row = results.begin(); row != results.end(); ++row)
DeleteInstance(atoi(row[0]));
}
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);
}
+16 -33
View File
@@ -1,18 +1,17 @@
#include "../common/debug.h"
#ifdef _WINDOWS
#include <winsock2.h>
#endif
#include "../common/misc_functions.h"
#include "../common/eqemu_logsys.h"
#include "dbcore.h"
#include <errmsg.h>
#include <fstream>
#include <iostream>
#include <errmsg.h>
#include <mysqld_error.h>
#include <limits.h>
#include "dbcore.h"
#include <string.h>
#include "../common/misc_functions.h"
#include <cstdlib>
#ifdef _WINDOWS
#define snprintf _snprintf
@@ -99,29 +98,20 @@ MySQLRequestResult DBcore::QueryDatabase(const char* query, uint32 querylen, boo
pStatus = Error;
char *errorBuffer = new char[MYSQL_ERRMSG_SIZE];
auto errorBuffer = new char[MYSQL_ERRMSG_SIZE];
snprintf(errorBuffer, MYSQL_ERRMSG_SIZE, "#%i: %s", mysql_errno(&mysql), mysql_error(&mysql));
std::cout << "DB Query Error #" << mysql_errno(&mysql) << ": " << mysql_error(&mysql) << std::endl;
return MySQLRequestResult(nullptr, 0, 0, 0, 0, (uint32)mysql_errno(&mysql), errorBuffer);
}
char *errorBuffer = new char[MYSQL_ERRMSG_SIZE];
auto errorBuffer = new char[MYSQL_ERRMSG_SIZE];
snprintf(errorBuffer, MYSQL_ERRMSG_SIZE, "#%i: %s", mysql_errno(&mysql), mysql_error(&mysql));
#ifdef _EQDEBUG
std::cout << "DB Query Error #" << mysql_errno(&mysql) << ": " << mysql_error(&mysql) << std::endl;
#endif
/* Implement Logging at the Root */
if (mysql_errno(&mysql) > 0 && strlen(query) > 0){
std::cout << "\n[MYSQL ERR] " << mysql_errno(&mysql) << ": " << mysql_error(&mysql) << " [Query]: \n" << query << "\n" << std::endl;
/* Write to log file */
std::ofstream log("eqemu_query_error_log.txt", std::ios_base::app | std::ios_base::out);
log << "[MYSQL ERR] " << mysql_error(&mysql) << "\n" << query << "\n";
log.close();
if (Log.log_settings[Logs::MySQLError].is_category_enabled == 1)
Log.Out(Logs::General, Logs::MySQLError, "%i: %s \n %s", mysql_errno(&mysql), mysql_error(&mysql), query);
}
return MySQLRequestResult(nullptr, 0, 0, 0, 0, mysql_errno(&mysql),errorBuffer);
@@ -136,21 +126,14 @@ MySQLRequestResult DBcore::QueryDatabase(const char* query, uint32 querylen, boo
rowCount = (uint32)mysql_num_rows(res);
MySQLRequestResult requestResult(res, (uint32)mysql_affected_rows(&mysql), rowCount, (uint32)mysql_field_count(&mysql), (uint32)mysql_insert_id(&mysql));
#if DEBUG_MYSQL_QUERIES >= 1
if (requestResult.Success())
if (Log.log_settings[Logs::MySQLQuery].is_category_enabled == 1)
{
std::cout << "query successful";
if (requestResult.Result())
std::cout << ", " << (int) mysql_num_rows(requestResult.Result()) << " rows returned";
std::cout << ", " << requestResult.RowCount() << " rows affected";
std::cout<< std::endl;
if ((strncasecmp(query, "select", 6) == 0))
Log.Out(Logs::General, Logs::MySQLQuery, "%s (%u row%s returned)", query, requestResult.RowCount(), requestResult.RowCount() == 1 ? "" : "s");
else
Log.Out(Logs::General, Logs::MySQLQuery, "%s (%u row%s affected)", query, requestResult.RowsAffected(), requestResult.RowsAffected() == 1 ? "" : "s");
}
else {
std::cout << "QUERY: query FAILED" << std::endl;
}
#endif
return requestResult;
}
+5 -8
View File
@@ -2,19 +2,16 @@
#define DBCORE_H
#ifdef _WINDOWS
#include <winsock.h>
#include <winsock2.h>
#include <windows.h>
#endif
#include "../common/mutex.h"
#include "../common/mysql_request_result.h"
#include "../common/types.h"
#include <mysql.h>
#include <string.h>
#include "../common/types.h"
#include "../common/mutex.h"
#include "../common/linked_list.h"
#include "../common/queue.h"
#include "../common/timer.h"
#include "../common/condition.h"
#include "../common/mysql_request_result.h"
class DBcore {
public:
-126
View File
@@ -1,126 +0,0 @@
// Doors
#ifdef SHAREMEM
int32 Database::GetDoorsCount(uint32* oMaxID) {
char errbuf[MYSQL_ERRMSG_SIZE];
char *query = 0;
MYSQL_RES *result;
MYSQL_ROW row;
query = new char[256];
strcpy(query, "SELECT MAX(id), count(*) FROM doors");
if (RunQuery(query, strlen(query), errbuf, &result)) {
safe_delete(query);
row = mysql_fetch_row(result);
if (row && row[1]) {
int32 ret = atoi(row[1]);
if (oMaxID) {
if (row[0])
*oMaxID = atoi(row[0]);
else
*oMaxID = 0;
}
mysql_free_result(result);
return ret;
}
}
else {
cerr << "Error in GetDoorsCount query '" << query << "' " << errbuf << endl;
delete[] query;
return -1;
}
return -1;
}
extern "C" bool extDBLoadDoors(uint32 iDoorCount, uint32 iMaxDoorID) { return database.DBLoadDoors(iDoorCount, iMaxDoorID); }
const Door* Database::GetDoor(uint8 door_id, const char* zone_name) {
for(uint32 i=0; i<max_door_type; i++) {
const Door* door = GetDoorDBID(i);
if(door && door->door_id == door_id && strcasecmp(door->zone_name, zone_name) == 0)
return door;
}
return 0;
}
const Door* Database::GetDoorDBID(uint32 db_id) {
return EMuShareMemDLL.Doors.GetDoor(db_id);
}
bool Database::LoadDoors() {
if (!EMuShareMemDLL.Load())
return false;
int32 tmp_max_door_type = -1;
uint32 tmp = 0;
tmp_max_door_type = GetDoorsCount(&tmp);
if (tmp_max_door_type < 0) {
cout << "Error: Database::LoadDoors-ShareMem: GetDoorsCount() returned < 0" << endl;
return false;
}
max_door_type = tmp_max_door_type;
bool ret = EMuShareMemDLL.Doors.DLLLoadDoors(&extDBLoadDoors, sizeof(Door), max_door_type, tmp);
return ret;
}
bool Database::DBLoadDoors(uint32 iDoorCount, uint32 iMaxDoorID) {
cout << "Loading Doors from database..." << endl;
char errbuf[MYSQL_ERRMSG_SIZE];
char *query = 0;
MYSQL_RES *result;
MYSQL_ROW row;
query = new char[256];
strcpy(query, "SELECT MAX(id), Count(*) FROM doors");
if (RunQuery(query, strlen(query), errbuf, &result))
{
safe_delete(query);
row = mysql_fetch_row(result);
if (row && row[0]) {
if (atoi(row[0]) > iMaxDoorID) {
cout << "Error: Insufficient shared memory to load doors." << endl;
cout << "Max(id): " << atoi(row[0]) << ", iMaxDoorID: " << iMaxDoorID << endl;
cout << "Fix this by increasing the MMF_MAX_Door_ID define statement" << endl;
return false;
}
if (atoi(row[1]) != iDoorCount) {
cout << "Error: Insufficient shared memory to load doors." << endl;
cout << "Count(*): " << atoi(row[1]) << ", iDoorCount: " << iDoorCount << endl;
return false;
}
max_door_type = atoi(row[0]);
mysql_free_result(result);
Door tmpDoor;
MakeAnyLenString(&query, "SELECT id,doorid,zone,name,pos_x,pos_y,pos_z,heading,opentype,guild,lockpick,keyitem,triggerdoor,triggertype from doors");//WHERE zone='%s'", zone_name
if (RunQuery(query, strlen(query), errbuf, &result))
{
safe_delete(query);
while((row = mysql_fetch_row(result))) {
memset(&tmpDoor, 0, sizeof(Door));
tmpDoor.db_id = atoi(row[0]);
tmpDoor.door_id = atoi(row[1]);
strn0cpy(tmpDoor.zone_name,row[2],32);
strn0cpy(tmpDoor.door_name,row[3],32);
tmpDoor.pos_x = (float)atof(row[4]);
tmpDoor.pos_y = (float)atof(row[5]);
tmpDoor.pos_z = (float)atof(row[6]);
tmpDoor.heading = atoi(row[7]);
tmpDoor.opentype = atoi(row[8]);
tmpDoor.guild_id = atoi(row[9]);
tmpDoor.lockpick = atoi(row[10]);
tmpDoor.keyitem = atoi(row[11]);
tmpDoor.trigger_door = atoi(row[12]);
tmpDoor.trigger_type = atoi(row[13]);
EMuShareMemDLL.Doors.cbAddDoor(tmpDoor.db_id, &tmpDoor);
Sleep(0);
}
mysql_free_result(result);
}
else
{
cerr << "Error in DBLoadDoors query '" << query << "' " << errbuf << endl;
delete[] query;
return false;
}
}
}
return true;
}
#endif
-441
View File
@@ -1,441 +0,0 @@
#include <iostream>
#include <string>
#include <cstdarg>
#include <time.h>
#ifdef _WINDOWS
#include <process.h>
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
#else
#include <sys/types.h>
#include <unistd.h>
#endif
#include "debug.h"
#include "string_util.h"
#include "misc_functions.h"
#include "platform.h"
#ifndef va_copy
#define va_copy(d,s) ((d) = (s))
#endif
static volatile bool logFileValid = false;
static EQEMuLog realLogFile;
EQEMuLog *LogFile = &realLogFile;
static const char* FileNames[EQEMuLog::MaxLogID] = { "logs/eqemu", "logs/eqemu", "logs/eqemu_error", "logs/eqemu_debug", "logs/eqemu_quest", "logs/eqemu_commands", "logs/crash" };
static const char* LogNames[EQEMuLog::MaxLogID] = { "Status", "Normal", "Error", "Debug", "Quest", "Command", "Crash" };
EQEMuLog::EQEMuLog() {
for (int i=0; i<MaxLogID; i++) {
fp[i] = 0;
logCallbackFmt[i] = nullptr;
logCallbackBuf[i] = nullptr;
logCallbackPva[i] = nullptr;
}
pLogStatus[Status] = LOG_LEVEL_STATUS;
pLogStatus[Normal] = LOG_LEVEL_NORMAL;
pLogStatus[Error] = LOG_LEVEL_ERROR;
pLogStatus[Debug] = LOG_LEVEL_DEBUG;
pLogStatus[Quest] = LOG_LEVEL_QUEST;
pLogStatus[Commands] = LOG_LEVEL_COMMANDS;
pLogStatus[Crash] = LOG_LEVEL_CRASH;
logFileValid = true;
}
EQEMuLog::~EQEMuLog() {
logFileValid = false;
for (int i=0; i<MaxLogID; i++) {
LockMutex lock(&MLog[i]); //to prevent termination race
if (fp[i])
fclose(fp[i]);
}
}
bool EQEMuLog::open(LogIDs id) {
if (!logFileValid) {
return false;
}
if (id >= MaxLogID) {
return false;
}
LockMutex lock(&MOpen);
if (pLogStatus[id] & 4) {
return false;
}
if (fp[id]) {
//cerr<<"Warning: LogFile already open"<<endl;
return true;
}
char exename[200] = "";
const EQEmuExePlatform &platform = GetExecutablePlatform();
if(platform == ExePlatformWorld) {
snprintf(exename, sizeof(exename), "_world");
} else if(platform == ExePlatformZone) {
snprintf(exename, sizeof(exename), "_zone");
} else if(platform == ExePlatformLaunch) {
snprintf(exename, sizeof(exename), "_launch");
} else if(platform == ExePlatformUCS) {
snprintf(exename, sizeof(exename), "_ucs");
} else if(platform == ExePlatformQueryServ) {
snprintf(exename, sizeof(exename), "_queryserv");
} else if(platform == ExePlatformSharedMemory) {
snprintf(exename, sizeof(exename), "_shared_memory");
} else if(platform == ExePlatformClientImport) {
snprintf(exename, sizeof(exename), "_import");
} else if(platform == ExePlatformClientExport) {
snprintf(exename, sizeof(exename), "_export");
}
char filename[200];
#ifndef NO_PIDLOG
snprintf(filename, sizeof(filename), "%s%s_%04i.log", FileNames[id], exename, getpid());
#else
snprintf(filename, sizeof(filename), "%s%s.log", FileNames[id], exename);
#endif
fp[id] = fopen(filename, "a");
if (!fp[id]) {
std::cerr << "Failed to open log file: " << filename << std::endl;
pLogStatus[id] |= 4; // set file state to error
return false;
}
fputs("---------------------------------------------\n",fp[id]);
write(id, "Starting Log: %s", filename);
return true;
}
bool EQEMuLog::write(LogIDs id, const char *fmt, ...) {
if (!logFileValid) {
return false;
}
if (id >= MaxLogID) {
return false;
}
bool dofile = false;
if (pLogStatus[id] & 1) {
dofile = open(id);
}
if (!(dofile || pLogStatus[id] & 2))
return false;
LockMutex lock(&MLog[id]);
if (!logFileValid)
return false; //check again for threading race reasons (to avoid two mutexes)
time_t aclock;
struct tm *newtime;
time( &aclock ); /* Get time in seconds */
newtime = localtime( &aclock ); /* Convert time to struct */
if (dofile)
#ifndef NO_PIDLOG
fprintf(fp[id], "[%02d.%02d. - %02d:%02d:%02d] ", newtime->tm_mon+1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec);
#else
fprintf(fp[id], "%04i [%02d.%02d. - %02d:%02d:%02d] ", getpid(), newtime->tm_mon+1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec);
#endif
va_list argptr, tmpargptr;
va_start(argptr, fmt);
if (dofile) {
va_copy(tmpargptr, argptr);
vfprintf( fp[id], fmt, tmpargptr );
}
if(logCallbackFmt[id]) {
msgCallbackFmt p = logCallbackFmt[id];
va_copy(tmpargptr, argptr);
p(id, fmt, tmpargptr );
}
if (pLogStatus[id] & 2) {
if (pLogStatus[id] & 8) {
fprintf(stderr, "[%s] ", LogNames[id]);
vfprintf( stderr, fmt, argptr );
}
else {
fprintf(stdout, "[%s] ", LogNames[id]);
vfprintf( stdout, fmt, argptr );
}
}
va_end(argptr);
if (dofile)
fprintf(fp[id], "\n");
if (pLogStatus[id] & 2) {
if (pLogStatus[id] & 8) {
fprintf(stderr, "\n");
fflush(stderr);
} else {
fprintf(stdout, "\n");
fflush(stdout);
}
}
if(dofile)
fflush(fp[id]);
return true;
}
//write with Prefix and a VA_list
bool EQEMuLog::writePVA(LogIDs id, const char *prefix, const char *fmt, va_list argptr) {
if (!logFileValid) {
return false;
}
if (id >= MaxLogID) {
return false;
}
bool dofile = false;
if (pLogStatus[id] & 1) {
dofile = open(id);
}
if (!(dofile || pLogStatus[id] & 2)) {
return false;
}
LockMutex lock(&MLog[id]);
if (!logFileValid)
return false; //check again for threading race reasons (to avoid two mutexes)
time_t aclock;
struct tm *newtime;
time( &aclock ); /* Get time in seconds */
newtime = localtime( &aclock ); /* Convert time to struct */
va_list tmpargptr;
if (dofile) {
#ifndef NO_PIDLOG
fprintf(fp[id], "[%02d.%02d. - %02d:%02d:%02d] %s", newtime->tm_mon+1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec, prefix);
#else
fprintf(fp[id], "%04i [%02d.%02d. - %02d:%02d:%02d] %s", getpid(), newtime->tm_mon+1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec, prefix);
#endif
va_copy(tmpargptr, argptr);
vfprintf( fp[id], fmt, tmpargptr );
}
if(logCallbackPva[id]) {
msgCallbackPva p = logCallbackPva[id];
va_copy(tmpargptr, argptr);
p(id, prefix, fmt, tmpargptr );
}
if (pLogStatus[id] & 2) {
if (pLogStatus[id] & 8) {
fprintf(stderr, "[%s] %s", LogNames[id], prefix);
vfprintf( stderr, fmt, argptr );
}
else {
fprintf(stdout, "[%s] %s", LogNames[id], prefix);
vfprintf( stdout, fmt, argptr );
}
}
va_end(argptr);
if (dofile)
fprintf(fp[id], "\n");
if (pLogStatus[id] & 2) {
if (pLogStatus[id] & 8)
fprintf(stderr, "\n");
else
fprintf(stdout, "\n");
}
if(dofile)
fflush(fp[id]);
return true;
}
bool EQEMuLog::writebuf(LogIDs id, const char *buf, uint8 size, uint32 count) {
if (!logFileValid) {
return false;
}
if (id >= MaxLogID) {
return false;
}
bool dofile = false;
if (pLogStatus[id] & 1) {
dofile = open(id);
}
if (!(dofile || pLogStatus[id] & 2))
return false;
LockMutex lock(&MLog[id]);
if (!logFileValid)
return false; //check again for threading race reasons (to avoid two mutexes)
time_t aclock;
struct tm *newtime;
time( &aclock ); /* Get time in seconds */
newtime = localtime( &aclock ); /* Convert time to struct */
if (dofile)
#ifndef NO_PIDLOG
fprintf(fp[id], "[%02d.%02d. - %02d:%02d:%02d] ", newtime->tm_mon+1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec);
#else
fprintf(fp[id], "%04i [%02d.%02d. - %02d:%02d:%02d] ", getpid(), newtime->tm_mon+1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec);
#endif
if (dofile) {
fwrite(buf, size, count, fp[id]);
fprintf(fp[id], "\n");
}
if(logCallbackBuf[id]) {
msgCallbackBuf p = logCallbackBuf[id];
p(id, buf, size, count);
}
if (pLogStatus[id] & 2) {
if (pLogStatus[id] & 8) {
fprintf(stderr, "[%s] ", LogNames[id]);
fwrite(buf, size, count, stderr);
fprintf(stderr, "\n");
} else {
fprintf(stdout, "[%s] ", LogNames[id]);
fwrite(buf, size, count, stdout);
fprintf(stdout, "\n");
}
}
if(dofile)
fflush(fp[id]);
return true;
}
bool EQEMuLog::writeNTS(LogIDs id, bool dofile, const char *fmt, ...) {
va_list argptr, tmpargptr;
va_start(argptr, fmt);
if (dofile) {
va_copy(tmpargptr, argptr);
vfprintf( fp[id], fmt, tmpargptr );
}
if (pLogStatus[id] & 2) {
if (pLogStatus[id] & 8)
vfprintf( stderr, fmt, argptr );
else
vfprintf( stdout, fmt, argptr );
}
va_end(argptr);
return true;
};
bool EQEMuLog::Dump(LogIDs id, uint8* data, uint32 size, uint32 cols, uint32 skip) {
if (!logFileValid) {
#if EQDEBUG >= 10
std::cerr << "Error: Dump() from null pointer" << std::endl;
#endif
return false;
}
if (size == 0)
return true;
if (!LogFile)
return false;
if (id >= MaxLogID)
return false;
bool dofile = false;
if (pLogStatus[id] & 1) {
dofile = open(id);
}
if (!(dofile || pLogStatus[id] & 2))
return false;
LockMutex lock(&MLog[id]);
if (!logFileValid)
return false; //check again for threading race reasons (to avoid two mutexes)
write(id, "Dumping Packet: %i", size);
// Output as HEX
int beginningOfLineOffset = 0;
uint32 indexInData;
std::string asciiOutput;
for(indexInData=skip; indexInData<size; indexInData++) {
if ((indexInData-skip)%cols==0) {
if (indexInData != skip)
writeNTS(id, dofile, " | %s\n", asciiOutput.c_str());
writeNTS(id, dofile, "%4i: ", indexInData-skip);
asciiOutput.clear();
beginningOfLineOffset = 0;
}
else if ((indexInData-skip)%(cols/2) == 0) {
writeNTS(id, dofile, "- ");
}
writeNTS(id, dofile, "%02X ", (unsigned char)data[indexInData]);
if (data[indexInData] >= 32 && data[indexInData] < 127)
{
// According to http://msdn.microsoft.com/en-us/library/vstudio/ee404875(v=vs.100).aspx
// Visual Studio 2010 doesn't have std::to_string(int) but it does have the long long
// version.
asciiOutput.append(std::to_string((long long)data[indexInData]));
}
else
{
asciiOutput.append(".");
}
}
uint32 k = ((indexInData-skip)-1)%cols;
if (k < 8)
writeNTS(id, dofile, " ");
for (uint32 h = k+1; h < cols; h++) {
writeNTS(id, dofile, " ");
}
writeNTS(id, dofile, " | %s\n", asciiOutput.c_str());
if (dofile)
fflush(fp[id]);
return true;
}
void EQEMuLog::SetCallback(LogIDs id, msgCallbackFmt proc) {
if (!logFileValid)
return;
if (id >= MaxLogID) {
return;
}
logCallbackFmt[id] = proc;
}
void EQEMuLog::SetCallback(LogIDs id, msgCallbackBuf proc) {
if (!logFileValid)
return;
if (id >= MaxLogID) {
return;
}
logCallbackBuf[id] = proc;
}
void EQEMuLog::SetCallback(LogIDs id, msgCallbackPva proc) {
if (!logFileValid)
return;
if (id >= MaxLogID) {
return;
}
logCallbackPva[id] = proc;
}
void EQEMuLog::SetAllCallbacks(msgCallbackFmt proc) {
if (!logFileValid)
return;
int r;
for(r = Status; r < MaxLogID; r++) {
SetCallback((LogIDs)r, proc);
}
}
void EQEMuLog::SetAllCallbacks(msgCallbackBuf proc) {
if (!logFileValid)
return;
int r;
for(r = Status; r < MaxLogID; r++) {
SetCallback((LogIDs)r, proc);
}
}
void EQEMuLog::SetAllCallbacks(msgCallbackPva proc) {
if (!logFileValid)
return;
int r;
for(r = Status; r < MaxLogID; r++) {
SetCallback((LogIDs)r, proc);
}
}
-149
View File
@@ -1,149 +0,0 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Debug Levels
#ifndef EQDEBUG
#define EQDEBUG 1
#else
////// File/Console options
// 0 <= Quiet mode Errors to file Status and Normal ignored
// 1 >= Status and Normal to console, Errors to file
// 2 >= Status, Normal, and Error to console and logfile
// 3 >= Lite debug
// 4 >= Medium debug
// 5 >= Debug release (Anything higher is not recommended for regular use)
// 6 == (Reserved for special builds) Login opcode debug All packets dumped
// 7 == (Reserved for special builds) Chat Opcode debug All packets dumped
// 8 == (Reserved for special builds) World opcode debug All packets dumped
// 9 == (Reserved for special builds) Zone Opcode debug All packets dumped
// 10 >= More than you ever wanted to know
//
/////
// Add more below to reserve for file's functions ect.
/////
// Any setup code based on defines should go here
//
#endif
#if defined(_DEBUG) && defined(WIN32)
#ifndef _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#endif
#endif
#ifndef EQDEBUG_H
#define EQDEBUG_H
#ifndef _WINDOWS
#define DebugBreak() if(0) {}
#endif
#define _WINSOCKAPI_ //stupid windows, trying to fix the winsock2 vs. winsock issues
#if defined(WIN32) && ( defined(PACKETCOLLECTOR) || defined(COLLECTOR) )
// Packet Collector on win32 requires winsock.h due to latest pcap.h
// winsock.h must come before windows.h
#include <winsock.h>
#endif
#ifdef _WINDOWS
#include <windows.h>
#include <winsock2.h>
#endif
#include "logsys.h"
#include "../common/mutex.h"
#include <stdio.h>
#include <stdarg.h>
class EQEMuLog {
public:
EQEMuLog();
~EQEMuLog();
enum LogIDs {
Status = 0, /* This must stay the first entry in this list */
Normal, /* Normal Logs */
Error, /* Error Logs */
Debug, /* Debug Logs */
Quest, /* Quest Logs */
Commands, /* Issued Comamnds */
Crash, /* Crash Logs */
Save, /* Client Saves */
MaxLogID /* Max, used in functions to get the max log ID */
};
//these are callbacks called for each
typedef void (* msgCallbackBuf)(LogIDs id, const char *buf, uint8 size, uint32 count);
typedef void (* msgCallbackFmt)(LogIDs id, const char *fmt, va_list ap);
typedef void (* msgCallbackPva)(LogIDs id, const char *prefix, const char *fmt, va_list ap);
void SetAllCallbacks(msgCallbackFmt proc);
void SetAllCallbacks(msgCallbackBuf proc);
void SetAllCallbacks(msgCallbackPva proc);
void SetCallback(LogIDs id, msgCallbackFmt proc);
void SetCallback(LogIDs id, msgCallbackBuf proc);
void SetCallback(LogIDs id, msgCallbackPva proc);
bool writebuf(LogIDs id, const char *buf, uint8 size, uint32 count);
bool write(LogIDs id, const char *fmt, ...);
bool writePVA(LogIDs id, const char *prefix, const char *fmt, va_list args);
bool Dump(LogIDs id, uint8* data, uint32 size, uint32 cols=16, uint32 skip=0);
private:
bool open(LogIDs id);
bool writeNTS(LogIDs id, bool dofile, const char *fmt, ...); // no error checking, assumes is open, no locking, no timestamp, no newline
Mutex MOpen;
Mutex MLog[MaxLogID];
FILE* fp[MaxLogID];
/* LogStatus: bitwise variable
1 = output to file
2 = output to stdout
4 = fopen error, dont retry
8 = use stderr instead (2 must be set)
*/
uint8 pLogStatus[MaxLogID];
msgCallbackFmt logCallbackFmt[MaxLogID];
msgCallbackBuf logCallbackBuf[MaxLogID];
msgCallbackPva logCallbackPva[MaxLogID];
};
extern EQEMuLog* LogFile;
#ifdef _EQDEBUG
class PerformanceMonitor {
public:
PerformanceMonitor(int64* ip) {
p = ip;
QueryPerformanceCounter(&tmp);
}
~PerformanceMonitor() {
LARGE_INTEGER tmp2;
QueryPerformanceCounter(&tmp2);
*p += tmp2.QuadPart - tmp.QuadPart;
}
LARGE_INTEGER tmp;
int64* p;
};
#endif
#endif
+149
View File
@@ -0,0 +1,149 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "deity.h"
EQEmu::deity::DeityTypeBit EQEmu::deity::ConvertDeityTypeToDeityTypeBit(DeityType deity_type)
{
switch (deity_type) {
case DeityBertoxxulous:
return bit_DeityBertoxxulous;
case DeityBrellSirilis:
return bit_DeityBrellSirilis;
case DeityCazicThule:
return bit_DeityCazicThule;
case DeityErollisiMarr:
return bit_DeityErollisiMarr;
case DeityBristlebane:
return bit_DeityBristlebane;
case DeityInnoruuk:
return bit_DeityInnoruuk;
case DeityKarana:
return bit_DeityKarana;
case DeityMithanielMarr:
return bit_DeityMithanielMarr;
case DeityPrexus:
return bit_DeityPrexus;
case DeityQuellious:
return bit_DeityQuellious;
case DeityRallosZek:
return bit_DeityRallosZek;
case DeityRodcetNife:
return bit_DeityRodcetNife;
case DeitySolusekRo:
return bit_DeitySolusekRo;
case DeityTheTribunal:
return bit_DeityTheTribunal;
case DeityTunare:
return bit_DeityTunare;
case DeityVeeshan:
return bit_DeityVeeshan;
case DeityAgnostic_LB:
case DeityAgnostic:
return bit_DeityAgnostic;
default:
return bit_DeityAll;
};
}
EQEmu::deity::DeityType EQEmu::deity::ConvertDeityTypeBitToDeityType(DeityTypeBit deity_type_bit)
{
switch (deity_type_bit) {
case bit_DeityAgnostic:
return DeityAgnostic;
case bit_DeityBertoxxulous:
return DeityBertoxxulous;
case bit_DeityBrellSirilis:
return DeityBrellSirilis;
case bit_DeityCazicThule:
return DeityCazicThule;
case bit_DeityErollisiMarr:
return DeityErollisiMarr;
case bit_DeityBristlebane:
return DeityBristlebane;
case bit_DeityInnoruuk:
return DeityInnoruuk;
case bit_DeityKarana:
return DeityKarana;
case bit_DeityMithanielMarr:
return DeityMithanielMarr;
case bit_DeityPrexus:
return DeityPrexus;
case bit_DeityQuellious:
return DeityQuellious;
case bit_DeityRallosZek:
return DeityRallosZek;
case bit_DeityRodcetNife:
return DeityRodcetNife;
case bit_DeitySolusekRo:
return DeitySolusekRo;
case bit_DeityTheTribunal:
return DeityTheTribunal;
case bit_DeityTunare:
return DeityTunare;
case bit_DeityVeeshan:
return DeityVeeshan;
default:
return DeityUnknown;
};
}
const char* EQEmu::deity::DeityName(DeityType deity_type)
{
switch (deity_type) {
case DeityBertoxxulous:
return "Bertoxxulous";
case DeityBrellSirilis:
return "Brell Serilis";
case DeityCazicThule:
return "Cazic-Thule";
case DeityErollisiMarr:
return "Erollisi Marr";
case DeityBristlebane:
return "Bristlebane";
case DeityInnoruuk:
return "Innoruuk";
case DeityKarana:
return "Karana";
case DeityMithanielMarr:
return "Mithaniel Marr";
case DeityPrexus:
return "Prexus";
case DeityQuellious:
return "Quellious";
case DeityRallosZek:
return "Rallos Zek";
case DeityRodcetNife:
return "Rodcet Nife";
case DeitySolusekRo:
return "Solusek Ro";
case DeityTheTribunal:
return "The Tribunal";
case DeityTunare:
return "Tunare";
case DeityVeeshan:
return "Veeshan";
case DeityAgnostic_LB:
case DeityAgnostic:
return "Agnostic";
default:
return "Unknown";
};
}
+55 -141
View File
@@ -1,5 +1,6 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemu.org)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,154 +14,67 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef DEITY_H
#define DEITY_H
#ifndef COMMON_DEITY_H
#define COMMON_DEITY_H
#include "types.h"
#include <string>
// NOTE: This code is not fully implemented since there are no references in the existing code
/*
** Diety types
**
** (ref: eqstr_us.txt)
**
** (Another orphaned enumeration...)
*/
enum DeityTypes
namespace EQEmu
{
/*----*/ DeityUnknown = 0,
/*----*/ DeityAgnostic_LB = 140,
/*3251*/ DeityBertoxxulous = 201,
/*3262*/ DeityBrellSirilis,
/*3253*/ DeityCazicThule,
/*3256*/ DeityErollisiMarr,
/*3252*/ DeityBristlebane,
/*3254*/ DeityInnoruuk,
/*3255*/ DeityKarana,
/*3257*/ DeityMithanielMarr,
/*3259*/ DeityPrexus,
/*3260*/ DeityQuellious,
/*3266*/ DeityRallosZek,
/*3258*/ DeityRodcetNife,
/*3261*/ DeitySolusekRo,
/*3263*/ DeityTheTribunal,
/*3264*/ DeityTunare,
/*3265*/ DeityVeeshan,
/*3250*/ DeityAgnostic = 396
};
namespace deity {
enum DeityType {
DeityUnknown = 0,
DeityAgnostic_LB = 140,
DeityBertoxxulous = 201,
DeityBrellSirilis,
DeityCazicThule,
DeityErollisiMarr,
DeityBristlebane,
DeityInnoruuk,
DeityKarana,
DeityMithanielMarr,
DeityPrexus,
DeityQuellious,
DeityRallosZek,
DeityRodcetNife,
DeitySolusekRo,
DeityTheTribunal,
DeityTunare,
DeityVeeshan,
DeityAgnostic = 396
};
/*
** Deity type bits
**
** (New orphan, but make use of it!)
*/
enum DeityTypeBits : uint32
{
BIT_DeityAll = 0x00000000,
BIT_DeityAgnostic = 0x00000001,
BIT_DeityBertoxxulous = 0x00000002,
BIT_DeityBrellSirilis = 0x00000004,
BIT_DeityCazicThule = 0x00000008,
BIT_DeityErollisiMarr = 0x00000010,
BIT_DeityBristlebane = 0x00000020,
BIT_DeityInnoruuk = 0x00000040,
BIT_DeityKarana = 0x00000080,
BIT_DeityMithanielMarr = 0x00000100,
BIT_DeityPrexus = 0x00000200,
BIT_DeityQuellious = 0x00000400,
BIT_DeityRallosZek = 0x00000800,
BIT_DeityRodcetNife = 0x00001000,
BIT_DeitySolusekRo = 0x00002000,
BIT_DeityTheTribunal = 0x00004000,
BIT_DeityTunare = 0x00008000,
BIT_DeityVeeshan = 0x00010000
};
enum DeityTypeBit : uint32 {
bit_DeityAll = 0x00000000,
bit_DeityAgnostic = 0x00000001,
bit_DeityBertoxxulous = 0x00000002,
bit_DeityBrellSirilis = 0x00000004,
bit_DeityCazicThule = 0x00000008,
bit_DeityErollisiMarr = 0x00000010,
bit_DeityBristlebane = 0x00000020,
bit_DeityInnoruuk = 0x00000040,
bit_DeityKarana = 0x00000080,
bit_DeityMithanielMarr = 0x00000100,
bit_DeityPrexus = 0x00000200,
bit_DeityQuellious = 0x00000400,
bit_DeityRallosZek = 0x00000800,
bit_DeityRodcetNife = 0x00001000,
bit_DeitySolusekRo = 0x00002000,
bit_DeityTheTribunal = 0x00004000,
bit_DeityTunare = 0x00008000,
bit_DeityVeeshan = 0x00010000
};
static DeityTypeBits ConvertDeityToBitDeity(DeityTypes deity)
{
switch(deity)
{
case DeityBertoxxulous: { return BIT_DeityBertoxxulous; }
case DeityBrellSirilis: { return BIT_DeityBrellSirilis; }
case DeityCazicThule: { return BIT_DeityCazicThule; }
case DeityErollisiMarr: { return BIT_DeityErollisiMarr; }
case DeityBristlebane: { return BIT_DeityBristlebane; }
case DeityInnoruuk: { return BIT_DeityInnoruuk; }
case DeityKarana: { return BIT_DeityKarana; }
case DeityMithanielMarr: { return BIT_DeityMithanielMarr; }
case DeityPrexus: { return BIT_DeityPrexus; }
case DeityQuellious: { return BIT_DeityQuellious; }
case DeityRallosZek: { return BIT_DeityRallosZek; }
case DeityRodcetNife: { return BIT_DeityRodcetNife; }
case DeitySolusekRo: { return BIT_DeitySolusekRo; }
case DeityTheTribunal: { return BIT_DeityTheTribunal; }
case DeityTunare: { return BIT_DeityTunare; }
case DeityVeeshan: { return BIT_DeityVeeshan; }
case DeityAgnostic_LB:
case DeityAgnostic: { return BIT_DeityAgnostic; }
default: { break; }
};
extern DeityTypeBit ConvertDeityTypeToDeityTypeBit(DeityType deity_type);
extern DeityType ConvertDeityTypeBitToDeityType(DeityTypeBit deity_type_bit);
extern const char* DeityName(DeityType deity_type);
return BIT_DeityAll;
};
} /*deity*/
static DeityTypes ConvertBitDeityToDeity(DeityTypeBits deity_bit)
{
switch(deity_bit)
{
case BIT_DeityAgnostic: { return DeityAgnostic; }
case BIT_DeityBertoxxulous: { return DeityBertoxxulous; }
case BIT_DeityBrellSirilis: { return DeityBrellSirilis; }
case BIT_DeityCazicThule: { return DeityCazicThule; }
case BIT_DeityErollisiMarr: { return DeityErollisiMarr; }
case BIT_DeityBristlebane: { return DeityBristlebane; }
case BIT_DeityInnoruuk: { return DeityInnoruuk; }
case BIT_DeityKarana: { return DeityKarana; }
case BIT_DeityMithanielMarr: { return DeityMithanielMarr; }
case BIT_DeityPrexus: { return DeityPrexus; }
case BIT_DeityQuellious: { return DeityQuellious; }
case BIT_DeityRallosZek: { return DeityRallosZek; }
case BIT_DeityRodcetNife: { return DeityRodcetNife; }
case BIT_DeitySolusekRo: { return DeitySolusekRo; }
case BIT_DeityTheTribunal: { return DeityTheTribunal; }
case BIT_DeityTunare: { return DeityTunare; }
case BIT_DeityVeeshan: { return DeityVeeshan; }
default: { break; }
};
} /*EQEmu*/
return DeityUnknown;
};
static std::string GetDeityName(DeityTypes deity)
{
switch(deity)
{
case DeityBertoxxulous: { return "Bertoxxulous"; }
case DeityBrellSirilis: { return "Brell Serilis"; }
case DeityCazicThule: { return "Cazic-Thule"; }
case DeityErollisiMarr: { return "Erollisi Marr"; }
case DeityBristlebane: { return "Bristlebane"; }
case DeityInnoruuk: { return "Innoruuk"; }
case DeityKarana: { return "Karana"; }
case DeityMithanielMarr: { return "Mithaniel Marr"; }
case DeityPrexus: { return "Prexus"; }
case DeityQuellious: { return "Quellious"; }
case DeityRallosZek: { return "Rallos Zek"; }
case DeityRodcetNife: { return "Rodcet Nife"; }
case DeitySolusekRo: { return "Solusek Ro"; }
case DeityTheTribunal: { return "The Tribunal"; }
case DeityTunare: { return "Tunare"; }
case DeityVeeshan: { return "Veeshan"; }
case DeityAgnostic_LB:
case DeityAgnostic: { return "Agnostic"; }
default: { break; }
};
return "Unknown";
};
#endif
#endif /* COMMON_DEITY_H */
+20
View File
@@ -0,0 +1,20 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "emu_constants.h"
+52
View File
@@ -0,0 +1,52 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef COMMON_EMU_CONSTANTS_H
#define COMMON_EMU_CONSTANTS_H
#include "eq_limits.h"
#include "emu_legacy.h"
#include "inventory_version.h"
//#include "deity.h"
//#include "say_link.h"
#include <string>
namespace EQEmu
{
namespace inventory {
//using namespace RoF2::invtype;
//using namespace RoF2::invslot;
//using namespace RoF2::invbag;
//using namespace RoF2::invaug;
} /*inventory*/
namespace constants {
const EQEmu::versions::ClientVersion CharacterCreationClient = EQEmu::versions::ClientVersion::RoF2;
const size_t CharacterCreationMax = RoF2::constants::CharacterCreationLimit;
const size_t SayLinkBodySize = RoF2::constants::SayLinkBodySize;
} /*constants*/
} /*EQEmu*/
#endif /*COMMON_EMU_CONSTANTS_H*/
+20
View File
@@ -0,0 +1,20 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "emu_legacy.h"
+275
View File
@@ -0,0 +1,275 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef COMMON_EMU_LEGACY_H
#define COMMON_EMU_LEGACY_H
#include "types.h"
#include <stdlib.h>
namespace EQEmu
{
// this is for perl and other legacy systems
namespace legacy {
enum InventorySlot {
SLOT_CHARM = 0,
SLOT_EAR01 = 1,
SLOT_HEAD = 2,
SLOT_FACE = 3,
SLOT_EAR02 = 4,
SLOT_NECK = 5,
SLOT_SHOULDER = 6,
SLOT_ARMS = 7,
SLOT_BACK = 8,
SLOT_BRACER01 = 9,
SLOT_BRACER02 = 10,
SLOT_RANGE = 11,
SLOT_HANDS = 12,
SLOT_PRIMARY = 13,
SLOT_SECONDARY = 14,
SLOT_RING01 = 15,
SLOT_RING02 = 16,
SLOT_CHEST = 17,
SLOT_LEGS = 18,
SLOT_FEET = 19,
SLOT_WAIST = 20,
SLOT_POWER_SOURCE = 9999,
SLOT_AMMO = 21,
SLOT_GENERAL_1 = 22,
SLOT_GENERAL_2 = 23,
SLOT_GENERAL_3 = 24,
SLOT_GENERAL_4 = 25,
SLOT_GENERAL_5 = 26,
SLOT_GENERAL_6 = 27,
SLOT_GENERAL_7 = 28,
SLOT_GENERAL_8 = 29,
//SLOT_GENERAL_9 = not supported
//SLOT_GENERAL_10 = not supported
SLOT_CURSOR = 30,
SLOT_CURSOR_END = (int16)0xFFFE, // I hope no one is using this...
SLOT_TRADESKILL = 1000,
SLOT_AUGMENT = 1001,
SLOT_INVALID = (int16)0xFFFF,
SLOT_POSSESSIONS_BEGIN = 0,
SLOT_POSSESSIONS_END = 30,
SLOT_EQUIPMENT_BEGIN = 0,
SLOT_EQUIPMENT_END = 21,
SLOT_PERSONAL_BEGIN = 22,
SLOT_PERSONAL_END = 29,
SLOT_PERSONAL_BAGS_BEGIN = 251,
SLOT_PERSONAL_BAGS_END = 330,
SLOT_CURSOR_BAG_BEGIN = 331,
SLOT_CURSOR_BAG_END = 340,
SLOT_TRIBUTE_BEGIN = 400,
SLOT_TRIBUTE_END = 404,
SLOT_BANK_BEGIN = 2000,
SLOT_BANK_END = 2023,
SLOT_BANK_BAGS_BEGIN = 2031,
SLOT_BANK_BAGS_END = 2270,
SLOT_SHARED_BANK_BEGIN = 2500,
SLOT_SHARED_BANK_END = 2501,
SLOT_SHARED_BANK_BAGS_BEGIN = 2531,
SLOT_SHARED_BANK_BAGS_END = 2550,
SLOT_TRADE_BEGIN = 3000,
SLOT_TRADE_END = 3007,
SLOT_TRADE_BAGS_BEGIN = 3031,
SLOT_TRADE_BAGS_END = 3110,
SLOT_WORLD_BEGIN = 4000,
SLOT_WORLD_END = 4009
};
enum InventoryTypes : int16 {
TypePossessions = 0,
TypeBank,
TypeSharedBank,
TypeTrade,
TypeWorld,
TypeLimbo, // 5
TypeTribute,
TypeTrophyTribute,
TypeGuildTribute,
TypeMerchant,
TypeDeleted, // 10
TypeCorpse,
TypeBazaar,
TypeInspect,
TypeRealEstate,
TypeViewMODPC, // 15
TypeViewMODBank,
TypeViewMODSharedBank,
TypeViewMODLimbo,
TypeAltStorage,
TypeArchived, // 20
TypeMail,
TypeGuildTrophyTribute,
TypeKrono,
TypeOther,
TypeCount
};
enum PossessionsSlots : int16 {
SlotCharm = 0,
SlotEar1,
SlotHead,
SlotFace,
SlotEar2,
SlotNeck, // 5
SlotShoulders,
SlotArms,
SlotBack,
SlotWrist1,
SlotWrist2, // 10
SlotRange,
SlotHands,
SlotPrimary,
SlotSecondary,
SlotFinger1, // 15
SlotFinger2,
SlotChest,
SlotLegs,
SlotFeet,
SlotWaist, // 20
SlotPowerSource = 9999, // temp
SlotAmmo = 21, // temp
SlotGeneral1,
SlotGeneral2,
SlotGeneral3,
SlotGeneral4, // 25
SlotGeneral5,
SlotGeneral6,
SlotGeneral7,
SlotGeneral8,
//SlotGeneral9,
//SlotGeneral10,
SlotCursor, // 30
SlotCount
};
enum MaterialSlots : uint8 {
MaterialHead = 0,
MaterialChest,
MaterialArms,
MaterialWrist,
MaterialHands,
MaterialLegs, // 5
MaterialFeet,
MaterialPrimary,
MaterialSecondary,
MaterialCount,
MaterialInvalid = 255
};
// these are currently hard-coded for existing inventory system..do not use in place of special client version handlers until ready
static const uint16 TYPE_POSSESSIONS_SIZE = SlotCount;
static const uint16 TYPE_BANK_SIZE = 24;
static const uint16 TYPE_SHARED_BANK_SIZE = 2;
static const uint16 TYPE_TRADE_SIZE = 8;
static const uint16 TYPE_WORLD_SIZE = 10;
static const uint16 TYPE_LIMBO_SIZE = 36;
static const uint16 TYPE_TRIBUTE_SIZE = 5; // (need client values)
static const uint16 TYPE_TROPHY_TRIBUTE_SIZE = 0;
static const uint16 TYPE_GUILD_TRIBUTE_SIZE = 0;
static const uint16 TYPE_MERCHANT_SIZE = 0;
static const uint16 TYPE_DELETED_SIZE = 0;
static const uint16 TYPE_CORPSE_SIZE = SlotCount; // no bitmask use..limits to size of client corpse window (see EQLimits::InventoryMapSize(MapCorpse, <EQClientVersion))
static const uint16 TYPE_BAZAAR_SIZE = 80;
static const uint16 TYPE_INSPECT_SIZE = 22;
static const uint16 TYPE_REAL_ESTATE_SIZE = 0;
static const uint16 TYPE_VIEW_MOD_PC_SIZE = 0;//NOT_USED;
static const uint16 TYPE_VIEW_MOD_BANK_SIZE = 0;//NOT_USED;
static const uint16 TYPE_VIEW_MOD_SHARED_BANK_SIZE = 0;//NOT_USED;
static const uint16 TYPE_VIEW_MOD_LIMBO_SIZE = 0;//NOT_USED;
static const uint16 TYPE_ALT_STORAGE_SIZE = 0;
static const uint16 TYPE_ARCHIVED_SIZE = 0;
static const uint16 TYPE_MAIL_SIZE = 0;
static const uint16 TYPE_GUILD_TROPHY_TRIBUTE_SIZE = 0;
static const uint16 TYPE_KRONO_SIZE = 0;
static const uint16 TYPE_OTHER_SIZE = 0;
// most of these definitions will go away with the structure-based system..this maintains compatibility for now
// (these are mainly to assign specific values to constants used in conversions and to identify per-client ranges/offsets)
static const int16 EQUIPMENT_BEGIN = SlotCharm;
static const int16 EQUIPMENT_END = SlotAmmo;
static const uint16 EQUIPMENT_SIZE = 22; // does not account for 'Power Source' - used mainly for npc equipment arrays
static const int16 GENERAL_BEGIN = SlotGeneral1;
static const int16 GENERAL_END = SlotGeneral8;
static const uint16 GENERAL_SIZE = 8;
static const int16 GENERAL_BAGS_BEGIN = 251;
static const int16 GENERAL_BAGS_END_OFFSET = 79;
static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET;
static const int16 CURSOR_BAG_BEGIN = 331;
static const int16 CURSOR_BAG_END_OFFSET = 9;
static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET;
static const int16 BANK_BEGIN = 2000;
static const int16 BANK_END = 2023;
static const int16 BANK_BAGS_BEGIN = 2031;
static const int16 BANK_BAGS_END_OFFSET = 239;
static const int16 BANK_BAGS_END = BANK_BAGS_BEGIN + BANK_BAGS_END_OFFSET;
static const int16 SHARED_BANK_BEGIN = 2500;
static const int16 SHARED_BANK_END = 2501;
static const int16 SHARED_BANK_BAGS_BEGIN = 2531;
static const int16 SHARED_BANK_BAGS_END_OFFSET = 19;
static const int16 SHARED_BANK_BAGS_END = SHARED_BANK_BAGS_BEGIN + SHARED_BANK_BAGS_END_OFFSET;
static const int16 TRADE_BEGIN = 3000;
static const int16 TRADE_END = 3007;
static const int16 TRADE_NPC_END = 3003;
static const int16 TRADE_BAGS_BEGIN = 3031;
static const int16 TRADE_BAGS_END_OFFSET = 79;
static const int16 TRADE_BAGS_END = TRADE_BAGS_BEGIN + TRADE_BAGS_END_OFFSET;
static const int16 WORLD_BEGIN = 4000;
static const int16 WORLD_END = 4009;
static const int16 WORLD_SIZE = TYPE_WORLD_SIZE;
static const int16 TRIBUTE_BEGIN = 400;
static const int16 TRIBUTE_END = 404;
static const int16 TRIBUTE_SIZE = TYPE_TRIBUTE_SIZE;
static const int16 CORPSE_BEGIN = 22;
//static const int16 CORPSE_END = RoF::consts::CORPSE_END; // not ready for use
static const int16 MATERIAL_BEGIN = MaterialHead;
static const int16 MATERIAL_END = MaterialSecondary;
static const int16 MATERIAL_TINT_END = MaterialFeet;
static const int16 MATERIAL_SIZE = MaterialCount;
// items
// common and container sizes will not increase until the new 'location' struct is implemented
static const uint16 ITEM_COMMON_SIZE = 6;//RoF::consts::ITEM_COMMON_SIZE;
static const uint16 ITEM_CONTAINER_SIZE = 10;//Titanium::consts::ITEM_CONTAINER_SIZE;
// BANDOLIERS_SIZE sets maximum limit..active limit will need to be handled by the appropriate AA or spell (or item?)
static const size_t BANDOLIERS_SIZE = 20;//RoF2::consts::BANDOLIERS_SIZE; // number of bandolier instances
static const size_t BANDOLIER_ITEM_COUNT = 4;//RoF2::consts::BANDOLIER_ITEM_COUNT; // number of equipment slots in bandolier instance
// POTION_BELT_SIZE sets maximum limit..active limit will need to be handled by the appropriate AA or spell (or item?)
static const size_t POTION_BELT_ITEM_COUNT = 5;//RoF2::consts::POTION_BELT_ITEM_COUNT;
static const size_t TEXT_LINK_BODY_LENGTH = 56;//RoF2::consts::TEXT_LINK_BODY_LENGTH;
}
}
#endif /* COMMON_EMU_LEGACY_H */
+18
View File
@@ -0,0 +1,18 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+56
View File
@@ -0,0 +1,56 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef COMMON_EMU_LIMITS_H
#define COMMON_EMU_LIMITS_H
#include "types.h"
#include <stdlib.h>
namespace EntityLimits
{
namespace npc {
enum : int { Invalid = -1, Null, Safety };
enum : bool { False = false, True = true };
}
namespace merc {
enum : int { Invalid = -1, Null, Safety };
enum : bool { False = false, True = true };
}
namespace bot {
enum : int { Invalid = -1, Null, Safety };
enum : bool { False = false, True = true };
}
namespace pet {
enum : int { Invalid = -1, Null, Safety };
enum : bool { False = false, True = true };
}
}; /*EntityLimits*/
#endif /*COMMON_EMU_LIMITS_H*/
+1 -1
View File
@@ -16,7 +16,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 04111-1307 USA
*/
#include "debug.h"
#include "global_define.h"
#include "emu_opcodes.h"
const char *OpcodeNames[_maxEmuOpcode+1] = {
+10 -2
View File
@@ -74,7 +74,9 @@ N(OP_CharacterCreateRequest),
N(OP_CharInventory),
N(OP_Charm),
N(OP_ChatMessage),
N(OP_ClearAA),
N(OP_ClearBlockedBuffs),
N(OP_ClearLeadershipAbilities),
N(OP_ClearNPCMarks),
N(OP_ClearObject),
N(OP_ClearSurname),
@@ -162,6 +164,7 @@ N(OP_FinishTrade),
N(OP_FinishWindow),
N(OP_FinishWindow2),
N(OP_Fishing),
N(OP_Fling),
N(OP_FloatListThing),
N(OP_Forage),
N(OP_ForceFindPerson),
@@ -213,6 +216,7 @@ N(OP_GroupUpdate),
N(OP_GroupUpdateB),
N(OP_GroupUpdateLeaderAA),
N(OP_GuildBank),
N(OP_GuildBankItemList),
N(OP_GuildCreate),
N(OP_GuildDelete),
N(OP_GuildDemote),
@@ -346,6 +350,7 @@ N(OP_OpenTributeMaster),
N(OP_PDeletePetition),
N(OP_PetBuffWindow),
N(OP_PetCommands),
N(OP_PetHoTT),
N(OP_Petition),
N(OP_PetitionBug),
N(OP_PetitionCheckIn),
@@ -362,6 +367,8 @@ N(OP_PetitionUnCheckout),
N(OP_PetitionUpdate),
N(OP_PickPocket),
N(OP_PlayerProfile),
N(OP_PlayerStateAdd),
N(OP_PlayerStateRemove),
N(OP_PlayEverquestRequest),
N(OP_PlayEverquestResponse),
N(OP_PlayMP3),
@@ -517,8 +524,6 @@ N(OP_VetRewardsAvaliable),
N(OP_VoiceMacroIn),
N(OP_VoiceMacroOut),
N(OP_WeaponEquip1),
N(OP_WeaponEquip2),
N(OP_WeaponUnequip2),
N(OP_WearChange),
N(OP_Weather),
N(OP_Weblink),
@@ -532,6 +537,8 @@ N(OP_WorldLogout),
N(OP_WorldObjectsSent),
N(OP_WorldUnknown001),
N(OP_XTargetAutoAddHaters),
N(OP_XTargetOpen),
N(OP_XTargetOpenResponse),
N(OP_XTargetRequest),
N(OP_XTargetResponse),
N(OP_YellForHelp),
@@ -545,4 +552,5 @@ N(OP_ZoneServerInfo),
N(OP_ZoneServerReady),
N(OP_ZoneSpawns),
N(OP_ZoneUnavail),
N(OP_ResetAA),
// mail and chat opcodes located in ../mail_oplist.h
+21 -23
View File
@@ -23,17 +23,14 @@ crap into its own subclass of this object, it will clean things up
tremendously.
*/
#include "../common/debug.h"
#include "../common/global_define.h"
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <iomanip>
#include "emu_tcp_connection.h"
#include "emu_tcp_server.h"
#include "../common/servertalk.h"
#include "../common/packet_dump.h"
#ifdef FREEBSD //Timothy Whitman - January 7, 2003
#define MSG_NOSIGNAL 0
@@ -107,7 +104,7 @@ EmuTCPConnection::EmuTCPConnection(uint32 ID, EmuTCPServer* iServer, EmuTCPConne
RelayCount = 0;
RemoteID = iRemoteID;
pOldFormat = false;
ConnectionType = Incomming;
ConnectionType = Incoming;
TCPMode = modePacket;
PacketMode = packetModeZone;
#if TCPN_DEBUG_Memory >= 7
@@ -459,21 +456,21 @@ void EmuTCPConnection::SendNetErrorPacket(const char* reason) {
std::cout << reason;
std::cout << "': " << inet_ntoa(in) << ":" << GetPort() << std::endl;
#endif
ServerPacket* pack = new ServerPacket(0);
pack->size = 1;
if (reason)
pack->size += strlen(reason) + 1;
pack->pBuffer = new uchar[pack->size];
memset(pack->pBuffer, 0, pack->size);
pack->pBuffer[0] = 255;
strcpy((char*) &pack->pBuffer[1], reason);
SendPacket(pack);
safe_delete(pack);
auto pack = new ServerPacket(0);
pack->size = 1;
if (reason)
pack->size += strlen(reason) + 1;
pack->pBuffer = new uchar[pack->size];
memset(pack->pBuffer, 0, pack->size);
pack->pBuffer[0] = 255;
strcpy((char *)&pack->pBuffer[1], reason);
SendPacket(pack);
safe_delete(pack);
}
void EmuTCPConnection::RemoveRelay(EmuTCPConnection* relay, bool iSendRelayDisconnect) {
if (iSendRelayDisconnect) {
ServerPacket* pack = new ServerPacket(0, 5);
auto pack = new ServerPacket(0, 5);
pack->pBuffer[0] = 3;
*((uint32*) &pack->pBuffer[1]) = relay->GetRemoteID();
SendPacket(pack);
@@ -612,7 +609,7 @@ bool EmuTCPConnection::ProcessReceivedDataAsPackets(char* errbuf) {
if (base >= recvbuf_used) {
safe_delete_array(recvbuf);
} else {
uchar* tmpbuf = new uchar[recvbuf_size - base];
auto tmpbuf = new uchar[recvbuf_size - base];
memcpy(tmpbuf, &recvbuf[base], recvbuf_used - base);
safe_delete_array(recvbuf);
recvbuf = tmpbuf;
@@ -686,7 +683,7 @@ bool EmuTCPConnection::ProcessReceivedDataAsOldPackets(char* errbuf) {
safe_delete_array(recvbuf);
}
else {
uchar* tmpbuf = new uchar[recvbuf_size - base];
auto tmpbuf = new uchar[recvbuf_size - base];
memcpy(tmpbuf, &recvbuf[base], recvbuf_used - base);
safe_delete_array(recvbuf);
recvbuf = tmpbuf;
@@ -717,7 +714,7 @@ void EmuTCPConnection::ProcessNetworkLayerPacket(ServerPacket* pack) {
SendNetErrorPacket("Switch to RelayServer mode by a Relay Client");
break;
}
if (ConnectionType != Incomming) {
if (ConnectionType != Incoming) {
SendNetErrorPacket("Switch to RelayServer mode on outgoing connection");
break;
}
@@ -738,11 +735,12 @@ void EmuTCPConnection::ProcessNetworkLayerPacket(ServerPacket* pack) {
SendNetErrorPacket("New RelayClient: wrong size, expected 11");
break;
}
if (ConnectionType != Incomming) {
if (ConnectionType != Incoming) {
SendNetErrorPacket("New RelayClient: illegal on outgoing connection");
break;
}
EmuTCPConnection* con = new EmuTCPConnection(Server->GetNextID(), Server, this, *((uint32*) data), *((uint32*) &data[4]), *((uint16*) &data[8]));
auto con = new EmuTCPConnection(Server->GetNextID(), Server, this, *((uint32 *)data),
*((uint32 *)&data[4]), *((uint16 *)&data[8]));
Server->AddConnection(con);
RelayCount++;
break;
@@ -758,7 +756,7 @@ void EmuTCPConnection::ProcessNetworkLayerPacket(ServerPacket* pack) {
}
EmuTCPConnection* con = Server->FindConnection(*((uint32*)data));
if (con) {
if (ConnectionType == Incomming) {
if (ConnectionType == Incoming) {
if (con->GetRelayLink() != this) {
SendNetErrorPacket("Delete RelayClient: RelayLink != this");
break;
@@ -790,7 +788,7 @@ bool EmuTCPConnection::SendData(bool &sent_something, char* errbuf) {
if(sent_something)
keepalive_timer.Start();
else if (TCPMode == modePacket && keepalive_timer.Check()) {
ServerPacket* pack = new ServerPacket(0, 0);
auto pack = new ServerPacket(0, 0);
SendPacket(pack);
safe_delete(pack);
#if TCPN_DEBUG >= 5
+1
View File
@@ -26,6 +26,7 @@
struct SPackSendQueue;
class EmuTCPServer;
class ServerPacket;
class EmuTCPConnection : public TCPConnection {
public:
+2 -2
View File
@@ -1,4 +1,4 @@
#include "debug.h"
#include "global_define.h"
#include "emu_tcp_server.h"
#include "emu_tcp_connection.h"
@@ -24,7 +24,7 @@ void EmuTCPServer::Process() {
void EmuTCPServer::CreateNewConnection(uint32 ID, SOCKET in_socket, uint32 irIP, uint16 irPort)
{
EmuTCPConnection *conn = new EmuTCPConnection(ID, this, in_socket, irIP, irPort, pOldFormat);
auto conn = new EmuTCPConnection(ID, this, in_socket, irIP, irPort, pOldFormat);
AddConnection(conn);
}
+83 -547
View File
@@ -1,5 +1,6 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2003 EQEMu Development Team (http://eqemulator.net)
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,361 +14,59 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef EQ_CONSTANTS_H
#define EQ_CONSTANTS_H
#ifndef COMMON_EQ_CONSTANTS_H
#define COMMON_EQ_CONSTANTS_H
#include "skills.h"
#include "types.h"
/*
** Item attributes
**
** (There are no grepwin hits other than these declarations... Do they have a use?)
*/
enum ItemAttributes : uint32
{
ItemAttrNone = 0x00000000,
ItemAttrLore = 0x00000001,
ItemAttrArtifact = 0x00000002,
ItemAttrSummoned = 0x00000004,
ItemAttrMagic = 0x00000008,
ItemAttrAugment = 0x00000010,
ItemAttrPendingLore = 0x00000020,
ItemAttrUnknown = 0xFFFFFFFF
};
/*
** Item class types
**
*/
enum ItemClassTypes
{
ItemClassCommon = 0,
ItemClassContainer,
ItemClassBook,
_ItemClassCount
};
//SpawnAppearance types: (compared two clients for server-originating types: SoF & RoF2)
#define AT_Die 0 // this causes the client to keel over and zone to bind point (default action)
#define AT_WhoLevel 1 // the level that shows up on /who
//#define AT_2 2 // unknown
#define AT_Invis 3 // 0 = visible, 1 = invisible
#define AT_PVP 4 // 0 = blue, 1 = pvp (red)
#define AT_Light 5 // light type emitted by player (lightstone, shiny shield)
#define AT_Anim 14 // 100=standing, 110=sitting, 111=ducking, 115=feigned, 105=looting
#define AT_Sneak 15 // 0 = normal, 1 = sneaking
#define AT_SpawnID 16 // server to client, sets player spawn id
#define AT_HP 17 // Client->Server, my HP has changed (like regen tic)
#define AT_Linkdead 18 // 0 = normal, 1 = linkdead
#define AT_Levitate 19 // 0=off, 1=flymode, 2=levitate
#define AT_GM 20 // 0 = normal, 1 = GM - all odd numbers seem to make it GM
#define AT_Anon 21 // 0 = normal, 1 = anon, 2 = roleplay
#define AT_GuildID 22
#define AT_GuildRank 23 // 0=member, 1=officer, 2=leader
#define AT_AFK 24 // 0 = normal, 1 = afk
#define AT_Pet 25 // Param is EntityID of owner, or 0 for when charm breaks
//#define AT_27 27 // unknown
#define AT_Split 28 // 0 = normal, 1 = autosplit on (not showing in SoF+) (client-to-server only)
#define AT_Size 29 // spawn's size (present: SoF, absent: RoF2)
//#define AT_30 30 // unknown
#define AT_NPCName 31 // change PC's name's color to NPC color 0 = normal, 1 = npc name
//#define AT_32 32 // unknown
//#define AT_33 33 // unknown
//#define AT_34 34 // unknown (present: SoF, absent: RoF2)
//#define AT_35 35 // unknown
//#define AT_36 36 // unknown
//#define AT_37 37 // unknown
//#define AT_38 38 // unknown
//#define AT_39 39 // unknown
#define AT_ShowHelm 43 // 0 = hide graphic, 1 = show graphic
#define AT_DamageState 44 // The damage state of a destructible object (0 through 4)
//#define AT_46 46 // unknown
//#define AT_48 48 // unknown
//#define AT_49 49 // unknown
//#define AT_52 52 // (absent: SoF, present: RoF2) (not a replacement for RoF absent 29 or 34)
//#define AT_53 53 // (absent: SoF, present: RoF2) (not a replacement for RoF absent 29 or 34)
/*
** Item use types
**
** (ref: database and eqstr_us.txt)
**
** (Looking at a recent database, it's possible that some of the item values may be off [10-27-2013] -U)
*/
enum ItemUseTypes : uint8
{
/*9138*/ ItemType1HSlash = 0,
/*9141*/ ItemType2HSlash,
/*9140*/ ItemType1HPiercing,
/*9139*/ ItemType1HBlunt,
/*9142*/ ItemType2HBlunt,
/*5504*/ ItemTypeBow,
/*----*/ ItemTypeUnknown1,
/*----*/ ItemTypeLargeThrowing,
/*5505*/ ItemTypeShield,
/*5506*/ ItemTypeScroll,
/*5507*/ ItemTypeArmor,
/*5508*/ ItemTypeMisc, // a lot of random crap has this item use.
/*7564*/ ItemTypeLockPick,
/*----*/ ItemTypeUnknown2,
/*5509*/ ItemTypeFood,
/*5510*/ ItemTypeDrink,
/*5511*/ ItemTypeLight,
/*5512*/ ItemTypeCombinable, // not all stackable items are this use...
/*5513*/ ItemTypeBandage,
/*----*/ ItemTypeSmallThrowing,
/*----*/ ItemTypeSpell, // spells and tomes
/*5514*/ ItemTypePotion,
/*----*/ ItemTypeUnknown3,
/*0406*/ ItemTypeWindInstrument,
/*0407*/ ItemTypeStringedInstrument,
/*0408*/ ItemTypeBrassInstrument,
/*0405*/ ItemTypePercussionInstrument,
/*5515*/ ItemTypeArrow,
/*----*/ ItemTypeUnknown4,
/*5521*/ ItemTypeJewelry,
/*----*/ ItemTypeSkull,
/*5516*/ ItemTypeBook, // skill-up tomes/books? (would probably need a pp flag if true...)
/*5517*/ ItemTypeNote,
/*5518*/ ItemTypeKey,
/*----*/ ItemTypeCoin,
/*5520*/ ItemType2HPiercing,
/*----*/ ItemTypeFishingPole,
/*----*/ ItemTypeFishingBait,
/*5519*/ ItemTypeAlcohol,
/*----*/ ItemTypeKey2, // keys and satchels?? (questable keys?)
/*----*/ ItemTypeCompass,
/*----*/ ItemTypeUnknown5,
/*----*/ ItemTypePoison, // might be wrong, but includes poisons
/*----*/ ItemTypeUnknown6,
/*----*/ ItemTypeUnknown7,
/*5522*/ ItemTypeMartial,
/*----*/ ItemTypeUnknown8,
/*----*/ ItemTypeUnknown9,
/*----*/ ItemTypeUnknown10,
/*----*/ ItemTypeUnknown11,
/*----*/ ItemTypeSinging,
/*5750*/ ItemTypeAllInstrumentTypes,
/*5776*/ ItemTypeCharm,
/*----*/ ItemTypeDye,
/*----*/ ItemTypeAugmentation,
/*----*/ ItemTypeAugmentationSolvent,
/*----*/ ItemTypeAugmentationDistiller,
/*----*/ ItemTypeUnknown12,
/*----*/ ItemTypeFellowshipKit,
/*----*/ ItemTypeUnknown13,
/*----*/ ItemTypeRecipe,
/*----*/ ItemTypeAdvancedRecipe,
/*----*/ ItemTypeJournal, // only one(1) database entry
/*----*/ ItemTypeAltCurrency, // alt-currency (as opposed to coinage)
/*5881*/ ItemTypePerfectedAugmentationDistiller,
/*----*/ _ItemTypeCount
//#define AT_Trader 300 // Bazaar Trader Mode (not present in SoF or RoF2)
/*
Unknowns:
Mounts?
Ornamentations?
GuildBanners?
Collectible?
Placeable?
(others?)
*/
};
/*
** Augmentation use type bitmasks (1-based)
**
** (ref: dbstr_us.txt)
**
*/
enum AugmentationUseTypeBitmasks : uint32 {
AugUseNone = 0x00000000,
AugUseGeneralSingleStat = 0x00000001, /*1^16^1 (General: Single Stat)^0*/
AugUseGeneralMultipleStat = 0x00000002, /*2^16^2 (General: Multiple Stat)^0*/
AugUseGeneralSpellEffect = 0x00000004, /*3^16^3 (General: Spell Effect)^0*/
AugUseWeaponGeneral = 0x00000008, /*4^16^4 (Weapon: General)^0*/
AugUseWeaponElemDamage = 0x00000010, /*5^16^5 (Weapon: Elem Damage)^0*/
AugUseWeaponBaseDamage = 0x00000020, /*6^16^6 (Weapon: Base Damage)^0*/
AugUseGeneralGroup = 0x00000040, /*7^16^7 (General: Group)^0*/
AugUseGeneralRaid = 0x00000080, /*8^16^8 (General: Raid)^0*/
AugUseGeneralDragonsPoints = 0x00000100, /*9^16^9 (General: Dragons Points)^0*/
AugUseCraftedCommon = 0x00000200, /*10^16^10 (Crafted: Common)^0*/
AugUseCraftedGroup1 = 0x00000400, /*11^16^11 (Crafted: Group)^0*/
AugUseCraftedRaid1 = 0x00000800, /*12^16^12 (Crafted: Raid)^0*/
AugUseEnergeiacGroup = 0x00001000, /*13^16^13 (Energeiac: Group)^0*/
AugUseEnergeiacRaid = 0x00002000, /*14^16^14 (Energeiac: Raid)^0*/
AugUseEmblem = 0x00004000, /*15^16^15 (Emblem)^0*/
AugUseCraftedGroup2 = 0x00008000, /*16^16^16 (Crafted: Group)^0*/
AugUseCraftedRaid2 = 0x00010000, /*17^16^17 (Crafted: Raid)^0*/
AugUseUnknown1 = 0x00020000, /*18^16^18^0*/
AugUseUnknown2 = 0x00040000, /*19^16^19^0*/
AugUseOrnamentation = 0x00080000, /*20^16^20 (Ornamentation)^0*/
AugUseSpecialOrnamentation = 0x00100000, /*21^16^21 (Special Ornamentation)^0*/
AugUseUnknown3 = 0x00200000, /*22^16^22^0*/
AugUseUnknown4 = 0x00400000, /*23^16^23^0*/
AugUseUnknown5 = 0x00800000, /*24^16^24^0*/
AugUseUnknown6 = 0x01000000, /*25^16^25^0*/
AugUseUnknown7 = 0x02000000, /*26^16^26^0*/
AugUseUnknown8 = 0x04000000, /*27^16^27^0*/
AugUseUnknown9 = 0x08000000, /*28^16^28^0*/
AugUseUnknown10 = 0x10000000, /*29^16^29^0*/
AugUseEpic25 = 0x20000000, /*30^16^30^0*/
AugUseTest = 0x40000000, /*31^16^Test^0*/ // listed as 31^16^31^0 in 5-10 client
AugUseAll = 0xFFFFFFFF
};
/*
** Augmentation use types (enumerated)
**
*/
enum AugmentationUseTypes : uint8 {
AugTypeNone = 0,
AugTypeGeneralSingleStat,
AugTypeGeneralMultipleStat,
AugTypeGeneralSpellEffect,
AugTypeWeaponGeneral,
AugTypeWeaponElemDamage,
AugTypeWeaponBaseDamage,
AugTypeGeneralGroup,
AugTypeGeneralRaid,
AugTypeGeneralDragonsPoints,
AugTypeCraftedCommon,
AugTypeCraftedGroup1,
AugTypeCraftedRaid1,
AugTypeEnergeiacGroup,
AugTypeEnergeiacRaid,
AugTypeEmblem,
AugTypeCraftedGroup2,
AugTypeCraftedRaid2,
AugTypeUnknown1,
AugTypeUnknown2,
AugTypeOrnamentation,
AugTypeSpecialOrnamentation,
AugTypeUnknown3,
AugTypeUnknown4,
AugTypeUnknown5,
AugTypeUnknown6,
AugTypeUnknown7,
AugTypeUnknown8,
AugTypeUnknown9,
AugTypeUnknown10,
AugTypeEpic25,
AugTypeTest,
_AugTypeCount,
AugTypeAll = 255
};
/*
** Augmentation restriction types (in-work)
**
** (ref: eqstr_us.txt)
**
*/
enum AugmentationRestrictionTypes : uint8 {
/*4690*/ AugRestrAny = 0,
/*9134*/ AugRestrArmor,
/*9135*/ AugRestrWeapons,
/*9136*/ AugRestr1HWeapons,
/*9137*/ AugRestr2HWeapons,
/*9138*/ AugRestr1HSlash,
/*9139*/ AugRestr1HBlunt,
/*9140*/ AugRestrPiercing,
/*9148*/ AugRestrHandToHand,
/*9141*/ AugRestr2HSlash,
/*9142*/ AugRestr2HBlunt,
/*9143*/ AugRestr2HPierce,
/*9144*/ AugRestrBows,
/*9145*/ AugRestrShields,
/*8052*/ AugRestr1HSlash1HBluntOrHandToHand,
/*9200*/ AugRestr1HBluntOrHandToHand, // no listed peq entries
// these three appear to be post-RoF (12-10-2012) and can not be verified until RoF (05-10-2013) is supported
/*????*/ AugRestrUnknown1,
/*????*/ AugRestrUnknown2,
/*????*/ AugRestrUnknown3, // last value in peq entries
_AugRestrCount
/*4687*/ //AugTypeAllItems, // ?? unknown atm
/*4688*/ //AugTypePrestige, // ?? unknown atm
/*4689*/ //AugTypeNonPrestige, // ?? unknown atm
};
/*
** Container use types
**
** This correlates to world 'object.type' (object.h/Object.cpp) as well as Item_Struct.BagType
**
** (ref: database, web forums and eqstr_us.txt)
*/
enum ContainerUseTypes : uint8
{
/*3400*/ BagTypeSmallBag = 0,
/*3401*/ BagTypeLargeBag,
/*3402*/ BagTypeQuiver,
/*3403*/ BagTypeBeltPouch,
/*3404*/ BagTypeWristPouch,
/*3405*/ BagTypeBackPack,
/*3406*/ BagTypeSmallChest,
/*3407*/ BagTypeLargeChest,
/*----*/ BagTypeBandolier, // <*Database Reference Only>
/*3408*/ BagTypeMedicineBag,
/*3409*/ BagTypeToolBox,
/*3410*/ BagTypeLexicon,
/*3411*/ BagTypeMortar,
/*3412*/ BagTypeSelfDusting, // Quest container (Auto-clear contents?)
/*3413*/ BagTypeMixingBowl,
/*3414*/ BagTypeOven,
/*3415*/ BagTypeSewingKit,
/*3416*/ BagTypeForge,
/*3417*/ BagTypeFletchingKit,
/*3418*/ BagTypeBrewBarrel,
/*3419*/ BagTypeJewelersKit,
/*3420*/ BagTypePotteryWheel,
/*3421*/ BagTypeKiln,
/*3422*/ BagTypeKeymaker, // (no database entries as of peq rev 69)
/*3423*/ BagTypeWizardsLexicon,
/*3424*/ BagTypeMagesLexicon,
/*3425*/ BagTypeNecromancersLexicon,
/*3426*/ BagTypeEnchantersLexicon,
/*----*/ BagTypeUnknown1, // (a coin pouch/purse?) (no database entries as of peq rev 69)
/*----*/ BagTypeConcordanceofResearch, // <*Database Reference Only>
/*3427*/ BagTypeAlwaysWorks, // Quest container (Never-fail combines?)
/*3428*/ BagTypeKoadaDalForge, // High Elf
/*3429*/ BagTypeTeirDalForge, // Dark Elf
/*3430*/ BagTypeOggokForge, // Ogre
/*3431*/ BagTypeStormguardForge, // Dwarf
/*3432*/ BagTypeAkanonForge, // Gnome
/*3433*/ BagTypeNorthmanForge, // Barbarian
/*----*/ BagTypeUnknown2, // (no database entries as of peq rev 69)
/*3434*/ BagTypeCabilisForge, // Iksar
/*3435*/ BagTypeFreeportForge, // Human 1
/*3436*/ BagTypeRoyalQeynosForge, // Human 2
/*3439*/ BagTypeHalflingTailoringKit,
/*3438*/ BagTypeErudTailoringKit,
/*3440*/ BagTypeFierDalTailoringKit, // Wood Elf
/*3441*/ BagTypeFierDalFletchingKit, // Wood Elf
/*3437*/ BagTypeIksarPotteryWheel,
/*3442*/ BagTypeTackleBox,
/*3443*/ BagTypeTrollForge,
/*3445*/ BagTypeFierDalForge, // Wood Elf
/*3444*/ BagTypeValeForge, // Halfling
/*3446*/ BagTypeErudForge,
/*----*/ BagTypeTradersSatchel, // <*Database Reference Only> (db: Yellow Trader's Satchel Token?)
/*5785*/ BagTypeGuktaForge, // Froglok (no database entries as of peq rev 69)
/*3359*/ BagTypeAugmentationSealer,
/*----*/ BagTypeIceCreamChurn, // <*Database Reference Only>
/*6325*/ BagTypeTransformationmold, // Ornamentation
/*6340*/ BagTypeDetransformationmold, // Ornamentation Stripper
/*5400*/ BagTypeUnattuner,
/*7684*/ BagTypeTradeskillBag,
/*7692*/ BagTypeCollectibleBag,
/*----*/ _BagTypeCount
};
/*
** Item Effect Types
**
*/
enum {
ET_CombatProc = 0,
ET_ClickEffect = 1,
ET_WornEffect = 2,
ET_Expendable = 3,
ET_EquipClick = 4,
ET_ClickEffect2 = 5, //name unknown
ET_Focus = 6,
ET_Scroll = 7
};
//SpawnAppearance types:
#define AT_Die 0 // this causes the client to keel over and zone to bind point
#define AT_WhoLevel 1 // the level that shows up on /who
#define AT_Invis 3 // 0 = visible, 1 = invisible
#define AT_PVP 4 // 0 = blue, 1 = pvp (red)
#define AT_Light 5 // light type emitted by player (lightstone, shiny shield)
#define AT_Anim 14 // 100=standing, 110=sitting, 111=ducking, 115=feigned, 105=looting
#define AT_Sneak 15 // 0 = normal, 1 = sneaking
#define AT_SpawnID 16 // server to client, sets player spawn id
#define AT_HP 17 // Client->Server, my HP has changed (like regen tic)
#define AT_Linkdead 18 // 0 = normal, 1 = linkdead
#define AT_Levitate 19 // 0=off, 1=flymode, 2=levitate
#define AT_GM 20 // 0 = normal, 1 = GM - all odd numbers seem to make it GM
#define AT_Anon 21 // 0 = normal, 1 = anon, 2 = roleplay
#define AT_GuildID 22
#define AT_GuildRank 23 // 0=member, 1=officer, 2=leader
#define AT_AFK 24 // 0 = normal, 1 = afk
#define AT_Pet 25 // Param is EntityID of owner, or 0 for when charm breaks
#define AT_Split 28 // 0 = normal, 1 = autosplit on
#define AT_Size 29 // spawn's size
#define AT_NPCName 31 // change PC's name's color to NPC color 0 = normal, 1 = npc name
#define AT_ShowHelm 43 // 0 = do not show helmet graphic, 1 = show graphic
#define AT_DamageState 44 // The damage state of a destructible object (0 through 4)
//#define AT_Trader 300 // Bazzar Trader Mode
// solar: animations for AT_Anim
// animations for AT_Anim
#define ANIM_FREEZE 102
#define ANIM_STAND 0x64
#define ANIM_SIT 0x6e
@@ -471,15 +170,40 @@ typedef enum {
#define MT_StrikeThrough 339
#define MT_Stun 340
// TODO: Really should combine above and below into one
//from showeq
enum ChatColor
{
/*
CC_Default = 0,
CC_DarkGrey = 1,
CC_DarkGreen = 2,
CC_DarkBlue = 3,
CC_Purple = 5,
CC_LightGrey = 6,
*/
CC_WhiteSmoke = 0, // FF|F0F0F0
CC_Green = 2, // FF|008000
CC_BrightBlue = 3, // FF|0040FF
CC_Magenta = 5, // FF|F000F0
CC_Gray = 6, // FF|808080
CC_LightGray = 7, // FF|E0E0E0
//CC_WhiteSmoke2 = 10, // FF|F0F0F0
CC_DarkGray = 12, // FF|A0A0A0
CC_Red = 13, // FF|F00000
CC_Lime = 14, // FF|00F000
CC_Yellow = 15, // FF|F0F000
CC_Blue = 16, // FF|0000F0
CC_LightNavy = 17, // FF|0000AF
CC_Cyan = 18, // FF|00F0F0
CC_Black = 20, // FF|000000
// any index <= 255 that is not defined above
CC_DimGray = 1, // FF|606060
CC_Default = 1,
CC_User_Say = 256,
CC_User_Tell = 257,
CC_User_Group = 258,
@@ -675,7 +399,7 @@ static const uint8 DamageTypeUnknown = 0xFF;
**
** (indexed by 'Skill' of SkillUseTypes)
*/
static const uint8 SkillDamageTypes[HIGHEST_SKILL + 1] = // change to _SkillServerArraySize once activated
static const uint8 SkillDamageTypes[EQEmu::skills::HIGHEST_SKILL + 1] = // change to _SkillServerArraySize once activated
{
/*1HBlunt*/ 0,
/*1HSlashing*/ 1,
@@ -751,29 +475,10 @@ static const uint8 SkillDamageTypes[HIGHEST_SKILL + 1] = // change to _SkillServ
/*Intimidation*/ DamageTypeUnknown,
/*Berserking*/ DamageTypeUnknown,
/*Taunt*/ DamageTypeUnknown,
/*Frenzy*/ 74 //,
// /*RemoveTrap*/ DamageTypeUnknown, // Needs research (set for SenseTrap value)
// /*TripleAttack*/ DamageTypeUnknown, // Needs research (set for DoubleAttack value)
// /*2HPiercing*/ 36 // Needs research (set for 1HPiercing value - similar to slash/blunt)
};
/*
** Material use slots
**
*/
enum MaterialUseSlots : uint8
{
MaterialHead = 0,
MaterialChest,
MaterialArms,
MaterialWrist,
MaterialHands,
MaterialLegs,
MaterialFeet,
MaterialPrimary,
MaterialSecondary,
_MaterialCount,
_MaterialInvalid = 255
/*Frenzy*/ 74,
/*RemoveTrap*/ DamageTypeUnknown, // Needs research (set for SenseTrap value)
/*TripleAttack*/ DamageTypeUnknown, // Needs research (set for DoubleAttack value)
/*2HPiercing*/ 36 // Needs research (set for 1HPiercing value - similar to slash/blunt)
};
/*
@@ -810,186 +515,17 @@ enum MaterialUseSlots : uint8
**
*/
enum InventoryMapTypes : int16 {
MapPossessions = 0,
MapBank,
MapSharedBank,
MapTrade,
MapWorld,
MapLimbo,
MapTribute,
MapTrophyTribute,
MapGuildTribute,
MapMerchant,
MapDeleted,
MapCorpse,
MapBazaar,
MapInspect,
MapRealEstate,
MapViewMODPC,
MapViewMODBank,
MapViewMODSharedBank,
MapViewMODLimbo,
MapAltStorage,
MapArchived,
MapMail,
MapGuildTrophyTribute,
MapKrono,
MapOther,
_MapCount
};
enum InventoryMainTypes : int16 {
MainCharm = 0,
MainEar1,
MainHead,
MainFace,
MainEar2,
MainNeck,
MainShoulders,
MainArms,
MainBack,
MainWrist1,
MainWrist2,
MainRange,
MainHands,
MainPrimary,
MainSecondary,
MainFinger1,
MainFinger2,
MainChest,
MainLegs,
MainFeet,
MainWaist,
MainPowerSource = 9999, // temp
MainAmmo = 21, // temp
MainGeneral1,
MainGeneral2,
MainGeneral3,
MainGeneral4,
MainGeneral5,
MainGeneral6,
MainGeneral7,
MainGeneral8,
//MainGeneral9,
//MainGeneral10,
MainCursor,
_MainCount
};
#define INVALID_INDEX -1
#define NOT_USED 0
#define NO_ITEM 0
// yes..these are redundant... but, they help to identify and define what is actually being performed
// plus, since they're pre-op's, they don't affect the actual binary size
#define MAP_BEGIN 0
#define MAIN_BEGIN 0
#define SUB_BEGIN 0
#define AUG_BEGIN 0
namespace legacy {
// this is for perl and other legacy systems
typedef enum {
SLOT_CHARM = 0,
SLOT_EAR01 = 1,
SLOT_HEAD = 2,
SLOT_FACE = 3,
SLOT_EAR02 = 4,
SLOT_NECK = 5,
SLOT_SHOULDER = 6,
SLOT_ARMS = 7,
SLOT_BACK = 8,
SLOT_BRACER01 = 9,
SLOT_BRACER02 = 10,
SLOT_RANGE = 11,
SLOT_HANDS = 12,
SLOT_PRIMARY = 13,
SLOT_SECONDARY = 14,
SLOT_RING01 = 15,
SLOT_RING02 = 16,
SLOT_CHEST = 17,
SLOT_LEGS = 18,
SLOT_FEET = 19,
SLOT_WAIST = 20,
SLOT_POWER_SOURCE = 9999,
SLOT_AMMO = 21,
SLOT_GENERAL_1 = 22,
SLOT_GENERAL_2 = 23,
SLOT_GENERAL_3 = 24,
SLOT_GENERAL_4 = 25,
SLOT_GENERAL_5 = 26,
SLOT_GENERAL_6 = 27,
SLOT_GENERAL_7 = 28,
SLOT_GENERAL_8 = 29,
//SLOT_GENERAL_9 = not supported
//SLOT_GENERAL_10 = not supported
SLOT_CURSOR = 30,
SLOT_CURSOR_END = (int16)0xFFFE, // I hope no one is using this...
SLOT_TRADESKILL = 1000,
SLOT_AUGMENT = 1001,
SLOT_INVALID = (int16)0xFFFF,
SLOT_POSSESSIONS_BEGIN = 0,
SLOT_POSSESSIONS_END = 30,
SLOT_EQUIPMENT_BEGIN = 0,
SLOT_EQUIPMENT_END = 21,
SLOT_PERSONAL_BEGIN = 22,
SLOT_PERSONAL_END = 29,
SLOT_PERSONAL_BAGS_BEGIN = 251,
SLOT_PERSONAL_BAGS_END = 330,
SLOT_CURSOR_BAG_BEGIN = 331,
SLOT_CURSOR_BAG_END = 340,
SLOT_TRIBUTE_BEGIN = 400,
SLOT_TRIBUTE_END = 404,
SLOT_BANK_BEGIN = 2000,
SLOT_BANK_END = 2023,
SLOT_BANK_BAGS_BEGIN = 2031,
SLOT_BANK_BAGS_END = 2270,
SLOT_SHARED_BANK_BEGIN = 2500,
SLOT_SHARED_BANK_END = 2501,
SLOT_SHARED_BANK_BAGS_BEGIN = 2531,
SLOT_SHARED_BANK_BAGS_END = 2550,
SLOT_TRADE_BEGIN = 3000,
SLOT_TRADE_END = 3007,
SLOT_TRADE_BAGS_BEGIN = 3031,
SLOT_TRADE_BAGS_END = 3110,
SLOT_WORLD_BEGIN = 4000,
SLOT_WORLD_END = 4009
} InventorySlot;
}
#pragma pack(1) // will be used in packets as well as other inventory-related systems
struct ItemSlot_Struct
{
int16 indexMap;
int16 unknown02;
int16 indexMain;
int16 indexSub;
int16 indexAug;
int16 unknown01;
};
struct ItemSlotShort_Struct
{
int16 indexMain;
int16 indexSub;
int16 indexAug;
int16 unknown01;
};
#pragma pack()
#define TYPE_BEGIN 0
#define SLOT_BEGIN 0
#define SUB_INDEX_BEGIN 0
#define AUG_INDEX_BEGIN 0
static const uint32 MAX_SPELL_DB_ID_VAL = 65535;
#endif
#endif /*COMMON_EQ_CONSTANTS_H*/
File diff suppressed because it is too large Load Diff
-211
View File
@@ -1,211 +0,0 @@
/*
EQEMu: Everquest Server Emulator
Copyright (C) 2001-2014 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef EQ_DICTIONARY_H
#define EQ_DICTIONARY_H
#include "types.h"
#include "eq_constants.h"
#include "clientversions.h"
#include <string>
#include "../common/patches/client62_constants.h"
#include "../common/patches/titanium_constants.h"
#include "../common/patches/sof_constants.h"
#include "../common/patches/sod_constants.h"
#include "../common/patches/underfoot_constants.h"
#include "../common/patches/rof_constants.h"
#include "../common/patches/rof2_constants.h"
// *** DO NOT CHANGE without a full understanding of the consequences..the server is set up to use these settings explicitly!! ***
// *** You will cause compilation failures and corrupt your database if partial or incorrect attempts to change them are made!! ***
// Hard-coded values usually indicate that further research is needed and the values given are from the old (known) system
// (future use)
//using namespace RoF2::maps; // server inventory maps enumeration (code and database sync'd to reference)
//using namespace RoF::slots; // server possessions slots enumeration (code and database sync'd to reference)
class EmuConstants {
// an immutable value is required to initialize arrays, etc... use this class as a repository for those
public:
// database
static const EQClientVersion CHARACTER_CREATION_CLIENT = EQClientRoF; // adjust according to starting item placement and target client
// inventory
static uint16 InventoryMapSize(int16 map);
//static std::string InventoryLocationName(Location_Struct location);
static std::string InventoryMapName(int16 map);
static std::string InventoryMainName(int16 main);
static std::string InventorySubName(int16 sub);
static std::string InventoryAugName(int16 aug);
// these are currently hard-coded for existing inventory system..do not use in place of special client version handlers until ready
static const uint16 MAP_POSSESSIONS_SIZE = _MainCount;
static const uint16 MAP_BANK_SIZE = 24;
static const uint16 MAP_SHARED_BANK_SIZE = 2;
static const uint16 MAP_TRADE_SIZE = 8;
static const uint16 MAP_WORLD_SIZE = 10;
static const uint16 MAP_LIMBO_SIZE = 36;
static const uint16 MAP_TRIBUTE_SIZE = 5; // (need client values)
static const uint16 MAP_TROPHY_TRIBUTE_SIZE = 0;
static const uint16 MAP_GUILD_TRIBUTE_SIZE = 0;
static const uint16 MAP_MERCHANT_SIZE = 0;
static const uint16 MAP_DELETED_SIZE = 0;
static const uint16 MAP_CORPSE_SIZE = _MainCount; // no bitmask use..limits to size of client corpse window (see EQLimits::InventoryMapSize(MapCorpse, <EQClientVersion))
static const uint16 MAP_BAZAAR_SIZE = 80;
static const uint16 MAP_INSPECT_SIZE = 22;
static const uint16 MAP_REAL_ESTATE_SIZE = 0;
static const uint16 MAP_VIEW_MOD_PC_SIZE = NOT_USED;
static const uint16 MAP_VIEW_MOD_BANK_SIZE = NOT_USED;
static const uint16 MAP_VIEW_MOD_SHARED_BANK_SIZE = NOT_USED;
static const uint16 MAP_VIEW_MOD_LIMBO_SIZE = NOT_USED;
static const uint16 MAP_ALT_STORAGE_SIZE = 0;
static const uint16 MAP_ARCHIVED_SIZE = 0;
static const uint16 MAP_MAIL_SIZE = 0;
static const uint16 MAP_GUILD_TROPHY_TRIBUTE_SIZE = 0;
static const uint16 MAP_KRONO_SIZE = 0;
static const uint16 MAP_OTHER_SIZE = 0;
// most of these definitions will go away with the structure-based system..this maintains compatibility for now
// (these are mainly to assign specific values to constants used in conversions and to identify per-client ranges/offsets)
static const int16 EQUIPMENT_BEGIN = MainCharm;
static const int16 EQUIPMENT_END = MainAmmo;
static const uint16 EQUIPMENT_SIZE = 22; // does not account for 'Power Source' - used mainly for npc equipment arrays
static const int16 GENERAL_BEGIN = MainGeneral1;
static const int16 GENERAL_END = MainGeneral8;
static const uint16 GENERAL_SIZE = 8;
static const int16 GENERAL_BAGS_BEGIN = 251;
static const int16 GENERAL_BAGS_END_OFFSET = 79;
static const int16 GENERAL_BAGS_END = GENERAL_BAGS_BEGIN + GENERAL_BAGS_END_OFFSET;
static const int16 CURSOR_BAG_BEGIN = 331;
static const int16 CURSOR_BAG_END_OFFSET = 9;
static const int16 CURSOR_BAG_END = CURSOR_BAG_BEGIN + CURSOR_BAG_END_OFFSET;
static const int16 BANK_BEGIN = 2000;
static const int16 BANK_END = 2023;
static const int16 BANK_BAGS_BEGIN = 2031;
static const int16 BANK_BAGS_END_OFFSET = 239;
static const int16 BANK_BAGS_END = BANK_BAGS_BEGIN + BANK_BAGS_END_OFFSET;
static const int16 SHARED_BANK_BEGIN = 2500;
static const int16 SHARED_BANK_END = 2501;
static const int16 SHARED_BANK_BAGS_BEGIN = 2531;
static const int16 SHARED_BANK_BAGS_END_OFFSET = 19;
static const int16 SHARED_BANK_BAGS_END = SHARED_BANK_BAGS_BEGIN + SHARED_BANK_BAGS_END_OFFSET;
static const int16 TRADE_BEGIN = 3000;
static const int16 TRADE_END = 3007;
static const int16 TRADE_NPC_END = 3003;
static const int16 TRADE_BAGS_BEGIN = 3031;
static const int16 TRADE_BAGS_END_OFFSET = 79;
static const int16 TRADE_BAGS_END = TRADE_BAGS_BEGIN + TRADE_BAGS_END_OFFSET;
static const int16 WORLD_BEGIN = 4000;
static const int16 WORLD_END = 4009;
static const int16 WORLD_SIZE = MAP_WORLD_SIZE;
static const int16 TRIBUTE_BEGIN = 400;
static const int16 TRIBUTE_END = 404;
static const int16 TRIBUTE_SIZE = MAP_TRIBUTE_SIZE;
static const int16 CORPSE_BEGIN = 22;
//static const int16 CORPSE_END = RoF::consts::CORPSE_END; // not ready for use
static const int16 MATERIAL_BEGIN = MaterialHead;
static const int16 MATERIAL_END = MaterialSecondary;
static const int16 MATERIAL_TINT_END = MaterialFeet;
static const int16 MATERIAL_SIZE = _MaterialCount;
// items
// common and container sizes will not increase until the new 'location' struct is implemented
static const uint16 ITEM_COMMON_SIZE = Underfoot::consts::ITEM_COMMON_SIZE;
static const uint16 ITEM_CONTAINER_SIZE = Underfoot::consts::ITEM_CONTAINER_SIZE;
// player profile
//static const uint32 CLASS_BITMASK = 0; // needs value
//static const uint32 RACE_BITMASK = 0; // needs value
// BANDOLIERS_COUNT sets maximum limit..active limit will need to be handled by the appropriate AA
static const uint32 BANDOLIERS_COUNT = Titanium::consts::BANDOLIERS_COUNT; // count = number of bandolier instances
static const uint32 BANDOLIER_SIZE = Titanium::consts::BANDOLIER_SIZE; // size = number of equipment slots in bandolier instance
static const uint32 POTION_BELT_SIZE = Titanium::consts::POTION_BELT_SIZE;
// legacy-related functions
//static int ServerToPerlSlot(int slot); // encode
//static int PerlToServerSlot(int slot); // decode
};
class EQLimits {
// values should default to a non-beneficial value..unless value conflicts with intended operation
//
// EmuConstants may be used as references..but, not every reference needs to be in EmuConstants (i.e., AllowsEmptyBagInBag(), CoinHasWeight(), etc...)
public:
// client version validation (checks to avoid crashing zone server when accessing reference arrays)
// use this inside of class Client (limits to actual clients)
static bool IsValidClientVersion(uint32 version);
static uint32 ValidateClientVersion(uint32 version);
static EQClientVersion ValidateClientVersion(EQClientVersion version);
// basically..any non-client classes - do not when setting a valid client
static bool IsValidNPCVersion(uint32 version);
static uint32 ValidateNPCVersion(uint32 version);
static EQClientVersion ValidateNPCVersion(EQClientVersion version);
// these are 'universal' - do not when setting a valid client
static bool IsValidMobVersion(uint32 version);
static uint32 ValidateMobVersion(uint32 version);
static EQClientVersion ValidateMobVersion(EQClientVersion version);
// inventory
static uint16 InventoryMapSize(int16 map, uint32 version);
static uint64 PossessionsBitmask(uint32 version);
static uint64 EquipmentBitmask(uint32 version);
static uint64 GeneralBitmask(uint32 version);
static uint64 CursorBitmask(uint32 version);
static bool AllowsEmptyBagInBag(uint32 version);
static bool AllowsClickCastFromBag(uint32 version);
// items
static uint16 ItemCommonSize(uint32 version);
static uint16 ItemContainerSize(uint32 version);
// player profile
static bool CoinHasWeight(uint32 version);
static uint32 BandoliersCount(uint32 version);
static uint32 BandolierSize(uint32 version);
static uint32 PotionBeltSize(uint32 version);
};
#endif /* EQ_LIMITS_H */
/*
Working Notes:
--------------
- full review of client_packet.cpp and client translators needed
*/
+521
View File
@@ -0,0 +1,521 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "emu_constants.h"
#include "emu_limits.h"
size_t EQEmu::constants::CharacterCreationLimit(versions::ClientVersion client_version)
{
static const size_t local[versions::ClientVersionCount] = {
ClientUnknown::Null,
Client62::Null,
Titanium::constants::CharacterCreationLimit,
SoF::constants::CharacterCreationLimit,
SoD::constants::CharacterCreationLimit,
UF::constants::CharacterCreationLimit,
RoF::constants::CharacterCreationLimit,
RoF2::constants::CharacterCreationLimit
};
return local[static_cast<size_t>(versions::ValidateClientVersion(client_version))];
}
uint16 EQEmu::inventory::InventoryTypeSize(versions::InventoryVersion inventory_version, int16 inv_type)
{
static const uint16 local[legacy::TypeCount][versions::InventoryVersionCount] = {
{ // local[TypePossessions]
ClientUnknown::Null,
Client62::Null,
legacy::TYPE_POSSESSIONS_SIZE,
legacy::TYPE_POSSESSIONS_SIZE,
legacy::TYPE_POSSESSIONS_SIZE,
legacy::TYPE_POSSESSIONS_SIZE,
legacy::TYPE_POSSESSIONS_SIZE,
legacy::TYPE_POSSESSIONS_SIZE,
legacy::TYPE_POSSESSIONS_SIZE,
legacy::TYPE_POSSESSIONS_SIZE,
legacy::TYPE_POSSESSIONS_SIZE,
legacy::TYPE_POSSESSIONS_SIZE
},
{ // local[TypeBank]
ClientUnknown::Null,
Client62::Null,
Titanium::invtype::InvTypeBankSize,
legacy::TYPE_BANK_SIZE,
legacy::TYPE_BANK_SIZE,
legacy::TYPE_BANK_SIZE,
legacy::TYPE_BANK_SIZE,
legacy::TYPE_BANK_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeSharedBank]
ClientUnknown::Null,
Client62::Null,
legacy::TYPE_SHARED_BANK_SIZE,
legacy::TYPE_SHARED_BANK_SIZE,
legacy::TYPE_SHARED_BANK_SIZE,
legacy::TYPE_SHARED_BANK_SIZE,
legacy::TYPE_SHARED_BANK_SIZE,
legacy::TYPE_SHARED_BANK_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeTrade]
ClientUnknown::Null,
Client62::Null,
legacy::TYPE_TRADE_SIZE,
legacy::TYPE_TRADE_SIZE,
legacy::TYPE_TRADE_SIZE,
legacy::TYPE_TRADE_SIZE,
legacy::TYPE_TRADE_SIZE,
legacy::TYPE_TRADE_SIZE,
4,
4,
legacy::TYPE_TRADE_SIZE, // client thinks this is another client
4
},
{ // local[TypeWorld]
ClientUnknown::Null,
Client62::Null,
legacy::TYPE_WORLD_SIZE,
legacy::TYPE_WORLD_SIZE,
legacy::TYPE_WORLD_SIZE,
legacy::TYPE_WORLD_SIZE,
legacy::TYPE_WORLD_SIZE,
legacy::TYPE_WORLD_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeLimbo]
ClientUnknown::Null,
Client62::Null,
legacy::TYPE_LIMBO_SIZE,
legacy::TYPE_LIMBO_SIZE,
legacy::TYPE_LIMBO_SIZE,
legacy::TYPE_LIMBO_SIZE,
legacy::TYPE_LIMBO_SIZE,
legacy::TYPE_LIMBO_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeTribute]
ClientUnknown::Null,
Client62::Null,
legacy::TYPE_TRIBUTE_SIZE,
legacy::TYPE_TRIBUTE_SIZE,
legacy::TYPE_TRIBUTE_SIZE,
legacy::TYPE_TRIBUTE_SIZE,
legacy::TYPE_TRIBUTE_SIZE,
legacy::TYPE_TRIBUTE_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeTrophyTribute]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_TROPHY_TRIBUTE_SIZE,
legacy::TYPE_TROPHY_TRIBUTE_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeGuildTribute]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_GUILD_TRIBUTE_SIZE,
legacy::TYPE_GUILD_TRIBUTE_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeMerchant]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_MERCHANT_SIZE,
legacy::TYPE_MERCHANT_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeDeleted]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_DELETED_SIZE,
legacy::TYPE_DELETED_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeCorpse]
ClientUnknown::Null,
Client62::Null,
Titanium::invtype::InvTypeCorpseSize,
SoF::invtype::InvTypeCorpseSize,
SoD::invtype::InvTypeCorpseSize,
UF::invtype::InvTypeCorpseSize,
RoF::invtype::InvTypeCorpseSize,
RoF2::invtype::InvTypeCorpseSize,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeBazaar]
ClientUnknown::Null,
Client62::Null,
legacy::TYPE_BAZAAR_SIZE,
legacy::TYPE_BAZAAR_SIZE,
legacy::TYPE_BAZAAR_SIZE,
legacy::TYPE_BAZAAR_SIZE,
legacy::TYPE_BAZAAR_SIZE,
legacy::TYPE_BAZAAR_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeInspect]
ClientUnknown::Null,
Client62::Null,
Titanium::invtype::InvTypeInspectSize,
SoF::invtype::InvTypeInspectSize,
SoD::invtype::InvTypeInspectSize,
UF::invtype::InvTypeInspectSize,
RoF::invtype::InvTypeInspectSize,
RoF2::invtype::InvTypeInspectSize,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeRealEstate]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_REAL_ESTATE_SIZE,
legacy::TYPE_REAL_ESTATE_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeViewMODPC]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_VIEW_MOD_PC_SIZE,
legacy::TYPE_VIEW_MOD_PC_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeViewMODBank]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_VIEW_MOD_BANK_SIZE,
legacy::TYPE_VIEW_MOD_BANK_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeViewMODSharedBank]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_VIEW_MOD_SHARED_BANK_SIZE,
legacy::TYPE_VIEW_MOD_SHARED_BANK_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeViewMODLimbo]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_VIEW_MOD_LIMBO_SIZE,
legacy::TYPE_VIEW_MOD_LIMBO_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeAltStorage]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_ALT_STORAGE_SIZE,
legacy::TYPE_ALT_STORAGE_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeArchived]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_ARCHIVED_SIZE,
legacy::TYPE_ARCHIVED_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeMail]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_MAIL_SIZE,
legacy::TYPE_MAIL_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeGuildTrophyTribute]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_GUILD_TROPHY_TRIBUTE_SIZE,
legacy::TYPE_GUILD_TROPHY_TRIBUTE_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeKrono]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_KRONO_SIZE,
legacy::TYPE_KRONO_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
},
{ // local[TypeOther]
ClientUnknown::Null,
Client62::Null,
Titanium::Null,
SoF::Null,
SoD::Null,
UF::Null,
legacy::TYPE_OTHER_SIZE,
legacy::TYPE_OTHER_SIZE,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
}
};
if ((uint16)inv_type < legacy::TypeCount)
return local[inv_type][static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
return NOT_USED;
}
uint64 EQEmu::inventory::PossessionsBitmask(versions::InventoryVersion inventory_version)
{
static const uint64 local[versions::InventoryVersionCount] = {
ClientUnknown::Null,
Client62::Null,
0x000000027FDFFFFF,
0x000000027FFFFFFF,
0x000000027FFFFFFF,
0x000000027FFFFFFF,
0x00000003FFFFFFFF,
0x00000003FFFFFFFF,
EntityLimits::npc::Null,
EntityLimits::merc::Null,
EntityLimits::bot::Null,
EntityLimits::pet::Null
};
return NOT_USED;
//return local[static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
}
bool EQEmu::inventory::AllowEmptyBagInBag(versions::InventoryVersion inventory_version)
{
static const bool local[versions::InventoryVersionCount] = {
ClientUnknown::False,
Client62::False,
Titanium::behavior::AllowEmptyBagInBag,
SoF::behavior::AllowEmptyBagInBag,
SoD::behavior::AllowEmptyBagInBag,
UF::behavior::AllowEmptyBagInBag,
RoF::behavior::AllowEmptyBagInBag,
RoF2::behavior::AllowEmptyBagInBag,
EntityLimits::npc::False,
EntityLimits::merc::False,
EntityLimits::bot::False,
EntityLimits::pet::False
};
return false;
//return local[static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
}
bool EQEmu::inventory::AllowClickCastFromBag(versions::InventoryVersion inventory_version)
{
static const bool local[versions::InventoryVersionCount] = {
ClientUnknown::False,
Client62::False,
Titanium::behavior::AllowClickCastFromBag,
SoF::behavior::AllowClickCastFromBag,
SoD::behavior::AllowClickCastFromBag,
UF::behavior::AllowClickCastFromBag,
RoF::behavior::AllowClickCastFromBag,
RoF2::behavior::AllowClickCastFromBag,
EntityLimits::npc::False,
EntityLimits::merc::False,
EntityLimits::bot::False,
EntityLimits::pet::False
};
return local[static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
}
uint16 EQEmu::inventory::ItemAugSize(versions::InventoryVersion inventory_version)
{
static const uint16 local[versions::InventoryVersionCount] = {
ClientUnknown::Null,
Client62::Null,
legacy::ITEM_COMMON_SIZE,
legacy::ITEM_COMMON_SIZE,
legacy::ITEM_COMMON_SIZE,
legacy::ITEM_COMMON_SIZE,
legacy::ITEM_COMMON_SIZE,
legacy::ITEM_COMMON_SIZE,
legacy::ITEM_COMMON_SIZE,
legacy::ITEM_COMMON_SIZE,
legacy::ITEM_COMMON_SIZE,
legacy::ITEM_COMMON_SIZE
};
return local[static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
}
uint16 EQEmu::inventory::ItemBagSize(versions::InventoryVersion inventory_version)
{
static const uint16 local[versions::InventoryVersionCount] = {
ClientUnknown::Null,
Client62::Null,
legacy::ITEM_CONTAINER_SIZE,
legacy::ITEM_CONTAINER_SIZE,
legacy::ITEM_CONTAINER_SIZE,
legacy::ITEM_CONTAINER_SIZE,
legacy::ITEM_CONTAINER_SIZE,
legacy::ITEM_CONTAINER_SIZE,
legacy::ITEM_CONTAINER_SIZE,
legacy::ITEM_CONTAINER_SIZE,
legacy::ITEM_CONTAINER_SIZE,
legacy::ITEM_CONTAINER_SIZE
};
return local[static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
}
bool EQEmu::profile::CoinHasWeight(versions::InventoryVersion inventory_version)
{
static const bool local[versions::InventoryVersionCount] = {
ClientUnknown::True,
Client62::True,
Titanium::behavior::CoinHasWeight,
SoF::behavior::CoinHasWeight,
SoD::behavior::CoinHasWeight,
UF::behavior::CoinHasWeight,
RoF::behavior::CoinHasWeight,
RoF::behavior::CoinHasWeight,
EntityLimits::npc::True,
EntityLimits::merc::True,
EntityLimits::bot::True,
EntityLimits::pet::True
};
return local[static_cast<size_t>(versions::ValidateInventoryVersion(inventory_version))];
}
+80
View File
@@ -0,0 +1,80 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef COMMON_EQ_LIMITS_H
#define COMMON_EQ_LIMITS_H
#include "types.h"
#include "eq_constants.h"
#include "inventory_version.h"
#include "../common/patches/titanium_limits.h"
#include "../common/patches/sof_limits.h"
#include "../common/patches/sod_limits.h"
#include "../common/patches/uf_limits.h"
#include "../common/patches/rof_limits.h"
#include "../common/patches/rof2_limits.h"
namespace EQEmu
{
namespace constants {
extern size_t CharacterCreationLimit(versions::ClientVersion client_version);
} /*constants*/
namespace inventory {
extern uint16 InventoryTypeSize(versions::InventoryVersion inventory_version, int16 inv_type);
extern uint64 PossessionsBitmask(versions::InventoryVersion inventory_version);
extern bool AllowEmptyBagInBag(versions::InventoryVersion inventory_version);
extern bool AllowClickCastFromBag(versions::InventoryVersion inventory_version);
extern uint16 ItemAugSize(versions::InventoryVersion inventory_version);
extern uint16 ItemBagSize(versions::InventoryVersion inventory_version);
extern bool ConcatenateInvTypeLimbo(versions::InventoryVersion inventory_version);
extern bool AllowOverLevelEquipment(versions::InventoryVersion inventory_version);
} /*inventory*/
namespace profile {
extern bool CoinHasWeight(versions::InventoryVersion inventory_version);
} /*profile*/
} /*EQEmu*/
namespace ClientUnknown
{
enum : int { Invalid = -1, Null, Safety };
enum : bool { False = false, True = true };
} /*ClientUnknown*/
namespace Client62
{
enum : int { Invalid = -1, Null, Safety };
enum : bool { False = false, True = true };
} /*Client62*/
#endif /*COMMON_EQ_LIMITS_H*/
+17 -8
View File
@@ -15,18 +15,22 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "debug.h"
#include <stdio.h>
#include <iostream>
#include <iomanip>
#include "crc16.h"
#include "global_define.h"
#include "eq_packet.h"
#include "misc.h"
#include "op_codes.h"
#include "crc16.h"
#include "platform.h"
#include <iomanip>
#include <iostream>
#include <sstream>
#include <stdio.h>
#ifndef STATIC_OPCODE
#include "opcodemgr.h"
#endif
#include "packet_dump.h"
#include "packet_functions.h"
#include <cstdlib>
@@ -256,7 +260,7 @@ bool EQProtocolPacket::combine(const EQProtocolPacket *rhs)
{
bool result=false;
if (opcode==OP_Combined && size+rhs->size+5<256) {
unsigned char *tmpbuffer=new unsigned char [size+rhs->size+3];
auto tmpbuffer = new unsigned char[size + rhs->size + 3];
memcpy(tmpbuffer,pBuffer,size);
uint32 offset=size;
tmpbuffer[offset++]=rhs->Size();
@@ -266,7 +270,7 @@ bool result=false;
pBuffer=tmpbuffer;
result=true;
} else if (size+rhs->size+7<256) {
unsigned char *tmpbuffer=new unsigned char [size+rhs->size+6];
auto tmpbuffer = new unsigned char[size + rhs->size + 6];
uint32 offset=0;
tmpbuffer[offset++]=Size();
offset+=serialize(tmpbuffer+offset);
@@ -453,7 +457,7 @@ EQApplicationPacket *EQApplicationPacket::Copy() const {
}
EQRawApplicationPacket *EQProtocolPacket::MakeAppPacket() const {
EQRawApplicationPacket *res = new EQRawApplicationPacket(opcode, pBuffer, size);
auto res = new EQRawApplicationPacket(opcode, pBuffer, size);
res->copyInfo(this);
return(res);
}
@@ -507,3 +511,8 @@ void DumpPacket(const EQApplicationPacket* app, bool iShowInfo) {
// DumpPacketAscii(app->pBuffer, app->size);
}
std::string DumpPacketToString(const EQApplicationPacket* app){
std::ostringstream out;
out << DumpPacketHexToString(app->pBuffer, app->size);
return out.str();
}
+4 -7
View File
@@ -19,9 +19,8 @@
#define _EQPACKET_H
#include "base_packet.h"
#include "eq_stream_type.h"
#include "op_codes.h"
#include "platform.h"
#include <iostream>
#ifdef STATIC_OPCODE
typedef unsigned short EmuOpcode;
@@ -30,9 +29,6 @@
#include "emu_opcodes.h"
#endif
class EQStream;
class EQStreamPair;
class EQPacket : public BasePacket {
friend class EQStream;
public:
@@ -66,7 +62,7 @@ class EQProtocolPacket : public BasePacket {
friend class EQStream;
friend class EQStreamPair;
public:
EQProtocolPacket(uint16 op, const unsigned char *buf, uint32 len) : BasePacket(buf,len), opcode(op) { acked = false; }
EQProtocolPacket(uint16 op, const unsigned char *buf, uint32 len) : BasePacket(buf, len), opcode(op) { acked = false; sent_time = 0; }
// EQProtocolPacket(const unsigned char *buf, uint32 len);
bool combine(const EQProtocolPacket *rhs);
uint32 serialize (unsigned char *dest) const;
@@ -74,6 +70,7 @@ public:
EQRawApplicationPacket *MakeAppPacket() const;
bool acked;
uint32 sent_time;
virtual void build_raw_header_dump(char *buffer, uint16 seq=0xffff) const;
virtual void build_header_dump(char *buffer) const;
@@ -151,6 +148,6 @@ protected:
};
extern void DumpPacket(const EQApplicationPacket* app, bool iShowInfo = false);
extern std::string DumpPacketToString(const EQApplicationPacket* app);
#endif
+340 -205
View File
@@ -1,5 +1,5 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2003 EQEMu Development Team (http://eqemulator.net)
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,6 +15,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef EQ_PACKET_STRUCTS_H
#define EQ_PACKET_STRUCTS_H
@@ -32,8 +33,7 @@ static const uint32 MAX_MERC_GRADES = 10;
static const uint32 MAX_MERC_STANCES = 10;
static const uint32 BLOCKED_BUFF_COUNT = 20;
//#include "eq_constants.h"
#include "eq_dictionary.h"
#include "emu_constants.h"
/*
** Compiler override to ensure
@@ -123,60 +123,81 @@ struct LDoNTrapTemplate
///////////////////////////////////////////////////////////////////////////////
/*
** Color_Struct
** Size: 4 bytes
** Used for convenience
** Merth: Gave struct a name so gcc 2.96 would compile
**
*/
// All clients translate the character select information to some degree
struct Color_Struct
{
union
{
struct
{
uint8 blue;
uint8 green;
uint8 red;
uint8 use_tint; // if there's a tint this is FF
} rgb;
uint32 color;
union {
struct {
uint8 Blue;
uint8 Green;
uint8 Red;
uint8 UseTint; // if there's a tint this is FF
} RGB;
uint32 Color;
};
};
/*
** Character Selection Struct
** Length: 1704 Bytes
**
*/
struct CharacterSelect_Struct {
/*0000*/ uint32 race[10]; // Characters Race
/*0040*/ Color_Struct cs_colors[10][9]; // Characters Equipment Colors
/*0400*/ uint8 beardcolor[10]; // Characters beard Color
/*0410*/ uint8 hairstyle[10]; // Characters hair style
/*0420*/ uint32 equip[10][9]; // 0=helm, 1=chest, 2=arm, 3=bracer, 4=hand, 5=leg, 6=boot, 7=melee1, 8=melee2 (Might not be)
/*0780*/ uint32 secondary[10]; // Characters secondary IDFile number
/*0820*/ uint32 drakkin_heritage[10]; // added for SoF
/*0860*/ uint32 drakkin_tattoo[10]; // added for SoF
/*0900*/ uint32 drakkin_details[10]; // added for SoF
/*0940*/ uint32 deity[10]; // Characters Deity
/*0980*/ uint8 gohome[10]; // 1=Go Home available, 0=not
/*0990*/ uint8 tutorial[10]; // 1=Tutorial available, 0=not
/*1000*/ uint8 beard[10]; // Characters Beard Type
/*1010*/ uint8 unknown902[10]; // 10x ff
/*1020*/ uint32 primary[10]; // Characters primary IDFile number
/*1060*/ uint8 haircolor[10]; // Characters Hair Color
/*1070*/ uint8 unknown0962[2]; // 2x 00
/*1072*/ uint32 zone[10]; // Characters Current Zone
/*1112*/ uint8 class_[10]; // Characters Classes
/*1022*/ uint8 face[10]; // Characters Face Type
/*1032*/ char name[10][64]; // Characters Names
/*1672*/ uint8 gender[10]; // Characters Gender
/*1682*/ uint8 eyecolor1[10]; // Characters Eye Color
/*1692*/ uint8 eyecolor2[10]; // Characters Eye 2 Color
/*1702*/ uint8 level[10]; // Characters Levels
/*1712*/
struct EquipStruct
{
uint32 Material;
uint32 Unknown1;
uint32 EliteMaterial;
uint32 HeroForgeModel;
uint32 Material2; // Same as material?
};
struct CharSelectEquip
{
uint32 Material;
uint32 Unknown1;
uint32 EliteMaterial;
uint32 HeroForgeModel;
uint32 Material2;
Color_Struct Color;
};
// RoF2-based hybrid struct
struct CharacterSelectEntry_Struct
{
char Name[64];
uint8 Class;
uint32 Race;
uint8 Level;
uint8 ShroudClass;
uint32 ShroudRace;
uint16 Zone;
uint16 Instance;
uint8 Gender;
uint8 Face;
CharSelectEquip Equip[9];
uint8 Unknown15; // Seen FF
uint8 Unknown19; // Seen FF
uint32 DrakkinTattoo;
uint32 DrakkinDetails;
uint32 Deity;
uint32 PrimaryIDFile;
uint32 SecondaryIDFile;
uint8 HairColor;
uint8 BeardColor;
uint8 EyeColor1;
uint8 EyeColor2;
uint8 HairStyle;
uint8 Beard;
uint8 GoHome; // Seen 0 for new char and 1 for existing
uint8 Tutorial; // Seen 1 for new char or 0 for existing
uint32 DrakkinHeritage;
uint8 Unknown1; // Seen 0
uint8 Enabled; // Originally labeled as 'CharEnabled' - unknown purpose and setting
uint32 LastLogin;
uint8 Unknown2; // Seen 0
};
struct CharacterSelect_Struct
{
uint32 CharCount; //number of chars in this packet
uint32 TotalChars; //total number of chars allowed?
CharacterSelectEntry_Struct Entries[0];
};
/*
@@ -251,33 +272,34 @@ struct Spawn_Struct {
/*0146*/ uint8 beard; // Beard style (not totally, sure but maybe!)
/*0147*/ uint8 unknown0147[4];
/*0151*/ uint8 level; // Spawn Level
/*0152*/ uint8 unknown0259[4]; // ***Placeholder
// None = 0, Open = 1, WeaponSheathed = 2, Aggressive = 4, ForcedAggressive = 8, InstrumentEquipped = 16, Stunned = 32, PrimaryWeaponEquipped = 64, SecondaryWeaponEquipped = 128
/*0152*/ uint32 PlayerState; // Controls animation stuff
/*0156*/ uint8 beardcolor; // Beard color
/*0157*/ char suffix[32]; // Player's suffix (of Veeshan, etc.)
/*0189*/ uint32 petOwnerId; // If this is a pet, the spawn id of owner
/*0193*/ uint8 guildrank; // 0=normal, 1=officer, 2=leader
/*0194*/ uint8 unknown0194[3];
/*0197*/ union
{
struct
{
/*0197*/ uint32 equip_helmet; // Equipment: Helmet Visual
/*0201*/ uint32 equip_chest; // Equipment: Chest Visual
/*0205*/ uint32 equip_arms; // Equipment: Arms Visual
/*0209*/ uint32 equip_bracers; // Equipment: Bracers Visual
/*0213*/ uint32 equip_hands; // Equipment: Hands Visual
/*0217*/ uint32 equip_legs; // Equipment: Legs Visual
/*0221*/ uint32 equip_feet; // Equipment: Feet Visual
/*0225*/ uint32 equip_primary; // Equipment: Primary Visual
/*0229*/ uint32 equip_secondary; // Equipment: Secondary Visual
} equip;
/*0197*/ uint32 equipment[_MaterialCount]; // Array elements correspond to struct equipment above
};
{
struct
{
/*0000*/ EquipStruct equip_helmet; // Equipment: Helmet visual
/*0000*/ EquipStruct equip_chest; // Equipment: Chest visual
/*0000*/ EquipStruct equip_arms; // Equipment: Arms visual
/*0000*/ EquipStruct equip_bracers; // Equipment: Wrist visual
/*0000*/ EquipStruct equip_hands; // Equipment: Hands visual
/*0000*/ EquipStruct equip_legs; // Equipment: Legs visual
/*0000*/ EquipStruct equip_feet; // Equipment: Boots visual
/*0000*/ EquipStruct equip_primary; // Equipment: Main visual
/*0000*/ EquipStruct equip_secondary; // Equipment: Off visual
} equip;
/*0000*/ EquipStruct equipment[EQEmu::legacy::MaterialCount];
};
/*0233*/ float runspeed; // Speed when running
/*0036*/ uint8 afk; // 0=no, 1=afk
/*0238*/ uint32 guildID; // Current guild
/*0242*/ char title[32]; // Title
/*0274*/ uint8 unknown0274;
/*0274*/ uint8 unknown0274; // non-zero prefixes name with '!'
/*0275*/ uint8 set_to_0xFF[8]; // ***Placeholder (all ff)
/*0283*/ uint8 helm; // Helm texture
/*0284*/ uint32 race; // Spawn race
@@ -317,7 +339,7 @@ union
/*0376*/ Color_Struct color_primary; // Color of primary item
/*0380*/ Color_Struct color_secondary; // Color of secondary item
} equipment_colors;
/*0348*/ Color_Struct colors[_MaterialCount]; // Array elements correspond to struct equipment_colors above
/*0348*/ Color_Struct colors[EQEmu::legacy::MaterialCount]; // Array elements correspond to struct equipment_colors above
};
/*0384*/ uint8 lfg; // 0=off, 1=lfg on
/*0385*/
@@ -340,9 +362,15 @@ union
uint32 DestructibleUnk7;
uint8 DestructibleUnk8;
uint32 DestructibleUnk9;
bool targetable_with_hotkey;
};
struct PlayerState_Struct {
/*00*/ uint32 spawn_id;
/*04*/ uint32 state;
};
/*
** New Spawn
** Length: 176 Bytes
@@ -516,7 +544,7 @@ struct SpawnAppearance_Struct
};
// solar: this is used inside profile
// this is used inside profile
struct SpellBuff_Struct
{
/*000*/ uint8 slotid; //badly named... seems to be 2 for a real buff, 0 otherwise
@@ -524,7 +552,7 @@ struct SpellBuff_Struct
/*002*/ uint8 bard_modifier;
/*003*/ uint8 effect; //not real
/*004*/ uint32 spellid;
/*008*/ uint32 duration;
/*008*/ int32 duration;
/*012*/ uint32 counters;
/*016*/ uint32 player_id; //'global' ID of the caster, for wearoff messages
/*020*/
@@ -537,7 +565,7 @@ struct SpellBuffFade_Struct {
/*006*/ uint8 effect;
/*007*/ uint8 unknown7;
/*008*/ uint32 spellid;
/*012*/ uint32 duration;
/*012*/ int32 duration;
/*016*/ uint32 num_hits;
/*020*/ uint32 unknown020; //prolly global player ID
/*024*/ uint32 slotid;
@@ -555,14 +583,8 @@ struct BuffRemoveRequest_Struct
struct PetBuff_Struct {
/*000*/ uint32 petid;
/*004*/ uint32 spellid[BUFF_COUNT];
/*104*/ uint32 unknown700;
/*108*/ uint32 unknown701;
/*112*/ uint32 unknown702;
/*116*/ uint32 unknown703;
/*120*/ uint32 unknown704;
/*124*/ uint32 ticsremaining[BUFF_COUNT];
/*224*/ uchar unknown705[20];
/*004*/ uint32 spellid[BUFF_COUNT+5];
/*124*/ int32 ticsremaining[BUFF_COUNT+5];
/*244*/ uint32 buffcount;
};
@@ -703,6 +725,7 @@ struct AA_Array
{
uint32 AA;
uint32 value;
uint32 charges;
};
@@ -732,29 +755,46 @@ struct Tribute_Struct {
uint32 tier;
};
//len = 72
struct BandolierItem_Struct {
uint32 item_id;
uint32 icon;
char item_name[64];
};
//len = 320
enum { //bandolier item positions
bandolierMainHand = 0,
bandolierOffHand,
// Bandolier item positions
enum
{
bandolierPrimary = 0,
bandolierSecondary,
bandolierRange,
bandolierAmmo
};
struct Bandolier_Struct {
char name[32];
BandolierItem_Struct items[EmuConstants::BANDOLIER_SIZE];
};
struct PotionBelt_Struct {
BandolierItem_Struct items[EmuConstants::POTION_BELT_SIZE];
//len = 72
struct BandolierItem_Struct
{
uint32 ID;
uint32 Icon;
char Name[64];
};
struct MovePotionToBelt_Struct {
//len = 320
struct Bandolier_Struct
{
char Name[32];
BandolierItem_Struct Items[EQEmu::legacy::BANDOLIER_ITEM_COUNT];
};
//len = 72
struct PotionBeltItem_Struct
{
uint32 ID;
uint32 Icon;
char Name[64];
};
//len = 288
struct PotionBelt_Struct
{
PotionBeltItem_Struct Items[EQEmu::legacy::POTION_BELT_ITEM_COUNT];
};
struct MovePotionToBelt_Struct
{
uint32 Action;
uint32 SlotNumber;
uint32 ItemID;
@@ -841,7 +881,7 @@ struct SuspendedMinion_Struct
/*002*/ uint32 HP;
/*006*/ uint32 Mana;
/*010*/ SpellBuff_Struct Buffs[BUFF_COUNT];
/*510*/ uint32 Items[_MaterialCount];
/*510*/ uint32 Items[EQEmu::legacy::MaterialCount];
/*546*/ char Name[64];
/*610*/
};
@@ -949,9 +989,9 @@ struct PlayerProfile_Struct
/*0304*/ uint8 ability_time_minutes;
/*0305*/ uint8 ability_time_hours; //place holder
/*0306*/ uint8 unknown0306[6]; // @bp Spacer/Flag?
/*0312*/ uint32 item_material[_MaterialCount]; // Item texture/material of worn/held items
/*0312*/ uint32 item_material[EQEmu::legacy::MaterialCount]; // Item texture/material of worn/held items
/*0348*/ uint8 unknown0348[44];
/*0392*/ Color_Struct item_tint[_MaterialCount];
/*0392*/ Color_Struct item_tint[EQEmu::legacy::MaterialCount];
/*0428*/ AA_Array aa_array[MAX_PP_AA_ARRAY];
/*2348*/ float unknown2384; //seen ~128, ~47
/*2352*/ char servername[32]; // length probably not right
@@ -1052,7 +1092,7 @@ struct PlayerProfile_Struct
/*7212*/ uint32 tribute_points;
/*7216*/ uint32 unknown7252;
/*7220*/ uint32 tribute_active; //1=active
/*7224*/ Tribute_Struct tributes[EmuConstants::TRIBUTE_SIZE];
/*7224*/ Tribute_Struct tributes[EQEmu::legacy::TRIBUTE_SIZE];
/*7264*/ Disciplines_Struct disciplines;
/*7664*/ uint32 recastTimers[MAX_RECAST_TYPES]; // Timers (GMT of last use)
/*7744*/ char unknown7780[160];
@@ -1079,7 +1119,7 @@ struct PlayerProfile_Struct
/*12800*/ uint32 expAA;
/*12804*/ uint32 aapoints; //avaliable, unspent
/*12808*/ uint8 unknown12844[36];
/*12844*/ Bandolier_Struct bandoliers[EmuConstants::BANDOLIERS_COUNT];
/*12844*/ Bandolier_Struct bandoliers[EQEmu::legacy::BANDOLIERS_SIZE];
/*14124*/ uint8 unknown14160[4506];
/*18630*/ SuspendedMinion_Struct SuspendedMinion; // No longer in use
/*19240*/ uint32 timeentitledonaccount;
@@ -1120,7 +1160,7 @@ struct TargetReject_Struct {
struct PetCommand_Struct {
/*000*/ uint32 command;
/*004*/ uint32 unknown;
/*004*/ uint32 target;
};
/*
@@ -1225,7 +1265,7 @@ struct ZoneChange_Struct {
// Whatever you send to the client in RequestClientZoneChange_Struct.type, the client will send back
// to the server in ZoneChange_Struct.zone_reason. My guess is this is a memo field of sorts.
// WildcardX 27 January 2008
// 27 January 2008
struct RequestClientZoneChange_Struct {
/*00*/ uint16 zone_id;
@@ -1239,12 +1279,12 @@ struct RequestClientZoneChange_Struct {
struct Animation_Struct {
/*00*/ uint16 spawnid;
/*02*/ uint8 action;
/*03*/ uint8 value;
/*02*/ uint8 speed;
/*03*/ uint8 action;
/*04*/
};
// solar: this is what causes the caster to animate and the target to
// this is what causes the caster to animate and the target to
// get the particle effects around them when a spell is cast
// also causes a buff icon
struct Action_Struct
@@ -1268,7 +1308,7 @@ struct Action_Struct
/* 31 */
};
// solar: this is what prints the You have been struck. and the regular
// this is what prints the You have been struck. and the regular
// melee messages like You try to pierce, etc. It's basically the melee
// and spell damage message
struct CombatDamage_Struct
@@ -1278,10 +1318,10 @@ struct CombatDamage_Struct
/* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells
/* 05 */ uint16 spellid;
/* 07 */ uint32 damage;
/* 11 */ uint32 unknown11;
/* 15 */ uint32 sequence; // see above notes in Action_Struct
/* 19 */ uint32 unknown19;
/* 23 */
/* 11 */ float force;
/* 15 */ float meleepush_xy; // see above notes in Action_Struct
/* 19 */ float meleepush_z;
/* 23 */ uint32 special; // 2 = Rampage, 1 = Wild Rampage
};
/*
@@ -1356,19 +1396,19 @@ struct PlayerPositionUpdateServer_Struct
struct PlayerPositionUpdateClient_Struct
{
/*0000*/ uint16 spawn_id;
/*0022*/ uint16 sequence; //increments one each packet
/*0002*/ uint16 sequence; //increments one each packet
/*0004*/ float y_pos; // y coord
/*0008*/ float delta_z; // Change in z
/*0016*/ float delta_x; // Change in x
/*0012*/ float delta_y; // Change in y
/*0012*/ float delta_x; // Change in x
/*0016*/ float delta_y; // Change in y
/*0020*/ int32 animation:10, // animation
delta_heading:10, // change in heading
padding0020:12; // ***Placeholder (mostly 1)
/*0024*/ float x_pos; // x coord
/*0028*/ float z_pos; // z coord
/*0034*/ uint16 heading:12, // Directional heading
/*0032*/ uint16 heading:12, // Directional heading
padding0004:4; // ***Placeholder
/*0032*/ uint8 unknown0006[2]; // ***Placeholder
/*0034*/ uint8 unknown0006[2]; // ***Placeholder
/*0036*/
};
@@ -1477,16 +1517,38 @@ struct ExpUpdate_Struct
enum ItemPacketType
{
ItemPacketViewLink = 0x00,
ItemPacketMerchant = 0x64,
ItemPacketTradeView = 0x65,
ItemPacketLoot = 0x66,
ItemPacketTrade = 0x67,
ItemPacketCharInventory = 0x69,
ItemPacketSummonItem = 0x6A,
ItemPacketTributeItem = 0x6C,
ItemPacketMerchant = 0x64,
ItemPacketWorldContainer = 0x6B,
ItemPacketCharmUpdate = 0x6E
ItemPacketTributeItem = 0x6C,
ItemPacketGuildTribute = 0x6D,
ItemPacketCharmUpdate = 0x6E, // noted as incorrect
ItemPacketInvalid = 0xFF
};
//enum ItemPacketType
//{
// ItemPacketMerchant = /*100*/ 0x64, // Titanium+
// ItemPacketTradeView = /*101*/ 0x65,
// ItemPacketLoot = /*102*/ 0x66,
// ItemPacketTrade = /*103*/ 0x67,
// ItemPacketCharInventory = /*105*/ 0x69,
// ItemPacketLimbo = /*106*/ 0x6A, // name change
// ItemPacketWorldContainer = /*107*/ 0x6B,
// ItemPacketTributeItem = /*108*/ 0x6C,
// ItemPacketGuildTribute = /*109*/ 0x6D, // missing from EQEmu
// ItemPacket10 = /*110*/ 0x6E,
// ItemPacket11 = /*111*/ 0x6F, // UF+ (equipment slots only) (RoF+ checks '(WORD*)slot + 4 != -1' [(WORD*)]slot + 2 would be bag index - if used) (guess)
// ItemPacket12 = /*112*/ 0x70, // RoF+ (causes stat update) (could be TrophyTribute and GuildTrophyTribute together - two case methodology - is it checking for GuildID?)
// ItemPacketRecovery = /*113*/ 0x71, (same handler as merchant..exception: parameter is '1' versus merchant '0' looks like tab id)
// ItemPacket14 = /*115*/ 0x73, (real estate/moving crate?)
// ItemPacket__ = /*xxx*/ 0xXX // switch 'default' - all clients
//};
struct ItemPacket_Struct
{
/*00*/ ItemPacketType PacketType;
@@ -1786,7 +1848,7 @@ struct RandomReq_Struct {
uint32 high;
};
/* solar: 9/23/03 reply to /random command; struct from Zaphod */
/* 9/23/03 reply to /random command */
struct RandomReply_Struct {
/* 00 */ uint32 low;
/* 04 */ uint32 high;
@@ -2057,7 +2119,7 @@ struct AdventureLeaderboard_Struct
/*struct Item_Shop_Struct {
uint16 merchantid;
uint8 itemtype;
Item_Struct item;
EQEmu::Item_Struct item;
uint8 iss_unknown001[6];
};*/
@@ -2083,7 +2145,7 @@ struct Illusion_Struct { //size: 256 - SoF
/*092*/ uint32 drakkin_heritage; //
/*096*/ uint32 drakkin_tattoo; //
/*100*/ uint32 drakkin_details; //
/*104*/ uint32 armor_tint[_MaterialCount]; //
/*104*/ uint32 armor_tint[EQEmu::legacy::MaterialCount]; //
/*140*/ uint8 eyecolor1; // Field Not Identified in any Illusion Struct
/*141*/ uint8 eyecolor2; // Field Not Identified in any Illusion Struct
/*142*/ uint8 unknown138[114]; //
@@ -2107,24 +2169,24 @@ struct Illusion_Struct_Old {
// OP_Sound - Size: 68
struct QuestReward_Struct
{
/*000*/ uint32 from_mob; // ID of mob awarding the client
/*004*/ uint32 unknown004;
/*008*/ uint32 unknown008;
/*012*/ uint32 unknown012;
/*016*/ uint32 unknown016;
/*020*/ uint32 unknown020;
/*024*/ uint32 silver; // Gives silver to the client
/*028*/ uint32 gold; // Gives gold to the client
/*032*/ uint32 platinum; // Gives platinum to the client
/*036*/ uint32 unknown036;
/*040*/ uint32 unknown040;
/*044*/ uint32 unknown044;
/*048*/ uint32 unknown048;
/*052*/ uint32 unknown052;
/*056*/ uint32 unknown056;
/*060*/ uint32 unknown060;
/*064*/ uint32 unknown064;
/*068*/
/*000*/ uint32 mob_id; // ID of mob awarding the client
/*004*/ uint32 target_id;
/*008*/ uint32 exp_reward;
/*012*/ uint32 faction;
/*016*/ int32 faction_mod;
/*020*/ uint32 copper; // Gives copper to the client
/*024*/ uint32 silver; // Gives silver to the client
/*028*/ uint32 gold; // Gives gold to the client
/*032*/ uint32 platinum; // Gives platinum to the client
/*036*/ uint32 item_id;
/*040*/ uint32 unknown040;
/*044*/ uint32 unknown044;
/*048*/ uint32 unknown048;
/*052*/ uint32 unknown052;
/*056*/ uint32 unknown056;
/*060*/ uint32 unknown060;
/*064*/ uint32 unknown064;
/*068*/
};
// Size: 8
@@ -2363,7 +2425,7 @@ struct AugmentItem_Struct {
// OP_Emote
struct Emote_Struct {
/*0000*/ uint32 unknown01;
/*0000*/ uint32 type; // 0 - custom, 0xffffffff - command (/dance, /flip, etc...)
/*0004*/ char message[1024];
/*1028*/
};
@@ -2380,11 +2442,11 @@ struct InspectResponse_Struct {
/*004*/ uint32 playerid;
/*008*/ char itemnames[23][64];
/*1480*/uint32 itemicons[23];
/*1572*/char text[288]; // Max number of chars in Inspect Window appears to be 254 // Msg struct property is 256 (254 + '\0' is my guess) -U
/*1572*/char text[288]; // Max number of chars in Inspect Window appears to be 254 // Msg struct property is 256 (254 + '\0' is my guess)
/*1860*/
};
//OP_InspectMessageUpdate - Size: 256 (SoF+ clients after self-inspect window is closed) -U
//OP_InspectMessageUpdate - Size: 256 (SoF+ clients after self-inspect window is closed)
struct InspectMessage_Struct {
/*000*/ char text[256];
/*256*/
@@ -2493,9 +2555,9 @@ struct BookRequest_Struct {
**
*/
struct Object_Struct {
/*00*/ uint32 linked_list_addr[2];// <Zaphod> They are, get this, prev and next, ala linked list
/*08*/ uint16 unknown008; //
/*10*/ uint16 unknown010; //
/*00*/ uint32 linked_list_addr[2];// They are, get this, prev and next, ala linked list
/*08*/ uint16 size; //
/*10*/ uint16 solidtype; //
/*12*/ uint32 drop_id; // Unique object id for zone
/*16*/ uint16 zone_id; // Redudant, but: Zone the object appears in
/*18*/ uint16 zone_instance; //
@@ -2512,8 +2574,8 @@ struct Object_Struct {
/*88*/ uint32 spawn_id; // Spawn Id of client interacting with object
/*92*/
};
//<Zaphod> 01 = generic drop, 02 = armor, 19 = weapon
//[13:40] <Zaphod> and 0xff seems to be indicative of the tradeskill/openable items that end up returning the old style item type in the OP_OpenObject
// 01 = generic drop, 02 = armor, 19 = weapon
//[13:40] and 0xff seems to be indicative of the tradeskill/openable items that end up returning the old style item type in the OP_OpenObject
/*
** Click Object Struct
@@ -2570,7 +2632,7 @@ struct CloseContainer_Struct {
*/
struct Door_Struct
{
/*0000*/ char name[32]; // Filename of Door // Was 10char long before... added the 6 in the next unknown to it: Daeken M. BlackBlade //changed both to 32: Trevius
/*0000*/ char name[32]; // Filename of Door // Was 10char long before... added the 6 in the next unknown to it //changed both to 32
/*0032*/ float yPos; // y loc
/*0036*/ float xPos; // x loc
/*0040*/ float zPos; // z loc
@@ -2736,7 +2798,8 @@ struct BazaarWelcome_Struct {
BazaarWindowStart_Struct Beginning;
uint32 Traders;
uint32 Items;
uint8 Unknown012[8];
uint32 Unknown012;
uint32 Unknown016;
};
struct BazaarSearch_Struct {
@@ -2895,7 +2958,7 @@ uint8 npccastfilters; // 0) No, 1) Ignore NPC Casts (all), 2) Ignore NPC Casts
*/
struct ItemViewRequest_Struct {
/*000*/ uint32 item_id;
/*004*/ uint32 augments[5];
/*004*/ uint32 augments[6];
/*024*/ uint32 link_hash;
/*028*/ uint32 unknown028;
/*032*/ char unknown032[12]; //probably includes loregroup & evolving info. see Client::MakeItemLink() in zone/inventory.cpp:469
@@ -2991,14 +3054,14 @@ struct ClientError_Struct
};
struct Track_Struct {
uint16 entityid;
uint16 padding002;
uint32 entityid;
float distance;
// Fields for SoD and later
uint8 level;
uint8 NPC;
uint8 GroupMember;
uint8 is_npc;
char name[64];
uint8 is_pet;
uint8 is_merc;
};
struct Tracking_Struct {
@@ -3121,6 +3184,7 @@ struct Trader_ShowItems_Struct{
/*000*/ uint32 Code;
/*004*/ uint32 TraderID;
/*008*/ uint32 Unknown08[3];
/*020*/
};
struct TraderBuy_Struct{
@@ -3166,9 +3230,10 @@ struct TraderDelItem_Struct{
struct TraderClick_Struct{
/*000*/ uint32 TraderID;
/*004*/ uint32 Unknown004;
/*004*/ uint32 Code;
/*008*/ uint32 Unknown008;
/*012*/ uint32 Approval;
/*016*/
};
struct FormattedMessage_Struct{
@@ -3367,7 +3432,7 @@ struct DyeStruct
struct Color_Struct secondary; // or this
}
dyes;
struct Color_Struct dye[_MaterialCount];
struct Color_Struct dye[EQEmu::legacy::MaterialCount];
};
};
@@ -3428,8 +3493,8 @@ struct SelectTributeReply_Struct {
struct TributeInfo_Struct {
uint32 active; //0 == inactive, 1 == active
uint32 tributes[EmuConstants::TRIBUTE_SIZE]; //-1 == NONE
uint32 tiers[EmuConstants::TRIBUTE_SIZE]; //all 00's
uint32 tributes[EQEmu::legacy::TRIBUTE_SIZE]; //-1 == NONE
uint32 tiers[EQEmu::legacy::TRIBUTE_SIZE]; //all 00's
uint32 tribute_master_id;
};
@@ -3986,7 +4051,7 @@ struct MarkNPC_Struct
struct InspectBuffs_Struct {
/*000*/ uint32 spell_id[BUFF_COUNT];
/*100*/ uint32 tics_remaining[BUFF_COUNT];
/*100*/ int32 tics_remaining[BUFF_COUNT];
};
struct RaidGeneral_Struct {
@@ -4079,30 +4144,35 @@ struct DynamicWall_Struct {
/*80*/
};
enum { //bandolier actions
BandolierCreate = 0,
BandolierRemove = 1,
BandolierSet = 2
// Bandolier actions
enum
{
bandolierCreate = 0,
bandolierRemove,
bandolierSet
};
struct BandolierCreate_Struct {
/*00*/ uint32 action; //0 for create
/*04*/ uint8 number;
/*05*/ char name[32];
/*37*/ uint16 unknown37; //seen 0x93FD
/*39*/ uint8 unknown39; //0
struct BandolierCreate_Struct
{
/*00*/ uint32 Action; //0 for create
/*04*/ uint8 Number;
/*05*/ char Name[32];
/*37*/ uint16 Unknown37; //seen 0x93FD
/*39*/ uint8 Unknown39; //0
};
struct BandolierDelete_Struct {
/*00*/ uint32 action;
/*04*/ uint8 number;
/*05*/ uint8 unknown05[35];
struct BandolierDelete_Struct
{
/*00*/ uint32 Action;
/*04*/ uint8 Number;
/*05*/ uint8 Unknown05[35];
};
struct BandolierSet_Struct {
/*00*/ uint32 action;
/*04*/ uint8 number;
/*05*/ uint8 unknown05[35];
struct BandolierSet_Struct
{
/*00*/ uint32 Action;
/*04*/ uint8 Number;
/*05*/ uint8 Unknown05[35];
};
struct Arrow_Struct {
@@ -4169,6 +4239,52 @@ struct UseAA_Struct {
uint32 end;
};
//new AA stuff
//reference only
struct AARankInfo_Struct
{
uint32 id;
int32 upper_hotkey_sid;
int32 lower_hotkey_sid;
int32 title_sid;
int32 desc_sid;
int32 level_req;
int32 cost;
uint32 seq;
uint32 current_level;
uint32 type;
int32 spell;
int32 spell_type;
int32 spell_refresh;
int32 classes;
int32 max_level;
int32 prev_id;
int32 next_id;
int32 total_cost;
int32 expansion;
int32 category;
uint32 charges;
uint8 grant_only;
uint32 total_effects;
uint32 total_prereqs;
};
struct AARankPrereq_Struct
{
int32 aa_id;
int32 points;
};
struct AARankEffect_Struct
{
int32 effect_id;
int32 base1;
int32 base2;
int32 slot;
};
//old AA stuff
struct AA_Ability {
/*00*/ uint32 skill_id;
/*04*/ uint32 base1;
@@ -4223,18 +4339,10 @@ struct SendAA_Struct {
struct AA_Action {
/*00*/ uint32 action;
/*04*/ uint32 ability;
/*08*/ uint32 unknown08;
/*08*/ uint32 target_id;
/*12*/ uint32 exp_value;
};
struct AA_Skills { //this should be removed and changed to AA_Array
/*00*/ uint32 aa_skill; // Total AAs Spent
/*04*/ uint32 aa_value;
/*08*/ uint32 unknown08;
/*12*/
};
struct AAExpUpdate_Struct {
/*00*/ uint32 unknown00; //seems to be a value from AA_Action.ability
/*04*/ uint32 aapoints_unspent;
@@ -4252,12 +4360,12 @@ struct AltAdvStats_Struct {
};
struct PlayerAA_Struct { // Is this still used?
AA_Skills aa_list[MAX_PP_AA_ARRAY];
AA_Array aa_list[MAX_PP_AA_ARRAY];
};
struct AATable_Struct {
/*00*/ int32 aa_spent; // Total AAs Spent
/*04*/ AA_Skills aa_list[MAX_PP_AA_ARRAY];
/*04*/ AA_Array aa_list[MAX_PP_AA_ARRAY];
};
struct Weather_Struct {
@@ -4505,19 +4613,12 @@ struct InternalVeteranReward
/*012*/ InternalVeteranRewardItem items[8];
};
struct VeteranClaimReply
struct VeteranClaim
{
/*000*/ char name[64];
/*064*/ uint32 claim_id;
/*068*/ uint32 reject_field;
/*072*/ uint32 unknown072;
};
struct VeteranClaimRequest
{
/*000*/ char name_data[64]; //name + other data
/*000*/ char name[64]; //name + other data
/*064*/ uint32 claim_id;
/*068*/ uint32 unknown068;
/*072*/ uint32 action;
};
struct GMSearchCorpse_Struct
@@ -4643,6 +4744,22 @@ struct GuildBankItemUpdate_Struct
/*226*/ uint16 Unknown226;
};
// newer clients (RoF+) send a list that contains 240 entries
// The packets don't actually use all 64 chars in the strings, but we'll just overallocate for these
struct GuildBankItemListEntry_Struct
{
uint8 vaild;
uint32 permissions;
char whofor[64];
char donator[64];
uint32 item_id;
uint32 item_icon;
uint32 quantity;
uint8 allow_merge; // 1 here for non-full stacks
uint8 usable;
char item_name[64];
};
struct GuildBankClear_Struct
{
/*00*/ uint32 Action;
@@ -4689,7 +4806,7 @@ struct BuffIconEntry_Struct
{
uint32 buff_slot;
uint32 spell_id;
uint32 tics_remaining;
int32 tics_remaining;
uint32 num_hits;
};
@@ -4698,6 +4815,8 @@ struct BuffIcon_Struct
uint32 entity_id;
uint8 all_buffs;
uint16 count;
uint8 type; // 0 = self buff window, 1 = self target window, 4 = group, 5 = PC, 7 = NPC
int32 tic_timer;
BuffIconEntry_Struct entries[0];
};
@@ -5218,8 +5337,10 @@ struct ServerLootItem_Struct {
uint32 aug_3; // uint32 aug_3;
uint32 aug_4; // uint32 aug_4;
uint32 aug_5; // uint32 aug_5;
uint8 min_level; //
uint8 max_level; //
uint32 aug_6; // uint32 aug_5;
uint8 attuned;
uint8 min_level;
uint8 max_level;
};
//Found in client near a ref to the string:
@@ -5242,6 +5363,20 @@ struct ClientMarqueeMessage_Struct {
typedef std::list<ServerLootItem_Struct*> ItemList;
struct fling_struct {
/* 00 */ uint32 collision; // 0 collision is off, anything else it's on
/* 04 */ int32 travel_time; // ms -- UF we need to calc this, RoF+ -1 auto calcs
/* 08 */ uint8 unk3; // bool, set to 1 has something to do with z-axis or something weird things happen if the new Z is above or equal to yours
/* 09 */ uint8 disable_fall_damage; // 1 you take no fall damage, 0 you take fall damage
/* 10 */ uint8 padding[2];
/* 12 */ float speed_z;
/* 16 */ float new_y;
/* 20 */ float new_x;
/* 24 */ float new_z;
/* 28 */
};
// Restore structure packing to default
#pragma pack()
+287 -288
View File
File diff suppressed because it is too large Load Diff
+49 -13
View File
@@ -1,22 +1,26 @@
#ifndef _EQSTREAM_H
#define _EQSTREAM_H
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <deque>
#ifndef WIN32
#include <netinet/in.h>
#endif
#include "eq_stream_type.h"
#include "../common/misc.h"
#include "../common/opcodemgr.h"
#include "../common/timer.h"
#include "eq_packet.h"
#include "eq_stream_intf.h"
#include "eq_stream_type.h"
#include "mutex.h"
#include "../common/opcodemgr.h"
#include "../common/misc.h"
#include "../common/condition.h"
#include "../common/timer.h"
class EQApplicationPacket;
class EQProtocolPacket;
#define FLAG_COMPRESSED 0x01
#define FLAG_ENCODED 0x04
@@ -45,6 +49,10 @@
#define RETRANSMIT_ACKED_PACKETS true
#endif
#ifndef MAX_SESSION_RETRIES
#define MAX_SESSION_RETRIES 30
#endif
#pragma pack(1)
struct SessionRequest {
uint32 UnknownA;
@@ -63,7 +71,7 @@ struct SessionResponse {
};
//Deltas are in ms, representing round trip times
struct SessionStats {
struct ClientSessionStats {
/*000*/ uint16 RequestID;
/*002*/ uint32 last_local_delta;
/*006*/ uint32 average_delta;
@@ -75,10 +83,19 @@ struct SessionStats {
/*038*/
};
struct ServerSessionStats {
/*000*/ uint16 RequestID;
/*002*/ uint32 ServerTime;
/*006*/ uint64 packets_sent_echo;
/*014*/ uint64 packets_received_echo;
/*022*/ uint64 packets_sent;
/*030*/ uint64 packets_received;
/*038*/
};
#pragma pack()
class OpcodeManager;
class EQStreamPair;
class EQRawApplicationPacket;
class EQStream : public EQStreamInterface {
@@ -101,6 +118,9 @@ class EQStream : public EQStreamInterface {
uint32 retransmittimer;
uint32 retransmittimeout;
uint16 sessionAttempts;
bool streamactive;
//uint32 buffer_len;
uint32 Session, Key;
@@ -133,7 +153,6 @@ class EQStream : public EQStreamInterface {
std::deque<EQProtocolPacket *> SequencedQueue;
uint16 NextOutSeq;
uint16 SequencedBase; //the sequence number of SequencedQueue[0]
long NextSequencedSend; //index into SequencedQueue
Mutex MOutboundQueue;
//a buffer we use for compression/decompression
@@ -148,10 +167,13 @@ class EQStream : public EQStreamInterface {
int32 BytesWritten;
uint64 sent_packet_count;
uint64 received_packet_count;
Mutex MRate;
int32 RateThreshold;
int32 DecayRate;
uint32 AverageDelta;
OpcodeManager **OpMgr;
@@ -194,10 +216,16 @@ class EQStream : public EQStreamInterface {
void _SendDisconnect();
void init();
void init(bool resetSession=true);
public:
EQStream() { init(); remote_ip = 0; remote_port = 0; State=UNESTABLISHED; StreamType=UnknownStream; compressed=true; encoded=false; app_opcode_size=2; bytes_sent=0; bytes_recv=0; create_time=Timer::GetTimeSeconds(); }
EQStream(sockaddr_in addr) { init(); remote_ip=addr.sin_addr.s_addr; remote_port=addr.sin_port; State=UNESTABLISHED; StreamType=UnknownStream; compressed=true; encoded=false; app_opcode_size=2; bytes_sent=0; bytes_recv=0; create_time=Timer::GetTimeSeconds(); }
EQStream() { init(); remote_ip = 0; remote_port = 0; State = UNESTABLISHED;
StreamType = UnknownStream; compressed = true; encoded = false; app_opcode_size = 2;
bytes_sent = 0; bytes_recv = 0; create_time = Timer::GetTimeSeconds(); sessionAttempts = 0;
streamactive = false; }
EQStream(sockaddr_in addr) { init(); remote_ip = addr.sin_addr.s_addr;
remote_port = addr.sin_port; State = UNESTABLISHED; StreamType = UnknownStream;
compressed = true; encoded = false; app_opcode_size = 2; bytes_sent = 0; bytes_recv = 0;
create_time = Timer::GetTimeSeconds(); }
virtual ~EQStream() { RemoveData(); SetState(CLOSED); }
void SetMaxLen(uint32 length) { MaxLen=length; }
@@ -221,6 +249,9 @@ class EQStream : public EQStreamInterface {
void SetLastPacketTime(uint32 t) {LastPacket=t;}
void Write(int eq_fd);
// whether or not the stream has been assigned (we passed our stream match)
void SetActive(bool val) { streamactive = val; }
//
inline bool IsInUse() { bool flag; MInUse.lock(); flag=(active_users>0); MInUse.unlock(); return flag; }
inline void PutInUse() { MInUse.lock(); active_users++; MInUse.unlock(); }
@@ -246,11 +277,13 @@ class EQStream : public EQStreamInterface {
void AddBytesSent(uint32 bytes)
{
bytes_sent += bytes;
++sent_packet_count;
}
void AddBytesRecv(uint32 bytes)
{
bytes_recv += bytes;
++received_packet_count;
}
virtual const uint32 GetBytesSent() const { return bytes_sent; }
@@ -269,6 +302,9 @@ class EQStream : public EQStreamInterface {
return bytes_recv / (Timer::GetTimeSeconds() - create_time);
}
const uint64 GetPacketsSent() { return sent_packet_count; }
const uint64 GetPacketsReceived() { return received_packet_count; }
//used for dynamic stream identification
class Signature {
public:
+57 -68
View File
@@ -1,7 +1,9 @@
#include "debug.h"
#include "global_define.h"
#include "eqemu_logsys.h"
#include "eq_stream_factory.h"
#ifdef _WINDOWS
#include <winsock.h>
#include <winsock2.h>
#include <process.h>
#include <io.h>
#include <stdio.h>
@@ -13,24 +15,24 @@
#include <netdb.h>
#include <pthread.h>
#endif
#include <fcntl.h>
#include <iostream>
#include <fcntl.h>
#include "op_codes.h"
#include "eq_stream.h"
#include "logsys.h"
ThreadReturnType EQStreamFactoryReaderLoop(void *eqfs)
{
EQStreamFactory *fs=(EQStreamFactory *)eqfs;
#ifndef WIN32
_log(COMMON__THREADS, "Starting EQStreamFactoryReaderLoop with thread ID %d", pthread_self());
Log.Out(Logs::Detail, Logs::None, "Starting EQStreamFactoryReaderLoop with thread ID %d", pthread_self());
#endif
fs->ReaderLoop();
#ifndef WIN32
_log(COMMON__THREADS, "Ending EQStreamFactoryReaderLoop with thread ID %d", pthread_self());
Log.Out(Logs::Detail, Logs::None, "Ending EQStreamFactoryReaderLoop with thread ID %d", pthread_self());
#endif
THREAD_RETURN(nullptr);
@@ -41,13 +43,13 @@ ThreadReturnType EQStreamFactoryWriterLoop(void *eqfs)
EQStreamFactory *fs=(EQStreamFactory *)eqfs;
#ifndef WIN32
_log(COMMON__THREADS, "Starting EQStreamFactoryWriterLoop with thread ID %d", pthread_self());
Log.Out(Logs::Detail, Logs::None, "Starting EQStreamFactoryWriterLoop with thread ID %d", pthread_self());
#endif
fs->WriterLoop();
#ifndef WIN32
_log(COMMON__THREADS, "Ending EQStreamFactoryWriterLoop with thread ID %d", pthread_self());
Log.Out(Logs::Detail, Logs::None, "Ending EQStreamFactoryWriterLoop with thread ID %d", pthread_self());
#endif
THREAD_RETURN(nullptr);
@@ -104,8 +106,6 @@ struct sockaddr_in address;
fcntl(sock, F_SETFL, O_NONBLOCK);
#endif
//moved these because on windows the output was delayed and causing the console window to look bad
//std::cout << "Starting factory Reader" << std::endl;
//std::cout << "Starting factory Writer" << std::endl;
#ifdef _WINDOWS
_beginthread(EQStreamFactoryReaderLoop,0, this);
_beginthread(EQStreamFactoryWriterLoop,0, this);
@@ -116,44 +116,39 @@ struct sockaddr_in address;
return true;
}
EQStream *EQStreamFactory::Pop()
std::shared_ptr<EQStream> EQStreamFactory::Pop()
{
EQStream *s=nullptr;
//std::cout << "Pop():Locking MNewStreams" << std::endl;
std::shared_ptr<EQStream> s = nullptr;
MNewStreams.lock();
if (NewStreams.size()) {
s=NewStreams.front();
if (!NewStreams.empty()) {
s = NewStreams.front();
NewStreams.pop();
s->PutInUse();
}
MNewStreams.unlock();
//std::cout << "Pop(): Unlocking MNewStreams" << std::endl;
return s;
}
void EQStreamFactory::Push(EQStream *s)
void EQStreamFactory::Push(std::shared_ptr<EQStream> s)
{
//std::cout << "Push():Locking MNewStreams" << std::endl;
MNewStreams.lock();
NewStreams.push(s);
MNewStreams.unlock();
//std::cout << "Push(): Unlocking MNewStreams" << std::endl;
}
void EQStreamFactory::ReaderLoop()
{
fd_set readset;
std::map<std::pair<uint32, uint16>,EQStream *>::iterator stream_itr;
int num;
int length;
unsigned char buffer[2048];
sockaddr_in from;
int socklen=sizeof(sockaddr_in);
timeval sleep_time;
//time_t now;
fd_set readset;
std::map<std::pair<uint32, uint16>, std::shared_ptr<EQStream>>::iterator stream_itr;
int num;
int length;
unsigned char buffer[2048];
sockaddr_in from;
int socklen = sizeof(sockaddr_in);
timeval sleep_time;
ReaderRunning = true;
ReaderRunning=true;
while(sock!=-1) {
MReaderRunning.lock();
if (!ReaderRunning)
@@ -184,10 +179,10 @@ timeval sleep_time;
// What do we wanna do?
} else {
MStreams.lock();
stream_itr=Streams.find(std::make_pair(from.sin_addr.s_addr, from.sin_port));
stream_itr = Streams.find(std::make_pair(from.sin_addr.s_addr, from.sin_port));
if (stream_itr == Streams.end()) {
if (buffer[1]==OP_SessionRequest) {
EQStream *s = new EQStream(from);
std::shared_ptr<EQStream> s = std::make_shared<EQStream>(from);
s->SetStreamType(StreamType);
Streams[std::make_pair(from.sin_addr.s_addr, from.sin_port)]=s;
WriterWork.Signal();
@@ -198,13 +193,13 @@ timeval sleep_time;
}
MStreams.unlock();
} else {
EQStream *curstream = stream_itr->second;
std::shared_ptr<EQStream> curstream = stream_itr->second;
//dont bother processing incoming packets for closed connections
if(curstream->CheckClosed())
curstream = nullptr;
else
curstream->PutInUse();
MStreams.unlock(); //the in use flag prevents the stream from being deleted while we are using it.
//the in use flag prevents the stream from being deleted while we are using it.
if(curstream) {
curstream->AddBytesRecv(length);
@@ -212,6 +207,7 @@ timeval sleep_time;
curstream->SetLastPacketTime(Timer::GetCurrentTime());
curstream->ReleaseFromUse();
}
MStreams.unlock();
}
}
}
@@ -224,10 +220,10 @@ void EQStreamFactory::CheckTimeout()
MStreams.lock();
unsigned long now=Timer::GetCurrentTime();
std::map<std::pair<uint32, uint16>,EQStream *>::iterator stream_itr;
std::map<std::pair<uint32, uint16>, std::shared_ptr<EQStream>>::iterator stream_itr;
for(stream_itr=Streams.begin();stream_itr!=Streams.end();) {
EQStream *s = stream_itr->second;
for(stream_itr = Streams.begin(); stream_itr != Streams.end();) {
std::shared_ptr<EQStream> s = stream_itr->second;
s->CheckTimeout(now, stream_timeout);
@@ -239,11 +235,9 @@ void EQStreamFactory::CheckTimeout()
//give it a little time for everybody to finish with it
} else {
//everybody is done, we can delete it now
//std::cout << "Removing connection" << std::endl;
std::map<std::pair<uint32, uint16>,EQStream *>::iterator temp=stream_itr;
auto temp = stream_itr;
++stream_itr;
//let whoever has the stream outside delete it
delete temp->second;
temp->second = nullptr;
Streams.erase(temp);
continue;
}
@@ -256,21 +250,16 @@ void EQStreamFactory::CheckTimeout()
void EQStreamFactory::WriterLoop()
{
std::map<std::pair<uint32, uint16>,EQStream *>::iterator stream_itr;
bool havework=true;
std::vector<EQStream *> wants_write;
std::vector<EQStream *>::iterator cur,end;
bool decay=false;
uint32 stream_count;
Timer DecayTimer(20);
WriterRunning=true;
bool havework = true;
std::vector<std::shared_ptr<EQStream>> wants_write;
std::vector<std::shared_ptr<EQStream>>::iterator cur, end;
bool decay = false;
uint32 stream_count;
Timer DecayTimer(20);
WriterRunning = true;
DecayTimer.Enable();
while(sock!=-1) {
//if (!havework) {
//WriterWork.Wait();
//}
while (sock != -1) {
MWriterRunning.lock();
if (!WriterRunning)
break;
@@ -279,34 +268,36 @@ Timer DecayTimer(20);
havework = false;
wants_write.clear();
decay=DecayTimer.Check();
decay = DecayTimer.Check();
//copy streams into a seperate list so we dont have to keep
//MStreams locked while we are writting
// copy streams into a seperate list so we dont have to keep
// MStreams locked while we are writting
MStreams.lock();
for(stream_itr=Streams.begin();stream_itr!=Streams.end();++stream_itr) {
for (auto stream_itr = Streams.begin(); stream_itr != Streams.end(); ++stream_itr) {
// If it's time to decay the bytes sent, then let's do it before we try to write
if (decay)
stream_itr->second->Decay();
//bullshit checking, to see if this is really happening, GDB seems to think so...
if(stream_itr->second == nullptr) {
fprintf(stderr, "ERROR: nullptr Stream encountered in EQStreamFactory::WriterLoop for: %i", stream_itr->first.first, stream_itr->first.second);
// bullshit checking, to see if this is really happening, GDB seems to think so...
if (stream_itr->second == nullptr) {
fprintf(stderr,
"ERROR: nullptr Stream encountered in EQStreamFactory::WriterLoop for: %i:%i",
stream_itr->first.first, stream_itr->first.second);
continue;
}
if (stream_itr->second->HasOutgoingData()) {
havework=true;
havework = true;
stream_itr->second->PutInUse();
wants_write.push_back(stream_itr->second);
}
}
MStreams.unlock();
//do the actual writes
// do the actual writes
cur = wants_write.begin();
end = wants_write.end();
for(; cur != end; ++cur) {
for (; cur != end; ++cur) {
(*cur)->Write(sock);
(*cur)->ReleaseFromUse();
}
@@ -314,12 +305,10 @@ Timer DecayTimer(20);
Sleep(10);
MStreams.lock();
stream_count=Streams.size();
stream_count = Streams.size();
MStreams.unlock();
if (!stream_count) {
//std::cout << "No streams, waiting on condition" << std::endl;
WriterWork.Wait();
//std::cout << "Awake from condition, must have a stream now" << std::endl;
}
}
}
+9 -6
View File
@@ -2,13 +2,16 @@
#define _EQSTREAMFACTORY_H
#include <memory>
#include <queue>
#include <map>
#include "../common/eq_stream.h"
#include "../common/condition.h"
#include "../common/timeoutmgr.h"
#include "../common/opcodemgr.h"
#include "../common/timer.h"
class EQStream;
class Timer;
class EQStreamFactory : private Timeoutable {
private:
@@ -24,10 +27,10 @@ class EQStreamFactory : private Timeoutable {
EQStreamType StreamType;
std::queue<EQStream *> NewStreams;
std::queue<std::shared_ptr<EQStream>> NewStreams;
Mutex MNewStreams;
std::map<std::pair<uint32, uint16>,EQStream *> Streams;
std::map<std::pair<uint32, uint16>, std::shared_ptr<EQStream>> Streams;
Mutex MStreams;
virtual void CheckTimeout();
@@ -40,8 +43,8 @@ class EQStreamFactory : private Timeoutable {
EQStreamFactory(EQStreamType type, uint32 timeout = 135000) : Timeoutable(5000), stream_timeout(timeout) { ReaderRunning=false; WriterRunning=false; StreamType=type; sock=-1; }
EQStreamFactory(EQStreamType type, int port, uint32 timeout = 135000);
EQStream *Pop();
void Push(EQStream *s);
std::shared_ptr<EQStream> Pop();
void Push(std::shared_ptr<EQStream> s);
bool Open();
bool Open(unsigned long port) { Port=port; return Open(); }
+39 -37
View File
@@ -1,20 +1,22 @@
#include "debug.h"
#include <utility>
#include "global_define.h"
#include "eqemu_logsys.h"
#include "eq_stream_ident.h"
#include "eq_stream_proxy.h"
#include "logsys.h"
EQStreamIdentifier::~EQStreamIdentifier() {
while(!m_identified.empty()) {
m_identified.front()->ReleaseFromUse();
m_identified.pop();
}
std::vector<Record *>::iterator cur, end;
std::vector<Record>::iterator cur, end;
cur = m_streams.begin();
end = m_streams.end();
for(; cur != end; ++cur) {
Record *r = *cur;
r->stream->ReleaseFromUse();
delete r;
Record &r = *cur;
r.stream->ReleaseFromUse();
}
std::vector<Patch *>::iterator curp, endp;
curp = m_patches.begin();
@@ -25,7 +27,7 @@ EQStreamIdentifier::~EQStreamIdentifier() {
}
void EQStreamIdentifier::RegisterPatch(const EQStream::Signature &sig, const char *name, OpcodeManager ** opcodes, const StructStrategy *structs) {
Patch *p = new Patch;
auto p = new Patch;
p->signature = sig;
p->name = name;
p->opcodes = opcodes;
@@ -34,54 +36,52 @@ void EQStreamIdentifier::RegisterPatch(const EQStream::Signature &sig, const cha
}
void EQStreamIdentifier::Process() {
std::vector<Record *>::iterator cur;
std::vector<Record>::iterator cur;
std::vector<Patch *>::iterator curp, endp;
//foreach pending stream.
cur = m_streams.begin();
while(cur != m_streams.end()) {
Record *r = *cur;
Record &r = *cur;
//first see if this stream has expired
if(r->expire.Check(false)) {
if(r.expire.Check(false)) {
//this stream has failed to match any pattern in our timeframe.
_log(NET__IDENTIFY, "Unable to identify stream from %s:%d before timeout.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()));
r->stream->ReleaseFromUse();
delete r;
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before timeout.", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()));
r.stream->ReleaseFromUse();
cur = m_streams.erase(cur);
continue;
}
//then make sure the stream is still active
//if stream hasn't finished initializing then continue;
if(r->stream->GetState() == UNESTABLISHED)
if(r.stream->GetState() == UNESTABLISHED)
{
++cur;
continue;
}
if(r->stream->GetState() != ESTABLISHED) {
if(r.stream->GetState() != ESTABLISHED) {
//the stream closed before it was identified.
_log(NET__IDENTIFY, "Unable to identify stream from %s:%d before it closed.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()));
switch(r->stream->GetState())
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before it closed.", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()));
switch(r.stream->GetState())
{
case ESTABLISHED:
_log(NET__IDENTIFY, "Stream state was Established");
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Established");
break;
case CLOSING:
_log(NET__IDENTIFY, "Stream state was Closing");
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Closing");
break;
case DISCONNECTING:
_log(NET__IDENTIFY, "Stream state was Disconnecting");
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Disconnecting");
break;
case CLOSED:
_log(NET__IDENTIFY, "Stream state was Closed");
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Closed");
break;
default:
_log(NET__IDENTIFY, "Stream state was Unestablished or unknown");
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Unestablished or unknown");
break;
}
r->stream->ReleaseFromUse();
delete r;
r.stream->ReleaseFromUse();
cur = m_streams.erase(cur);
continue;
}
@@ -98,20 +98,23 @@ void EQStreamIdentifier::Process() {
Patch *p = *curp;
//ask the stream to see if it matches the supplied signature
EQStream::MatchState res = r->stream->CheckSignature(&p->signature);
EQStream::MatchState res = r.stream->CheckSignature(&p->signature);
switch(res) {
case EQStream::MatchNotReady:
//the stream has not received enough packets to compare with this signature
// _log(NET__IDENT_TRACE, "%s:%d: Tried patch %s, but stream is not ready for it.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str());
// Log.LogDebugType(Logs::General, Logs::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, but stream is not ready for it.", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()), p->name.c_str());
all_ready = false;
break;
case EQStream::MatchSuccessful: {
//yay, a match.
_log(NET__IDENTIFY, "Identified stream %s:%d with signature %s", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str());
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Identified stream %s:%d with signature %s", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()), p->name.c_str());
// before we assign the eqstream to an interface, let the stream recognize it is in use and the session should not be reset any further
r.stream->SetActive(true);
//might want to do something less-specific here... some day..
EQStreamInterface *s = new EQStreamProxy(r->stream, p->structs, p->opcodes);
EQStreamInterface *s = new EQStreamProxy(r.stream, p->structs, p->opcodes);
m_identified.push(s);
found_one = true;
@@ -119,7 +122,7 @@ void EQStreamIdentifier::Process() {
}
case EQStream::MatchFailed:
//do nothing...
_log(NET__IDENT_TRACE, "%s:%d: Tried patch %s, and it did not match.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str());
Log.Out(Logs::General, Logs::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, and it did not match.", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()), p->name.c_str());
break;
}
}
@@ -127,14 +130,13 @@ void EQStreamIdentifier::Process() {
//if we checked all patches and did not find a match.
if(all_ready && !found_one) {
//the stream cannot be identified.
_log(NET__IDENTIFY, "Unable to identify stream from %s:%d, no match found.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()));
r->stream->ReleaseFromUse();
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d, no match found.", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()));
r.stream->ReleaseFromUse();
}
//if we found a match, or were not able to identify it
if(found_one || all_ready) {
//cannot print ip/port here. r->stream is invalid.
delete r;
//cannot print ip/port here. r.stream is invalid.
cur = m_streams.erase(cur);
} else {
++cur;
@@ -142,8 +144,8 @@ void EQStreamIdentifier::Process() {
} //end foreach stream
}
void EQStreamIdentifier::AddStream(EQStream *&eqs) {
m_streams.push_back(new Record(eqs));
void EQStreamIdentifier::AddStream(std::shared_ptr<EQStream> &eqs) {
m_streams.push_back(Record(eqs));
eqs = nullptr;
}
@@ -155,8 +157,8 @@ EQStreamInterface *EQStreamIdentifier::PopIdentified() {
return(res);
}
EQStreamIdentifier::Record::Record(EQStream *s)
: stream(s),
EQStreamIdentifier::Record::Record(std::shared_ptr<EQStream> s)
: stream(std::move(s)),
expire(STREAM_IDENT_WAIT_MS)
{
}
+6 -5
View File
@@ -4,13 +4,14 @@
#include "eq_stream.h"
#include "timer.h"
#include <vector>
#include <string>
#include <queue>
#include <memory>
#define STREAM_IDENT_WAIT_MS 10000
class OpcodeManager;
class StructStrategy;
class EQStreamInterface;
class EQStreamIdentifier {
public:
@@ -21,7 +22,7 @@ public:
//main processing interface
void Process();
void AddStream(EQStream *& eqs);
void AddStream(std::shared_ptr<EQStream> &eqs);
EQStreamInterface *PopIdentified();
protected:
@@ -39,11 +40,11 @@ protected:
//pending streams..
class Record {
public:
Record(EQStream *s);
EQStream *stream; //we own this
Record(std::shared_ptr<EQStream> s);
std::shared_ptr<EQStream> stream; //we own this
Timer expire;
};
std::vector<Record *> m_streams; //we own these objects, and the streams contained in them.
std::vector<Record> m_streams; //we own these objects, and the streams contained in them.
std::queue<EQStreamInterface *> m_identified; //we own these objects
};
+2 -2
View File
@@ -4,7 +4,7 @@
//this is the only part of an EQStream that is seen by the application.
#include <string>
#include "clientversions.h"
#include "client_version.h" // inv2 watch
typedef enum {
ESTABLISHED,
@@ -35,7 +35,7 @@ public:
virtual const uint32 GetBytesRecieved() const { return 0; }
virtual const uint32 GetBytesSentPerSecond() const { return 0; }
virtual const uint32 GetBytesRecvPerSecond() const { return 0; }
virtual const EQClientVersion ClientVersion() const { return EQClientUnknown; }
virtual const EQEmu::versions::ClientVersion ClientVersion() const { return EQEmu::versions::ClientVersion::Unknown; }
};
#endif /*EQSTREAMINTF_H_*/
+3 -10
View File
@@ -1,11 +1,11 @@
#include "debug.h"
#include "global_define.h"
#include "eq_stream_proxy.h"
#include "eq_stream.h"
#include "struct_strategy.h"
EQStreamProxy::EQStreamProxy(EQStream *&stream, const StructStrategy *structs, OpcodeManager **opcodes)
EQStreamProxy::EQStreamProxy(std::shared_ptr<EQStream> &stream, const StructStrategy *structs, OpcodeManager **opcodes)
: m_stream(stream),
m_structs(structs),
m_opcodes(opcodes)
@@ -15,14 +15,13 @@ EQStreamProxy::EQStreamProxy(EQStream *&stream, const StructStrategy *structs, O
}
EQStreamProxy::~EQStreamProxy() {
//delete m_stream; //released by the stream factory.
}
std::string EQStreamProxy::Describe() const {
return(m_structs->Describe());
}
const EQClientVersion EQStreamProxy::ClientVersion() const
const EQEmu::versions::ClientVersion EQStreamProxy::ClientVersion() const
{
return m_structs->ClientVersion();
}
@@ -85,12 +84,6 @@ const uint32 EQStreamProxy::GetBytesRecvPerSecond() const
void EQStreamProxy::ReleaseFromUse() {
m_stream->ReleaseFromUse();
//this is so ugly, but I cant think of a better way to deal with
//it right now...
if(!m_stream->IsInUse()) {
delete this;
}
}
void EQStreamProxy::RemoveData() {
+5 -4
View File
@@ -4,8 +4,9 @@
#include "types.h"
#include "eq_stream_intf.h"
#include "eq_stream.h"
#include <memory>
class EQStream;
class StructStrategy;
class OpcodeManager;
class EQApplicationPacket;
@@ -13,7 +14,7 @@ class EQApplicationPacket;
class EQStreamProxy : public EQStreamInterface {
public:
//takes ownership of the stream.
EQStreamProxy(EQStream *&stream, const StructStrategy *structs, OpcodeManager **opcodes);
EQStreamProxy(std::shared_ptr<EQStream> &stream, const StructStrategy *structs, OpcodeManager **opcodes);
virtual ~EQStreamProxy();
//EQStreamInterface:
@@ -27,7 +28,7 @@ public:
virtual void RemoveData();
virtual bool CheckState(EQStreamState state);
virtual std::string Describe() const;
virtual const EQClientVersion ClientVersion() const;
virtual const EQEmu::versions::ClientVersion ClientVersion() const;
virtual const uint32 GetBytesSent() const;
virtual const uint32 GetBytesRecieved() const;
@@ -35,7 +36,7 @@ public:
virtual const uint32 GetBytesRecvPerSecond() const;
protected:
EQStream *const m_stream; //we own this stream object.
std::shared_ptr<EQStream> const m_stream; //we own this stream object.
const StructStrategy *const m_structs; //we do not own this object.
//this is a pointer to a pointer to make it less likely that a packet will
//reference an invalid opcode manager when they are being reloaded.
+2 -2
View File
@@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "debug.h"
#include "global_define.h"
#include "eqdb.h"
#include "database.h"
#include <mysql.h>
@@ -63,7 +63,7 @@ EQDBRes * EQDB::query(Const_char *q) {
//NOT THREAD SAFE!
Const_char *EQDB::escape_string(Const_char *from) {
int len = strlen(from);
char *res = new char[len*2+1];
auto res = new char[len * 2 + 1];
mysql_real_escape_string(mysql_ref,res,from,len);
+1 -1
View File
@@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "debug.h"
#include "global_define.h"
#include "eqdb_res.h"
#include <mysql.h>
+383 -297
View File
@@ -1,4 +1,4 @@
/* EQEMu: Everquest Server Emulator
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
@@ -15,392 +15,475 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
#include "../common/global_define.h"
#include "eqemu_config.h"
#include "misc_functions.h"
#include <iostream>
#include <sstream>
std::string EQEmuConfig::ConfigFile = "eqemu_config.xml";
EQEmuConfig *EQEmuConfig::_config = nullptr;
void EQEmuConfig::do_world(TiXmlElement *ele) {
void EQEmuConfig::do_world(TiXmlElement *ele)
{
const char *text;
TiXmlElement * sub_ele;;
text= ParseTextBlock(ele,"shortname");
if (text)
ShortName=text;
text = ParseTextBlock(ele,"longname");
if (text)
LongName=text;
text = ParseTextBlock(ele,"address",true);
if (text)
WorldAddress=text;
text = ParseTextBlock(ele,"localaddress",true);
if (text)
LocalAddress=text;
text = ParseTextBlock(ele,"maxclients",true);
if (text)
MaxClients=atoi(text);
text = ParseTextBlock(ele, "shortname");
if (text) {
ShortName = text;
}
text = ParseTextBlock(ele, "longname");
if (text) {
LongName = text;
}
text = ParseTextBlock(ele, "address", true);
if (text) {
WorldAddress = text;
}
text = ParseTextBlock(ele, "localaddress", true);
if (text) {
LocalAddress = text;
}
text = ParseTextBlock(ele, "maxclients", true);
if (text) {
MaxClients = atoi(text);
}
// Get the <key> element
text = ParseTextBlock(ele,"key",true);
if (text)
SharedKey=text;
text = ParseTextBlock(ele, "key", true);
if (text) {
SharedKey = text;
}
// Get the <loginserver> element
sub_ele = ele->FirstChildElement("loginserver");
if (sub_ele) {
text=ParseTextBlock(sub_ele,"host",true);
if (text)
LoginHost=text;
text=ParseTextBlock(sub_ele,"port",true);
if (text)
LoginPort=atoi(text);
text=ParseTextBlock(sub_ele,"account",true);
if (text)
LoginAccount=text;
text=ParseTextBlock(sub_ele,"password",true);
if (text)
LoginPassword=text;
text = ParseTextBlock(sub_ele, "host", true);
if (text) {
LoginHost = text;
}
text = ParseTextBlock(sub_ele, "port", true);
if (text) {
LoginPort = atoi(text);
}
text = ParseTextBlock(sub_ele, "account", true);
if (text) {
LoginAccount = text;
}
text = ParseTextBlock(sub_ele, "password", true);
if (text) {
LoginPassword = text;
}
} else {
char str[32];
do {
sprintf(str, "loginserver%i", ++LoginCount);
sub_ele = ele->FirstChildElement(str);
if (sub_ele) {
LoginConfig* loginconfig = new LoginConfig;
text=ParseTextBlock(sub_ele,"host",true);
if (text)
loginconfig->LoginHost=text;
text=ParseTextBlock(sub_ele,"port",true);
if (text)
loginconfig->LoginPort=atoi(text);
text=ParseTextBlock(sub_ele,"account",true);
if (text)
loginconfig->LoginAccount=text;
text=ParseTextBlock(sub_ele,"password",true);
if (text)
loginconfig->LoginPassword=text;
auto loginconfig = new LoginConfig;
text = ParseTextBlock(sub_ele, "host", true);
if (text) {
loginconfig->LoginHost = text;
}
text = ParseTextBlock(sub_ele, "port", true);
if (text) {
loginconfig->LoginPort = atoi(text);
}
text = ParseTextBlock(sub_ele, "account", true);
if (text) {
loginconfig->LoginAccount = text;
}
text = ParseTextBlock(sub_ele, "password", true);
if (text) {
loginconfig->LoginPassword = text;
}
loginlist.Insert(loginconfig);
}
} while(sub_ele);
} while (sub_ele);
}
// Check for locked
sub_ele = ele->FirstChildElement("locked");
if (sub_ele != nullptr)
Locked=true;
if (sub_ele != nullptr) {
Locked = true;
}
// Get the <tcp> element
sub_ele = ele->FirstChildElement("tcp");
if(sub_ele != nullptr) {
if (sub_ele != nullptr) {
text = sub_ele->Attribute("ip");
if (text)
WorldIP=text;
if (text) {
WorldIP = text;
}
text = sub_ele->Attribute("port");
if (text)
WorldTCPPort=atoi(text);
if (text) {
WorldTCPPort = atoi(text);
}
text = sub_ele->Attribute("telnet");
if (text && !strcasecmp(text,"enabled"))
TelnetEnabled=true;
if (text && !strcasecmp(text, "enabled")) {
TelnetEnabled = true;
}
}
// Get the <http> element
sub_ele = ele->FirstChildElement("http");
if(sub_ele != nullptr) {
if (sub_ele != nullptr) {
// text = sub_ele->Attribute("ip");
// if (text)
// WorldIP=text;
text = sub_ele->Attribute("mimefile");
if (text)
WorldHTTPMimeFile=text;
if (text) {
WorldHTTPMimeFile = text;
}
text = sub_ele->Attribute("port");
if (text)
WorldHTTPPort=atoi(text);
if (text) {
WorldHTTPPort = atoi(text);
}
text = sub_ele->Attribute("enabled");
if (text && !strcasecmp(text,"true"))
WorldHTTPEnabled=true;
if (text && !strcasecmp(text, "true")) {
WorldHTTPEnabled = true;
}
}
}
void EQEmuConfig::do_chatserver(TiXmlElement *ele) {
void EQEmuConfig::do_chatserver(TiXmlElement *ele)
{
const char *text;
text=ParseTextBlock(ele,"host",true);
if (text)
ChatHost=text;
text=ParseTextBlock(ele,"port",true);
if (text)
ChatPort=atoi(text);
text = ParseTextBlock(ele, "host", true);
if (text) {
ChatHost = text;
}
text = ParseTextBlock(ele, "port", true);
if (text) {
ChatPort = atoi(text);
}
}
void EQEmuConfig::do_mailserver(TiXmlElement *ele) {
void EQEmuConfig::do_mailserver(TiXmlElement *ele)
{
const char *text;
text=ParseTextBlock(ele,"host",true);
if (text)
MailHost=text;
text=ParseTextBlock(ele,"port",true);
if (text)
MailPort=atoi(text);
text = ParseTextBlock(ele, "host", true);
if (text) {
MailHost = text;
}
text = ParseTextBlock(ele, "port", true);
if (text) {
MailPort = atoi(text);
}
}
void EQEmuConfig::do_database(TiXmlElement *ele) {
void EQEmuConfig::do_database(TiXmlElement *ele)
{
const char *text;
text=ParseTextBlock(ele,"host",true);
if (text)
DatabaseHost=text;
text=ParseTextBlock(ele,"port",true);
if (text)
DatabasePort=atoi(text);
text=ParseTextBlock(ele,"username",true);
if (text)
DatabaseUsername=text;
text=ParseTextBlock(ele,"password",true);
if (text)
DatabasePassword=text;
text=ParseTextBlock(ele,"db",true);
if (text)
DatabaseDB=text;
text = ParseTextBlock(ele, "host", true);
if (text) {
DatabaseHost = text;
}
text = ParseTextBlock(ele, "port", true);
if (text) {
DatabasePort = atoi(text);
}
text = ParseTextBlock(ele, "username", true);
if (text) {
DatabaseUsername = text;
}
text = ParseTextBlock(ele, "password", true);
if (text) {
DatabasePassword = text;
}
text = ParseTextBlock(ele, "db", true);
if (text) {
DatabaseDB = text;
}
}
void EQEmuConfig::do_qsdatabase(TiXmlElement *ele) {
void EQEmuConfig::do_qsdatabase(TiXmlElement *ele)
{
const char *text;
text=ParseTextBlock(ele,"host",true);
if (text)
QSDatabaseHost=text;
text=ParseTextBlock(ele,"port",true);
if (text)
QSDatabasePort=atoi(text);
text=ParseTextBlock(ele,"username",true);
if (text)
QSDatabaseUsername=text;
text=ParseTextBlock(ele,"password",true);
if (text)
QSDatabasePassword=text;
text=ParseTextBlock(ele,"db",true);
if (text)
QSDatabaseDB=text;
text = ParseTextBlock(ele, "host", true);
if (text) {
QSDatabaseHost = text;
}
text = ParseTextBlock(ele, "port", true);
if (text) {
QSDatabasePort = atoi(text);
}
text = ParseTextBlock(ele, "username", true);
if (text) {
QSDatabaseUsername = text;
}
text = ParseTextBlock(ele, "password", true);
if (text) {
QSDatabasePassword = text;
}
text = ParseTextBlock(ele, "db", true);
if (text) {
QSDatabaseDB = text;
}
}
void EQEmuConfig::do_zones(TiXmlElement *ele) {
void EQEmuConfig::do_zones(TiXmlElement *ele)
{
const char *text;
TiXmlElement *sub_ele;
// TiXmlNode *node,*sub_node;
text=ParseTextBlock(ele,"defaultstatus",true);
if (text)
DefaultStatus=atoi(text);
text = ParseTextBlock(ele, "defaultstatus", true);
if (text) {
DefaultStatus = atoi(text);
}
// Get the <ports> element
sub_ele = ele->FirstChildElement("ports");
if(sub_ele != nullptr) {
if (sub_ele != nullptr) {
text = sub_ele->Attribute("low");
if (text)
ZonePortLow=atoi(text);;
if (text) {
ZonePortLow = atoi(text);
};
text = sub_ele->Attribute("high");
if (text)
ZonePortHigh=atoi(text);
if (text) {
ZonePortHigh = atoi(text);
}
}
}
void EQEmuConfig::do_files(TiXmlElement *ele) {
void EQEmuConfig::do_files(TiXmlElement *ele)
{
const char *text;
text=ParseTextBlock(ele,"spells",true);
if (text)
SpellsFile=text;
text=ParseTextBlock(ele,"opcodes",true);
if (text)
OpCodesFile=text;
text=ParseTextBlock(ele,"logsettings",true);
if (text)
LogSettingsFile=text;
text=ParseTextBlock(ele,"eqtime",true);
if (text)
EQTimeFile=text;
text = ParseTextBlock(ele, "spells", true);
if (text) {
SpellsFile = text;
}
text = ParseTextBlock(ele, "opcodes", true);
if (text) {
OpCodesFile = text;
}
text = ParseTextBlock(ele, "plugin.pl", true);
if (text) {
PluginPlFile = text;
}
}
void EQEmuConfig::do_directories(TiXmlElement *ele) {
void EQEmuConfig::do_directories(TiXmlElement *ele)
{
const char *text;
text=ParseTextBlock(ele,"maps",true);
if (text)
MapDir=text;
text=ParseTextBlock(ele,"quests",true);
if (text)
QuestDir=text;
text=ParseTextBlock(ele,"plugins",true);
if (text)
PluginDir=text;
text = ParseTextBlock(ele, "maps", true);
if (text) {
MapDir = text;
if ( MapDir.back() != '/' )
MapDir += '/';
}
text = ParseTextBlock(ele, "quests", true);
if (text) {
QuestDir = text;
if ( QuestDir.back() != '/' )
QuestDir += '/';
}
text = ParseTextBlock(ele, "plugins", true);
if (text) {
PluginDir = text;
if ( PluginDir.back() != '/' )
PluginDir += '/';
}
text = ParseTextBlock(ele, "lua_modules", true);
if (text) {
LuaModuleDir = text;
if ( LuaModuleDir.back() != '/' )
LuaModuleDir += '/';
}
text = ParseTextBlock(ele, "patches", true);
if (text) {
PatchDir = text;
if ( PatchDir.back() != '/' )
PatchDir += '/';
}
text = ParseTextBlock(ele, "shared_memory", true);
if (text) {
SharedMemDir = text;
if ( SharedMemDir.back() != '/' )
SharedMemDir += '/';
}
//Not Fully Implemented yet LogDir
text = ParseTextBlock(ele, "logs", true);
if (text) {
LogDir = text;
if ( LogDir.back() != '/' )
LogDir += '/';
}
}
void EQEmuConfig::do_launcher(TiXmlElement *ele) {
void EQEmuConfig::do_launcher(TiXmlElement *ele)
{
const char *text;
TiXmlElement *sub_ele;
text=ParseTextBlock(ele,"logprefix",true);
if (text)
text = ParseTextBlock(ele, "logprefix", true);
if (text) {
LogPrefix = text;
text=ParseTextBlock(ele,"logsuffix",true);
if (text)
}
text = ParseTextBlock(ele, "logsuffix", true);
if (text) {
LogSuffix = text;
}
// Get the <exe> element
text = ParseTextBlock(ele,"exe",true);
if (text)
text = ParseTextBlock(ele, "exe", true);
if (text) {
ZoneExe = text;
}
// Get the <timers> element
sub_ele = ele->FirstChildElement("timers");
if(sub_ele != nullptr) {
if (sub_ele != nullptr) {
text = sub_ele->Attribute("restart");
if (text)
if (text) {
RestartWait = atoi(text);
}
text = sub_ele->Attribute("reterminate");
if (text)
if (text) {
TerminateWait = atoi(text);
}
text = sub_ele->Attribute("initial");
if (text)
if (text) {
InitialBootWait = atoi(text);
}
text = sub_ele->Attribute("interval");
if (text)
if (text) {
ZoneBootInterval = atoi(text);
}
}
}
std::string EQEmuConfig::GetByName(const std::string &var_name) const {
if(var_name == "ShortName")
return(ShortName);
if(var_name == "LongName")
return(LongName);
if(var_name == "WorldAddress")
return(WorldAddress);
if(var_name == "LoginHost")
return(LoginHost);
if(var_name == "LoginAccount")
return(LoginAccount);
if(var_name == "LoginPassword")
return(LoginPassword);
if(var_name == "LoginPort")
return(itoa(LoginPort));
if(var_name == "Locked")
return(Locked?"true":"false");
if(var_name == "WorldTCPPort")
return(itoa(WorldTCPPort));
if(var_name == "WorldIP")
return(WorldIP);
if(var_name == "TelnetEnabled")
return(TelnetEnabled?"true":"false");
if(var_name == "WorldHTTPPort")
return(itoa(WorldHTTPPort));
if(var_name == "WorldHTTPMimeFile")
return(WorldHTTPMimeFile);
if(var_name == "WorldHTTPEnabled")
return(WorldHTTPEnabled?"true":"false");
if(var_name == "ChatHost")
return(ChatHost);
if(var_name == "ChatPort")
return(itoa(ChatPort));
if(var_name == "MailHost")
return(MailHost);
if(var_name == "MailPort")
return(itoa(MailPort));
if(var_name == "DatabaseHost")
return(DatabaseHost);
if(var_name == "DatabaseUsername")
return(DatabaseUsername);
if(var_name == "DatabasePassword")
return(DatabasePassword);
if(var_name == "DatabaseDB")
return(DatabaseDB);
if(var_name == "DatabasePort")
return(itoa(DatabasePort));
if(var_name == "QSDatabaseHost")
return(QSDatabaseHost);
if(var_name == "QSDatabaseUsername")
return(QSDatabaseUsername);
if(var_name == "QSDatabasePassword")
return(QSDatabasePassword);
if(var_name == "QSDatabaseDB")
return(QSDatabaseDB);
if(var_name == "QSDatabasePort")
return(itoa(QSDatabasePort));
if(var_name == "SpellsFile")
return(SpellsFile);
if(var_name == "OpCodesFile")
return(OpCodesFile);
if(var_name == "EQTimeFile")
return(EQTimeFile);
if(var_name == "LogSettingsFile")
return(LogSettingsFile);
if(var_name == "MapDir")
return(MapDir);
if(var_name == "QuestDir")
return(QuestDir);
if(var_name == "PluginDir")
return(PluginDir);
if(var_name == "LogPrefix")
return(LogPrefix);
if(var_name == "LogSuffix")
return(LogSuffix);
if(var_name == "ZoneExe")
return(ZoneExe);
if(var_name == "ZonePortLow")
return(itoa(ZonePortLow));
if(var_name == "ZonePortHigh")
return(itoa(ZonePortHigh));
if(var_name == "DefaultStatus")
return(itoa(DefaultStatus));
std::string EQEmuConfig::GetByName(const std::string &var_name) const
{
if (var_name == "ShortName") {
return (ShortName);
}
if (var_name == "LongName") {
return (LongName);
}
if (var_name == "WorldAddress") {
return (WorldAddress);
}
if (var_name == "LoginHost") {
return (LoginHost);
}
if (var_name == "LoginAccount") {
return (LoginAccount);
}
if (var_name == "LoginPassword") {
return (LoginPassword);
}
if (var_name == "LoginPort") {
return (itoa(LoginPort));
}
if (var_name == "Locked") {
return (Locked ? "true" : "false");
}
if (var_name == "WorldTCPPort") {
return (itoa(WorldTCPPort));
}
if (var_name == "WorldIP") {
return (WorldIP);
}
if (var_name == "TelnetEnabled") {
return (TelnetEnabled ? "true" : "false");
}
if (var_name == "WorldHTTPPort") {
return (itoa(WorldHTTPPort));
}
if (var_name == "WorldHTTPMimeFile") {
return (WorldHTTPMimeFile);
}
if (var_name == "WorldHTTPEnabled") {
return (WorldHTTPEnabled ? "true" : "false");
}
if (var_name == "ChatHost") {
return (ChatHost);
}
if (var_name == "ChatPort") {
return (itoa(ChatPort));
}
if (var_name == "MailHost") {
return (MailHost);
}
if (var_name == "MailPort") {
return (itoa(MailPort));
}
if (var_name == "DatabaseHost") {
return (DatabaseHost);
}
if (var_name == "DatabaseUsername") {
return (DatabaseUsername);
}
if (var_name == "DatabasePassword") {
return (DatabasePassword);
}
if (var_name == "DatabaseDB") {
return (DatabaseDB);
}
if (var_name == "DatabasePort") {
return (itoa(DatabasePort));
}
if (var_name == "QSDatabaseHost") {
return (QSDatabaseHost);
}
if (var_name == "QSDatabaseUsername") {
return (QSDatabaseUsername);
}
if (var_name == "QSDatabasePassword") {
return (QSDatabasePassword);
}
if (var_name == "QSDatabaseDB") {
return (QSDatabaseDB);
}
if (var_name == "QSDatabasePort") {
return (itoa(QSDatabasePort));
}
if (var_name == "SpellsFile") {
return (SpellsFile);
}
if (var_name == "OpCodesFile") {
return (OpCodesFile);
}
if (var_name == "PluginPlFile") {
return (PluginPlFile);
}
if (var_name == "MapDir") {
return (MapDir);
}
if (var_name == "QuestDir") {
return (QuestDir);
}
if (var_name == "PluginDir") {
return (PluginDir);
}
if (var_name == "LuaModuleDir") {
return (LuaModuleDir);
}
if (var_name == "PatchDir") {
return (PatchDir);
}
if (var_name == "SharedMemDir") {
return (SharedMemDir);
}
if (var_name == "LogDir") {
return (LogDir);
}
if (var_name == "LogPrefix") {
return (LogPrefix);
}
if (var_name == "LogSuffix") {
return (LogSuffix);
}
if (var_name == "ZoneExe") {
return (ZoneExe);
}
if (var_name == "ZonePortLow") {
return (itoa(ZonePortLow));
}
if (var_name == "ZonePortHigh") {
return (itoa(ZonePortHigh));
}
if (var_name == "DefaultStatus") {
return (itoa(DefaultStatus));
}
// if(var_name == "DynamicCount")
// return(itoa(DynamicCount));
return("");
return ("");
}
void EQEmuConfig::Dump() const
@@ -435,11 +518,14 @@ void EQEmuConfig::Dump() const
std::cout << "QSDatabasePort = " << QSDatabasePort << std::endl;
std::cout << "SpellsFile = " << SpellsFile << std::endl;
std::cout << "OpCodesFile = " << OpCodesFile << std::endl;
std::cout << "EQTimeFile = " << EQTimeFile << std::endl;
std::cout << "LogSettingsFile = " << LogSettingsFile << std::endl;
std::cout << "PluginPlFile = " << PluginPlFile << std::endl;
std::cout << "MapDir = " << MapDir << std::endl;
std::cout << "QuestDir = " << QuestDir << std::endl;
std::cout << "PluginDir = " << PluginDir << std::endl;
std::cout << "LuaModuleDir = " << LuaModuleDir << std::endl;
std::cout << "PatchDir = " << PatchDir << std::endl;
std::cout << "SharedMemDir = " << SharedMemDir << std::endl;
std::cout << "LogDir = " << LogDir << std::endl;
std::cout << "ZonePortLow = " << ZonePortLow << std::endl;
std::cout << "ZonePortHigh = " << ZonePortHigh << std::endl;
std::cout << "DefaultStatus = " << (int)DefaultStatus << std::endl;
+166 -167
View File
@@ -1,4 +1,4 @@
/* EQEMu: Everquest Server Emulator
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
@@ -28,200 +28,199 @@ struct LoginConfig {
uint16 LoginPort;
};
class EQEmuConfig : public XMLParser {
public:
virtual std::string GetByName(const std::string &var_name) const;
class EQEmuConfig : public XMLParser
{
public:
virtual std::string GetByName(const std::string &var_name) const;
// From <world/>
std::string ShortName;
std::string LongName;
std::string WorldAddress;
std::string LocalAddress;
std::string LoginHost;
std::string LoginAccount;
std::string LoginPassword;
uint16 LoginPort;
uint32 LoginCount;
LinkedList<LoginConfig*> loginlist;
bool Locked;
uint16 WorldTCPPort;
std::string WorldIP;
bool TelnetEnabled;
int32 MaxClients;
bool WorldHTTPEnabled;
uint16 WorldHTTPPort;
std::string WorldHTTPMimeFile;
std::string SharedKey;
// From <world/>
std::string ShortName;
std::string LongName;
std::string WorldAddress;
std::string LocalAddress;
std::string LoginHost;
std::string LoginAccount;
std::string LoginPassword;
uint16 LoginPort;
uint32 LoginCount;
LinkedList<LoginConfig*> loginlist;
bool Locked;
uint16 WorldTCPPort;
std::string WorldIP;
bool TelnetEnabled;
int32 MaxClients;
bool WorldHTTPEnabled;
uint16 WorldHTTPPort;
std::string WorldHTTPMimeFile;
std::string SharedKey;
// From <chatserver/>
std::string ChatHost;
uint16 ChatPort;
// From <chatserver/>
std::string ChatHost;
uint16 ChatPort;
// From <mailserver/>
std::string MailHost;
uint16 MailPort;
// From <mailserver/>
std::string MailHost;
uint16 MailPort;
// From <database/>
std::string DatabaseHost;
std::string DatabaseUsername;
std::string DatabasePassword;
std::string DatabaseDB;
uint16 DatabasePort;
// From <database/>
std::string DatabaseHost;
std::string DatabaseUsername;
std::string DatabasePassword;
std::string DatabaseDB;
uint16 DatabasePort;
// From <qsdatabase> // QueryServ
std::string QSDatabaseHost;
std::string QSDatabaseUsername;
std::string QSDatabasePassword;
std::string QSDatabaseDB;
uint16 QSDatabasePort;
// From <qsdatabase> // QueryServ
std::string QSDatabaseHost;
std::string QSDatabaseUsername;
std::string QSDatabasePassword;
std::string QSDatabaseDB;
uint16 QSDatabasePort;
// From <files/>
std::string SpellsFile;
std::string OpCodesFile;
std::string EQTimeFile;
std::string LogSettingsFile;
// From <files/>
std::string SpellsFile;
std::string OpCodesFile;
std::string PluginPlFile;
// From <directories/>
std::string MapDir;
std::string QuestDir;
std::string PluginDir;
// From <directories/>
std::string MapDir;
std::string QuestDir;
std::string PluginDir;
std::string LuaModuleDir;
std::string PatchDir;
std::string SharedMemDir;
std::string LogDir;
// From <launcher/>
std::string LogPrefix;
std::string LogSuffix;
std::string ZoneExe;
uint32 RestartWait;
uint32 TerminateWait;
uint32 InitialBootWait;
uint32 ZoneBootInterval;
// From <launcher/>
std::string LogPrefix;
std::string LogSuffix;
std::string ZoneExe;
uint32 RestartWait;
uint32 TerminateWait;
uint32 InitialBootWait;
uint32 ZoneBootInterval;
// From <zones/>
uint16 ZonePortLow;
uint16 ZonePortHigh;
uint8 DefaultStatus;
// From <zones/>
uint16 ZonePortLow;
uint16 ZonePortHigh;
uint8 DefaultStatus;
// uint16 DynamicCount;
// map<string,uint16> StaticZones;
protected:
protected:
static EQEmuConfig *_config;
static EQEmuConfig *_config;
static std::string ConfigFile;
static std::string ConfigFile;
#define ELEMENT(name) \
void do_##name(TiXmlElement *ele);
#include "eqemu_config_elements.h"
#include "eqemu_config_elements.h"
EQEmuConfig() {
// import the needed handler prototypes
EQEmuConfig()
{
// import the needed handler prototypes
#define ELEMENT(name) \
Handlers[#name]=(ElementHandler)&EQEmuConfig::do_##name;
#include "eqemu_config_elements.h"
Handlers[#name]=(ElementHandler)&EQEmuConfig::do_##name;
#include "eqemu_config_elements.h"
// Set sane defaults
// Login server
LoginHost = "eqemulator.net";
LoginPort = 5998;
// World
Locked = false;
WorldTCPPort = 9000;
TelnetEnabled = false;
WorldHTTPEnabled = false;
WorldHTTPPort = 9080;
WorldHTTPMimeFile = "mime.types";
SharedKey = ""; //blank disables authentication
// Mail
ChatHost = "eqchat.eqemulator.net";
ChatPort = 7778;
// Mail
MailHost = "eqmail.eqemulator.net";
MailPort = 7779;
// Mysql
DatabaseHost = "localhost";
DatabasePort = 3306;
DatabaseUsername = "eq";
DatabasePassword = "eq";
DatabaseDB = "eq";
// QueryServ Database
QSDatabaseHost = "localhost";
QSDatabasePort = 3306;
QSDatabaseUsername = "eq";
QSDatabasePassword = "eq";
QSDatabaseDB = "eq";
// Files
SpellsFile = "spells_us.txt";
OpCodesFile = "opcodes.conf";
PluginPlFile = "plugin.pl";
// Dirs
MapDir = "Maps/";
QuestDir = "quests/";
PluginDir = "plugins/";
LuaModuleDir = "lua_modules/";
PatchDir = "./";
SharedMemDir = "shared/";
LogDir = "logs/";
// Set sane defaults
// Launcher
LogPrefix = "logs/zone-";
LogSuffix = ".log";
RestartWait = 10000; //milliseconds
TerminateWait = 10000; //milliseconds
InitialBootWait = 20000; //milliseconds
ZoneBootInterval = 2000; //milliseconds
#ifdef WIN32
ZoneExe = "zone.exe";
#else
ZoneExe = "./zone";
#endif
// Zones
ZonePortLow = 7000;
ZonePortHigh = 7999;
DefaultStatus = 0;
// For where zones need to connect to.
WorldIP = "127.0.0.1";
// Dynamics to start
//DynamicCount=5;
MaxClients = -1;
LoginCount = 0;
}
virtual ~EQEmuConfig() {}
// Login server
LoginHost="eqemulator.net";
LoginPort=5998;
public:
// World
Locked=false;
WorldTCPPort=9000;
TelnetEnabled=false;
WorldHTTPEnabled=false;
WorldHTTPPort=9080;
WorldHTTPMimeFile="mime.types";
SharedKey = ""; //blank disables authentication
// Produce a const singleton
static const EQEmuConfig *get()
{
if (_config == nullptr) {
LoadConfig();
}
return (_config);
}
// Mail
ChatHost="eqchat.eqemulator.net";
ChatPort=7778;
// Allow the use to set the conf file to be used.
static void SetConfigFile(std::string file)
{
EQEmuConfig::ConfigFile = file;
}
// Mail
MailHost="eqmail.eqemulator.net";
MailPort=7779;
// Load the config
static bool LoadConfig()
{
if (_config != nullptr) {
delete _config;
}
_config = new EQEmuConfig;
return _config->ParseFile(EQEmuConfig::ConfigFile.c_str(), "server");
}
// Mysql
DatabaseHost="localhost";
DatabasePort=3306;
DatabaseUsername="eq";
DatabasePassword="eq";
DatabaseDB="eq";
// QueryServ Database
QSDatabaseHost="localhost";
QSDatabasePort=3306;
QSDatabaseUsername="eq";
QSDatabasePassword="eq";
QSDatabaseDB="eq";
// Files
SpellsFile="spells_us.txt";
OpCodesFile="opcodes.conf";
EQTimeFile="eqtime.cfg";
LogSettingsFile="log.ini";
// Dirs
MapDir="Maps";
QuestDir="quests";
PluginDir="plugins";
// Launcher
LogPrefix = "logs/zone-";
LogSuffix = ".log";
RestartWait = 10000; //milliseconds
TerminateWait = 10000; //milliseconds
InitialBootWait = 20000; //milliseconds
ZoneBootInterval = 2000; //milliseconds
#ifdef WIN32
ZoneExe = "zone.exe";
#else
ZoneExe = "./zone";
#endif
// Zones
ZonePortLow=7000;
ZonePortHigh=7999;
DefaultStatus=0;
// For where zones need to connect to.
WorldIP="127.0.0.1";
// Dynamics to start
//DynamicCount=5;
MaxClients=-1;
LoginCount=0;
}
virtual ~EQEmuConfig() {}
public:
// Produce a const singleton
static const EQEmuConfig *get() {
if (_config == nullptr)
LoadConfig();
return(_config);
}
// Allow the use to set the conf file to be used.
static void SetConfigFile(std::string file) { EQEmuConfig::ConfigFile = file; }
// Load the config
static bool LoadConfig() {
if (_config != nullptr)
delete _config;
_config=new EQEmuConfig;
return _config->ParseFile(EQEmuConfig::ConfigFile.c_str(),"server");
}
void Dump() const;
void Dump() const;
};
#endif
-135
View File
@@ -1,135 +0,0 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef _WINDOWS
#include <windows.h>
#endif
#include "eqemu_error.h"
#include "linked_list.h"
#include "mutex.h"
#include "misc_functions.h"
#include <stdio.h>
#include <string.h>
#ifdef _WINDOWS
#include <conio.h>
#endif
void UpdateWindowTitle(char* iNewTitle = 0);
void CatchSignal(int sig_num);
const char* EQEMuErrorText[EQEMuError_MaxErrorID] = { "ErrorID# 0, No Error",
"MySQL Error #1405 or #2001 means your mysql server rejected the username and password you presented it.",
"MySQL Error #2003 means you were unable to connect to the mysql server.",
"MySQL Error #2005 means you there are too many connections on the mysql server. The server is overloaded.",
"MySQL Error #2007 means you the server is out of memory. The server is overloaded.",
};
LinkedList<char*>* EQEMuErrorList;
Mutex* MEQEMuErrorList;
AutoDelete< LinkedList<char*> > ADEQEMuErrorList(&EQEMuErrorList);
AutoDelete<Mutex> ADMEQEMuErrorList(&MEQEMuErrorList);
const char* GetErrorText(uint32 iError) {
if (iError >= EQEMuError_MaxErrorID)
return "ErrorID# out of range";
else
return EQEMuErrorText[iError];
}
void AddEQEMuError(eEQEMuError iError, bool iExitNow) {
if (!iError)
return;
if (!EQEMuErrorList) {
EQEMuErrorList = new LinkedList<char*>;
MEQEMuErrorList = new Mutex;
}
LockMutex lock(MEQEMuErrorList);
LinkedListIterator<char*> iterator(*EQEMuErrorList);
iterator.Reset();
while (iterator.MoreElements()) {
if (iterator.GetData()[0] == 1) {
//Umm... this gets a big WTF...
// if (*((uint32*) iterator.GetData()[1]) == iError)
//not sure whats going on, using a character as a pointer....
if (*((eEQEMuError*) &(iterator.GetData()[1])) == iError)
return;
}
iterator.Advance();
}
char* tmp = new char[6];
tmp[0] = 1;
tmp[5] = 0;
*((uint32*) &tmp[1]) = iError;
EQEMuErrorList->Append(tmp);
if (iExitNow)
CatchSignal(2);
}
void AddEQEMuError(char* iError, bool iExitNow) {
if (!iError)
return;
if (!EQEMuErrorList) {
EQEMuErrorList = new LinkedList<char*>;
MEQEMuErrorList = new Mutex;
}
LockMutex lock(MEQEMuErrorList);
char* tmp = strcpy(new char[strlen(iError) + 1], iError);
EQEMuErrorList->Append(tmp);
if (iExitNow)
CatchSignal(2);
}
uint32 CheckEQEMuError() {
if (!EQEMuErrorList)
return 0;
uint32 ret = 0;
char* tmp = 0;
bool HeaderPrinted = false;
LockMutex lock(MEQEMuErrorList);
while ((tmp = EQEMuErrorList->Pop() )) {
if (!HeaderPrinted) {
fprintf(stdout, "===============================\nRuntime errors:\n\n");
HeaderPrinted = true;
}
if (tmp[0] == 1) {
fprintf(stdout, "%s\n", GetErrorText(*((uint32*) &tmp[1])));
fprintf(stdout, "For more information on this error, visit http://www.eqemu.net/eqemuerror.php?id=%u\n\n", *((uint32*) &tmp[1]));
}
else {
fprintf(stdout, "%s\n\n", tmp);
}
safe_delete(tmp);
ret++;
}
return ret;
}
void CheckEQEMuErrorAndPause() {
#ifdef _WINDOWS
if (CheckEQEMuError()) {
fprintf(stdout, "Hit any key to exit\n");
UpdateWindowTitle("Error");
getch();
}
#endif
}
+351
View File
@@ -0,0 +1,351 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2015 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "eqemu_logsys.h"
#include "platform.h"
#include "string_util.h"
#include "database.h"
#include "misc.h"
#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
#include <time.h>
#include <sys/stat.h>
std::ofstream process_log;
#ifdef _WINDOWS
#include <direct.h>
#include <conio.h>
#include <iostream>
#include <dos.h>
#include <windows.h>
#include <process.h>
#else
#include <unistd.h>
#include <sys/stat.h>
#endif
/* Linux ANSI console color defines */
#define LC_RESET "\033[0m"
#define LC_BLACK "\033[30m" /* Black */
#define LC_RED "\033[31m" /* Red */
#define LC_GREEN "\033[32m" /* Green */
#define LC_YELLOW "\033[33m" /* Yellow */
#define LC_BLUE "\033[34m" /* Blue */
#define LC_MAGENTA "\033[35m" /* Magenta */
#define LC_CYAN "\033[36m" /* Cyan */
#define LC_WHITE "\033[37m" /* White */
namespace Console {
enum Color {
Black = 0,
Blue = 1,
Green = 2,
Cyan = 3,
Red = 4,
Magenta = 5,
Brown = 6,
LightGray = 7,
DarkGray = 8,
LightBlue = 9,
LightGreen = 10,
LightCyan = 11,
LightRed = 12,
LightMagenta = 13,
Yellow = 14,
White = 15
};
}
EQEmuLogSys::EQEmuLogSys()
{
on_log_gmsay_hook = [](uint16 log_type, const std::string&) {};
bool file_logs_enabled = false;
int log_platform = 0;
}
EQEmuLogSys::~EQEmuLogSys()
{
}
void EQEmuLogSys::LoadLogSettingsDefaults()
{
/* Get Executable platform currently running this code (Zone/World/etc) */
log_platform = GetExecutablePlatformInt();
/* Zero out Array */
memset(log_settings, 0, sizeof(LogSettings) * Logs::LogCategory::MaxCategoryID);
/* Set Defaults */
log_settings[Logs::World_Server].log_to_console = Logs::General;
log_settings[Logs::Zone_Server].log_to_console = Logs::General;
log_settings[Logs::QS_Server].log_to_console = Logs::General;
log_settings[Logs::UCS_Server].log_to_console = Logs::General;
log_settings[Logs::Crash].log_to_console = Logs::General;
log_settings[Logs::MySQLError].log_to_console = Logs::General;
log_settings[Logs::Login_Server].log_to_console = Logs::General;
/* Declare process file names for log writing
If there is no process_file_name declared, no log file will be written, simply
*/
if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformWorld)
platform_file_name = "world";
else if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformQueryServ)
platform_file_name = "query_server";
else if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone)
platform_file_name = "zone";
else if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformUCS)
platform_file_name = "ucs";
else if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformLogin)
platform_file_name = "login";
else if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformLaunch)
platform_file_name = "launcher";
}
std::string EQEmuLogSys::FormatOutMessageString(uint16 log_category, const std::string &in_message)
{
std::string category_string;
if (log_category > 0 && Logs::LogCategoryName[log_category])
category_string = StringFormat("[%s] ", Logs::LogCategoryName[log_category]);
return StringFormat("%s%s", category_string.c_str(), in_message.c_str());
}
void EQEmuLogSys::ProcessGMSay(uint16 debug_level, uint16 log_category, const std::string &message)
{
/* Check if category enabled for process */
if (log_settings[log_category].log_to_gmsay == 0)
return;
/* Enabling Netcode based GMSay output creates a feedback loop that ultimately ends in a crash */
if (log_category == Logs::LogCategory::Netcode)
return;
/* Make sure the message inbound is at a debug level we're set at */
if (log_settings[log_category].log_to_gmsay < debug_level)
return;
/* Check to see if the process that actually ran this is zone */
if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone)
on_log_gmsay_hook(log_category, message);
}
void EQEmuLogSys::ProcessLogWrite(uint16 debug_level, uint16 log_category, const std::string &message)
{
if (log_category == Logs::Crash) {
char time_stamp[80];
EQEmuLogSys::SetCurrentTimeStamp(time_stamp);
std::ofstream crash_log;
EQEmuLogSys::MakeDirectory("logs/crashes");
crash_log.open(StringFormat("logs/crashes/crash_%s_%i.log", platform_file_name.c_str(), getpid()), std::ios_base::app | std::ios_base::out);
crash_log << time_stamp << " " << message << "\n";
crash_log.close();
}
/* Check if category enabled for process */
if (log_settings[log_category].log_to_file == 0)
return;
/* Make sure the message inbound is at a debug level we're set at */
if (log_settings[log_category].log_to_file < debug_level)
return;
char time_stamp[80];
EQEmuLogSys::SetCurrentTimeStamp(time_stamp);
if (process_log)
process_log << time_stamp << " " << message << std::endl;
}
uint16 EQEmuLogSys::GetWindowsConsoleColorFromCategory(uint16 log_category) {
switch (log_category) {
case Logs::Status:
case Logs::Normal:
return Console::Color::Yellow;
case Logs::MySQLError:
case Logs::Error:
return Console::Color::LightRed;
case Logs::MySQLQuery:
case Logs::Debug:
return Console::Color::LightGreen;
case Logs::Quests:
return Console::Color::LightCyan;
case Logs::Commands:
case Logs::Mercenaries:
return Console::Color::LightMagenta;
case Logs::Crash:
return Console::Color::LightRed;
default:
return Console::Color::Yellow;
}
}
std::string EQEmuLogSys::GetLinuxConsoleColorFromCategory(uint16 log_category) {
switch (log_category) {
case Logs::Status:
case Logs::Normal:
return LC_YELLOW;
case Logs::MySQLError:
case Logs::Error:
return LC_RED;
case Logs::MySQLQuery:
case Logs::Debug:
return LC_GREEN;
case Logs::Quests:
return LC_CYAN;
case Logs::Commands:
case Logs::Mercenaries:
return LC_MAGENTA;
case Logs::Crash:
return LC_RED;
default:
return LC_YELLOW;
}
}
uint16 EQEmuLogSys::GetGMSayColorFromCategory(uint16 log_category) {
switch (log_category) {
case Logs::Status:
case Logs::Normal:
return 15; /* Yellow */
case Logs::MySQLError:
case Logs::Error:
return 13; /* Red */
case Logs::MySQLQuery:
case Logs::Debug:
return 14; /* Light Green */
case Logs::Quests:
return 258; /* Light Cyan */
case Logs::Commands:
case Logs::Mercenaries:
return 5; /* Light Purple */
case Logs::Crash:
return 13; /* Red */
default:
return 15; /* Yellow */
}
}
void EQEmuLogSys::ProcessConsoleMessage(uint16 debug_level, uint16 log_category, const std::string &message)
{
/* Check if category enabled for process */
if (log_settings[log_category].log_to_console == 0)
return;
/* Make sure the message inbound is at a debug level we're set at */
if (log_settings[log_category].log_to_console < debug_level)
return;
#ifdef _WINDOWS
HANDLE console_handle;
console_handle = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_FONT_INFOEX info = { 0 };
info.cbSize = sizeof(info);
info.dwFontSize.Y = 12; // leave X as zero
info.FontWeight = FW_NORMAL;
wcscpy(info.FaceName, L"Lucida Console");
SetCurrentConsoleFontEx(console_handle, NULL, &info);
SetConsoleTextAttribute(console_handle, EQEmuLogSys::GetWindowsConsoleColorFromCategory(log_category));
std::cout << message << "\n";
SetConsoleTextAttribute(console_handle, Console::Color::White);
#else
std::cout << EQEmuLogSys::GetLinuxConsoleColorFromCategory(log_category) << message << LC_RESET << std::endl;
#endif
}
void EQEmuLogSys::Out(Logs::DebugLevel debug_level, uint16 log_category, std::string message, ...)
{
const bool log_to_console = log_settings[log_category].log_to_console > 0;
const bool log_to_file = log_settings[log_category].log_to_file > 0;
const bool log_to_gmsay = log_settings[log_category].log_to_gmsay > 0;
const bool nothing_to_log = !log_to_console && !log_to_file && !log_to_gmsay;
if (nothing_to_log) return;
va_list args;
va_start(args, message);
std::string output_message = vStringFormat(message.c_str(), args);
va_end(args);
std::string output_debug_message = EQEmuLogSys::FormatOutMessageString(log_category, output_message);
if (log_to_console) EQEmuLogSys::ProcessConsoleMessage(debug_level, log_category, output_debug_message);
if (log_to_gmsay) EQEmuLogSys::ProcessGMSay(debug_level, log_category, output_debug_message);
if (log_to_file) EQEmuLogSys::ProcessLogWrite(debug_level, log_category, output_debug_message);
}
void EQEmuLogSys::SetCurrentTimeStamp(char* time_stamp)
{
time_t raw_time;
struct tm * time_info;
time(&raw_time);
time_info = localtime(&raw_time);
strftime(time_stamp, 80, "[%m-%d-%Y :: %H:%M:%S]", time_info);
}
void EQEmuLogSys::MakeDirectory(const std::string &directory_name)
{
#ifdef _WINDOWS
struct _stat st;
if (_stat(directory_name.c_str(), &st) == 0) // exists
return;
_mkdir(directory_name.c_str());
#else
struct stat st;
if (stat(directory_name.c_str(), &st) == 0) // exists
return;
mkdir(directory_name.c_str(), 0755);
#endif
}
void EQEmuLogSys::CloseFileLogs()
{
if (process_log.is_open()) {
process_log.close();
}
}
void EQEmuLogSys::StartFileLogs(const std::string &log_name)
{
EQEmuLogSys::CloseFileLogs();
/* When loading settings, we must have been given a reason in category based logging to output to a file in order to even create or open one... */
if (file_logs_enabled == false)
return;
if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone) {
if (!log_name.empty())
platform_file_name = log_name;
if (platform_file_name.empty())
return;
EQEmuLogSys::Out(Logs::General, Logs::Status, "Starting File Log 'logs/%s_%i.log'", platform_file_name.c_str(), getpid());
EQEmuLogSys::MakeDirectory("logs/zone");
process_log.open(StringFormat("logs/zone/%s_%i.log", platform_file_name.c_str(), getpid()), std::ios_base::app | std::ios_base::out);
} else {
if (platform_file_name.empty())
return;
EQEmuLogSys::Out(Logs::General, Logs::Status, "Starting File Log 'logs/%s_%i.log'", platform_file_name.c_str(), getpid());
process_log.open(StringFormat("logs/%s_%i.log", platform_file_name.c_str(), getpid()), std::ios_base::app | std::ios_base::out);
}
}
+206
View File
@@ -0,0 +1,206 @@
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2015 EQEMu Development Team (http://eqemulator.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY except by those people which sell it, which
are required to give you total support for your newly bought product;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef EQEMU_LOGSYS_H
#define EQEMU_LOGSYS_H
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <functional>
#include "types.h"
namespace Logs {
enum DebugLevel {
General = 1, /* 1 - Low-Level general debugging, useful info on single line */
Moderate, /* 2 - Informational based, used in functions, when particular things load */
Detail /* 3 - Use this for extreme detail in logging, usually in extreme debugging in the stack or interprocess communication */
};
/*
If you add to this, make sure you update LogCategoryName
NOTE: Only add to the bottom of the enum because that is the type ID assignment
*/
enum LogCategory {
None = 0,
AA,
AI,
Aggro,
Attack,
Client_Server_Packet,
Combat,
Commands,
Crash,
Debug,
Doors,
Error,
Guilds,
Inventory,
Launcher,
Netcode,
Normal,
Object,
Pathing,
QS_Server,
Quests,
Rules,
Skills,
Spawns,
Spells,
Status,
TCP_Connection,
Tasks,
Tradeskills,
Trading,
Tribute,
UCS_Server,
WebInterface_Server,
World_Server,
Zone_Server,
MySQLError,
MySQLQuery,
Mercenaries,
QuestDebug,
Server_Client_Packet,
Client_Server_Packet_Unhandled,
Server_Client_Packet_With_Dump,
Client_Server_Packet_With_Dump,
Login_Server,
MaxCategoryID /* Don't Remove this*/
};
/* If you add to this, make sure you update LogCategory */
static const char* LogCategoryName[LogCategory::MaxCategoryID] = {
"",
"AA",
"AI",
"Aggro",
"Attack",
"Packet :: Client -> Server",
"Combat",
"Commands",
"Crash",
"Debug",
"Doors",
"Error",
"Guilds",
"Inventory",
"Launcher",
"Netcode",
"Normal",
"Object",
"Pathing",
"QS Server",
"Quests",
"Rules",
"Skills",
"Spawns",
"Spells",
"Status",
"TCP Connection",
"Tasks",
"Tradeskills",
"Trading",
"Tribute",
"UCS Server",
"WebInterface Server",
"World Server",
"Zone Server",
"MySQL Error",
"MySQL Query",
"Mercenaries",
"Quest Debug",
"Packet :: Server -> Client",
"Packet :: Client -> Server Unhandled",
"Packet :: Server -> Client (Dump)",
"Packet :: Client -> Server (Dump)",
"Login Server"
};
}
class EQEmuLogSys {
public:
EQEmuLogSys();
~EQEmuLogSys();
void CloseFileLogs(); /* Close File Logs wherever necessary, either at zone shutdown or entire process shutdown for everything else. This should be handled on deconstructor but to be safe we use it anyways. */
void LoadLogSettingsDefaults(); /* Initializes log_settings and sets some defaults if DB is not present */
void MakeDirectory(const std::string &directory_name); /* Platform independent way of performing a MakeDirectory based on name */
/*
The one and only Logging function that uses a debug level as a parameter, as well as a log_category
log_category - defined in Logs::LogCategory::[]
log_category name resolution works by passing the enum int ID to Logs::LogCategoryName[category_id]
Example: EQEmuLogSys::Out(Logs::General, Logs::Guilds, "This guild has no leader present");
- This would pipe the same category and debug level to all output formats, but the internal memory reference of log_settings would
be checked against to see if that piped output is set to actually process it for the category and debug level
*/
void Out(Logs::DebugLevel debug_level, uint16 log_category, std::string message, ...);
void SetCurrentTimeStamp(char* time_stamp); /* Used in file logs to prepend a timestamp entry for logs */
void StartFileLogs(const std::string &log_name = ""); /* Used to declare the processes file log and to keep it open for later use */
/*
LogSettings Struct
This struct is the master reference for all settings for each category, and for each output
log_to_file[category_id] = [1-3] - Sets debug level for category to output to file
log_to_console[category_id] = [1-3] - Sets debug level for category to output to console
log_to_gmsay[category_id] = [1-3] - Sets debug level for category to output to gmsay
*/
struct LogSettings {
uint8 log_to_file;
uint8 log_to_console;
uint8 log_to_gmsay;
uint8 is_category_enabled; /* When any log output in a category > 0, set this to 1 as (Enabled) */
};
/* Internally used memory reference for all log settings per category.
These are loaded via DB and have defaults loaded in LoadLogSettingsDefaults.
Database loaded via Database::LoadLogSettings(log_settings)
*/
LogSettings log_settings[Logs::LogCategory::MaxCategoryID];
bool file_logs_enabled; /* Set when log settings are loaded to determine if keeping a file open is necessary */
int log_platform; /* Sets Executable platform (Zone/World/UCS) etc. */
std::string platform_file_name; /* File name used in writing logs */
uint16 GetGMSayColorFromCategory(uint16 log_category); /* GMSay Client Message colors mapped by category */
void OnLogHookCallBackZone(std::function<void(uint16 log_type, const std::string&)> f) { on_log_gmsay_hook = f; }
private:
std::function<void(uint16 log_category, const std::string&)> on_log_gmsay_hook; /* Callback pointer to zone process for hooking logs to zone using GMSay */
std::string FormatOutMessageString(uint16 log_category, const std::string &in_message); /* Formats log messages like '[Category] This is a log message' */
std::string GetLinuxConsoleColorFromCategory(uint16 log_category); /* Linux console color messages mapped by category */
uint16 GetWindowsConsoleColorFromCategory(uint16 log_category); /* Windows console color messages mapped by category */
void ProcessConsoleMessage(uint16 debug_level, uint16 log_category, const std::string &message); /* ProcessConsoleMessage called via Log.Out */
void ProcessGMSay(uint16 debug_level, uint16 log_category, const std::string &message); /* ProcessGMSay called via Log.Out */
void ProcessLogWrite(uint16 debug_level, uint16 log_category, const std::string &message); /* ProcessLogWrite called via Log.Out */
};
extern EQEmuLogSys Log;
#endif
+42 -110
View File
@@ -17,7 +17,8 @@
*/
#include <fstream>
#include "../common/debug.h"
#include "../common/global_define.h"
#include "../common/eqemu_logsys.h"
#include "../common/eqtime.h"
#include "../common/eq_packet_structs.h"
#include <memory.h>
@@ -42,19 +43,19 @@ EQTime::EQTime(TimeOfDay_Struct start_eq, time_t start_real)
EQTime::EQTime()
{
timezone=0;
timezone = 0;
memset(&eqTime, 0, sizeof(eqTime));
//Defaults for time
TimeOfDay_Struct start;
start.day=1;
start.hour=9;
start.minute=0;
start.month=1;
start.year=3100;
start.day = 1;
start.hour = 9;
start.minute = 0;
start.month = 1;
start.year = 3100;
//Set default time zone
timezone=0;
timezone = 0;
//Start EQTimer
setEQTimeOfDay(start, time(0));
SetCurrentEQTimeOfDay(start, time(0));
}
EQTime::~EQTime()
@@ -66,10 +67,10 @@ EQTime::~EQTime()
//Input: Current Time (as a time_t), a pointer to the TimeOfDay_Struct that will be written to.
//Output: 0=Error, 1=Sucess
int EQTime::getEQTimeOfDay( time_t timeConvert, struct TimeOfDay_Struct *eqTimeOfDay )
int EQTime::GetCurrentEQTimeOfDay(time_t timeConvert, struct TimeOfDay_Struct *eqTimeOfDay)
{
/* check to see if we have a reference time to go by. */
if( eqTime.start_realtime == 0 )
if (eqTime.start_realtime == 0)
return 0;
unsigned long diff = timeConvert - eqTime.start_realtime;
@@ -82,7 +83,7 @@ int EQTime::getEQTimeOfDay( time_t timeConvert, struct TimeOfDay_Struct *eqTimeO
int32 ntz = timezone;
/* The minutes range from 0 - 59 */
diff += eqTime.start_eqtime.minute + (ntz%60);
diff += eqTime.start_eqtime.minute + (ntz % 60);
eqTimeOfDay->minute = diff % 60;
diff /= 60;
ntz /= 60;
@@ -96,24 +97,24 @@ int EQTime::getEQTimeOfDay( time_t timeConvert, struct TimeOfDay_Struct *eqTimeO
//
// Modify it so that it works from
// 0-23 for our calculations
diff += ( eqTime.start_eqtime.hour - 1) + (ntz%24);
eqTimeOfDay->hour = (diff%24) + 1;
diff += (eqTime.start_eqtime.hour - 1) + (ntz % 24);
eqTimeOfDay->hour = (diff % 24) + 1;
diff /= 24;
ntz /= 24;
// The days range from 1-28
// Modify it so that it works from
// 0-27 for our calculations
diff += ( eqTime.start_eqtime.day - 1 ) + (ntz%28);
eqTimeOfDay->day = (diff%28) + 1;
diff += (eqTime.start_eqtime.day - 1) + (ntz % 28);
eqTimeOfDay->day = (diff % 28) + 1;
diff /= 28;
ntz /= 28;
// The months range from 1-12
// Modify it so that it works from
// 0-11 for our calculations
diff += ( eqTime.start_eqtime.month - 1 ) + (ntz%12);
eqTimeOfDay->month = (diff%12) + 1;
diff += (eqTime.start_eqtime.month - 1) + (ntz % 12);
eqTimeOfDay->month = (diff % 12) + 1;
diff /= 12;
ntz /= 12;
@@ -123,102 +124,34 @@ int EQTime::getEQTimeOfDay( time_t timeConvert, struct TimeOfDay_Struct *eqTimeO
}
//setEQTimeOfDay
int EQTime::setEQTimeOfDay(TimeOfDay_Struct start_eq, time_t start_real)
int EQTime::SetCurrentEQTimeOfDay(TimeOfDay_Struct start_eq, time_t start_real)
{
if(start_real==0)
if (start_real == 0)
return 0;
eqTime.start_eqtime=start_eq;
eqTime.start_realtime=start_real;
eqTime.start_eqtime = start_eq;
eqTime.start_realtime = start_real;
return 1;
}
//saveFile and loadFile need to use long for the save datatype...
//For some reason, ifstream/ofstream have problems with EQEmu datatypes in files.
bool EQTime::saveFile(const char *filename)
{
std::ofstream of;
of.open(filename);
if(!of)
{
LogFile->write(EQEMuLog::Error, "EQTime::saveFile failed: Unable to open file '%s'", filename);
return false;
}
//Enable for debugging
//std::cout << "SAVE: day=" << (long)eqTime.start_eqtime.day << ";hour=" << (long)eqTime.start_eqtime.hour << ";min=" << (long)eqTime.start_eqtime.minute << ";mon=" << (long)eqTime.start_eqtime.month << ";yr=" << eqTime.start_eqtime.year << ";timet=" << eqTime.start_realtime << std::endl;
of << EQT_VERSION << std::endl;
of << (long)eqTime.start_eqtime.day << std::endl;
of << (long)eqTime.start_eqtime.hour << std::endl;
of << (long)eqTime.start_eqtime.minute << std::endl;
of << (long)eqTime.start_eqtime.month << std::endl;
of << eqTime.start_eqtime.year << std::endl;
of << eqTime.start_realtime << std::endl;
of.close();
return true;
}
bool EQTime::loadFile(const char *filename)
{
int version=0;
long in_data=0;
std::ifstream in;
in.open(filename);
if(!in)
{
LogFile->write(EQEMuLog::Error, "Could not load EQTime file %s", filename);
return false;
}
in >> version;
in.ignore(80, '\n');
if(version != EQT_VERSION)
{
LogFile->write(EQEMuLog::Error, "'%s' is NOT a valid EQTime file. File version is %i, EQTime version is %i", filename, version, EQT_VERSION);
return false;
}
//in >> eqTime.start_eqtime.day;
in >> in_data;
in.ignore(80, '\n');
eqTime.start_eqtime.day = in_data;
//in >> eqTime.start_eqtime.hour;
in >> in_data;
eqTime.start_eqtime.hour = in_data;
in.ignore(80, '\n');
//in >> eqTime.start_eqtime.minute;
in >> in_data;
in.ignore(80, '\n');
eqTime.start_eqtime.minute = in_data;
//in >> eqTime.start_eqtime.month;
in >> in_data;
in.ignore(80, '\n');
eqTime.start_eqtime.month = in_data;
in >> eqTime.start_eqtime.year;
in.ignore(80, '\n');
in >> eqTime.start_realtime;
//Enable for debugging...
//std::cout << "LOAD: day=" << (long)eqTime.start_eqtime.day << ";hour=" << (long)eqTime.start_eqtime.hour << ";min=" << (long)eqTime.start_eqtime.minute << ";mon=" << (long)eqTime.start_eqtime.month << ";yr=" << eqTime.start_eqtime.year << ";timet=" << eqTime.start_realtime << std::endl;
in.close();
return true;
}
bool EQTime::IsTimeBefore(TimeOfDay_Struct *base, TimeOfDay_Struct *test) {
if(base->year > test->year)
if (base->year > test->year)
return(true);
if(base->year < test->year)
if (base->year < test->year)
return(false);
//same years
if(base->month > test->month)
if (base->month > test->month)
return(true);
if(base->month < test->month)
if (base->month < test->month)
return(false);
//same month
if(base->day > test->day)
if (base->day > test->day)
return(true);
if(base->day < test->day)
if (base->day < test->day)
return(false);
//same day
if(base->hour > test->hour)
if (base->hour > test->hour)
return(true);
if(base->hour < test->hour)
if (base->hour < test->hour)
return(false);
//same hour...
return(base->minute > test->minute);
@@ -231,7 +164,7 @@ void EQTime::AddMinutes(uint32 minutes, TimeOfDay_Struct *to) {
//minutes start at 0, everything else starts at 1
cur = to->minute;
cur += minutes;
if(cur < 60) {
if (cur < 60) {
to->minute = cur;
return;
}
@@ -239,29 +172,29 @@ void EQTime::AddMinutes(uint32 minutes, TimeOfDay_Struct *to) {
//carry hours
cur /= 60;
cur += to->hour;
if(cur <= 24) {
if (cur <= 24) {
to->hour = cur;
return;
}
to->hour = ((cur-1) % 24) + 1;
to->hour = ((cur - 1) % 24) + 1;
//carry days
cur = (cur-1) / 24;
cur = (cur - 1) / 24;
cur += to->day;
if(cur <= 28) {
if (cur <= 28) {
to->day = cur;
return;
}
to->day = ((cur-1) % 28) + 1;
to->day = ((cur - 1) % 28) + 1;
//carry months
cur = (cur-1) / 28;
cur = (cur - 1) / 28;
cur += to->month;
if(cur <= 12) {
if (cur <= 12) {
to->month = cur;
return;
}
to->month = ((cur-1) % 12) + 1;
to->month = ((cur - 1) % 12) + 1;
//carry years
to->year += (cur-1) / 12;
to->year += (cur - 1) / 12;
}
void EQTime::ToString(TimeOfDay_Struct *t, std::string &str) {
@@ -270,5 +203,4 @@ void EQTime::ToString(TimeOfDay_Struct *t, std::string &str) {
t->month, t->day, t->year, t->hour, t->minute);
buf[127] = '\0';
str = buf;
}
}
+3 -9
View File
@@ -21,8 +21,8 @@ public:
~EQTime();
//Get functions
int getEQTimeOfDay( TimeOfDay_Struct *eqTimeOfDay ) { return(getEQTimeOfDay(time(nullptr), eqTimeOfDay)); }
int getEQTimeOfDay( time_t timeConvert, TimeOfDay_Struct *eqTimeOfDay );
int GetCurrentEQTimeOfDay( TimeOfDay_Struct *eqTimeOfDay ) { return(GetCurrentEQTimeOfDay(time(nullptr), eqTimeOfDay)); }
int GetCurrentEQTimeOfDay( time_t timeConvert, TimeOfDay_Struct *eqTimeOfDay );
TimeOfDay_Struct getStartEQTime() { return eqTime.start_eqtime; }
time_t getStartRealTime() { return eqTime.start_realtime; }
uint32 getEQTimeZone() { return timezone; }
@@ -30,7 +30,7 @@ public:
uint32 getEQTimeZoneMin() { return timezone%60; }
//Set functions
int setEQTimeOfDay(TimeOfDay_Struct start_eq, time_t start_real);
int SetCurrentEQTimeOfDay(TimeOfDay_Struct start_eq, time_t start_real);
void setEQTimeZone(int32 in_timezone) { timezone=in_timezone; }
//Time math/logic functions
@@ -39,12 +39,6 @@ public:
static void ToString(TimeOfDay_Struct *t, std::string &str);
//Database functions
//bool loadDB(Database q);
//bool setDB(Database q);
bool loadFile(const char *filename);
bool saveFile(const char *filename);
private:
//This is our reference clock.
eqTimeOfDay eqTime;
+1 -1
View File
@@ -16,7 +16,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "debug.h"
#include "global_define.h"
#include "extprofile.h"
//Set defaults in the extended profile...
+3 -1
View File
@@ -40,7 +40,7 @@ struct ExtendedProfile_Struct {
uint16 old_pet_hp; /* Not Used */
uint16 old_pet_mana; /* Not Used */
SpellBuff_Struct pet_buffs[BUFF_COUNT]; /* Not Used */
uint32 pet_items[_MaterialCount]; /* Not Used */
uint32 pet_items[EQEmu::legacy::MaterialCount]; /* Not Used */
char merc_name[64]; /* Used */
uint32 aa_effects; /* Used */
@@ -54,6 +54,8 @@ struct ExtendedProfile_Struct {
uint32 mercTimerRemaining; /* Not Used */
uint8 mercGender; /* Not Used */
int32 mercState; /* Not Used */
uint32 last_invsnapshot_time; /* Used */
uint32 next_invsnapshot_time; /* Used */
};
#pragma pack()
+113 -86
View File
@@ -1,4 +1,4 @@
/* EQEMu: Everquest Server Emulator
/* EQEMu: Everquest Server Emulator
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
This program is free software; you can redistribute it and/or modify
@@ -15,34 +15,35 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "debug.h"
#include "faction.h"
#include "races.h"
const char *FactionValueToString(FACTION_VALUE fv) {
switch(fv) {
case FACTION_ALLY:
return("Ally");
case FACTION_WARMLY:
return("Warmly");
case FACTION_KINDLY:
return("Kindly");
case FACTION_AMIABLE:
return("Amiable");
case FACTION_INDIFFERENT:
return("Indifferent");
case FACTION_APPREHENSIVE:
return("Apprehensive");
case FACTION_DUBIOUS:
return("Dubious");
case FACTION_THREATENLY:
return("Threatenly");
case FACTION_SCOWLS:
return("Scowls, ready to attack.");
default:
break;
const char *FactionValueToString(FACTION_VALUE fv)
{
switch (fv) {
case FACTION_ALLY:
return ("Ally");
case FACTION_WARMLY:
return ("Warmly");
case FACTION_KINDLY:
return ("Kindly");
case FACTION_AMIABLE:
return ("Amiable");
case FACTION_INDIFFERENT:
return ("Indifferent");
case FACTION_APPREHENSIVE:
return ("Apprehensive");
case FACTION_DUBIOUS:
return ("Dubious");
case FACTION_THREATENLY:
return ("Threatenly");
case FACTION_SCOWLS:
return ("Scowls, ready to attack.");
default:
break;
}
return("Unknown Faction Con");
return ("Unknown Faction Con");
}
@@ -55,35 +56,56 @@ const char *FactionValueToString(FACTION_VALUE fv) {
FACTION_VALUE CalculateFaction(FactionMods* fm, int32 tmpCharacter_value)
{
int32 character_value = tmpCharacter_value;
if (fm)
if (fm) {
character_value += fm->base + fm->class_mod + fm->race_mod + fm->deity_mod;
if(character_value >= 1101) return FACTION_ALLY;
if(character_value >= 701 && character_value <= 1100) return FACTION_WARMLY;
if(character_value >= 401 && character_value <= 700) return FACTION_KINDLY;
if(character_value >= 101 && character_value <= 400) return FACTION_AMIABLE;
if(character_value >= 0 && character_value <= 100) return FACTION_INDIFFERENT;
if(character_value >= -100 && character_value <= -1) return FACTION_APPREHENSIVE;
if(character_value >= -700 && character_value <= -101) return FACTION_DUBIOUS;
if(character_value >= -999 && character_value <= -701) return FACTION_THREATENLY;
if(character_value <= -1000) return FACTION_SCOWLS;
}
if (character_value >= 1101) {
return FACTION_ALLY;
}
if (character_value >= 701 && character_value <= 1100) {
return FACTION_WARMLY;
}
if (character_value >= 401 && character_value <= 700) {
return FACTION_KINDLY;
}
if (character_value >= 101 && character_value <= 400) {
return FACTION_AMIABLE;
}
if (character_value >= 0 && character_value <= 100) {
return FACTION_INDIFFERENT;
}
if (character_value >= -100 && character_value <= -1) {
return FACTION_APPREHENSIVE;
}
if (character_value >= -700 && character_value <= -101) {
return FACTION_DUBIOUS;
}
if (character_value >= -999 && character_value <= -701) {
return FACTION_THREATENLY;
}
if (character_value <= -1000) {
return FACTION_SCOWLS;
}
return FACTION_INDIFFERENT;
}
// this function should check if some races have more than one race define
bool IsOfEqualRace(int r1, int r2)
{
if (r1 == r2)
if (r1 == r2) {
return true;
}
// TODO: add more values
switch(r1)
{
case DARK_ELF:
if (r2 == 77)
return true;
break;
case BARBARIAN:
if (r2 == 90)
return true;
switch (r1) {
case DARK_ELF:
if (r2 == 77) {
return true;
}
break;
case BARBARIAN:
if (r2 == 90) {
return true;
}
}
return false;
}
@@ -91,50 +113,55 @@ bool IsOfEqualRace(int r1, int r2)
// trolls endure ogres, dark elves, ...
bool IsOfIndiffRace(int r1, int r2)
{
if (r1 == r2)
if (r1 == r2) {
return true;
}
// TODO: add more values
switch(r1)
{
case DARK_ELF:
case OGRE:
case TROLL:
if (r2 == OGRE || r2 == TROLL || r2 == DARK_ELF)
switch (r1) {
case DARK_ELF:
case OGRE:
case TROLL:
if (r2 == OGRE || r2 == TROLL || r2 == DARK_ELF) {
return true;
}
break;
case HUMAN:
case BARBARIAN:
case HALF_ELF:
case GNOME:
case HALFLING:
case WOOD_ELF:
if (r2 == HUMAN ||
r2 == BARBARIAN ||
r2 == ERUDITE ||
r2 == HALF_ELF ||
r2 == GNOME ||
r2 == HALFLING ||
r2 == DWARF ||
r2 == HIGH_ELF ||
r2 == WOOD_ELF) {
return true;
}
break;
case ERUDITE:
if (r2 == HUMAN || r2 == HALF_ELF) {
return true;
}
break;
case DWARF:
if (r2 == HALFLING || r2 == GNOME) {
return true;
}
break;
case HIGH_ELF:
if (r2 == WOOD_ELF) {
return true;
}
break;
case VAHSHIR:
return true;
break;
case HUMAN:
case BARBARIAN:
case HALF_ELF:
case GNOME:
case HALFLING:
case WOOD_ELF:
if (r2 == HUMAN ||
r2 == BARBARIAN ||
r2 == ERUDITE ||
r2 == HALF_ELF ||
r2 == GNOME ||
r2 == HALFLING ||
r2 == DWARF ||
r2 == HIGH_ELF ||
r2 == WOOD_ELF)
return true;
break;
case ERUDITE:
if (r2 == HUMAN || r2 == HALF_ELF)
return true;
break;
case DWARF:
if (r2 == HALFLING || r2 == GNOME)
return true;
break;
case HIGH_ELF:
if (r2 == WOOD_ELF)
return true;
break;
case VAHSHIR:
return true;
case IKSAR:
return false;
case IKSAR:
return false;
}
return false;
}
+7 -1
View File
@@ -154,11 +154,12 @@ enum { //reuse times
enum { //timer settings, all in milliseconds
AImovement_duration = 100,
AIthink_duration = 150,
AIscanarea_delay = 500,
AIscanarea_delay = 6000,
AIfeignremember_delay = 500,
AItarget_check_duration = 500,
AIClientScanarea_delay = 750, //used in REVERSE_AGGRO
AIassistcheck_delay = 3000, //now often a fighting NPC will yell for help
AI_check_signal_timer_delay = 500, // How often EVENT_SIGNAL checks are processed
ClientProximity_interval = 150,
CombatEventTimer_expire = 12000,
Tribute_duration = 600000,
@@ -232,6 +233,8 @@ enum { //some random constants
#define GROUP_EXP_PER_POINT 1000
#define RAID_EXP_PER_POINT 2000
#define ZONE_CONTROLLER_NPC_ID 10
//Some hard coded statuses from commands and other places:
enum {
minStatusToBeGM = 40,
@@ -270,6 +273,9 @@ enum {
#define NPC_DEFAULT_LOGGING_ENABLED false
// This is the item ID we use for say links, we use the max that fits in 5 ASCII chars
#define SAYLINK_ITEM_ID 0xFFFFF
/*
+7 -5
View File
@@ -30,11 +30,13 @@ source_group("GTX Files" FILES ${GTX_HEADER})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
add_executable(${NAME} ${ROOT_TEXT}
${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER})
if(GLM_TEST_ENABLE)
add_executable(${NAME} ${ROOT_TEXT}
${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER})
endif(GLM_TEST_ENABLE)
#add_library(glm STATIC glm.cpp)
#add_library(glm_shared SHARED glm.cpp)
+5 -4
View File
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -26,9 +30,6 @@
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef GLM_COMMON_INCLUDED
#define GLM_COMMON_INCLUDED
#pragma once
#include "detail/func_common.hpp"
#endif//GLM_COMMON_INCLUDED
+8 -7
View File
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -21,13 +25,12 @@
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/core/_features.hpp
/// @file glm/detail/_features.hpp
/// @date 2013-02-20 / 2013-02-20
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_features
#define glm_core_features
#pragma once
// #define GLM_CXX98_EXCEPTIONS
// #define GLM_CXX98_RTTI
@@ -281,7 +284,7 @@
# define GLM_CXX11_STATIC_ASSERT
# endif
#elif(GLM_COMPILER & GLM_COMPILER_CLANG)
#elif(GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))
# if(__has_feature(cxx_exceptions))
# define GLM_CXX98_EXCEPTIONS
# endif
@@ -422,6 +425,4 @@
# define GLM_CXX11_VARIADIC_TEMPLATES
# endif
#endif//(GLM_COMPILER & GLM_COMPILER_CLANG)
#endif//glm_core_features
#endif//(GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))
+5 -1
View File
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -21,7 +25,7 @@
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/core/_fixes.hpp
/// @file glm/detail/_fixes.hpp
/// @date 2011-02-21 / 2011-11-22
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
+16 -10
View File
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -26,8 +30,12 @@
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef GLM_DETAIL_NOISE_INCLUDED
#define GLM_DETAIL_NOISE_INCLUDED
#pragma once
#include "../vec2.hpp"
#include "../vec3.hpp"
#include "../vec4.hpp"
#include "../common.hpp"
namespace glm{
namespace detail
@@ -75,19 +83,19 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec2<T, P> taylorInvSqrt(detail::tvec2<T, P> const & r)
GLM_FUNC_QUALIFIER tvec2<T, P> taylorInvSqrt(tvec2<T, P> const & r)
{
return T(1.79284291400159) - T(0.85373472095314) * r;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec3<T, P> taylorInvSqrt(detail::tvec3<T, P> const & r)
GLM_FUNC_QUALIFIER tvec3<T, P> taylorInvSqrt(tvec3<T, P> const & r)
{
return T(1.79284291400159) - T(0.85373472095314) * r;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec4<T, P> taylorInvSqrt(detail::tvec4<T, P> const & r)
GLM_FUNC_QUALIFIER tvec4<T, P> taylorInvSqrt(tvec4<T, P> const & r)
{
return T(1.79284291400159) - T(0.85373472095314) * r;
}
@@ -100,19 +108,19 @@ namespace detail
*/
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec2<T, P> fade(detail::tvec2<T, P> const & t)
GLM_FUNC_QUALIFIER tvec2<T, P> fade(tvec2<T, P> const & t)
{
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec3<T, P> fade(detail::tvec3<T, P> const & t)
GLM_FUNC_QUALIFIER tvec3<T, P> fade(tvec3<T, P> const & t)
{
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec4<T, P> fade(detail::tvec4<T, P> const & t)
GLM_FUNC_QUALIFIER tvec4<T, P> fade(tvec4<T, P> const & t)
{
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
}
@@ -126,5 +134,3 @@ namespace detail
}//namespace detail
}//namespace glm
#endif//GLM_DETAIL_NOISE_INCLUDED
File diff suppressed because it is too large Load Diff
+6 -5
View File
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -21,13 +25,12 @@
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/core/_swizzle_func.hpp
/// @file glm/detail/_swizzle_func.hpp
/// @date 2011-10-16 / 2011-10-16
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_swizzle_func
#define glm_core_swizzle_func
#pragma once
#define GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B) \
SWIZZLED_TYPE<TMPL_TYPE, PRECISION> A ## B() CONST \
@@ -720,5 +723,3 @@
GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t, p, q)
//GLM_SWIZZLE_GEN_VEC_FROM_VEC4(valType, detail::vec4, detail::vec2, detail::vec3, detail::vec4)
#endif//glm_core_swizzle_func
+113 -170
View File
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -21,197 +25,136 @@
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/core/_vectorize.hpp
/// @file glm/detail/_vectorize.hpp
/// @date 2011-10-14 / 2011-10-14
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef GLM_CORE_DETAIL_INCLUDED
#define GLM_CORE_DETAIL_INCLUDED
#pragma once
#include "type_vec1.hpp"
#include "type_vec2.hpp"
#include "type_vec3.hpp"
#include "type_vec4.hpp"
#define VECTORIZE1_VEC(func) \
template <typename T, precision P> \
GLM_FUNC_QUALIFIER detail::tvec1<T, P> func( \
detail::tvec1<T, P> const & v) \
{ \
return detail::tvec1<T, P>( \
func(v.x)); \
}
#define VECTORIZE2_VEC(func) \
template <typename T, precision P> \
GLM_FUNC_QUALIFIER detail::tvec2<T, P> func( \
detail::tvec2<T, P> const & v) \
{ \
return detail::tvec2<T, P>( \
func(v.x), \
func(v.y)); \
}
#define VECTORIZE3_VEC(func) \
template <typename T, precision P> \
GLM_FUNC_QUALIFIER detail::tvec3<T, P> func( \
detail::tvec3<T, P> const & v) \
{ \
return detail::tvec3<T, P>( \
func(v.x), \
func(v.y), \
func(v.z)); \
}
#define VECTORIZE4_VEC(func) \
template <typename T, precision P> \
GLM_FUNC_QUALIFIER detail::tvec4<T, P> func( \
detail::tvec4<T, P> const & v) \
{ \
return detail::tvec4<T, P>( \
func(v.x), \
func(v.y), \
func(v.z), \
func(v.w)); \
}
#define VECTORIZE_VEC(func) \
VECTORIZE1_VEC(func) \
VECTORIZE2_VEC(func) \
VECTORIZE3_VEC(func) \
VECTORIZE4_VEC(func)
#define VECTORIZE1_VEC_SCA(func) \
template <typename T, precision P> \
GLM_FUNC_QUALIFIER detail::tvec1<T, P> func \
( \
detail::tvec1<T, P> const & x, \
T const & y \
) \
{ \
return detail::tvec1<T, P>( \
func(x.x, y)); \
}
#define VECTORIZE2_VEC_SCA(func) \
template <typename T, precision P> \
GLM_FUNC_QUALIFIER detail::tvec2<T, P> func \
( \
detail::tvec2<T, P> const & x, \
T const & y \
) \
{ \
return detail::tvec2<T, P>( \
func(x.x, y), \
func(x.y, y)); \
}
#define VECTORIZE3_VEC_SCA(func) \
template <typename T, precision P> \
GLM_FUNC_QUALIFIER detail::tvec3<T, P> func \
( \
detail::tvec3<T, P> const & x, \
T const & y \
) \
{ \
return detail::tvec3<T, P>( \
func(x.x, y), \
func(x.y, y), \
func(x.z, y)); \
}
#define VECTORIZE4_VEC_SCA(func) \
template <typename T, precision P> \
GLM_FUNC_QUALIFIER detail::tvec4<T, P> func \
( \
detail::tvec4<T, P> const & x, \
T const & y \
) \
{ \
return detail::tvec4<T, P>( \
func(x.x, y), \
func(x.y, y), \
func(x.z, y), \
func(x.w, y)); \
}
#define VECTORIZE_VEC_SCA(func) \
VECTORIZE1_VEC_SCA(func) \
VECTORIZE2_VEC_SCA(func) \
VECTORIZE3_VEC_SCA(func) \
VECTORIZE4_VEC_SCA(func)
#define VECTORIZE2_VEC_VEC(func) \
template <typename T, precision P> \
GLM_FUNC_QUALIFIER detail::tvec2<T, P> func \
( \
detail::tvec2<T, P> const & x, \
detail::tvec2<T, P> const & y \
) \
{ \
return detail::tvec2<T, P>( \
func(x.x, y.x), \
func(x.y, y.y)); \
}
#define VECTORIZE3_VEC_VEC(func) \
template <typename T, precision P> \
GLM_FUNC_QUALIFIER detail::tvec3<T, P> func \
( \
detail::tvec3<T, P> const & x, \
detail::tvec3<T, P> const & y \
) \
{ \
return detail::tvec3<T, P>( \
func(x.x, y.x), \
func(x.y, y.y), \
func(x.z, y.z)); \
}
#define VECTORIZE4_VEC_VEC(func) \
template <typename T, precision P> \
GLM_FUNC_QUALIFIER detail::tvec4<T, P> func \
( \
detail::tvec4<T, P> const & x, \
detail::tvec4<T, P> const & y \
) \
{ \
return detail::tvec4<T, P>( \
func(x.x, y.x), \
func(x.y, y.y), \
func(x.z, y.z), \
func(x.w, y.w)); \
}
#define VECTORIZE_VEC_VEC(func) \
VECTORIZE2_VEC_VEC(func) \
VECTORIZE3_VEC_VEC(func) \
VECTORIZE4_VEC_VEC(func)
namespace glm{
namespace detail
{
template<bool C>
struct If
template <typename R, typename T, precision P, template <typename, precision> class vecType>
struct functor1{};
template <typename R, typename T, precision P>
struct functor1<R, T, P, tvec1>
{
template<typename F, typename T>
static GLM_FUNC_QUALIFIER T apply(F functor, const T& val)
GLM_FUNC_QUALIFIER static tvec1<R, P> call(R (*Func) (T x), tvec1<T, P> const & v)
{
return functor(val);
return tvec1<R, P>(Func(v.x));
}
};
template<>
struct If<false>
template <typename R, typename T, precision P>
struct functor1<R, T, P, tvec2>
{
template<typename F, typename T>
static GLM_FUNC_QUALIFIER T apply(F, const T& val)
GLM_FUNC_QUALIFIER static tvec2<R, P> call(R (*Func) (T x), tvec2<T, P> const & v)
{
return val;
return tvec2<R, P>(Func(v.x), Func(v.y));
}
};
template <typename R, typename T, precision P>
struct functor1<R, T, P, tvec3>
{
GLM_FUNC_QUALIFIER static tvec3<R, P> call(R (*Func) (T x), tvec3<T, P> const & v)
{
return tvec3<R, P>(Func(v.x), Func(v.y), Func(v.z));
}
};
template <typename R, typename T, precision P>
struct functor1<R, T, P, tvec4>
{
GLM_FUNC_QUALIFIER static tvec4<R, P> call(R (*Func) (T x), tvec4<T, P> const & v)
{
return tvec4<R, P>(Func(v.x), Func(v.y), Func(v.z), Func(v.w));
}
};
template <typename T, precision P, template <typename, precision> class vecType>
struct functor2{};
template <typename T, precision P>
struct functor2<T, P, tvec1>
{
GLM_FUNC_QUALIFIER static tvec1<T, P> call(T (*Func) (T x, T y), tvec1<T, P> const & a, tvec1<T, P> const & b)
{
return tvec1<T, P>(Func(a.x, b.x));
}
};
template <typename T, precision P>
struct functor2<T, P, tvec2>
{
GLM_FUNC_QUALIFIER static tvec2<T, P> call(T (*Func) (T x, T y), tvec2<T, P> const & a, tvec2<T, P> const & b)
{
return tvec2<T, P>(Func(a.x, b.x), Func(a.y, b.y));
}
};
template <typename T, precision P>
struct functor2<T, P, tvec3>
{
GLM_FUNC_QUALIFIER static tvec3<T, P> call(T (*Func) (T x, T y), tvec3<T, P> const & a, tvec3<T, P> const & b)
{
return tvec3<T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z));
}
};
template <typename T, precision P>
struct functor2<T, P, tvec4>
{
GLM_FUNC_QUALIFIER static tvec4<T, P> call(T (*Func) (T x, T y), tvec4<T, P> const & a, tvec4<T, P> const & b)
{
return tvec4<T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w));
}
};
template <typename T, precision P, template <typename, precision> class vecType>
struct functor2_vec_sca{};
template <typename T, precision P>
struct functor2_vec_sca<T, P, tvec1>
{
GLM_FUNC_QUALIFIER static tvec1<T, P> call(T (*Func) (T x, T y), tvec1<T, P> const & a, T b)
{
return tvec1<T, P>(Func(a.x, b));
}
};
template <typename T, precision P>
struct functor2_vec_sca<T, P, tvec2>
{
GLM_FUNC_QUALIFIER static tvec2<T, P> call(T (*Func) (T x, T y), tvec2<T, P> const & a, T b)
{
return tvec2<T, P>(Func(a.x, b), Func(a.y, b));
}
};
template <typename T, precision P>
struct functor2_vec_sca<T, P, tvec3>
{
GLM_FUNC_QUALIFIER static tvec3<T, P> call(T (*Func) (T x, T y), tvec3<T, P> const & a, T b)
{
return tvec3<T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b));
}
};
template <typename T, precision P>
struct functor2_vec_sca<T, P, tvec4>
{
GLM_FUNC_QUALIFIER static tvec4<T, P> call(T (*Func) (T x, T y), tvec4<T, P> const & a, T b)
{
return tvec4<T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b));
}
};
}//namespace detail
}//namespace glm
#endif//GLM_CORE_DETAIL_INCLUDED
+33 -1
View File
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -29,7 +33,6 @@
/// dummy.cpp exist only a wordaround for CMake file.
///////////////////////////////////////////////////////////////////////////////////
#define GLM_FORCE_RADIANS
#define GLM_MESSAGES
#include "../glm.hpp"
#include <limits>
@@ -42,6 +45,7 @@ struct material
glm::vec4 specular; // Scm
float shininess; // Srm
};
struct light
{
glm::vec4 ambient; // Acli
@@ -60,6 +64,7 @@ struct light
float quadraticAttenuation;// K2
};
// Sample 1
#include <glm/vec3.hpp>// glm::vec3
#include <glm/geometric.hpp>// glm::cross, glm::normalize
@@ -184,7 +189,34 @@ glm::vec3 lighting
return Color;
}
*/
template <typename T, glm::precision P, template<typename, glm::precision> class vecType>
T normalizeDotA(vecType<T, P> const & x, vecType<T, P> const & y)
{
return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y));
}
#define GLM_TEMPLATE_GENTYPE typename T, glm::precision P, template<typename, glm::precision> class
template <GLM_TEMPLATE_GENTYPE vecType>
T normalizeDotB(vecType<T, P> const & x, vecType<T, P> const & y)
{
return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y));
}
template <typename vecType>
typename vecType::value_type normalizeDotC(vecType const & a, vecType const & b)
{
return glm::dot(a, b) * glm::inversesqrt(glm::dot(a, a) * glm::dot(b, b));
}
int main()
{
glm::vec4 v(1);
float a = normalizeDotA(v, v);
float b = normalizeDotB(v, v);
float c = normalizeDotC(v, v);
return 0;
}
+76 -92
View File
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -21,7 +25,7 @@
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/core/func_common.hpp
/// @file glm/detail/func_common.hpp
/// @date 2008-03-08 / 2010-01-26
/// @author Christophe Riccio
///
@@ -33,8 +37,7 @@
/// These all operate component-wise. The description is per component.
///////////////////////////////////////////////////////////////////////////////////
#ifndef GLM_FUNC_COMMON_INCLUDED
#define GLM_FUNC_COMMON_INCLUDED
#pragma once
#include "setup.hpp"
#include "precision.hpp"
@@ -53,7 +56,10 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/abs.xml">GLSL abs man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType abs(genType const & x);
GLM_FUNC_DECL genType abs(genType x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> abs(vecType<T, P> const & x);
/// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0.
///
@@ -61,17 +67,17 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sign.xml">GLSL sign man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType sign(genType const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> sign(vecType<T, P> const & x);
/// Returns a value equal to the nearest integer that is less then or equal to x.
///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floor.xml">GLSL floor man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType floor(genType const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> floor(vecType<T, P> const & x);
/// Returns a value equal to the nearest integer to x
/// whose absolute value is not larger than the absolute value of x.
@@ -80,8 +86,8 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/trunc.xml">GLSL trunc man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType trunc(genType const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> trunc(vecType<T, P> const & x);
/// Returns a value equal to the nearest integer to x.
/// The fraction 0.5 will round in a direction chosen by the
@@ -93,9 +99,9 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType round(genType const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> round(vecType<T, P> const & x);
/// Returns a value equal to the nearest integer to x.
/// A fractional part of 0.5 will round toward the nearest even
/// integer. (Both 3.5 and 4.5 for x will return 4.0.)
@@ -105,8 +111,8 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/roundEven.xml">GLSL roundEven man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
/// @see <a href="http://developer.amd.com/documentation/articles/pages/New-Round-to-Even-Technique.aspx">New round to even technique</a>
template <typename genType>
GLM_FUNC_DECL genType roundEven(genType const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> roundEven(vecType<T, P> const & x);
/// Returns a value equal to the nearest integer
/// that is greater than or equal to x.
@@ -115,8 +121,8 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ceil.xml">GLSL ceil man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType ceil(genType const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> ceil(vecType<T, P> const & x);
/// Return x - floor(x).
///
@@ -125,7 +131,10 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fract.xml">GLSL fract man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType fract(genType const & x);
GLM_FUNC_DECL genType fract(genType x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> fract(vecType<T, P> const & x);
/// Modulus. Returns x - y * floor(x / y)
/// for each component in x using the floating point value y.
@@ -135,21 +144,13 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType mod(
genType const & x,
genType const & y);
GLM_FUNC_DECL genType mod(genType x, genType y);
/// Modulus. Returns x - y * floor(x / y)
/// for each component in x using the floating point value y.
///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType mod(
genType const & x,
typename genType::value_type const & y);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> mod(vecType<T, P> const & x, T y);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> mod(vecType<T, P> const & x, vecType<T, P> const & y);
/// Returns the fractional part of x and sets i to the integer
/// part (as a whole number floating point value). Both the
@@ -161,25 +162,22 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/modf.xml">GLSL modf man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType modf(
genType const & x,
genType & i);
GLM_FUNC_DECL genType modf(genType x, genType & i);
/// Returns y if y < x; otherwise, it returns x.
///
/// @tparam genType Floating-point or integer; scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/min.xml">GLSL min man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a><<<<<<< HEAD
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType min(
genType const & x,
genType const & y);
GLM_FUNC_DECL genType min(genType x, genType y);
template <typename genType>
GLM_FUNC_DECL genType min(
genType const & x,
typename genType::value_type const & y);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> min(vecType<T, P> const & x, T y);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> min(vecType<T, P> const & x, vecType<T, P> const & y);
/// Returns y if x < y; otherwise, it returns x.
///
@@ -188,14 +186,13 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/max.xml">GLSL max man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType max(
genType const & x,
genType const & y);
GLM_FUNC_DECL genType max(genType x, genType y);
template <typename genType>
GLM_FUNC_DECL genType max(
genType const & x,
typename genType::value_type const & y);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> max(vecType<T, P> const & x, T y);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> max(vecType<T, P> const & x, vecType<T, P> const & y);
/// Returns min(max(x, minVal), maxVal) for each component in x
/// using the floating-point values minVal and maxVal.
@@ -205,16 +202,13 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/clamp.xml">GLSL clamp man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType clamp(
genType const & x,
genType const & minVal,
genType const & maxVal);
GLM_FUNC_DECL genType clamp(genType x, genType minVal, genType maxVal);
template <typename genType, precision P>
GLM_FUNC_DECL genType clamp(
genType const & x,
typename genType::value_type const & minVal,
typename genType::value_type const & maxVal);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> clamp(vecType<T, P> const & x, T minVal, T maxVal);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> clamp(vecType<T, P> const & x, vecType<T, P> const & minVal, vecType<T, P> const & maxVal);
/// If genTypeU is a floating scalar or vector:
/// Returns x * (1.0 - a) + y * a, i.e., the linear blend of
@@ -259,40 +253,34 @@ namespace glm
/// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter.
/// @endcode
template <typename T, typename U, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> mix(
vecType<T, P> const & x,
vecType<T, P> const & y,
vecType<U, P> const & a);
GLM_FUNC_DECL vecType<T, P> mix(vecType<T, P> const & x, vecType<T, P> const & y, vecType<U, P> const & a);
template <typename T, typename U, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> mix(
vecType<T, P> const & x,
vecType<T, P> const & y,
U const & a);
GLM_FUNC_DECL vecType<T, P> mix(vecType<T, P> const & x, vecType<T, P> const & y, U a);
template <typename genTypeT, typename genTypeU>
GLM_FUNC_DECL genTypeT mix(
genTypeT const & x,
genTypeT const & y,
genTypeU const & a);
GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a);
/// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType step(
genType const & edge,
genType const & x);
GLM_FUNC_DECL genType step(genType edge, genType x);
/// Returns 0.0 if x < edge, otherwise it returns 1.0.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <template <typename, precision> class vecType, typename T, precision P>
GLM_FUNC_DECL vecType<T, P> step(
T const & edge,
vecType<T, P> const & x);
GLM_FUNC_DECL vecType<T, P> step(T edge, vecType<T, P> const & x);
/// Returns 0.0 if x < edge, otherwise it returns 1.0.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <template <typename, precision> class vecType, typename T, precision P>
GLM_FUNC_DECL vecType<T, P> step(vecType<T, P> const & edge, vecType<T, P> const & x);
/// Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and
/// performs smooth Hermite interpolation between 0 and 1
@@ -309,16 +297,13 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/smoothstep.xml">GLSL smoothstep man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL genType smoothstep(
genType const & edge0,
genType const & edge1,
genType const & x);
GLM_FUNC_DECL genType smoothstep(genType edge0, genType edge1, genType x);
template <typename genType>
GLM_FUNC_DECL genType smoothstep(
typename genType::value_type const & edge0,
typename genType::value_type const & edge1,
genType const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> smoothstep(T edge0, T edge1, vecType<T, P> const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> smoothstep(vecType<T, P> const & edge0, vecType<T, P> const & edge1, vecType<T, P> const & x);
/// Returns true if x holds a NaN (not a number)
/// representation in the underlying implementation's set of
@@ -332,8 +317,8 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isnan.xml">GLSL isnan man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL typename genType::bool_type isnan(genType const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<bool, P> isnan(vecType<T, P> const & x);
/// Returns true if x holds a positive infinity or negative
/// infinity representation in the underlying implementation's
@@ -345,8 +330,8 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isinf.xml">GLSL isinf man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType>
GLM_FUNC_DECL typename genType::bool_type isinf(genType const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<bool, P> isinf(vecType<T, P> const & x);
/// Returns a signed integer value representing
/// the encoding of a floating-point value. The floating-point
@@ -469,4 +454,3 @@ namespace glm
#include "func_common.inl"
#endif//GLM_FUNC_COMMON_INCLUDED
File diff suppressed because it is too large Load Diff
+31 -31
View File
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -21,7 +25,7 @@
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/core/func_exponential.hpp
/// @file glm/detail/func_exponential.hpp
/// @date 2008-08-08 / 2011-06-14
/// @author Christophe Riccio
///
@@ -33,8 +37,7 @@
/// These all operate component-wise. The description is per component.
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_func_exponential
#define glm_core_func_exponential
#pragma once
#include "type_vec1.hpp"
#include "type_vec2.hpp"
@@ -49,84 +52,81 @@ namespace glm
/// Returns 'base' raised to the power 'exponent'.
///
/// @param base Floating point value. pow function is defined for input values of x defined in the range (inf-, inf+) in the limit of the type precision.
/// @param base Floating point value. pow function is defined for input values of 'base' defined in the range (inf-, inf+) in the limit of the type precision.
/// @param exponent Floating point value representing the 'exponent'.
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/pow.xml">GLSL pow man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename genType>
GLM_FUNC_DECL genType pow(genType const & base, genType const & exponent);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> pow(vecType<T, P> const & base, vecType<T, P> const & exponent);
/// Returns the natural exponentiation of x, i.e., e^x.
///
/// @param x exp function is defined for input values of x defined in the range (inf-, inf+) in the limit of the type precision.
/// @param v exp function is defined for input values of v defined in the range (inf-, inf+) in the limit of the type precision.
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp.xml">GLSL exp man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename genType>
GLM_FUNC_DECL genType exp(genType const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> exp(vecType<T, P> const & v);
/// Returns the natural logarithm of x, i.e.,
/// Returns the natural logarithm of v, i.e.,
/// returns the value y which satisfies the equation x = e^y.
/// Results are undefined if x <= 0.
/// Results are undefined if v <= 0.
///
/// @param x log function is defined for input values of x defined in the range (0, inf+) in the limit of the type precision.
/// @param v log function is defined for input values of v defined in the range (0, inf+) in the limit of the type precision.
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log.xml">GLSL log man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename genType>
GLM_FUNC_DECL genType log(genType const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> log(vecType<T, P> const & v);
/// Returns 2 raised to the x power.
/// Returns 2 raised to the v power.
///
/// @param x exp2 function is defined for input values of x defined in the range (inf-, inf+) in the limit of the type precision.
/// @param v exp2 function is defined for input values of v defined in the range (inf-, inf+) in the limit of the type precision.
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp2.xml">GLSL exp2 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename genType>
GLM_FUNC_DECL genType exp2(genType const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> exp2(vecType<T, P> const & v);
/// Returns the base 2 log of x, i.e., returns the value y,
/// which satisfies the equation x = 2 ^ y.
///
/// @param x log2 function is defined for input values of x defined in the range (0, inf+) in the limit of the type precision.
/// @param v log2 function is defined for input values of v defined in the range (0, inf+) in the limit of the type precision.
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log2.xml">GLSL log2 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename genType>
GLM_FUNC_DECL genType log2(genType x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> log2(vecType<T, P> const & v);
/// Returns the positive square root of x.
/// Returns the positive square root of v.
///
/// @param x sqrt function is defined for input values of x defined in the range [0, inf+) in the limit of the type precision.
/// @param v sqrt function is defined for input values of v defined in the range [0, inf+) in the limit of the type precision.
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sqrt.xml">GLSL sqrt man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
//template <typename genType>
//GLM_FUNC_DECL genType sqrt(genType const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> sqrt(vecType<T, P> const & x);
GLM_FUNC_DECL vecType<T, P> sqrt(vecType<T, P> const & v);
/// Returns the reciprocal of the positive square root of x.
/// Returns the reciprocal of the positive square root of v.
///
/// @param x inversesqrt function is defined for input values of x defined in the range [0, inf+) in the limit of the type precision.
/// @param v inversesqrt function is defined for input values of v defined in the range [0, inf+) in the limit of the type precision.
/// @tparam genType Floating-point scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inversesqrt.xml">GLSL inversesqrt man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename genType>
GLM_FUNC_DECL genType inversesqrt(genType const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> inversesqrt(vecType<T, P> const & v);
/// @}
}//namespace glm
#include "func_exponential.inl"
#endif//glm_core_func_exponential
+51 -137
View File
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -21,7 +25,7 @@
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/core/func_exponential.inl
/// @file glm/detail/func_exponential.inl
/// @date 2008-08-03 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
@@ -29,25 +33,28 @@
#include "func_vector_relational.hpp"
#include "_vectorize.hpp"
#include <limits>
#include <cmath>
#include <cassert>
namespace glm{
namespace detail
{
template <bool isFloat>
# if GLM_HAS_CXX11_STL
using std::log2;
# else
template <typename genType>
genType log2(genType Value)
{
return std::log(Value) * static_cast<genType>(1.4426950408889634073599246810019);
}
# endif
template <typename T, precision P, template <class, precision> class vecType, bool isFloat = true>
struct compute_log2
{
template <typename T>
T operator() (T const & Value) const;
};
template <>
struct compute_log2<true>
{
template <typename T>
GLM_FUNC_QUALIFIER T operator() (T const & Value) const
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & vec)
{
return static_cast<T>(::std::log(Value)) * static_cast<T>(1.4426950408889634073599246810019);
return detail::functor1<T, T, P, vecType>::call(log2, vec);
}
};
@@ -78,170 +85,77 @@ namespace detail
}//namespace detail
// pow
template <typename genType>
GLM_FUNC_QUALIFIER genType pow
(
genType const & x,
genType const & y
)
using std::pow;
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> pow(vecType<T, P> const & base, vecType<T, P> const & exponent)
{
GLM_STATIC_ASSERT(
std::numeric_limits<genType>::is_iec559,
"'pow' only accept floating-point inputs");
return std::pow(x, y);
return detail::functor2<T, P, vecType>::call(pow, base, exponent);
}
VECTORIZE_VEC_VEC(pow)
// exp
template <typename genType>
GLM_FUNC_QUALIFIER genType exp
(
genType const & x
)
using std::exp;
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> exp(vecType<T, P> const & x)
{
GLM_STATIC_ASSERT(
std::numeric_limits<genType>::is_iec559,
"'exp' only accept floating-point inputs");
return std::exp(x);
return detail::functor1<T, T, P, vecType>::call(exp, x);
}
VECTORIZE_VEC(exp)
// log
template <typename genType>
GLM_FUNC_QUALIFIER genType log
(
genType const & x
)
using std::log;
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> log(vecType<T, P> const & x)
{
GLM_STATIC_ASSERT(
std::numeric_limits<genType>::is_iec559,
"'log' only accept floating-point inputs");
return std::log(x);
return detail::functor1<T, T, P, vecType>::call(log, x);
}
VECTORIZE_VEC(log)
//exp2, ln2 = 0.69314718055994530941723212145818f
template <typename genType>
GLM_FUNC_QUALIFIER genType exp2(genType const & x)
GLM_FUNC_QUALIFIER genType exp2(genType x)
{
GLM_STATIC_ASSERT(
std::numeric_limits<genType>::is_iec559,
"'exp2' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'exp2' only accept floating-point inputs");
return std::exp(static_cast<genType>(0.69314718055994530941723212145818) * x);
}
VECTORIZE_VEC(exp2)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> exp2(vecType<T, P> const & x)
{
return detail::functor1<T, T, P, vecType>::call(exp2, x);
}
// log2, ln2 = 0.69314718055994530941723212145818f
template <typename genType>
GLM_FUNC_QUALIFIER genType log2(genType x)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer,
"GLM core 'log2' only accept floating-point inputs. Include <glm/gtx/integer.hpp> for additional integer support.");
assert(x > genType(0)); // log2 is only defined on the range (0, inf]
return detail::compute_log2<std::numeric_limits<genType>::is_iec559>()(x);
return log2(tvec1<genType>(x)).x;
}
VECTORIZE_VEC(log2)
namespace detail
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> log2(vecType<T, P> const & x)
{
template <template <class, precision> class vecType, typename T, precision P>
struct compute_sqrt{};
template <typename T, precision P>
struct compute_sqrt<detail::tvec1, T, P>
{
GLM_FUNC_QUALIFIER static detail::tvec1<T, P> call(detail::tvec1<T, P> const & x)
{
return detail::tvec1<T, P>(std::sqrt(x.x));
}
};
template <typename T, precision P>
struct compute_sqrt<detail::tvec2, T, P>
{
GLM_FUNC_QUALIFIER static detail::tvec2<T, P> call(detail::tvec2<T, P> const & x)
{
return detail::tvec2<T, P>(std::sqrt(x.x), std::sqrt(x.y));
}
};
template <typename T, precision P>
struct compute_sqrt<detail::tvec3, T, P>
{
GLM_FUNC_QUALIFIER static detail::tvec3<T, P> call(detail::tvec3<T, P> const & x)
{
return detail::tvec3<T, P>(std::sqrt(x.x), std::sqrt(x.y), std::sqrt(x.z));
}
};
template <typename T, precision P>
struct compute_sqrt<detail::tvec4, T, P>
{
GLM_FUNC_QUALIFIER static detail::tvec4<T, P> call(detail::tvec4<T, P> const & x)
{
return detail::tvec4<T, P>(std::sqrt(x.x), std::sqrt(x.y), std::sqrt(x.z), std::sqrt(x.w));
}
};
}//namespace detail
return detail::compute_log2<T, P, vecType, std::numeric_limits<T>::is_iec559>::call(x);
}
// sqrt
GLM_FUNC_QUALIFIER float sqrt(float x)
{
# ifdef __CUDACC__ // Wordaround for a CUDA compiler bug up to CUDA6
detail::tvec1<float, highp> tmp(detail::compute_sqrt<detail::tvec1, float, highp>::call(x));
return tmp.x;
# else
return detail::compute_sqrt<detail::tvec1, float, highp>::call(x).x;
# endif
}
GLM_FUNC_QUALIFIER double sqrt(double x)
{
# ifdef __CUDACC__ // Wordaround for a CUDA compiler bug up to CUDA6
detail::tvec1<double, highp> tmp(detail::compute_sqrt<detail::tvec1, double, highp>::call(x));
return tmp.x;
# else
return detail::compute_sqrt<detail::tvec1, double, highp>::call(x).x;
# endif
}
using std::sqrt;
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> sqrt(vecType<T, P> const & x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sqrt' only accept floating-point inputs");
return detail::compute_sqrt<vecType, T, P>::call(x);
return detail::functor1<T, T, P, vecType>::call(sqrt, x);
}
// inversesqrt
GLM_FUNC_QUALIFIER float inversesqrt(float const & x)
template <typename genType>
GLM_FUNC_QUALIFIER genType inversesqrt(genType x)
{
return 1.0f / sqrt(x);
return static_cast<genType>(1) / sqrt(x);
}
GLM_FUNC_QUALIFIER double inversesqrt(double const & x)
{
return 1.0 / sqrt(x);
}
template <template <class, precision> class vecType, typename T, precision P>
GLM_FUNC_QUALIFIER vecType<T, P> inversesqrt
(
vecType<T, P> const & x
)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> inversesqrt(vecType<T, P> const & x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'inversesqrt' only accept floating-point inputs");
return detail::compute_inversesqrt<vecType, T, P>::call(x);
}
VECTORIZE_VEC(inversesqrt)
}//namespace glm
+21 -30
View File
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -21,7 +25,7 @@
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/core/func_geometric.hpp
/// @file glm/detail/func_geometric.hpp
/// @date 2008-08-03 / 2011-06-14
/// @author Christophe Riccio
///
@@ -33,8 +37,7 @@
/// These operate on vectors as vectors, not component-wise.
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_func_geometric
#define glm_core_func_geometric
#pragma once
#include "type_vec3.hpp"
@@ -49,9 +52,9 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/length.xml">GLSL length man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename genType>
GLM_FUNC_DECL typename genType::value_type length(
genType const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL T length(
vecType<T, P> const & x);
/// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1).
///
@@ -59,10 +62,10 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/distance.xml">GLSL distance man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename genType>
GLM_FUNC_DECL typename genType::value_type distance(
genType const & p0,
genType const & p1);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL T distance(
vecType<T, P> const & p0,
vecType<T, P> const & p1);
/// Returns the dot product of x and y, i.e., result = x * y.
///
@@ -75,17 +78,6 @@ namespace glm
vecType<T, P> const & x,
vecType<T, P> const & y);
/// Returns the dot product of x and y, i.e., result = x * y.
///
/// @tparam genType Floating-point vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/dot.xml">GLSL dot man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename genType>
GLM_FUNC_DECL genType dot(
genType const & x,
genType const & y);
/// Returns the cross product of x and y.
///
/// @tparam valType Floating-point scalar types.
@@ -93,17 +85,18 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cross.xml">GLSL cross man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename T, precision P>
GLM_FUNC_DECL detail::tvec3<T, P> cross(
detail::tvec3<T, P> const & x,
detail::tvec3<T, P> const & y);
GLM_FUNC_DECL tvec3<T, P> cross(
tvec3<T, P> const & x,
tvec3<T, P> const & y);
/// Returns a vector in the same direction as x but with length of 1.
/// According to issue 10 GLSL 1.10 specification, if length(x) == 0 then result is undefined and generate an error.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/normalize.xml">GLSL normalize man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename genType>
GLM_FUNC_DECL genType normalize(
genType const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> normalize(
vecType<T, P> const & x);
/// If dot(Nref, I) < 0.0, return N, otherwise, return -N.
///
@@ -141,11 +134,9 @@ namespace glm
GLM_FUNC_DECL vecType<T, P> refract(
vecType<T, P> const & I,
vecType<T, P> const & N,
T const & eta);
T eta);
/// @}
}//namespace glm
#include "func_geometric.inl"
#endif//glm_core_func_geometric
+46 -191
View File
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -21,7 +25,7 @@
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/core/func_geometric.inl
/// @file glm/detail/func_geometric.inl
/// @date 2008-08-03 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
@@ -39,45 +43,40 @@ namespace detail
struct compute_dot{};
template <typename T, precision P>
struct compute_dot<detail::tvec1, T, P>
struct compute_dot<tvec1, T, P>
{
GLM_FUNC_QUALIFIER static T call(detail::tvec1<T, P> const & x, detail::tvec1<T, P> const & y)
GLM_FUNC_QUALIFIER static T call(tvec1<T, P> const & a, tvec1<T, P> const & b)
{
# ifdef __CUDACC__ // Wordaround for a CUDA compiler bug up to CUDA6
detail::tvec1<T, P> tmp(x * y);
return tmp.x;
# else
return detail::tvec1<T, P>(x * y).x;
# endif
return a.x * b.x;
}
};
template <typename T, precision P>
struct compute_dot<detail::tvec2, T, P>
struct compute_dot<tvec2, T, P>
{
GLM_FUNC_QUALIFIER static T call(detail::tvec2<T, P> const & x, detail::tvec2<T, P> const & y)
GLM_FUNC_QUALIFIER static T call(tvec2<T, P> const & x, tvec2<T, P> const & y)
{
detail::tvec2<T, P> tmp(x * y);
tvec2<T, P> tmp(x * y);
return tmp.x + tmp.y;
}
};
template <typename T, precision P>
struct compute_dot<detail::tvec3, T, P>
struct compute_dot<tvec3, T, P>
{
GLM_FUNC_QUALIFIER static T call(detail::tvec3<T, P> const & x, detail::tvec3<T, P> const & y)
GLM_FUNC_QUALIFIER static T call(tvec3<T, P> const & x, tvec3<T, P> const & y)
{
detail::tvec3<T, P> tmp(x * y);
tvec3<T, P> tmp(x * y);
return tmp.x + tmp.y + tmp.z;
}
};
template <typename T, precision P>
struct compute_dot<detail::tvec4, T, P>
struct compute_dot<tvec4, T, P>
{
GLM_FUNC_QUALIFIER static T call(detail::tvec4<T, P> const & x, detail::tvec4<T, P> const & y)
GLM_FUNC_QUALIFIER static T call(tvec4<T, P> const & x, tvec4<T, P> const & y)
{
detail::tvec4<T, P> tmp(x * y);
tvec4<T, P> tmp(x * y);
return (tmp.x + tmp.y) + (tmp.z + tmp.w);
}
};
@@ -85,144 +84,58 @@ namespace detail
// length
template <typename genType>
GLM_FUNC_QUALIFIER genType length
(
genType const & x
)
GLM_FUNC_QUALIFIER genType length(genType x)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'length' only accept floating-point inputs");
genType sqr = x * x;
return sqrt(sqr);
return abs(x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T length(detail::tvec2<T, P> const & v)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER T length(vecType<T, P> const & v)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'length' only accept floating-point inputs");
T sqr = v.x * v.x + v.y * v.y;
return sqrt(sqr);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T length(detail::tvec3<T, P> const & v)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'length' only accept floating-point inputs");
T sqr = v.x * v.x + v.y * v.y + v.z * v.z;
return sqrt(sqr);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T length(detail::tvec4<T, P> const & v)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'length' only accept floating-point inputs");
T sqr = v.x * v.x + v.y * v.y + v.z * v.z + v.w * v.w;
return sqrt(sqr);
return sqrt(dot(v, v));
}
// distance
template <typename genType>
GLM_FUNC_QUALIFIER genType distance
(
genType const & p0,
genType const & p1
)
GLM_FUNC_QUALIFIER genType distance(genType const & p0, genType const & p1)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'distance' only accept floating-point inputs");
return length(p1 - p0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T distance
(
detail::tvec2<T, P> const & p0,
detail::tvec2<T, P> const & p1
)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER T distance(vecType<T, P> const & p0, vecType<T, P> const & p1)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'distance' only accept floating-point inputs");
return length(p1 - p0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T distance
(
detail::tvec3<T, P> const & p0,
detail::tvec3<T, P> const & p1
)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'distance' only accept floating-point inputs");
return length(p1 - p0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T distance
(
detail::tvec4<T, P> const & p0,
detail::tvec4<T, P> const & p1
)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'distance' only accept floating-point inputs");
return length(p1 - p0);
}
// dot
template <typename T>
GLM_FUNC_QUALIFIER T dot
(
T const & x,
T const & y
)
GLM_FUNC_QUALIFIER T dot(T x, T y)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' only accept floating-point inputs");
return detail::compute_dot<detail::tvec1, T, highp>::call(x, y);
return x * y;
}
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER T dot
(
vecType<T, P> const & x,
vecType<T, P> const & y
)
GLM_FUNC_QUALIFIER T dot(vecType<T, P> const & x, vecType<T, P> const & y)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' only accept floating-point inputs");
return detail::compute_dot<vecType, T, P>::call(x, y);
}
/* // SSE3
GLM_FUNC_QUALIFIER float dot(const tvec4<float>& x, const tvec4<float>& y)
{
float Result;
__asm
{
mov esi, x
mov edi, y
movaps xmm0, [esi]
mulps xmm0, [edi]
haddps( _xmm0, _xmm0 )
haddps( _xmm0, _xmm0 )
movss Result, xmm0
}
return Result;
}
*/
// cross
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec3<T, P> cross
(
detail::tvec3<T, P> const & x,
detail::tvec3<T, P> const & y
)
GLM_FUNC_QUALIFIER tvec3<T, P> cross(tvec3<T, P> const & x, tvec3<T, P> const & y)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'cross' only accept floating-point inputs");
return detail::tvec3<T, P>(
return tvec3<T, P>(
x.y * y.z - y.y * x.z,
x.z * y.x - y.z * x.x,
x.x * y.y - y.x * x.y);
@@ -230,111 +143,53 @@ namespace detail
// normalize
template <typename genType>
GLM_FUNC_QUALIFIER genType normalize
(
genType const & x
)
GLM_FUNC_QUALIFIER genType normalize(genType const & x)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'normalize' only accept floating-point inputs");
return x < genType(0) ? genType(-1) : genType(1);
}
// According to issue 10 GLSL 1.10 specification, if length(x) == 0 then result is undefine and generate an error
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec2<T, P> normalize
(
detail::tvec2<T, P> const & x
)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' only accept floating-point inputs");
T sqr = x.x * x.x + x.y * x.y;
return x * inversesqrt(sqr);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec3<T, P> normalize
(
detail::tvec3<T, P> const & x
)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> normalize(vecType<T, P> const & x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' only accept floating-point inputs");
T sqr = x.x * x.x + x.y * x.y + x.z * x.z;
return x * inversesqrt(sqr);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec4<T, P> normalize
(
detail::tvec4<T, P> const & x
)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' only accept floating-point inputs");
T sqr = x.x * x.x + x.y * x.y + x.z * x.z + x.w * x.w;
return x * inversesqrt(sqr);
return x * inversesqrt(dot(x, x));
}
// faceforward
template <typename genType>
GLM_FUNC_QUALIFIER genType faceforward
(
genType const & N,
genType const & I,
genType const & Nref
)
GLM_FUNC_QUALIFIER genType faceforward(genType const & N, genType const & I, genType const & Nref)
{
return dot(Nref, I) < 0 ? N : -N;
return dot(Nref, I) < static_cast<genType>(0) ? N : -N;
}
// reflect
template <typename genType>
GLM_FUNC_QUALIFIER genType reflect
(
genType const & I,
genType const & N
)
GLM_FUNC_QUALIFIER genType reflect(genType const & I, genType const & N)
{
return I - N * dot(N, I) * genType(2);
return I - N * dot(N, I) * static_cast<genType>(2);
}
// refract
template <typename genType>
GLM_FUNC_QUALIFIER genType refract
(
genType const & I,
genType const & N,
genType const & eta
)
GLM_FUNC_QUALIFIER genType refract(genType const & I, genType const & N, genType const & eta)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'refract' only accept floating-point inputs");
genType dotValue = dot(N, I);
genType k = genType(1) - eta * eta * (genType(1) - dotValue * dotValue);
if(k < genType(0))
return genType(0);
else
return eta * I - (eta * dotValue + sqrt(k)) * N;
genType const dotValue(dot(N, I));
genType const k(static_cast<genType>(1) - eta * eta * (static_cast<genType>(1) - dotValue * dotValue));
return (eta * I - (eta * dotValue + sqrt(k)) * N) * static_cast<genType>(k >= static_cast<genType>(0));
}
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> refract
(
vecType<T, P> const & I,
vecType<T, P> const & N,
T const & eta
)
GLM_FUNC_QUALIFIER vecType<T, P> refract(vecType<T, P> const & I, vecType<T, P> const & N, T eta)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'refract' only accept floating-point inputs");
T dotValue = dot(N, I);
T k = T(1) - eta * eta * (T(1) - dotValue * dotValue);
if(k < T(0))
return vecType<T, P>(0);
else
return eta * I - (eta * dotValue + std::sqrt(k)) * N;
T const dotValue(dot(N, I));
T const k(static_cast<T>(1) - eta * eta * (static_cast<T>(1) - dotValue * dotValue));
return (eta * I - (eta * dotValue + std::sqrt(k)) * N) * static_cast<T>(k >= static_cast<T>(0));
}
}//namespace glm
+85 -56
View File
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -21,7 +25,7 @@
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/core/func_integer.hpp
/// @file glm/detail/func_integer.hpp
/// @date 2010-03-17 / 2011-06-18
/// @author Christophe Riccio
///
@@ -35,10 +39,12 @@
/// b, inclusive. The lowest-order bit is bit 0.
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_func_integer
#define glm_core_func_integer
#pragma once
#include "setup.hpp"
#include "precision.hpp"
#include "func_common.hpp"
#include "func_vector_relational.hpp"
namespace glm
{
@@ -53,11 +59,11 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uaddCarry.xml">GLSL uaddCarry man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename genUType>
GLM_FUNC_DECL genUType uaddCarry(
genUType const & x,
genUType const & y,
genUType & carry);
template <precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<uint, P> uaddCarry(
vecType<uint, P> const & x,
vecType<uint, P> const & y,
vecType<uint, P> & carry);
/// Subtracts the 32-bit unsigned integer y from x, returning
/// the difference if non-negative, or pow(2, 32) plus the difference
@@ -67,12 +73,12 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/usubBorrow.xml">GLSL usubBorrow man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename genUType>
GLM_FUNC_DECL genUType usubBorrow(
genUType const & x,
genUType const & y,
genUType & borrow);
template <precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<uint, P> usubBorrow(
vecType<uint, P> const & x,
vecType<uint, P> const & y,
vecType<uint, P> & borrow);
/// Multiplies 32-bit integers x and y, producing a 64-bit
/// result. The 32 least-significant bits are returned in lsb.
/// The 32 most-significant bits are returned in msb.
@@ -81,12 +87,12 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/umulExtended.xml">GLSL umulExtended man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename genUType>
template <precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL void umulExtended(
genUType const & x,
genUType const & y,
genUType & msb,
genUType & lsb);
vecType<uint, P> const & x,
vecType<uint, P> const & y,
vecType<uint, P> & msb,
vecType<uint, P> & lsb);
/// Multiplies 32-bit integers x and y, producing a 64-bit
/// result. The 32 least-significant bits are returned in lsb.
@@ -96,12 +102,12 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/imulExtended.xml">GLSL imulExtended man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename genIType>
template <precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL void imulExtended(
genIType const & x,
genIType const & y,
genIType & msb,
genIType & lsb);
vecType<int, P> const & x,
vecType<int, P> const & y,
vecType<int, P> & msb,
vecType<int, P> & lsb);
/// Extracts bits [offset, offset + bits - 1] from value,
/// returning them in the least significant bits of the result.
@@ -114,15 +120,15 @@ namespace glm
/// offset and bits is greater than the number of bits used
/// to store the operand.
///
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
/// @tparam T Signed or unsigned integer scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldExtract.xml">GLSL bitfieldExtract man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename genIUType>
GLM_FUNC_DECL genIUType bitfieldExtract(
genIUType const & Value,
int const & Offset,
int const & Bits);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> bitfieldExtract(
vecType<T, P> const & Value,
int Offset,
int Bits);
/// Returns the insertion the bits least-significant bits of insert into base.
///
@@ -134,70 +140,93 @@ namespace glm
/// offset and bits is greater than the number of bits used to
/// store the operand.
///
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
/// @tparam T Signed or unsigned integer scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldInsert.xml">GLSL bitfieldInsert man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename genIUType>
GLM_FUNC_DECL genIUType bitfieldInsert(
genIUType const & Base,
genIUType const & Insert,
int const & Offset,
int const & Bits);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> bitfieldInsert(
vecType<T, P> const & Base,
vecType<T, P> const & Insert,
int Offset,
int Bits);
/// Returns the reversal of the bits of value.
/// The bit numbered n of the result will be taken from bit (bits - 1) - n of value,
/// where bits is the total number of bits used to represent value.
///
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
/// @tparam T Signed or unsigned integer scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldReverse.xml">GLSL bitfieldReverse man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename genIUType>
GLM_FUNC_DECL genIUType bitfieldReverse(genIUType const & Value);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> bitfieldReverse(vecType<T, P> const & v);
/// Returns the number of bits set to 1 in the binary representation of value.
///
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
/// @tparam T Signed or unsigned integer scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitCount.xml">GLSL bitCount man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename genType>
GLM_FUNC_DECL int bitCount(genType v);
/// Returns the number of bits set to 1 in the binary representation of value.
///
/// @todo Clarify the declaration to specify that scalars are suported.
template <typename T, template <typename> class genIUType>
GLM_FUNC_DECL typename genIUType<T>::signed_type bitCount(genIUType<T> const & Value);
/// @tparam T Signed or unsigned integer scalar or vector types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitCount.xml">GLSL bitCount man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<int, P> bitCount(vecType<T, P> const & v);
/// Returns the bit number of the least significant bit set to
/// 1 in the binary representation of value.
/// If value is zero, -1 will be returned.
///
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
/// @tparam T Signed or unsigned integer scalar types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findLSB.xml">GLSL findLSB man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename genIUType>
GLM_FUNC_DECL int findLSB(genIUType x);
/// Returns the bit number of the least significant bit set to
/// 1 in the binary representation of value.
/// If value is zero, -1 will be returned.
///
/// @todo Clarify the declaration to specify that scalars are suported.
template <typename T, template <typename> class genIUType>
GLM_FUNC_DECL typename genIUType<T>::signed_type findLSB(genIUType<T> const & Value);
/// @tparam T Signed or unsigned integer scalar types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findLSB.xml">GLSL findLSB man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<int, P> findLSB(vecType<T, P> const & v);
/// Returns the bit number of the most significant bit in the binary representation of value.
/// For positive integers, the result will be the bit number of the most significant bit set to 1.
/// For negative integers, the result will be the bit number of the most significant
/// bit set to 0. For a value of zero or negative one, -1 will be returned.
///
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
/// @tparam T Signed or unsigned integer scalar types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findMSB.xml">GLSL findMSB man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename genIUType>
GLM_FUNC_DECL int findMSB(genIUType x);
/// Returns the bit number of the most significant bit in the binary representation of value.
/// For positive integers, the result will be the bit number of the most significant bit set to 1.
/// For negative integers, the result will be the bit number of the most significant
/// bit set to 0. For a value of zero or negative one, -1 will be returned.
///
/// @todo Clarify the declaration to specify that scalars are suported.
template <typename T, template <typename> class genIUType>
GLM_FUNC_DECL typename genIUType<T>::signed_type findMSB(genIUType<T> const & Value);
/// @tparam T Signed or unsigned integer scalar types.
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findMSB.xml">GLSL findMSB man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<int, P> findMSB(vecType<T, P> const & v);
/// @}
}//namespace glm
#include "func_integer.inl"
#endif//glm_core_func_integer
+251 -512
View File
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -21,7 +25,7 @@
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/core/func_integer.inl
/// @file glm/detail/func_integer.inl
/// @date 2010-03-17 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
@@ -39,73 +43,186 @@
#endif//(GLM_ARCH != GLM_ARCH_PURE)
#include <limits>
namespace glm
namespace glm{
namespace detail
{
template <typename T>
GLM_FUNC_QUALIFIER T mask(T Bits)
{
return Bits >= sizeof(T) * 8 ? ~static_cast<T>(0) : (static_cast<T>(1) << Bits) - static_cast<T>(1);
}
template <bool EXEC = false>
struct compute_bitfieldReverseStep
{
template <typename T, glm::precision P, template <class, glm::precision> class vecType>
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & v, T, T)
{
return v;
}
};
template <>
struct compute_bitfieldReverseStep<true>
{
template <typename T, glm::precision P, template <class, glm::precision> class vecType>
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & v, T Mask, T Shift)
{
return (v & Mask) << Shift | (v & (~Mask)) >> Shift;
}
};
template <bool EXEC = false>
struct compute_bitfieldBitCountStep
{
template <typename T, glm::precision P, template <class, glm::precision> class vecType>
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & v, T, T)
{
return v;
}
};
template <>
struct compute_bitfieldBitCountStep<true>
{
template <typename T, glm::precision P, template <class, glm::precision> class vecType>
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & v, T Mask, T Shift)
{
return (v & Mask) + ((v >> Shift) & Mask);
}
};
template <typename genIUType, size_t Bits>
struct compute_findLSB
{
GLM_FUNC_QUALIFIER static int call(genIUType Value)
{
if(Value == 0)
return -1;
return glm::bitCount(~Value & (Value - static_cast<genIUType>(1)));
}
};
# if GLM_HAS_BITSCAN_WINDOWS
template <typename genIUType>
struct compute_findLSB<genIUType, 32>
{
GLM_FUNC_QUALIFIER static int call(genIUType Value)
{
unsigned long Result(0);
unsigned char IsNotNull = _BitScanForward(&Result, *reinterpret_cast<unsigned long*>(&Value));
return IsNotNull ? int(Result) : -1;
}
};
# if !((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_MODEL == GLM_MODEL_32))
template <typename genIUType>
struct compute_findLSB<genIUType, 64>
{
GLM_FUNC_QUALIFIER static int call(genIUType Value)
{
unsigned long Result(0);
unsigned char IsNotNull = _BitScanForward64(&Result, *reinterpret_cast<unsigned __int64*>(&Value));
return IsNotNull ? int(Result) : -1;
}
};
# endif
# endif//GLM_HAS_BITSCAN_WINDOWS
template <typename T, glm::precision P, template <class, glm::precision> class vecType, bool EXEC = true>
struct compute_findMSB_step_vec
{
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, T Shift)
{
return x | (x >> Shift);
}
};
template <typename T, glm::precision P, template <typename, glm::precision> class vecType>
struct compute_findMSB_step_vec<T, P, vecType, false>
{
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, T)
{
return x;
}
};
template <typename T, glm::precision P, template <typename, glm::precision> class vecType, int>
struct compute_findMSB_vec
{
GLM_FUNC_QUALIFIER static vecType<int, P> call(vecType<T, P> const & vec)
{
vecType<T, P> x(vec);
x = compute_findMSB_step_vec<T, P, vecType, sizeof(T) * 8 >= 8>::call(x, static_cast<T>( 1));
x = compute_findMSB_step_vec<T, P, vecType, sizeof(T) * 8 >= 8>::call(x, static_cast<T>( 2));
x = compute_findMSB_step_vec<T, P, vecType, sizeof(T) * 8 >= 8>::call(x, static_cast<T>( 4));
x = compute_findMSB_step_vec<T, P, vecType, sizeof(T) * 8 >= 16>::call(x, static_cast<T>( 8));
x = compute_findMSB_step_vec<T, P, vecType, sizeof(T) * 8 >= 32>::call(x, static_cast<T>(16));
x = compute_findMSB_step_vec<T, P, vecType, sizeof(T) * 8 >= 64>::call(x, static_cast<T>(32));
return vecType<int, P>(sizeof(T) * 8 - 1) - glm::bitCount(~x);
}
};
# if GLM_HAS_BITSCAN_WINDOWS
template <typename genIUType>
GLM_FUNC_QUALIFIER int compute_findMSB_32(genIUType Value)
{
unsigned long Result(0);
unsigned char IsNotNull = _BitScanReverse(&Result, *reinterpret_cast<unsigned long*>(&Value));
return IsNotNull ? int(Result) : -1;
}
template <typename T, glm::precision P, template <class, glm::precision> class vecType>
struct compute_findMSB_vec<T, P, vecType, 32>
{
GLM_FUNC_QUALIFIER static vecType<int, P> call(vecType<T, P> const & x)
{
return detail::functor1<int, T, P, vecType>::call(compute_findMSB_32, x);
}
};
# if !((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_MODEL == GLM_MODEL_32))
template <typename genIUType>
GLM_FUNC_QUALIFIER int compute_findMSB_64(genIUType Value)
{
unsigned long Result(0);
unsigned char IsNotNull = _BitScanReverse64(&Result, *reinterpret_cast<unsigned __int64*>(&Value));
return IsNotNull ? int(Result) : -1;
}
template <typename T, glm::precision P, template <class, glm::precision> class vecType>
struct compute_findMSB_vec<T, P, vecType, 64>
{
GLM_FUNC_QUALIFIER static vecType<int, P> call(vecType<T, P> const & x)
{
return detail::functor1<int, T, P, vecType>::call(compute_findMSB_64, x);
}
};
# endif
# endif//GLM_HAS_BITSCAN_WINDOWS
}//namespace detail
// uaddCarry
template <>
GLM_FUNC_QUALIFIER uint uaddCarry
(
uint const & x,
uint const & y,
uint & Carry
)
GLM_FUNC_QUALIFIER uint uaddCarry(uint const & x, uint const & y, uint & Carry)
{
uint64 Value64 = static_cast<uint64>(x) + static_cast<uint64>(y);
uint32 Result = static_cast<uint32>(Value64 % (static_cast<uint64>(1) << static_cast<uint64>(32)));
Carry = (Value64 % (static_cast<uint64>(1) << static_cast<uint64>(32))) > 1 ? static_cast<uint32>(1) : static_cast<uint32>(0);
return Result;
uint64 const Value64(static_cast<uint64>(x) + static_cast<uint64>(y));
uint64 const Max32((static_cast<uint64>(1) << static_cast<uint64>(32)) - static_cast<uint64>(1));
Carry = Value64 > Max32 ? 1 : 0;
return static_cast<uint32>(Value64 % (Max32 + static_cast<uint64>(1)));
}
template <>
GLM_FUNC_QUALIFIER uvec2 uaddCarry
(
uvec2 const & x,
uvec2 const & y,
uvec2 & Carry
)
template <precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<uint, P> uaddCarry(vecType<uint, P> const & x, vecType<uint, P> const & y, vecType<uint, P> & Carry)
{
return uvec2(
uaddCarry(x[0], y[0], Carry[0]),
uaddCarry(x[1], y[1], Carry[1]));
}
template <>
GLM_FUNC_QUALIFIER uvec3 uaddCarry
(
uvec3 const & x,
uvec3 const & y,
uvec3 & Carry
)
{
return uvec3(
uaddCarry(x[0], y[0], Carry[0]),
uaddCarry(x[1], y[1], Carry[1]),
uaddCarry(x[2], y[2], Carry[2]));
}
template <>
GLM_FUNC_QUALIFIER uvec4 uaddCarry
(
uvec4 const & x,
uvec4 const & y,
uvec4 & Carry
)
{
return uvec4(
uaddCarry(x[0], y[0], Carry[0]),
uaddCarry(x[1], y[1], Carry[1]),
uaddCarry(x[2], y[2], Carry[2]),
uaddCarry(x[3], y[3], Carry[3]));
vecType<uint64, P> Value64(vecType<uint64, P>(x) + vecType<uint64, P>(y));
vecType<uint64, P> Max32((static_cast<uint64>(1) << static_cast<uint64>(32)) - static_cast<uint64>(1));
Carry = mix(vecType<uint32, P>(0), vecType<uint32, P>(1), greaterThan(Value64, Max32));
return vecType<uint32,P>(Value64 % (Max32 + static_cast<uint64>(1)));
}
// usubBorrow
template <>
GLM_FUNC_QUALIFIER uint usubBorrow
(
uint const & x,
uint const & y,
uint & Borrow
)
GLM_FUNC_QUALIFIER uint usubBorrow(uint const & x, uint const & y, uint & Borrow)
{
GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch");
@@ -116,57 +233,17 @@ namespace glm
return static_cast<uint32>((static_cast<int64>(1) << static_cast<int64>(32)) + (static_cast<int64>(y) - static_cast<int64>(x)));
}
template <>
GLM_FUNC_QUALIFIER uvec2 usubBorrow
(
uvec2 const & x,
uvec2 const & y,
uvec2 & Borrow
)
template <precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<uint, P> usubBorrow(vecType<uint, P> const & x, vecType<uint, P> const & y, vecType<uint, P> & Borrow)
{
return uvec2(
usubBorrow(x[0], y[0], Borrow[0]),
usubBorrow(x[1], y[1], Borrow[1]));
}
template <>
GLM_FUNC_QUALIFIER uvec3 usubBorrow
(
uvec3 const & x,
uvec3 const & y,
uvec3 & Borrow
)
{
return uvec3(
usubBorrow(x[0], y[0], Borrow[0]),
usubBorrow(x[1], y[1], Borrow[1]),
usubBorrow(x[2], y[2], Borrow[2]));
}
template <>
GLM_FUNC_QUALIFIER uvec4 usubBorrow
(
uvec4 const & x,
uvec4 const & y,
uvec4 & Borrow
)
{
return uvec4(
usubBorrow(x[0], y[0], Borrow[0]),
usubBorrow(x[1], y[1], Borrow[1]),
usubBorrow(x[2], y[2], Borrow[2]),
usubBorrow(x[3], y[3], Borrow[3]));
Borrow = mix(vecType<uint, P>(1), vecType<uint, P>(0), greaterThanEqual(x, y));
vecType<uint, P> const YgeX(y - x);
vecType<uint, P> const XgeY(vecType<uint32, P>((static_cast<int64>(1) << static_cast<int64>(32)) + (vecType<int64, P>(y) - vecType<int64, P>(x))));
return mix(XgeY, YgeX, greaterThanEqual(y, x));
}
// umulExtended
template <>
GLM_FUNC_QUALIFIER void umulExtended
(
uint const & x,
uint const & y,
uint & msb,
uint & lsb
)
GLM_FUNC_QUALIFIER void umulExtended(uint const & x, uint const & y, uint & msb, uint & lsb)
{
GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch");
@@ -177,57 +254,18 @@ namespace glm
lsb = *PointerLSB;
}
template <>
GLM_FUNC_QUALIFIER void umulExtended
(
uvec2 const & x,
uvec2 const & y,
uvec2 & msb,
uvec2 & lsb
)
template <precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER void umulExtended(vecType<uint, P> const & x, vecType<uint, P> const & y, vecType<uint, P> & msb, vecType<uint, P> & lsb)
{
umulExtended(x[0], y[0], msb[0], lsb[0]);
umulExtended(x[1], y[1], msb[1], lsb[1]);
}
GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch");
template <>
GLM_FUNC_QUALIFIER void umulExtended
(
uvec3 const & x,
uvec3 const & y,
uvec3 & msb,
uvec3 & lsb
)
{
umulExtended(x[0], y[0], msb[0], lsb[0]);
umulExtended(x[1], y[1], msb[1], lsb[1]);
umulExtended(x[2], y[2], msb[2], lsb[2]);
}
template <>
GLM_FUNC_QUALIFIER void umulExtended
(
uvec4 const & x,
uvec4 const & y,
uvec4 & msb,
uvec4 & lsb
)
{
umulExtended(x[0], y[0], msb[0], lsb[0]);
umulExtended(x[1], y[1], msb[1], lsb[1]);
umulExtended(x[2], y[2], msb[2], lsb[2]);
umulExtended(x[3], y[3], msb[3], lsb[3]);
vecType<uint64, P> Value64(vecType<uint64, P>(x) * vecType<uint64, P>(y));
msb = vecType<uint32, P>(Value64 >> static_cast<uint64>(32));
lsb = vecType<uint32, P>(Value64);
}
// imulExtended
template <>
GLM_FUNC_QUALIFIER void imulExtended
(
int const & x,
int const & y,
int & msb,
int & lsb
)
GLM_FUNC_QUALIFIER void imulExtended(int x, int y, int & msb, int & lsb)
{
GLM_STATIC_ASSERT(sizeof(int) == sizeof(int32), "int and int32 size mismatch");
@@ -238,417 +276,118 @@ namespace glm
lsb = *PointerLSB;
}
template <>
GLM_FUNC_QUALIFIER void imulExtended
(
ivec2 const & x,
ivec2 const & y,
ivec2 & msb,
ivec2 & lsb
)
template <precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER void imulExtended(vecType<int, P> const & x, vecType<int, P> const & y, vecType<int, P> & msb, vecType<int, P> & lsb)
{
imulExtended(x[0], y[0], msb[0], lsb[0]),
imulExtended(x[1], y[1], msb[1], lsb[1]);
}
GLM_STATIC_ASSERT(sizeof(int) == sizeof(int32), "int and int32 size mismatch");
template <>
GLM_FUNC_QUALIFIER void imulExtended
(
ivec3 const & x,
ivec3 const & y,
ivec3 & msb,
ivec3 & lsb
)
{
imulExtended(x[0], y[0], msb[0], lsb[0]),
imulExtended(x[1], y[1], msb[1], lsb[1]);
imulExtended(x[2], y[2], msb[2], lsb[2]);
}
template <>
GLM_FUNC_QUALIFIER void imulExtended
(
ivec4 const & x,
ivec4 const & y,
ivec4 & msb,
ivec4 & lsb
)
{
imulExtended(x[0], y[0], msb[0], lsb[0]),
imulExtended(x[1], y[1], msb[1], lsb[1]);
imulExtended(x[2], y[2], msb[2], lsb[2]);
imulExtended(x[3], y[3], msb[3], lsb[3]);
vecType<int64, P> Value64(vecType<int64, P>(x) * vecType<int64, P>(y));
lsb = vecType<int32, P>(Value64 & static_cast<int64>(0xFFFFFFFF));
msb = vecType<int32, P>((Value64 >> static_cast<int64>(32)) & static_cast<int64>(0xFFFFFFFF));
}
// bitfieldExtract
template <typename genIUType>
GLM_FUNC_QUALIFIER genIUType bitfieldExtract
(
genIUType const & Value,
int const & Offset,
int const & Bits
)
GLM_FUNC_QUALIFIER genIUType bitfieldExtract(genIUType Value, int Offset, int Bits)
{
int GenSize = int(sizeof(genIUType)) << int(3);
assert(Offset + Bits <= GenSize);
genIUType ShiftLeft = Bits ? Value << (GenSize - (Bits + Offset)) : genIUType(0);
genIUType ShiftBack = ShiftLeft >> genIUType(GenSize - Bits);
return ShiftBack;
return bitfieldExtract(tvec1<genIUType>(Value), Offset, Bits).x;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec2<T, P> bitfieldExtract
(
detail::tvec2<T, P> const & Value,
int const & Offset,
int const & Bits
)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> bitfieldExtract(vecType<T, P> const & Value, int Offset, int Bits)
{
return detail::tvec2<T, P>(
bitfieldExtract(Value[0], Offset, Bits),
bitfieldExtract(Value[1], Offset, Bits));
}
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldExtract' only accept integer inputs");
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec3<T, P> bitfieldExtract
(
detail::tvec3<T, P> const & Value,
int const & Offset,
int const & Bits
)
{
return detail::tvec3<T, P>(
bitfieldExtract(Value[0], Offset, Bits),
bitfieldExtract(Value[1], Offset, Bits),
bitfieldExtract(Value[2], Offset, Bits));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec4<T, P> bitfieldExtract
(
detail::tvec4<T, P> const & Value,
int const & Offset,
int const & Bits
)
{
return detail::tvec4<T, P>(
bitfieldExtract(Value[0], Offset, Bits),
bitfieldExtract(Value[1], Offset, Bits),
bitfieldExtract(Value[2], Offset, Bits),
bitfieldExtract(Value[3], Offset, Bits));
return (Value >> static_cast<T>(Offset)) & static_cast<T>(detail::mask(Bits));
}
// bitfieldInsert
template <typename genIUType>
GLM_FUNC_QUALIFIER genIUType bitfieldInsert
(
genIUType const & Base,
genIUType const & Insert,
int const & Offset,
int const & Bits
)
GLM_FUNC_QUALIFIER genIUType bitfieldInsert(genIUType const & Base, genIUType const & Insert, int Offset, int Bits)
{
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'bitfieldInsert' only accept integer values");
assert(Offset + Bits <= sizeof(genIUType));
return bitfieldInsert(tvec1<genIUType>(Base), tvec1<genIUType>(Insert), Offset, Bits).x;
}
if(Bits == 0)
return Base;
genIUType Mask = 0;
for(int Bit = Offset; Bit < Offset + Bits; ++Bit)
Mask |= (1 << Bit);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> bitfieldInsert(vecType<T, P> const & Base, vecType<T, P> const & Insert, int Offset, int Bits)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldInsert' only accept integer values");
T const Mask = static_cast<T>(detail::mask(Bits) << Offset);
return (Base & ~Mask) | (Insert & Mask);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec2<T, P> bitfieldInsert
(
detail::tvec2<T, P> const & Base,
detail::tvec2<T, P> const & Insert,
int const & Offset,
int const & Bits
)
{
return detail::tvec2<T, P>(
bitfieldInsert(Base[0], Insert[0], Offset, Bits),
bitfieldInsert(Base[1], Insert[1], Offset, Bits));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec3<T, P> bitfieldInsert
(
detail::tvec3<T, P> const & Base,
detail::tvec3<T, P> const & Insert,
int const & Offset,
int const & Bits
)
{
return detail::tvec3<T, P>(
bitfieldInsert(Base[0], Insert[0], Offset, Bits),
bitfieldInsert(Base[1], Insert[1], Offset, Bits),
bitfieldInsert(Base[2], Insert[2], Offset, Bits));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec4<T, P> bitfieldInsert
(
detail::tvec4<T, P> const & Base,
detail::tvec4<T, P> const & Insert,
int const & Offset,
int const & Bits
)
{
return detail::tvec4<T, P>(
bitfieldInsert(Base[0], Insert[0], Offset, Bits),
bitfieldInsert(Base[1], Insert[1], Offset, Bits),
bitfieldInsert(Base[2], Insert[2], Offset, Bits),
bitfieldInsert(Base[3], Insert[3], Offset, Bits));
}
// bitfieldReverse
template <typename genIUType>
GLM_FUNC_QUALIFIER genIUType bitfieldReverse(genIUType const & Value)
template <typename genType>
GLM_FUNC_QUALIFIER genType bitfieldReverse(genType x)
{
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'bitfieldReverse' only accept integer values");
return bitfieldReverse(glm::tvec1<genType, glm::defaultp>(x)).x;
}
genIUType Out = 0;
std::size_t BitSize = sizeof(genIUType) * 8;
for(std::size_t i = 0; i < BitSize; ++i)
if(Value & (genIUType(1) << i))
Out |= genIUType(1) << (BitSize - 1 - i);
return Out;
}
VECTORIZE_VEC(bitfieldReverse)
template <typename T, glm::precision P, template <typename, glm::precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> bitfieldReverse(vecType<T, P> const & v)
{
vecType<T, P> x(v);
x = detail::compute_bitfieldReverseStep<sizeof(T) * 8 >= 2>::call(x, T(0x5555555555555555ull), static_cast<T>( 1));
x = detail::compute_bitfieldReverseStep<sizeof(T) * 8 >= 4>::call(x, T(0x3333333333333333ull), static_cast<T>( 2));
x = detail::compute_bitfieldReverseStep<sizeof(T) * 8 >= 8>::call(x, T(0x0F0F0F0F0F0F0F0Full), static_cast<T>( 4));
x = detail::compute_bitfieldReverseStep<sizeof(T) * 8 >= 16>::call(x, T(0x00FF00FF00FF00FFull), static_cast<T>( 8));
x = detail::compute_bitfieldReverseStep<sizeof(T) * 8 >= 32>::call(x, T(0x0000FFFF0000FFFFull), static_cast<T>(16));
x = detail::compute_bitfieldReverseStep<sizeof(T) * 8 >= 64>::call(x, T(0x00000000FFFFFFFFull), static_cast<T>(32));
return x;
}
// bitCount
template <typename genIUType>
GLM_FUNC_QUALIFIER int bitCount(genIUType const & Value)
template <typename genType>
GLM_FUNC_QUALIFIER int bitCount(genType x)
{
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'bitCount' only accept integer values");
int Count = 0;
for(std::size_t i = 0; i < sizeof(genIUType) * std::size_t(8); ++i)
{
if(Value & (1 << i))
++Count;
}
return Count;
return bitCount(glm::tvec1<genType, glm::defaultp>(x)).x;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec2<int, P> bitCount
(
detail::tvec2<T, P> const & value
)
template <typename T, glm::precision P, template <typename, glm::precision> class vecType>
GLM_FUNC_QUALIFIER vecType<int, P> bitCount(vecType<T, P> const & v)
{
return detail::tvec2<int, P>(
bitCount(value[0]),
bitCount(value[1]));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec3<int, P> bitCount
(
detail::tvec3<T, P> const & value
)
{
return detail::tvec3<int, P>(
bitCount(value[0]),
bitCount(value[1]),
bitCount(value[2]));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec4<int, P> bitCount
(
detail::tvec4<T, P> const & value
)
{
return detail::tvec4<int, P>(
bitCount(value[0]),
bitCount(value[1]),
bitCount(value[2]),
bitCount(value[3]));
vecType<typename detail::make_unsigned<T>::type, P> x(*reinterpret_cast<vecType<typename detail::make_unsigned<T>::type, P> const *>(&v));
x = detail::compute_bitfieldBitCountStep<sizeof(T) * 8 >= 2>::call(x, typename detail::make_unsigned<T>::type(0x5555555555555555ull), typename detail::make_unsigned<T>::type( 1));
x = detail::compute_bitfieldBitCountStep<sizeof(T) * 8 >= 4>::call(x, typename detail::make_unsigned<T>::type(0x3333333333333333ull), typename detail::make_unsigned<T>::type( 2));
x = detail::compute_bitfieldBitCountStep<sizeof(T) * 8 >= 8>::call(x, typename detail::make_unsigned<T>::type(0x0F0F0F0F0F0F0F0Full), typename detail::make_unsigned<T>::type( 4));
x = detail::compute_bitfieldBitCountStep<sizeof(T) * 8 >= 16>::call(x, typename detail::make_unsigned<T>::type(0x00FF00FF00FF00FFull), typename detail::make_unsigned<T>::type( 8));
x = detail::compute_bitfieldBitCountStep<sizeof(T) * 8 >= 32>::call(x, typename detail::make_unsigned<T>::type(0x0000FFFF0000FFFFull), typename detail::make_unsigned<T>::type(16));
x = detail::compute_bitfieldBitCountStep<sizeof(T) * 8 >= 64>::call(x, typename detail::make_unsigned<T>::type(0x00000000FFFFFFFFull), typename detail::make_unsigned<T>::type(32));
return vecType<int, P>(x);
}
// findLSB
template <typename genIUType>
GLM_FUNC_QUALIFIER int findLSB
(
genIUType const & Value
)
GLM_FUNC_QUALIFIER int findLSB(genIUType Value)
{
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findLSB' only accept integer values");
if(Value == 0)
return -1;
genIUType Bit;
for(Bit = genIUType(0); !(Value & (1 << Bit)); ++Bit){}
return Bit;
return detail::compute_findLSB<genIUType, sizeof(genIUType) * 8>::call(Value);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec2<int, P> findLSB
(
detail::tvec2<T, P> const & value
)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<int, P> findLSB(vecType<T, P> const & x)
{
return detail::tvec2<int, P>(
findLSB(value[0]),
findLSB(value[1]));
}
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'findLSB' only accept integer values");
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec3<int, P> findLSB
(
detail::tvec3<T, P> const & value
)
{
return detail::tvec3<int, P>(
findLSB(value[0]),
findLSB(value[1]),
findLSB(value[2]));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec4<int, P> findLSB
(
detail::tvec4<T, P> const & value
)
{
return detail::tvec4<int, P>(
findLSB(value[0]),
findLSB(value[1]),
findLSB(value[2]),
findLSB(value[3]));
return detail::functor1<int, T, P, vecType>::call(findLSB, x);
}
// findMSB
#if((GLM_ARCH != GLM_ARCH_PURE) && (GLM_COMPILER & GLM_COMPILER_VC))
template <typename genIUType>
GLM_FUNC_QUALIFIER int findMSB
(
genIUType const & Value
)
GLM_FUNC_QUALIFIER int findMSB(genIUType x)
{
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
if(Value == 0)
return -1;
unsigned long Result(0);
_BitScanReverse(&Result, Value);
return int(Result);
}
/*
// __builtin_clz seems to be buggy as it crasks for some values, from 0x00200000 to 80000000
#elif((GLM_ARCH != GLM_ARCH_PURE) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC40))
template <typename genIUType>
GLM_FUNC_QUALIFIER int findMSB
(
genIUType const & Value
)
{
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
if(Value == 0)
return -1;
// clz returns the number or trailing 0-bits; see
// http://gcc.gnu.org/onlinedocs/gcc-4.7.1/gcc/Other-Builtins.html
//
// NoteBecause __builtin_clz only works for unsigned ints, this
// implementation will not work for 64-bit integers.
//
return 31 - __builtin_clzl(Value);
}
*/
#else
/* SSE implementation idea
__m128i const Zero = _mm_set_epi32( 0, 0, 0, 0);
__m128i const One = _mm_set_epi32( 1, 1, 1, 1);
__m128i Bit = _mm_set_epi32(-1, -1, -1, -1);
__m128i Tmp = _mm_set_epi32(Value, Value, Value, Value);
__m128i Mmi = Zero;
for(int i = 0; i < 32; ++i)
{
__m128i Shilt = _mm_and_si128(_mm_cmpgt_epi32(Tmp, One), One);
Tmp = _mm_srai_epi32(Tmp, One);
Bit = _mm_add_epi32(Bit, _mm_and_si128(Shilt, i));
Mmi = _mm_and_si128(Mmi, One);
}
return Bit;
*/
template <typename genIUType>
GLM_FUNC_QUALIFIER int findMSB
(
genIUType const & Value
)
{
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
if(Value == genIUType(0) || Value == genIUType(-1))
return -1;
else if(Value > 0)
{
genIUType Bit = genIUType(-1);
for(genIUType tmp = Value; tmp > 0; tmp >>= 1, ++Bit){}
return Bit;
}
else //if(Value < 0)
{
int const BitCount(sizeof(genIUType) * 8);
int MostSignificantBit(-1);
for(int BitIndex(0); BitIndex < BitCount; ++BitIndex)
MostSignificantBit = (Value & (1 << BitIndex)) ? MostSignificantBit : BitIndex;
assert(MostSignificantBit >= 0);
return MostSignificantBit;
}
}
#endif//(GLM_COMPILER)
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec2<int, P> findMSB
(
detail::tvec2<T, P> const & value
)
{
return detail::tvec2<int, P>(
findMSB(value[0]),
findMSB(value[1]));
return findMSB(tvec1<genIUType>(x)).x;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec3<int, P> findMSB
(
detail::tvec3<T, P> const & value
)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<int, P> findMSB(vecType<T, P> const & x)
{
return detail::tvec3<int, P>(
findMSB(value[0]),
findMSB(value[1]),
findMSB(value[2]));
}
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'findMSB' only accept integer values");
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec4<int, P> findMSB
(
detail::tvec4<T, P> const & value
)
{
return detail::tvec4<int, P>(
findMSB(value[0]),
findMSB(value[1]),
findMSB(value[2]),
findMSB(value[3]));
return detail::compute_findMSB_vec<T, P, vecType, sizeof(T) * 8>::call(x);
}
}//namespace glm
+7 -8
View File
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -21,7 +25,7 @@
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/core/func_matrix.hpp
/// @file glm/detail/func_matrix.hpp
/// @date 2008-08-03 / 2011-06-15
/// @author Christophe Riccio
///
@@ -37,8 +41,7 @@
/// floating point version is shown.
///////////////////////////////////////////////////////////////////////////////////
#ifndef GLM_CORE_func_matrix
#define GLM_CORE_func_matrix
#pragma once
// Dependencies
#include "../detail/precision.hpp"
@@ -137,8 +140,6 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/outerProduct.xml">GLSL outerProduct man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
///
/// @todo Clarify the declaration to specify that matType doesn't have to be provided when used.
template <typename T, precision P, template <typename, precision> class vecTypeA, template <typename, precision> class vecTypeB>
GLM_FUNC_DECL typename detail::outerProduct_trait<T, P, vecTypeA, vecTypeB>::type outerProduct(vecTypeA<T, P> const & c, vecTypeB<T, P> const & r);
@@ -148,7 +149,7 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/transpose.xml">GLSL transpose man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
# if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC11))
# if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012))
template <typename T, precision P, template <typename, precision> class matType>
GLM_FUNC_DECL typename matType<T, P>::transpose_type transpose(matType<T, P> const & x);
# endif
@@ -175,5 +176,3 @@ namespace detail
}//namespace glm
#include "func_matrix.inl"
#endif//GLM_CORE_func_matrix
+47 -197
View File
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -21,7 +25,7 @@
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/core/func_matrix.inl
/// @file glm/detail/func_matrix.inl
/// @date 2008-03-08 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
@@ -32,173 +36,15 @@
namespace glm{
namespace detail
{
template
<
template <class, precision> class vecTypeA,
template <class, precision> class vecTypeB,
typename T, precision P
>
struct compute_outerProduct{};
template <typename T, precision P>
struct compute_outerProduct<detail::tvec2, detail::tvec2, T, P>
{
GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait<T, P, detail::tvec2, detail::tvec2>::type call(detail::tvec2<T, P> const & c, detail::tvec2<T, P> const & r)
{
detail::tmat2x2<T, P> m(detail::tmat2x2<T, P>::_null);
m[0][0] = c[0] * r[0];
m[0][1] = c[1] * r[0];
m[1][0] = c[0] * r[1];
m[1][1] = c[1] * r[1];
return m;
}
};
template <typename T, precision P>
struct compute_outerProduct<detail::tvec3, detail::tvec3, T, P>
{
GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait<T, P, detail::tvec3, detail::tvec3>::type call(detail::tvec3<T, P> const & c, detail::tvec3<T, P> const & r)
{
detail::tmat3x3<T, P> m(detail::tmat3x3<T, P>::_null);
for(length_t i(0); i < m.length(); ++i)
m[i] = c * r[i];
return m;
}
};
template <typename T, precision P>
struct compute_outerProduct<detail::tvec4, detail::tvec4, T, P>
{
GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait<T, P, detail::tvec4, detail::tvec4>::type call(detail::tvec4<T, P> const & c, detail::tvec4<T, P> const & r)
{
detail::tmat4x4<T, P> m(detail::tmat4x4<T, P>::_null);
for(length_t i(0); i < m.length(); ++i)
m[i] = c * r[i];
return m;
}
};
template <typename T, precision P>
struct compute_outerProduct<detail::tvec3, detail::tvec2, T, P>
{
GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait<T, P, detail::tvec3, detail::tvec2>::type call(detail::tvec3<T, P> const & c, detail::tvec2<T, P> const & r)
{
detail::tmat2x3<T, P> m(detail::tmat2x3<T, P>::_null);
m[0][0] = c.x * r.x;
m[0][1] = c.y * r.x;
m[0][2] = c.z * r.x;
m[1][0] = c.x * r.y;
m[1][1] = c.y * r.y;
m[1][2] = c.z * r.y;
return m;
}
};
template <typename T, precision P>
struct compute_outerProduct<detail::tvec2, detail::tvec3, T, P>
{
GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait<T, P, detail::tvec2, detail::tvec3>::type call(detail::tvec2<T, P> const & c, detail::tvec3<T, P> const & r)
{
detail::tmat3x2<T, P> m(detail::tmat3x2<T, P>::_null);
m[0][0] = c.x * r.x;
m[0][1] = c.y * r.x;
m[1][0] = c.x * r.y;
m[1][1] = c.y * r.y;
m[2][0] = c.x * r.z;
m[2][1] = c.y * r.z;
return m;
}
};
template <typename T, precision P>
struct compute_outerProduct<detail::tvec4, detail::tvec2, T, P>
{
GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait<T, P, detail::tvec4, detail::tvec2>::type call(detail::tvec4<T, P> const & c, detail::tvec2<T, P> const & r)
{
detail::tmat2x4<T, P> m(detail::tmat2x4<T, P>::_null);
m[0][0] = c.x * r.x;
m[0][1] = c.y * r.x;
m[0][2] = c.z * r.x;
m[0][3] = c.w * r.x;
m[1][0] = c.x * r.y;
m[1][1] = c.y * r.y;
m[1][2] = c.z * r.y;
m[1][3] = c.w * r.y;
return m;
}
};
template <typename T, precision P>
struct compute_outerProduct<detail::tvec2, detail::tvec4, T, P>
{
GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait<T, P, detail::tvec2, detail::tvec4>::type call(detail::tvec2<T, P> const & c, detail::tvec4<T, P> const & r)
{
detail::tmat4x2<T, P> m(detail::tmat4x2<T, P>::_null);
m[0][0] = c.x * r.x;
m[0][1] = c.y * r.x;
m[1][0] = c.x * r.y;
m[1][1] = c.y * r.y;
m[2][0] = c.x * r.z;
m[2][1] = c.y * r.z;
m[3][0] = c.x * r.w;
m[3][1] = c.y * r.w;
return m;
}
};
template <typename T, precision P>
struct compute_outerProduct<detail::tvec4, detail::tvec3, T, P>
{
GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait<T, P, detail::tvec4, detail::tvec3>::type call(detail::tvec4<T, P> const & c, detail::tvec3<T, P> const & r)
{
detail::tmat3x4<T, P> m(detail::tmat3x4<T, P>::_null);
m[0][0] = c.x * r.x;
m[0][1] = c.y * r.x;
m[0][2] = c.z * r.x;
m[0][3] = c.w * r.x;
m[1][0] = c.x * r.y;
m[1][1] = c.y * r.y;
m[1][2] = c.z * r.y;
m[1][3] = c.w * r.y;
m[2][0] = c.x * r.z;
m[2][1] = c.y * r.z;
m[2][2] = c.z * r.z;
m[2][3] = c.w * r.z;
return m;
}
};
template <typename T, precision P>
struct compute_outerProduct<detail::tvec3, detail::tvec4, T, P>
{
GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait<T, P, detail::tvec3, detail::tvec4>::type call(detail::tvec3<T, P> const & c, detail::tvec4<T, P> const & r)
{
detail::tmat4x3<T, P> m(detail::tmat4x3<T, P>::_null);
m[0][0] = c.x * r.x;
m[0][1] = c.y * r.x;
m[0][2] = c.z * r.x;
m[1][0] = c.x * r.y;
m[1][1] = c.y * r.y;
m[1][2] = c.z * r.y;
m[2][0] = c.x * r.z;
m[2][1] = c.y * r.z;
m[2][2] = c.z * r.z;
m[3][0] = c.x * r.w;
m[3][1] = c.y * r.w;
m[3][2] = c.z * r.w;
return m;
}
};
template <template <class, precision> class matType, typename T, precision P>
struct compute_transpose{};
template <typename T, precision P>
struct compute_transpose<detail::tmat2x2, T, P>
struct compute_transpose<tmat2x2, T, P>
{
GLM_FUNC_QUALIFIER static detail::tmat2x2<T, P> call(detail::tmat2x2<T, P> const & m)
GLM_FUNC_QUALIFIER static tmat2x2<T, P> call(tmat2x2<T, P> const & m)
{
detail::tmat2x2<T, P> result(detail::tmat2x2<T, P>::_null);
tmat2x2<T, P> result(uninitialize);
result[0][0] = m[0][0];
result[0][1] = m[1][0];
result[1][0] = m[0][1];
@@ -208,11 +54,11 @@ namespace detail
};
template <typename T, precision P>
struct compute_transpose<detail::tmat2x3, T, P>
struct compute_transpose<tmat2x3, T, P>
{
GLM_FUNC_QUALIFIER static detail::tmat3x2<T, P> call(detail::tmat2x3<T, P> const & m)
GLM_FUNC_QUALIFIER static tmat3x2<T, P> call(tmat2x3<T, P> const & m)
{
detail::tmat3x2<T, P> result(detail::tmat3x2<T, P>::_null);
tmat3x2<T, P> result(uninitialize);
result[0][0] = m[0][0];
result[0][1] = m[1][0];
result[1][0] = m[0][1];
@@ -224,11 +70,11 @@ namespace detail
};
template <typename T, precision P>
struct compute_transpose<detail::tmat2x4, T, P>
struct compute_transpose<tmat2x4, T, P>
{
GLM_FUNC_QUALIFIER static detail::tmat4x2<T, P> call(detail::tmat2x4<T, P> const & m)
GLM_FUNC_QUALIFIER static tmat4x2<T, P> call(tmat2x4<T, P> const & m)
{
detail::tmat4x2<T, P> result(detail::tmat4x2<T, P>::_null);
tmat4x2<T, P> result(uninitialize);
result[0][0] = m[0][0];
result[0][1] = m[1][0];
result[1][0] = m[0][1];
@@ -242,11 +88,11 @@ namespace detail
};
template <typename T, precision P>
struct compute_transpose<detail::tmat3x2, T, P>
struct compute_transpose<tmat3x2, T, P>
{
GLM_FUNC_QUALIFIER static detail::tmat2x3<T, P> call(detail::tmat3x2<T, P> const & m)
GLM_FUNC_QUALIFIER static tmat2x3<T, P> call(tmat3x2<T, P> const & m)
{
detail::tmat2x3<T, P> result(detail::tmat2x3<T, P>::_null);
tmat2x3<T, P> result(uninitialize);
result[0][0] = m[0][0];
result[0][1] = m[1][0];
result[0][2] = m[2][0];
@@ -258,11 +104,11 @@ namespace detail
};
template <typename T, precision P>
struct compute_transpose<detail::tmat3x3, T, P>
struct compute_transpose<tmat3x3, T, P>
{
GLM_FUNC_QUALIFIER static detail::tmat3x3<T, P> call(detail::tmat3x3<T, P> const & m)
GLM_FUNC_QUALIFIER static tmat3x3<T, P> call(tmat3x3<T, P> const & m)
{
detail::tmat3x3<T, P> result(detail::tmat3x3<T, P>::_null);
tmat3x3<T, P> result(uninitialize);
result[0][0] = m[0][0];
result[0][1] = m[1][0];
result[0][2] = m[2][0];
@@ -279,11 +125,11 @@ namespace detail
};
template <typename T, precision P>
struct compute_transpose<detail::tmat3x4, T, P>
struct compute_transpose<tmat3x4, T, P>
{
GLM_FUNC_QUALIFIER static detail::tmat4x3<T, P> call(detail::tmat3x4<T, P> const & m)
GLM_FUNC_QUALIFIER static tmat4x3<T, P> call(tmat3x4<T, P> const & m)
{
detail::tmat4x3<T, P> result(detail::tmat4x3<T, P>::_null);
tmat4x3<T, P> result(uninitialize);
result[0][0] = m[0][0];
result[0][1] = m[1][0];
result[0][2] = m[2][0];
@@ -301,11 +147,11 @@ namespace detail
};
template <typename T, precision P>
struct compute_transpose<detail::tmat4x2, T, P>
struct compute_transpose<tmat4x2, T, P>
{
GLM_FUNC_QUALIFIER static detail::tmat2x4<T, P> call(detail::tmat4x2<T, P> const & m)
GLM_FUNC_QUALIFIER static tmat2x4<T, P> call(tmat4x2<T, P> const & m)
{
detail::tmat2x4<T, P> result(detail::tmat2x4<T, P>::_null);
tmat2x4<T, P> result(uninitialize);
result[0][0] = m[0][0];
result[0][1] = m[1][0];
result[0][2] = m[2][0];
@@ -319,11 +165,11 @@ namespace detail
};
template <typename T, precision P>
struct compute_transpose<detail::tmat4x3, T, P>
struct compute_transpose<tmat4x3, T, P>
{
GLM_FUNC_QUALIFIER static detail::tmat3x4<T, P> call(detail::tmat4x3<T, P> const & m)
GLM_FUNC_QUALIFIER static tmat3x4<T, P> call(tmat4x3<T, P> const & m)
{
detail::tmat3x4<T, P> result(detail::tmat3x4<T, P>::_null);
tmat3x4<T, P> result(uninitialize);
result[0][0] = m[0][0];
result[0][1] = m[1][0];
result[0][2] = m[2][0];
@@ -341,11 +187,11 @@ namespace detail
};
template <typename T, precision P>
struct compute_transpose<detail::tmat4x4, T, P>
struct compute_transpose<tmat4x4, T, P>
{
GLM_FUNC_QUALIFIER static detail::tmat4x4<T, P> call(detail::tmat4x4<T, P> const & m)
GLM_FUNC_QUALIFIER static tmat4x4<T, P> call(tmat4x4<T, P> const & m)
{
detail::tmat4x4<T, P> result(detail::tmat4x4<T, P>::_null);
tmat4x4<T, P> result(uninitialize);
result[0][0] = m[0][0];
result[0][1] = m[1][0];
result[0][2] = m[2][0];
@@ -373,18 +219,18 @@ namespace detail
struct compute_determinant{};
template <typename T, precision P>
struct compute_determinant<detail::tmat2x2, T, P>
struct compute_determinant<tmat2x2, T, P>
{
GLM_FUNC_QUALIFIER static T call(detail::tmat2x2<T, P> const & m)
GLM_FUNC_QUALIFIER static T call(tmat2x2<T, P> const & m)
{
return m[0][0] * m[1][1] - m[1][0] * m[0][1];
}
};
template <typename T, precision P>
struct compute_determinant<detail::tmat3x3, T, P>
struct compute_determinant<tmat3x3, T, P>
{
GLM_FUNC_QUALIFIER static T call(detail::tmat3x3<T, P> const & m)
GLM_FUNC_QUALIFIER static T call(tmat3x3<T, P> const & m)
{
return
+ m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2])
@@ -394,9 +240,9 @@ namespace detail
};
template <typename T, precision P>
struct compute_determinant<detail::tmat4x4, T, P>
struct compute_determinant<tmat4x4, T, P>
{
GLM_FUNC_QUALIFIER static T call(detail::tmat4x4<T, P> const & m)
GLM_FUNC_QUALIFIER static T call(tmat4x4<T, P> const & m)
{
T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];
T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3];
@@ -405,7 +251,7 @@ namespace detail
T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2];
T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1];
detail::tvec4<T, P> DetCof(
tvec4<T, P> DetCof(
+ (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02),
- (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04),
+ (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05),
@@ -423,8 +269,8 @@ namespace detail
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'matrixCompMult' only accept floating-point inputs");
matType<T, P> result(matType<T, P>::_null);
for(length_t i = 0; i < result.length(); ++i)
matType<T, P> result(uninitialize);
for(detail::component_count_t i = 0; i < detail::component_count(result); ++i)
result[i] = x[i] * y[i];
return result;
}
@@ -433,7 +279,11 @@ namespace detail
GLM_FUNC_QUALIFIER typename detail::outerProduct_trait<T, P, vecTypeA, vecTypeB>::type outerProduct(vecTypeA<T, P> const & c, vecTypeB<T, P> const & r)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'outerProduct' only accept floating-point inputs");
return detail::compute_outerProduct<vecTypeA, vecTypeB, T, P>::call(c, r);
typename detail::outerProduct_trait<T, P, vecTypeA, vecTypeB>::type m(uninitialize);
for(detail::component_count_t i = 0; i < detail::component_count(m); ++i)
m[i] = c * r[i];
return m;
}
template <typename T, precision P, template <typename, precision> class matType>
@@ -454,7 +304,7 @@ namespace detail
GLM_FUNC_QUALIFIER matType<T, P> inverse(matType<T, P> const & m)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'inverse' only accept floating-point inputs");
return detail::compute_inverse<matType, T, P>::call(m);
return detail::compute_inverse(m);
}
}//namespace glm
+9 -8
View File
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -21,7 +25,7 @@
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/core/func_noise.hpp
/// @file glm/detail/func_noise.hpp
/// @date 2008-08-01 / 2011-06-18
/// @author Christophe Riccio
///
@@ -35,8 +39,7 @@
/// appearance of randomness, but are not truly random.
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_func_noise
#define glm_core_func_noise
#pragma once
#include "type_vec1.hpp"
#include "type_vec2.hpp"
@@ -64,7 +67,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise2.xml">GLSL noise2 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
template <typename genType>
GLM_FUNC_DECL detail::tvec2<typename genType::value_type, defaultp> noise2(genType const & x);
GLM_FUNC_DECL tvec2<typename genType::value_type, defaultp> noise2(genType const & x);
/// Returns a 3D noise value based on the input value x.
///
@@ -73,7 +76,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise3.xml">GLSL noise3 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
template <typename genType>
GLM_FUNC_DECL detail::tvec3<typename genType::value_type, defaultp> noise3(genType const & x);
GLM_FUNC_DECL tvec3<typename genType::value_type, defaultp> noise3(genType const & x);
/// Returns a 4D noise value based on the input value x.
///
@@ -82,11 +85,9 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise4.xml">GLSL noise4 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
template <typename genType>
GLM_FUNC_DECL detail::tvec4<typename genType::value_type, defaultp> noise4(genType const & x);
GLM_FUNC_DECL tvec4<typename genType::value_type, defaultp> noise4(genType const & x);
/// @}
}//namespace glm
#include "func_noise.inl"
#endif//glm_core_func_noise
+149 -145
View File
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -21,7 +25,7 @@
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/core/func_noise.inl
/// @file glm/detail/func_noise.inl
/// @date 2008-08-01 / 2011-09-27
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
@@ -33,43 +37,43 @@ namespace glm{
namespace detail
{
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec4<T, P> grad4(T const & j, detail::tvec4<T, P> const & ip)
GLM_FUNC_QUALIFIER tvec4<T, P> grad4(T const & j, tvec4<T, P> const & ip)
{
detail::tvec3<T, P> pXYZ = floor(fract(detail::tvec3<T, P>(j) * detail::tvec3<T, P>(ip)) * T(7)) * ip[2] - T(1);
T pW = static_cast<T>(1.5) - dot(abs(pXYZ), detail::tvec3<T, P>(1));
detail::tvec4<T, P> s = detail::tvec4<T, P>(lessThan(detail::tvec4<T, P>(pXYZ, pW), detail::tvec4<T, P>(0.0)));
pXYZ = pXYZ + (detail::tvec3<T, P>(s) * T(2) - T(1)) * s.w;
return detail::tvec4<T, P>(pXYZ, pW);
tvec3<T, P> pXYZ = floor(fract(tvec3<T, P>(j) * tvec3<T, P>(ip)) * T(7)) * ip[2] - T(1);
T pW = static_cast<T>(1.5) - dot(abs(pXYZ), tvec3<T, P>(1));
tvec4<T, P> s = tvec4<T, P>(lessThan(tvec4<T, P>(pXYZ, pW), tvec4<T, P>(0.0)));
pXYZ = pXYZ + (tvec3<T, P>(s) * T(2) - T(1)) * s.w;
return tvec4<T, P>(pXYZ, pW);
}
}//namespace detail
template <typename T>
GLM_FUNC_QUALIFIER T noise1(T const & x)
{
return noise1(detail::tvec2<T, defaultp>(x, T(0)));
return noise1(tvec2<T, defaultp>(x, T(0)));
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tvec2<T, defaultp> noise2(T const & x)
GLM_FUNC_QUALIFIER tvec2<T, defaultp> noise2(T const & x)
{
return detail::tvec2<T, defaultp>(
return tvec2<T, defaultp>(
noise1(x + T(0.0)),
noise1(x + T(1.0)));
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tvec3<T, defaultp> noise3(T const & x)
GLM_FUNC_QUALIFIER tvec3<T, defaultp> noise3(T const & x)
{
return detail::tvec3<T, defaultp>(
return tvec3<T, defaultp>(
noise1(x - T(1.0)),
noise1(x + T(0.0)),
noise1(x + T(1.0)));
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tvec4<T, defaultp> noise4(T const & x)
GLM_FUNC_QUALIFIER tvec4<T, defaultp> noise4(T const & x)
{
return detail::tvec4<T, defaultp>(
return tvec4<T, defaultp>(
noise1(x - T(1.0)),
noise1(x + T(0.0)),
noise1(x + T(1.0)),
@@ -77,38 +81,38 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T noise1(detail::tvec2<T, P> const & v)
GLM_FUNC_QUALIFIER T noise1(tvec2<T, P> const & v)
{
detail::tvec4<T, P> const C = detail::tvec4<T, P>(
tvec4<T, P> const C = tvec4<T, P>(
T( 0.211324865405187), // (3.0 - sqrt(3.0)) / 6.0
T( 0.366025403784439), // 0.5 * (sqrt(3.0) - 1.0)
T(-0.577350269189626), // -1.0 + 2.0 * C.x
T( 0.024390243902439)); // 1.0 / 41.0
// First corner
detail::tvec2<T, P> i = floor(v + dot(v, detail::tvec2<T, P>(C[1])));
detail::tvec2<T, P> x0 = v - i + dot(i, detail::tvec2<T, P>(C[0]));
tvec2<T, P> i = floor(v + dot(v, tvec2<T, P>(C[1])));
tvec2<T, P> x0 = v - i + dot(i, tvec2<T, P>(C[0]));
// Other corners
//i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0
//i1.y = 1.0 - i1.x;
detail::tvec2<T, P> i1 = (x0.x > x0.y) ? detail::tvec2<T, P>(1, 0) : detail::tvec2<T, P>(0, 1);
tvec2<T, P> i1 = (x0.x > x0.y) ? tvec2<T, P>(1, 0) : tvec2<T, P>(0, 1);
// x0 = x0 - 0.0 + 0.0 * C.xx ;
// x1 = x0 - i1 + 1.0 * C.xx ;
// x2 = x0 - 1.0 + 2.0 * C.xx ;
detail::tvec4<T, P> x12 = detail::tvec4<T, P>(x0.x, x0.y, x0.x, x0.y) + detail::tvec4<T, P>(C.x, C.x, C.z, C.z);
x12 = detail::tvec4<T, P>(detail::tvec2<T, P>(x12) - i1, x12.z, x12.w);
tvec4<T, P> x12 = tvec4<T, P>(x0.x, x0.y, x0.x, x0.y) + tvec4<T, P>(C.x, C.x, C.z, C.z);
x12 = tvec4<T, P>(tvec2<T, P>(x12) - i1, x12.z, x12.w);
// Permutations
i = mod(i, T(289)); // Avoid truncation effects in permutation
detail::tvec3<T, P> p = detail::permute(
detail::permute(i.y + detail::tvec3<T, P>(T(0), i1.y, T(1))) + i.x + detail::tvec3<T, P>(T(0), i1.x, T(1)));
tvec3<T, P> p = detail::permute(
detail::permute(i.y + tvec3<T, P>(T(0), i1.y, T(1))) + i.x + tvec3<T, P>(T(0), i1.x, T(1)));
detail::tvec3<T, P> m = max(T(0.5) - detail::tvec3<T, P>(
tvec3<T, P> m = max(T(0.5) - tvec3<T, P>(
dot(x0, x0),
dot(detail::tvec2<T, P>(x12.x, x12.y), detail::tvec2<T, P>(x12.x, x12.y)),
dot(detail::tvec2<T, P>(x12.z, x12.w), detail::tvec2<T, P>(x12.z, x12.w))), T(0));
dot(tvec2<T, P>(x12.x, x12.y), tvec2<T, P>(x12.x, x12.y)),
dot(tvec2<T, P>(x12.z, x12.w), tvec2<T, P>(x12.z, x12.w))), T(0));
m = m * m;
m = m * m;
@@ -116,17 +120,17 @@ namespace detail
// Gradients: 41 points uniformly over a line, mapped onto a diamond.
// The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)
detail::tvec3<T, P> x = static_cast<T>(2) * fract(p * C.w) - T(1);
detail::tvec3<T, P> h = abs(x) - T(0.5);
detail::tvec3<T, P> ox = floor(x + T(0.5));
detail::tvec3<T, P> a0 = x - ox;
tvec3<T, P> x = static_cast<T>(2) * fract(p * C.w) - T(1);
tvec3<T, P> h = abs(x) - T(0.5);
tvec3<T, P> ox = floor(x + T(0.5));
tvec3<T, P> a0 = x - ox;
// Normalise gradients implicitly by scaling m
// Inlined for speed: m *= taylorInvSqrt( a0*a0 + h*h );
m *= static_cast<T>(1.79284291400159) - T(0.85373472095314) * (a0 * a0 + h * h);
// Compute final noise value at P
detail::tvec3<T, P> g;
tvec3<T, P> g;
g.x = a0.x * x0.x + h.x * x0.y;
//g.yz = a0.yz * x12.xz + h.yz * x12.yw;
g.y = a0.y * x12.x + h.y * x12.y;
@@ -135,84 +139,84 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T noise1(detail::tvec3<T, P> const & v)
GLM_FUNC_QUALIFIER T noise1(tvec3<T, P> const & v)
{
detail::tvec2<T, P> const C(1.0 / 6.0, 1.0 / 3.0);
detail::tvec4<T, P> const D(0.0, 0.5, 1.0, 2.0);
tvec2<T, P> const C(1.0 / 6.0, 1.0 / 3.0);
tvec4<T, P> const D(0.0, 0.5, 1.0, 2.0);
// First corner
detail::tvec3<T, P> i(floor(v + dot(v, detail::tvec3<T, P>(C.y))));
detail::tvec3<T, P> x0(v - i + dot(i, detail::tvec3<T, P>(C.x)));
tvec3<T, P> i(floor(v + dot(v, tvec3<T, P>(C.y))));
tvec3<T, P> x0(v - i + dot(i, tvec3<T, P>(C.x)));
// Other corners
detail::tvec3<T, P> g(step(detail::tvec3<T, P>(x0.y, x0.z, x0.x), x0));
detail::tvec3<T, P> l(T(1) - g);
detail::tvec3<T, P> i1(min(g, detail::tvec3<T, P>(l.z, l.x, l.y)));
detail::tvec3<T, P> i2(max(g, detail::tvec3<T, P>(l.z, l.x, l.y)));
tvec3<T, P> g(step(tvec3<T, P>(x0.y, x0.z, x0.x), x0));
tvec3<T, P> l(T(1) - g);
tvec3<T, P> i1(min(g, tvec3<T, P>(l.z, l.x, l.y)));
tvec3<T, P> i2(max(g, tvec3<T, P>(l.z, l.x, l.y)));
// x0 = x0 - 0.0 + 0.0 * C.xxx;
// x1 = x0 - i1 + 1.0 * C.xxx;
// x2 = x0 - i2 + 2.0 * C.xxx;
// x3 = x0 - 1.0 + 3.0 * C.xxx;
detail::tvec3<T, P> x1(x0 - i1 + C.x);
detail::tvec3<T, P> x2(x0 - i2 + C.y); // 2.0*C.x = 1/3 = C.y
detail::tvec3<T, P> x3(x0 - D.y); // -1.0+3.0*C.x = -0.5 = -D.y
tvec3<T, P> x1(x0 - i1 + C.x);
tvec3<T, P> x2(x0 - i2 + C.y); // 2.0*C.x = 1/3 = C.y
tvec3<T, P> x3(x0 - D.y); // -1.0+3.0*C.x = -0.5 = -D.y
// Permutations
i = mod289(i);
detail::tvec4<T, P> p(detail::permute(detail::permute(detail::permute(
i.z + detail::tvec4<T, P>(T(0), i1.z, i2.z, T(1))) +
i.y + detail::tvec4<T, P>(T(0), i1.y, i2.y, T(1))) +
i.x + detail::tvec4<T, P>(T(0), i1.x, i2.x, T(1))));
tvec4<T, P> p(detail::permute(detail::permute(detail::permute(
i.z + tvec4<T, P>(T(0), i1.z, i2.z, T(1))) +
i.y + tvec4<T, P>(T(0), i1.y, i2.y, T(1))) +
i.x + tvec4<T, P>(T(0), i1.x, i2.x, T(1))));
// Gradients: 7x7 points over a square, mapped onto an octahedron.
// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)
T n_ = static_cast<T>(0.142857142857); // 1.0/7.0
detail::tvec3<T, P> ns(n_ * detail::tvec3<T, P>(D.w, D.y, D.z) - detail::tvec3<T, P>(D.x, D.z, D.x));
tvec3<T, P> ns(n_ * tvec3<T, P>(D.w, D.y, D.z) - tvec3<T, P>(D.x, D.z, D.x));
detail::tvec4<T, P> j(p - T(49) * floor(p * ns.z * ns.z)); // mod(p,7*7)
tvec4<T, P> j(p - T(49) * floor(p * ns.z * ns.z)); // mod(p,7*7)
detail::tvec4<T, P> x_(floor(j * ns.z));
detail::tvec4<T, P> y_(floor(j - T(7) * x_)); // mod(j,N)
tvec4<T, P> x_(floor(j * ns.z));
tvec4<T, P> y_(floor(j - T(7) * x_)); // mod(j,N)
detail::tvec4<T, P> x(x_ * ns.x + ns.y);
detail::tvec4<T, P> y(y_ * ns.x + ns.y);
detail::tvec4<T, P> h(T(1) - abs(x) - abs(y));
tvec4<T, P> x(x_ * ns.x + ns.y);
tvec4<T, P> y(y_ * ns.x + ns.y);
tvec4<T, P> h(T(1) - abs(x) - abs(y));
detail::tvec4<T, P> b0(x.x, x.y, y.x, y.y);
detail::tvec4<T, P> b1(x.z, x.w, y.z, y.w);
tvec4<T, P> b0(x.x, x.y, y.x, y.y);
tvec4<T, P> b1(x.z, x.w, y.z, y.w);
// vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;
// vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;
detail::tvec4<T, P> s0(floor(b0) * T(2) + T(1));
detail::tvec4<T, P> s1(floor(b1) * T(2) + T(1));
detail::tvec4<T, P> sh(-step(h, detail::tvec4<T, P>(0.0)));
tvec4<T, P> s0(floor(b0) * T(2) + T(1));
tvec4<T, P> s1(floor(b1) * T(2) + T(1));
tvec4<T, P> sh(-step(h, tvec4<T, P>(0.0)));
detail::tvec4<T, P> a0 = detail::tvec4<T, P>(b0.x, b0.z, b0.y, b0.w) + detail::tvec4<T, P>(s0.x, s0.z, s0.y, s0.w) * detail::tvec4<T, P>(sh.x, sh.x, sh.y, sh.y);
detail::tvec4<T, P> a1 = detail::tvec4<T, P>(b1.x, b1.z, b1.y, b1.w) + detail::tvec4<T, P>(s1.x, s1.z, s1.y, s1.w) * detail::tvec4<T, P>(sh.z, sh.z, sh.w, sh.w);
tvec4<T, P> a0 = tvec4<T, P>(b0.x, b0.z, b0.y, b0.w) + tvec4<T, P>(s0.x, s0.z, s0.y, s0.w) * tvec4<T, P>(sh.x, sh.x, sh.y, sh.y);
tvec4<T, P> a1 = tvec4<T, P>(b1.x, b1.z, b1.y, b1.w) + tvec4<T, P>(s1.x, s1.z, s1.y, s1.w) * tvec4<T, P>(sh.z, sh.z, sh.w, sh.w);
detail::tvec3<T, P> p0(a0.x, a0.y, h.x);
detail::tvec3<T, P> p1(a0.z, a0.w, h.y);
detail::tvec3<T, P> p2(a1.x, a1.y, h.z);
detail::tvec3<T, P> p3(a1.z, a1.w, h.w);
tvec3<T, P> p0(a0.x, a0.y, h.x);
tvec3<T, P> p1(a0.z, a0.w, h.y);
tvec3<T, P> p2(a1.x, a1.y, h.z);
tvec3<T, P> p3(a1.z, a1.w, h.w);
// Normalise gradients
detail::tvec4<T, P> norm = taylorInvSqrt(detail::tvec4<T, P>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));
tvec4<T, P> norm = taylorInvSqrt(tvec4<T, P>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));
p0 *= norm.x;
p1 *= norm.y;
p2 *= norm.z;
p3 *= norm.w;
// Mix final noise value
detail::tvec4<T, P> m = max(T(0.6) - detail::tvec4<T, P>(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), T(0));
tvec4<T, P> m = max(T(0.6) - tvec4<T, P>(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), T(0));
m = m * m;
return T(42) * dot(m * m, detail::tvec4<T, P>(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));
return T(42) * dot(m * m, tvec4<T, P>(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T noise1(detail::tvec4<T, P> const & v)
GLM_FUNC_QUALIFIER T noise1(tvec4<T, P> const & v)
{
detail::tvec4<T, P> const C(
tvec4<T, P> const C(
0.138196601125011, // (5 - sqrt(5))/20 G4
0.276393202250021, // 2 * G4
0.414589803375032, // 3 * G4
@@ -222,66 +226,66 @@ namespace detail
T const F4 = static_cast<T>(0.309016994374947451);
// First corner
detail::tvec4<T, P> i = floor(v + dot(v, detail::tvec4<T, P>(F4)));
detail::tvec4<T, P> x0 = v - i + dot(i, detail::tvec4<T, P>(C.x));
tvec4<T, P> i = floor(v + dot(v, tvec4<T, P>(F4)));
tvec4<T, P> x0 = v - i + dot(i, tvec4<T, P>(C.x));
// Other corners
// Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)
detail::tvec4<T, P> i0;
detail::tvec3<T, P> isX = step(detail::tvec3<T, P>(x0.y, x0.z, x0.w), detail::tvec3<T, P>(x0.x));
detail::tvec3<T, P> isYZ = step(detail::tvec3<T, P>(x0.z, x0.w, x0.w), detail::tvec3<T, P>(x0.y, x0.y, x0.z));
tvec4<T, P> i0;
tvec3<T, P> isX = step(tvec3<T, P>(x0.y, x0.z, x0.w), tvec3<T, P>(x0.x));
tvec3<T, P> isYZ = step(tvec3<T, P>(x0.z, x0.w, x0.w), tvec3<T, P>(x0.y, x0.y, x0.z));
// i0.x = dot(isX, vec3(1.0));
//i0.x = isX.x + isX.y + isX.z;
//i0.yzw = static_cast<T>(1) - isX;
i0 = detail::tvec4<T, P>(isX.x + isX.y + isX.z, T(1) - isX);
i0 = tvec4<T, P>(isX.x + isX.y + isX.z, T(1) - isX);
// i0.y += dot(isYZ.xy, vec2(1.0));
i0.y += isYZ.x + isYZ.y;
//i0.zw += 1.0 - detail::tvec2<T, P>(isYZ.x, isYZ.y);
//i0.zw += 1.0 - tvec2<T, P>(isYZ.x, isYZ.y);
i0.z += static_cast<T>(1) - isYZ.x;
i0.w += static_cast<T>(1) - isYZ.y;
i0.z += isYZ.z;
i0.w += static_cast<T>(1) - isYZ.z;
// i0 now contains the unique values 0,1,2,3 in each channel
detail::tvec4<T, P> i3 = clamp(i0, T(0), T(1));
detail::tvec4<T, P> i2 = clamp(i0 - T(1), T(0), T(1));
detail::tvec4<T, P> i1 = clamp(i0 - T(2), T(0), T(1));
tvec4<T, P> i3 = clamp(i0, T(0), T(1));
tvec4<T, P> i2 = clamp(i0 - T(1), T(0), T(1));
tvec4<T, P> i1 = clamp(i0 - T(2), T(0), T(1));
// x0 = x0 - 0.0 + 0.0 * C.xxxx
// x1 = x0 - i1 + 0.0 * C.xxxx
// x2 = x0 - i2 + 0.0 * C.xxxx
// x3 = x0 - i3 + 0.0 * C.xxxx
// x4 = x0 - 1.0 + 4.0 * C.xxxx
detail::tvec4<T, P> x1 = x0 - i1 + C.x;
detail::tvec4<T, P> x2 = x0 - i2 + C.y;
detail::tvec4<T, P> x3 = x0 - i3 + C.z;
detail::tvec4<T, P> x4 = x0 + C.w;
tvec4<T, P> x1 = x0 - i1 + C.x;
tvec4<T, P> x2 = x0 - i2 + C.y;
tvec4<T, P> x3 = x0 - i3 + C.z;
tvec4<T, P> x4 = x0 + C.w;
// Permutations
i = mod(i, T(289));
T j0 = detail::permute(detail::permute(detail::permute(detail::permute(i.w) + i.z) + i.y) + i.x);
detail::tvec4<T, P> j1 = detail::permute(detail::permute(detail::permute(detail::permute(
i.w + detail::tvec4<T, P>(i1.w, i2.w, i3.w, T(1))) +
i.z + detail::tvec4<T, P>(i1.z, i2.z, i3.z, T(1))) +
i.y + detail::tvec4<T, P>(i1.y, i2.y, i3.y, T(1))) +
i.x + detail::tvec4<T, P>(i1.x, i2.x, i3.x, T(1)));
tvec4<T, P> j1 = detail::permute(detail::permute(detail::permute(detail::permute(
i.w + tvec4<T, P>(i1.w, i2.w, i3.w, T(1))) +
i.z + tvec4<T, P>(i1.z, i2.z, i3.z, T(1))) +
i.y + tvec4<T, P>(i1.y, i2.y, i3.y, T(1))) +
i.x + tvec4<T, P>(i1.x, i2.x, i3.x, T(1)));
// Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope
// 7*7*6 = 294, which is close to the ring size 17*17 = 289.
detail::tvec4<T, P> ip = detail::tvec4<T, P>(T(1) / T(294), T(1) / T(49), T(1) / T(7), T(0));
tvec4<T, P> ip = tvec4<T, P>(T(1) / T(294), T(1) / T(49), T(1) / T(7), T(0));
detail::tvec4<T, P> p0 = detail::grad4(j0, ip);
detail::tvec4<T, P> p1 = detail::grad4(j1.x, ip);
detail::tvec4<T, P> p2 = detail::grad4(j1.y, ip);
detail::tvec4<T, P> p3 = detail::grad4(j1.z, ip);
detail::tvec4<T, P> p4 = detail::grad4(j1.w, ip);
tvec4<T, P> p0 = detail::grad4(j0, ip);
tvec4<T, P> p1 = detail::grad4(j1.x, ip);
tvec4<T, P> p2 = detail::grad4(j1.y, ip);
tvec4<T, P> p3 = detail::grad4(j1.z, ip);
tvec4<T, P> p4 = detail::grad4(j1.w, ip);
// Normalise gradients
detail::tvec4<T, P> norm = detail::taylorInvSqrt(detail::tvec4<T, P>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));
tvec4<T, P> norm = detail::taylorInvSqrt(tvec4<T, P>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));
p0 *= norm.x;
p1 *= norm.y;
p2 *= norm.z;
@@ -289,96 +293,96 @@ namespace detail
p4 *= taylorInvSqrt(dot(p4, p4));
// Mix contributions from the five corners
detail::tvec3<T, P> m0 = max(T(0.6) - detail::tvec3<T, P>(dot(x0, x0), dot(x1, x1), dot(x2, x2)), T(0));
detail::tvec2<T, P> m1 = max(T(0.6) - detail::tvec2<T, P>(dot(x3, x3), dot(x4, x4) ), T(0));
tvec3<T, P> m0 = max(T(0.6) - tvec3<T, P>(dot(x0, x0), dot(x1, x1), dot(x2, x2)), T(0));
tvec2<T, P> m1 = max(T(0.6) - tvec2<T, P>(dot(x3, x3), dot(x4, x4) ), T(0));
m0 = m0 * m0;
m1 = m1 * m1;
return T(49) * (
dot(m0 * m0, detail::tvec3<T, P>(dot(p0, x0), dot(p1, x1), dot(p2, x2))) +
dot(m1 * m1, detail::tvec2<T, P>(dot(p3, x3), dot(p4, x4))));
dot(m0 * m0, tvec3<T, P>(dot(p0, x0), dot(p1, x1), dot(p2, x2))) +
dot(m1 * m1, tvec2<T, P>(dot(p3, x3), dot(p4, x4))));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec2<T, P> noise2(detail::tvec2<T, P> const & x)
GLM_FUNC_QUALIFIER tvec2<T, P> noise2(tvec2<T, P> const & x)
{
return detail::tvec2<T, P>(
noise1(x + detail::tvec2<T, P>(0.0)),
noise1(detail::tvec2<T, P>(0.0) - x));
return tvec2<T, P>(
noise1(x + tvec2<T, P>(0.0)),
noise1(tvec2<T, P>(0.0) - x));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec2<T, P> noise2(detail::tvec3<T, P> const & x)
GLM_FUNC_QUALIFIER tvec2<T, P> noise2(tvec3<T, P> const & x)
{
return detail::tvec2<T, P>(
noise1(x + detail::tvec3<T, P>(0.0)),
noise1(detail::tvec3<T, P>(0.0) - x));
return tvec2<T, P>(
noise1(x + tvec3<T, P>(0.0)),
noise1(tvec3<T, P>(0.0) - x));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec2<T, P> noise2(detail::tvec4<T, P> const & x)
GLM_FUNC_QUALIFIER tvec2<T, P> noise2(tvec4<T, P> const & x)
{
return detail::tvec2<T, P>(
noise1(x + detail::tvec4<T, P>(0)),
noise1(detail::tvec4<T, P>(0) - x));
return tvec2<T, P>(
noise1(x + tvec4<T, P>(0)),
noise1(tvec4<T, P>(0) - x));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec3<T, P> noise3(detail::tvec2<T, P> const & x)
GLM_FUNC_QUALIFIER tvec3<T, P> noise3(tvec2<T, P> const & x)
{
return detail::tvec3<T, P>(
noise1(x - detail::tvec2<T, P>(1.0)),
noise1(x + detail::tvec2<T, P>(0.0)),
noise1(x + detail::tvec2<T, P>(1.0)));
return tvec3<T, P>(
noise1(x - tvec2<T, P>(1.0)),
noise1(x + tvec2<T, P>(0.0)),
noise1(x + tvec2<T, P>(1.0)));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec3<T, P> noise3(detail::tvec3<T, P> const & x)
GLM_FUNC_QUALIFIER tvec3<T, P> noise3(tvec3<T, P> const & x)
{
return detail::tvec3<T, P>(
noise1(x - detail::tvec3<T, P>(1.0)),
noise1(x + detail::tvec3<T, P>(0.0)),
noise1(x + detail::tvec3<T, P>(1.0)));
return tvec3<T, P>(
noise1(x - tvec3<T, P>(1.0)),
noise1(x + tvec3<T, P>(0.0)),
noise1(x + tvec3<T, P>(1.0)));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec3<T, P> noise3(detail::tvec4<T, P> const & x)
GLM_FUNC_QUALIFIER tvec3<T, P> noise3(tvec4<T, P> const & x)
{
return detail::tvec3<T, P>(
noise1(x - detail::tvec4<T, P>(1)),
noise1(x + detail::tvec4<T, P>(0)),
noise1(x + detail::tvec4<T, P>(1)));
return tvec3<T, P>(
noise1(x - tvec4<T, P>(1)),
noise1(x + tvec4<T, P>(0)),
noise1(x + tvec4<T, P>(1)));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec4<T, P> noise4(detail::tvec2<T, P> const & x)
GLM_FUNC_QUALIFIER tvec4<T, P> noise4(tvec2<T, P> const & x)
{
return detail::tvec4<T, P>(
noise1(x - detail::tvec2<T, P>(1)),
noise1(x + detail::tvec2<T, P>(0)),
noise1(x + detail::tvec2<T, P>(1)),
noise1(x + detail::tvec2<T, P>(2)));
return tvec4<T, P>(
noise1(x - tvec2<T, P>(1)),
noise1(x + tvec2<T, P>(0)),
noise1(x + tvec2<T, P>(1)),
noise1(x + tvec2<T, P>(2)));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec4<T, P> noise4(detail::tvec3<T, P> const & x)
GLM_FUNC_QUALIFIER tvec4<T, P> noise4(tvec3<T, P> const & x)
{
return detail::tvec4<T, P>(
noise1(x - detail::tvec3<T, P>(1)),
noise1(x + detail::tvec3<T, P>(0)),
noise1(x + detail::tvec3<T, P>(1)),
noise1(x + detail::tvec3<T, P>(2)));
return tvec4<T, P>(
noise1(x - tvec3<T, P>(1)),
noise1(x + tvec3<T, P>(0)),
noise1(x + tvec3<T, P>(1)),
noise1(x + tvec3<T, P>(2)));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec4<T, P> noise4(detail::tvec4<T, P> const & x)
GLM_FUNC_QUALIFIER tvec4<T, P> noise4(tvec4<T, P> const & x)
{
return detail::tvec4<T, P>(
noise1(x - detail::tvec4<T, P>(1)),
noise1(x + detail::tvec4<T, P>(0)),
noise1(x + detail::tvec4<T, P>(1)),
noise1(x + detail::tvec4<T, P>(2)));
return tvec4<T, P>(
noise1(x - tvec4<T, P>(1)),
noise1(x + tvec4<T, P>(0)),
noise1(x + tvec4<T, P>(1)),
noise1(x + tvec4<T, P>(2)));
}
}//namespace glm
+7 -5
View File
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -21,11 +25,12 @@
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/core/func_packing.hpp
/// @file glm/detail/func_packing.hpp
/// @date 2010-03-17 / 2011-06-15
/// @author Christophe Riccio
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
/// @see gtc_packing
///
/// @defgroup core_func_packing Floating-Point Pack and Unpack Functions
/// @ingroup core
@@ -33,8 +38,7 @@
/// These functions do not operate component-wise, rather as described in each case.
///////////////////////////////////////////////////////////////////////////////////
#ifndef GLM_CORE_func_packing
#define GLM_CORE_func_packing
#pragma once
#include "type_vec2.hpp"
#include "type_vec4.hpp"
@@ -191,5 +195,3 @@ namespace glm
}//namespace glm
#include "func_packing.inl"
#endif//GLM_CORE_func_packing
+11 -3
View File
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -21,7 +25,7 @@
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/core/func_packing.inl
/// @file glm/detail/func_packing.inl
/// @date 2010-03-17 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
@@ -35,7 +39,9 @@ namespace glm
GLM_FUNC_QUALIFIER uint packUnorm2x16(vec2 const & v)
{
u16vec2 Topack(round(clamp(v, 0.0f, 1.0f) * 65535.0f));
return reinterpret_cast<uint&>(Topack);
// return reinterpret_cast<uint&>(Topack);
uint* ptr(reinterpret_cast<uint*>(&Topack));
return *ptr;
}
GLM_FUNC_QUALIFIER vec2 unpackUnorm2x16(uint const & p)
@@ -47,7 +53,9 @@ namespace glm
GLM_FUNC_QUALIFIER uint packSnorm2x16(vec2 const & v)
{
i16vec2 Topack(round(clamp(v ,-1.0f, 1.0f) * 32767.0f));
return reinterpret_cast<uint32&>(Topack);
// return reinterpret_cast<uint32&>(Topack);
uint* ptr(reinterpret_cast<uint*>(&Topack));
return *ptr;
}
GLM_FUNC_QUALIFIER vec2 unpackSnorm2x16(uint const & p)
+39 -37
View File
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -21,7 +25,7 @@
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/core/func_trigonometric.hpp
/// @file glm/detail/func_trigonometric.hpp
/// @date 2008-08-01 / 2011-06-15
/// @author Christophe Riccio
///
@@ -37,8 +41,10 @@
/// These all operate component-wise. The description is per component.
///////////////////////////////////////////////////////////////////////////////////
#ifndef GLM_CORE_func_trigonometric
#define GLM_CORE_func_trigonometric
#pragma once
#include "setup.hpp"
#include "precision.hpp"
namespace glm
{
@@ -51,8 +57,8 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/radians.xml">GLSL radians man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
GLM_FUNC_DECL genType radians(genType const & degrees);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> radians(vecType<T, P> const & degrees);
/// Converts radians to degrees and returns the result.
///
@@ -60,8 +66,8 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/degrees.xml">GLSL degrees man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
GLM_FUNC_DECL genType degrees(genType const & radians);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> degrees(vecType<T, P> const & radians);
/// The standard trigonometric sine function.
/// The values returned by this function will range from [-1, 1].
@@ -70,8 +76,8 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sin.xml">GLSL sin man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
GLM_FUNC_DECL genType sin(genType const & angle);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> sin(vecType<T, P> const & angle);
/// The standard trigonometric cosine function.
/// The values returned by this function will range from [-1, 1].
@@ -80,8 +86,8 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cos.xml">GLSL cos man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
GLM_FUNC_DECL genType cos(genType const & angle);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> cos(vecType<T, P> const & angle);
/// The standard trigonometric tangent function.
///
@@ -89,8 +95,8 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/tan.xml">GLSL tan man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
GLM_FUNC_DECL genType tan(genType const & angle);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> tan(vecType<T, P> const & angle);
/// Arc sine. Returns an angle whose sine is x.
/// The range of values returned by this function is [-PI/2, PI/2].
@@ -100,8 +106,8 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/asin.xml">GLSL asin man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
GLM_FUNC_DECL genType asin(genType const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> asin(vecType<T, P> const & x);
/// Arc cosine. Returns an angle whose sine is x.
/// The range of values returned by this function is [0, PI].
@@ -111,8 +117,8 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/acos.xml">GLSL acos man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
GLM_FUNC_DECL genType acos(genType const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> acos(vecType<T, P> const & x);
/// Arc tangent. Returns an angle whose tangent is y/x.
/// The signs of x and y are used to determine what
@@ -124,8 +130,8 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atan.xml">GLSL atan man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
GLM_FUNC_DECL genType atan(genType const & y, genType const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> atan(vecType<T, P> const & y, vecType<T, P> const & x);
/// Arc tangent. Returns an angle whose tangent is y_over_x.
/// The range of values returned by this function is [-PI/2, PI/2].
@@ -134,8 +140,8 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atan.xml">GLSL atan man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
GLM_FUNC_DECL genType atan(genType const & y_over_x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> atan(vecType<T, P> const & y_over_x);
/// Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2
///
@@ -143,8 +149,8 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sinh.xml">GLSL sinh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
GLM_FUNC_DECL genType sinh(genType const & angle);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> sinh(vecType<T, P> const & angle);
/// Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2
///
@@ -152,8 +158,8 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cosh.xml">GLSL cosh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
GLM_FUNC_DECL genType cosh(genType const & angle);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> cosh(vecType<T, P> const & angle);
/// Returns the hyperbolic tangent function, sinh(angle) / cosh(angle)
///
@@ -161,8 +167,8 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/tanh.xml">GLSL tanh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
GLM_FUNC_DECL genType tanh(genType const & angle);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> tanh(vecType<T, P> const & angle);
/// Arc hyperbolic sine; returns the inverse of sinh.
///
@@ -170,8 +176,8 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/asinh.xml">GLSL asinh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
GLM_FUNC_DECL genType asinh(genType const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> asinh(vecType<T, P> const & x);
/// Arc hyperbolic cosine; returns the non-negative inverse
/// of cosh. Results are undefined if x < 1.
@@ -180,8 +186,8 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/acosh.xml">GLSL acosh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
GLM_FUNC_DECL genType acosh(genType const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> acosh(vecType<T, P> const & x);
/// Arc hyperbolic tangent; returns the inverse of tanh.
/// Results are undefined if abs(x) >= 1.
@@ -190,14 +196,10 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atanh.xml">GLSL atanh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename genType>
GLM_FUNC_DECL genType atanh(genType const & x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> atanh(vecType<T, P> const & x);
/// @}
}//namespace glm
#include "func_trigonometric.inl"
#endif//GLM_CORE_func_trigonometric
+121 -143
View File
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -21,7 +25,7 @@
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/core/func_trigonometric.inl
/// @file glm/detail/func_trigonometric.inl
/// @date 2008-08-03 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
@@ -34,213 +38,187 @@ namespace glm
{
// radians
template <typename genType>
GLM_FUNC_QUALIFIER genType radians
(
genType const & degrees
)
GLM_FUNC_QUALIFIER genType radians(genType degrees)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'radians' only accept floating-point input");
return degrees * genType(0.01745329251994329576923690768489);
return degrees * static_cast<genType>(0.01745329251994329576923690768489);
}
VECTORIZE_VEC(radians)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> radians(vecType<T, P> const & v)
{
return detail::functor1<T, T, P, vecType>::call(radians, v);
}
// degrees
template <typename genType>
GLM_FUNC_QUALIFIER genType degrees
(
genType const & radians
)
GLM_FUNC_QUALIFIER genType degrees(genType radians)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'degrees' only accept floating-point input");
return radians * genType(57.295779513082320876798154814105);
return radians * static_cast<genType>(57.295779513082320876798154814105);
}
VECTORIZE_VEC(degrees)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> degrees(vecType<T, P> const & v)
{
return detail::functor1<T, T, P, vecType>::call(degrees, v);
}
// sin
template <typename genType>
GLM_FUNC_QUALIFIER genType sin
(
genType const & angle
)
using ::std::sin;
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> sin(vecType<T, P> const & v)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'sin' only accept floating-point input");
return genType(::std::sin(angle));
return detail::functor1<T, T, P, vecType>::call(sin, v);
}
VECTORIZE_VEC(sin)
// cos
template <typename genType>
GLM_FUNC_QUALIFIER genType cos(genType const & angle)
using std::cos;
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> cos(vecType<T, P> const & v)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'cos' only accept floating-point input");
return genType(::std::cos(angle));
return detail::functor1<T, T, P, vecType>::call(cos, v);
}
VECTORIZE_VEC(cos)
// tan
template <typename genType>
GLM_FUNC_QUALIFIER genType tan
(
genType const & angle
)
using std::tan;
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> tan(vecType<T, P> const & v)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'tan' only accept floating-point input");
return genType(::std::tan(angle));
return detail::functor1<T, T, P, vecType>::call(tan, v);
}
VECTORIZE_VEC(tan)
// asin
template <typename genType>
GLM_FUNC_QUALIFIER genType asin
(
genType const & x
)
using std::asin;
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> asin(vecType<T, P> const & v)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'asin' only accept floating-point input");
return genType(::std::asin(x));
return detail::functor1<T, T, P, vecType>::call(asin, v);
}
VECTORIZE_VEC(asin)
// acos
template <typename genType>
GLM_FUNC_QUALIFIER genType acos
(
genType const & x
)
using std::acos;
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> acos(vecType<T, P> const & v)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acos' only accept floating-point input");
return genType(::std::acos(x));
return detail::functor1<T, T, P, vecType>::call(acos, v);
}
VECTORIZE_VEC(acos)
// atan
template <typename genType>
GLM_FUNC_QUALIFIER genType atan
(
genType const & y,
genType const & x
)
GLM_FUNC_QUALIFIER genType atan(genType const & y, genType const & x)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'atan' only accept floating-point input");
return genType(::std::atan2(y, x));
return ::std::atan2(y, x);
}
VECTORIZE_VEC_VEC(atan)
template <typename genType>
GLM_FUNC_QUALIFIER genType atan
(
genType const & x
)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> atan(vecType<T, P> const & a, vecType<T, P> const & b)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'atan' only accept floating-point input");
return genType(::std::atan(x));
return detail::functor2<T, P, vecType>::call(atan2, a, b);
}
VECTORIZE_VEC(atan)
using std::atan;
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> atan(vecType<T, P> const & v)
{
return detail::functor1<T, T, P, vecType>::call(atan, v);
}
// sinh
template <typename genType>
GLM_FUNC_QUALIFIER genType sinh
(
genType const & angle
)
using std::sinh;
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> sinh(vecType<T, P> const & v)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'sinh' only accept floating-point input");
return genType(std::sinh(angle));
return detail::functor1<T, T, P, vecType>::call(sinh, v);
}
VECTORIZE_VEC(sinh)
// cosh
template <typename genType>
GLM_FUNC_QUALIFIER genType cosh
(
genType const & angle
)
using std::cosh;
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> cosh(vecType<T, P> const & v)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'cosh' only accept floating-point input");
return genType(std::cosh(angle));
return detail::functor1<T, T, P, vecType>::call(cosh, v);
}
VECTORIZE_VEC(cosh)
// tanh
template <typename genType>
GLM_FUNC_QUALIFIER genType tanh
(
genType const & angle
)
using std::tanh;
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> tanh(vecType<T, P> const & v)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'tanh' only accept floating-point input");
return genType(std::tanh(angle));
return detail::functor1<T, T, P, vecType>::call(tanh, v);
}
VECTORIZE_VEC(tanh)
// asinh
template <typename genType>
GLM_FUNC_QUALIFIER genType asinh
(
genType const & x
)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'asinh' only accept floating-point input");
return (x < genType(0) ? genType(-1) : (x > genType(0) ? genType(1) : genType(0))) * log(abs(x) + sqrt(genType(1) + x * x));
}
# if GLM_HAS_CXX11_STL
using std::asinh;
# else
template <typename genType>
GLM_FUNC_QUALIFIER genType asinh(genType const & x)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'asinh' only accept floating-point input");
VECTORIZE_VEC(asinh)
return (x < static_cast<genType>(0) ? static_cast<genType>(-1) : (x > static_cast<genType>(0) ? static_cast<genType>(1) : static_cast<genType>(0))) * log(abs(x) + sqrt(static_cast<genType>(1) + x * x));
}
# endif
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> asinh(vecType<T, P> const & v)
{
return detail::functor1<T, T, P, vecType>::call(asinh, v);
}
// acosh
template <typename genType>
GLM_FUNC_QUALIFIER genType acosh
(
genType const & x
)
# if GLM_HAS_CXX11_STL
using std::acosh;
# else
template <typename genType>
GLM_FUNC_QUALIFIER genType acosh(genType const & x)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acosh' only accept floating-point input");
if(x < static_cast<genType>(1))
return static_cast<genType>(0);
return log(x + sqrt(x * x - static_cast<genType>(1)));
}
# endif
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> acosh(vecType<T, P> const & v)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acosh' only accept floating-point input");
if(x < genType(1))
return genType(0);
return log(x + sqrt(x * x - genType(1)));
return detail::functor1<T, T, P, vecType>::call(acosh, v);
}
VECTORIZE_VEC(acosh)
// atanh
template <typename genType>
GLM_FUNC_QUALIFIER genType atanh
(
genType const & x
)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'atanh' only accept floating-point input");
# if GLM_HAS_CXX11_STL
using std::atanh;
# else
template <typename genType>
GLM_FUNC_QUALIFIER genType atanh(genType const & x)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'atanh' only accept floating-point input");
if(abs(x) >= genType(1))
return 0;
return genType(0.5) * log((genType(1) + x) / (genType(1) - x));
if(abs(x) >= static_cast<genType>(1))
return 0;
return static_cast<genType>(0.5) * log((static_cast<genType>(1) + x) / (static_cast<genType>(1) - x));
}
# endif
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> atanh(vecType<T, P> const & v)
{
return detail::functor1<T, T, P, vecType>::call(atanh, v);
}
VECTORIZE_VEC(atanh)
}//namespace glm

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