Commit Graph

35 Commits

Author SHA1 Message Date
Shauren
af4ac778d7 Core/Quests: Implemented quest flag forcing the player to be flagged for PvP as long as the quest is in his log. 2013-02-26 17:14:13 +01:00
Spp
0c2402df95 Core/RBAC: Create new permissions 'See two side who list', 'Add friends of other faction', 'See all levels with who command' and 'Allows to add a gm to friend list' 2013-02-25 15:48:19 +01:00
Spp
ea2e6052b2 Core/RBAC: Create new permissions 'Allow to use CMSG_WORLD_TELEPORT opcode' and 'Allow to use CMSG_WHOIS opcode' 2013-02-25 15:48:18 +01:00
Shauren
59c3c6b8a6 Core/Players: Allow players to log out in combat when they are in resting area (logout in rest area is instant by default, but not when in combat) 2013-02-20 20:52:58 +01:00
Machiavelli
01fbbf3b93 Core/Vehicles: Refactor some parts of vehicle system
- Fix a few crashes:
Closes #9235
- Simplify and get rid of lots of redundant and silly code
- Optimisations in Unit::ChangeSeat
- More documentation
2013-02-18 00:39:58 +01:00
Spp
b980aff83e Core: Implement Role based Access Control
- This system will give more control of actions an account can perform.

System defines:
- Permissions to perform some action
- Roles: a set of permissions that have some relation
- Groups: a set of roles that have some relation

Operations:
- Grant: Assign and allow
- Deny: Assign and do not allow
- Revoke: Remove

Precedence to know if something can be done: Grant, Deny. That means, if you are granted some action by a role but you have denied the permission, the action can not be done.

Some Rules:
- Groups can only have roles
- Roles can only have permissions
- An account can be assigned granted and denied roles. Permissions inherited from roles are granted if roles is granted and denied if roles is denied
- An account can be assigned granted and denied permissions
- An account can have multiple groups, roles and permissions
- An account can not have same role granted and denied at same time
- An acconnt can not have same permission granted and denied at same time
- Id 0 can not be used to define a group, role or permission

Added some permissions as a sample of use (Instant Logout, Skip Queue, Join BGs, Join DF) and some permissions as a workaround to commands till command system is modified to use RBAC
2013-02-04 09:04:33 +01:00
Spp
fa5dd4bd4e Core/Misc: Remove some calls to const_cast 2013-01-30 08:39:06 +01:00
Spp
cc605e0605 Core/Misc: Minor cosmetic changes here and there 2013-01-24 16:57:35 +01:00
Spp
802657250c Core/Misc: Apply codestyle to multiple files 2013-01-14 09:50:59 +01:00
Vincent_Michael
cc65aba789 Update copyright note for 2013.
Happy new year.
2013-01-01 00:41:01 +01:00
Spp
2251d1bfae Core/Misc: Set mode 0644 for files 2012-11-27 13:03:12 +01:00
Spp
b99c347747 Core: Remove Player.h dependency from all the possible headers 2012-11-17 05:18:37 +01:00
Spp
58c60c70cc Core: Move a couple of log messages to debug 2012-11-15 13:42:24 +01:00
Spp
9fbc4c0ae2 Core/Misc: reduced amount of string memory allocations (Step II) 2012-10-24 15:34:48 +02:00
Spp
013fb1f4d9 Core/Misc: reduced amount of string memory allocations (Step I) 2012-10-24 15:34:48 +02:00
Spp
7831ecdb18 Core: "Initial support for C++11 compilers" 2012-10-02 15:06:19 +02:00
Spp
8c5f011e79 Core/Achievements: Force all calls to AchievementMgr be done through Player functions (Remove GetAchievementMgr)
Note: No real use in 3.3.5 but will be used in 4.3.4
2012-09-18 14:29:53 +02:00
Spp
358c6a26d6 Core: Warning fixes (Also some -pedantic under game folder) 2012-09-10 13:04:31 +02:00
Vincent-Michael
6891fe6248 Core/Battlefield: Add missing stuff for wintergrasp 2012-08-21 23:03:30 +02:00
Kandera
b9f60fe56c Core/Wintergrasp: finish implementation for battlefields. this is highly experimental enable at you're own risk. will almost definatly cause issues with the wintergrasp patch floating around 2012-08-20 16:23:24 -04:00
Manuel Carrasco
d7a7a9800b Battlefield: Make sBattlefieldMgr a pointer. By Subv. 2012-08-20 13:48:47 -04:00
Spp
55ce180f28 Core/Logging: Add Asyncronous logging with Loggers ("What to log") and Appenders ("Where to log") system. Will allow to select to full log some parts of core while others are not even logged.
- Logging System is asyncronous to improve performance.
- Each msg and Logger has a Log Type and Log Level assigned. Each msg is assigned the Logger of same Log Type or "root" Logger is selected if there is no Logger configured for the given Log Type
- Loggers have a list of Appenders to send the msg to. The Msg in the Logger is not sent to Appenders if the msg LogLevel is lower than Logger LogLevel.
- There are three (at the moment) types of Appenders: Console, File or DB (this is WIP, not working ATM). Msg is not written to the resource if msg LogLevel is lower than Appender LogLevel.
- Appender and Console Log levels can be changed while server is active with command '.set loglevel (a/l) name level'

Explanation of use with Sample config:

Appender.Console.Type=1       (1 = Console)
Appender.Console.Level=2      (2 = Debug)

Appender.Server.Type=2        (2 = File)
Appender.Server.Level=3       (3 = Info)
Appender.Server.File=Server.log

