245 Commits

Author SHA1 Message Date
Shauren
3d8a75b0b5 Core/Misc: Reduce differences between branches 2025-10-04 15:05:17 +02:00
Shauren
ff6df050c5 Core/Misc: Remove boost/algorithm dependency 2025-06-08 14:37:54 +02:00
Shauren
7cbbe2c781 Core/Chat: Remove fmt::sprintf from headers 2025-06-05 15:28:11 +02:00
Shauren
c4b710446d Core/Realms: Realmlist refactors
* Removed global realm variable from World and use RealmList everywhere
* Match auth build key with client version
* Restored allowedSecurityLevel checks for realmlist packet building
* Restored updating population field, mysteriously removed 15 years ago in f20b25d1c9
2024-08-18 18:59:58 +02:00
Shauren
3260b94dd6 Core/Misc: Replace string to int conversion functions from Common.h with c++17 std::from_chars based ones Trinity::StringTo 2023-05-13 15:46:27 +02:00
Treeston
57f382d91c Game/ChatCommands: Make sure ChatHandler::extractPlayerTarget populates the strtok buffer for non-nullptr returns. Closes #25692, supersedes #25698.
(cherry picked from commit c8c572d980)
2022-03-05 01:02:18 +01:00
Treeston
3fd2eb126c [3.3.5] ChatCommands, the other half: chat command resolution refactor (PR #25463)
(cherry picked from commit 1eca51b417)
2022-02-27 20:08:41 +01:00
Shauren
f8ad7017dd Core/Misc: Move (or delete) constructors and destructors to .cpp files (avoids compiling them in every file that includes them) 2022-02-12 21:36:46 +01:00
Shauren
d057e057d3 Core/Misc: Optimize ChatCommand includes (include only where neccessary) 2022-02-11 21:57:45 +01:00
Treeston
378691aaa2 [3.3.5] Core/ChatCommands: Show error messages from argument parsers (PR #25443)
(cherry picked from commit 75f9e7396e)
2022-02-05 23:42:15 +01:00
Treeston
42be7836df Chat/Commands: Eradicate ChatHandler::extractOptFirstArg
(cherry picked from commit 4f636b80e4)
2022-02-05 16:21:54 +01:00
Treeston
706163743d [3.3.5] Scripts/Commands: .arena command conversion (PR #25407)
(cherry picked from commit b63d655e20)
2022-02-05 13:57:50 +01:00
Treeston
a65e7e0213 Scripts/Commands: Fix a crash in .help - closes #25360
(cherry picked from commit 944f49d613)
2022-02-04 21:21:40 +01:00
Treeston
9f97fdd31a Core/Common: Tokenizer -> Trinity::Tokenize (PR: #25327)
(cherry picked from commit 534a2388b7)
2022-02-04 00:27:14 +01:00
Shauren
6d9a084036 Core/Commands: Initialize commands on startup instead of first use
(cherry picked from commit 0fc7b50c04)
2022-01-24 14:46:14 +01:00
Heaven31415
0ea3fe545c Refactor SendSysMessage, SendGlobalSysMessage, SendGlobalGMSysMessage (#23029)
(cherry picked from commit 9db50f05cb)
2021-11-23 23:07:23 +01:00
Treeston
e506c80a64 Core/Chat: Unify chat hyperlink parsing (PR #22417)
- Validate most link properties all the time
- If enabled, also validate link text (needs locale)
- Instead of blocking the entire message, sanitize it
- Apply filtering to DND/AFK messages. Closes #22399

(cherry picked from commit f27284594b)
2021-10-31 01:39:04 +02:00
Treeston
0c681b6509 Scripts/Commands: New argument parsing methodology (PR #22363)
- Detect the arguments accepted by the command handler
- Tokenize out those arguments automatically and feed them to the handler
- Unmatched rest of the string can be accepted by trailing char const* or CommandArgs*

(cherry picked from commit 66a87c4642)
2021-10-25 00:03:23 +02:00
Treeston
42c65c3bc2 Core/Chat: Provide a fully-formed protocol for addons to interact with GM commands (#20074)
Send success/fail state, allow interleaving, and indicate end of output. Add framework for supporting non-human-readable output in commands.

(cherry picked from commit 508c9d2fc1)
2020-08-20 00:49:52 +02:00
Shauren
deca201f77 Core/DataStores: Simplified string memory allocation in db2 files, dropped unneccessary level of indirection 2020-06-27 13:33:17 +02:00
jackpoz
6611211d31 Core/Misc: Fix static analysis issues
(cherry picked from commit 65aeeafad3)
2020-04-28 13:43:40 +02:00
Aokromes
b0bf1275ee New Year 2020-01-02 06:44:10 +01:00
Shauren
e8e89f58fb Core/DBLayer: Prevent using prepared statements on wrong database 2019-07-27 01:00:37 +02:00
xinef1
ad4e63bae1 Core/Misc: Moved CharacterInfo out of world to separate class
Closes #19030

(cherrypicked from 59ce3d6c9b)
2019-07-21 21:06:54 +02:00
ariel-
b742c87222 Core: add some missing Player Name normalization on input data
(cherrypicked from 6f9e8b6c91)
2019-07-21 21:06:54 +02:00
xinef1
b485f3e673 Few small optimizations here and there (#18684)
Changes list:
- Added CharacterGuidByNameContainer which contains name -> guid unordered map (updated along CharacterInfo)
- Extended CharacterInfo structure with GuildId
- Extended CharacterInfo structure with ArenaTeamId[3], for all possible teams (2v2, 3v3, 5v5)
- Removed CHAR_SEL_GUID_BY_NAME and CHAR_SEL_CHAR_GUID_BY_NAME synchronous queries, name -> guid can be now retrieved in World::GetCharacterGuidByName
- Removed CHAR_SEL_GUID_RACE_ACC_BY_NAME synchronous query, guid can be retrieved by name and rest of the data can be retrieved by guid
- Removed CHAR_SEL_CHAR_LEVEL synchronous query, level can be retrieved by guid
- Changed CHAR_SEL_CHARACTER_ACTIONS_SPEC to asynchronous query, action bars are now loaded asynchronously
- Removed CHAR_SEL_CHARACTER_NAME_CLASS synchronous query, guid can be retrieved by name and rest of the data can be retrieved by guid
- Removed CHAR_SEL_PLAYER_ARENA_TEAMS and CHAR_SEL_ARENA_TEAM_ID_BY_PLAYER_GUID synchronous queries, arena teams are now stored in CharacterInfo
- Replaced synchronous db calls with CharacterInfo lookups
- Removed ObjectMgr::GetPlayerGUIDByName, as it used db query
- Replaced some unnecessary UpdateObjectVisibility() calls because they were either duplicated (called few lines above in other function) or it is enough to call DestroyForNearbyPlayers because object is being removed or should be invisible and DestroyForNearbyPlayers is faster
- Corrected typo in Player::DestroyForPlayer, only items in slots 0 to EQUIPMENT_SLOT_END are sent to other players
- Renamed Player::GetGuildIdFromDB to Player::GetGuildIdFromCharacterInfo and changed the function to use CharacterInfo structure
- Renamed Player::GetArenaTeamIdFromDB to Player::GetArenaTeamIdFromCharacterInfo and changed the function to use CharacterInfo structure
- Renamed Player::GetLevelFromDB to Player::GetLevelFromCharacterInfo and changed the function to use CharacterInfo structure
- Removed GameEventMgr::_questToEventLinks and associated functions, eventId is now stored in Quest class under _eventIdForQuest variable
- Changed some functions checking quest status to use other functions for quest status check instead of duplicating code
- Removed callback from add friend, because we can get the guid from appropriate storage, no need to make db query
- Removed callback from add ignore, because we can get the guid from appropriate storage, no need to make db query
- Added callback to unwrap wrapped items asynchronously
- Removed synchronous select in tutorials to check if we have any entries in db, if any entry exists in db, m_TutorialsChanged variable will have TUTORIALS_FLAG_LOADED_FROM_DB flag added and it is no longer necessary to query database

(cherrypicked from b955456008)
2019-07-21 21:06:54 +02:00
vincent-michael
5620eb9463 Update copyright note for 2019
auto happy = new year(2019);
2019-01-01 10:14:33 +01:00
Shauren
5bfb1cc960 Core/Chat: Updated quest chat link format 2018-11-12 23:27:28 +01:00
Shauren
91be2332e2 Core/Entities: Phasing rewrite
* Optimized phase visibility checking
* Handle all phase flags

Closes #16758
Closes #21119
2018-03-25 19:28:36 +03:00
ariel-
6d060bbea8 Core/Chat: fix RBAC_PERM_COMMANDS_NOTIFY_COMMAND_NOT_FOUND_ERROR for subcommands
Ref #18463
(cherry picked from commit eb376f4b7e)
2018-03-12 16:39:42 +01:00
vincent-michael
7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00
Shauren
b453e12423 Core/Game: Include cleanup part 5
* ObjectMgr.h
* Player.h
* Unit.h
* G3D should no longer propagate everywhere from Spline/MotionMaster
2017-06-04 01:00:45 +02:00
Shauren
f2039981e0 Core/Game: Include cleanup, part 3 2017-05-20 00:09:37 +02:00
Shauren
c5d3dd90be Core/Game: Include cleanup
* Mostly aimed at removing Log/DatabaseEnv includes from other headers
* Fix most packet headers including other packet headers - moved common structures such as ItemInstance to their own files
* Moved SAI function definitions to source files (massive or requiring many different dependencies)
2017-05-18 23:53:25 +02:00
Shauren
9299e9bde0 Core/Grids: Ported cmangos/mangos-wotlk@ea99457e50 2017-05-13 19:37:33 +02:00
Shauren
beb3316089 Core/Shared: Include cleanup 2017-05-13 11:49:09 +02:00
Rochet2
80cf4e3070 * Scripts/Commands: Fix guid usage and enhance commands
- Fix targeting gameobjects and creatures for .dist and .gps. The old code used DB guid to search from core generated guid lists.
- Fix some error messages saying 'no player found' even if creatures and gameobjects and players were searched
- Change atoi to atoul when receiving lowguids as string or other uint32 values
- Use ObjectGuid::LowType instead of uint32 for lowguid type
- Allow .gob info to take in gameobject guid link as well as entry link in addition to gameobject entry and update the documentation of the command
- Change .gob delete to post the spawnid (dbguid) instead of the ingame generated guid (which is basically never seen or used by the player in any other commands that I see)
- Allow spawntimesecs to be negative when spawning a gameobject
- Disable searching by ingame spawn id in commands. (it makes little sense for a user to provide a number which is then attempted to be used as DB guid and non DB guid when both could have a match)
- Update .gob turn documentation to tell about possibility to provide orientation in command
- Correct the types in .gob add command result trinity_string
- Correct the creature search for .npc del
- Change .event to .event info
- Add .go offset command
- Remove the .go command for empty string (no subcommand given) because it just used .go xyz
- Extend .gob info to show size, faction, flags and model dimensions
- Remove some unnecessary casts
- Document .wp show better (first and last were not documented)
- Insert spawnid to .wp show info error message
- Fix spawntime printing for .gobject target
- Fix guid targetting for .npc set movetype
- Fix query by spawnid for .wp show info
- Fix deleting of existing waypoints when twice doing the command .wp show on
- Fix deleting of existing waypoints when doing the command .wp show off
- Change wpguid column in DB and in core to uint32, which is what the spawnid type is in core and db.

Closes #18978
2017-03-11 12:29:37 +01:00
vincent-michael
86b98686a9 Update copyright note for 2017
Happy new year
2017-01-01 16:23:13 +01:00
ariel-
59a9bc5ca0 Core/Channels: Revamp of channel system
* Core/Chat: general cleanup and revamping: (#17576) (fbbb03212e)
* Core/Channel: restore accidentally deleted line, fixes channels not honoring ownership setting (7c71417993)
* Channel Followup: avoid setting an invisible gm as Channel owner (#17597) (8a8362ef15)
* Core/Channel: change the way channels are stored and sent to client, fixes multiple channels per zone when using different locales (#17980)
2016-10-07 01:09:28 -03:00
Shauren
885d9b53c3 Core/DataStores: Updated dbc/db2 to 7.0.1.20994 2016-05-20 23:48:48 +02:00
Naios
9cc97f226d Core/Game: Rewrote the ScriptMgr to support script reloading.
* Finally this commit enables dynamic script hotswapping
  and finished the PR #15671.
* Split the storage layout to use optimized storages
  for database bound and unbound scripts.
* Add several unload workers to reload scripts correctly
  -> Requires further investigation.
* Fixes memory leaks in ScriptMgr when dropping invalid scripts.
* Fixes VehicleScripts
* Makes OutdoorPvP scripts reloadable
* Makes InstanceMapScripts reloadable
* Makes CommandScripts reloadable
2016-04-11 21:14:00 +02:00
Aokromes
d4146a23ac Merge pull request #16038 from tkrokli/grammar_and_spelling_corrections_335
[3.3.5] Core/Logs: English text corrections
(cherry picked from commit 4cd937140b)
2016-04-08 19:48:58 +02:00
Shauren
db0b8bf24e Core/Maps: Changed the way area data is stored in maps, it now uses ID field from AreaTable.dbc instead AreaBit used for exploration marker (and is not unique anymore on top of simply being stupidly confusing)
Note: Extracting maps is required
2016-02-02 19:13:04 +01:00
Vincent-Michael
478cc756eb Update copyright note for 2016
Happy new year (Again new year with idiots ...)
2016-01-01 00:34:25 +01:00
jackpoz
ec3bba64f0 Core/Commands: Fix NULL dereference crash
Closes #15833

(cherry picked from commit abd4e2e0f1)
2015-11-10 21:27:50 +01:00
Shauren
2d942ddcc5 Core/Commands: Refactored chat command script hook, fixes a crash when building with gcc 5
Closes #15616
Closes #15740
2015-10-22 20:26:56 +02:00
Shauren
63def8aa32 Core/Battle.net:
* Changed packet structures to mirror client names
* Simplified ToString Building
* Removed deprecated structures

World: Cleaned up duplicate realm info 'realm' and 'realmHandle' variables (realmHandle was removed, that data is fully contained in realm)
2015-10-06 00:30:47 +02:00
joschiwald
cf1e80e3d0 Core/Misc: removed some useless map checks 2015-10-04 14:53:05 +02:00
jackpoz
ee7039e845 Core/Chat: Allow to sanitize | characters when sending messages to clients
Add an optional parameter "escapeCharacters" to ChatHandler::SendSysMessage() to properly escape | character, otherwise it might freeze the client.

(cherry picked from commit 7c91984a64)
2015-09-24 23:42:23 +02:00
Vincent-Michael
2e586bc520 Core: Header cleanup in game/*/*.cpp 2015-07-25 20:18:42 +02:00