Commit Graph
25 Commits
Author SHA1 Message Date
Karrz1 16705c7c90 Realm loopback test: with a localAddress the stock pick is either realm address 2026-11-14 12:02:52 +00:00
Karrz1 9c19986d28 Realm: 127.0.0.1 for a local game only when the world server is on this PC
Since 0.1.30 a game on the auth server's own PC always got 127.0.0.1 from the
realm list, so a VPN that was on when the server started could not break the
login. With the auth server on one PC and the world server on another, that
sent the game to a PC with no world server and the login failed.

Now a loopback client gets 127.0.0.1 only when the realm's address or
localAddress is this PC, or when something listens on 127.0.0.1 at the
realm's port (the VPN case: the address is gone but the world server still
listens here). Otherwise the realmlist addresses are used as before 0.1.30.
The port check is kept for a minute per port.
2026-11-14 11:55:25 +00:00
Karrz1 ff699fb5cf Sync with WoW Forever 0.1.34: Blizzlike core
Brings forever up to date with our 0.1.34 code for the WoW Forever client 1.60.1.70862.
Blizzlike only: fixes from real game data (packet captures, live hotfixes, player caches, Wowhead and Questie data,
VMaNGOS for the vanilla world) and server fixes. No custom items or custom content; every rate and option defaults
to Blizzard's behaviour.

What is new since 2ae1313e, in short:
- Clients 70790, 70840 and 70862: message numbers, mail, guild window, charters, contact list, add-on whispers.
- Crash and exploit fixes: guild ranks, loot of emptied veins, quest lookups, taxi mask, battleground templates,
  vendor free buys, item sell price, auction house, falling out of the world, bnetserver request limit.
