Giter Site home page Giter Site logo

konquest's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

konquest's Issues

Set up maven repo

Figure out how to create a Maven repo for Konquest? So other projects can include it for API reasons.

Improve Discord integrations

Auto Roles

Assign linked players a role for their kingdom, if one exists. Check the Discord server (guild) if a role exists that matches the name of the kingdom.

Give a player that role when:

  • They join the server, are linked and do not have the role
  • They are assigned to a kingdom
  • They link their account

Remove a kingdom role when:

  • They are exiled
  • They are assigned to a different kingdom
  • They unlink their account
  • They join the server and their kingdom no longer exists

When a kingdom is removed or renamed, do nothing. The old role in Discord should have no affect, because any kingdom messages, for renamed kingdoms, will not go to the linked channel any more.

Embedded file support

Allow users to include "shortcode" or placeholders in messages used with discord, like image files and user/role mentions.

Maybe create a separate config file, just for discord messages. Users would have to put the image files into the plugins/Konquest folder that they want to embed in the messages.

Message Customization

Allow users to set colors and emojis in Discord messages.

Change all data storage to SQL

Currently, only player data is stored in the SQL database. All territory data is stored in YML files. This may not scale very well. Investigate ways to store territory data in the SQL database instead. If a good solution is found, then implement data storage for

  • Camps (CampManager.java)
  • Kingdoms (KingdomManager.java)
  • Ruins (RuinManager.java)
  • Sanctuaries (SanctuaryManager.java)

Also, to support version migration, implement a system for transferring old YML data into the SQL database.

All kingdoms get removed when upgrading from MC 1.19.4 to 1.20

From report:

In the database it still shows the prefixes they set when they had kingdoms.
MariaDB [konquest]> SELECT * FROM players;
+--------------------------------------+------------+--------------+-----------+---------+----------+--------+
| uuid | kingdom | exileKingdom | barbarian | prefix | prefixOn | custom |
+--------------------------------------+------------+--------------+-----------+---------+----------+--------+
| redacted UUID | Barbarians | Barbarians | 1 | PEASANT | 0 | |
| redacted UUID | Barbarians | Barbarians | 1 | NOBLE | 1 | |
| redacted UUID | Barbarians | Barbarians | 1 | PEASANT | 0 | |
| redacted UUID | Barbarians | Barbarians | 1 | CLERIC | 1 | |
| redacted UUID | Barbarians | Barbarians | 1 | PEASANT | 1 | |
| redacted UUID | Barbarians | Barbarians | 1 | BARON | 1 | |
+--------------------------------------+------------+--------------+-----------+---------+----------+--------+
6 rows in set (0.001 sec)

MariaDB [konquest]>

We made 3 kingdoms on MC 1.19.4 using Konquest 0.11.2. When I updated the server jar to the paper 1.20 (build 19), then everyone logged in and it said, "You are now a barbarian" in chat, and their places weren't kingdoms anymore. We haven't tried remaking the kingdoms yet, that might work.

Example log:
https://pastebin.com/DeHR5bUQ

Other Thoughts

  • Try to reproduce
  • Add console messages for kingdom load status, without debug, like when no kingdoms could be loaded
  • Make automatic backups of data files

Add more camp clan options

Offline joining

Add a core config option to allow barbarian players to join their camp to a clan when all clan members are offline.

  • True: A barbarian may place a camp and join a clan when all other clan members are offline (default).
  • False: A new camp cannot be added to a clan when all other clan members are offline.

Prevent enemy travel

Copied from #95

Similar to core.kingdoms.no_enemy_travel, create a new option core.camps.no_enemy_travel, which prevents any player that is no the owner from traveling while inside of a camp.

The current logic will prevent non-barbarians from traveling while inside of a camp, but any barbarian can travel inside of any camp.

Update chest shop integrations

Konquest can integrate with QuickShop in order to add shop constraints based on territories and player relationships. This integration has gotten out of date and only supports an older version of QuickShop.

Update to the latest version of QuickShop (maybe using Gradle) and make sure chest shops work as described on the public Konquest wiki.

Also, investigate other chest shop plugins to integrate, maybe Chest Shop if that's still around and updated.

  • Allow players in admin bypass to create shops in sanctuary, notify admins when protected
  • Prevent making shops inside templates within sanctuaries
  • Add property flag: shop - allows all players to create shops

Set up Gradle

Update the project to use Gradle for dependencies, build automation, etc.

Pruning an offline player sometimes fails

Context is that there's a kingdom with a master and an officer. The master exceeds the offline timeout and attempts to be pruned. During the forced exile, the officer was set as the new master, and the old master's UUID was removed from the kingdom's membership list. However, it appears that the old master's kingdom was not updated to Barbarians, and their isBarbarian flag remains false. This data is not flushed to the database either.

On subsequent offline timeout pruning intervals, the old master is identified as not a Barbarian at attempts to force exile again, but it always errors out because the player is not a member of their kingdom, error shown below:

image

