Git Product home page Git Product logo

spenttime's People

Contributors

dependabot[bot] avatar imdmk avatar mend-bolt-for-github[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

andersonwest

spenttime's Issues

Support for 1.21

I'm running a purpur server on 1.21 and the commands don't work. Seems like this plugin needs updating.

Server console outputs this:

[13:55:20 ERROR]: Error occurred while enabling SpentTime v1.0.6 (Is it up to date?)
java.lang.ExceptionInInitializerError: null
at SpentTime v1.0.6.jar/com.github.imdmk.spenttime.gui.settings.GuiItemSettings.(GuiItemSettings.java:49) ~[SpentTime v1.0.6.jar:?]
at SpentTime v1.0.6.jar/com.github.imdmk.spenttime.gui.settings.GuiSettings.(GuiSettings.java:29) ~[SpentTime v1.0.6.jar:?]
at SpentTime v1.0.6.jar/com.github.imdmk.spenttime.configuration.implementation.PluginConfiguration.(PluginConfiguration.java:36) ~[SpentTime v1.0.6.jar:?]
at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62) ~[?:?]
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502) ~[?:?]
at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128) ~[?:?]
at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:304) ~[?:?]
at java.base/java.lang.Class.newInstance(Class.java:725) ~[?:?]
at SpentTime v1.0.6.jar/com.github.imdmk.spenttime.lib.eu.okaeri.configs.ConfigManager.create(ConfigManager.java:22) ~[SpentTime v1.0.6.jar:?]
at SpentTime v1.0.6.jar/com.github.imdmk.spenttime.configuration.ConfigurationFactory.create(ConfigurationFactory.java:28) ~[SpentTime v1.0.6.jar:?]
at SpentTime v1.0.6.jar/com.github.imdmk.spenttime.SpentTime.(SpentTime.java:93) ~[SpentTime v1.0.6.jar:?]
at SpentTime v1.0.6.jar/com.github.imdmk.spenttime.SpentTimePlugin.onEnable(SpentTimePlugin.java:11) ~[SpentTime v1.0.6.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:288) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:202) ~[purpur-1.21.jar:1.21-2265-8f0f20d]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:109) ~[purpur-1.21.jar:1.21-2265-8f0f20d]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:520) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.CraftServer.enablePlugin(CraftServer.java:643) ~[purpur-1.21.jar:1.21-2265-8f0f20d]
at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:592) ~[purpur-1.21.jar:1.21-2265-8f0f20d]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:756) ~[purpur-1.21.jar:1.21-2265-8f0f20d]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:518) ~[purpur-1.21.jar:1.21-2265-8f0f20d]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:361) ~[purpur-1.21.jar:1.21-2265-8f0f20d]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1225) ~[purpur-1.21.jar:1.21-2265-8f0f20d]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:333) ~[purpur-1.21.jar:1.21-2265-8f0f20d]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: com.github.imdmk.spenttime.lib.dev.triumphteam.gui.components.exception.GuiException: Could not retrieve displayName nor lore field for ItemBuilder.
at SpentTime v1.0.6.jar/com.github.imdmk.spenttime.lib.dev.triumphteam.gui.builder.item.BaseItemBuilder.(BaseItemBuilder.java:86) ~[SpentTime v1.0.6.jar:?]
... 24 more
[13:55:20 INFO]: [SpentTime] Disabling SpentTime v1.0.6

Using reset and reset-all without permission

Any players can use reset commands. I haven't given anyone permission and I can't even forbid them using luckperms. Other commands work as intended (only used by op or if given permission by luckperms)

git-Purpur-2176 (MC: 1.20.4)
SpentTime version 1.0.7

Config file:

