Commit Graph

124 Commits

Author SHA1 Message Date
Jeremy
1ef0c04520 Core/Battlegrounds: Clean up some Team/TeamId parameters to use enums instead of raw integer types (#29535)
* Fix criteria data type bg loss team score
2023-12-29 14:12:15 +01:00
Shauren
b4778a4d72 Core/PacketIO: Fixed server time sent in CalendarRaidLockoutAdded 2023-12-02 16:03:50 +01:00
Shauren
7e76e91152 Core/Misc: Kill another synchronous db query in packet handlers 2023-11-27 18:36:34 +01:00
Shauren
b888b1b09f Core/Calendar: Implement different timezone support for ingame calendar
Closes #8390
Closes #29427
2023-11-21 12:25:22 +01:00
Shauren
1eea1d11b1 Core: Update to 10.2.0 2023-11-09 13:33:26 +01:00
Shauren
d791afae1d Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api) 2023-01-08 21:16:53 +01:00
Shauren
9b924522d0 Core/Instances: Delete InstanceSaveMgr and replace most of its uses with new InstanceLockMgr 2022-10-04 00:19:38 +02:00
Shauren
17665c929c Core/Instances: Instance lock rewrite (WIP) 2022-10-04 00:19:38 +02:00
Mikhail Redko
9e6def8ae2 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>
(cherry picked from commit 6c12f45f3b)
2022-03-09 14:55:18 +01:00
Shauren
ad4f4bfab7 Core/Misc: Minor game include cleanup 2022-02-13 00:49:10 +01:00
Shauren
0d3235f569 Core/Guilds: Separate guild rank id from guild rank order
Co-authored-by: aquadeus <efectokoleos13@gmail.com>
2022-01-09 23:12:00 +01:00
Giacomo Pozzoni
562c567b1e 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.
(cherry picked from commit fb059722fd)
2021-12-18 22:19:05 +01:00
jackpoz
5600316c9f Core/Calendar: Improve calendar timezone handling
Improve calendar timezone handling by at least creating events with the correct time if both client and server are in the same timezone. There is currently no information received from the client about in which timezone it is.

(cherry picked from commit b33934f6ce)
2021-12-01 00:46:05 +01:00
jackpoz
e17e4e6f07 Core/Misc: Replace time(NULL) with GameTime::GetGameTime()
(cherry picked from commit 12701cb0c6)

 Conflicts:
	src/server/game/Achievements/AchievementMgr.cpp
	src/server/game/AuctionHouse/AuctionHouseMgr.cpp
	src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp
	src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
	src/server/game/Battlefield/Battlefield.cpp
	src/server/game/Battlefield/Zones/BattlefieldWG.cpp
	src/server/game/Battlegrounds/BattlegroundMgr.cpp
	src/server/game/Calendar/CalendarMgr.h
	src/server/game/DungeonFinding/LFGQueue.cpp
	src/server/game/Entities/Corpse/Corpse.cpp
	src/server/game/Entities/Creature/Creature.cpp
	src/server/game/Entities/Item/Item.cpp
	src/server/game/Entities/Pet/Pet.cpp
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Entities/Unit/Unit.cpp
	src/server/game/Globals/ObjectMgr.cpp
	src/server/game/Grids/ObjectGridLoader.cpp
	src/server/game/Guilds/Guild.cpp
	src/server/game/Handlers/AuctionHouseHandler.cpp
	src/server/game/Handlers/BattlefieldHandler.cpp
	src/server/game/Handlers/CalendarHandler.cpp
	src/server/game/Handlers/CharacterHandler.cpp
	src/server/game/Handlers/ChatHandler.cpp
	src/server/game/Handlers/LFGHandler.cpp
	src/server/game/Handlers/MailHandler.cpp
	src/server/game/Handlers/MiscHandler.cpp
	src/server/game/Handlers/MovementHandler.cpp
	src/server/game/Handlers/PetHandler.cpp
	src/server/game/Handlers/QueryHandler.cpp
	src/server/game/Handlers/TicketHandler.cpp
	src/server/game/Instances/InstanceSaveMgr.cpp
	src/server/game/Server/WorldSession.cpp
	src/server/game/Server/WorldSocket.cpp
	src/server/game/Spells/Auras/SpellAuras.cpp
	src/server/game/Tickets/TicketMgr.cpp
	src/server/game/Tickets/TicketMgr.h
	src/server/game/World/World.cpp
	src/server/scripts/Commands/cs_gobject.cpp
	src/server/scripts/Commands/cs_instance.cpp
	src/server/scripts/Commands/cs_list.cpp
	src/server/scripts/Northrend/zone_wintergrasp.cpp
	src/server/scripts/Spells/spell_item.cpp
