Commit Graph

138 Commits

Author SHA1 Message Date
joschiwald
72ed5bfc93 Core/Misc: changed trinity string id to unsigned and removed obsolete code 2014-09-18 02:36:28 +02:00
Shauren
a0e50ea35f Core/Entities: Use ObjectGuid class in game project 2014-09-14 16:14:12 +02:00
jackpoz
4d9f8b926a Scripts/Commands: Change "few" commands to target current Player by default 2014-08-25 22:00:04 +02:00
DDuarte
df3b08d140 Core/Server: Use nullptr instead of 0 where pointers are expected 2014-08-09 21:32:26 +01:00
jackpoz
dc58ec0d6c Scripts/Commands: ".modify speed" targets current Player by default
Allow ".modify speed" command to target current Player if there is no target or if the selected Unit is a Creature.
This behavior could be extended to other commands that require target Players.
2014-04-13 14:06:21 +02:00
jackpoz
0056ec04c0 Core/Misc: Fix warning with GCC 2014-03-30 13:30:00 +02:00
jackpoz
dfca19444a Core/Misc: Fix warning 2014-03-29 21:51:45 +01:00
jackpoz
4cffd2e707 Core/Commands: Handle "" as empty string argument
Fixes #11548
2014-03-29 21:07:46 +01:00
Vincent_Michael
20004050bc Update copyright note for 2014.
Happy new year.
2014-01-01 00:07:53 +01:00
Shauren
107af52853 Core/Chat: Refactored building chat packets
* Moved everything into one specialized method instead of being scattered all over the place
* Allow localizing creature names in chat messages (when using $N)
* Send SMSG_GM_MESSAGECHAT for gm messages
2013-12-23 14:23:49 +01:00
Spp
94e2b9332a Core/Logging: Remove LOG_FILTER_XXX defines with it's value (remember logger names are case-sensitive) 2013-11-08 10:50:51 +01:00
Shauren
9d19e4d0ac Core/Commands: Restored old functionality of getSelectedPlayer in chat commands
Also fixed build
2013-10-06 11:28:25 +02:00
Shauren
a368fae588 Core/Players: Fixed issues with incorrect targets being selected for spells 2013-10-03 17:07:25 +02:00
Spp
cfaea769bc Core/RBAC: Move RBAC code to namespace rbac 2013-09-27 13:35:45 +02:00
Spp
3232b69ff3 Core/RBAC: Move commands security to RBAC (using generic RBAC Permissions)
- Warning: This will break commands for any custom security level
2013-08-30 13:57:09 +02:00
Nay
8eaf763235 Core&Tools: Fix multiple issues found by a static code coverage tool 2013-08-26 02:00:18 +01:00
Nay
12973de799 Core&Tools: Fix multiple issues found by a static code coverage tool 2013-08-24 22:57:22 +01:00
Shauren
ab6be8c603 Core/Battlegrounds: Fixed error with counting AB owned nodes (and warning fixes) 2013-08-01 18:02:08 +02:00
b4nan1
894a2434bf Update Chat.cpp
this is better or?
2013-05-29 14:59:37 +02:00
Shauren
bda68d3f9d Core/Commands: Fixed wrong field types used in db queries for pinfo command and output alive state if target is offline 2013-05-24 18:31:19 +02:00
Spp
d1677b2db0 Core/Logging: Performance-related tweaks to logging system
All sLog->out* functions (except outCommand atm) are replaced with TC_LOG_* macros.
    Memleak fix
