Approved [1.12] DieMob regions

Discussion in 'Plugin Releases' started by InanZen, May 29, 2012.

  1. InanZen TShock Plugin Developer

    Description:
    • Adds monster protection option to regions
    • Simply add existing regions to the list of regions you want to protect from monsters
    • Turn specific types of monsters into other monsters
    • Multi-world support
    Commands:
    • /diemob | /dm | /DieMob
    • /dm add | del "region name" - adds | removes region to DieMob list
    • /dm list [page number] - list regions on DieMob list (names + locations)
    • /dm reload - reloads config.json
    • /dm info "region name" - display region info
    • /dm replacemobsinfo "region name" [page number] - display mob replacements list for region
    • /dm mod "region name" [option] [arg]
      • options:
        • type - args: kill / repel / passive - set region mode to kill or repel affected mobs
        • AffectFriendlyNPCs - args: true / false - does region affect friendly NPCs (default: false)
        • AffectStatueSpawns - args: true / false - does region affect mobs spawned by statues (default: false)
        • ReplaceMobs - args: add fromMobID toMobID / del fromMobID - assign or delete specific mob types to be converted to other mob types.
      • options and arguments are case insensitive
    Permissions:
    • diemob - permission for all commands
    Config File: (if updating delete the old one)
    • "UpdateInterval" - time in miliseconds for each region vs mob check
    • "RepelPowerModifier" - modifier for repel strength (velocity).
    • "MobsWith0ValueButNotStatueSpawn" - some mobs have value 0 like statue spawned mobs, but are actually hostile mobs (like those little eyes from Eye of Cuthuhlu), so this list is for plugin to not consider them StatueSpawns.
    Files:
    ChangeLog:
    • v 0.24 - changed npc.type to npc.netID
    • v 0.23
      - database lock fix.
    • v 0.21
      • added Passive region type. Useful for ReplaceMobs regions.
    • v0.20
      • TShock 4.0 release references updated
      • added per region settings
      • added Repel region mode
      • added ReplaceMob mode
    • v 0.17
      • based on tshock4.0 pre-release
      • fixed a problem with regions deletion.
    • v 0.16
      • pulled MySQL support. Now saves in SQLite format for all users
    • v 0.15
      • fixed MySQL error (seems not)
    • v 0.1
      • initial release
    Donate if you support the developer
    [IMG]
    radishes likes this.
  2. popstarfreas Active Member

    Cool any chance of adding an AFK zone or updating the other plugin? Its nice to send people to a zone where they wont die or you can see when they are AFK.
  3. InanZen TShock Plugin Developer

    I might do it in another plugin, since i want this one to stay lightweight
    popstarfreas likes this.
  4. popstarfreas Active Member

    that was what i was implying but yes it would be great if you could make it as the other one doesn't look like its going to be maintained but it did have some great ideas.
    I also have one problem : What if i want to add diemob to an area but not protect it?
  5. DankBud TShock Supporter

    first time trying this.
    Code:
    6/15/2012 7:05:15 PM
    MySql.Data.MySqlClient.MySqlException (0x80004005): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''Region' TEXT PRIMARY KEY  UNIQUE, 'WorldID' INTEGER    )' at line 1
      at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
      at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId)
      at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId)
      at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
      at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
      at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
      at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
      at TShockAPI.DB.DbExt.Query(IDbConnection olddb, String query, Object[] args)
      at TShockAPI.DB.SqlTableCreator.EnsureExists(SqlTable table)
      at DieMob.DieMobMain.DieMob_Create()
      at DieMob.DieMobMain.SetupDb()
      at DieMob.DieMobMain.Initialize()
      at PluginContainer.Initialize()
      at Terraria.ProgramServer.Initialize(Main main)
      at Terraria.ProgramServer.Main(String[] args)
  6. InanZen TShock Plugin Developer

    Seems i was using wrong syntax for MySQL, i've changed it from VarChar to text now so it should be fine.
    Please let me know, as i cannot test it on MySQL
  7. DankBud TShock Supporter

    Nope same crash.
  8. InanZen TShock Plugin Developer

    oh my i seem to have been using only Sqlite query creator.
    this time fixed for sure:
    Code:
    -            SqlTableCreator SQLcreator = new SqlTableCreator(db, new SqliteQueryCreator());
            100    
    +            SqlTableCreator SQLcreator = new SqlTableCreator(db, db.GetSqlType() == SqlType.Sqlite ? (IQueryBuilder)new SqliteQueryCreator() : new MysqlQueryCreator());
  9. DankBud TShock Supporter

    Code:
    6/17/2012 9:12:39 AM
    MySql.Data.MySqlClient.MySqlException (0x80004005): BLOB/TEXT column 'Region' used in key specification without a key length
      at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
      at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId)
      at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId)
      at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
      at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
      at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
      at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
      at TShockAPI.DB.DbExt.Query(IDbConnection olddb, String query, Object[] args)
      at TShockAPI.DB.SqlTableCreator.EnsureExists(SqlTable table)
      at DieMob.DieMobMain.SetupDb()
      at DieMob.DieMobMain.Initialize()
      at PluginContainer.Initialize()
      at Terraria.ProgramServer.Initialize(Main main)
      at Terraria.ProgramServer.Main(String[] args)
  10. InanZen TShock Plugin Developer

  11. cccdfern Member

    Well, it booted with that one, so that's a sure sign of part of it working :). or not, can't execute any commands :s
    (from errorlog)
    Code:
    Exception while trying to load: DieMob.dll
    Could not load file or assembly '28586 bytes loaded from TerrariaServer, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
    Stack trace:
      at System.Reflection.RuntimeAssembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection, SecurityContextSource securityContextSource)
      at System.Reflection.Assembly.Load(Byte[] rawAssembly)
      at Terraria.ProgramServer.Initialize(Main main)
    
  12. InanZen TShock Plugin Developer

    are you using an old tshock version?
  13. cccdfern Member

    nope, TShock 3.9.0.0526
  14. Guiyran Member

    I'll give this a test on my offsite dedi. Hoping it works. I'm looking for a diemob, but dont need the whole prison/jail thing. I will be sad if it turns to sqlight, but if it cant be helped then oh well.
  15. Guiyran Member

    Tested without success in mysql. I double checked to make sure I had your lasted upload.

    I get this...

    Code:
    6/26/2012 7:50:42 PM
    MySql.Data.MySqlClient.MySqlException (0x80004005): BLOB/TEXT column 'Region' used in key specification without a key length
      at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
      at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId)
      at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId)
      at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
      at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
      at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
      at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
      at TShockAPI.DB.DbExt.Query(IDbConnection olddb, String query, Object[] args)
      at TShockAPI.DB.SqlTableCreator.EnsureExists(SqlTable table)
      at DieMob.DieMobMain.SetupDb()
      at DieMob.DieMobMain.Initialize()
      at PluginContainer.Initialize()
      at Terraria.ProgramServer.Initialize(Main main)
      at Terraria.ProgramServer.Main(String[] args)
  16. InanZen TShock Plugin Developer

    ok, i've pulled MySQL support as promised :)
    So v0.16 should now work for everybody
    yay!
  17. bman New Member

    no error log but as far as I can tell NPC's don't respawn (possibility of a plugin conflict maybe and yes I am using your version) (the other plugin is the infinitechest plugin
  18. InanZen TShock Plugin Developer

    can you explain what do you mean by "NPCs dont respawn"?
  19. bman New Member

    simple as that (yes I made a new world when I started both plugins btw) and I mean that when ever the guide is killed even waiting for a day to pass in terraria or using tshock commands to speed up the process the guide doesn't respawn

    only way to respawn the guide is to use the /spawnmob command atleast

    yes latest Tshock
  20. InanZen TShock Plugin Developer

    that has nothing to do with this plugin :rolleyes:

Share This Page