Commit Graph

663 Commits

Author SHA1 Message Date
Anton Popovichenko
1ddd9dc19c 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 <giacomopoz@gmail.com>

* Core/Config Fix code style in EnvVarForIniKey

Co-authored-by: Shauren <shauren.trinity@gmail.com>

* Update tests/common/Config.cpp

* Apply suggestions from code review

Co-authored-by: Peter Keresztes Schmidt <carbenium@outlook.com>

* Apply suggestions from code review

Co-authored-by: Peter Keresztes Schmidt <carbenium@outlook.com>

Co-authored-by: Anton Popovichenko <anton.popovichenko@mendix.com>
Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
Co-authored-by: Shauren <shauren.trinity@gmail.com>
Co-authored-by: Peter Keresztes Schmidt <carbenium@outlook.com>
2021-08-19 22:26:16 +02:00
Jinnaix
7050a5ccb6 Server/Config - Change default settings for saving gm logs. (#26804)
* Server/Config - Change default settings for saving gm logs.

* update

Prefix Timestamp to the text
2021-08-13 16:59:43 +02:00
jackpoz
8fcf59f9db Core/Misc: Fix build on systems where size_t is not defined as uintXX_t, i.e. Mac 2021-08-06 19:46:37 +02:00
jackpoz
de4ccc7f27 Core/SOAP: Fix memory leak on shutdown reported by ASan 2021-07-30 18:42:43 +02:00
jackpoz
2a12e96d17 Core/SOAP: Fix new/free mismatch reported by ASan 2021-07-30 17:54:46 +02:00
Giacomo Pozzoni
68bf7e6d12 Core/Network: Add option to allow/disallow saving IP addresses to database (#26723)
Add config option AllowLoggingIPAddressesInDatabase to authserver and worldserver to specify if IP addresses can be logged or not to the database
2021-07-28 11:44:24 +02:00
Giacomo Pozzoni
96dc110f4a Core/DBLayer: Add QueueSize() method (#26733)
* Core/DBLayer: Add QueueSize() method

Add QueueSize() method to database objects (Login, Character and World) that returns how many tasks are queued.
Include the queue size of the 3 databases in ".server debug" command

* Make the code less threadsafe

* Send data to InfluxDB

* Update grafana dashboard
2021-07-24 14:50:30 +02:00
Chaouki Dhib
d337fb99ed Core/Movement: Implement proper player speed change (#26561) 2021-06-15 23:09:48 +02:00
KoNicks
4b0089bf7d Core/Misc: Fix build when using libstdc++-11 (#26564) 2021-05-30 18:52:35 +02:00
Mikhail Redko
6c12f45f3b Core/Console: Improve ReadWinConsole logic and cosmetic changes (#26402)
* Core/Console: Improve ReadWinConsole logic and cosmetic changes

* Core/Console: Fixed possible appearance of weird characters in the console when printing the output of child processes

* Fix codestyle

* Removed auto

* Core/Misc: Explicit casting Difficulty values to uint8 before outputting to console

* Core/Misc: Cast Difficulty to uint32 for output to console

Co-authored-by: jackpoz <giacomopoz@gmail.com>
2021-05-11 09:55:57 +02:00
Mikhail Redko
1539bed3db Core/Misc: Fixed utf8 encoding in console input/output. (#26352)
* Core/Misc: Fixed utf8 encoding in console input/output.

* Fix gcc build

* Fixed that weird 'a' with circle above it and other similar letters. Also fixed encoding in AppenderConsole which sometimes did not work as it should

* Fix build on Linux

* Probably better to do it like this
2021-04-11 19:41:44 +02:00
illfated
23cd884f3b DB/Item: Remove Plans: Goblin Rocket Boots (7192) from loot & exclude from being sold by AHbot
Closes #25930
2021-01-24 15:10:04 +02:00
Kargatum
a32b6b8ac4 Core: whitespace cleanup, reduce double blank line to single (#25795)
* Core/Misc: fix double empty line

* worldserver.conf
2021-01-03 11:47:07 +01:00
Gildor
8217519ea2 Core/Visibility: Split BG/Arena visibility settings (#25690) 2020-12-26 23:30:16 +01:00
Shauren
155e37831e Dep/Boost: Partial support for boost 1.74 - asio
Ref #25470
2020-09-27 20:20:59 +02:00
Treeston
1eca51b417 [3.3.5] ChatCommands, the other half: chat command resolution refactor (PR #25463) 2020-09-20 02:50:38 +02:00
Treeston
75f9e7396e [3.3.5] Core/ChatCommands: Show error messages from argument parsers (PR #25443) 2020-09-12 19:42:10 +02:00
jackpoz
5498f3be96 Core/PathFinding: Enable pathfinding (MMaps) by default 2020-09-06 21:34:19 +02:00
Treeston
eaf8fa75a1 Core/Misc: Add support for custom link colors. Clean-up hyperlink validation, no more long-ass defines. Remove UI.ShowQuestLevelsInDialogs. 2020-09-02 22:01:51 +02:00
Jinnaix
812c2af4da Core/Misc: Update Worldserver.conf for AhBot Pricing -make things more clear (#25341)
* AhBot Pricing: Make things more clear

* Change default value to BuyPrice and add some more information to how two sided AH works

* Sync c++ configs with .conf ones

Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
2020-08-29 17:05:59 +02:00
Treeston
d717b9dc3e Core/Misc: Update worldserver.conf.dist to match actual defaults. 2020-08-21 12:13:38 +02:00
Treeston
a3971ca4b0 Core/Warden: More refactors lifted from #25286. 2020-08-20 17:56:10 +02:00
Shauren
39c5e03b74 Core/CrashHandler: #ifdef cleanup to make VS not choke when parsing, fixed file being all red in editor 2020-08-07 17:19:18 +02:00
Shauren
b3db50a3b4 Core/Misc: Fix compile errors found with msvc /permissive- 2020-08-04 15:42:08 +02:00
Treeston
3164b58c7d Core/Authserver: Re-organize the accounts table (PR #25135)
- no longer use sha_pass_hash for anything else core-side (.account, SOAP, RA)
- salt/verifier/session_key are now binary
- old s/v/sha_pass_hash fields kept around for backwards compatibility
- sha_pass_hash is still updated (for now), s/v are not
- sha_pass_hash is only read if s/v have been manually changed
- SRP6 b now uses the full 32 bytes of randomness (instead of randomly only using 19)
2020-08-02 22:52:21 +02:00
Giacomo Pozzoni
deceb11b5f Log sync db queries in World::Update() loop (#25174)
* Core/Misc: Log sync queries on critical path

* Fix build

* Rename

* Fix warning

* Fix no-pch

* Change WarnAboutSyncQueries() to be header-only
2020-07-30 21:42:27 +02:00
Shauren
2f0893d279 Core/Misc: Replace database query in WorldSession::HandleAddFriendOpcode with async version 2020-07-30 17:41:20 +02:00
Giacomo Pozzoni
8a2c79c850 Core/Metric: Log detailed metrics about each opcode handler (#25153)
* Core/Metric: Log detailed metrics about each opcode handler

* Add new panel to Performance profiling dashboard and use fill(0) instead of fill(none)

* Add new settings Metric.Threshold.* to be able to specify the minimum threshold for the specified metrics

* Update dashboard

* Change thresholds to be required to send the metrics. A TC_METRIC_DETAILED_TIMER metric with an expected threshold not configured will be ignored

* Use typedef Milliseconds

* Refresh realms on load
2020-07-28 14:27:54 +02:00
Giacomo Pozzoni
3c0ac7302f Core/Metric: Add more metrics about World::Update() loop (#25098)
* Core/Metric: Add more metrics about World::Update() loop

* Add new Performance profiling grafana dashboard

* Add new cmake setting WITHOUT_METRICS that disables all metrics

As new metrics are added, someone might want to disable them if unused.

* Add more metrics about World::Update() loop

* Remove old performance profiling features

Remove "server set difftime" command, "-RecordUpdateTimeDiffInterval" and "MinRecordUpdateTimeDiff" worldserver config settings and their related code.
The whole UpdateTime class could be removed too.

* Update and rename 2020_07_99_99_world.sql to 2020_07_24_00_world.sql
2020-07-24 00:30:16 +02:00
ipriver
a46d047f94 fixed indentation for cmake files 2020-06-24 14:42:02 +02:00
Peter Keresztes Schmidt
b210bb3713 Core/Misc: Replace Trinity::make_unique with std (#24869)
(cherry picked from commit bab5fd87a3)
2020-06-23 18:03:16 +02:00
Shauren
a9f9f737b2 Core/Misc: Properly close database connections when using --update-databases-only arg 2020-06-22 09:53:10 +02:00
ipriver
dc467ee0f6 Additional cmake entry for configs
Closes #24812

Co-authored-by: Carbenium <carbenium@outlook.com>
2020-06-19 15:06:03 +02:00
Max Drosdo.www
1e9c84a3ea Worldserver/CLI: console printf fix (#24802)
* Remove extra cli printf call for non-Windows systems

* Codestyle changes

Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
2020-06-17 22:14:27 +02:00
Giacomo Pozzoni
247564a7ab Core/Creature: Allow to disable HP regen in Raids even if the target is unreachable (#24646) 2020-05-21 14:48:09 +02:00
ForesterDev
e1a8ebc064 Core/PacketIO: updated SMSG_DURABILITY_DAMAGE_DEATH (#24442)
- use RATE_DURABILITY_LOSS_ON_DEATH for death from falling
- add note, that RATE_DURABILITY_LOSS_ON_DEATH doesn't change log message

(cherry picked from commit a1831e0c1e)

# Conflicts:
#	src/server/game/Entities/GameObject/GameObject.cpp
#	src/server/game/Entities/Player/Player.cpp
#	src/server/game/Entities/Unit/Unit.cpp
#	src/server/game/Server/Packets/GameObjectPackets.h
#	src/server/game/Server/Protocol/Opcodes.cpp

Co-authored-by: MitchesD <majklprofik@seznam.cz>
2020-04-14 14:00:53 +02:00
jackpoz
31018c3652 Core/Log: Log all character kicks to "network.kick" category 2020-04-08 21:05:01 +02:00
myuzhobcplidtkieno
ae553f8966 Added the ability to use TLS when connecting to a database. (#24348)
* Added the ability to use TLS when connecting to a database.

* Trying to kickstart CI checks

* Revert the kickstart change

Co-authored-by: myuzhobcplidtkieno <myuzhobcplidtkieno@github.com>
Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
2020-04-07 22:08:28 +02:00
jackpoz
caae3886d2 Core/Misc: Remove whitespace at the end of lines 2020-04-05 19:11:00 +02:00
Shauren
fe1003bdbd Core/DBLayer: Prevent using prepared statements on wrong database
(cherry picked from commit e8e89f58fb)

# Conflicts:
#	src/server/bnetserver/REST/LoginRESTService.cpp
#	src/server/bnetserver/Server/Session.cpp
#	src/server/database/Database/DatabaseWorkerPool.cpp
#	src/server/database/Database/Implementation/HotfixDatabase.h
#	src/server/database/Database/MySQLConnection.cpp
#	src/server/database/Database/MySQLConnection.h
#	src/server/database/Database/PreparedStatement.cpp
#	src/server/database/Database/PreparedStatement.h
#	src/server/database/Database/QueryHolder.cpp
#	src/server/database/Database/SQLOperation.h
#	src/server/database/Database/Transaction.h
#	src/server/game/Accounts/BattlenetAccountMgr.cpp
#	src/server/game/Achievements/AchievementMgr.cpp
#	src/server/game/AuctionHouse/AuctionHouseMgr.cpp
#	src/server/game/AuctionHouseBot/AuctionHouseBot.cpp
#	src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp
#	src/server/game/BattlePets/BattlePetMgr.cpp
#	src/server/game/Battlegrounds/ArenaTeam.cpp
#	src/server/game/BlackMarket/BlackMarketMgr.cpp
#	src/server/game/Chat/Channels/Channel.cpp
#	src/server/game/Entities/Corpse/Corpse.cpp
#	src/server/game/Entities/Creature/Creature.cpp
#	src/server/game/Entities/GameObject/GameObject.cpp
#	src/server/game/Entities/Item/Item.cpp
#	src/server/game/Entities/Pet/Pet.cpp
#	src/server/game/Entities/Player/CollectionMgr.cpp
#	src/server/game/Entities/Player/Player.cpp
#	src/server/game/Garrison/Garrison.cpp
#	src/server/game/Globals/ObjectMgr.cpp
#	src/server/game/Groups/Group.cpp
#	src/server/game/Guilds/Guild.cpp
#	src/server/game/Guilds/GuildFinderMgr.cpp
#	src/server/game/Guilds/GuildMgr.cpp
#	src/server/game/Handlers/AuctionHouseHandler.cpp
#	src/server/game/Handlers/CharacterHandler.cpp
#	src/server/game/Handlers/ItemHandler.cpp
#	src/server/game/Handlers/MailHandler.cpp
#	src/server/game/Handlers/MiscHandler.cpp
#	src/server/game/Handlers/PetitionsHandler.cpp
#	src/server/game/Handlers/SpellHandler.cpp
#	src/server/game/Handlers/TicketHandler.cpp
#	src/server/game/Loot/Loot.cpp
#	src/server/game/Mails/Mail.cpp
#	src/server/game/Maps/Map.cpp
#	src/server/game/Movement/Waypoints/WaypointManager.cpp
#	src/server/game/OutdoorPvP/OutdoorPvP.cpp
#	src/server/game/Pools/PoolMgr.cpp
#	src/server/game/Quests/QuestObjectiveCriteriaMgr.cpp
#	src/server/game/Reputation/ReputationMgr.cpp
#	src/server/game/Scenarios/InstanceScenario.cpp
#	src/server/game/Server/WorldSession.cpp
#	src/server/game/Server/WorldSocket.cpp
#	src/server/game/Spells/SpellHistory.cpp
#	src/server/game/Support/SupportMgr.cpp
#	src/server/game/Tools/PlayerDump.cpp
#	src/server/game/World/World.cpp
#	src/server/scripts/Commands/cs_account.cpp
#	src/server/scripts/Commands/cs_ban.cpp
#	src/server/scripts/Commands/cs_battlenet_account.cpp
#	src/server/scripts/Commands/cs_group.cpp
#	src/server/scripts/Commands/cs_lfg.cpp
#	src/server/scripts/Commands/cs_list.cpp
#	src/server/scripts/Commands/cs_message.cpp
#	src/server/scripts/Commands/cs_misc.cpp
#	src/server/scripts/Commands/cs_npc.cpp
#	src/server/scripts/Commands/cs_tele.cpp
#	src/server/scripts/Commands/cs_wp.cpp
#	src/server/shared/DataStores/DB2DatabaseLoader.cpp
#	src/server/shared/Realm/RealmList.cpp
2020-03-31 13:42:01 +00:00
Aokromes
ed93932537 New year
Say bye bye to every year changing dates
2020-01-02 06:25:50 +01:00
jackpoz
00703ee238 Core/Misc: Enable MaxCoreStuckTime setting by default
Enable MaxCoreStuckTime setting by default to force worldserver to exit in case of infinite loops.
Note that this will not affect existing setups with the setting MaxCoreStuckTime set to 0 in the local worldserver.conf .
2019-10-26 19:49:41 +02:00
Giacomo Pozzoni
fb059722fd Core/Calendar: Add some additional validation when creating events (#23797)
* Core/Calendar: Add some additional validation when creating events

Allow only 30 player events and 100 guild events to be created.
Don't allow to create guild events if player is not in guild.
Send some more error messages to the client (not blizzlike errors but better than nothing).

* Core/Calendar: Add some additional validation/checks

Add guild id check in GetPlayerEvents().
Change error message in HandleCalendarCopyEvent() to be the same as in HandleCalendarAddEvent() when creating an event in the past.

* Core/Calendar: Add some additional validation/checks

Reduce the number of CMSG_CALENDAR_ADD_EVENT packets a seconds allowed from 10 to 3.

* Core/Calendar: Add some additional validation/checks

Implement 5 seconds cooldown between the creation of calendar events

* Core/Calendar: Add some additional validation/checks

Don't allow to copy events of a different player/guild

* Core/Calendar: Implement automatic deletion of old events

Implement automatic deletion of events older than 1 month (30 days).
Fix debug assertion triggered when deleting a character with calendar events.
Avoid double std::set lookup when deleting events when deleting a character.

NB: The whole CalendarMgr/CalendarHandler code should be checked line by line for bugs/crashes/exploits.
2019-09-17 09:11:56 +02:00
Treeston
4211645834 [3.3.5] Core/Authserver: TOTP rewrite: (PR #23633)
- Proper management commands (.account 2fa)
- Secrets can now be encrypted (set TOTPTokenSecret in .conf)
- Secret now stored in binary
- Argon2 and AES primitives
- Base32/64 support
2019-08-10 21:34:51 +02:00
Treeston
a5e73e41c0 Core/Pooling: Quest pooling rewrite: (PR#23627)
- Split quest pooling from PoolMgr (into QuestPoolMgr)
- Proper saving/restoring on server restart
- No more hacking into sObjectMgr to insert/remove available quests
2019-08-04 12:22:57 +02:00
Treeston
fedf1f557b Core/Chat: Custom channel preservation rewrite. Channel data is now loaded at startup, and written to the DB periodically, instead of both things happening in real time. 2019-08-01 23:42:14 +02:00
Treeston
26440857c1 Core/Spawns: Exterminate CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY with extreme prejudice. (It didn't work anyway.) 2019-07-15 15:57:04 +02:00
Wyrserth
5707019256 Core/Player: apply LevelReq.Trade only to the player initiating a trade, aligning it with the other LevelReq.* config options. 2019-07-13 01:08:16 +02:00
Wyrserth
1bdbede7e0 Misc/Config: set decay timer for unlooted normal creatures to 5 minutes.
Now that respawns do not care about the previous corpse's state, there's no reason to force a very frustrating faster despawn.
2019-07-06 16:15:45 +02:00
Gooyeth
c30a27ef18 Core/Battleground: Implement previous opponent timer on Arena queue. (#21754) 2019-07-06 01:35:23 +02:00