Commit Graph

211 Commits

Author SHA1 Message Date
leak
d39a013b6b Replaced ACE_Task_Base based DatabaseWorker with PCQ
Note: Not exactly sure how shutdown should be handled, currently the queue clears itself out before shutting down
This might need to be changed if the queue should be fully processed before being deleted
2014-06-30 18:37:23 +02:00
Ascathor
6949735098 Core/Misc:
* Fix some codestyle, fix some typos

* Change CMakeLists for: Custom (can be uncommented), Events, World
** Custom is theoretically unchanged. You can, however, uncomment the glob_recurse that initializes every file within. This might be easier for beginners.

* Introducing the IP Based Action Log System:
** On several different actions, e.g. Login, Character Login, etc., a new entry is added
** Can be logged on and off in worldserver config
*** Disabled by default to prevent increased log db size for unknowing users.

* Add a new row to account table called 'last_attempt_ip'
** Lists the last ip trying to connect to the account

* Add a new type of HookScripts: AccountScript
** Includes: OnAccountLogin, OnFailedAccountLogin, OnEmailChange, OnFailedChange, OnPasswordChange, OnFailedPasswordChange

* Added new Hook to PlayerScripts: OnFailedPlayerDelete

* Added new variables to PlayerScripts: OnPlayerDelete
2014-06-13 16:25:11 +02:00
Kinzcool
c536305e3a Core: Droped faction_H field -- only one faction table is necessary 2014-04-27 18:13:55 -04:00
joschiwald
742f32f15a Core/Texts: Implemented loading BroadcastTexts 2014-04-22 17:57:23 +02:00
Dehravor
6a5c43b0d8 Core/Loot: Implement round robin for under threshold items in case of master loot
Thanks @Shauren for pointing out
2014-03-16 19:12:01 +01:00
joschiwald
3a40d8a887 Core/Player: delete queststatus (weekly/monthly/seasonal) on deleting character thx @Expecto
- also rename some prepared statements

Closes #11658
2014-03-02 00:00:39 +01:00
Vincent_Michael
20004050bc Update copyright note for 2014.
Happy new year.
2014-01-01 00:07:53 +01:00
jackpoz
b0ffbb2179 Core/Auth: Fix expiring account bans
Fix a database race condition in authserver that would delay the account ban expiry by 1 login because the query that would have removed the ban was executed asynchronously.
2013-12-22 14:00:14 +01:00
Shauren
172d3197bc Core/Guilds: Fixed an issue with withdrawing money from guild bank as guild master if the guild was created using a gm command
Closes #11262
2013-11-25 16:23:55 +01:00
jackpoz
f0c4d0ac05 Core/Transports: Fix few transport issues on relog.
Properly save transport related data to database when saving a Player .
On Player login update the current position as relative to transport, in case the transport moved.
2013-11-17 15:17:40 +01:00
jackpoz
096cb6bf00 Core/Auth: Fix Auth failing sometimes
Fix a database race condition between authserver saving session key to database asynchronously and worldserver reading it; session key is now saved synchronously.
2013-11-16 23:25:21 +01:00
Ascathor
2607738990 Core/Code: Unify codestyle for brackets: {} to { }.
Also added missing copyright to some files.
2013-10-27 23:46:02 +01:00
Shauren
59fd2520fc Core/Creatures: Removed remains of creature_transport table 2013-10-17 00:20:00 +02:00
Spp
ea2fe0217d Core/RBAC: Simplify RBAC implementation
- Drop groups (roles than can have inherited roles) and roles (set of
  permissions)
- Permissions can now have inherited permissions (those act as roles)

RBAC DB structure is now limited to four tables
- rbac_permissions: Contains permissions and roles
- rbac_linked_permissions: Contains the relation between permissions and
  linked permissions (those permissions that have linked permissions are
  called roles)
- rbac_default_permissions: Contains the list of permissions to be granted
  to each security level [Added to maintain compatibility in an easy way]
- rbac_account_permissions: Contains the list of permissions granted or
  denied for a particular account.

