266 Commits

Author SHA1 Message Date
Alex
e5f5db69b4
Merge pull request #1280 from EQEmu/bug_fix/strcpy_overlap_GetGroupLeadershipInfo
[ASan] Fix strcpy-param-overlap with GetGroupLeadershipInfo calls
2021-03-05 19:24:42 -08:00
Alex
d635e69ee3
Merge pull request #1283 from EQEmu/cleanup/Wformat-overflow
[Cleanup] Make code -Wformat-overflow safe
2021-03-05 19:23:48 -08:00
Michael Cook (mackal)
224c26620e Clean up MOTD processing 2021-03-05 15:24:40 -05:00
Michael Cook (mackal)
c45395be95 Fix strcpy-param-overlap with GetGroupLeadershipInfo calls
==1810==ERROR: AddressSanitizer: strcpy-param-overlap: memory ranges [0x7ffef04baf90,0x7ffef04baf98) and [0x7ffef04baf90, 0x7ffef04baf98) overlap
    #0 0x7f163bb9509e  (/lib/x86_64-linux-gnu/libasan.so.5+0x4f09e)
    #1 0x5652caed27b3 in Client::Handle_Connect_OP_ZoneEntry(EQApplicationPacket const*) ../zone/client_packet.cpp:1535

==1918==ERROR: AddressSanitizer: strcpy-param-overlap: memory ranges [0x7ffddc8057c0,0x7ffddc8057c8) and [0x7ffddc8057c0, 0x7ffddc8057c8) overlap
    #0 0x7fc61ee0e09e  (/lib/x86_64-linux-gnu/libasan.so.5+0x4f09e)
    #1 0x56023c149698 in WorldServer::HandleMessage(unsigned short, EQ::Net::Packet const&) ../zone/worldserver.cpp:1055
2021-02-28 21:42:51 -05:00
Michael Cook (mackal)
b82f376bfb Fix stack-buffer-overflow thanks to StopLFP
==1674==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffb47f3068 at pc 0x7f64ee1f531e bp 0x7fffb47f2f50 sp 0x7fffb47f2700
READ of size 432 at 0x7fffb47f3068 thread T0
    #0 0x7f64ee1f531d  (/lib/x86_64-linux-gnu/libasan.so.5+0x3f31d)
    #1 0x55c78e8d002e in WorldServer::UpdateLFP(unsigned int, unsigned char, unsigned char, unsigned int, unsigned int, unsigned int, char const*, GroupLFPMemberEntry*) ../zone/worldserver.cpp:3166
    #2 0x55c78e8d01d9 in WorldServer::StopLFP(unsigned int) ../zone/worldserver.cpp:3180
