nsporillo/GlobalWarming

Add proper temperature reset command

开放

#39 创建于 2019年10月2日

 (2 条评论) (0 个反应) (0 位负责人)Java (48 个派生)batch import
Acceptedenhancementgood first issuehelp wanted

仓库指标

星标
 (475 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

GlobalWarming works by taking the cumulative carbon scores on a per world basis and translating that into a temperature based on the configurable models files.

Right now we support a /gw debug temp <value> command which will manually override the worlds temperature by calculating the score that the desired temperature matches to and setting the worlds score in the database. However, we track a detailed record of player contributions and reductions which are linked to furnace and tree tables. This means that player scores remain what they are, so scoreboards and GW commands will show scores which do not add up to the current global carbon score.

Ideally we'd have this temperature reset command not destroy the referential integrity of the database. We can probably assume that if one wishes to reset the temperature, then they are okay with erasing all of the player contributions and reductions. The typical suggested workaround for when server owners want to reset their world is to:

  1. Shutdown the server
  2. Manually delete the H2 database files
  3. Restart the server

However if the owner is not using H2 and is instead using MySQL.. this is a more involved process. We want this command to simply purge all relevant tables and reload the internal GlobalWarming storage such that it is fully consistent.

贡献者指南