NOTE: IF YOU ARE USING CUSTOM PERMISSIONS, ROLES OR GROUPS CHECK THE SQL
BEFORE APPLYING...
2013-09-29 13:19:05 +02:00
Shauren
0ca481c0a2 Core/Achievements: Converted save queries to prepared statements 2013-09-06 14:00:21 +02: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
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
raczman
ba22baebbd Core/Auth: Implement time-based token for user login as described in RFC 6238.
New column in account table is a base32 of token key bytes,
coincidentally it is the same format Google's Authenticator Android app uses.
If you want that to work, set system time on server correctly and use ntpd.

Closes #10527

Signed-off-by: Nay <dnpd.dd@gmail.com>
2013-08-25 14:02:40 +01:00
Ascathor
5a9810ec08 Core/Commands: Added the rank id to .pinfo for guild data 2013-07-24 19:25:36 +02:00
Shauren
ef15fe8ed2 Core/Instances: Fixed a bug that caused switching group leader inside active instance to cause players not being saved when a boss was killed.
Closes #5109
2013-06-11 15:50:08 +02:00
Subv
1d1bb84cf9 Merge pull request #9854 from Ascathor/master
Core/Command: Optimized .pinfo more
2013-06-02 17:52:27 -07:00
Vincent-Michael
15b055fe87 Core/Database: Fix bad sql query in 55b3819d12 (thx Shauren) 2013-06-01 23:47:46 +02:00
Subv
55b3819d12 Core/Database: Deleted characters will no longer be loaded when sending the SMSG_CHAR_ENUM packet. 2013-06-01 12:57:37 -05:00
Ascathor
fb52e9ea03 Core/Command: Optimized .pinfo more
* Moved some checks around
* Added RBAC Permission for Email, last login and last ip (group 3 and 4) -- If missing RBAC permission, then it displays "Unauthorized (RBAC)"
* Changed totalmail output from uint64 to uint32
* Level either puts Max level, or a list of information necessary
* Only queries guild if the current xp query also detects guild membership
* Incorporated recent changes into code
* Commander requires higher than target to get sensitive data beside RBAC permission.
2013-05-26 14:21:39 +02:00
Shauren
590133c2b0 Missed change for previous commit 2013-05-24 18:33:33 +02:00
Bezo
178cb300d1 Implement .arena commands - add new commands to the core to handle with arena teams.
*.arena create [player] "arena name" [type]
	*.arena create "arena name" [type]
	*.arena disband [TeamID]
	*.arena rename "oldName" "newName"
	*.arena captain [TeamID] [Player]
	*.arena info [TeamID]
	*.arena lookup [name]
2013-05-22 00:50:51 +03:00
Ascathor
051d6ef925 Core/Command: Rework PInfo and give more output and add Gender to trinity_string
* Prints out in several strings instead of few
* Leaves unnecessary ones out (e.g. phase for GMs)
* Some code documentation included (including doxygen)
* Cleaner code (partly)
* Prints more content, e.g.:
** Localized Class- and Race names
** Localizable Gender names
** Current experience, required experience
** And more

Shoutouts to @Nay, @Subv, @Shauren and several others from the irc

Core/Command: Rework PInfo and give more output and add Gender to trinity_string
2013-05-20 03:09:34 +02:00
xjose93
f2b6b2f95e Core/Commands: Improve .character rename [name], now can force rename .character rename [name] [newName] 2013-04-29 11:26:54 +02:00
Aokromes
1087e5f5c9 Merge pull request #9710 from xjose93/Autobroadcast
Core/World: Improvements in Autobroadcast system (dropped from world database and moved to auth database, added realmid and weight columns)
2013-04-27 05:02:48 -07:00
Aokromes
e486cd7623 Merge pull request #9662 from xjose93/GuildRename
Guild rename
2013-04-27 05:02:07 -07:00
xjose93
d7e9d1bafb Core/World: Improvements in Autobroadcast system (dropped from world database and moved to auth database, added realmid and weight columns) 2013-04-25 22:54:20 +02:00
Bezo
7542049eba [Ip2nationLock] Implement the ip2nation lock country. 2013-04-22 15:53:48 +02:00
xjose93
678cade116 Core/Commands: rename guilds (.guild rename "old guildname" "new guildname") 2013-04-19 23:21:23 +02:00
Nay
4e1a4b3ce4 Core/DB: Fix a table name in CHAR_SEL_MAIL_LIST_INFO 2013-03-17 18:19:15 +00:00
Bezo
228d9803f3 Scripts/Commands: Add .list mail $char/$guid command
Prints a list of mails received by the characters

