# Configuration

## Default config.yml

{% code title="CrownStoreData/config.yml" overflow="wrap" lineNumbers="true" expandable="true" %}

```yaml
#
# Thank you for purchasing CrownStoreData!
# If you have any questions, suggestions or need help, please do not hesitate and
# join our discord: https://dsc.gg/crowndevelopment to ask for help!
# We are there to assist you.
#
# By purchasing this plugin you are accepting the BBB terms as well as
# our terms that can be found in our discord.
#

# you can obtain your license in our discord! https://dsc.gg/crowndevelopment
# paste your license key in here
license: paste-here

# enable this to send various messages to console
debug-mode: false

##################################################################
#                       DATA CONFIGURATION                       #
#                    dsc.gg/crowndevelopment                     #
##################################################################
storage:
  method: h2 # you can choose between H2 and MySQL and MariaDB. MySQL and MariaDB are recommended
  data:
    host: crownhost
    database: crowndatabase
    username: crownuser
    password: "crownpassword"

    # sets the maximum size of the MySQL connection pool.
    #   https://github.com/brettwooldridge/HikariCP/wiki/About-Pool-Sizing

    pool-settings:
      maximum-pool-size: 10
      minimum-idle: 10
      maximum-lifetime: 1800000
      keepalive-time: 0
      connection-timeout: 5000

store:
  provider: manual # you can choose between: tebex, craftingstore, manual
  secret: paste-here

  # how to find your secret
  # on tebex: Tebex Dashboard -> Integrations > Gameservers > Show Secret Key > Secret Key
  # on crafting store: Dashboard -> Webstore > Servers > Reveal Token
  # on manual: not needed

# when running the plugin on multiple servers, you can choose where to fetch the data
# one server will fetch the data and handle logic, the others will only read from the database
# this only works when storage.method is set to mysql or mariadb
data:
  fetch:
    database: false
    store: true
  save:
    database: true

payment:
  check-amount: 10  # how many payments the plugin should read with each update looking for new payments
  queue-time: 200 # how many ticks it takes for the process queue to process the next payment in line

interval:
  payment-data-update: 30 # how often the plugin will request data to process payments
  goal-data-update: 30 # how often the plugin will request data to update goals
  sales-data-update: 0 # how often the plugin will send requests, updating its sales data in seconds (0 to disable)
  ranking-data-update: 30 # how often the plugin will update the rankings in seconds (0 to disable)
  sale-reminder: 0 # how often the sale reminder is sent in seconds (0 to disable)

##################################################################
#                     PURCHASE CONFIGURATION                     #
#                    dsc.gg/crowndevelopment                     #
##################################################################
# purchases with a value below this amount will not be broadcasted in game.
min-amount-for-broadcast: 0

# date format is: yyyy-MM-dd - payments younger that this will be completely ignored
ignore-payments-older-than: "2000-01-01"

# disable this to not fetch skin data for the purchase message
use-player-head-in-purchase-message: true

commands:
  on-purchase: [ ] # commands that are executed after every purchase
  on-update: [ ] # commands that are executed after every data update

##################################################################
#                  COMMUNITY GOAL CONFIGURATION                  #
#                    dsc.gg/crowndevelopment                     #
##################################################################
goal:
  mode: internal # you can choose between: internal, external
  bar:
    percentage: 2.0 # the percentage a single bar represents - double from 1 to 100
    display-mode: solid # you can choose between solid and gradient
    full: "&a|" # the bar that is reached
    empty: "&c|" # the bar that is not reached yet
    gradient: "#ffffff:#000000" # separate the two hex codes with a :
  completion-commands: [ ] # these commands are executed after a goal is completed
  milestones: [ ] # percentages that will count as a milestone towards the community goal

##################################################################
#                  DISCORD WEBHOOK CONFIGURATION                 #
#                    dsc.gg/crowndevelopment                     #
##################################################################
webhook:
  enabled: false
  url: url-here

  embeds:
    purchase: false
    goal: false
    sale: false

  purchase-images:
    mode: random # you can choose between: random, mapped
    default-url: "default"
    map: # if mode is mapped - this contains the package id to url mappings
      12345: "url"

##################################################################
#                     GG WAVE CONFIGURATION                      #
#                    dsc.gg/crowndevelopment                     #
##################################################################
gg-wave:
  enabled: false
  tiers:
    one:
      display-name: "&f&lONE"
      min-amount: 10 # this is the minimum a player has to spend to start this tier
      always-trigger: false # enabling this will always trigger the ggwave no matter the input
      keep-original-message: false # this will keep the players original message in the ggwave message
      trigger-text: "gg" # the text players have to type for the gg wave
      duration: 10 # duration of the ggwave in seconds
      design:
        type: RAINBOW # choose from: RAINBOW, SOLID, SOLIDRAINBOW, GRADIENT
        bold: false
        solid-color: ""
        solid-rainbow-colors: [ ]
        gradient: "#ffffff:#000000" # separate the two hex codes with a :
      commands: # the commands that are executed when a player types to receive a reward
        - "eco give %player% 100"

##################################################################
#                     FIREWORK CONFIGURATION                     #
#                    dsc.gg/crowndevelopment                     #
##################################################################
fireworks:
  enabled: false
  mode: player # you can choose between player and all
  power: 1
  effects:
    BALL_LARGE:
      colors:
        - "#34eb7d"
        - "#ec40ff"
        - "#4046ff"
      flicker: true
      trail: true

##################################################################
#                    BLACKLIST CONFIGURATION                     #
#                    dsc.gg/crowndevelopment                     #
##################################################################
blacklist:
  enabled: false

  # purchases containing these package ids won't be displayed in game or in discord
  # they will still be loaded into the system, calculated in ranking etc
  packages:
    - 12345
    - 123456

  # purchases made under any name in this list won't be displayed in game or in discord
  # all names have to be in lower case
  # they will still be loaded into the system, calculated in ranking etc
  names:
    - obeeyyyy
```