Things to investigate:

  • How did the offline player get into this state?
  • Is there a logic error on the first time they were pruned, where the officer was successfully given master, and that somehow upset the membership accounting?
  • Maybe its fine if the membership doesn't exist, try adjusting the error conditions.

IllegalStateException thrown by IntelliJ when setting up the repo

When setting up the konquest repository with IntelliJ in macOS 13.3.1, the following exception is thrown during the Gradle sync:

java.lang.IllegalStateException: Module entity with name: konquest should be available

This appears to be an issue with the latest version of IntelliJ as documented in this YouTrack ticket: https://youtrack.jetbrains.com/issue/IDEA-317606/

The workaround at the moment is to change the casing of the root project name in settings.gradle.kts from uppercase to all lowercase.

Add Dynmap color customization

  • Add a sub-command to /k kingdom to set the web map color of a kingdom.
  • /k kingdom webcolor X - master only
  • /k admin kingdom (kingdom) webcolor X

The argument X can be any enum name of the Color enum (e.g. RED, NAVY, PURPLE, etc). It can also be a hex string with format #RRGGBB. Including the color argument sets the color. Omitting the color argument displays the current color.

  • Add a core.yml option to enable kingdom masters to set the webcolor, or let only admins do it.

  • The webcolor needs to be a new field in the KonKingdom class, and needs to be stored in kingdoms.yml.

Add more permissions

  • Create barbarian camp when placing bed konquest.create.camp
  • Settle towns (already command permission for /k settle?) konquest.create.town
  • Create kingdoms (extra perm over existing command /k kingdom) konquest.create.kingdom

Add API for managing ruins

Add API manager and methods for creating and managing ruins.

The ruin manager and ruin model classes already exist, but needs to include methods for managing critical blocks and spawn points for ruin golems.

Add membership property flags

  • Add new property flags that apply to towns, capitals and kingdoms:
  • JOIN - allows players to join or be invited
  • LEAVE - allows players to leave or be kicked
  • PROMOTE - allows player promotion to knight/officer
  • DEMOTE - allows player demotion to resident/member
  • TRANSFER - allows lord/master to transfer
  • Update admin flag command to apply flag to all valid flag holders.
  • Add sub-command to admin flag command to set to default (from properties.yml).
  • Add info menu properties for membership flags.

Add config options to change SQL table names

Add a config option to core.yml under core.database.mysql, called prefix, which is by default a string kq_.

The option will be used (when not an empty string) to prepend to the SQL table names:

  1. players
  2. stats
  3. directives
  4. customs

This prefix option should help prevent the likelihood of conflicting table names in databases shared with other plugins.

There also needs to be logic to attempt to recover old Konquest tables and copy them into the new tables when the prefix changes, and when upgrading from the original non-prefixed tables.

Unit testing

I don't know if this is practical for Konquest, but it would be really neat if there were automated unit tests to verify lots of core functionality of the plugin. Right now, every feature and mechanic is tested manually in a Spigot or Paper server. I only test with 2 player accounts, so I could possibly miss some big issues related to larger scale servers.

Ideally, there would be some kind of virtual Spigot server with virtual players, and a test suite that simulates a player joining, creating towns, and doing other common things. There would also be lower-level unit tests for all of the manager and model classes.

This would take a lot of work to complete, so initially just research possible approaches/solutions to see if this is feasible. Document findings in this issue.

Reduce the lag of pasting monuments

Currently town monuments are pasted from template all in one tick. Update the BlockPaster class to extend BukkitRunnable to only paste a single Y level of the monument every tick until it is complete.

Make javadoc tool tips appear when Konquest is imported in other projects

When Konquest is included as a dependency in other projects, either as an imported JAR or maven repo, API methods should display a tooltip with javadoc info displayed.

See this example in Eclipse, when a Java String method is being typed:
image

But when a Konquest API method is hovered:
image

I want the Konquest methods to show info from the javadoc found in the doc folder. I'm assuming that doc must be included in the Konquest JAR somehow, and maybe some other options are needed during the build.

Enhance economy mechanics

Give towns a central bank, where town lord is the owner. Bank is re-created for new lords and transfers funds. Town residents can deposit into bank, which uses funds to pay for upgrades etc.

Add config options for kingdom taxes and banks:

  • Interval
  • Percentage of player account per interval
  • Minimum account balance to be taxed
  • Tax disbursement global or local
  • Bank interest rate over interval

Every interval, all kingdom members who are residents of at least 1 town have percentage of account balance withdrawn. If set to global disbursement, all members taxes are totaled and divided equally between towns with enabled tax income. If local disbursement, a player's taxes will only go to the towns they are resident of.

Allow town lords to enable tax income (disabled by default) to pull a percentage of total kingdom taxes. The more towns with enabled income tax, the less each one gets, given fixed kingdom population.

Town info displays bank balance, tax rate, etc.

Server admins can choose an interest rate on central bank accounts to grow savings. Or add tax rate, interest rate to per-kingdom flags.

If economy provider does not implement banks, use original bankless system of pulling from lord's player account for town upgrades. Taxes will be disabled, as well as interest rates.

