Giter Club home page Giter Club logo

houseregions-plugin's Introduction

House Regions Plugin

A TShock Region Wrapper for Housing Purposes

This plugin provides players on TShock driven Terraria servers the possibility of defining houses in which other players can not alter any tiles. It accomplishes this by utilizing TShock's region system, i.e. this plugin simply wraps the region system functionality with an easy to use and more restricted interface designed for regular users.

For quick usage and for the sake of usabilitiy house regions are kept entirely unnamed, when being defined two points to mark the region boundaries are sufficient. To change parameters of a house region later, like adding shared players or groups, the player must simply stand in the region they want to change and execute the related house commands. The maximum amount of house regions per user, several size restrictions, and whether house regions can overlap with regular TShock regions can be configured.

Warning: TShock regions defined through this plugin are named in the format "*H_User:HouseIndex" thus, if you manually define a TShock region with this name format, this plugin will treat the region just like a house.

Releases of this plugin use Semantic Versioning.

How to Install

Note: This plugin requires TerrariaAPI-Server and TShock in order to work. You can't use this with a vanilla Terraria server.

Grab the latest release and put the .dll files into your server's ServerPlugins directory. Also put the contents of the tshock/ folder into your server's tshock folder. You may change the configuration options to your needs by editing the tshock/House Regions/Config.xml file.

Commands

  • /house
  • /house commands
  • /house summary
  • /house info
  • /house define
  • /house resize <up|down|left|right> <amount>
  • /house share <user>
  • /house unshare <user>
  • /house shareGroup <group>
  • /house unshareGroup <group>
  • /house delete
  • /house scan
  • /house reloadconfig

To get more information about a command type /<command> help ingame.

Permissions

  • houseregions.define Can define new or resize existing houses.
  • houseregions.delete Can delete existing houses.
  • houseregions.share Can share houses.
  • houseregions.sharewithgroups Can share houses with TShock groups.
  • houseregions.nolimits Can define houses without a maximum limit or size restrictions.
  • houseregions.housingmaster Can display a list of all house owners. Can change settings of any house, either owned or not owned.
  • houseregions.cfg Can reload the configuration file.

Credits

Icon made by freepik

houseregions-plugin's People

Contributors

codercow avatar stealownz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

houseregions-plugin's Issues

0 of 1 house defined but it says max already

when I set the config to allow 1 max house per player and then test it in-game, it wouldn't let me define a house and gave the error message "you have reached the max of 1 houses". Then I typed /house and the info message said "you've defined 0 of 1 possible houses so far"

not sure exactly what causes this, but a temp workaround I did is just add a + 1 after maxHouses = Config.MaxHousesPerUser

Can't define houses

When using HouseRegions + Protector plugins:
2015-08-09 01:01:57 - Utils: INFO: Maenso executed: /house set 1.
[Server APi]
2015-08-09 01:02:07 - Utils: INFO: Maenso executed: /house set 2.
2015-08-09 01:02:21 - Utils: INFO: Maenso executed: /house add Test.
2015-08-09 01:02:21 - Command: ERROR: System.NullReferenceException: Object Reference not set to an instance of an object
en HousingDistricts.HTools.MaxCount(TSPlayer ply)
en HousingDistricts.HCommands.House(CommandArgs args)
en TShockAPI.Command.Run(String msg, Boolean silent, TSPlayer ply, List`1 parms)
Note: Currently using 1.20API, Tshock 1.3.0.7

Ownership Transfer

I was wondering if it's possible to implement a way to let a user transfer ownership to another player. It would be very useful for servers that "rent out" predefined houses to players. If this was added in, we could easily check if the player has already reached the house limit.
I'm thinking the feature would probably work by removing the HouseRegion from the original owner, storing the region temporarily in memory, and then set it as a new HouseRegion for the new owner.

/setowner not working correctly? - User is already an owner

I believe I'm testing this with default configurations (Deleted all regions and HouseRegion config files).
After defining a house, upon trying to execute '/house setowner newPlayer', I'm given an error saying that the "player is already the owner of this region".
Anything that I might be doing wrong?

House Protection not working for doors

The defined area gets protected but when i hit a door with a pickaxe it simply gets destroyed after a message: "This region is protected from changes"

House Define does not work

When a user uses /house define they can create the points with a wrench/wire but when they click inside the defined region, nothing happens. When they type /house it says they have 0/1 region defined and when they try to define a region again or delete the region they just made it says that they already have 1/1 regions defined and that the region doesn't even exist....

So now we can't remove the regions and nothing is actually protected.

Add Custom /House Command Support

New custom sub-commands for /House can be configured by server owners to execute a given command list. Could look like this:

<CustomHouseCommands>
  <CustomCommand Name="Private" Permission="PrivateHouses">
    /dreg %house
    /rf set %house PRIVATE
  </CustomCommand>
</CustomHouseCommands>

Where %house is replaced with the name of the house regions the player is currently standing in and {0...} could be passed parameters.

House owners with the "PrivateHouses" permission could then write "/House Private" to execute the command list above for the house they're standing in thus, in this example, it would let the Region Flags plugin set their house to private.

Further parameters:
%owner = The house owner.
%ownergroup = The group of the house owner.
%index = The house index.
%player = Name of the player executing the command.
%playergroup = Group of the player executing the command.

help plis?? :c

[10/23/15 19:57:06] [Server API] Warning: Plugin "House Regions" has had an unhandled exception thrown by one of its NetGetData handlers:
System.MissingFieldException: Field not found: 'Terraria.Main.tile'.
in Terraria.Plugins.Common.Hooks.GetDataHookHandler.NetHooks_GetData(GetDataEventArgs e)
in TerrariaApi.Server.HandlerCollection`1.Invoke(ArgsType args)

/house unshare Error

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at System.Collections.Generic.List1.RemoveAt(Int32 index) at TShockAPI.DB.Region.RemoveID(Int32 id) at TShockAPI.DB.RegionManager.RemoveUser(String regionName, String userName) at Terraria.Plugins.CoderCow.HouseRegions.UserInteractionHandler.HouseUnshareCommand_Exec(CommandArgs args) at Terraria.Plugins.CoderCow.HouseRegions.UserInteractionHandler.TryExecuteSubCommand(String commandNameLC, CommandArgs args) at Terraria.Plugins.CoderCow.HouseRegions.UserInteractionHandler.RootCommand_Exec(CommandArgs args) at Terraria.Plugins.Common.UserInteractionHandlerBase.<>c__DisplayClass2.<RegisterCommand>b__0(CommandArgs args) at TShockAPI.Command.Run(String msg, TSPlayer ply, List1 parms)

Add /House Define Auto

To automatically attempt to define a fitting region for the structure the player is currently stading in.

Building the plugin

Hey I am not that great at coding and I get this error when building just wondering if there is something I am missing?

Severity Code Description Project File Line Suppression State
Error The command ""C:\Users\Jewsus\Desktop\TShock-Minitaka\SourceCode - OTAPI\CoderCow\HouseRegions-Plugin\packages\Mono.pdb2mdb.0.1.0.20130128\tools\pdb2mdb.exe" "C:\Users\Jewsus\Desktop\TShock-Minitaka\SourceCode - OTAPI\CoderCow\HouseRegions-Plugin\bin\Release\House Regions.dll"" exited with code 3. House Regions

I would guess I am missing something required like mono?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.