{% endcode %}

## What these values mean

### license

* `license`: Your license key. You can find everything you need to know about the license system [here](https://obey.gitbook.io/wiki/core/guides/our-license-system).

### debug-mode

* `debug-mode`: Either `true` or `false`. Toggles debug messages in the console.

### storage

* `storage`:
  * `method`: You can choose between `h2`, `mysql` and `mariadb`. Using `myslq` or `mariadb` will require configuration of the next `data` segment.
  * `data`:
    * `host`: Hostname of you database.
    * `database`: Logical name of your database
    * `username`: Username for authentication.
    * `password`: Password for authentication.
    * `pool-settings`: You can read more about pool settings [here](https://github.com/brettwooldridge/HikariCP/wiki/About-Pool-Sizing).
      * `maximum-pool-size`:
      * `maximum-idle`:
      * `maximum-lifetime`:
      * `keepalive-time`:
      * `connection-timeout`:

### store

* `store`:

  * `provider`: You can choose between `manual`, `Tebex` and \`\`Craftingstore\`.
  * `secret`: When using `Tebex` or `Craftingstore`. Put your store secret here.

  **Where to get your store secret from**

  > **On Tebex**: Tebex Dashboard -> Integrations > Gameservers > Show Secret Key > Secret Key

  > **On Craftingstore**: Dashboard -> Webstore > Servers > Reveal Token

  **Explanation of manual mode**

  > Manual mode is used for all store providers that are not integrated into CSD yet. Instead of fetching payment data from an API, payments are registered with the /csd manualpayment command. This command will need to be executed from your webstore.

### data

* `data`:
  * `fetch`:
    * `database`: Either `true` or `false`. Toggles reading data from the database. (This does not include the initial fetch on load)
    * `store`: Either `true` or `false`. Toggles reading data from the store api.
  * `save`:
    * `database`: Either `true` or `false`. Toggle saving data to the database.

### payment

* `payment`:
  * `check-amount`: The amount of payments that are fetched with each update call. Not needed in `manual` mode.
  * `queue-time`: The ticks the process queue waits until processing the next payment in queue. While loading all payments you might want to lower this.

### min-amount-for-broadcast

* `min-amount-for-broadcast`: The minimum value a purchase has to have to be broadcasted in-game and in discord.

### ignore-payments-older-than

* `ignore-payments-older-than`: Payments older that this date will be completely ignored. Not needed in `manual` mode.

### use-player-head-in-purchase-message

* `use-player-head-in-purchase-message`: Either `true` or `false`. Toggles fetching for skin information for the player head in the purchase message.

### interval

* `interval`: These values are represented in seconds. The value `0` will `disable` these features.
  * `payment-data-update`: The time that has to pass before payment data is fetched again. Not needed in `manual` mode.
  * `goal-data-update`: The time that has to pass before goal data is fetched again. Not needed in `manual` or `internal` mode.
  * `sales-data-update`: The time that has to pass before sale data is fetched again. Not needed in `manual` mode.
  * `ranking-data-upate`: The time that has to pass before the ranking data is recalculated.
  * `sale-reminder`: The time that has to pass before the sale broadcast is sent again. Does not work for `manual` mode.

### commands

* `commands`:
  * `on-purchase`: An Array containing commands that will be executed by the server when a purchase is made.
  * `on-update`: An Array containing commands that will be executed by the server with every data fetch. Does not work for `manual` mode.

### goal

* `goal`:

  * `mode`: Either `internal` or `external`.
  * `bar`:
    * `percentage`: This is the percentage a single bar represents. So when its `1`, there will be `100` bars. When its `5`, there will be `20` bars.
    * `display-mode`: You can choose between `solid` and `gradient`. With solid it will simply use the `full` and empty `bars`. With gradient you want to remove the color from `full`.
    * `full`: The string that represents a full bar.
    * `empty`: The string that represents an empty bar.
    * `gradient`: A string containing hex color codes separated with a `:` to build the gradient.
  * `completion-commands`: An Array containing commands that will be executed on goal completion
  * `milestones`: An Array containing the goal milestone percentages.

  **What's the difference between internal and external goal modes ?**

  > Internal mode lets the plugin handle all goal logic. So you just create a goal using the commands. Set the target and current values and use the id from the goal list. External mode will make the plugin read goal data from the store's API. Only available for `Tebex` and `Craftingstore`.

### webhook

* `webhook`:
  * `enabled`: Either `true` or `false`. What it does should be clear.
  * `url`: Your webhook URL.
  * `embeds`: These are either `true` or `false` and toggle the individual embeds.
    * `purchase`:
    * `goal`:
    * `sale`:
  * `purchase-images`:

    * `mode`: Either `random` or `mapped`
    * `default-url`: This acts as a fallback URL for the `mapped` mode.
    * `map`: Simple key value pairs. Key represents package id and value an URL for the image.

    **Example of mapped mode for purchase-image**

    ```yml
    purchase-images:
        mode: random # you can choose between: random, mapped
        default-url: "default"
        map:
        12345: "https://your image url"
    ```

### gg-wave

* `gg-wave`:
  * `enabled`: Either `true` or `false`. What it does should be clear.
  * `tiers`
    * `one`: The tier name.
      * `display-name`: The tier display name. Used as an internal placeholder for messages.
      * `min-amount`: The minimum value a purchase has to have to trigger this GGWave Tier.
      * `always-trigger`: This will allow all messages sent to trigger a ggwave instead of just the allowed `tigger-text`.
      * `keep-original-message`: This will keep the players message in the ggwave format instead of replacing it with `ggwave-message-text` from `messages.yml`.
      * `trigger-text`: The text players have to type to trigger in the GGWave. `all` can be used to allow any input.
      * `duration`: The duration of the GGWave in seconds.
      * `design`:
        * `type`: Either `rainbow`, `solid`, `solidrainbow`, `gradient`
        * `bold`: Either `true` or `false`.
        * `solid-color`: The color to use for `solid` mode.
        * `solid-rainbow-colors`: An array of colors to cycle through in `solidrainbow` mode.
        * `gradient`: A string containing two colors separated with a `:` to build the gradient.
      * `commands`: An array of commands that are executed once per ggwave per player.

### fireworks

* `fireworks`:

  * `enabled`: Either `true` or `false`.
  * `mode`: Either `player` or `all`. Should be clear.
  * `power`: Power for the firework.
  * `effects`: You can put the effects in here, follow the efect object structure.

  **Example for a firework effect**

  ```yml
  BALL_LARGE:
    colors:
      - "#34eb7d"
      - "#ec40ff"
      - "#4046ff"
    flicker: true
    trail: true
  ```

### blacklist

* `backlist`:
  * `enabled`: Either `true` or `false`.
  * `packages`: An array containing package ids. Purchases containing these ids will not be broadcasted.
  * `names`: An array containing player names. Purchases from players with these names will not be broadcasted.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://obey.gitbook.io/wiki/storedata/configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
