Commit graph

237 commits

Author SHA1 Message Date
Zack Piispanen
856def83b3 Added basic framework for allowing for ban durations and banning admin.
Added BanningUser, Date(of ban), and Expiration to the db
On join, Expiration is checked, if ban is expired we remove it and the user is allowed on.
When running the ban command, your UAN is used as the banning user, and the date is that moment, with no expiration.
#531
2013-09-22 16:04:12 -04:00
Zack Piispanen
7c0bcceb9f Added LastAccessed time field and KnownIPs field to the user database. This resulted in some changes everywhere, such as new logic with default groups. Apparently, somehow, the ip based stuff worked even though no ips were set to properly grab the user group. The wrong group was being assigned to new users resulting in a player with 0 permissions. This is now fixed. 2013-09-21 20:57:14 -04:00
Lucas Nicodemus
d4e193b44d Merge pull request #529 from k0rd/general-devel
Remove WorldID from the WHERE clause in UPDATE SQL for RememberedPosManager
2013-09-21 14:36:08 -07:00
Zack Piispanen
ba42fb08df Removed ip address from users, as well as changed /user add syntax to be '/user add username password group' instead of colon bullshit. 2013-09-21 17:11:22 -04:00
k0rd
88e8e65dcb Remove WorldID from the WHERE clause in UPDATE SQL for RememberedPosManager, changed logic to also update the WorldID 2013-09-21 16:41:45 -04:00
Zack Piispanen
b22457382e remove unused using statements 2013-09-17 02:24:02 -04:00
Lucas Nicodemus
ae7ab5f234 Updated copyright information to point to 2013. 2013-08-22 21:51:17 -06:00
Lucas Nicodemus
9470e20423 Line ending normalization to CRLF (Windows) 2013-08-22 21:17:32 -06:00
CoderCow
33091035c0 -Improved group loading from the database:
--TShock will now attempt to load any available valid group data even if there are invalid records and will also report proper errors / warnings.
--"superadmin" is now a reserved group name.
--Groups with parents causing infinite parent loops, invaild parents, or parenting theirselfes will have their parent group reset.
--Double definitions of groups with the same name are no longer allowed.
--Group instances are now tried to be preserved instead of being recreated during a reload of the group data.

-Added command "/group parent" to get and set the parent of groups.
-REST Endpoint "/v2/groups/create" will no longer allow creating groups having theirselfes as parent.
-REST Endpoint "/v2/groups/update" will no longer allow setting a group's parent to theirself or setting a parent group resulting in an infinite parent loop.
-This commit should fix #482.
2013-07-27 22:02:29 +02:00
CoderCow
76aab4af78 Added quick format versions of the TSPlayer.Send<X>Message methods. 2013-06-27 15:04:00 +02:00
CoderCow
102c50a638 Fixed /region allowg adding an already existing group to the database multiple times. 2013-06-27 12:18:37 +02:00
CoderCow
f7edbe55d6 Fixed /region allow adding an already existing user id to the database multiple times. 2013-06-27 10:46:59 +02:00
Zack Piispanen
410f6cf872 Fixes some potential issues with concurrency, as well as cleaning up my z index check. 2012-12-14 23:40:38 -05:00
Zack Piispanen
88394ac561 Added back in region manager.
Added back in spawnmob commands, including the obsolete boss commands.
2012-09-15 16:20:16 -04:00
MarioE
2e2539a4d1 Rename RememberedPosManager, also remove some deprecation messages. 2012-08-20 10:53:02 -04:00
MarioE
5b032f277d Match the god damned existing tab format 2012-08-20 10:33:54 -04:00
MarioE
53008daacb Fixed storing chat colors incorrectly, and prefix/suffix resets 2012-06-08 21:36:34 -04:00
MarioE
b85bed52d2 That should be all of it 2012-06-04 21:28:47 -04:00
Zack Piispanen
b56a77b39d Removed the Region code. Left todo's for the places where we currently reference it though. 2012-05-30 20:12:27 -04:00
Lucas Nicodemus
8d5cdf04a8 Update copyright to reflect actual year date. 2012-04-24 12:45:46 -06:00
Zack Piispanen
b5504d2319 Z index based regions 2012-04-15 15:39:09 -04:00
k0rd
4bfdcb7dab Add checks for invalid positions when the server does not report the correct player position values to the RememberPosManager system. 2012-03-12 13:58:51 -04:00
Zack Piispanen
58359edd12 More typos.... 2012-03-04 00:09:23 -05:00
Zack Piispanen
9da1701354 Fixed typo in GenericSQLQuery. 2012-03-03 23:57:12 -05:00
Steven Hartland
b63cca0415 Merge pull request #406 from stevenh/6c636d4084e1a15d053652f1125c167a4b60b2d3
Refactored IQueryBuilder extracting common code into the GenericQueryCreator
2012-02-27 03:18:12 -08:00
stevenh
b6b5a2f1ca Added compatibiliy shims for old method signatures without which existing compiled plugins will error with missing method ...
This fixes #410
2012-02-24 11:37:43 +00:00
stevenh
d813a60060 Fixed resource leak in GetUser fixes #404
Multiple user exception is now passed direct to the caller of GetUser instead of being wrapped
2012-02-22 16:09:40 +00:00
stevenh
6c636d4084 Refactored IQueryBuilder extracting common code into the GenericQueryCreator
Fixed MysqlQueryCreator UpdateValue generating invalid SQL fixes #400
2012-02-22 11:47:09 +00:00
stevenh
41dbd31aac Converted all files to LF line endings 2012-02-21 15:56:34 +00:00
stevenh
84789ff4d5 Fixed GetUser not locating users by ID and hence GetUserById not working either, fixes #395 2012-02-20 21:44:25 +00:00
stevenh
1bc785f398 Fixes #392 making user group changes take effect on active players instantly 2012-02-20 10:56:06 +00:00
stevenh
d862d7922e Added better support for detection of duplicate users
Corrected and enhanced exception message for GetUser
2012-02-16 11:30:44 +00:00
stevenh
098363a9cc Fixed internal object and DB inconsitencies for modified default groups
Fixed console errors for failed parent dependencies of default groups that already exist caused by fb11729547 consistency fixes