- Classes, talents, pets and buffs from the live game data and Blizzard's hotfixes of November.
- Quests, NPCs, spawns, trainers, loot, fishing, events, Merchant's Favor crates and writs, sealed crate turn-ins.
- Dungeon and raid scripts (Molten Core, Blackwing Lair, Zul'Gurub, Ahn'Qiraj, Shadowfang Keep, Deadmines ...).
- Pathing fixes that help pets and NPCs.
- Russian creature names, quest titles and quest texts.
- README: Blizzlike stance, branches, repack.
2026-11-09 17:27:57 +00:00
Karrz1 ff04fe72fa Network: connections per address and login timeouts
Nothing limited how many connections one address could hold open, and a connection that never logged in stayed open for good, on both servers. worldserver: Network.ConnectionsPerIp (16; a player uses two) and Network.AuthTimeout (60 s to log in). bnetserver: Network.ConnectionsPerIp (16), Network.HandshakeTimeout (30 s for the TLS handshake) and Network.LoginTimeout (600 s to log in). 0 turns each off, and connections from the server's own PC (loopback) are never limited, so the local launcher and a single-PC realm are unaffected. The count lives in Trinity::Net::IpConnectionLimit (common/network), with a test.
2026-10-27 15:04:16 +00:00
Shauren 4db97c8372 Dep/Catch2: Update to 3.15.2 2026-07-15 23:46:27 +02:00
Shauren b705283d0e GCC build fix 2024-03-13 19:56:34 +01:00
Shauren 37899f3954 Tests: Disable intentionally triggered warning in test code 2024-03-13 18:17:04 +01:00
Shauren f690b69338 Core/Utils: unique_trackable_ptr improvements
* Added comparison operators
* Added type casting helper functions
2024-03-13 17:04:26 +01:00
Shauren 1f3ebbb23c Fix tests build 2024-03-11 18:25:17 +01:00
Shauren 32e54b6bd1 Core/Utils: Added a custom smart pointer type unique_trackable_ptr - a specialized variant of std::shared_ptr that enforces unique ownership
* This is intended to be used by external code unable to track object lifetime such as custom scripting engines
2024-03-11 18:16:34 +01:00
Fabian 084d9d37b1 Tests: Add missing include 2024-03-01 11:40:12 +01:00
Shauren cd62dc4491 Tests: Fixed environment variable confg test compilation on windows 2023-01-06 16:55:58 +01:00
Shauren 42fbcf2fc5 Core/Utils: Replace boost flat_set with our own 2023-01-06 16:51:01 +01:00
Anton Popovichenko 8447f627ba Core/Config: Implement config override with env vars (#26811)
* Core/Config: Implement config override with env vars

Implement overriding of configuration from the .conf file with environment variables.
Environment variables keys are autogenerated based on the keys defined in .conf file.
Usage example:
$ export TC_DATA_DIR=/usr
$ TC_WORLD_SERVER_PORT=8080 ./worldserver

* Core/Config Fix typo in logs

Co-authored-by: Giacomo Pozzoni <[email protected]>

* Core/Config Fix code style in EnvVarForIniKey

Co-authored-by: Shauren <[email protected]>

* Update tests/common/Config.cpp

* Apply suggestions from code review

Co-authored-by: Peter Keresztes Schmidt <[email protected]>

* Apply suggestions from code review

Co-authored-by: Peter Keresztes Schmidt <[email protected]>

Co-authored-by: Anton Popovichenko <[email protected]>
Co-authored-by: Giacomo Pozzoni <[email protected]>
Co-authored-by: Shauren <[email protected]>
Co-authored-by: Peter Keresztes Schmidt <[email protected]>
(cherry picked from commit 1ddd9dc19cc1df1a1ab8c6123283999f9dea6760)
2022-03-13 16:37:01 +01:00
Treeston da8a66a05e Common/Util: Trinity::StringTo<double> support (PR #25364)
(cherry picked from commit f45aa5cac1579e87cbc599ffb58e10e662066792)
2022-02-04 23:50:25 +01:00
Treeston 2aaebc193c UnitTests: Cleanup + StringConvert/ChatCommand tests (PR #25353)
(cherry picked from commit 8ce3635d39dbdd101ddf180a66c483162df99c04)
2022-02-04 13:03:29 +01:00
Carbenium 8809d54ca2 Core/Common: Merge TimeTrackerSmall with TimeTracker
(cherry picked from commit 228696bf80bcd55d35445cd24ae119020c310f88)
2022-01-24 21:34:36 +01:00
Carbenium 35e0002df3 Core/Common: Add a std::chrono interface to TimeTrackerSmall
New methods:
TimeTrackerSmall(Milliseconds expiry);
void Update(Milliseconds diff);
void Reset(Milliseconds expiry)
Milliseconds GetExpiry() const

Removed methods:
int32 GetExpiry() const

Also add basic unit tests.

Core/Scripts: Use std::chrono interface of TimeTrackerSmall

(cherry picked from commit e55516348dbabaa8c9d559426315f3f70967acaa)
2022-01-24 21:25:47 +01:00
Carbenium 906a47b161 tests/EventMap: Add tests for Repeat
(cherry picked from commit e6f36f83b8af4d973a96f01c6095b075dd12f5d5)
2022-01-24 00:01:48 +01:00
Carbenium da17942af9 Core/EventMap: Clarify documentation of ScheduleEvent
(cherry picked from commit 7865c1c197f4eb9165ef3ab26eb4f750a5b58960)
2022-01-24 00:01:38 +01:00
Carbenium a5d85deced Core/EventMap: Unify semantics of DelayEvents
DelayEvents(Milliseconds delay) had different semantics than
DelayEvents(Milliseconds delay, uint32 group).
The first method delayed the events only in the case the internal timer
already ticked at least for the amount of delay. In contrast the latter method
delayed events regardless of the internal timer value.

Use the latter semantics for DelayEvents(Milliseconds delay) as well which makes
the outcome more predictable. Adapt tests accordingly.

(cherry picked from commit 4470b9122379dc846b322a441951a03913912b71)
2022-01-24 00:01:25 +01:00
Carbenium 5512eb2f8f tests/EventMap: Test for event past it's execution time
With the switch to std::chrono return type of GetTimeUntilEvent
we don't run into an overflow condition which happend with the previous
uint32 return value if the events scheduled execution time is in the past.
Test for this case.

(cherry picked from commit e877f988d1c4e1361612f3d5c4ebe915f746aee5)
2022-01-24 00:00:47 +01:00
Carbenium 27c1f47598 EventMap: Change GetTimeUntilEvent to return std::chrono types
(cherry picked from commit 8cb35b0d5f1462387033e6bd2f99d0ea829fdcd8)
2022-01-23 23:59:46 +01:00
Carbenium ddeae5e7d2 tests: Add some basic tests for EventMap
(cherry picked from commit 7950275697c9d48781ad61cf3749e0392ee660bc)
2022-01-23 22:48:58 +01:00
Carbenium f837f28171 dep: Add catch2 unit test framework and wire it up
To enable the test suite, make sure to configure CMake with -DBUILD_TESTING=1 , since it is disabled by default. The catch2 dependency will be downloaded during configure time.

Also add a new target "tests-common", which includes unit tests for the "common" project. To finally run the tests use the "test" target.

CircleCI: Run unit tests
(cherry picked from commit 6a28ee7b2a4269aa7e43265d1cd0067537e3e883)
2022-01-23 22:48:35 +01:00