9124 Commits

Author SHA1 Message Date
Alex
e18b332414
[CLE] Reset iterator in IsAccountInGame() (#1345) 2021-05-10 01:34:40 -05:00
Paul Coene
2edda6e743
[Feature] Allow any spawn2 spawned mob to path while zone is idle if new flag is set. (#1339)
* Changes to allow any spawn2 to be marked to path even when zone is idle

* Fixed for Kingly review of PR

Co-authored-by: Noudess <noudess@gmail.com>
2021-05-10 01:21:43 -05:00
Paul Coene
b335568bf9
Prevent client update while on boat if boat turning (#1343)
Co-authored-by: Noudess <noudess@gmail.com>
2021-05-10 01:15:38 -05:00
JeffyW
0758250ad1
[Installer] $ENV support, formatting, and optimizations (#1340)
* [Installer] $ENV support

Add support for passing in installation variables instead of install_variables.txt.

In particular:
- EQEMU_SERVER_SKIP_UPDATE
- EQEMU_SERVER_SKIP_MAPS_UPDATE
Both work the same as files with the same name.

- MYSQL_DATABASE
- MYSQL_USER
- MYSQL_PASSWORD
All get read into the same $installation_variables collection, and are still overridden by any values found in installation_variables.txt

- MYSQL_HOST
Added to the list of $installation_variables, supported in installation_variables.txt, and overrides the default host for where the database lives (allowing it to be a separate container)

- MYSQL_ROOT_PASSWORD
If set, will use "root" as the user for DROP/CREATE DATABASE calls, to prevent requiring the "eq" user requiring more permission than is given by default with the MySql/MariaDB containers.

* [Installer] new_server_with_bots

Enabling bots requires both updated binaries and some database scripts.  Fetching source and compiling the code is the longest part of setting up a new server.  If you know you want bots, rather than having to do it twice, we can just accept an option to do it all at the same time.

* [Installer] Git/Source/Build optimizations

Source code is the same for bot/non-bot, so switch to a common directory for source and separate directories for build.

If the source directory already exists with a .git subfolder, rather than attempt to re-clone, instead do a git pull to still get the latest code.  Helps when using a shared volume but rebuilding containers.

* [Installer] Formatting / Cleanup

Fixed some indentation, added an existing option to the utility script output, removed some excess newlines, and moved a debug output to help identifying errors.
2021-05-10 01:15:11 -05:00
Paul Coene
843aac631b
[Bug Fix] Add debugging and fix edge case where no target for aggro mob (#1344)
Co-authored-by: Noudess <noudess@gmail.com>
2021-05-10 01:10:13 -05:00
hg
0ce7c11d36
[Expeditions] Track DZ member status in world (#1341)
World now caches and tracks member statuses so it can send them to zones
that request them on startup. Prior to this the cle would be searched in
world for every zone startup caching request, now it's only searched once
when a new expedition is created.

Bulk loading statuses removed since it would only be needed on world
startup now and likely have no clients in the client list anyway.

This also lets world choose non-linkdead members on expedition leader
changes and better detect when a leader change needs to occur
2021-05-10 01:07:19 -05:00
Alex
26d374d52a
[Quest API] Add IsRaidTarget() to Perl and Lua (#1347)
- Add $npc->IsRaidTarget() to Perl.
- Add npc:IsRaidTarget() to Lua.
2021-05-10 01:05:46 -05:00
Paul Coene
39f5949441
#grid delete was deleting the grids everywhere (#1346)
Fix to only delete correct zone grid.
2021-05-09 16:39:54 -04:00
hg
abf73947f4
[Dynamic Zones] Rename dynamic zone structs (#1327)
* Rename dz member id field

The name of the struct is enough to make this implicit

* Rename dz member enum and struct

Rename ExpeditionMember to DynamicZoneMember

Rename ExpeditionMemberStatus to DynamicZoneMemberStatus

* Rename dz window packet structs

This makes it more clear the window may be used by any dynamic zone
system not just expeditions (live missions fill the window when
player doesn't have an active expedition).

* Rename dz window packet fields
2021-04-27 18:53:56 -05:00
Michael Cook (mackal)
4358e24dab
[Bug Fix] Fix use-after-free corruption with some DB calls (#1335) 2021-04-27 18:53:34 -05:00
Michael Cook (mackal)
c063d9512e
[Rule] Add a rule to disable the Pet Resist buff (#1337)
Spells:July242002PetResists defaults to true
2021-04-27 18:52:39 -05:00
Alex
39de9c04f6
Add new experience modifiers table to GetCharacterTables() and GetPlayerTables() in database_schema.h. (#1338) 2021-04-27 18:52:00 -05:00
Alex
1637ea95cb
Fix Perl NPC GetAvoidanceRating() Perl Croak. (#1333) 2021-04-27 17:46:59 -04:00
Paul Coene
6fb687871c
Fix calls to GetSafePoints to not pass null_ptr as zonename (#1336)
* Fix calls to GetSafePoints to not pass null_ptr as zonename

* Fix GetSafePoints to check and deal will nullptr being sent as short_zone_name

* Remove unintentinal formatting change

* Fix some typos/cut-n-paste errors I assume

Co-authored-by: Noudess <noudess@gmail.com>
2021-04-27 17:21:37 -04:00
Alex
dd06033a58
Add character-specific zone-based experience modifiers. (#1326)
* Add character-specific zone-based experience modifiers.

This will allow server operators to give players individual experience modifiers (regular and AA).

Zone ID 0 will server as a global modifier for players, if no rows are found the modifier defaults to 1.0 so experience is neither increased nor decreased.

Setting a zone-specific modifier will override the zone ID 0 global modifier.

Requires a SQL update: sql/git/required/2021_04_11_character_exp_modifiers.sql

- Add quest::getaaexpmodifierbycharid(character_id, zone_id) to Perl.
- Add eq.get_aa_exp_modifier_by_char_id(character_id, zone_id) to Lua.
- Add quest::getexpmodifierbycharid(character_id, zone_id) to Perl.
- Add eq.get_exp_modifier_by_char_id(character_id, zone_id) to Lua.
- Add quest::setaaexpmodifierbycharid(character_id, zone_id, aa_modifier) to Perl.
- Add eq.set_aa_exp_modifier_by_char_id(character_id, zone_id, aa_modifier) to Lua.
- Add quest::setexpmodifierbycharid(character_id, zone_id, exp_modifier) to Perl.
- Add eq.set_exp_modifier_by_char_id(character_id, zone_id, exp_modifier) to Lua.
- Add $client->GetAAEXPModifier(character_id, zone_id) to Perl.
- Add client:GetAAEXPModifier(character_id, zone_id) to Lua.
- Add $client->GetEXPModifier(character_id, zone_id) to Perl.
- Add client:GetEXPModifier(character_id, zone_id) to Lua.
- Add $client->SetAAEXPModifier(zone_id, aa_modifier) to Perl.
- Add client:SetAAEXPModifier(zone_id, aa_modifier) to Lua.
- Add $client->SetEXPModifier(zone_id, exp_modifier) to Perl.
- Add client:SetEXPModifier(zone_id, exp_modifier) to Lua.

* Removed unneeded [].

* Fix variable name,

* Fix variable name.

* Fix version.h.

* Rename 2021_04_11_character_exp_modifiers.sql to 2021_04_23_character_exp_modifiers.sql

* Update db_update_manifest.txt
2021-04-23 08:47:39 -04:00
Alex
13a50f7806
[Quest API] Add HTML color tag method to Perl and Lua. (#1324)
* Add HTML color tag method to Perl and Lua.
- Add quest::gethexcolorcode(color_name) to Perl.
- Add eq.get_hex_color_code(color_name) to Lua.

Full color list here: https://pastebin.com/rUYKr1ye

* Convert to static and use strcasecmp over strcmp.

Co-authored-by: Chris Miles <akkadius1@gmail.com>
2021-04-22 23:52:00 -05:00
Paul Coene
c18562b150
[Bug] Fix ignore_primary_assist. (#1323)
* [Bug] Fix ignore_primary_assist.

* Fix to continue loop instead of return

Co-authored-by: Noudess <noudess@gmail.com>
2021-04-22 23:40:17 -05:00
Michael Cook (mackal)
dba3010c89
[Strings] Split String Optimizations (#1325)
* Switch the 2 split calls to SplitString

* Nuke duplicate split in favor of SplitString #1263

* Add a test for SplitString

* Optimize SplitString

Benchmarking:
--------------------------------------------------------------
Benchmark                       Time           CPU Iterations
--------------------------------------------------------------
bench_oldsplit               5201 ns       5201 ns     129500
bench_split                  1269 ns       1269 ns     548906

This is splitting a VERY long SpecialAbilities string. This is ~75%
speed up.
2021-04-22 23:36:39 -05:00
Alex
00fb9bc9f9
[Bug Fix] Zone Heading for Binds, Summons, Teleports, and Zoning. (#1328)
* For as long as I can remember people have had issues with zoning in, facing the wrong way, and walking through a zone line.

With this we will be able to set zone's safe heading as well as preserve heading on summon (NPC or GM) and teleports between zones.

This affects several pre-existing quest methods and extends their parameters to allow for the addition of heading.

The following functions have had heading added.
Lua
- client:SetBindPoint()
- client:SetStartZone()

Perl
- $client->SetBindPoint()
- $client->SetStartZone()
- quest::rebind()

SetStartZone parameter list was fixed also.

This converts some pre-existing methods from glm::vec3() to glm::vec4() and has an overload where necessary to use a glm::vec3() method versus glm::vec4() method.

This shouldn't affect any pre-existing servers and will allow PEQ and others to document safe headings for zones properly.

* Removed possible memory leaks.

* Fix SQL.

* Fix client message.

* Fix debug log.

* Fix log message.

* Fix call in rebind overload.

* Fix floats.

* Add default to column.
2021-04-22 22:49:44 -05:00
splose
5893730704
[Rules] Add rule 'GM:MinStatusToBypassLockedServer' (#1330)
* Add rule 'GM:MinStatusToBypassLockedServer'
Default Status: 100
Description: Players >= this status can log in to the server even when it is locked

* Add rule 'GM:MinStatusToBypassLockedServer'
Default Status: 100
Description: Players >= this status can log in to the server even when it is locked
2021-04-22 22:42:14 -05:00
Alex
0f23bd24cc
[Quest API] Convert Client GetLastName() method export to Mob export. (#1331) 2021-04-22 22:41:19 -05:00
Peter Rigby
324d48aa90
[Fix] Moved assigning of AISpellVar variables before AI_Start() so that any values that override the rule values will not be ignored (#1321) 2021-04-07 01:22:42 -05:00
hg
dadc1b2843
[Expeditions] Refactor expedition caching (#1315)
Add common expedition base class

Use repository for zone and world expedition caching

World now stores members and leader as Member objects instead of ids

This improves readability of the caching methods and lets world cache
expedition dzs and members like zone. World also now caches expeditions
as unique_ptr which will be necessary for future dz callback lambdas
that capture 'this' so addresses don't change on cache vector resizes.
2021-04-07 01:20:35 -05:00
Michael Cook (mackal)
0534a2c6be
Switch scheduled hot zone check to search instead of split (#1313)
Using search_deliminated_string here is significantly faster than
splitting, most likely because of dynamic memory management

Some tests on my system:

----------------------------------------------------
Benchmark             Time           CPU Iterations
----------------------------------------------------
bench_split         864 ns        864 ns     807922
bench_search         35 ns         35 ns   20265205

This test was a case where the string was present somewhere in the
middle which gave a ~96% speed up

----------------------------------------------------
Benchmark             Time           CPU Iterations
----------------------------------------------------
bench_split         936 ns        936 ns     725518
bench_search         61 ns         61 ns   11156359

This test was when the string was not present, which will be the vast
majority of times this is actually checked, was ~93% speed up
2021-04-07 01:17:30 -05:00
RoTPvP
050e78b1b6
Added a check to stop Bard song for Mezz/Stun (#1319)
* Added a check to stop Bard song for Mezz/Stun

* Cleaned Song stun / mezz stop

* Update client_process.cpp

* removed bard check & added else where

* code clean up

Co-authored-by: ProducerZekServer <go@away.com>
2021-04-02 23:44:59 -04:00
Michael Cook (mackal)
084b253ff7
Hack to fix repulsable bard charms (#1320)
This isn't the exactly the right way, but it's behavior is much closer
to live than current for Solon's Song of the Sirens (725), the other
bard charms don't repulse due to mana cost
2021-04-01 14:19:47 -04:00
Michael Cook (mackal)
a9a83a2052
[Bug Fix] Misc Bard Song Fixes (#1317)
* Bards song with a mana cost shouldn't repulse

* Bard songs with SE_TemporaryPets shouldn't repulse

This is mostly just an issue with Vet AAs, the actually songs have a
recast, so are already handled

* SE_Familiar should be prevented as well
2021-04-01 14:19:29 -04:00
Akkadius
d117ce0bf2 [Hotfix] Incorrect Perl usage method (docs) 2021-03-31 00:18:43 -05:00
hg
10b1f7e1ca
Add missing includes to fix windows compile (#1314) 2021-03-29 18:09:36 -05:00
Akkadius
4ac32d89e8 [Hotfix] DB Manifest 2021-03-29 03:01:07 -05:00
Chris Miles
7aa5308f9c
[Scheduler] Event scheduler implementation (#1257)
* Event scheduler implementation

* Create 2021_02_17_server_scheduled_events.sql

* Tweak

* Remove unused event [skip ci]

* Cleanup [skip ci]

* PR adjustments

* Database manifest
2021-03-29 02:52:57 -05:00
Michael Cook (mackal)
f51bc4daaf
[Fix] Clean up Filtered/MessageString functions (#1311)
This solves the OOB issue pointed out in #1304 and cleans up the code a
bit so it should be less error prone
2021-03-29 02:18:03 -05:00
hg
049fe55c7f
[Expeditions] Create common dz abstract class (#1312)
This creates an abstract class in common so zone and world can share
most of the implementation. World now has access to the same dz data and
api as zone.

Rename CharacterChange to AddRemoveCharacter for clarity

Rename GetRemainingDuration to GetDurationRemaining for consistency

Move dynamic zone queries to custom repository methods
2021-03-29 02:17:36 -05:00
hg
f5cf566fca
[Expeditions] Let dz process its expired state (#1310)
Move early empty shutdown and process rate rules to DynamicZone scope

This decouples the expired status check from expeditions into an
internal dz method that can be called by its owning system
2021-03-28 20:43:09 -05:00
Alex
97c11a1199
[Quest API] Add new zone name methods to Perl and Lua. (#1309)
- Add quest::GetZoneShortName(zone_id) to Perl.
- Add quest::GetZoneLongNameByID(zone_id) to Perl.
- Add eq.get_zone_id_by_name(zone_name) to Lua.
- Add eq.get_zone_short_name_by_id(zone_id) to Lua.
- Add eq.get_zone_long_name_by_id(zone_id) to Lua.
- Add eq.get_zone_long_name_by_name(zone_name) to Lua.
2021-03-28 20:25:50 -05:00
Akkadius
ba64d6f494 [Installer] Swap unstable powershell download for Perl LWP::Simple call 2021-03-28 20:04:34 -05:00
Alex
410ba4b19a
[Rules] Cleanup all unused rules. (#1308) 2021-03-28 18:37:21 -05:00
Paul Coene
74076078bb
[Boats] Fix x/y offsets from client to reflect EQ x/y instead of boat heading… (#1296)
* Fix x/y offsets from client to reflect EQ x/y instead of boat heading x/y

* Use std version of math calls and reduce the # of calls

* Remove errant instrumentation

Co-authored-by: Noudess <noudess@gmail.com>
2021-03-28 18:20:02 -05:00
hg
d9e23a0303
[Expeditions] Decouple dz updates from expeditions (#1303)
Use internal dz messages to process duration and location changes

Add world DynamicZone class (later this will inherit from a base)

Add FindDynamicZoneByID to get dz from zone and world system caches
2021-03-28 18:14:36 -05:00
Thalix
dbb9c1d4f4
Minor ruletypes.h cleanup (#1306)
Minor ruletypes.h cleanup
2021-03-28 18:06:56 -05:00
Michael Cook (mackal)
d202695e88
[Cleanup] Only link Lua with zone (#1288)
Only zone requires to be linked to lua, so let's not link EVERYTHING.

There is probably more clean up we could do, but I know for a fact Lua
is only used by zone.

This probably has some measurable benefits that probably don't really
matter that much :)
2021-03-19 00:12:46 -05:00
Michael Cook (mackal)
323f5ea92e
[Bug Fix] Add Bounds Checking to OP_LFGCommand Comment Processing
Theoretically this could be used to corrupt memory, but they would have
to get extremely lucky to actually execute a successful attack
2021-03-18 23:43:13 -05:00
hg
5b74f1e756
[Expeditions] Refactor expedition requests (#1301)
Move ExpeditionLockoutTimer to common

This simplifies expedition request conflict checks and uses repository
for the queries instead of processing the query result directly.
2021-03-18 23:42:41 -05:00
hg
ee4af65268
[Expeditions] Cleanup client dz safe return methods (#1300)
This changes Zone::GetDynamicZone to return a pointer instead of a copy
and also lets DynamicZone be forward declared in zone.h
2021-03-18 23:42:20 -05:00
hg
739b975cad
[Expeditions] [Quest API] Add expedition IsLocked to Quest API (#1292) 2021-03-16 00:04:08 -05:00
Thalix
5035451af7
[Crash] Bugfix for zone crash caused by #flymode -1 (#1291)
* Update command.cpp

Fixed typo in the command description.

* Bugfix for #flymode zone crash

Bugfix for #flymode zone crash when invalid values are passed. Also, when entering #flymode without parameters, the correct syntax is now displayed.

* Changed as requested
2021-03-16 00:03:35 -05:00
hg
18a3ff5f12
Throttle auto expedition leader changes (#1293)
This fixes unnecessary leader processing on mass dzquits

Also marks leader dirty for empty expeditions in case something goes
wrong (shouldn't be possible after 62e480fe)
2021-03-16 00:01:48 -05:00
hg
0d12bf0b1f
[Expeditions] Store description and leader name on dz (#1294)
* Rename dynamic zone source files

* Store description and leader name on dz

Removes the DynamicZoneInfo struct used for switch list window. This
data can be stored on DynamicZone and kept updated by its owning system

* Separate create compass packet method

Cleanup MarkSingleCompassLoc
2021-03-16 00:00:55 -05:00
splose
b3fbe1b015
add quest::get_spell_level(uint16 spell_id, uint8 class_id) (#1295) 2021-03-15 23:59:09 -05:00
splose
e9cd0b15a2
setting spawn2.version to -1 will now properly spawn mobs in all zone versions (#1299) 2021-03-15 23:57:54 -05:00