2021-02-28 17:50:07 -05:00
Michael Cook (mackal)
7a46a6595c
[Cleanup] use std::make_unique (#1259)
* Convert common/eq_limits.cpp to use make_unique

* Convert common/net/console_server.cpp to use make_unique

* Convert common/net/servertalk_client_connection.cpp to use make_unique

* Convert common/net/servertalk_legacy_client_connection.cpp to use make_unique

* Convert common/net/servertalk_server.cpp to use make_unique

* Convert common/net/websocket_server.cpp to use make_unique

* Convert common/net/websocket_server_connection.cpp to use make_unique

* Convert common/shareddb.cpp to use make_unique

* Convert eqlaunch/worldserver.cpp to use make_unique

* Convert loginserver/server_manager.cpp to use make_unique

* Convert loginserver/world_server.cpp to use make_unique

* Convert queryserv/worldserver.cpp to use make_unique

* Convert ucs/worldserver.cpp to use make_unique

* Convert world/clientlist.cpp to use make_unique

* Convert world/expedition.cpp to use make_unique

* Convert world/launcher_link.cpp to use make_unique

* Convert world/login_server.cpp to use make_unique

* Convert world/main.cpp to use make_unique

* Convert world/ucs.cpp to use make_unique

* Convert world/web_interface.cpp to use make_unique

* Convert world/zonelist.cpp to use make_unique

* Convert world/zoneserver.cpp to use make_unique

* Convert zone/client.cpp to use make_unique

* Convert zone/corpse.cpp to use make_unique

* Convert zone/dynamiczone.cpp to use make_unique

* Convert zone/expedition.cpp to use make_unique

* Convert zone/main.cpp to use make_unique

* Convert zone/mob_ai.cpp to use make_unique

* Convert zone/mob_movement_manager.cpp to use make_unique

* Convert zone/pathfinder_nav_mesh.cpp to use make_unique

* Convert zone/worldserver.cpp to use make_unique
2021-02-23 18:30:46 -06:00
Michael Cook (mackal)
0ef01165ea
Fix some leaks of groups/raids (#1242)
These cases probably are exceedingly rare, but they still need to be
accounted for. (As in, I don't think anyone has run into these cases too
often to cause problems)
2021-02-12 02:07:58 -06:00
Akkadius
6e765e7ddc Revert "[BUG] Fix for Group Leader Disband Issue"
This reverts commit f854137ca029fa6e90cab5133bd8ee6194f8e1cb.
2021-02-12 02:05:20 -06:00
Akkadius
0c533071d4 Yet more cleanup 2021-02-07 15:00:16 -06:00
Akkadius
c194e2ac9c Fix linux compile warnings 2021-02-06 01:22:22 -06:00
Akkadius
b7983d4c20 First pass 2021-02-06 00:45:13 -06:00
Trust
f854137ca0 [BUG] Fix for Group Leader Disband Issue
Added public/private class for oldleadername so we can save the previous leader name when the entity is destroyed then allow us to transfer leadership.

Adjusted DelmemberOOZ and in zone functions to include removal of the old leader when disbanding.
2020-12-31 00:16:27 -05:00
hg
da5d4b9830 Send all members expedition expire warnings
All expedition members are notified not just those in dz

This will only work if the dz is running. It might make more sense to
move this to client or world processing so members are notified even if
the zone instance isn't running
2020-12-30 18:47:31 -05:00
hg
b377fd183a Add api to add lockout duration
Also supports reducing lockout duration

Add Expedition::AddLockoutDuration

Add Client::AddExpeditionLockoutDuration

Some expeditions require adding to existing lockout durations
during progression. These add the specified seconds to individual
member lockout timers instead of setting a static duration based on
internal expedition lockout like UpdateLockoutDuration.
2020-12-30 18:47:11 -05:00
hg
d61879fd3c Add character id based expedition apis
Add static expedition methods to add or remove character lockouts

Add CreateLockout static helper to ExpeditionLockoutTimer

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

Fix #dz list member count
2020-12-30 18:47:10 -05:00
hg
184ea679f2 Refactor client cross zone message helpers
Remove extra cross zone message server opcode and struct. Existing
function already exists for normal messages

Group CZClientMessageString struct with other CZ structs
2020-12-30 18:47:09 -05:00
hg
9164073d14 Let world shutdown dz early for empty expeditions
Since world now tracks empty expeditions it can determine when to
shutdown dynamic zone instances when the rule is enabled rather than
letting zones do it.
2020-12-30 18:47:08 -05:00
hg
148af3edfc Only delete empty expeditions when the dz is empty
Zones are no longer able to delete expeditions. World now tracks empty
expeditions in cache and only deletes them when it detects an
expedition's dynamic zone instance has no more clients inside.

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

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

This fixes expired expeditions being left in zone caches unless the
expedition's dz instance was running to detect it (or unless an
expedition was deleted via a client using /kickplayers). This was also
leaving clients in a ghost expedition that no longer actually existed
2020-12-30 18:47:08 -05:00
hg
3f4ea66ea1 Implement expedition locking
Disables the ability to add new members

Adds Expedition::SetLocked(bool) to quest api

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

This adds the Expedition::SetReplayLockoutOnMemberJoin(bool) method
to the quest api so it can be disabled
2020-12-30 18:47:08 -05:00
hg
ef77b28b3f Add #dz lockouts remove command
This allows clearing a character's lockouts

Adds client RemoveAllExpeditionLockouts methods and exposes to lua api
2020-12-30 18:47:07 -05:00
hg
eccc79e4ce Let dz handle client removal timers
Remove all clients inside a dz, not just those assigned to instance
2020-12-30 18:47:07 -05:00
hg
8eef2ae089 Add DynamicZone class for expedition instancing
Add DynamicZone sql table schema

Add DynamicZones logging category

Modify CreateExpedition to take DynamicZone and ExpeditionRequest objects

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

Implement live-like DynamicZone instance kick timer for removed members

Implement updating multiple client compasses (supports existing quest compass)

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

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

Implement OP_DzChooseZoneReply handling

Add Lua api methods for expedition's associated dynamic zone

Add #dz list gm command to list current DynamicZone instances from database
2020-12-30 18:47:07 -05:00
hg
da067be2fa Implement initial expedition system
Add Expeditions logging category

Add handlers for all Dynamic Zone/Expedition related opcodes

Add FormatName string_util function to format character names

Add Zone::IsZone helper method

Add cross zone MessageString support with variable parameters

Add static Client method helpers for cross zone messaging

Add #dz gm command to debug expedition cache for current zone
2020-12-30 18:47:06 -05:00
Akkadius
758a30a080 Fix merge 2020-07-12 16:57:36 -05:00
Akkadius
3016f9409b Fix merge 2020-07-12 16:57:04 -05:00
Akkadius
8647bd73ce Merge remote-tracking branch 'origin' into integration/multi-tenancy-expansions-repository 2020-07-12 16:51:36 -05:00
Chris Miles
b801f8dfe5
Merge pull request #1092 from EQEmu/cross_zone_overhaul
Completely overhaul cross zone and world wide methods in quest API.
2020-07-07 14:15:29 -05:00
Alex
c8389bc674 Completely overhaul cross zone and world wide methods in quest API. 2020-07-07 08:02:56 -04:00
Alex
f1929c4f45 Add hot reload saylinks as well as a rule to determine if you bypass the saylinks. 2020-07-07 07:20:08 -04:00
Akkadius
b7e2261e16 Merge branch 'master' of https://github.com/EQEmu/Server into integration/multi-tenancy-expansions-repository 2020-07-07 01:32:17 -05:00
Alex
f514dd5b55 Optimize cross-zone utilities and add cross-zone player move utilities to Perl/Lua. 2020-06-29 17:54:30 -04:00
Akkadius
e03ca7f65e Merge branch 'master' of https://github.com/EQEmu/Server into integration/multi-tenancy-expansions-repository 2020-06-29 00:40:27 -05:00
Alex
25c3d3803f Add cross-zone task assign methods to Perl/Lua. 2020-06-27 20:03:06 -04:00
Akkadius
3f62da4573 Merge branch 'master' of https://github.com/EQEmu/Server into integration/multi-tenancy-expansions-repository 2020-05-23 22:33:34 -05:00
KimLS
2fbd5aaccc Rename namespace EQEmu to namespace EQ (so we don't have two similar but different namespaces anymore) 2020-05-17 18:36:06 -07:00
Alex
5f0d3e9026 Add several cross zone methods to Perl/Lua. 2020-05-11 20:10:52 -04:00
Alex
dc9bd031ff
Merge branch 'master' into crosszonesignalplayerbygroupid 2020-05-10 21:00:43 -04:00
Alex
857b24727c Add CrossZoneMessagePlayerByGuildID() to Perl/Lua. 2020-05-10 16:52:33 -04:00
Alex
12c4b20169 Add CrossZoneSignalPlayerByGroupID() to Perl/Lua. 2020-05-09 21:15:34 -04:00
Akkadius
373fb3f0e7 Decouple zone calls, cleanup logic 2020-04-19 04:36:39 -05:00
Akkadius
a0f8bbb3b9 Merge branch 'master' of https://github.com/EQEmu/Server into integration/multi-tenancy-expansions-repository 2020-04-18 02:31:43 -05:00
Chris Miles
16cfad1966
UCS / Raid / Zone Fixes (#1033)
* Cache EntityList::GetRaidByClient

* Adjustments [skip ci]

* Update entity [skip ci]

* More cleanup [skip ci]

* More tweaks [skip ci]

* Cleanup [skip ci]

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

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

* Shutdown the eventloop to properly shutdown the zone versus calling a hard exit
2020-04-14 23:28:43 -05:00
Akkadius
2b1b786f02 Merge branch 'master' of https://github.com/EQEmu/Server into integration/multi-tenancy-expansions-repository 2020-04-06 02:55:46 -05:00
KimLS
52d2469da2 Rewrite how zone finds ports 2020-03-21 17:05:28 -07:00
Akkadius
d360c60289 Migrate ldon traps and #hotfix [skip ci] 2020-03-12 02:40:04 -05:00
Akkadius
ca49f3902f Migrate getZoneX calls and npc types calls [skip ci] 2020-03-12 02:27:09 -05:00
Chris Miles
81ff7f5d57
Merge pull request #964 from EQEmu/feature/hot-reload
Feature - Hot Reload
2020-02-22 16:18:47 -06:00
hg
e09b0ae1e9 Let client handle consent confirmation messages to corpse owner 2020-02-02 14:37:12 -05:00