Made GroupManager.groups readonly to discourage overwriting it. Could still do with better encapsulation to prevent consistency problems if modified externally.

Added UpdateGroup method to GroupManager

Refactored Group handling of permissions and chatcolor to prevent inconsistent data
Notably:-
* AddPermission now does the right thing when passed the string "!permission"
* Converted ChatColor from method to getter / setter

Added RemovePermission to Group

Refactored GroupManager Permissions handling to ensure consistent data between DB and internal objects

Removed redundent AddGroup method in preference to a default value on the main method

Correct some tabs vs spaces

Added ParentName helper to Group

Fixed inverted parameters to error "Invalid parent {0} for group {1}"
2012-02-16 11:23:39 +00:00
stevenh
2f7cb9f44e Added exception handling option to AddBan & Remove Ban
Fixed formatting of EnsureExists(table) block
2012-02-16 11:11:30 +00:00
stevenh
6d08fef275 Fixed missing UNIQUE constraints when using SQLite
Fixed missing NOT NULL constaints when using MySQL
2012-02-13 23:44:58 +00:00
stevenh
78cc7a6f75 Added the ability to delete a ban by name in the same way as a user 2012-02-13 22:38:04 +00:00
stevenh
fb11729547 Added IEnumerable support to GroupManager to facilitate RestAPI listing groups
Added optional exceptions parameter to AddGroup and DeleteGroup to faciliate RestAPI group manipulation. This changes the behaviour of these methods to throw an exception on error instead of returning an error string.
Corrected internal lists from being updated in failed DB updates in DeleteGroup and AddGroup
Added doc for chatcolor on AddGroup
2012-02-13 22:23:01 +00:00
stevenh
4daa9add13 Added GetUsers method mirroring GetBans to enable RestAPI to provide a full users list as well as an active one 2012-02-13 22:23:01 +00:00
stevenh
46f5f872ae Moved local exceptions outside of try block in AddUser so the calling code gets the original exception and not a generic one
Also added details of the SQL exception message into the message of the UserManagerException so its easier to determine the actual error when the exception message is returned / printed out
2012-02-13 22:23:01 +00:00
stevenh
0c13716b84 Removed TShock.Config.EnableBanOnUsernames check from GetBanByName so that it can be used internally for queries 2012-02-13 22:20:44 +00:00
Lucas Nicodemus
454403d495 Added /lists/bans REST endpoint - Returns a JSON list of bans 2012-02-09 22:20:36 -07:00
k0rd
217d001baf option to overload Region.InArea() with x,y for more accurate Region detection. 2012-02-04 18:00:33 -05:00
k0rd
bd878ee63c Don't use remembered pos if we are on a different WorldID 2012-02-04 17:01:27 -05:00
k0rd
ad56dd0741 this was trying to enter Player Names in multiple rows when the IP was different - but player name is the primary key!
(also fixed position on reconnect)

Remembering Position should now work correctly.
2012-01-31 21:02:16 -05:00
k0rd
7dcac918ec Added a more descriptive error message when database dlls are missing. 2012-01-20 18:45:53 -05:00
Natrim
4eeb09fb58 somepony forgot debug message here 2012-01-12 14:29:00 +01:00
Natrim
e113982158 don't display '()' in banned item list when no allowed groups is available 2012-01-11 11:29:27 +01:00
Natrim
5b7971f753 fix for banitem deleting in MYSQL 2012-01-11 11:29:13 +01:00
Natrim
2e7fa14a91 add commands for allowed groups for banned items 2012-01-10 11:17:54 +01:00
Natrim
b4d6908f98 add list items command to display banned items 2012-01-10 11:17:24 +01:00