Commit Graph

353 Commits

Author SHA1 Message Date
Spp
895a23df11 Core/RBAC: Add default groups to accounts based on their security level.
- Removed config option RBAC.DefaultGroups

Use the table rbac_security_level_groups to configure the groups to be added to the account at load time.

Note: Those groups are only used at run time, never saved to DB
2013-09-27 13:35:45 +02:00
Aokromes
783e28e874 Core/Groups: Allow to configure the way in which instance reset message is sent, to the whole party (not blizzlike) or not.
Signed-off-by: Machiavelli <machiavelli.trinity@gmail.com>
2013-09-12 10:19:05 +01:00
Aokromes
80516db48c Core/Battlegrounds: Allow random BG winner/loser rewards to be configurable
Signed-off-by: Machiavelli <machiavelli.trinity@gmail.com>
2013-09-07 13:32:04 +01:00
jackpoz
5eff0b62ae Core/Command Line: Fix memory leak
Fix memory leak in command line handler on platforms other than Windows. The result of readline() is supposed to be freed with free() as described at http://cnswww.cns.cwru.edu/php/chet/readline/readline.html#SEC24 .

Valgrind log:
 11 bytes in 2 blocks are definitely lost in loss record 6 of 61
  at 0x4C28BED: malloc (vg_replace_malloc.c:263)
  by 0x4E5F6E8: xmalloc (in /lib/x86_64-linux-gnu/libreadline.so.6.2)
  by 0x4E4571A: readline_internal_teardown (in /lib/x86_64-linux-gnu/libreadline.so.6.2)
  by 0x4E46541: readline (in /lib/x86_64-linux-gnu/libreadline.so.6.2)
  by 0x1005284: CliRunnable::run() (CliRunnable.cpp:161)
  by 0x163A3DA: ACE_Based::Thread::ThreadTask(void*) (Threading.cpp:186)
  by 0x518C555: ACE_OS_Thread_Adapter::invoke() (OS_Thread_Adapter.cpp:103)
  by 0x61D7B4F: start_thread (pthread_create.c:304)
  by 0x6C66A7C: clone (clone.S:112)
2013-09-04 21:55:10 +02:00
Nay
9b92bc9409 Core: Fix compile with PCH enabled and warnings
Few corrections to worldserver.conf
2013-09-02 16:18:55 +01:00
Ascathor
722a6c143a Core/Account: Make account password change security variable and various changes
Settings within worldserver.conf:

Three settings for secruity level:
0 - None - No change to current system
1 - Email - Always requires the email entered on registration for confirming.
2 - RBAC - Groups applied with the RBAC role always require the email entered on registration for confirming.

RBAC default to every group. Changed some logs to make it more clear what is going on at all.

Emails may now no longer exceed 64 chars. Current email is used as regmail.

On account creation, two emails are saved. Registration email and normal email. Normal email is relevant afterwards. Registration email can be changed by console ONLY.

Includes new commands and changes to existing ones:
.account fulfills several new functions:
* Still prints GM Level.
* If account has permission, it displays the current email. This is not defaulted to any group.
* Security level is displayed. Also displays if user has RBAC perm if RBAC security mode is selected
.account email allows user to change email with sufficient confirmation
.account set sec email allows higher sec with higher sec than account to change the normal email. Registrationemail remains untouched here.
.account set sec regmail allows console to change registration email.
.pinfo now displays the registration and normal mail.

Also fixes .learn all crafts.
Closes #10558
2013-09-01 21:21:16 +02:00
jackpoz
e1e1067d17 Core/Thread: Fix race condition in FreezeDetectorRunnable
Fix race condition by replacing a static volatile uint32 with proper atomic thread-safe ACE_Atomic_Op<ACE_Thread_Mutex, uint32>, incremented in WorldRunnable::run() at each world loop and read in FreezeDetectorRunnable::run().

Helgrind log:
 Possible data race during read of size 4 at 0x2400D54 by thread #12
 Locks held: none
    at 0x100FEA6: FreezeDetectorRunnable::run() (Master.cpp:106)
    by 0x1637892: ACE_Based::Thread::ThreadTask(void*) (Threading.cpp:186)
    by 0x518F555: ACE_OS_Thread_Adapter::invoke() (OS_Thread_Adapter.cpp:103)
    by 0x4C2B5AD: mythread_wrapper (hg_intercepts.c:219)
    by 0x61DAB4F: start_thread (pthread_create.c:304)
    by 0x6C69A7C: clone (clone.S:112)

 This conflicts with a previous write of size 4 by thread #9
 Locks held: none
    at 0x100C23E: WorldRunnable::run() (WorldRunnable.cpp:55)
    by 0x1637892: ACE_Based::Thread::ThreadTask(void*) (Threading.cpp:186)
    by 0x518F555: ACE_OS_Thread_Adapter::invoke() (OS_Thread_Adapter.cpp:103)
    by 0x4C2B5AD: mythread_wrapper (hg_intercepts.c:219)
    by 0x61DAB4F: start_thread (pthread_create.c:304)
    by 0x6C69A7C: clone (clone.S:112)