2013-05-13 15:07:36 +02:00
xjose93
c7a6c1be84 Core/Log: Added guid (of gm), area and zone to gm command log. 2013-04-23 19:09:48 +02:00
Spp
fc78c48495 Core/RBAC: Create new permissions 'Notify if a command was not found' and 'Enables lower security than target check' 2013-02-25 15:48:18 +01:00
Spp
fedc26a115 Typo fix 2013-02-05 09:26:52 +01:00
Spp
f210ab0d47 Core/RBAC: Allow custom security levels for commands. (Before this change any command with seclevel > 3 had the same permissions than player commands)
Note: This is still a workaround till command system is moved to RBAC
2013-02-05 09:11:56 +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
Vincent_Michael
cc65aba789 Update copyright note for 2013.
Happy new year.
2013-01-01 00:41:01 +01:00
Spp
e954498560 Core/Misc: Random changes here and there to minimize differences with 4.3.4 branch 2012-11-27 13:03:12 +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
leak
6bf9cb56a9 Core/Chat: Prevent client crashes with invalid chat language and message type combinations
Fixes #8083
2012-11-01 20:04:35 +01:00
Spp
013fb1f4d9 Core/Misc: reduced amount of string memory allocations (Step I) 2012-10-24 15:34:48 +02: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
Vincent-Michael
4a3df36bd9 Core/Commands: Convert more misc commands in commandscript 2012-07-29 15:03:26 +02:00
Vincent-Michael
6f69a3326d Convert misc commands in commandscript 2012-07-29 01:23:51 +02:00
Vincent-Michael
a9812a0860 Core/Commands: Convert ticket commands in commandscript 2012-07-15 22:20:22 +02:00
Vincent-Michael
9e84942917 Core/Commands: Convert ban / unban / baninfo / banlist commands in commandscript 2012-07-14 13:37:57 +02:00
Vincent-Michael
91cd7109e4 Core/Commands: Convert lookup commands in commandscript 2012-07-06 21:38:18 +02:00
Vincent-Michael
f8374fac0b Core/Commands: Convert guild commands in commandscript 2012-07-02 21:57:50 +02:00
Vincent-Michael
5de44b3632 Core/Commands: Convert reset commands in commandscript 2012-06-21 23:41:03 +02:00
Vincent-Michael
d3bf4626d0 Core/Commands: Convert list commands in commandscript 2012-06-21 17:21:23 +02:00
Xees
a312cd4ba1 Scripts/Commands: Convert character and server commands to commandscript
Closes #6856

Signed-off-by: Nay <dnpd.dd@gmail.com>
2012-06-21 00:11:11 +01:00
Vincent-Michael
c19f13e6fc Core/Commands: Convert cast commands in commandscript 2012-06-19 20:42:11 +02:00
Vincent-Michael
0e8889415d Core/Chat: Convert instance commands in commandscript 2012-06-14 17:33:46 +02:00
Shocker
83e1e17649 Merge pull request #6008 from cookta2012/troy09
Core/Commands: Some porting and organizing

Moving a commands around eliminating a unnecessary file, and porting the "demorph" command
 * moved the "wpgps" command into the cs_debug.cpp because it seems more fitting
 * organized the "modify speed" commands into a table of their own
 * moved the "gps" command into the cs_misc.cpp
2012-04-23 17:21:42 -07:00
Machiavelli
74b5b3bd8e Core/Commands: Remove recently defunct .hover command. All this spell did before hoverheight changes was .cast/.unaura spell 11010. And since we do not have .autoattack, .steadyshot, .heroicstrike, .shootwand etc. either, there's no place for this command in the core (there never was). 2012-04-12 12:04:04 +02:00
faramir118
e3f198ca56 couple wrong return types 2012-04-11 19:58:12 +02:00
cookta2012
7e793575be Moving a commands around eliminating a unnecessary file, and porting the "demorph" command
* moved the "wpgps" command into the cs_debug.cpp because it seems more fitting
* organized the "modify speed" commands into a table of their own
* moved the "gps" command into the cs_misc.cpp
2012-04-05 17:43:06 -05:00
Subv
2987d4f40d Core/Commands: Allow combatstop command to be used from console with the player name as parameter
Signed-off-by: Subv <s.v.h21@hotmail.com>
2012-04-01 11:03:47 -05:00
Shauren
c8bf09d504 Core/DBLayer: Match field type reads in core with data types in db for prepared statements 2012-03-24 16:44:01 +01:00