2021-04-15 05:53:27 +02:00
Shauren
cab4c87d2d Core/PacketIO: Updated most packet structures to 9.0.1 2020-12-08 18:16:41 +01:00
Shauren
1c52d5fff7 Core/Misc: Replace NULL with nullptr 2020-08-14 17:06:03 +02:00
Shauren
ec08296570 Fix nopch build 2020-02-18 17:37:01 +01:00
Shauren
90628b7d29 Core/DataStores: Updated db2 structures to 8.3.0 2020-02-17 23:58:47 +01:00
Aokromes
b0bf1275ee New Year 2020-01-02 06:44:10 +01:00
Shauren
f6e2b8cdc1 Core/DBLayer: Prevent committing transactions started on a different database 2019-07-27 10:52:33 +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
0a779bd791 Core/PacketIO: Updated packet structures to 8.0.1 2018-11-05 00:00:34 +01:00
Shauren
ee682544d0 Core/PacketIO: Updated opcode enum to 8.0 2018-10-01 21:01:10 +02:00
Shauren
738f37d3cf Core/Maps: Replaced spawnmask with difficulty list 2018-09-15 17:55:26 +02:00
vincent-michael
7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00
Shauren
3d7c2ef88f Core/Game: Include cleanup, part 4 - packets and largest headers (after preprocessing, except player/objectmgr) 2017-05-21 23:18:43 +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
vincent-michael
86b98686a9 Update copyright note for 2017
Happy new year
2017-01-01 16:23:13 +01:00
Shauren
7398b2383e Core/PacketIO: Updated calendar, bg, battle pet and bmah packet structures 2016-06-15 22:44:31 +02:00
Shauren
4e67383621 Merge branch '3.3.5-instanceextend' into 3.3.5 (PR #16392)
(cherry picked from commit 62aff401f6)
2016-04-05 20:35:59 +02:00
Shauren
fc49833fa6 Add missing changes 2016-02-25 23:20:54 +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
Shauren
0d9fe2222b Core/PacketIO: Updated and enabled CMSG_CALENDAR_COMPLAIN 2015-12-14 20:21:17 +01:00
Gacko
ceda5b6169 CalendarHandler: Fix warning. 2015-08-05 10:47:16 +02:00
Shauren
3604025bb7 Core/PacketIO: Added utility packet array class to handle loop counter limiting in packets received from the client 2015-07-29 00:04:37 +02:00
Golrag
83c2d36179 Core/PacketIO: CalendarPackets:
CMSG_CALENDAR_GET
CMSG_CALENDAR_GET_EVENT
CMSG_CALENDAR_GUILD_FILTER
CMSG_CALENDAR_ADD_EVENT
CMSG_CALENDAR_UPDATE_EVENT
CMSG_CALENDAR_REMOVE_EVENT
CMSG_CALENDAR_COPY_EVENT
CMSG_CALENDAR_GET_NUM_PENDING
CMSG_CALENDAR_EVENT_SIGN_UP
CMSG_CALENDAR_REMOVE_INVITE
CMSG_CALENDAR_EVENT_STATUS
CMSG_SET_SAVED_INSTANCE_EXTEND
CMSG_CALENDAR_EVENT_MODERATOR_STATUS

SMSG_CALENDAR_EVENT_INVITE
SMSG_CALENDAR_SEND_CALENDAR
SMSG_CALENDAR_SEND_EVENT
SMSG_CALENDAR_EVENT_INVITE_ALERT
SMSG_CALENDAR_EVENT_INVITE_STATUS
SMSG_CALENDAR_EVENT_INVITE_REMOVED
SMSG_CALENDAR_EVENT_INVITE_MODERATOR_STATUS
SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT
SMSG_CALENDAR_CLEAR_PENDING_ACTION
SMSG_CALENDAR_EVENT_UPDATED_ALERT
SMSG_CALENDAR_EVENT_REMOVED_ALERT
SMSG_CALENDAR_SEND_NUM_PENDING
SMSG_CALENDAR_COMMAND_RESULT
SMSG_CALENDAR_RAID_LOCKOUT_UPDATED
SMSG_CALENDAR_EVENT_INITIAL_INVITES
SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT // NYI
SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT // NYI
SMSG_CALENDAR_EVENT_INVITE_NOTES // NYI
2015-07-28 12:57:56 +02:00
Vincent-Michael
2e586bc520 Core: Header cleanup in game/*/*.cpp 2015-07-25 20:18:42 +02:00
Shauren
21df17fd47 Core/Misc: Removed ReadAsPacked/WriteAsPacked methods from ObjectGuid, they are not needed anymore as guids are always written packed 2015-07-25 10:38:45 +02:00
Shauren
5389180778 Core/PacketIO: Updated all client opcode values 2015-04-01 01:44:10 +02:00
Epicurus4
3b364bc580 Core/PacketIO: Sync with wpp 2015-03-01 10:30:32 -05:00
Shauren
68fceee10e Core/Spells: Removed leftovers of old cooldown handling
* Use ItemEffect.db2 data directly instead of copying it to another structure
2015-02-21 13:08:33 +01:00
joschiwald
36e50ff8ae Core/Opcodes: sync with wpp 2015-01-17 03:55:29 +01:00
Shauren
faa583c784 Core/Maps: Updated map difficulties 2015-01-10 01:35:47 +01:00
Vincent-Michael
ab90f74486 Update copyright note for 2015
Happy new year
2015-01-01 00:28:09 +01:00
Intel
a7f56c2208 Core/DataStores: Updated GameObjectDisplayInfo.dbc, GemProperties.dbc, GlyphProperties.dbc, GlyphSlot.dbc, GuildPerkSpells.dbc structs 2014-11-08 20:21:17 +02:00
Shauren
15fbb6f46f Core/Entites: Updated GUID format 2014-10-29 21:13:21 +01:00
Shauren
7afab9f783 Core/Entities: Updated HighGuid values 2014-10-27 12:03:35 +01:00