#
# Configuration file for the SpentTime plugin.
#
# If you have a problem with plugin configuration, please create an issue on the project's github.
# However, if you like the plugin, leave a star for the project on GitHub.
# 
# Support site: https://github.com/imDMK/SpentTime/issues/new/choose
# GitHub: https://github.com/imDMK/SpentTime
#
# Check for plugin update after the administrator join to server?
checkForUpdate: true
# Specifies how often the player's spent time should be saved in the database
# Including a spent time top update
# Recommended value: 10m
spentTimeSaveDelay: 10m
#
# Gui settings
#
guiSettings:
  # This determines how many players are to be displayed in the player top
  # WARNING: Increasing this value may increase the consumption of database server resources
  # Recommended value: 10
  querySize: 20
  # The type of gui
  # Available types:
  # DISABLED - The list of players will be sent in the chat
  # STANDARD - Standard Gui that should be used when the player list does not exceed 10
  # PAGINATED - A Gui with pages that allow you to move between pages through items
  # SCROLLING - A Gui that allows you to scroll through items
  type: DISABLED
  # The title of spent time gui
  title: "<red>Топ проведённого времени<dark_gray>:"
  #
  # Gui item settings
  #
  guiItemSettings:
    # The head item name
    # {PLAYER} - The player name
    # {POSITION} - The player position
    # {TIME} - The player time
    headName: "<!italic><red>{POSITION}. <gray>Игрок <red>{PLAYER}"
    # The head item default lore
    headLore:
    - ""
    - "<!italic><green>Игрок провёл <red>{TIME} <green>на сервере<dark_gray>."
    - ""
    # The head item lore displayed when a player has permission to reset a player's spent time
    headLoreAdmin:
    - ""
    - "<!italic><green>The player has spent <red>{TIME} <green>on the server<dark_gray>."
    - ""
    - "<!italic><red>Click {CLICK} <gray>to <red>reset {PLAYER} <gray>spent time."
    # What type of button does the admin need to click to reset the player's spent time using the gui?
    # When the admin clicks a different button than the set one, nothing will happen
    # ClickTypes: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/ClickType.html
    headClickType: SHIFT_RIGHT
    # Include the item that is around the gui?
    fillBorder: true
    # The item that is around the gui
    borderItem:
      material: GRAY_STAINED_GLASS_PANE
    # Exit item
    # Set to -1 to disable
    exitItemSlot: 49
    exitItem:
      material: ACACIA_BUTTON
      item-meta:
        display-name: <red>Закрыть
    # Previous page item
    # Set to -1 to disable
    previousPageItemSlot: 46
    previousPageItem:
      material: ARROW
      item-meta:
        display-name: "<green>Предыдущая страница"
    # Used when the player clicks on the previous page but there is no page
    noPreviousPageItem:
      material: BARRIER
      item-meta:
        display-name: "<red>Предыдущей страницы нет"
    # Next page item
    # Set to -1 to disable
    nextPageItemSlot: 52
    nextPageItem:
      material: ARROW
      item-meta:
        display-name: "<green>Следующая страница"
    # Used when the player clicks on the next page but there is no page
    noNextPageItem:
      material: BARRIER
      item-meta:
        display-name: "<red>Следующей страницы нет"
#
# Scrolling gui settings
#
scrollingGuiSettings:
  # Specifies the direction in which the player list should move
  # Available directions:
  # HORIZONTAL - The items will be moving horizontally
  # VERTICAL - The items list will be moving vertically
  scrollType: VERTICAL
#
# Database settings
#
databaseSettings:
  # Database mode
  # Supported databases: SQLITE, MYSQL
  databaseMode: SQLITE
  hostname: localhost
  database: database
  username: root
  password: ExamplePassword1101
  port: 3306
#
# Notification settings
#
notificationSettings:
  # {TIME} - The spent player time
  playerSpentTime: "CHAT: <gray>Вы провели <red>{TIME} <gray>на сервере<dark_gray>."
  # {PLAYER} - Target name
  # {TIME} - Spent target time
  targetSpentTime: "CHAT: <gray>Игрок <green>{PLAYER} провёл <red>{TIME} на сервере<dark_gray>."
  topSpentTimeIsEmpty: "CHAT: <red>Топ проведённого времени пуст<dark_gray>."
  # Used when top spent time GUI is disabled
  topSpentTimeListFirst: "CHAT: <green>Топ 10 игроков по проведённому времени на серверу<dark_gray>:"
  # Used when top spent time GUI is disabled
  # {POSITION} - The player position
  # PLAYER} - The player name
  # {TIME} - The spent player time
  topSpentTimeList: "CHAT: <dark_gray>- <green>{POSITION} {PLAYER}<dark_gray>: <red>{TIME}"
  # {PLAYER} - The player name
  targetSpentTimeHasBeenReset: "CHAT: <green>Время игрока {PLAYER} было сброшенно<dark_gray>."
  globalSpentTimeHasBeenReset: "CHAT: <green>Время всех игроков было сброшенно<dark_gray>."
  # {PLAYER} - The player name
  # {TIME} - New spent player time
  targetSpentTimeHasBeenSet: "CHAT: <green>Время игрока {PLAYER} изменено на {TIME}<dark_gray>."
  # {PERMISSIONS} - Required permissions
  missingPermissions: "CHAT: <red>Недостаточно прав: <dark_red>{PERMISSIONS}<dark_gray>."
  playerNotFound: "CHAT: <red>Игрок не обнаружен<dark_gray>."
  # {USAGE} - Correct usage of command
  invalidUsage: "CHAT: <red>Неверное использование: <dark_red>{USAGE}<dark_gray>."
  # Used when there is more than one option to use a command
  invalidUsageFirst: "CHAT: <red>Неверное использование:"
  # {USAGE} - Correct usage of command
  # Used when there is more than one option to use a command
  invalidUsageList: "CHAT: <dark_gray>- <red>{USAGE}"

