Commit Graph

68 Commits

Author SHA1 Message Date
Chazy Chaz
d17a45ee7e Core/Misc: Update locales_creature_text to simple system 2017-05-04 16:46:53 +02:00
jackpoz
65aeeafad3 Core/Misc: Fix static analysis issues 2017-04-25 14:27:53 +02:00
ariel-
4c593f12ca Core/Instance: stop updating the instance resettimes based on creature respawns
- Rather update normal instance reset time to 2 hours after last creature kill
- This fixes yet another integer overflow due to the possibility of having time_t max showing up
- Also change respawntime and resettime fields to bigint on respawn/instance related tables
- Start using prepared statements on the InstanceSaveMgr
2017-04-12 02:19:55 -03:00
xinef1
9dc3de10f0 Core/Loot: implement Loot Item Storage (#19018)
* Created Item Loot Storage, no more synchronous DB selects
* Fixed buyback case, where stored loot was not removed from db
* Added Primary key, and changed field types to be unsigned for table item_loot_money
2017-04-11 22:22:50 -03:00
ariel-
affee140c6 Core/Database: Prepared statement parameter preallocation (#18999)
- Pass prepared statement size to the helper class to prevent runtime resizing.
- Rename CheckValidIndex -> AssertValidIndex
- Cached prepared size on the worker pool as it's shared among all connections
- Cached query data only for each connection, done lookup in map instead of possibly creating a new element
- Kill the prepared statement map, and store raw sql string on the MySQLPreparedStatement class
(This info is only used for logging, and there is no need of keeping a second container just for it)
2017-03-01 22:20:53 -03:00
Shauren
c2a36c9e89 Fixed clang segmentation fault in nopch mode
(cherry picked from commit 787adc24b2)
2017-01-30 17:22:01 +01:00
ariel-
60dd803bbe Core/Server: fix duplicated inserts into tutorials table for newly created characters 2017-01-29 14:00:19 -03:00
xinef1
b955456008 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
2017-01-28 01:00:28 -03:00
Shauren
d7b02a0624 Removed debug leftovers
(cherry picked from commit e8273b7b37)
2017-01-25 23:38:19 -03:00
Shauren
580f46693d Build fix
(cherry picked from commit 0314abc26a)
2017-01-25 23:38:16 -03:00
Shauren
4c27203c8f Core/DBLayer: Convert async queries to new query callbacks and remove old callback handling
(cherry picked from commit 8e2634b2b4)

Conflicts:
	src/server/bnetserver/Server/Session.cpp
	src/server/bnetserver/Server/Session.h
	src/server/database/Database/QueryCallback.cpp
	src/server/game/Handlers/CharacterHandler.cpp
	src/server/game/Handlers/SocialHandler.cpp
	src/server/game/Server/WorldSession.cpp
	src/server/game/Server/WorldSession.h
	src/server/game/Server/WorldSocket.cpp
	src/server/game/Server/WorldSocket.h
	src/server/game/World/World.cpp
	src/server/game/World/World.h
2017-01-25 23:38:13 -03:00
Shauren
8af3cccc83 Core/DBLayer: Refine new query callback for chaining
(cherry picked from commit 73e61fa652)
2017-01-25 23:38:10 -03:00
Shauren
b879a6cae5 Core/DBLayer: Added new async query callback api
(cherry picked from commit fcabeed754)
2017-01-25 23:38:07 -03:00
joschiwald
62b62ddd63 Core/Packets: updated some contactlist packets
(cherry picked from commit e01bb91887)

Conflicts:
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Entities/Player/Player.h
	src/server/game/Entities/Player/SocialMgr.cpp
	src/server/game/Entities/Player/SocialMgr.h
	src/server/game/Handlers/MiscHandler.cpp
	src/server/game/Server/Packets/MiscPackets.cpp
	src/server/game/Server/Protocol/Opcodes.cpp
	src/server/game/Server/Protocol/Opcodes.h
	src/server/game/Server/WorldSession.cpp
	src/server/game/Server/WorldSession.h
	src/server/shared/Database/Implementation/CharacterDatabase.cpp
	src/server/shared/Database/Implementation/CharacterDatabase.h
2017-01-25 23:36:24 -03:00
ariel-
f7f865f818 Core/Scripts: added command to move characters across accounts 2017-01-06 02:34:52 -03:00
tkrokli
6a51a88767 Update Copyright notice for 2017
Happy new year!
2017-01-02 19:52:45 +01:00
myran2
6c21ddd9b9 Core/Pets: Use prepared statements in Pet::SavePetToDB
Very partial cherry pick
(cherry picked from commit bc1a81747a)
2016-12-15 08:43:10 -03:00
ariel-
e84dfff4ce Core/Auras: don't save auras casted by items
- Drop useless field from DB (itemGuid was being saved, but never used, see Prepared Statements)
- This type of auras (like Water Bucket, Precious Ribbon, etc) will be recasted on login anyways.

This reverts commit 16cfd59f5b
2016-10-30 07:31:42 -03:00
ariel-
66688a7855 Core/Channel: revamp channel system (#17980)
* Core/Channel: change the way channels are stored and sent to client.

- Fixes multiple channels per zone when using different locales
- Connected clients will receive locally the name of the channel for their apropiate locale (if available)
- In other cases default locale name will be sent, so as to prevent breaking channel chat for those players

Closes #8411
2016-10-07 00:59:56 -03:00
joschiwald
ec221c5500 Core/Auth: removed unneeded sub query 2016-09-25 18:06:01 +02:00
SnapperRy
6f1e823cac Core/Fishing: implement retail-like fishing skill-up functionality (#17528) 2016-09-13 04:16:05 +02:00
joschiwald
f5890941b1 Core/Logging: delete old logs of the own realm only
(cherry picked from commit beedf737c8)
2016-08-27 15:28:33 +02:00
ariel-
fbfcfe4c1d Core/Globals: delete another synch query using CharacterInfo map 2016-08-18 01:45:44 -03:00
jackpoz
7616f796d0 Server/Database: Reduce differences between 3.3.5 and 6.x branches
Code functionality shouldn't have been modified.
2016-08-10 16:57:21 +02:00
jackpoz
abe37e458c Server/Database: Reduce differences between 3.3.5 and 6.x branches
Cherry-pick 1bea52fd46 and 543bea32 to add support to TYPE_BINARY MySQL field type
2016-08-10 16:02:22 +02:00
ForesterDev
6a87524204 Core\Command: remove account_muted data on account deletion 2016-08-04 17:24:41 +04:00
ariel-
1a52c1cd36 Core/Misc: remove two synch queries and replace them with CharacterInfo cache 2016-07-16 20:51:32 -03:00
Aokromes
90cff479ac Core/Misc: Better description for a log 2016-07-02 19:53:38 +02:00
psayafan
fe2aed6047 Core/Player: Add option to prevent rename during character customization
Closes #17420
2016-06-23 21:31:09 +02:00
Aokromes
862d068cde * DB/Graveyards: Added a comment field to describe the graveyards in graveyard_zone 2016-05-25 19:08:52 +02:00
Naios
d4d199d765 Core/Common: Move the query callback header to the database project
* Also renames the header to it's correct name QueryCallback
2016-05-10 18:16:13 +02:00
Shauren
40b0f03d5c Core/Misc: Fixed warnings found by GCC 6
(cherry picked from commit 67fd3ee726)

# Conflicts:
#	src/server/game/Spells/Auras/SpellAuras.cpp
2016-04-28 16:21:20 +01:00
Shauren
39abb8acb3 Core/Misc: MSVC warning fixes
(cherry picked from commit 70412e7e25)
2016-04-09 18:13:30 +02:00
Naios
205556b226 Core/Database: Converted the database library to a shared library.
* There is still the possibility to static link against database.

(cherry picked from commit 6cfea2d8f7)
2016-03-24 02:46:01 +01:00
Shauren
1925778e44 Core/Players: Split playerBytes fields in characters table
(cherry picked from commit 2a6f65fddc)
2016-03-13 20:18:05 +01:00
Shauren
2a37266269 Core/Auth: Fixed login for accounts with accented characters
Closes #16770
2016-03-12 21:22:16 +01:00
Naios
3a4ec8bcbe Core/Database: Move singleton instances into compilation units
* Fixes issues when building shared libraries
  (prevents gcc and clang from providing several instance)
* Also instantiate the database worker pools in DatabaseEnv.cpp now.

(cherry picked from commit a8fe7f6eb7)
2016-03-11 19:51:07 +01:00
Naios
62815c6e1c Core/Database: Use RAII for resource management in MySQLConnection
* Prevents double deletion of MySQLConnection after errors
* The object stays valid after an error and will wait for a reconnect
* Also crash the server if 5 reconnects fail
* Corrects an issue where the server was crashed after one reconnect
  because mysql_thread_id was invoked with an invalid handle
2016-03-03 01:19:58 +01:00
Naios
09fa0ab46a Core/Database: Move DatabaseWorkerPool into it's own translation unit 2016-03-03 01:06:13 +01:00
Naios
5ed0180994 Core/Database: Use RAII instead of raw pointers for resource management
* Corrects dirty usage of vectors with array indexes
* Removes _connectionCount which is now handled through the vector size
* Rename magic identifier "t" to "connection"
2016-03-03 01:06:13 +01:00
Naios
7d3cffc297 Core/Database: Close the databases correctly when the DBUpdater fails
* Also fixes a memory leak spotted by Aokromes
2016-03-03 01:06:13 +01:00
Shauren
dfbb3bec56 Core/Auth: Moved expiring bans to background task - no longer blocking queries during login by default running every minute (configurable) 2016-02-15 19:38:53 +01:00
Shauren
5bf90b3338 Core/Auth: Performance/security improvements
* Changed all db queries to async
* Added buffer length checks
* Only allow one challenge/proof packet per socket lifetime

Closes #13217
Closes #16602
2016-02-14 18:41:25 +01:00
treeston
6102a7937d Maps/Instances: Implement handling of CMSG_SET_SAVED_INSTANCE_EXTEND 2016-02-10 19:35:11 +01:00
Rushor
923a368ac7 Update copyright note for 2016 2016-01-01 12:02:33 +01:00
jackpoz
5b8b32dac7 Core/Quest: Fix issues reported by static analysis 2015-12-07 20:55:33 +01:00
Shauren
7631ec444e Core/DBLayer: Improve error message from 0a27f8bce2
(cherry picked from commit d31706b07e)
2015-11-14 13:54:36 +01:00
Shauren
536365a70f Fix build for mysql versions older than 5.7
(cherry picked from commit 5604aed5f1)
2015-11-13 09:28:14 +01:00
Shauren
9bc5088a81 Core/DBLayer: Ensure that MySQL version used when compiling is the same as libmysql.dll version used for running the server.
Ref #15848

(cherry picked from commit 0a27f8bce2)
2015-11-12 17:55:10 +01:00
Vincent-Michael
ff9001ce1d Updated url for tc wiki
(cherry picked from commit 6d01960448)
2015-11-07 19:35:24 +01:00