Commit graph

407 commits

Author SHA1 Message Date
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
darkunderdog
6079d84c9e Updated Regions.InAreaRegion.Name to allow overlapping regions - For plugins that use this it will require updating the code 2012-01-04 20:11:22 -06:00
Lucas Nicodemus
bf9d0137f1 Added any missing license headers to all files 2012-01-01 03:06:48 -07:00
Lucas Nicodemus
902015b285 Remove flat file converter from ban system constructor 2012-01-01 02:56:57 -07:00
Lucas Nicodemus
2ac5ea929b Remove yet another flat file converter from yet another constructor 2012-01-01 02:55:54 -07:00
Lucas Nicodemus
4709093553 Remove flat file shit from item bans 2012-01-01 02:54:38 -07:00
Lucas Nicodemus
71b5d63263 Remove flat file conversion code from user manager 2012-01-01 02:53:37 -07:00
Lucas Nicodemus
4e20b87992 Remove flat file conversion code from warp system 2012-01-01 02:51:46 -07:00
Lucas Nicodemus
2bfdaaaabc Remove flat file conversion code 2012-01-01 02:48:15 -07:00
high
41be28b5a3 Added blob type to sqlite 2011-12-31 18:22:07 -05:00
Lucas Nicodemus
c6abbfe4d2 ReSharper code reformat to match naming conventions and stuff 2011-12-30 14:38:04 -07:00
Lucas Nicodemus
1147788154 ReSharper redundant code cleanup 2011-12-30 14:32:05 -07:00
Zidonuke
2367598945 Fix Console Spam with group names 2011-12-29 16:17:19 -05:00
Zidonuke
b9a8fdf891 Quick fixes 2011-12-29 02:16:45 -05:00
Zidonuke
2e5155e1c0 Oops forgot some things. 2011-12-29 00:41:02 -05:00
Zidonuke
b7d84d6855 Implemented guest group config and default group. 2011-12-29 00:38:22 -05:00
Zidonuke
34efba9c1f Changed hack detection to allow future permissions overrides, now prevents hack clients modding max hp while online. 2011-12-28 21:03:29 -05:00
Zidonuke
99e9859b7c Merge pull request #317 from natrim/general-devel
Added some usefull permissions
2011-12-28 09:29:15 -08:00
Zidonuke
8f22ca4950 Attempt to fix unit tests. 2011-12-28 12:27:14 -05:00
Natrim
aa0642c64a added some useful permissions
(canregister,canlogin,canchangepassword,canpartychat,cantalkinthird,candisplayplaying)
2011-12-28 10:00:46 +01:00
Zack Piispanen
4c468b7f3c Item bans now have a group component. Adding a group to an item ban will allow that group to use the item.
Also fixed chests/items in chests being null when we truncate stack sizes.

Added code to let anyone with manageregion permission to modify regions...make sense.
2011-12-27 19:14:42 -05:00
Zack
d92537fd87 Moved the else from Midas' commit that reset the groups allowed in the event of an error, we can just ignore it instead of resetting. Move initialization of the list to the constructor. 2011-12-27 09:40:45 -05:00
Justin
f9b1af1b19 fixed null pointer exceptions during save and initializing regions 2011-12-26 12:53:16 -07:00
Zidonuke
7fe6cde2d9 Remove mana checks from server side inventory, it's not synced by redigit's client properly. 2011-12-25 10:45:28 -05:00
Zack Piispanen
d0a9b47f2f You can now add entire groups to a region. You can define as many groups as you want to a region, just like users. The new commands are /region allowg group region and /region removeg group region.
Any player in the group has build rights in the region.
2011-12-24 15:21:16 -05:00
Zidonuke
8cf298ad85 Save player data on backups
Server Side Inventory security improvements, blocking trashcan and "banks" items
CovertCorruption is now more thorough.
PvP Modes, normal, always, disabled now configurable
Initial group prefix/suffix implementation
Range checks reworked, Killing ice blocks now ignored for ice rod.
Adding a NPC name to item banlist will block it from spawning
Added configs to disable snowballs and clown bombs from npcs.
2011-12-22 17:32:51 -05:00
Zidonuke
c06bf2fe2e Break off from older commands and systems, move to more recent configurations.
Cheating detection no longer kicks, instead uses new system to block actions, and notifies user to fix the issue instead.
2011-12-20 22:41:49 -05:00
Zidonuke
f414fb4e39 Fixed all known bugs to server side inventory, its now fully tested.
Fixed pvp related stuff, its now fully working.
Inventory data is per account, not per character since I can't get SQLite to do something I need it to do.
Pvp throttling hardcoded because client side has a limit of 5 seconds, so double enforce it server side.
2011-12-20 21:30:06 -05:00
Zidonuke
bc7fac9b73 Annoying Server Side Inventory implemented. Needs extensive testing.
If enabled, all player actions are disabled until they /login which triggers a inventory check against the server. If they fail the check the login doesn't occur and they can't act. Default inventory for new accounts or characters requires a new character's inventory and health. Every inventory change that occurs is stored back into playerData memory and then onLeave it's stored back into the database, to be loaded at next /login
2011-12-20 16:21:22 -05:00
Zidonuke
ad22a379d9 New config to disable dungeon guardian and instead send players to spawn (stops hack abuse)
Changed AlwaysPvp to support new features better.
Now checking ItemAnimation for stuff.
Initial data structures for Server Side Inventory handling support.
2011-12-20 13:12:27 -05:00
Zidonuke
82fb69f9d4 Random Improvements and Fixes 2011-12-20 03:31:47 -05:00