I've disabled GUI and translated most messages to Russian, which I suppose shouldn't cause any issues. I've tried to use spenttime without any other plugins installed and nothing changed

okaeri-configs-yaml-snakeyaml-5.0.1.jar: 1 vulnerabilities (highest severity is: 9.8)

Vulnerable Library - okaeri-configs-yaml-snakeyaml-5.0.1.jar

Path to dependency file: /build.gradle.kts

Path to vulnerable library: /home/wss-scanner/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.33/2cd0a87ff7df953f810c344bdf2fe3340b954c69/snakeyaml-1.33.jar

Found in HEAD commit: c36d9f0cb010e13d63409a35f58f1234578fdbaa

Vulnerabilities

CVE Severity CVSS Dependency Type Fixed in (okaeri-configs-yaml-snakeyaml version) Remediation Possible**
CVE-2022-1471 Critical 9.8 snakeyaml-1.33.jar Transitive N/A*

*For some transitive vulnerabilities, there is no version of direct dependency with a fix. Check the "Details" section below to see if there is a version of transitive dependency where vulnerability is fixed.

**In some cases, Remediation PR cannot be created automatically for a vulnerability despite the availability of remediation

Details

CVE-2022-1471

Vulnerable Library - snakeyaml-1.33.jar

YAML 1.1 parser and emitter for Java

Library home page: https://bitbucket.org/snakeyaml/snakeyaml

Path to dependency file: /build.gradle.kts

Path to vulnerable library: /home/wss-scanner/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.33/2cd0a87ff7df953f810c344bdf2fe3340b954c69/snakeyaml-1.33.jar

Dependency Hierarchy:

  • okaeri-configs-yaml-snakeyaml-5.0.1.jar (Root Library)
    • snakeyaml-1.33.jar (Vulnerable Library)

Found in HEAD commit: c36d9f0cb010e13d63409a35f58f1234578fdbaa

Found in base branch: main

Vulnerability Details

SnakeYaml's Constructor() class does not restrict types which can be instantiated during deserialization. Deserializing yaml content provided by an attacker can lead to remote code execution. We recommend using SnakeYaml's SafeConsturctor when parsing untrusted content to restrict deserialization. We recommend upgrading to version 2.0 and beyond.

Publish Date: 2022-12-01

URL: CVE-2022-1471

CVSS 3 Score Details (9.8)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: High
    • Integrity Impact: High
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://bitbucket.org/snakeyaml/snakeyaml/issues/561/cve-2022-1471-vulnerability-in#comment-64634374

Release Date: 2022-12-01

Fix Resolution: org.yaml:snakeyaml:2.0

Step up your Open Source Security Game with Mend here

triumph-gui-3.1.7.jar: 2 vulnerabilities (highest severity is: 7.7)

Vulnerable Library - triumph-gui-3.1.7.jar

Path to dependency file: /build.gradle.kts

Path to vulnerable library: /home/wss-scanner/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.8.0/c4ba5371a29ac9b2ad6129b1d39ea38750043eff/gson-2.8.0.jar

Found in HEAD commit: 71f9d7e270be4972f71dc98767844b434506958e

Vulnerabilities

CVE Severity CVSS Dependency Type Fixed in (triumph-gui version) Remediation Possible**
WS-2021-0419 High 7.7 gson-2.8.0.jar Transitive N/A*
CVE-2022-25647 High 7.5 gson-2.8.0.jar Transitive N/A*

*For some transitive vulnerabilities, there is no version of direct dependency with a fix. Check the "Details" section below to see if there is a version of transitive dependency where vulnerability is fixed.

**In some cases, Remediation PR cannot be created automatically for a vulnerability despite the availability of remediation

Details

WS-2021-0419

Vulnerable Library - gson-2.8.0.jar

Gson JSON library

Library home page: https://github.com/google/gson

Path to dependency file: /build.gradle.kts

Path to vulnerable library: /home/wss-scanner/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.8.0/c4ba5371a29ac9b2ad6129b1d39ea38750043eff/gson-2.8.0.jar