Appender.SQL.Type=2           (2 = File)
Appender.SQL.Level=1          (1 = Trace)
Appender.SQL.File=sql.log

Appenders=Console Server      (NOTE: SQL has not been included here... that will make core ignore the config for "SQL" as it's not in this list)

Logger.root.Type=0            (0 = Default - if it's not created by config, server will create it with LogLevel = DISABLED)
Logger.root.Level=5           (5 = Error)
Logger.root.Appenders=Console

Logger.SQL.Type=26            (26 = SQL)
Logger.SQL.Level=3            (2 = Debug)
Logger.SQL.Appenders=Console Server SQL

Logger.SomeRandomName.Type=24 (24 = Guild)
Logger.SomeRandomName.Level=5 (5 = Error)
Loggers=root SQL SomeRandomName

* At loading Appender SQL will be ignored, as it's not present on "Appenders"

* sLog->outDebug(LOG_FILTER_GUILD, "Some log msg related to Guilds")
  - Msg is sent to Logger of Type LOG_FILTER_GUILD (24). Logger with name SomeRandomName is found but it's LogLevel = 5 and Msg LogLevel=2... Msg is not logged

* sLog->outError(LOG_FILTER_GUILD, "Some error log msg related to Guilds")
  - Msg is sent to Logger of Type LOG_FILTER_GUILD (24). Logger with name SomeRandomeName is found with proper LogLevel but Logger does not have any Appenders assigned to that logger... Msg is not logged

* sLog->outDebug(LOG_FILTER_SQL, "Some msg related to SQLs")
  - Msg is sent to Logger SQL (matches type), as it matches LogLevel the msg is sent to Appenders Console, Server and SQL
    - Appender Console has lower Log Level: Msg is logged to Console
    - Appender Server has higher Log Level: Msg is not logged to file
    - Appender SQL has lower Log Level: Msg is logged to file sql.log

* sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Some msg related to Battelgrounds")
  - Msg is sent to Logger root (Type 0) as no Logger was found with Type LOG_FILTER_BATTLEGROUND (13). As Logger has higher LogLevel msg is not sent to any appender

* sLog->outError(LOG_FILTER_BATTLEGROUND, "Some error msg related to Battelgrounds")
  - Msg is sent to Logger root (Type 0) as no Logger was found with Type LOG_FILTER_BATTLEGROUND (13). Msg has lower LogLevel and is sent to Appender Console
    - Appender Console has lower LogLevel: Msg is logged to Console
2012-08-03 14:20:18 +02:00
kaelima
a32f4f439b Core/Protocol: Move some debug messages to their appropriate debug output mask. 2012-06-03 05:41:30 +02:00
kaelima
f1e6601032 Core/Protocol:
- Allow CMSG_LOGOUT_CANCEL to be recieved during serverside logout process (ignore it however, it's too late to abort)
- Fix STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT opcodes because of m_playerRecentlyLogout being set false too early in some cases
2012-05-27 19:57:49 +02:00
kaelima
dbe8034ec2 Core/Calendar: Fix crash when deleting an event on the calendar. Should also stop the error message from appearing.
Thanks elecyb
Closes #6570

- Corrected some code from 66d42b4f29
2012-05-23 16:37:22 +02:00
kaelima
66d42b4f29 Core/Protocol: Process CMSG_UPDATE_MISSILE_TRAJECTORY packets 2012-05-23 14:24:45 +02:00
leak
12e55a04bb Core/DBLayer: Convert PQuery() queries to prepared statements 2012-03-24 01:25:08 +01:00
Machiavelli
41cc704bf8 Core/Movement:
- Don't abort relocation if movementflag restrictions were violated. There might be lag between client and server and even different parts of the core that made this approach improper.
- MOVEMENTFLAG_ROOT cannot be used in conjunction with MOVEMENTFLAG_MASK_MOVING, but it's a valid flag to receive from client.
- Fix falling to ground when unapplying fly/waterwalk aura. NOTE: This is a client-side initiated fall, in the future this should be initiated and updated by the server. (Working on it)
- Rename MOVEMENTFLAG_FALLING to MOVEMENTFLAG_FALLING_FAR
- Rename MOVEMENTFLAG_JUMPING to MOVEMENTFLAG_FALLING

Closes #5751
2012-03-17 20:36:12 +01:00
Machiavelli
65453620e8 Core/Movement: Do not process server side relocation if reading movementinfo from client resulted in violations (= hacking). 2012-03-16 18:15:08 +01:00
Spp
d38bc3a178 Core: Rename GetCreatureInfo to GetCreatureTemplate and minor cleanup here and there 2012-02-27 14:58:47 +01:00
Discovered
c10e6708ed Core: Add some more output in HandleSetActionButtonOpcode (show playername/guid as well)
Signed-off-by: click <click@gonnamakeyou.com>
2012-02-25 21:40:05 +01:00
leak
8e3a4b956e Core/Warden: Base implementation for Warden functionality
Note: The default config file action for clients failing the checks can be changed for each check via the characters.warden_action table

Credits to TOM_RUS
2012-02-19 13:51:16 +01:00
kaelima
5684f39d58 Core/Protocol: Remove useless ResetInstances call inside WorldSession::HandleResetInstancesOpcode. 2012-02-10 12:52:30 +01:00
Shocker
08be716ef8 Core/Misc: Rename UNIT_STAT_* enums to UNIT_STATE_* 2012-02-03 19:02:17 +02:00
Spp
c9762b0e38 Core: Change Handlers location 2012-01-26 10:54:53 +01:00