131 Commits

Author SHA1 Message Date
Akkadius
78190798dc [Performance] Use static memory in EQ::Net::DaybreakConnection 2025-01-27 02:42:14 -06:00
Alex
1f3ac2dc4f
[Memory Leak] Change raw pointer to unique_ptr to avoid potential leak in dbg stream (#4616)
Co-authored-by: KimLS <KimLS@peqtgc.com>
2025-01-26 19:05:45 -06:00
Chris Miles
c44596b38a
[Network] Prune / disconnect TCP connections gracefully (#4574) 2025-01-05 23:48:00 -06:00
Chris Miles
f2f8fae58b
[Telnet] Telnet encoding fix (#3269) 2023-04-05 12:16:25 -04:00
Aeadoin
f752b57a55
[Cleanup] Cleanup uses of insert/push_back when a temp object is used. (#3170) 2023-04-03 16:45:01 -04:00
Chris Miles
19791195e5
[Logging] Netcode Logging Unify (#2443)
* [Logging] Unify netcode logging

* More tweaks, generator

* Exclude OP_SpecialMesg at callback level

* Consolidate packet loggers

* Log at EQStream level instead of proxy

* Fix C->S

* Server to server logging

* C-S for Loginserver

* Hook UCS for C->S

* Update eqemu_logsys.h

* World C->S logging

* Translate opcodes through patch system for client to server

* Additional logging requests

* Add detailed opcode translation logging

* vStringFormat resiliency

* Translate loginserver C->S

* Simplify out message string (reduce copies) and ignore legacy formats

* Update eqemu_logsys.cpp

* Log file format

* Handle deprecated categories
2022-09-28 03:42:09 -05:00
hg
c847e3da86
[Netcode] Adjust first packet for compress flag (#2326)
When a packet was over max_raw_size and zlib failed to compress the
first packet chunk then the final output would be 513 bytes which
exceeded m_max_packet_size of 512.

This occured because the first packet chunk used sublen without
adjusting for the new_length + 1 compression flag added in Compress().
When the packet failed to compress then it was already at its max.
After the first packet, chunk sizes are calculated using max_raw_size
which already accounted for the compress flag. (From #979)

This should fix #2325
2022-07-27 08:52:25 -05:00
Chris Miles
dfd8f84cac
[Strings] Refactor Strings Usage (#2305)
* Initial commit checkpoint

* More functions converted

* Commify

* More functions

* Fin

* Sort declarations

* Split functions between files

* Bots

* Update strings.h

* Split

* Revert find replaces

* Repository template

* Money

* Misc function

* Update CMakeLists.txt

* Saylink

* Update strings.cpp

* Swap Strings::Saylink for Saylink::Create since saylink is coupled to zone database

* API casings
2022-07-14 02:10:52 -05:00
Kinglykrab
d107226ced
[Telnet] Add guildsay to console commands and Guild Channel to QueueMessage. (#2263)
* [Telnet] Add guildsay to console commands and Guild Channel to QueueMessage.
- Will allow you to send guild-specific messages from things like Discord EQ.
- Add Guild support in `EQ::Net::ConsoleServerConnection::SendChannelMessage` so guild ID can be parsed out.

* Fix auction ChannelMessage by adding to condition.

* Update console.cpp

* Update console.cpp
2022-07-02 21:51:03 -05:00
Kinglykrab
293361a1f7
[Cleanup] Make use of AccountStatus constants wherever status is checked or used. (#1764)
* [Cleanup] Make use of AccountStatus constants wherever status is checked or used.
- Cleanup all instances of SendEmoteMessage.
- Cleanup all instances of SendEmoteMessageRaw.
- Cleanup all instances of MessageStatus.
- Convert Quest API method defaults to use constants.

* Cleanup constant names.
2021-11-14 21:01:13 -06:00
Alex
e4bd6f5bd2
[Networking] Servertalk Legacy World Connections for Login (#1662)
* servertalk server connections will now attempt to parse legacy connections as well as modern ones

* Some fixes for legacy connections

* Change legacy default from local to eqemu
2021-11-11 19:37:35 -06:00
Chris Miles
228e0007ca
Pad zero size packets which is what we did on encrypted connections prior to #1464 (#1504) 2021-08-31 00:33:49 -05:00
Alex
1c8231eb9e
[Netcode] Remove security from servertalk connections (#1464)
* Remove security from servertalk connections

* Remove the two hello steps before handshake that are now obsolete out

* Revert "Remove the two hello steps before handshake that are now obsolete out"

This reverts commit 32d61ea2381c1bddf8b08c5240899116d0fd3e80.

* Keep old values for enums

* Use downgrade security handshake for backwards compat

* Send handshake instead of hello to fast connect

* Add connect callback so it will actually work
2021-08-15 23:39:38 -05:00
Michael Cook (mackal)
cafae9d8c6 Use casts to silence ASan complaints
I don't think these are actually causing any real problems, ASan
complains about them though since it's kind of a code smell I guess and
a potential source of problems. But our case is fine, so cast to silence
them.
2021-02-28 18:01:34 -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
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
peterigz
21ed02ca52 Add missing break for OP_AppCombined switch statement 2020-04-17 18:27:45 +01:00
hg
ed09d4ae54 Send packet uncompressed if zlib deflates to a larger size than input
It's not guaranteed that deflate output will be smaller than the input.

In some cases zlib-ng (Z_BEST_SPEED) compression is causing packets to
increase in size and exceed m_max_packet_size. This results in the
packets never being fully received by the client.

Currently this is most reproducible in the spell_book section of the
OP_PlayerProfile message. After using #scribespells this portion of the
player profile has a lot of incrementing spellids which may be affecting
the compression algorithm. The client never processes the player profile
(MSG_SEND_PC) message and times out on zone entry.

This isn't necessarily a bug with zlib-ng since it inflates back to the
original input and normal zlib could do this too, but the current netcode
doesn't handle this.
2020-02-14 10:06:47 -05:00
KimLS
6bc6b659d5 Merge branch 'master' of github.com:EQEmu/Server 2020-02-03 17:17:26 -08:00
KimLS
c2300d514c Packet warnings 2020-02-01 20:49:04 -08:00
Michael Cook (mackal)
4241fba7e2 Forgot 2 exceptions 2020-01-16 19:10:04 -05:00
Michael Cook (mackal)
139b6c34e5 Change things -Wcatch-value complains about to references 2020-01-16 19:03:36 -05:00
Michael Cook (mackal)
14402c9c41 Fix unreachable switch statements in console_server_connection.cpp 2020-01-16 17:44:46 -05:00
Akkadius
ed7ce38fe0 Add some pointer safety checks to underlying data service call [skip ci] 2019-11-03 14:34:07 -06:00
Akkadius
e2630d2b20 Return blank string on null socket [skip ci] 2019-10-29 23:16:37 -05:00
Akkadius
2eb14a5c8a Move Netcode logging to LogNetcode 2019-09-01 23:10:49 -05:00
Akkadius
d3803045bc Add log aliases to make logging much easier to use (All FMT driven) 2019-09-01 20:47:26 -05:00
KimLS
5fce042a31 Up stale connection ms again 2019-08-08 18:49:21 -07:00
Akkadius
4498819fad Abstracted CLI command handling interface, streamlined more logging 2019-08-04 02:58:26 -05:00
Akkadius
7c2ee06355 Merge branch 'master' of https://github.com/EQEmu/Server into lsid 2019-07-14 22:53:32 -05:00
KimLS
6bdc9b6ba5 Add support for single account login to both world and login server, should also work with eqemu login server, can be turned off in rules if you don't mind the side effects double logins cause. Also lowered the linkdead time to 30s + 90s default (2min) 2019-07-13 16:16:15 -07:00
Akkadius
86f9a205e5 Remove eqemu_logsys_fmt.h header, more log tweaks 2019-07-05 17:20:20 -05:00
Akkadius
9c931ced4e Allow local admin login 2019-05-20 00:49:05 -05:00
KimLS
52276d06b0 Remove c++17 construct, a bridge too far for now 2019-05-17 00:29:51 -07:00
KimLS
597c4e8c60 Rename websocket_server so it no longer shares a name with its own type 2019-05-17 00:22:32 -07:00
KimLS
c737504645 Subscription changes 2019-05-17 00:09:38 -07:00
KimLS
ebca112769 Implement a basic websockets server 2019-05-16 00:12:21 -07:00
KimLS
09b91f5229 Change hash from enum to int, older gcc versions have trouble with that 2019-05-12 21:09:06 -07:00
KimLS
63198d974e Merge branch 'feature/eqemu-api-data-service-netstats' of github.com:EQEmu/Server into feature/eqemu-api-data-service-netstats 2019-04-16 01:09:31 -07:00
KimLS
cd8ab727aa Tweaks from other branch 2019-04-16 01:09:25 -07:00
Akkadius
1d88b063aa Change compression level in deflate 2019-04-15 00:12:11 -05:00
KimLS
cbfd02b9ff Remove logging from daybreak network code to make it thread safe, there is a threadsafe replacement if you care (there's only like 4 logs in the code anyway); made event loop thread local so we can have one for each thread 2019-03-15 21:34:23 -07:00
KimLS
7977949ae9 Change eqstream interface to get rid of some stuff as well as flesh out a few more options plus some rule and performance changes 2019-03-13 22:55:49 -07:00
KimLS
67b228a91c Added packet stats 2019-03-11 15:24:32 -07:00
KimLS
675a67b676 Set data rate to disabled by default 2019-03-10 03:28:44 -07:00
KimLS
777f182282 Update fmt lib with submodule 2019-03-10 00:10:47 -08:00
KimLS
ee1fcdf5fa Stats, stats everywhere (I added a #netstats command) 2019-03-09 22:25:04 -08:00
KimLS
cb9f0fbe31 Start of a network options interface command 2019-02-24 19:24:10 -08:00
KimLS
b156b078ed Revert internal send to old code 2019-02-24 15:20:01 -08:00
KimLS
e3d5200310 Redid background task interface, used it to async send client packets 2019-01-07 19:53:23 -08:00