Dependency Hierarchy:

  • triumph-gui-3.1.7.jar (Root Library)
    • adventure-text-serializer-gson-4.16.0.jar
      • gson-2.8.0.jar (Vulnerable Library)

Found in HEAD commit: 71f9d7e270be4972f71dc98767844b434506958e

Found in base branch: main

Vulnerability Details

Denial of Service vulnerability was discovered in gson before 2.8.9 via the writeReplace() method.

Publish Date: 2021-10-11

URL: WS-2021-0419

CVSS 3 Score Details (7.7)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: High
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: Low
    • Integrity Impact: High
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Release Date: 2021-10-11

Fix Resolution: com.google.code.gson:gson:2.8.9

Step up your Open Source Security Game with Mend here

CVE-2022-25647

Vulnerable Library - gson-2.8.0.jar

Gson JSON library

Library home page: https://github.com/google/gson

Path to dependency file: /build.gradle.kts

Path to vulnerable library: /home/wss-scanner/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.8.0/c4ba5371a29ac9b2ad6129b1d39ea38750043eff/gson-2.8.0.jar

Dependency Hierarchy:

  • triumph-gui-3.1.7.jar (Root Library)
    • adventure-text-serializer-gson-4.16.0.jar
      • gson-2.8.0.jar (Vulnerable Library)

Found in HEAD commit: 71f9d7e270be4972f71dc98767844b434506958e

Found in base branch: main

Vulnerability Details

The package com.google.code.gson:gson before 2.8.9 are vulnerable to Deserialization of Untrusted Data via the writeReplace() method in internal classes, which may lead to DoS attacks.

Publish Date: 2022-05-01

URL: CVE-2022-25647

CVSS 3 Score Details (7.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-25647`

Release Date: 2022-05-01

Fix Resolution: com.google.code.gson:gson:gson-parent-2.8.9

Step up your Open Source Security Game with Mend here

okaeri-configs-yaml-snakeyaml-5.0.0-beta.5.jar: 1 vulnerabilities (highest severity is: 9.8) - autoclosed

Vulnerable Library - okaeri-configs-yaml-snakeyaml-5.0.0-beta.5.jar

Path to dependency file: /build.gradle.kts

Path to vulnerable library: /home/wss-scanner/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.33/2cd0a87ff7df953f810c344bdf2fe3340b954c69/snakeyaml-1.33.jar

Found in HEAD commit: 71f9d7e270be4972f71dc98767844b434506958e

Vulnerabilities

CVE Severity CVSS Dependency Type Fixed in (okaeri-configs-yaml-snakeyaml version) Remediation Possible**
CVE-2022-1471 Critical 9.8 snakeyaml-1.33.jar Transitive N/A*

*For some transitive vulnerabilities, there is no version of direct dependency with a fix. Check the "Details" section below to see if there is a version of transitive dependency where vulnerability is fixed.

**In some cases, Remediation PR cannot be created automatically for a vulnerability despite the availability of remediation

Details

CVE-2022-1471

Vulnerable Library - snakeyaml-1.33.jar

YAML 1.1 parser and emitter for Java

Library home page: https://bitbucket.org/snakeyaml/snakeyaml

Path to dependency file: /build.gradle.kts

Path to vulnerable library: /home/wss-scanner/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.33/2cd0a87ff7df953f810c344bdf2fe3340b954c69/snakeyaml-1.33.jar

Dependency Hierarchy:

  • okaeri-configs-yaml-snakeyaml-5.0.0-beta.5.jar (Root Library)
    • snakeyaml-1.33.jar (Vulnerable Library)

Found in HEAD commit: 71f9d7e270be4972f71dc98767844b434506958e

Found in base branch: main

Vulnerability Details

SnakeYaml's Constructor() class does not restrict types which can be instantiated during deserialization. Deserializing yaml content provided by an attacker can lead to remote code execution. We recommend using SnakeYaml's SafeConsturctor when parsing untrusted content to restrict deserialization. We recommend upgrading to version 2.0 and beyond.

Publish Date: 2022-12-01

URL: CVE-2022-1471

CVSS 3 Score Details (9.8)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: High
    • Integrity Impact: High
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://bitbucket.org/snakeyaml/snakeyaml/issues/561/cve-2022-1471-vulnerability-in#comment-64634374

Release Date: 2022-12-01

Fix Resolution: org.yaml:snakeyaml:2.0

Step up your Open Source Security Game with Mend here

Duration not showing more than 1 day

Duration does not support showing days, months, etc. If you have more than 24 hours, e.g. 26, it will not be 1 day 2 hours but 26 hours.
You need to implement your own converter like in litecommands.

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.