Towns have a central account, either a bank "owned" by lord, or the lord's player account.
Add town options for:

  • Absolute tax amount
  • Enable town taxesAdd config options for:
  • Tax interval in seconds
  • Minimum taxable account balance for players
  • Enable tax feature
  • Central account interest rate

Taxes will be deposited into each town's central account. Only online players are taxed.

Add new town upgrades

Buff Iron Golems

Increase health and attack damage

Level 1: Health increased by 1 heart
Level 2: Health increased by 2 hearts, damage increased by 1
Level 3: Health increased by 3 hearts, damage increased by 2

When upgrade is applied, search for all nearby iron golems to apply buff. When new golems are created, check for upgrade and apply buffs.

Apply some potion effect for visual indicator of buffed golem.

Killer Bunny

Spawns a killer bunny to defend critical blocks in the monument.

Target enemies that interact with critical blocks. Stop target when they leave monument chunk or die. Try to path to keep within monument? or teleport if it gets too far away... ?

Command framework re-write

Overview

Change the command framework to be more modular and easier to manage the commands, currently, there is a lot of repetitive code that does similar things, and could be refactored to be more optimized and easier to work with.

Add name tag timers above loot chests

Loot chests should have a visual indicator above them displaying the time left remaining before a loot chest can be opened, or if it is ready to be opened, the name tag should be "READY"

Make the admin flag command format nicer

Currently the command k admin flag (name) prints out a messy table of name-value pairs with a description.

image

  • Figure out how to line things up neater, add colors for "true" and "false", and improve overall text formatting.
  • Make the first line say "All Properties of <name>".

Beautify messages

Console messages

  • Improve formatting of plugin enable messages.

Make info more clear (which integrations are enabled, all checks, loading info, etc).

Menu item lore

  • Make item lore look better
  • All menu icons
  • TBD

General Info

Improve info about plugin mechanics.

  • Add kingdom payment info to kingdom icons? or kingdom info menu?

Patch 0.11.1

Work on minor fixes and adjustments.

  • #56
    • Tested
  • #50
    • Tested
  • Removing sanctuary does not refresh particle borders, make sure removing all territories refresh borders.
    • Tested
  • Add startup check for all offline players to ensure kingdom membership if the player has a kingdom assignment.
    • Tested
  • Admin kingdom transfer success does not print any chat messages, add something.
    • Tested
  • Make sure that offline pruning does not delete admin kingdoms.
    • Tested
  • Prevent endermen from picking up blocks in claimed territory.
    • Tested
  • #71
    • Tested
  • #72
    • Tested
  • #73
    • Tested
  • Make admin flag auto-complete only suggest valid flags
    • Tested
  • Make peaceful kingdom members protected from attacks and attacking others.
    • Tested

Improve command help

When a command is executed with incorrect arguments, instead of printing just the generic invalid params message, also print that command's help usage.

Also, update auto-complete so that it shows the expected next argument, if there is one.

Add event logging

Log actions to file:

  • Player join kingdom
  • Player exile
  • Player leave town
  • Player join town
  • Player travel
  • Town settle
  • Town capture
  • Town management (any /k town)
  • Kingdom creation
  • Kingdom disband
  • Kingdom management (any /k kingdom)

Capture actions in database table.
Add command to query logs with filtering.

Add more SQL support

Add MySQL and any other support options for databases in config.
Add more data to the database.

Add SQLite DB auto backups

By default, the SQL database uses SQLite with a Konquest.db file. This file can potentially become corrupted by external means. Add a feature in Konquest which periodically backs up the DB file every N days, up to X times before deleting the oldest backup.

Maybe also include an auto-restore feature where if the database cannot be loaded when a SQLITE_NOTADB error is detected, or other standard SQLITE malformed error, revert to the most recent backup file.

Port to IntelliJ

Change the project IDE to IntelliJ. From a fresh repo clone, the project should

  • Open with no warnings/errors
  • Build a valid JAR

Change all core config paths to use CorePath enums

The hard-coded String paths must be replaced with their counterpart enums in CorePath. Throughout the code, core.yml options are fetched using this common approach:

refreshTimeSeconds = konquest.getConfigManager().getConfig("core").getLong("core.monuments.loot_refresh",(long)0.0);

Most major classes have a reference to the main Konquest instance, konquest, either directly or via a superclass method getKonquest(). Core.yml settings are loaded into memory on plugin enable, and are accessed via the ConfigManager class, which can access the core config. Because this is so common, there is a convenience method, Konquest#getCore().

So, there are two changes for every occurrence of this core config access:

  1. Replace konquest.getConfigManager().getConfig("core") with konquest.getCore().
  2. Replace the String path with its corresponding enum, e.g. "core.monuments.loot_refresh" with CorePath.MONUMENTS_LOOT_REFRESH.getPath().

Search for all occurrences of getConfigManager().getConfig("core") to find most of these areas. If any String paths do not have a matching CorePath enum, leave it alone and record its location in this issue.

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.