2013-09-01 18:49:49 +02:00
Machiavelli
59b4c34924 Core/NetworkIO: Generic packet spam solution
Currently regulates the usage of CMSG_CHAR_ENUM only, but can be easily
extended to detect inappropriate network behaviour by using
AntiDOS.AllowOpcode in WorldSession's handlers.
2013-08-29 16:46:28 +01:00
QAston
19343ddd55 Fix crashed caused by using openssl from multiple threads simultanously.
Note that this doesn't make BigNumber class threadsafe - it never was that way.
2013-08-18 17:44:04 +02:00
Nay
a7d876e8b5 Config: Change ProcessPriority default to 0 (Normal)
On Linux, superuser (root) is required to set a process high priority and we shouldn't force that.
(It's already set to 0 (Normal) in worldserver\Master.cpp and authserver\Main.cpp)
2013-07-30 15:34:38 +01:00
Nay
1bb3c4a2b4 Misc: Fix warnings and build
Closes #10396
2013-07-29 14:24:53 +01:00
Nay
3330239a02 Servers: Fix typo 2013-07-28 20:12:06 +01:00
Nay
e3f7be12ef Servers: Enable UseProcessors and ProcessPriority settings to be used on Linux 2013-07-28 18:58:12 +01:00
Nay
f71d894a21 Servers: Fix some code style issues in world and authserver 2013-07-28 16:59:07 +01:00
Shauren
779a59e7e2 Core/Config: Refactored ConfigMgr
* Loading initial configuration files is now separate from loading any additional custom configs
2013-07-15 17:31:44 +02:00
Shauren
3c91c04758 Buildsystem/MSVC
* Fixed ACE PCH
* Removed WheatyExceptionReport sources from shared project
2013-06-15 14:07:12 +02:00
corbi
e185713464 Stats Limits 2013-06-05 10:34:05 +03:00
Spp
d3c2af0f66 Core/Build: Fix compile under Ubuntu 13.04 and openSUSE 12.3 (and probably other new distros)
Closes #9832
Closes #9740
2013-05-21 08:36:52 +02:00
Shauren
8be181c7e6 Core/Misc: Fixed a bunch of issues found by static analysis 2013-05-17 20:39:53 +02:00
Shauren
86d846e627 Core: Fixed windows compile 2013-05-13 18:10:20 +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
Ascathor
1c2d617c18 Core/Player: CharDelete.Heroic.MinLevel as seperated unlink requirement for Heroic classes
Also added documentation for GetCharacterNameData
2013-04-28 00:04:55 +02:00
click
7afe928f2a Core/Buildsystem: Actually follow CONF_DIR path-directive when installing configuration-files on UNIX
Fixes issue #9649
2013-04-14 14:35:45 +02:00
Spp
1a6a23ec96 Core/Misc: Minor optimizations (+code changes to reduce differences with 4.3.4 branch)
Core/Logging: Create new logger type "Cheat". Will be used to log all cheat attempts
2013-03-25 13:26:48 +01:00
Nay
41c7f35a31 Merge pull request #9385 from thomas007788/Doxygen
First step of comment style refactoring to doxygen-style.
2013-03-08 16:25:05 -08:00
Nay
c7463c5f6c Buildsystem: Add support for compiling with MinGW on Windows
Tested with:
- Windows 8 x64
- MySQL 5.5.30 win32
- OpenSSL 1.0.1c (32 bits)
- No PCH
- MinGW with GCC 4.7.0

TODO:
- Fix compile/link with PCH enabled
- Fix compile with WheatyExceptonionReport enabled (ignored for now)
- Fix compile of .rc files (ignored for now)
- Test with more platforms
2013-03-09 00:12:50 +00:00
Nefarion
49fd11ab5a First step of comment style refactoring to doxygen-style. 2013-03-08 21:55:37 +01:00
Spp
377cfdb560 Core/RBAC: Fix multiple permissions and remove multiple config options that are currently implementes by RBAC
- Remove config options: CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT, CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL, CONFIG_GM_LOG_TRADE, CONFIG_ALLOW_TWO_SIDE_ACCOUNTS, CONFIG_ALLOW_TWO_SIDE_WHO_LIST, CONFIG_ALLOW_GM_FRIEND, CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND, CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL
- Fix RBAC_PERM_SKIP_CHECK_CHAT_SPAM (Was checking spam for those that had the permission)
- Only check RBAC_PERM_TWO_SIDE_INTERACTION_CHAT for sender of whispers (Restores GM being able to whisper players)
- Only check RBAC_PERM_TWO_SIDE_INTERACTION_MAIL for sender
- Fix .ticket assign <Player>, with last RBAC change it was changed by mistake from Player to Account
2013-03-08 13:15:25 +01:00
Shauren
6be5bc71eb Core/GameObjects
* Removed long deprecated code for mining nodes (multiple uses, artifact of TBC)
* Made fishing pools generate use count only on spawn (and respawn) instead of randomizing use count on every fishing attempt - prevents early despawning in some cases
2013-03-02 23:59:42 +01:00
Spp
480c6cf4dd Core/RBAC: Add .reload rbac command and prevent possible crash if rbac_permissions has wrong data 2013-02-27 03:30:53 +01:00
Spp
15343d9bb0 Core/RBAC: Remove unnecessary header includes from other header files 2013-02-25 15:48:17 +01:00
Spp
4fc7fcae33 Core/RBAC: Add config option to set comma separated list of groups to add by default
- Allows to reduce the rows in rbac_account_groups
2013-02-18 14:49:59 +01:00
Nay
87d4e8c067 Core/Config: Change CONFIG_EVENT_ANNOUNCE from int to bool
Also correct the description of BeepAtStart, it works in Windows as well
2013-02-18 12:20:00 +00:00
Machiavelli
203cf7cbf0 Core/RA: Addition to previous crashfix
To make sure it also works for sessions that use more than 1 command
before closing.
2013-02-14 13:30:51 +01:00
Machiavelli
b4be224004 Core/RA: Fix a possible crash
Caused when RASocket::handle_close (event-driven) would delete the underlying object before RASocket::commandFinished callback was executed for that object. Dereferencing freed pointers is bad.
2013-02-14 11:57:43 +01:00
Nay
42e660e2a2 Core/Sockets: Always try to send MSG_NOSIGNAL in peer().send()
Fixes RASocket::authenticate crash

"MSG_NOSIGNAL:
If you send() to a remote host which is no longer recv()ing, you'll typically get the signal SIGPIPE. Adding this flag prevents that signal from being raised."

Closes #5040
Thanks to @derex for the hint
2013-02-11 02:59:37 +00:00
Vincent_Michael
5b45a87da5 Core: More clean up whitespace 2013-02-07 00:24:00 +01:00
click
ede65fb60c Core/Remote: Adjust logentries to accomodate separation of info- vs debug-output, using Info-level as default unless it's REAL debugoutput 2013-02-05 15:45:18 +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
MrSmite
a45f7fd878 Adds CONF option to show quest levels in dialogs.
Example: [13] Westfall Stew

Default = 0 (off). Make sure to set UI.ShowQuestLevelsInDialogs to 1 to turn it on

NOTES:

* DO NOT supply the quest level when using commands such as .lookup quest, it
is not actually part of the title (even though it will be printed in the result)

* Also adds the level in the quest tracker and quest log

* If locale is used, the level is added after the proper title is looked up

* LUA Mods that offer this feature do not work properly with TC, most will not put the level in all dialogs. Users who have such mods should disable the mod's feature or they may see the quest level listed twice.

Example: [13][13] Westfall Stew
2013-01-25 21:47:07 -05:00
Machiavelli
39c2d892f3 Core/Log: Allow configuring a maximum file size for a log file. If the file size is about to be exceeded, the core will create a new file titled <oldname>_.log and start outputting there. 2013-01-23 17:48:17 +01:00
Nay
3cb80f206e Core/Config: Set mmaps disabled by default 2013-01-21 20:45:09 +00:00
Vincent_Michael
94944e3072 Merge branch 'master' of github.com:TrinityCore/TrinityCore into mmaps
Conflicts:
	src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
2013-01-20 00:34:20 +01:00
Shauren
a77bb44d1e Core/RA: Warning fix 2013-01-19 13:35:01 +01:00
Vincent_Michael
224b4480a7 Merge branch 'master' of github.com:TrinityCore/TrinityCore into mmaps 2013-01-16 23:43:07 +01:00
Spp
526bdc0764 Core/Logging: Add config option to enable/disable asyncronous logging (disabled by default) 2013-01-16 09:52:49 +01:00
Spp
be3826825e Core/Logging: Use correct realmId when logging to DB 2013-01-16 08:59:56 +01:00
Vincent_Michael
11bd11badc Merge branch 'master' of github.com:TrinityCore/TrinityCore into mmaps 2013-01-15 23:34:50 +01:00
kaelima
c7ce94ee3d WorldServer/RA: Implement MSG_NOSIGNAL in RASocket send.
Used to prevent raising SIGPIPE when the host are no longer recv()ing
2013-01-15 16:10:59 +01:00