Closs #9421
2013-03-17 17:32:24 +00:00
Vincent_Michael
4ee0a4a446 Revert "Core/Commands: Optimize for command .npc near"
This reverts commit 4e789d4c5c.
2013-03-09 23:28:32 +01:00
Vincent_Michael
4e789d4c5c Core/Commands: Optimize for command .npc near 2013-03-09 23:05:27 +01:00
Shauren
f37e0ee838 Core/Players: Implemented converting quests on faction change (keeping old faction quests in disabled state - not loaded during login) and restoring them if changing back to original faction
Closes #890
Closes #9248
2013-03-04 14:15:52 +01:00
Nay
028c72a9f2 Core/NPCs: Refactor equipments
- creature_template.equipment_id deleted
- creature_equip_template.entry == creature_template.entry
- id field added to creature_equip_template -> PK(entry, id)
- id field in creature_equip_template starts at 1
- creature.equipment_id references id of creature_equip_template
- creature.equipment_id = 0 means no equipment at all (default 1)
- creature.equipment_id = -1 means pick a random equipment from creature_equip_template
- add equipment info to .npc info command

While table creature_equip_template got bigger in size, this system is easier to mantain and allows creatures to have a random template from a group of equipments
2013-02-18 12:24:18 +00:00
Shauren
b6e56e42ea Core/Auth: Reverted part of fb43a92cc2 - session key is still needed after logging in to be able to switch realms 2013-02-08 01:03:56 +01:00
Shauren
fb43a92cc2 Core/Accounts: sessionkey field in account table is only a temporary storage to pass data from authserver to worldserver and should only be used as such. Clearing sessionkey from database after a successful login to prevent possible exploits. 2013-02-07 16:15:23 +01:00
Nay
0b3170c228 Core/Player: Fix a query that was wrongly deleting items
CHAR_DEL_ITEM_INSTANCE deletes by item guid but in Player::DeleteFromDB the guid being used was player's guid.
That means that if player with guid 100 was deleted, the item with guid 100 would also be deleted. This item could or could not belong to the player.

Closes #8883
Closes #9136

Thanks to @vlad852 for finding the issue
2013-02-06 13:17:21 +00:00
Aokromes
6d8a69d640 Merge pull request #9099 from Bezo/mutenew
Add Mute reason and mute by to the db so you can get this info from the ...
2013-02-04 06:55:26 -08: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
67d46ae1ae Scripts/Commands: Show correct guild Rank when using .pinfo command
(Corrections to 1b551cc1)
2013-01-31 09:18:42 +01:00
Bezo
760d62e934 Add Mute reason and mute by to the db so you can get this info from the db with the pinfo command when player get muted.
old LOGIN_UPD_MUTE_TIME change to LOGIN_UPD_MUTE_TIME_LOGIN due the use of it when character login to world.
2013-01-30 13:09:41 +02:00
Spp
2c32393a39 Core/Misc: Always state what columns are affected by MySQL statements 2013-01-30 08:42:01 +01:00
Shauren
6e80357f8e Core/Authserver: Added possibility to allow realm connections both from "world" and local networks. 2013-01-27 17:33:01 +01:00
Nay
1b551cc157 Scripts/Commands: Add guild info to .pinfo
Original patch by @secharles, modified

Closes #8946
2013-01-26 21:33:13 +00:00
thomas33
c36aa6e7af fix typo 2013-01-25 12:25:06 +01:00