Compare commits
No commits in common. "master" and "dev1" have entirely different histories.
63 changed files with 1086 additions and 2112 deletions
40
.classpath
Normal file
40
.classpath
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/classes" path="src/main/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="optional" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||
<attributes>
|
||||
<attribute name="test" value="true"/>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||
<attributes>
|
||||
<attribute name="test" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="optional" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
|
@ -1,20 +0,0 @@
|
|||
on: [push]
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: docker
|
||||
container: debian:sid
|
||||
steps:
|
||||
- name: Prepare for installation
|
||||
run: apt update
|
||||
- name: Install JDK
|
||||
run: apt install --no-install-recommends -y openjdk-21-jdk-headless maven git nodejs
|
||||
|
||||
- name: Clone repository
|
||||
run: git clone https://git.m724.eu/Minecon724/realweather.git .
|
||||
|
||||
- name: Build
|
||||
run: mvn clean package
|
||||
- name: Upload artifacts
|
||||
uses: https://github.com/actions/upload-artifact@v3
|
||||
with:
|
||||
path: target/realweather-*.jar
|
3
.idea/.gitignore
vendored
3
.idea/.gitignore
vendored
|
@ -1,3 +0,0 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
|
@ -1,13 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="realweather" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
</component>
|
||||
</project>
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
|
@ -1,8 +0,0 @@
|
|||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="VulnerableLibrariesLocal" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="isIgnoringEnabled" value="true" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
|
@ -1,30 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="m724" />
|
||||
<option name="name" value="m724" />
|
||||
<option name="url" value="https://git.m724.eu/api/packages/Minecon724/maven" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="spigot-repo" />
|
||||
<option name="name" value="spigot-repo" />
|
||||
<option name="url" value="https://hub.spigotmc.org/nexus/content/repositories/snapshots/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
|
@ -1,12 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="temurin-21" project-jdk-type="JavaSDK" />
|
||||
</project>
|
|
@ -1,8 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/realweather.iml" filepath="$PROJECT_DIR$/realweather.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
|
@ -1,124 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Palette2">
|
||||
<group name="Swing">
|
||||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||
</item>
|
||||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||
<initial-values>
|
||||
<property name="text" value="Button" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="RadioButton" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="CheckBox" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="Label" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||
<preferred-size width="-1" height="20" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||
</item>
|
||||
</group>
|
||||
</component>
|
||||
</project>
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
23
.project
Normal file
23
.project
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>realweather</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -1,11 +1,9 @@
|
|||
If you're using a firewall, you must allow the following hosts:
|
||||
- updater:
|
||||
* git.m724.eu
|
||||
- core functionality:
|
||||
* rw-api.m724.eu
|
||||
- weather:
|
||||
* api.openweathermap.org
|
||||
- thunder:
|
||||
* ws1.blitzortung.org
|
||||
* ws7.blitzortung.org
|
||||
* ws8.blitzortung.org
|
||||
|
||||
Subject to change!
|
232
LICENSE
Normal file
232
LICENSE
Normal file
|
@ -0,0 +1,232 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
“This License” refers to version 3 of the GNU General Public License.
|
||||
|
||||
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
|
||||
|
||||
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
|
||||
|
||||
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
|
||||
|
||||
A “covered work” means either the unmodified Program or a work based on the Program.
|
||||
|
||||
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
|
||||
|
||||
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
|
||||
|
||||
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
|
||||
|
||||
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
|
||||
|
||||
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
|
||||
|
||||
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
|
||||
|
||||
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
|
||||
|
||||
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
|
||||
|
||||
A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
|
||||
|
||||
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
|
||||
|
||||
realweather
|
||||
Copyright (C) 2024 Minecon724
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
|
||||
|
||||
realweather Copyright (C) 2024 Minecon724
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <https://www.gnu.org/philosophy/why-not-lgpl.html>.
|
617
LICENSE.md
617
LICENSE.md
|
@ -1,617 +0,0 @@
|
|||
# GNU GENERAL PUBLIC LICENSE
|
||||
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
<https://fsf.org/>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this
|
||||
license document, but changing it is not allowed.
|
||||
|
||||
## Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom
|
||||
to share and change all versions of a program--to make sure it remains
|
||||
free software for all its users. We, the Free Software Foundation, use
|
||||
the GNU General Public License for most of our software; it applies
|
||||
also to any other work released this way by its authors. You can apply
|
||||
it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you
|
||||
have certain responsibilities if you distribute copies of the
|
||||
software, or if you modify it: responsibilities to respect the freedom
|
||||
of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the
|
||||
manufacturer can do so. This is fundamentally incompatible with the
|
||||
aim of protecting users' freedom to change the software. The
|
||||
systematic pattern of such abuse occurs in the area of products for
|
||||
individuals to use, which is precisely where it is most unacceptable.
|
||||
Therefore, we have designed this version of the GPL to prohibit the
|
||||
practice for those products. If such problems arise substantially in
|
||||
other domains, we stand ready to extend this provision to those
|
||||
domains in future versions of the GPL, as needed to protect the
|
||||
freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish
|
||||
to avoid the special danger that patents applied to a free program
|
||||
could make it effectively proprietary. To prevent this, the GPL
|
||||
assures that patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
## TERMS AND CONDITIONS
|
||||
|
||||
### 0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds
|
||||
of works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of
|
||||
an exact copy. The resulting work is called a "modified version" of
|
||||
the earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user
|
||||
through a computer network, with no transfer of a copy, is not
|
||||
conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices" to
|
||||
the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
### 1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work for
|
||||
making modifications to it. "Object code" means any non-source form of
|
||||
a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users can
|
||||
regenerate automatically from other parts of the Corresponding Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that same
|
||||
work.
|
||||
|
||||
### 2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not convey,
|
||||
without conditions so long as your license otherwise remains in force.
|
||||
You may convey covered works to others for the sole purpose of having
|
||||
them make modifications exclusively for you, or provide you with
|
||||
facilities for running those works, provided that you comply with the
|
||||
terms of this License in conveying all material for which you do not
|
||||
control copyright. Those thus making or running the covered works for
|
||||
you must do so exclusively on your behalf, under your direction and
|
||||
control, on terms that prohibit them from making any copies of your
|
||||
copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under the
|
||||
conditions stated below. Sublicensing is not allowed; section 10 makes
|
||||
it unnecessary.
|
||||
|
||||
### 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such
|
||||
circumvention is effected by exercising rights under this License with
|
||||
respect to the covered work, and you disclaim any intention to limit
|
||||
operation or modification of the work as a means of enforcing, against
|
||||
the work's users, your or third parties' legal rights to forbid
|
||||
circumvention of technological measures.
|
||||
|
||||
### 4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
### 5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these
|
||||
conditions:
|
||||
|
||||
- a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
- b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under
|
||||
section 7. This requirement modifies the requirement in section 4
|
||||
to "keep intact all notices".
|
||||
- c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
- d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
### 6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms of
|
||||
sections 4 and 5, provided that you also convey the machine-readable
|
||||
Corresponding Source under the terms of this License, in one of these
|
||||
ways:
|
||||
|
||||
- a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
- b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the Corresponding
|
||||
Source from a network server at no charge.
|
||||
- c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
- d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
- e) Convey the object code using peer-to-peer transmission,
|
||||
provided you inform other peers where the object code and
|
||||
Corresponding Source of the work are being offered to the general
|
||||
public at no charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal,
|
||||
family, or household purposes, or (2) anything designed or sold for
|
||||
incorporation into a dwelling. In determining whether a product is a
|
||||
consumer product, doubtful cases shall be resolved in favor of
|
||||
coverage. For a particular product received by a particular user,
|
||||
"normally used" refers to a typical or common use of that class of
|
||||
product, regardless of the status of the particular user or of the way
|
||||
in which the particular user actually uses, or expects or is expected
|
||||
to use, the product. A product is a consumer product regardless of
|
||||
whether the product has substantial commercial, industrial or
|
||||
non-consumer uses, unless such uses represent the only significant
|
||||
mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to
|
||||
install and execute modified versions of a covered work in that User
|
||||
Product from a modified version of its Corresponding Source. The
|
||||
information must suffice to ensure that the continued functioning of
|
||||
the modified object code is in no case prevented or interfered with
|
||||
solely because modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or
|
||||
updates for a work that has been modified or installed by the
|
||||
recipient, or for the User Product in which it has been modified or
|
||||
installed. Access to a network may be denied when the modification
|
||||
itself materially and adversely affects the operation of the network
|
||||
or violates the rules and protocols for communication across the
|
||||
network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
### 7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders
|
||||
of that material) supplement the terms of this License with terms:
|
||||
|
||||
- a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
- b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
- c) Prohibiting misrepresentation of the origin of that material,
|
||||
or requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
- d) Limiting the use for publicity purposes of names of licensors
|
||||
or authors of the material; or
|
||||
- e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
- f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions
|
||||
of it) with contractual assumptions of liability to the recipient,
|
||||
for any liability that these contractual assumptions directly
|
||||
impose on those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions; the
|
||||
above requirements apply either way.
|
||||
|
||||
### 8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your license
|
||||
from a particular copyright holder is reinstated (a) provisionally,
|
||||
unless and until the copyright holder explicitly and finally
|
||||
terminates your license, and (b) permanently, if the copyright holder
|
||||
fails to notify you of the violation by some reasonable means prior to
|
||||
60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
### 9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or run
|
||||
a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
### 10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
### 11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims owned
|
||||
or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within the
|
||||
scope of its coverage, prohibits the exercise of, or is conditioned on
|
||||
the non-exercise of one or more of the rights that are specifically
|
||||
granted under this License. You may not convey a covered work if you
|
||||
are a party to an arrangement with a third party that is in the
|
||||
business of distributing software, under which you make payment to the
|
||||
third party based on the extent of your activity of conveying the
|
||||
work, and under which the third party grants, to any of the parties
|
||||
who would receive the covered work from you, a discriminatory patent
|
||||
license (a) in connection with copies of the covered work conveyed by
|
||||
you (or copies made from those copies), or (b) primarily for and in
|
||||
connection with specific products or compilations that contain the
|
||||
covered work, unless you entered into that arrangement, or that patent
|
||||
license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
### 12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under
|
||||
this License and any other pertinent obligations, then as a
|
||||
consequence you may not convey it at all. For example, if you agree to
|
||||
terms that obligate you to collect a royalty for further conveying
|
||||
from those to whom you convey the Program, the only way you could
|
||||
satisfy both those terms and this License would be to refrain entirely
|
||||
from conveying the Program.
|
||||
|
||||
### 13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
### 14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in
|
||||
detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies that a certain numbered version of the GNU General Public
|
||||
License "or any later version" applies to it, you have the option of
|
||||
following the terms and conditions either of that numbered version or
|
||||
of any later version published by the Free Software Foundation. If the
|
||||
Program does not specify a version number of the GNU General Public
|
||||
License, you may choose any version ever published by the Free
|
||||
Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future versions
|
||||
of the GNU General Public License can be used, that proxy's public
|
||||
statement of acceptance of a version permanently authorizes you to
|
||||
choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
### 15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
|
||||
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
|
||||
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
|
||||
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
|
||||
CORRECTION.
|
||||
|
||||
### 16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
|
||||
CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
|
||||
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
|
||||
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
|
||||
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
|
||||
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
|
||||
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
### 17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
38
README.md
38
README.md
|
@ -1,15 +1,35 @@
|
|||
# realweather
|
||||
|
||||
For MC 1.19.4+ and Java 21+
|
||||
differences compared to v0:
|
||||
- no geoip mode, I think it doesn't fit as it's only cosmetical
|
||||
- as such, renamed modes:
|
||||
* `point` -> `static`
|
||||
* `globe` -> `dynamic`
|
||||
* usually there's just a boolean for dynamic
|
||||
- I wanted to do this even before this plugin: \
|
||||
lightning ⚡ in real time
|
||||
* if static, only time synced, random position \
|
||||
probably within some radius from the static point
|
||||
* if dynamic, position is also synced
|
||||
- commands, finally!
|
||||
|
||||
TODO (no order):
|
||||
- auto update
|
||||
- static mode for lightning
|
||||
- extensible: api (partially there)
|
||||
- airplanes? https://opensky-network.org/
|
||||
- more api providers, multiple api keys
|
||||
- snow
|
||||
- lightning effects
|
||||
- weather levels \
|
||||
it's not like there's strong rain or there's no rain \
|
||||
I'm not sure how yet
|
||||
- sunrise sunset
|
||||
- track the above in issues
|
||||
|
||||
### Building
|
||||
To compile, clone this repo and `mvn clean package`. \
|
||||
JAR will be in `target/`. Use the one without `original-`. \
|
||||
By default, it's signed with the test key.
|
||||
JAR will be in `target/`. Use the one without `original-`.
|
||||
|
||||
#### Signing
|
||||
A test (and default) keystore is provided:
|
||||
- keystore: `testkeystore.jks`
|
||||
- storepass: `123456`
|
||||
- alias: `testkey`
|
||||
Override with `-Djarsigner.`
|
||||
### Versioning
|
||||
Basically, 0.9.x are prereleases
|
68
dependency-reduced-pom.xml
Normal file
68
dependency-reduced-pom.xml
Normal file
|
@ -0,0 +1,68 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>eu.m724</groupId>
|
||||
<artifactId>realweather</artifactId>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<filtering>true</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactSet>
|
||||
<includes>
|
||||
<include>eu.m724:wtapi</include>
|
||||
<include>org.java-websocket:Java-WebSocket</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>eu.m724:*</artifact>
|
||||
<excludes>
|
||||
<exclude>META-INF/MANIFEST.MF</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
<minimizeJar>true</minimizeJar>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>724rocks</id>
|
||||
<url>https://git.724.rocks/api/packages/Minecon724/maven</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.20.6-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
</properties>
|
||||
</project>
|
|
@ -69,5 +69,4 @@ t = (longitude / 15) * 1000 * scale
|
|||
|
||||
accounting for sunrise and sunset
|
||||
TODO, idk yet without
|
||||
update: this is now possible with 0.8.0 api
|
||||
|
||||
|
|
100
pom.xml
100
pom.xml
|
@ -2,17 +2,12 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>eu.m724</groupId>
|
||||
<artifactId>realweather</artifactId>
|
||||
<version>1.0.0-alpha-6-SNAPSHOT</version>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<jarsigner.keystore>${project.basedir}/testkeystore.jks</jarsigner.keystore>
|
||||
<jarsigner.alias>testkey</jarsigner.alias>
|
||||
<jarsigner.storepass>123456</jarsigner.storepass>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
</properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
|
@ -20,8 +15,8 @@
|
|||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>m724</id>
|
||||
<url>https://git.m724.eu/api/packages/Minecon724/maven</url>
|
||||
<id>724rocks</id>
|
||||
<url>https://git.724.rocks/api/packages/Minecon724/maven</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
|
@ -29,29 +24,13 @@
|
|||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.19.4-R0.1-SNAPSHOT</version>
|
||||
<version>1.20.6-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<!-- Fix warning about vulnerabilities of things we don't use -->
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.yaml</groupId>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>eu.m724</groupId>
|
||||
<artifactId>wtapi</artifactId>
|
||||
<version>0.8.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>eu.m724</groupId>
|
||||
<artifactId>jarupdater</artifactId>
|
||||
<version>0.1.8</version>
|
||||
<version>0.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -62,15 +41,7 @@
|
|||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins> <!-- versions: https://maven.apache.org/plugins/ -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<version>3.1.1</version>
|
||||
<configuration>
|
||||
<allowTimestampedSnapshots>true</allowTimestampedSnapshots>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
|
@ -82,69 +53,26 @@
|
|||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<minimizeJar>true</minimizeJar>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
<artifactSet>
|
||||
<artifactSet>
|
||||
<includes>
|
||||
<include>eu.m724:wtapi</include>
|
||||
<include>eu.m724:jarupdater</include>
|
||||
<!-- <include>org.java-websocket:Java-WebSocket</include> -->
|
||||
<!-- it's in plugin.yml and downloaded by server -->
|
||||
<!-- gson is bundled with spigot -->
|
||||
<include>org.java-websocket:Java-WebSocket</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
<filters>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>*</artifact>
|
||||
<artifact>eu.m724:*</artifact>
|
||||
<excludes>
|
||||
<exclude>META-INF/MANIFEST.MF</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
<minimizeJar>true</minimizeJar>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jarsigner-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>sign</id>
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>verify</id>
|
||||
<goals>
|
||||
<goal>verify</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<keystore>${jarsigner.keystore}</keystore>
|
||||
<alias>${jarsigner.alias}</alias>
|
||||
<storepass>${jarsigner.storepass}</storepass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>m724</id>
|
||||
<url>https://git.m724.eu/api/packages/Minecon724/maven</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>m724</id>
|
||||
<url>https://git.m724.eu/api/packages/Minecon724/maven</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
<scm>
|
||||
<developerConnection>scm:git:git@git.m724.eu:Minecon724/realweather.git</developerConnection>
|
||||
<tag>HEAD</tag>
|
||||
</scm>
|
||||
</project>
|
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="AdditionalModuleElements">
|
||||
<content url="file://$MODULE_DIR$" dumb="true">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/test" isTestSource="true" />
|
||||
</content>
|
||||
</component>
|
||||
<component name="FacetManager">
|
||||
<facet type="minecraft" name="Minecraft">
|
||||
<configuration>
|
||||
<autoDetectTypes>
|
||||
<platformType>SPIGOT</platformType>
|
||||
</autoDetectTypes>
|
||||
<projectReimportVersion>1</projectReimportVersion>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
</module>
|
|
@ -1,22 +0,0 @@
|
|||
package eu.m724.realweather;
|
||||
|
||||
import eu.m724.realweather.mapper.MapperConfig;
|
||||
import eu.m724.realweather.thunder.ThunderConfig;
|
||||
import eu.m724.realweather.time.TimeConfig;
|
||||
import eu.m724.realweather.updater.UpdaterConfig;
|
||||
import eu.m724.realweather.weather.WeatherConfig;
|
||||
|
||||
// TODO replaces GlobalConstants for configs
|
||||
public class Configs {
|
||||
static WeatherConfig weatherConfig;
|
||||
static TimeConfig timeConfig;
|
||||
static ThunderConfig thunderConfig;
|
||||
static MapperConfig mapperConfig;
|
||||
static UpdaterConfig updaterConfig;
|
||||
|
||||
public static WeatherConfig weatherConfig() { return weatherConfig; }
|
||||
public static TimeConfig timeConfig() { return timeConfig; }
|
||||
public static ThunderConfig thunderConfig() { return thunderConfig; }
|
||||
public static MapperConfig mapperConfig() { return mapperConfig; }
|
||||
public static UpdaterConfig updaterConfig() { return updaterConfig; }
|
||||
}
|
|
@ -13,6 +13,6 @@ public class DebugLogger {
|
|||
|
||||
public static void info(String message, int minDebugLevel, Object... format) {
|
||||
if (debugLevel >= minDebugLevel)
|
||||
baseLogger.info(message.formatted(format));
|
||||
baseLogger.info(String.format(message, format));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,23 +3,48 @@ package eu.m724.realweather;
|
|||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import eu.m724.realweather.mapper.Mapper;
|
||||
import eu.m724.realweather.weather.PlayerWeatherCache;
|
||||
import eu.m724.realweather.mapper.MapperConfig;
|
||||
import eu.m724.realweather.thunder.ThunderConfig;
|
||||
import eu.m724.realweather.thunder.ThunderMaster;
|
||||
import eu.m724.realweather.time.TimeConfig;
|
||||
import eu.m724.realweather.weather.PlayerWeatherDirectory;
|
||||
import eu.m724.realweather.weather.WeatherConfig;
|
||||
|
||||
// perhaps replace with a singleton
|
||||
// TODO actually, remove it altogether
|
||||
public class GlobalConstants {
|
||||
static WeatherConfig weatherConfig;
|
||||
static TimeConfig timeConfig;
|
||||
static ThunderConfig thunderConfig;
|
||||
static MapperConfig mapperConfig;
|
||||
|
||||
static ThunderMaster thunderMaster;
|
||||
|
||||
static Mapper mapper;
|
||||
static Plugin plugin;
|
||||
static PlayerWeatherCache playerWeatherCache;
|
||||
static PlayerWeatherDirectory playerWeatherDirectory;
|
||||
|
||||
public static WeatherConfig getWeatherConfig() {
|
||||
return weatherConfig;
|
||||
}
|
||||
public static TimeConfig getTimeConfig() {
|
||||
return timeConfig;
|
||||
}
|
||||
public static ThunderConfig getThunderConfig() {
|
||||
return thunderConfig;
|
||||
}
|
||||
public static MapperConfig getMapperConfig() {
|
||||
return mapperConfig;
|
||||
}
|
||||
public static ThunderMaster getThunderMaster() {
|
||||
return thunderMaster;
|
||||
}
|
||||
public static Mapper getMapper() {
|
||||
return mapper;
|
||||
}
|
||||
public static Plugin getPlugin() {
|
||||
return plugin;
|
||||
}
|
||||
public static PlayerWeatherCache getPlayerWeatherCache() {
|
||||
return playerWeatherCache;
|
||||
public static PlayerWeatherDirectory getPlayerWeatherDirectory() {
|
||||
return playerWeatherDirectory;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,37 +4,31 @@ import java.io.File;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
import eu.m724.realweather.commands.AdminCommand;
|
||||
import eu.m724.realweather.commands.GeoCommand;
|
||||
import eu.m724.realweather.commands.LocalTimeCommand;
|
||||
import eu.m724.realweather.commands.LocalWeatherCommand;
|
||||
import eu.m724.realweather.exception.UserError;
|
||||
import eu.m724.realweather.mapper.Mapper;
|
||||
import eu.m724.realweather.mapper.MapperConfig;
|
||||
import eu.m724.realweather.object.UserException;
|
||||
import eu.m724.realweather.thunder.ThunderConfig;
|
||||
import eu.m724.realweather.thunder.ThunderMaster;
|
||||
import eu.m724.realweather.time.TimeConfig;
|
||||
import eu.m724.realweather.time.TimeMaster;
|
||||
import eu.m724.realweather.updater.PluginUpdater;
|
||||
import eu.m724.realweather.updater.UpdaterConfig;
|
||||
import eu.m724.realweather.weather.PlayerWeatherCache;
|
||||
import eu.m724.realweather.weather.WeatherConfig;
|
||||
import eu.m724.realweather.weather.WeatherMaster;
|
||||
import eu.m724.wtapi.provider.exception.NoSuchProviderException;
|
||||
import eu.m724.wtapi.provider.exception.ProviderException;
|
||||
|
||||
// TODO unmess this too
|
||||
public class RealWeatherPlugin extends JavaPlugin {
|
||||
private WeatherMaster weatherMaster;
|
||||
private ThunderMaster thunderMaster;
|
||||
private TimeMaster timeMaster;
|
||||
private PluginUpdater updater;
|
||||
|
||||
private Logger logger;
|
||||
|
||||
|
@ -51,7 +45,14 @@ public class RealWeatherPlugin extends JavaPlugin {
|
|||
thunderConfiguration, timeConfiguration;
|
||||
|
||||
DebugLogger.info("loading configurations", 1);
|
||||
boolean firstRun = !new File(dataFolder, "config.yml").exists();
|
||||
|
||||
if (!new File(dataFolder, "config.yml").exists()) {
|
||||
logger.info("This is the first run of this plugin.");
|
||||
logger.info("Please shutdown the server and input your API keys and settings");
|
||||
|
||||
getServer().getPluginManager().disablePlugin(this);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
configuration = getConfig("config.yml");
|
||||
|
@ -61,13 +62,7 @@ public class RealWeatherPlugin extends JavaPlugin {
|
|||
timeConfiguration = getConfig("modules/time.yml");
|
||||
} catch (IOException e) {
|
||||
logger.severe("Failed to load config!");
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
if (firstRun) {
|
||||
logger.warning("This is your first time running this plugin.");
|
||||
logger.warning("Please *shut down* the server, review the config files (enable modules, enter your API keys, etc.)");
|
||||
logger.warning("Don't forget to enable the plugin in config.yml");
|
||||
e.printStackTrace();
|
||||
|
||||
getServer().getPluginManager().disablePlugin(this);
|
||||
return;
|
||||
|
@ -77,39 +72,34 @@ public class RealWeatherPlugin extends JavaPlugin {
|
|||
DebugLogger.debugLevel = configuration.getInt("debug");
|
||||
|
||||
if (!configuration.getBoolean("enabled")) {
|
||||
logger.warning("Plugin disabled by administrator. Enable it in config.yml");
|
||||
logger.info("plugin disabled by admin");
|
||||
getServer().getPluginManager().disablePlugin(this);
|
||||
return;
|
||||
}
|
||||
|
||||
GlobalConstants.plugin = this;
|
||||
GlobalConstants.playerWeatherCache = new PlayerWeatherCache();
|
||||
|
||||
DebugLogger.info("loading mapper", 1);
|
||||
Configs.mapperConfig = MapperConfig.fromConfiguration(mapConfiguration);
|
||||
GlobalConstants.mapperConfig = MapperConfig.fromConfiguration(mapConfiguration);
|
||||
GlobalConstants.mapper = new Mapper();
|
||||
GlobalConstants.mapper.registerEvents(this);
|
||||
|
||||
try {
|
||||
DebugLogger.info("loading weather", 1);
|
||||
Configs.weatherConfig = WeatherConfig.fromConfiguration(weatherConfiguration);
|
||||
weatherMaster = new WeatherMaster();
|
||||
weatherMaster.init(this);
|
||||
GlobalConstants.weatherConfig = WeatherConfig.fromConfiguration(weatherConfiguration);
|
||||
weatherMaster = new WeatherMaster(GlobalConstants.weatherConfig);
|
||||
weatherMaster.init();
|
||||
|
||||
DebugLogger.info("loading thunder", 1);
|
||||
Configs.thunderConfig = ThunderConfig.fromConfiguration(thunderConfiguration);
|
||||
thunderMaster = new ThunderMaster();
|
||||
thunderMaster.init(this);
|
||||
GlobalConstants.thunderConfig = ThunderConfig.fromConfiguration(thunderConfiguration);
|
||||
thunderMaster = new ThunderMaster(GlobalConstants.thunderConfig);
|
||||
thunderMaster.init();
|
||||
|
||||
DebugLogger.info("loading time", 1);
|
||||
Configs.timeConfig = TimeConfig.fromConfiguration(timeConfiguration);
|
||||
timeMaster = new TimeMaster();
|
||||
GlobalConstants.timeConfig = TimeConfig.fromConfiguration(timeConfiguration);
|
||||
timeMaster = new TimeMaster(GlobalConstants.timeConfig);
|
||||
timeMaster.init();
|
||||
|
||||
Configs.updaterConfig = UpdaterConfig.fromConfiguration(configuration.getConfigurationSection("updater"));
|
||||
updater = PluginUpdater.build(this, this.getFile());
|
||||
//updater.init();
|
||||
} catch (UserError | NoSuchProviderException e) {
|
||||
} catch (UserException e) {
|
||||
logger.severe("There are errors in your config:");
|
||||
logger.severe(e.getMessage());
|
||||
|
||||
|
@ -126,26 +116,13 @@ public class RealWeatherPlugin extends JavaPlugin {
|
|||
return;
|
||||
}
|
||||
|
||||
getCommand("rwadmin").setExecutor(new AdminCommand(updater, thunderMaster));
|
||||
GlobalConstants.thunderMaster = thunderMaster;
|
||||
|
||||
getCommand("rwadmin").setExecutor(new AdminCommand());
|
||||
getCommand("geo").setExecutor(new GeoCommand());
|
||||
|
||||
if (Configs.timeConfig.enabled())
|
||||
getCommand("localtime").setExecutor(new LocalTimeCommand(timeMaster.getTimeConverter()));
|
||||
|
||||
if (Configs.weatherConfig.enabled()) {
|
||||
getCommand("localweather").setExecutor(new LocalWeatherCommand());
|
||||
}
|
||||
|
||||
/*Metrics metrics = new Metrics(this, 15020);
|
||||
metrics.addCustomChart(new SimplePie("weather_provider", () ->
|
||||
GlobalConstants.weatherConfig.enabled ? GlobalConstants.weatherConfig.provider : "off"
|
||||
));
|
||||
metrics.addCustomChart(new SimplePie("thunder_provider", () ->
|
||||
GlobalConstants.thunderConfig.enabled ? GlobalConstants.thunderConfig.provider : "off"
|
||||
));
|
||||
metrics.addCustomChart(new SimplePie("real_time", () ->
|
||||
GlobalConstants.timeConfig.enabled() ? "on" : "off"
|
||||
));*/
|
||||
if (GlobalConstants.timeConfig.enabled)
|
||||
getCommand("localtime").setExecutor(new LocalTimeCommand());
|
||||
|
||||
DebugLogger.info("ended loading", 1);
|
||||
}
|
||||
|
@ -160,7 +137,7 @@ public class RealWeatherPlugin extends JavaPlugin {
|
|||
if (defConfigStream == null)
|
||||
return null;
|
||||
|
||||
config = YamlConfiguration.loadConfiguration(new InputStreamReader(defConfigStream, StandardCharsets.UTF_8));
|
||||
config = YamlConfiguration.loadConfiguration(new InputStreamReader(defConfigStream, Charsets.UTF_8));
|
||||
config.save(configFile);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,65 +0,0 @@
|
|||
package eu.m724.realweather.api.weather;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import eu.m724.wtapi.object.Weather;
|
||||
|
||||
/**
|
||||
* Fired when a weather state is retrieved<br>
|
||||
* It doesn't mean the weather has changed, just that we retrieved the state<br>
|
||||
*/
|
||||
public class AsyncWeatherUpdateEvent extends Event implements Cancellable {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
|
||||
private final Player player;
|
||||
private final Weather weather;
|
||||
|
||||
private boolean cancelled;
|
||||
|
||||
public AsyncWeatherUpdateEvent(Player player, Weather weather) {
|
||||
super(true);
|
||||
this.player = player;
|
||||
this.weather = weather;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a player that the weather is for, null if worldwide (static mode)
|
||||
*/
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the weather state that was just changed
|
||||
*/
|
||||
public Weather getWeather() {
|
||||
return weather;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel weather change<br>
|
||||
* It will only cancel changing the actual weather by the plugin, not retrieving and caching it
|
||||
* @param cancelled to cancel or not
|
||||
*/
|
||||
@Override
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package eu.m724.realweather.commands;
|
||||
|
||||
import eu.m724.realweather.Configs;
|
||||
import java.time.Duration;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
@ -11,63 +12,86 @@ import eu.m724.realweather.mapper.MapperConfig;
|
|||
import eu.m724.realweather.thunder.ThunderConfig;
|
||||
import eu.m724.realweather.thunder.ThunderMaster;
|
||||
import eu.m724.realweather.time.TimeConfig;
|
||||
import eu.m724.realweather.updater.PluginUpdater;
|
||||
import eu.m724.realweather.weather.WeatherConfig;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
|
||||
// TODO unmess this all
|
||||
public class AdminCommand implements CommandExecutor {
|
||||
private final UpdateCommand updateCommand;
|
||||
private final Plugin plugin = GlobalConstants.getPlugin();
|
||||
private Plugin plugin = GlobalConstants.getPlugin();
|
||||
|
||||
private final WeatherConfig weatherConfig = Configs.weatherConfig();
|
||||
private final TimeConfig timeConfig = Configs.timeConfig();
|
||||
private final ThunderConfig thunderConfig = Configs.thunderConfig();
|
||||
private final MapperConfig mapperConfig = Configs.mapperConfig();
|
||||
private WeatherConfig weatherConfig = GlobalConstants.getWeatherConfig();
|
||||
private TimeConfig timeConfig = GlobalConstants.getTimeConfig();
|
||||
private ThunderConfig thunderConfig = GlobalConstants.getThunderConfig();
|
||||
private MapperConfig mapperConfig = GlobalConstants.getMapperConfig();
|
||||
|
||||
private final ThunderMaster thunderMaster;
|
||||
private ThunderMaster thunderMaster = GlobalConstants.getThunderMaster();
|
||||
|
||||
public AdminCommand(PluginUpdater updater, ThunderMaster thunderMaster) {
|
||||
this.updateCommand = new UpdateCommand(updater);
|
||||
this.thunderMaster = thunderMaster;
|
||||
}
|
||||
private BaseComponent enabledComponent = TextComponent.fromLegacy("YES\n", ChatColor.GREEN);
|
||||
private BaseComponent disabledComponent = TextComponent.fromLegacy("NO\n", ChatColor.RED);
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (args.length > 0 && args[0].equals("update")) {
|
||||
return updateCommand.onCommand(sender, command, label, args);
|
||||
|
||||
ComponentBuilder componentBuilder =
|
||||
new ComponentBuilder("\nRealWeather " + plugin.getDescription().getVersion() + "\n\n")
|
||||
.color(ChatColor.YELLOW);
|
||||
|
||||
componentBuilder.append("Coordinate scale: ").color(ChatColor.GOLD);
|
||||
componentBuilder.append(String.format("%d, %d blocks / deg\n", mapperConfig.scaleLatitude, mapperConfig.scaleLongitude)).color(ChatColor.AQUA);
|
||||
|
||||
componentBuilder.append("\nWeather: ").color(ChatColor.GOLD);
|
||||
componentBuilder.append(weatherConfig.enabled ? enabledComponent : disabledComponent);
|
||||
|
||||
if (weatherConfig.enabled) {
|
||||
componentBuilder.append(" Provider: ").color(ChatColor.GOLD);
|
||||
componentBuilder.append(weatherConfig.provider + "\n").color(ChatColor.AQUA);
|
||||
|
||||
componentBuilder.append(" Dynamic: ").color(ChatColor.GOLD);
|
||||
componentBuilder.append(weatherConfig.dynamic ? enabledComponent : disabledComponent);
|
||||
}
|
||||
|
||||
colorize(sender, "\n&eRealWeather %s\n\n", plugin.getDescription().getVersion().replace("-SNAPSHOT", "&c-SNAPSHOT"));
|
||||
componentBuilder.append("\nTime: ").color(ChatColor.GOLD);
|
||||
componentBuilder.append(timeConfig.enabled ? enabledComponent : disabledComponent);
|
||||
|
||||
colorize(sender, "&6Coordinate scale: &b%d, %d &7blocks / deg", mapperConfig.scaleLatitude, mapperConfig.scaleLongitude);
|
||||
if (timeConfig.enabled) {
|
||||
componentBuilder.append(" Scale: ").color(ChatColor.GOLD);
|
||||
componentBuilder.append(Double.toString(timeConfig.scale) + "\n").color(ChatColor.AQUA);
|
||||
|
||||
colorize(sender, "\n&6Weather: %s", weatherConfig.enabled() ? (weatherConfig.dynamic() ? "&aYes, dynamic" : "&aYes, static") : "&cDisabled");
|
||||
long worldTime = timeConfig.calculateWorldTimeSeconds();
|
||||
Duration worldTimeDuration = Duration.ofSeconds(worldTime);
|
||||
|
||||
if (weatherConfig.enabled()) {
|
||||
colorize(sender, " &6Provider: &b%s", weatherConfig.provider());
|
||||
colorize(sender, " &6/localweather to see current weather");
|
||||
String worldTimeFormatted = String.format("%d:%02d:%02d\n",
|
||||
worldTimeDuration.toHours(),
|
||||
worldTimeDuration.toMinutesPart(),
|
||||
worldTimeDuration.toSecondsPart());
|
||||
|
||||
componentBuilder.append(" World time: ").color(ChatColor.GOLD);
|
||||
componentBuilder.append(worldTimeFormatted).color(ChatColor.AQUA);
|
||||
|
||||
componentBuilder.append(" Dynamic: ").color(ChatColor.GOLD);
|
||||
componentBuilder.append(timeConfig.dynamic ? enabledComponent : disabledComponent);
|
||||
}
|
||||
|
||||
colorize(sender, "\n&6Time: %s", timeConfig.enabled() ? (timeConfig.dynamic() ? "&aYes, dynamic" : "&aYes, static") : "&cDisabled");
|
||||
componentBuilder.append("\nThunder: ").color(ChatColor.GOLD);
|
||||
componentBuilder.append(thunderConfig.enabled ? enabledComponent : disabledComponent);
|
||||
|
||||
if (thunderConfig.enabled) {
|
||||
componentBuilder.append(" Provider: ").color(ChatColor.GOLD);
|
||||
componentBuilder.append(thunderConfig.provider + "\n").color(ChatColor.AQUA);
|
||||
|
||||
componentBuilder.append(" Refresh: ").color(ChatColor.GOLD);
|
||||
componentBuilder.append(String.format("%d ticks\n", thunderConfig.refresh)).color(ChatColor.AQUA);
|
||||
|
||||
componentBuilder.append(" Latency: ").color(ChatColor.GOLD);
|
||||
componentBuilder.append(String.format("avg %dms\n", thunderMaster.getLatency())).color(ChatColor.AQUA);
|
||||
|
||||
if (timeConfig.enabled()) {
|
||||
colorize(sender, " &6Scale: &b%s&7x", timeConfig.scale());
|
||||
colorize(sender, " &6/localtime to see current time");
|
||||
}
|
||||
|
||||
colorize(sender, "\n&6Thunder: %s", thunderConfig.enabled() ? "&aYes, dynamic" : "&cDisabled");
|
||||
|
||||
if (thunderConfig.enabled()) {
|
||||
colorize(sender, " &6Provider: &b%s", thunderConfig.provider());
|
||||
colorize(sender, " &6Refresh period: &b%d &7ticks", thunderConfig.refreshPeriod());
|
||||
colorize(sender, " &6API latency: &b%d&7ms", thunderMaster.getLatency());
|
||||
}
|
||||
sender.spigot().sendMessage(componentBuilder.create());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void colorize(CommandSender sender, String text, Object... format) {
|
||||
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', text.formatted(format)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package eu.m724.realweather.commands;
|
||||
|
||||
import net.md_5.bungee.api.chat.*;
|
||||
import net.md_5.bungee.api.chat.hover.content.Content;
|
||||
import net.md_5.bungee.api.chat.hover.content.Text;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
|
@ -10,97 +8,66 @@ import org.bukkit.command.CommandSender;
|
|||
import org.bukkit.entity.Player;
|
||||
|
||||
import eu.m724.realweather.GlobalConstants;
|
||||
import eu.m724.realweather.mapper.Mapper;
|
||||
import eu.m724.realweather.weather.PlayerWeatherCache;
|
||||
import eu.m724.wtapi.object.Coordinates;
|
||||
import eu.m724.wtapi.object.Weather;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||
|
||||
public class GeoCommand implements CommandExecutor {
|
||||
private final PlayerWeatherCache playerWeatherCache = GlobalConstants.getPlayerWeatherCache();
|
||||
private final Mapper mapper = GlobalConstants.getMapper();
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
Player player = sender instanceof Player ? (Player) sender : null;
|
||||
|
||||
if (args.length == 0) {
|
||||
if (player != null) {
|
||||
if (player != null) {
|
||||
Location location = player.getLocation();
|
||||
Coordinates coordinates = mapper.locationToCoordinates(location);
|
||||
Coordinates coordinates = GlobalConstants.getMapper().locationToCoordinates(location);
|
||||
|
||||
Weather weather = playerWeatherCache.getWeather(player);
|
||||
String address = formatAddress(weather);
|
||||
BaseComponent[] component = new ComponentBuilder("\nGeolocation: ").color(ChatColor.GOLD)
|
||||
.append(String.format("lat: %f, lon: %f\n", coordinates.latitude, coordinates.longitude)).color(ChatColor.AQUA)
|
||||
.append("Position: ").color(ChatColor.GRAY)
|
||||
.append(String.format("x: %f, z: %f\n", location.getX(), location.getZ())).color(ChatColor.DARK_AQUA)
|
||||
.create(); // TODO improve readability
|
||||
|
||||
colorize(player, "");
|
||||
colorize(player, "&6Geolocation: &b%f&7, %b%f &7(lat, lon)", coordinates.latitude, coordinates.longitude);
|
||||
colorize(player, "&7Position: &3%f&8, %3%f &8(x, z)", location.getX(), location.getZ());
|
||||
colorize(player, "&7City: &3%s", address);
|
||||
colorize(player, "");
|
||||
player.spigot().sendMessage(component);
|
||||
} else {
|
||||
sender.sendMessage("Add arguments to use this command in console");
|
||||
}
|
||||
} else if (args.length >= 3) {
|
||||
colorize(sender, "&cInvalid arguments, &7make sure it's &a\"/geo lat,lon\" &7or &a\"/geo x z\" &7or just &a\"/geo\"");
|
||||
} else if (args.length == 2) {
|
||||
double x, z;
|
||||
|
||||
try {
|
||||
x = Double.parseDouble(args[0]);
|
||||
z = Double.parseDouble(args[1]);
|
||||
} catch (NumberFormatException e) {
|
||||
colorize(sender, "&cInvalid arguments, &7make sure it's &a\"/geo lat,lon\" &7or &a\"/geo x z\" &7or just &a\"/geo\"");
|
||||
return true;
|
||||
}
|
||||
|
||||
Location location = new Location(null, x, 0, z);
|
||||
Coordinates coordinates = mapper.locationToCoordinates(location);
|
||||
|
||||
colorize(sender, "");
|
||||
colorize(sender, "&6Position: &b%f&7, %b%f &7(x, z)", location.getX(), location.getZ());
|
||||
colorize(sender, "&7Geolocation: &3%f&8, %3%f &8(lat, lon)", coordinates.latitude, coordinates.longitude);
|
||||
colorize(sender, "&7Input interpreted as position, because you separated with a space");
|
||||
colorize(sender, "");
|
||||
|
||||
return true;
|
||||
} else {
|
||||
} else if (args.length >= 2) {
|
||||
double latitude, longitude;
|
||||
|
||||
try {
|
||||
String[] split = args[0].split(",");
|
||||
latitude = Double.parseDouble(split[0]);
|
||||
longitude = Double.parseDouble(split[1]);
|
||||
latitude = Double.parseDouble(args[0]);
|
||||
longitude = Double.parseDouble(args[1]);
|
||||
} catch (NumberFormatException e) {
|
||||
colorize(sender, "&cInvalid arguments, &7make sure it's &a\"/geo lat,lon\" &7or &a\"/geo x z\" &7or just &a\"/geo\"");
|
||||
sender.sendMessage("Arguments should be latitude and longitude");
|
||||
return true;
|
||||
}
|
||||
|
||||
Coordinates coordinates = new Coordinates(latitude, longitude);
|
||||
Location location = mapper.coordinatesToLocation(null, coordinates);
|
||||
Location location = GlobalConstants.getMapper().coordinatesToLocation(player.getWorld(), coordinates);
|
||||
|
||||
colorize(sender, "");
|
||||
colorize(sender, "&6Position: &b%f&7, %b%f &7(x, z)", location.getX(), location.getZ());
|
||||
colorize(sender, "&7Geolocation: &3%f&8, %3%f &8(lat, lon)", coordinates.latitude, coordinates.longitude);
|
||||
colorize(sender, "&7Input interpreted as geolocation, because you separated with a comma");
|
||||
colorize(sender, "");
|
||||
BaseComponent[] component = new ComponentBuilder("\nPosition: ").color(ChatColor.GOLD)
|
||||
.append(String.format("x: %f, z: %f\n", location.getX(), location.getZ())).color(ChatColor.AQUA)
|
||||
.append("Geolocation: ").color(ChatColor.GRAY)
|
||||
.append(String.format("lat: %f, lon: %f\n", coordinates.latitude, coordinates.longitude)).color(ChatColor.DARK_AQUA)
|
||||
.create();
|
||||
|
||||
player.spigot().sendMessage(component);
|
||||
|
||||
if (args.length == 3) {
|
||||
if (args[2].equalsIgnoreCase("tp") && player != null && player.hasPermission("realweather.command.geo.tp")) {
|
||||
Location targetLoc =
|
||||
location.getWorld().getHighestBlockAt(location).getLocation().add(0, 1, 0);
|
||||
player.teleport(targetLoc);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
sender.sendMessage("Not enough arguments");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void colorize(CommandSender sender, String text, Object... format) {
|
||||
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', text.formatted(format)));
|
||||
}
|
||||
|
||||
private String formatAddress(Weather weather) {
|
||||
if (weather == null) return "Not retrieved yet";
|
||||
Coordinates coordinates = weather.coordinates;
|
||||
|
||||
if (coordinates.country == null && coordinates.city == null)
|
||||
return "Unknown";
|
||||
else if (coordinates.city == null)
|
||||
return "Somewhere in " + coordinates.country;
|
||||
else if (coordinates.country == null)
|
||||
return coordinates.city;
|
||||
return coordinates.city + ", " + coordinates.country;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package eu.m724.realweather.commands;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
import eu.m724.realweather.Configs;
|
||||
import eu.m724.realweather.time.TimeConverter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
@ -18,22 +16,15 @@ import net.md_5.bungee.api.chat.BaseComponent;
|
|||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||
|
||||
public class LocalTimeCommand implements CommandExecutor {
|
||||
private final Mapper mapper = GlobalConstants.getMapper();
|
||||
private final TimeConfig timeConfig = Configs.timeConfig();
|
||||
private final TimeConverter timeConverter;
|
||||
|
||||
public LocalTimeCommand(TimeConverter timeConverter) {
|
||||
this.timeConverter = timeConverter;
|
||||
}
|
||||
private TimeConfig timeConfig = GlobalConstants.getTimeConfig();
|
||||
private Mapper mapper = GlobalConstants.getMapper();
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
Player player = sender instanceof Player ? (Player) sender : null;
|
||||
|
||||
long worldTime = System.currentTimeMillis();
|
||||
worldTime = timeConverter.scale(worldTime) % 86400000;
|
||||
long worldTimeTicks = timeConverter.millisToTicks(worldTime);
|
||||
Duration worldTimeDuration = Duration.ofMillis(worldTime);
|
||||
long worldTime = timeConfig.calculateWorldTimeSeconds();
|
||||
Duration worldTimeDuration = Duration.ofSeconds(worldTime);
|
||||
|
||||
String worldTimeFormatted = String.format("%d:%02d:%02d",
|
||||
worldTimeDuration.toHours(),
|
||||
|
@ -46,15 +37,14 @@ public class LocalTimeCommand implements CommandExecutor {
|
|||
|
||||
sender.spigot().sendMessage(component);
|
||||
|
||||
if (timeConfig.dynamic() && player != null && player.hasPermission("realweather.dynamic")) {
|
||||
if (timeConfig.dynamic && player != null && player.hasPermission("realweather.dynamic")) {
|
||||
Coordinates coordinates = mapper.locationToCoordinates(player.getLocation());
|
||||
|
||||
long offsetTime = timeConverter.calculateZoneOffset(coordinates.longitude);
|
||||
long offsetTimeTicks = timeConverter.millisToTicks(offsetTime);
|
||||
long offsetTime = timeConfig.calculateTimeOffsetSeconds(coordinates.longitude);
|
||||
boolean negative = offsetTime < 0;
|
||||
|
||||
Duration localTimeDuration = Duration.ofMillis(Math.floorMod(worldTime + offsetTime, 86400000));
|
||||
Duration offsetTimeDuration = Duration.ofMillis(Math.floorMod(negative ? -offsetTime : offsetTime, 86400000));
|
||||
Duration localTimeDuration = worldTimeDuration.plus(offsetTime, ChronoUnit.SECONDS);
|
||||
Duration offsetTimeDuration = Duration.ofSeconds(negative ? -offsetTime : offsetTime);
|
||||
|
||||
String offsetTimeFormatted = String.format("%s%d:%02d:%02d",
|
||||
(negative ? "-" : "+"),
|
||||
|
@ -68,8 +58,8 @@ public class LocalTimeCommand implements CommandExecutor {
|
|||
localTimeDuration.toSecondsPart());
|
||||
|
||||
component = new ComponentBuilder("Local time: ").color(ChatColor.GOLD)
|
||||
.append(localTimeFormatted + " %dt".formatted(worldTimeTicks)).color(ChatColor.AQUA)
|
||||
.append(" " + offsetTimeFormatted + " %dt".formatted(offsetTimeTicks)).color(ChatColor.GRAY)
|
||||
.append(localTimeFormatted).color(ChatColor.AQUA)
|
||||
.append(" " + offsetTimeFormatted).color(ChatColor.GRAY)
|
||||
.create();
|
||||
|
||||
sender.spigot().sendMessage(component);
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
package eu.m724.realweather.commands;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.ZoneOffset;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import eu.m724.realweather.GlobalConstants;
|
||||
import eu.m724.realweather.weather.PlayerWeatherCache;
|
||||
import eu.m724.wtapi.object.Weather;
|
||||
|
||||
public class LocalWeatherCommand implements CommandExecutor {
|
||||
private final PlayerWeatherCache playerWeatherCache = GlobalConstants.getPlayerWeatherCache();
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player player)) {
|
||||
sender.sendMessage("You must be a player to use this command");
|
||||
return true;
|
||||
}
|
||||
|
||||
Weather weather = playerWeatherCache.getWeather(player);
|
||||
|
||||
if (weather != null) {
|
||||
long lastUpdate = playerWeatherCache.getLastUpdate(player);
|
||||
colorize(sender, "\n&e" + weather.description);
|
||||
|
||||
if (weather.rainSeverity != null)
|
||||
colorize(sender, "&6Rain: &b%s", weather.rainSeverity.toString());
|
||||
if (weather.drizzleSeverity != null)
|
||||
colorize(sender, "&6Drizzle: &b%s", weather.drizzleSeverity.toString());
|
||||
if (weather.sleetSeverity != null)
|
||||
colorize(sender, "&6Sleet: &b%s", weather.sleetSeverity.toString());
|
||||
if (weather.snowSeverity != null)
|
||||
colorize(sender, "&6Snow: &b%s", weather.snowSeverity.toString());
|
||||
if (weather.thunderstormSeverity != null)
|
||||
colorize(sender, "&6Thunderstorm: &b%s", weather.thunderstormSeverity.toString());
|
||||
if (weather.shower)
|
||||
colorize(sender, "&6Shower");
|
||||
|
||||
colorize(sender, "&6Cloudiness: &b%f&7%%", weather.cloudiness * 100);
|
||||
colorize(sender, "&6Humidity: &b%f&7%%", weather.humidity * 100);
|
||||
colorize(sender, "&6Temperature: &b%f&7°C (feels like %f°C)", weather.temperature - 273.15, weather.temperatureApparent - 273.15);
|
||||
colorize(sender, "&6Wind: &b%f&7m/s (gust %fm/s)", weather.windSpeed, weather.windGust);
|
||||
colorize(sender, "&6Last update: &b%s UTC\n", formatTime(lastUpdate));
|
||||
|
||||
} else {
|
||||
colorize(sender, "&6No weather for you, try again in a second");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void colorize(CommandSender sender, String text, Object... format) {
|
||||
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', text.formatted(format)));
|
||||
}
|
||||
|
||||
private String formatTime(long timestamp) {
|
||||
return DateTimeFormatter.ofPattern("HH:mm:ss").format(Instant.ofEpochMilli(timestamp).atZone(ZoneOffset.UTC));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,77 +0,0 @@
|
|||
package eu.m724.realweather.commands;
|
||||
|
||||
import java.nio.file.NoSuchFileException;
|
||||
import java.time.Instant;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import eu.m724.jarupdater.updater.Updater;
|
||||
import eu.m724.jarupdater.object.Version;
|
||||
|
||||
/**
|
||||
* not actually a command but deserves a separate file
|
||||
*/
|
||||
public class UpdateCommand {
|
||||
private final Updater updater;
|
||||
|
||||
public UpdateCommand(Updater updater) {
|
||||
this.updater = updater;
|
||||
}
|
||||
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!sender.hasPermission("realweather.admin.update")) return false;
|
||||
|
||||
sender.sendMessage("Please wait");
|
||||
CompletableFuture<Version> latestFuture = updater.getLatestVersion();
|
||||
|
||||
if (args.length == 0) {
|
||||
latestFuture.thenAccept(metadata -> {
|
||||
if (metadata != null) {
|
||||
sender.sendMessage("An update is available!");
|
||||
sender.sendMessage("RealWeather %s released %s".formatted(metadata.getLabel(), formatDate(metadata.getTimestamp())));
|
||||
sender.sendMessage("To download: /rwadmin update download");
|
||||
} else {
|
||||
sender.sendMessage("No new updates"); // TODO color
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String action = args[1]; // remember this function is proxied
|
||||
|
||||
if (action.equals("download")) {
|
||||
sender.sendMessage("Started download");
|
||||
|
||||
updater.downloadLatestVersion().handle((file, ex) -> {
|
||||
sender.sendMessage("Download failed. See console for details.");
|
||||
ex.printStackTrace();
|
||||
return null;
|
||||
}).thenAccept(file -> {
|
||||
if (file != null)
|
||||
sender.sendMessage("Download finished, install with /rwadmin update install");
|
||||
});
|
||||
|
||||
} else if (action.equals("install")) {
|
||||
try {
|
||||
updater.installLatestVersion().handle((v, ex) -> {
|
||||
sender.sendMessage("Install failed. See console for details.");
|
||||
ex.printStackTrace();
|
||||
return null;
|
||||
}).thenAccept(v -> {
|
||||
sender.sendMessage("Installation completed, restart server to apply");
|
||||
});
|
||||
} catch (NoSuchFileException e) {
|
||||
sender.sendMessage("Download the update first");
|
||||
}
|
||||
} else return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private String formatDate(long timestamp) { // TODO move this
|
||||
return DateTimeFormatter.ofPattern("dd.MM.yyyy").format(Instant.ofEpochSecond(timestamp));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package eu.m724.realweather.exception;
|
||||
|
||||
public class UserError extends Error {
|
||||
|
||||
private static final long serialVersionUID = 7152429719832602384L;
|
||||
|
||||
public UserError(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
}
|
|
@ -4,24 +4,24 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import eu.m724.realweather.Configs;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import eu.m724.realweather.GlobalConstants;
|
||||
import eu.m724.wtapi.object.Coordinates;
|
||||
|
||||
public class Mapper {
|
||||
private final MapperConfig config = Configs.mapperConfig();
|
||||
private final List<World> worlds = new ArrayList<>();
|
||||
private MapperConfig config = GlobalConstants.getMapperConfig();
|
||||
private List<World> worlds = new ArrayList<>();
|
||||
|
||||
private final List<Consumer<World>> worldLoadConsumers = new ArrayList<>();
|
||||
private final List<Consumer<World>> worldUnloadConsumers = new ArrayList<>();
|
||||
// TODO game rules, I think I meant handling by this class
|
||||
private List<Consumer<World>> worldLoadConsumers = new ArrayList<>();
|
||||
private List<Consumer<World>> worldUnloadConsumers = new ArrayList<>();
|
||||
// TODO game rules
|
||||
|
||||
/**
|
||||
* Registers a consumer which will be called on world load
|
||||
* @param consumer the consumer which will be called on world load
|
||||
* @param consumer
|
||||
*/
|
||||
public void registerWorldLoadConsumer(Consumer<World> consumer) {
|
||||
this.worldLoadConsumers.add(consumer);
|
||||
|
@ -29,50 +29,34 @@ public class Mapper {
|
|||
|
||||
/**
|
||||
* Registers a consumer which will be called on world unload
|
||||
* @param consumer the consumer which will be called on world unload
|
||||
* @param consumer
|
||||
*/
|
||||
public void registerWorldUnloadConsumer(Consumer<World> consumer) {
|
||||
this.worldUnloadConsumers.add(consumer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers events handled by mapper.<br>
|
||||
* Registers events handled by mapper.
|
||||
* This should be called once on plugin load.
|
||||
* @param plugin the plugin to register events under
|
||||
* @param plugin
|
||||
*/
|
||||
public void registerEvents(Plugin plugin) {
|
||||
plugin.getServer().getPluginManager().registerEvents(new MapperEventHandler(this), plugin);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a {@link Location} to {@link Coordinates}<br>
|
||||
* The result is scaled and wrapped
|
||||
*
|
||||
* @param location the location to convert
|
||||
* @return the coordinates
|
||||
*/
|
||||
public Coordinates locationToCoordinates(Location location) {
|
||||
// it's <-90, 90> (inclusive), but there's no point to make it that way here, because it's easier, and nice precision is enough
|
||||
double latitude = (-location.getZ() / config.scaleLatitude) % 90;
|
||||
// here it's <-180, 180) so it's correct, and we don't need excuses
|
||||
double longitude = (location.getX() / config.scaleLongitude) % 180;
|
||||
double latitude = -location.getZ() / config.scaleLatitude;
|
||||
double longitude = location.getX() / config.scaleLongitude;
|
||||
|
||||
return new Coordinates(latitude, longitude);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts {@link Coordinates} to a {@link Location}<br>
|
||||
* The result is scaled, but not wrapped to world border or anything
|
||||
*
|
||||
* @param world the world of the location
|
||||
* @param coordinates the coordinates to convert
|
||||
* @return the location in {@code world}
|
||||
*/
|
||||
public Location coordinatesToLocation(World world, Coordinates coordinates) {
|
||||
double x = coordinates.longitude * config.scaleLongitude;
|
||||
double z = -coordinates.latitude * config.scaleLatitude;
|
||||
|
||||
return new Location(world, x, 0, z);
|
||||
|
||||
}
|
||||
|
||||
public Coordinates getPoint() {
|
||||
|
|
|
@ -6,7 +6,7 @@ import org.bukkit.event.world.WorldLoadEvent;
|
|||
import org.bukkit.event.world.WorldUnloadEvent;
|
||||
|
||||
public class MapperEventHandler implements Listener {
|
||||
private final Mapper mapper;
|
||||
private Mapper mapper;
|
||||
|
||||
public MapperEventHandler(Mapper mapper) {
|
||||
this.mapper = mapper;
|
||||
|
|
11
src/main/java/eu/m724/realweather/object/UserException.java
Normal file
11
src/main/java/eu/m724/realweather/object/UserException.java
Normal file
|
@ -0,0 +1,11 @@
|
|||
package eu.m724.realweather.object;
|
||||
|
||||
public class UserException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = 6850666306511891275L;
|
||||
|
||||
public UserException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
}
|
|
@ -2,22 +2,22 @@ package eu.m724.realweather.thunder;
|
|||
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param enabled is thunder module enabled
|
||||
* @param provider The provider name, may or may not exist, if it doesn't, an error is thrown later
|
||||
* @param refreshPeriod how often probe for strikes, in ticks
|
||||
*/
|
||||
public record ThunderConfig(
|
||||
boolean enabled,
|
||||
String provider,
|
||||
int refreshPeriod
|
||||
) {
|
||||
public class ThunderConfig {
|
||||
public boolean enabled;
|
||||
|
||||
public String provider;
|
||||
|
||||
// how often refresh in ms
|
||||
public int refresh;
|
||||
|
||||
public static ThunderConfig fromConfiguration(ConfigurationSection configuration) {
|
||||
return new ThunderConfig(
|
||||
configuration.getBoolean("enabled"),
|
||||
configuration.getString("provider"),
|
||||
configuration.getInt("refreshPeriod")
|
||||
);
|
||||
ThunderConfig thunderConfig = new ThunderConfig();
|
||||
|
||||
thunderConfig.enabled = configuration.getBoolean("enabled");
|
||||
thunderConfig.provider = configuration.getString("provider");
|
||||
|
||||
thunderConfig.refresh = configuration.getInt("refresh");
|
||||
|
||||
return thunderConfig;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,37 +1,57 @@
|
|||
package eu.m724.realweather.thunder;
|
||||
|
||||
import eu.m724.realweather.Configs;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import eu.m724.realweather.DebugLogger;
|
||||
import eu.m724.wtapi.provider.Providers;
|
||||
import eu.m724.wtapi.provider.exception.NoSuchProviderException;
|
||||
import eu.m724.realweather.GlobalConstants;
|
||||
import eu.m724.realweather.object.UserException;
|
||||
import eu.m724.wtapi.provider.exception.ProviderException;
|
||||
import eu.m724.wtapi.provider.thunder.ThunderProvider;
|
||||
import eu.m724.wtapi.thunder.ThunderProvider;
|
||||
import eu.m724.wtapi.thunder.impl.blitzortung.BlitzortungProvider;
|
||||
|
||||
public class ThunderMaster {
|
||||
private final ThunderConfig config = Configs.thunderConfig();
|
||||
private ThunderConfig config;
|
||||
private ThunderProvider provider;
|
||||
private ThunderTask thunderTask;
|
||||
|
||||
private Plugin plugin = GlobalConstants.getPlugin();
|
||||
|
||||
public ThunderMaster(ThunderConfig config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
/**
|
||||
* initializes, tests and starts
|
||||
* @throws UserException config issue
|
||||
* @throws ProviderException if provider initialization failed
|
||||
* @throws NoSuchProviderException config issue
|
||||
*/
|
||||
public void init(Plugin plugin) throws ProviderException, NoSuchProviderException {
|
||||
if (!config.enabled())
|
||||
public void init() throws UserException, ProviderException {
|
||||
if (!config.enabled)
|
||||
return;
|
||||
|
||||
provider = Providers.getThunderProvider(config.provider(), null);
|
||||
provider = createProvider();
|
||||
|
||||
if (provider == null)
|
||||
throw new UserException("Invalid provider: " + config.provider);
|
||||
|
||||
provider.init();
|
||||
|
||||
ThunderTask thunderTask = new ThunderTask(provider);
|
||||
thunderTask = new ThunderTask(provider);
|
||||
thunderTask.init();
|
||||
thunderTask.runTaskTimer(plugin, 0, config.refreshPeriod());
|
||||
thunderTask.runTaskTimer(plugin, 0, config.refresh);
|
||||
|
||||
DebugLogger.info("thunder loaded", 1);
|
||||
}
|
||||
|
||||
private ThunderProvider createProvider() {
|
||||
switch (config.provider) {
|
||||
case "blitzortung":
|
||||
return new BlitzortungProvider();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public long getLatency() {
|
||||
return provider.getLatency();
|
||||
}
|
||||
|
|
|
@ -8,13 +8,13 @@ import org.bukkit.scheduler.BukkitRunnable;
|
|||
import eu.m724.realweather.DebugLogger;
|
||||
import eu.m724.realweather.GlobalConstants;
|
||||
import eu.m724.realweather.mapper.Mapper;
|
||||
import eu.m724.wtapi.provider.thunder.ThunderProvider;
|
||||
import eu.m724.wtapi.provider.thunder.impl.blitzortung.TimedStrike;
|
||||
import eu.m724.wtapi.thunder.ThunderProvider;
|
||||
import eu.m724.wtapi.thunder.impl.blitzortung.TimedStrike;
|
||||
|
||||
class ThunderTask extends BukkitRunnable {
|
||||
private final ThunderProvider thunderProvider;
|
||||
private final Mapper mapper = GlobalConstants.getMapper();
|
||||
private final ArrayList<TimedStrike> strikes = new ArrayList<>();
|
||||
private ThunderProvider thunderProvider;
|
||||
private Mapper mapper = GlobalConstants.getMapper();
|
||||
private ArrayList<TimedStrike> strikes = new ArrayList<>();
|
||||
|
||||
public ThunderTask(ThunderProvider thunderProvider) {
|
||||
this.thunderProvider = thunderProvider;
|
||||
|
@ -33,8 +33,9 @@ class ThunderTask extends BukkitRunnable {
|
|||
DebugLogger.info("thundertask running", 3);
|
||||
thunderProvider.tick();
|
||||
|
||||
while (!strikes.isEmpty()) {
|
||||
TimedStrike strike = strikes.removeFirst();
|
||||
while (strikes.size() > 0) {
|
||||
TimedStrike strike = strikes.get(0);
|
||||
strikes.remove(0);
|
||||
|
||||
DebugLogger.info("strike: %f %f", 2, strike.coordinates.latitude, strike.coordinates.longitude);
|
||||
|
||||
|
@ -42,11 +43,11 @@ class ThunderTask extends BukkitRunnable {
|
|||
Location location = mapper.coordinatesToLocation(w, strike.coordinates);
|
||||
DebugLogger.info("in %s that converts to: %d %d", 2, w.getName(), location.getBlockX(), location.getBlockZ());
|
||||
|
||||
// World#isLoaded, Chunk#isLoaded and probably others using Chunk, load the chunk and always return true
|
||||
// for some reason all isloaded etc methods utilizing the Chunk object actually load that chunk before
|
||||
if (w.isChunkLoaded(location.getBlockX() / 16, location.getBlockZ() / 16)) {
|
||||
location.setY(w.getHighestBlockYAt(location) + 1);
|
||||
w.strikeLightning(location);
|
||||
DebugLogger.info("spawned lightning in %s on y level %d", 2, w.getName(), location.getBlockY());
|
||||
DebugLogger.info("spawnd lightning in %s on y level %d", 2, w.getName(), location.getBlockY());
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
@ -10,13 +10,13 @@ import eu.m724.realweather.mapper.Mapper;
|
|||
import eu.m724.wtapi.object.Coordinates;
|
||||
|
||||
public class AsyncPlayerTimeTask extends BukkitRunnable {
|
||||
private final Server server = GlobalConstants.getPlugin().getServer();
|
||||
private final Mapper mapper = GlobalConstants.getMapper();
|
||||
private Server server = GlobalConstants.getPlugin().getServer();
|
||||
private Mapper mapper = GlobalConstants.getMapper();
|
||||
|
||||
private final TimeConverter timeConverter;
|
||||
private TimeConfig timeConfig;
|
||||
|
||||
AsyncPlayerTimeTask(TimeConverter timeConverter) {
|
||||
this.timeConverter = timeConverter;
|
||||
AsyncPlayerTimeTask(TimeConfig timeConfig) {
|
||||
this.timeConfig = timeConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -26,12 +26,10 @@ public class AsyncPlayerTimeTask extends BukkitRunnable {
|
|||
if (!mapper.getWorlds().contains(player.getWorld())) continue;
|
||||
|
||||
Coordinates coordinates = mapper.locationToCoordinates(player.getLocation());
|
||||
long offsetTicks = timeConfig.calculateTimeOffsetTicks(coordinates.longitude);
|
||||
|
||||
long time = timeConverter.calculateZoneOffset(coordinates.longitude);
|
||||
long ticks = timeConverter.millisToTicks(time);
|
||||
|
||||
player.setPlayerTime(ticks, true);
|
||||
DebugLogger.info("Time for %s: %d", 2, player.getName(), time);
|
||||
player.setPlayerTime(Math.floorMod(offsetTicks, 24000), true);
|
||||
DebugLogger.info("Time for %s: %d", 2, player.getName(), offsetTicks);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,27 +6,18 @@ import eu.m724.realweather.DebugLogger;
|
|||
import eu.m724.realweather.GlobalConstants;
|
||||
import eu.m724.realweather.mapper.Mapper;
|
||||
|
||||
/**
|
||||
* This does world time, player time is basically offset of this, like timezone +0
|
||||
*/
|
||||
public class SyncTimeUpdateTask extends BukkitRunnable {
|
||||
private final Mapper mapper = GlobalConstants.getMapper();
|
||||
private TimeConfig timeConfig;
|
||||
private Mapper mapper = GlobalConstants.getMapper();
|
||||
|
||||
private final TimeConverter timeConverter;
|
||||
private final long zoneOffset;
|
||||
|
||||
SyncTimeUpdateTask(TimeConverter timeConverter, boolean dynamic) {
|
||||
this.timeConverter = timeConverter;
|
||||
this.zoneOffset = !dynamic ? timeConverter.calculateZoneOffset(mapper.getPoint().longitude) : 0;
|
||||
SyncTimeUpdateTask(TimeConfig timeConfig) {
|
||||
this.timeConfig = timeConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
long time = System.currentTimeMillis();
|
||||
time = timeConverter.scale(time);
|
||||
|
||||
long ticks = timeConverter.millisToTicks(time + zoneOffset);
|
||||
|
||||
// TODO double?
|
||||
long ticks = timeConfig.calculateWorldTimeTicks();
|
||||
DebugLogger.info("Updating time: %d", 2, ticks);
|
||||
|
||||
mapper.getWorlds().forEach(world -> world.setFullTime(ticks));
|
||||
|
|
|
@ -2,22 +2,52 @@ package eu.m724.realweather.time;
|
|||
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param enabled is time module enabled
|
||||
* @param dynamic is time dynamic, that is per player
|
||||
* @param scale timescale, time goes Nx slower (0.5 - 2x faster)
|
||||
*/
|
||||
public record TimeConfig(
|
||||
boolean enabled,
|
||||
boolean dynamic,
|
||||
double scale
|
||||
) {
|
||||
public class TimeConfig {
|
||||
public boolean enabled;
|
||||
|
||||
// state is per player
|
||||
public boolean dynamic;
|
||||
// x day cycles in 1 irl day
|
||||
public double scale;
|
||||
|
||||
public static TimeConfig fromConfiguration(ConfigurationSection configuration) {
|
||||
return new TimeConfig(
|
||||
configuration.getBoolean("enabled"),
|
||||
configuration.getBoolean("dynamic"),
|
||||
configuration.getDouble("scale")
|
||||
);
|
||||
TimeConfig timeConfig = new TimeConfig();
|
||||
|
||||
timeConfig.enabled = configuration.getBoolean("enabled");
|
||||
|
||||
timeConfig.dynamic = configuration.getBoolean("dynamic");
|
||||
timeConfig.scale = configuration.getDouble("scale");
|
||||
|
||||
return timeConfig;
|
||||
}
|
||||
|
||||
public long calculateWorldTimeSeconds() {
|
||||
long now = (long) (System.currentTimeMillis() * scale / 1000) % 86400;
|
||||
|
||||
return now;
|
||||
}
|
||||
|
||||
public long calculateWorldTimeTicks() {
|
||||
long now = calculateWorldTimeSeconds();
|
||||
long ticks = Math.floorMod(now / 72 * 20 - 6000, 24000);
|
||||
|
||||
return ticks;
|
||||
}
|
||||
|
||||
/**
|
||||
* this method is mostly for info
|
||||
* @param longitude
|
||||
* @return
|
||||
*/
|
||||
public long calculateTimeOffsetSeconds(double longitude) {
|
||||
long offset = (long) ((longitude / 15) * 3600 * scale);
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
public long calculateTimeOffsetTicks(double longitude) {
|
||||
long offsetTicks = (long) ((longitude / 15) * 1000 * scale);
|
||||
|
||||
return offsetTicks;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
package eu.m724.realweather.time;
|
||||
|
||||
public class TimeConverter {
|
||||
public final double scale;
|
||||
|
||||
public TimeConverter(double scale) {
|
||||
this.scale = scale;
|
||||
}
|
||||
|
||||
/**
|
||||
* Divides time by predefined scale<br>
|
||||
* ...slowing it down
|
||||
*
|
||||
* @param time unix milliseconds
|
||||
* @return scaled unix milliseconds
|
||||
*/
|
||||
public long scale(long time) {
|
||||
return (long) (time / scale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts unix timestamp to in game ticks
|
||||
*
|
||||
* @param time unix millis
|
||||
* @return in-game ticks
|
||||
*/
|
||||
public long millisToTicks(long time) {
|
||||
return Math.floorMod(time / 3600 - 6000, 24000);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates how often (or how rarely) we can update time<br>
|
||||
* That is, to not do stuff when we don't have to<br>
|
||||
* In ticks, because it's used with Bukkit scheduler
|
||||
*
|
||||
* @return update period IN TICKS
|
||||
*/
|
||||
public long calculateUpdatePeriod() {
|
||||
return (long) (72 / scale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates time offset (in millis) for specified longitude
|
||||
*
|
||||
* @param longitude the longitude
|
||||
* @return milliseconds of offset from the center of the world (0)
|
||||
*/
|
||||
public long calculateZoneOffset(double longitude) {
|
||||
return (long) (longitude * 240000);
|
||||
}
|
||||
}
|
|
@ -1,41 +1,44 @@
|
|||
package eu.m724.realweather.time;
|
||||
|
||||
import eu.m724.realweather.Configs;
|
||||
import org.bukkit.GameRule;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import eu.m724.realweather.DebugLogger;
|
||||
import eu.m724.realweather.GlobalConstants;
|
||||
import eu.m724.realweather.mapper.Mapper;
|
||||
import eu.m724.realweather.object.UserException;
|
||||
|
||||
public class TimeMaster {
|
||||
private final Mapper mapper = GlobalConstants.getMapper();
|
||||
private final Plugin plugin = GlobalConstants.getPlugin();
|
||||
private final TimeConfig timeConfig = Configs.timeConfig();
|
||||
private TimeConfig timeConfig;
|
||||
private Mapper mapper = GlobalConstants.getMapper();
|
||||
private Plugin plugin = GlobalConstants.getPlugin();
|
||||
|
||||
// TODO I don't want to initialize this here
|
||||
private final TimeConverter timeConverter = new TimeConverter(timeConfig.scale());
|
||||
|
||||
// TODO this is only used once
|
||||
public TimeConverter getTimeConverter() {
|
||||
return timeConverter;
|
||||
public TimeMaster(TimeConfig timeConfig) {
|
||||
this.timeConfig = timeConfig;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
if (!timeConfig.enabled())
|
||||
/**
|
||||
* initializes, tests and starts
|
||||
* @throws UserException config issue
|
||||
*/
|
||||
public void init() throws UserException {
|
||||
if (!timeConfig.enabled)
|
||||
return;
|
||||
|
||||
long period = timeConverter.calculateUpdatePeriod();
|
||||
|
||||
if (timeConfig.scale() * period != 72.0) {
|
||||
long period = (long) (72 / timeConfig.scale);
|
||||
|
||||
if (timeConfig.scale * Math.floor(period) != 72.0) {
|
||||
// TODO log this properly
|
||||
DebugLogger.info("Warning: RealTime scale is not optimal. Time will be out of sync.", 0);
|
||||
}
|
||||
|
||||
new SyncTimeUpdateTask(timeConverter, timeConfig.dynamic()).runTaskTimer(plugin, 0, period);
|
||||
new SyncTimeUpdateTask(timeConfig).runTaskTimer(plugin, 0, period);
|
||||
|
||||
if (timeConfig.dynamic())
|
||||
new AsyncPlayerTimeTask(timeConverter).runTaskTimerAsynchronously(plugin, 0, 60); // 5 seconds
|
||||
if (timeConfig.dynamic)
|
||||
new AsyncPlayerTimeTask(timeConfig).runTaskTimerAsynchronously(plugin, 0, period);
|
||||
// TODO maybe use a different period?
|
||||
// TODO also make it on player join
|
||||
|
||||
mapper.registerWorldLoadConsumer(world -> world.setGameRule(GameRule.DO_DAYLIGHT_CYCLE, false));
|
||||
mapper.registerWorldUnloadConsumer(world -> world.setGameRule(GameRule.DO_DAYLIGHT_CYCLE, true));
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
package eu.m724.realweather.updater;
|
||||
|
||||
import eu.m724.jarupdater.environment.ConstantEnvironment;
|
||||
import eu.m724.jarupdater.updater.Updater;
|
||||
import eu.m724.jarupdater.verify.SignatureVerifier;
|
||||
import eu.m724.jarupdater.verify.Verifier;
|
||||
import eu.m724.realweather.Configs;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import eu.m724.jarupdater.download.Downloader;
|
||||
import eu.m724.jarupdater.download.SimpleDownloader;
|
||||
import eu.m724.jarupdater.environment.Environment;
|
||||
import eu.m724.jarupdater.live.GiteaMetadataDAO;
|
||||
import eu.m724.jarupdater.live.MetadataDAO;
|
||||
import eu.m724.jarupdater.live.MetadataFacade;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
public class PluginUpdater extends Updater {
|
||||
private final UpdaterConfig updaterConfig = Configs.updaterConfig();
|
||||
|
||||
final Plugin plugin;
|
||||
|
||||
PluginUpdater(Plugin plugin, Environment environment, MetadataFacade metadataProvider, Downloader downloader, Verifier verifier) {
|
||||
super(environment, metadataProvider, downloader, verifier);
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public static PluginUpdater build(Plugin plugin, File file) {
|
||||
Environment environment = new ConstantEnvironment(
|
||||
plugin.getDescription().getVersion(),
|
||||
Configs.updaterConfig().channel(),
|
||||
file.toPath()
|
||||
);
|
||||
|
||||
MetadataDAO metadataDAO = new GiteaMetadataDAO("https://git.m724.eu/Minecon724/realweather-metadata", "master");
|
||||
MetadataFacade metadataFacade = new MetadataFacade(environment, metadataDAO);
|
||||
Downloader downloader = new SimpleDownloader("realweather");
|
||||
|
||||
SignatureVerifier verifier = new SignatureVerifier();
|
||||
try (InputStream inputStream = plugin.getResource("verifies_downloaded_jars.pem")) {
|
||||
verifier.loadPublicKey(inputStream);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
return new PluginUpdater(plugin, environment, metadataFacade, downloader, verifier);
|
||||
}
|
||||
|
||||
public void init() {
|
||||
if (!updaterConfig.alert()) return;
|
||||
|
||||
UpdateNotifier updateNotifier = new UpdateNotifier(this, (version) -> {});
|
||||
updateNotifier.register();
|
||||
}
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
package eu.m724.realweather.updater;
|
||||
|
||||
import java.util.concurrent.CompletionException;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import eu.m724.jarupdater.object.Version;
|
||||
import eu.m724.realweather.DebugLogger;
|
||||
|
||||
public class UpdateNotifier extends BukkitRunnable implements Listener { // TODO move this to jarupdater
|
||||
private final PluginUpdater updater;
|
||||
private final Consumer<Version> updateConsumer;
|
||||
private final Plugin plugin;
|
||||
|
||||
private Version latestVersion;
|
||||
|
||||
public UpdateNotifier(PluginUpdater updater, Consumer<Version> updateConsumer) {
|
||||
this.updater = updater;
|
||||
this.updateConsumer = updateConsumer;
|
||||
this.plugin = updater.plugin;
|
||||
}
|
||||
|
||||
public void register() {
|
||||
this.runTaskTimerAsynchronously(updater.plugin, 0, 432000); // 6h
|
||||
plugin.getServer().getPluginManager().registerEvents(this, plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
DebugLogger.info("update task running", 2);
|
||||
|
||||
try {
|
||||
latestVersion = updater.getLatestVersion().join();
|
||||
} catch (CompletionException e) {
|
||||
Throwable ex = e.getCause();
|
||||
DebugLogger.info("Error trying to contact update server: %s", 0, ex.getMessage());
|
||||
|
||||
if (DebugLogger.getDebugLevel() >= 1)
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (latestVersion == null) return;
|
||||
DebugLogger.info("RealWeather is outdated. /rwadmin update", 0);
|
||||
|
||||
for (Player player : updater.plugin.getServer().getOnlinePlayers()) {
|
||||
if (player.hasPermission("realweather.update.notify")) {
|
||||
player.sendMessage("RealWeather is outdated. /rwadmin update");
|
||||
}
|
||||
}
|
||||
|
||||
updateConsumer.accept(latestVersion);
|
||||
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent e) {
|
||||
Player player = e.getPlayer();
|
||||
if (latestVersion != null && player.hasPermission("realweather.update.notify")) {
|
||||
player.sendMessage("RealWeather is outdated. /rwadmin update");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package eu.m724.realweather.updater;
|
||||
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param alert alert admins about updates
|
||||
* @param channel update channel
|
||||
*/
|
||||
public record UpdaterConfig(
|
||||
boolean alert, // this is different because I can't use notify in records sadly
|
||||
String channel
|
||||
) {
|
||||
public static UpdaterConfig fromConfiguration(ConfigurationSection configuration) {
|
||||
return new UpdaterConfig(
|
||||
configuration.getBoolean("notify"),
|
||||
configuration.getString("channel")
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,128 @@
|
|||
package eu.m724.realweather.weather;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.CompletionException;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import eu.m724.realweather.DebugLogger;
|
||||
import eu.m724.realweather.GlobalConstants;
|
||||
import eu.m724.realweather.mapper.Mapper;
|
||||
import eu.m724.realweather.weather.event.AsyncWeatherUpdateEvent;
|
||||
import eu.m724.wtapi.object.Coordinates;
|
||||
import eu.m724.wtapi.object.Weather;
|
||||
import eu.m724.wtapi.provider.WeatherProvider;
|
||||
|
||||
public class AsyncWeatherRetriever extends BukkitRunnable implements Listener { // TODO split this
|
||||
private WeatherProvider weatherProvider;
|
||||
|
||||
private boolean dynamic = GlobalConstants.getWeatherConfig().dynamic;
|
||||
private Mapper mapper = GlobalConstants.getMapper();
|
||||
private Plugin plugin = GlobalConstants.getPlugin();
|
||||
private Server server = plugin.getServer();
|
||||
private PlayerWeatherDirectory playerWeatherDirectory = GlobalConstants.getPlayerWeatherDirectory();
|
||||
|
||||
public AsyncWeatherRetriever(WeatherProvider weatherProvider) {
|
||||
this.weatherProvider = weatherProvider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
DebugLogger.info("Weather retrieval", 3);
|
||||
long delay = 6000;
|
||||
|
||||
if (dynamic) {
|
||||
if (server.getOnlinePlayers().size() == 0) return;
|
||||
|
||||
List<Player> players = server.getOnlinePlayers().stream()
|
||||
.filter(player -> player.hasPermission("realweather.dynamic"))
|
||||
.filter(player -> mapper.getWorlds().contains(player.getWorld()))
|
||||
.collect(Collectors.toUnmodifiableList());
|
||||
|
||||
Coordinates[] coordinates = players.stream()
|
||||
.map(player -> mapper.locationToCoordinates(player.getLocation()))
|
||||
.toArray(Coordinates[]::new);
|
||||
|
||||
CompletableFuture<Weather[]> weathersFuture =
|
||||
weatherProvider.getWeatherBulk(coordinates);
|
||||
|
||||
float hourly = weatherProvider.getQuotaHourly() / (float)(weatherProvider.getBulkLimit() * players.size());
|
||||
int minTickDelay = (int) (72000 / hourly);
|
||||
|
||||
delay = Math.max(6000, minTickDelay);
|
||||
|
||||
try {
|
||||
Weather[] weathers = weathersFuture.join();
|
||||
for (int i=0; i<weathers.length; i++) {
|
||||
Player player = players.get(i);
|
||||
Weather weather = weathers[i];
|
||||
|
||||
playerWeatherDirectory.weathers.put(player, weather);
|
||||
|
||||
AsyncWeatherUpdateEvent event =
|
||||
new AsyncWeatherUpdateEvent(player, weather);
|
||||
|
||||
server.getPluginManager().callEvent(event);
|
||||
}
|
||||
} catch (CompletionException e) { // TODO handle finer exceptions
|
||||
DebugLogger.info("failed to retrieve weather data", 1);
|
||||
|
||||
if (DebugLogger.getDebugLevel() > 0)
|
||||
e.printStackTrace();
|
||||
|
||||
delay = 200;
|
||||
}
|
||||
} else {
|
||||
Coordinates point = mapper.getPoint();
|
||||
CompletableFuture<Weather> weatherFuture = weatherProvider.getWeather(point);
|
||||
|
||||
try {
|
||||
Weather weather = weatherFuture.join();
|
||||
|
||||
AsyncWeatherUpdateEvent event =
|
||||
new AsyncWeatherUpdateEvent(null, weather);
|
||||
|
||||
server.getPluginManager().callEvent(event);
|
||||
} catch (CompletionException e) { // TODO handle finer exceptions
|
||||
DebugLogger.info("failed to retrieve weather data", 1);
|
||||
|
||||
if (DebugLogger.getDebugLevel() > 0)
|
||||
e.printStackTrace();
|
||||
|
||||
delay = 200;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DebugLogger.info("Scheduling restart with delay %d", 3, delay);
|
||||
runTaskLaterAsynchronously(plugin, delay);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
Coordinates coordinates = mapper.locationToCoordinates(player.getLocation());
|
||||
|
||||
CompletableFuture<Weather> weatherFuture = weatherProvider.getWeather(coordinates);
|
||||
DebugLogger.info("A player joined so I requested weather", 3);
|
||||
|
||||
weatherFuture.thenAccept(weather -> {
|
||||
playerWeatherDirectory.weathers.put(player, weather);
|
||||
|
||||
AsyncWeatherUpdateEvent weatherEvent =
|
||||
new AsyncWeatherUpdateEvent(player, weather);
|
||||
|
||||
server.getPluginManager().callEvent(weatherEvent);
|
||||
}); // TODO is this really safe?
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package eu.m724.realweather.weather;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.WeatherType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import eu.m724.realweather.DebugLogger;
|
||||
import eu.m724.wtapi.object.Weather;
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
|
||||
// TODO this class is currently unused and it will probably be removed or replaced
|
||||
public class DynamicWeatherApplier extends BukkitRunnable {
|
||||
private List<Player> players;
|
||||
private Weather[] weathers;
|
||||
|
||||
public DynamicWeatherApplier(List<Player> players, Weather[] weathers) {
|
||||
this.players = players;
|
||||
this.weathers = weathers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
DebugLogger.info("applying weather for %d players", 2, players.size());
|
||||
|
||||
for (int i=0; i<players.size(); i++) {
|
||||
Player player = players.get(i);
|
||||
Weather weather = weathers[i];
|
||||
|
||||
if (player.hasPermission("realweather.actionbar")) {
|
||||
String text = String.format("%f %f (%s) - %s",
|
||||
weather.coordinates.latitude, weather.coordinates.longitude,
|
||||
weather.city, weather.description);
|
||||
BaseComponent component = TextComponent.fromLegacy(text);
|
||||
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, component);
|
||||
|
||||
DebugLogger.info("%s has actionbar permission so they received status", 2, player.getName());
|
||||
}
|
||||
|
||||
if (weather.isRaining()) {
|
||||
player.setPlayerWeather(WeatherType.DOWNFALL);
|
||||
} else {
|
||||
player.setPlayerWeather(WeatherType.CLEAR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,137 +0,0 @@
|
|||
package eu.m724.realweather.weather;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.CompletionException;
|
||||
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import eu.m724.realweather.DebugLogger;
|
||||
import eu.m724.realweather.GlobalConstants;
|
||||
import eu.m724.realweather.mapper.Mapper;
|
||||
import eu.m724.realweather.api.weather.AsyncWeatherUpdateEvent;
|
||||
import eu.m724.wtapi.object.Coordinates;
|
||||
import eu.m724.wtapi.object.Weather;
|
||||
import eu.m724.wtapi.provider.weather.WeatherProvider;
|
||||
|
||||
public class DynamicWeatherRetriever extends BukkitRunnable implements Listener {
|
||||
private final WeatherProvider weatherProvider;
|
||||
|
||||
private final Mapper mapper = GlobalConstants.getMapper();
|
||||
private final Plugin plugin = GlobalConstants.getPlugin();
|
||||
private final Server server = plugin.getServer();
|
||||
private final PlayerWeatherCache playerWeatherCache = GlobalConstants.getPlayerWeatherCache();
|
||||
|
||||
// when to next update all players
|
||||
private long nextUpdate = 0;
|
||||
// players that need update asap
|
||||
private final Set<Player> neededUpdate = new HashSet<>();
|
||||
|
||||
public DynamicWeatherRetriever(WeatherProvider weatherProvider) {
|
||||
this.weatherProvider = weatherProvider;
|
||||
}
|
||||
|
||||
private record CoordinatesResult(
|
||||
Map<Coordinates, Player[]> coordinatesPlayersMap,
|
||||
int coordinatesCount,
|
||||
int playerCount
|
||||
) {}
|
||||
|
||||
private CoordinatesResult makeCoordinates(Collection<? extends Player> players) {
|
||||
Map<Coordinates, Player[]> map = new HashMap<>();
|
||||
int coordinatesCount = 0;
|
||||
int playerCount = 0;
|
||||
|
||||
long now = System.currentTimeMillis();
|
||||
|
||||
for (Player player : players) {
|
||||
if (!player.hasPermission("realweather.dynamic")) continue;
|
||||
if (!mapper.getWorlds().contains(player.getWorld())) continue;
|
||||
|
||||
Long lastUpdate = playerWeatherCache.getLastUpdate(player);
|
||||
if (lastUpdate != null && now - lastUpdate < 10000) continue;
|
||||
|
||||
Coordinates coordinates = mapper.locationToCoordinates(player.getLocation());
|
||||
Coordinates closestCoordinates = null;
|
||||
|
||||
for (Coordinates potential : map.keySet()) {
|
||||
//double distance = Math.sqrt(Math.pow(potential.latitude - coordinates.latitude, 2) + Math.pow(potential.longitude - potential.latitude, 2));
|
||||
// TODO setup for "bundling" that is one request for close players
|
||||
}
|
||||
|
||||
if (closestCoordinates != null) {
|
||||
Player[] oldPlayerArray = map.get(coordinates);
|
||||
Player[] newPlayerArray = Arrays.copyOf(oldPlayerArray, oldPlayerArray.length + 1);
|
||||
newPlayerArray[oldPlayerArray.length] = player;
|
||||
map.put(coordinates, newPlayerArray);
|
||||
} else {
|
||||
map.put(coordinates, new Player[] { player });
|
||||
coordinatesCount++;
|
||||
}
|
||||
|
||||
playerCount++;
|
||||
}
|
||||
|
||||
return new CoordinatesResult(map, coordinatesCount, playerCount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
DebugLogger.info("Weather retrieval", 3);
|
||||
long now = System.currentTimeMillis();
|
||||
|
||||
CoordinatesResult coordinates;
|
||||
if (now > nextUpdate) {
|
||||
coordinates = makeCoordinates(server.getOnlinePlayers());
|
||||
// calculate acceptable request rate based on weather provider quota and active players
|
||||
float hourly = weatherProvider.getQuotaHourly() / (float)(weatherProvider.getBulkLimit() * coordinates.coordinatesCount());
|
||||
nextUpdate = now + Math.max(60000, (long) (3600000 / hourly));
|
||||
DebugLogger.info("Next update in %d", 3, nextUpdate);
|
||||
} else { // immediate update for those that need it right now
|
||||
if (neededUpdate.isEmpty()) return;
|
||||
DebugLogger.info("Players in need of update: %d", 2, neededUpdate.size());
|
||||
coordinates = makeCoordinates(neededUpdate);
|
||||
neededUpdate.clear();
|
||||
}
|
||||
Coordinates[] coordinatesArray = coordinates.coordinatesPlayersMap().keySet().toArray(Coordinates[]::new);
|
||||
|
||||
// TODO change to Collection in wtapi? but some ordered kind
|
||||
CompletableFuture<Weather[]> weathersFuture =
|
||||
weatherProvider.getWeatherBulk(coordinatesArray);
|
||||
|
||||
try {
|
||||
Weather[] weathers = weathersFuture.join();
|
||||
for (int i=0; i<weathers.length; i++) {
|
||||
Weather weather = weathers[i];
|
||||
for (Player player : coordinates.coordinatesPlayersMap().get(coordinatesArray[i])) {
|
||||
playerWeatherCache.put(player, weather, now);
|
||||
|
||||
AsyncWeatherUpdateEvent event =
|
||||
new AsyncWeatherUpdateEvent(player, weather);
|
||||
|
||||
server.getPluginManager().callEvent(event);
|
||||
}
|
||||
}
|
||||
} catch (CompletionException e) { // TODO handle finer exceptions
|
||||
DebugLogger.info("An error occurred trying to retrieve weather data", 0);
|
||||
|
||||
if (DebugLogger.getDebugLevel() > 0)
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
DebugLogger.info("dynamic retriever done", 3);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
neededUpdate.add(player);
|
||||
}
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package eu.m724.realweather.weather;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import eu.m724.wtapi.object.Weather;
|
||||
|
||||
/**
|
||||
* Stores player weathers and when they were last updated
|
||||
*/
|
||||
public class PlayerWeatherCache {
|
||||
HashMap<Player, Weather> weathers = new HashMap<>();
|
||||
HashMap<Player, Long> lastUpdates = new HashMap<>();
|
||||
|
||||
void put(Player player, Weather weather, Long lastUpdate) {
|
||||
weathers.put(player, weather);
|
||||
lastUpdates.put(player, lastUpdate);
|
||||
}
|
||||
|
||||
public Weather getWeather(Player player) {
|
||||
return weathers.get(player);
|
||||
}
|
||||
|
||||
public Long getLastUpdate(Player player) {
|
||||
return lastUpdates.get(player);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package eu.m724.realweather.weather;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import eu.m724.wtapi.object.Weather;
|
||||
|
||||
public class PlayerWeatherDirectory {
|
||||
HashMap<Player, Weather> weathers = new HashMap<>();
|
||||
|
||||
public Weather getWeather(Player player) {
|
||||
return weathers.get(player); // TODO concurrent exception?
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
package eu.m724.realweather.weather;
|
||||
|
||||
import eu.m724.realweather.DebugLogger;
|
||||
import eu.m724.realweather.GlobalConstants;
|
||||
import eu.m724.realweather.api.weather.AsyncWeatherUpdateEvent;
|
||||
import eu.m724.realweather.mapper.Mapper;
|
||||
import eu.m724.wtapi.object.Coordinates;
|
||||
import eu.m724.wtapi.object.Weather;
|
||||
import eu.m724.wtapi.provider.weather.WeatherProvider;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.CompletionException;
|
||||
|
||||
public class StaticWeatherRetriever extends BukkitRunnable {
|
||||
private final Plugin plugin = GlobalConstants.getPlugin();
|
||||
private final Mapper mapper = GlobalConstants.getMapper();
|
||||
|
||||
private final WeatherProvider weatherProvider;
|
||||
|
||||
public StaticWeatherRetriever(WeatherProvider weatherProvider) {
|
||||
this.weatherProvider = weatherProvider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Coordinates point = mapper.getPoint();
|
||||
CompletableFuture<Weather> weatherFuture = weatherProvider.getWeather(point);
|
||||
|
||||
try {
|
||||
Weather weather = weatherFuture.join();
|
||||
|
||||
AsyncWeatherUpdateEvent event =
|
||||
new AsyncWeatherUpdateEvent(null, weather);
|
||||
|
||||
plugin.getServer().getPluginManager().callEvent(event);
|
||||
} catch (CompletionException e) { // TODO handle finer exceptions
|
||||
DebugLogger.info("An error occurred trying to retrieve weather data", 0);
|
||||
|
||||
if (DebugLogger.getDebugLevel() > 0)
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
DebugLogger.info("static weather retriever is done", 3);
|
||||
}
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
package eu.m724.realweather.weather;
|
||||
|
||||
import eu.m724.realweather.DebugLogger;
|
||||
import eu.m724.realweather.GlobalConstants;
|
||||
import eu.m724.realweather.api.weather.AsyncWeatherUpdateEvent;
|
||||
import eu.m724.realweather.mapper.Mapper;
|
||||
import eu.m724.wtapi.object.Weather;
|
||||
import org.bukkit.WeatherType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
// TODO make weather more comprehensive
|
||||
public class WeatherChanger implements Listener {
|
||||
private final Mapper mapper = GlobalConstants.getMapper();
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onWeatherUpdate(AsyncWeatherUpdateEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
Weather weather = event.getWeather();
|
||||
|
||||
if (player != null) { // dynamic mode
|
||||
DebugLogger.info("Changing weather for player %s", 2, player.getName());
|
||||
|
||||
if (weather.isThundering() || weather.isSnowing() || weather.isRaining()) {
|
||||
player.setPlayerWeather(WeatherType.DOWNFALL);
|
||||
} else {
|
||||
player.setPlayerWeather(WeatherType.CLEAR);
|
||||
}
|
||||
} else { // static mode
|
||||
DebugLogger.info("Changing weather static", 3);
|
||||
mapper.getWorlds().forEach(w -> {
|
||||
DebugLogger.info("Changing weather static in world %s", 2, w.getName());
|
||||
if (weather.isThundering()) {
|
||||
w.setClearWeatherDuration(0);
|
||||
w.setWeatherDuration(120000);
|
||||
w.setThunderDuration(120000);
|
||||
} else if (weather.isRaining() || weather.isSnowing()) {
|
||||
w.setClearWeatherDuration(0);
|
||||
w.setWeatherDuration(120000);
|
||||
w.setThunderDuration(0);
|
||||
} else {
|
||||
w.setClearWeatherDuration(120000);
|
||||
w.setWeatherDuration(0);
|
||||
w.setThunderDuration(0);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,26 +2,25 @@ package eu.m724.realweather.weather;
|
|||
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
|
||||
/**
|
||||
* Configuration of the weather module
|
||||
*
|
||||
* @param enabled Is weather module enabled
|
||||
* @param provider The provider name, may or may not exist, if it doesn't, an error is thrown later
|
||||
* @param apiKey API key for the provider
|
||||
* @param dynamic dynamic mode, weather is per player or global
|
||||
*/
|
||||
public record WeatherConfig(
|
||||
boolean enabled,
|
||||
String provider,
|
||||
String apiKey, // TODO don't expose that, I mean it's only used in one place in init
|
||||
boolean dynamic
|
||||
) {
|
||||
public class WeatherConfig {
|
||||
public boolean enabled;
|
||||
|
||||
public String provider;
|
||||
public String apiKey;
|
||||
|
||||
// state is per player
|
||||
public boolean dynamic;
|
||||
|
||||
public static WeatherConfig fromConfiguration(ConfigurationSection configuration) {
|
||||
return new WeatherConfig(
|
||||
configuration.getBoolean("enabled"),
|
||||
configuration.getString("provider"),
|
||||
configuration.getString("apiKey"),
|
||||
configuration.getBoolean("dynamic")
|
||||
);
|
||||
WeatherConfig weatherConfig = new WeatherConfig();
|
||||
|
||||
weatherConfig.enabled = configuration.getBoolean("enabled");
|
||||
|
||||
weatherConfig.provider = configuration.getString("provider");
|
||||
weatherConfig.apiKey = configuration.getString("apiKey");
|
||||
|
||||
weatherConfig.dynamic = configuration.getBoolean("dynamic");
|
||||
|
||||
return weatherConfig;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,49 +1,58 @@
|
|||
package eu.m724.realweather.weather;
|
||||
|
||||
import eu.m724.realweather.Configs;
|
||||
import org.bukkit.GameRule;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import eu.m724.realweather.DebugLogger;
|
||||
import eu.m724.realweather.GlobalConstants;
|
||||
import eu.m724.realweather.mapper.Mapper;
|
||||
import eu.m724.wtapi.provider.Providers;
|
||||
import eu.m724.wtapi.provider.exception.NoSuchProviderException;
|
||||
import eu.m724.realweather.object.UserException;
|
||||
import eu.m724.wtapi.provider.WeatherProvider;
|
||||
import eu.m724.wtapi.provider.exception.ProviderException;
|
||||
import eu.m724.wtapi.provider.weather.WeatherProvider;
|
||||
import eu.m724.wtapi.provider.impl.openweathermap.OpenWeatherMapProvider;
|
||||
|
||||
public class WeatherMaster {
|
||||
private final WeatherConfig config = Configs.weatherConfig();
|
||||
private final Mapper mapper = GlobalConstants.getMapper();
|
||||
private WeatherConfig config;
|
||||
private WeatherProvider provider;
|
||||
private Mapper mapper = GlobalConstants.getMapper();
|
||||
private Plugin plugin = GlobalConstants.getPlugin();
|
||||
|
||||
public WeatherMaster(WeatherConfig config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
/**
|
||||
* initializes, tests and starts
|
||||
* @throws UserException config issue
|
||||
* @throws ProviderException if provider initialization failed
|
||||
* @throws NoSuchProviderException config issue
|
||||
*/
|
||||
public void init(Plugin plugin) throws ProviderException, NoSuchProviderException {
|
||||
if (!config.enabled()) {
|
||||
DebugLogger.info("weather module is disabled", 1);
|
||||
public void init() throws UserException, ProviderException {
|
||||
if (!config.enabled)
|
||||
return;
|
||||
}
|
||||
|
||||
WeatherProvider provider = Providers.getWeatherProvider(config.provider(), config.apiKey());
|
||||
provider = createProvider();
|
||||
|
||||
if (provider == null)
|
||||
throw new UserException("Invalid provider: " + config.provider);
|
||||
|
||||
provider.init();
|
||||
|
||||
if (config.dynamic()) {
|
||||
DynamicWeatherRetriever retriever = new DynamicWeatherRetriever(provider);
|
||||
retriever.runTaskTimerAsynchronously(plugin,0, 1000);
|
||||
plugin.getServer().getPluginManager().registerEvents(retriever, plugin);
|
||||
} else {
|
||||
StaticWeatherRetriever retriever = new StaticWeatherRetriever(provider);
|
||||
retriever.runTaskTimerAsynchronously(plugin,0, 60000);
|
||||
}
|
||||
|
||||
plugin.getServer().getPluginManager().registerEvents(new WeatherChanger(), plugin);
|
||||
AsyncWeatherRetriever retriever = new AsyncWeatherRetriever(provider);
|
||||
retriever.runTaskAsynchronously(plugin);
|
||||
plugin.getServer().getPluginManager().registerEvents(retriever, plugin);
|
||||
|
||||
mapper.registerWorldLoadConsumer(world -> world.setGameRule(GameRule.DO_WEATHER_CYCLE, false));
|
||||
mapper.registerWorldUnloadConsumer(world -> world.setGameRule(GameRule.DO_WEATHER_CYCLE, true));
|
||||
|
||||
DebugLogger.info("weather loaded", 1);
|
||||
}
|
||||
|
||||
private WeatherProvider createProvider() {
|
||||
switch (config.provider) {
|
||||
case "openweathermap":
|
||||
return new OpenWeatherMapProvider(config.apiKey);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
package eu.m724.realweather.weather.event;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import eu.m724.wtapi.object.Weather;
|
||||
|
||||
/**
|
||||
* Fired when a weather state is retrieved
|
||||
* it doesn't mean a change
|
||||
*/
|
||||
public class AsyncWeatherUpdateEvent extends Event {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
|
||||
private final Player player;
|
||||
private final Weather weather;
|
||||
|
||||
public AsyncWeatherUpdateEvent(Player player, Weather weather) {
|
||||
super(true);
|
||||
this.player = player;
|
||||
this.weather = weather;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return a player that the weather is for, null if not dynamic
|
||||
*/
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
public Weather getWeather() {
|
||||
return weather;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
|
||||
}
|
|
@ -3,21 +3,15 @@
|
|||
############################
|
||||
|
||||
# Master switch
|
||||
enabled: false
|
||||
enabled: true
|
||||
|
||||
updater:
|
||||
# Notify players and console about plugin updates
|
||||
# This also controls automatic checking
|
||||
# You can still update with /rwadmin update
|
||||
# Relevant permission node: realweather.update.notify
|
||||
# notify players about plugin updates
|
||||
# revelant permission node: realweather.update.notify
|
||||
notify: true
|
||||
# stable for stable releases
|
||||
# testing for latest builds (untested hence the name)
|
||||
# As there's no release yet, stable will just error
|
||||
channel: testing
|
||||
|
||||
# 0 - no debug
|
||||
# 1 - debug loading modules
|
||||
# 2 - also debug processing conditions
|
||||
# 3 - also log tasks running, this will spam
|
||||
debug: 0
|
||||
debug: 3
|
|
@ -8,17 +8,16 @@ worlds:
|
|||
- world
|
||||
|
||||
dimensions:
|
||||
# Blocks per 1 deg, can't be decimal
|
||||
# latitude = -Z, longitude = X (to match with F3)
|
||||
# The default (111000) assumes 1 block = 1 meter
|
||||
latitude: 111000 # -9990000 to 9990000 Z
|
||||
longitude: 111000 # -19980000 to 19980000 X
|
||||
# blocks per 1 deg, can't be decimal
|
||||
# the default (111000) assumes 1 block = 1 meter
|
||||
latitude: 111000
|
||||
longitude: 111000
|
||||
|
||||
# To make it span world border to world border:
|
||||
# if you want the globe to cover the whole world use:
|
||||
# latitude: 333333
|
||||
# longitude: 166666
|
||||
|
||||
# For `static` mode
|
||||
# if you use `static` mode
|
||||
point:
|
||||
latitude: 0
|
||||
longitude: 0
|
|
@ -4,12 +4,11 @@
|
|||
|
||||
enabled: false
|
||||
|
||||
# Currently only blitzortung
|
||||
# currently only blitzortung
|
||||
provider: blitzortung
|
||||
|
||||
# How often should we poll for updates and spawn lightning
|
||||
# This is a synchronous task
|
||||
# Exaggerating, if you put it too low you'll have lag,
|
||||
# But if you put it too high you'll have lag spikes and weird lightning
|
||||
# In ticks, default 100 is 5 seconds so reduce if lightning seems weird, in my testing even 5 ticks is fine
|
||||
refreshPeriod: 100
|
||||
# how often should we poll for updates and spawn lightning
|
||||
# this is a synchronous task
|
||||
# if you put it too low you'll have constant lag
|
||||
# but if you put it too high it will process a lot of data at once so you'll have lag spikes
|
||||
refresh: 100 # ticks
|
||||
|
|
|
@ -2,20 +2,16 @@
|
|||
### TIME SETTINGS ###
|
||||
############################
|
||||
|
||||
# Warning: this removes sleep
|
||||
# No, it's not a bug. It would de-synchronize, and can you skip time IRL?
|
||||
# Can you believe that I actually used to consider this a bug?
|
||||
|
||||
# warning: this removes sleep
|
||||
enabled: false
|
||||
|
||||
# How this plugin affects your world:
|
||||
# - static (false): time is the same across the world
|
||||
# - dynamic (true): static + local time for each player, however it's only cosmetic so it will not match mobs spawning etc
|
||||
# Settings for both are in map.yml
|
||||
# - dynamic (true): static + local time for each player, however it's only cosmetical so it will not match mobs spawning etc
|
||||
# settings for both are in map.yml
|
||||
dynamic: true
|
||||
|
||||
# x in game day cycles in 1 irl day cycle
|
||||
# 2.0 - time goes 2x SLOWER
|
||||
# 0.5 - time goes 2x FASTER
|
||||
# If modified, time will no longer be in sync with real life
|
||||
# time will no longer be in sync
|
||||
# can be decimal
|
||||
scale: 1.0
|
|
@ -2,11 +2,6 @@
|
|||
### WEATHER SETTINGS ###
|
||||
############################
|
||||
|
||||
# In Minecraft, it can only rain or not rain (or snow - but not both) and thunder or not thunder.
|
||||
# In real life, rain, thunder, snow can be heavy, moderate, light and in between and can coexist. That's excluding many other conditions.
|
||||
# For now, there's just rain and thunder
|
||||
# This plugin will improve in the future, but there's other stuff to work on currently. I hope you understand.
|
||||
|
||||
enabled: false
|
||||
|
||||
# Currently only OpenWeatherMap
|
||||
|
@ -16,6 +11,6 @@ apiKey: REPLACE ME
|
|||
|
||||
# How this plugin affects your world:
|
||||
# - static (false): weather is the same across the world
|
||||
# - dynamic (true): weather is per player, however it's only cosmetic so it will not match mobs spawning etc
|
||||
# - dynamic (true): weather is per player, however it's only cosmetical so it will not match mobs spawning etc
|
||||
# settings for both are in map.yml
|
||||
dynamic: true
|
|
@ -2,51 +2,42 @@ name: RealWeather
|
|||
version: ${project.version}
|
||||
|
||||
author: Minecon724
|
||||
website: https://www.spigotmc.org/resources/realweather-realtime.101599/
|
||||
website: https://forum.m724.eu/topic/3/realweather-1-0
|
||||
|
||||
api-version: 1.19.4
|
||||
api-version: 1.20
|
||||
load: STARTUP
|
||||
main: eu.m724.realweather.RealWeatherPlugin
|
||||
|
||||
libraries:
|
||||
- org.java-websocket:Java-WebSocket:1.5.7
|
||||
|
||||
commands:
|
||||
rwadmin:
|
||||
description: RealWeather admin command
|
||||
permission: realweather.admin
|
||||
permission-message: You do not have permission to use this command.
|
||||
|
||||
# usage is processed in code
|
||||
geo:
|
||||
description: Convert lat,lon <=> x,y,z
|
||||
description: Convert lat,lon to x,y,z and vice versa
|
||||
permission: realweather.command.geo
|
||||
permission-message: You do not have permission to use this command.
|
||||
# usage is processed in code
|
||||
localtime:
|
||||
description: Get real time in current location
|
||||
permission: realweather.command.localtime
|
||||
permission-message: You do not have permission to use this command.
|
||||
localweather:
|
||||
description: Get weather in current location
|
||||
permission: realweather.command.localweather
|
||||
permission-message: You do not have permission to use this command.
|
||||
|
||||
permissions:
|
||||
# Commands
|
||||
|
||||
realweather.admin:
|
||||
description: Allows admin management with /rwadmin
|
||||
realweather.admin.update:
|
||||
description: Allows installing updates with /rwadmin update
|
||||
|
||||
realweather.command.geo:
|
||||
description: Allows /geo
|
||||
default: true
|
||||
realweather.command.geo.tp:
|
||||
description: Allows teleportation using /geo
|
||||
realweather.command.localtime:
|
||||
description: Allows /localtime
|
||||
default: true
|
||||
realweather.command.localweather:
|
||||
description: Allows /localweather
|
||||
default: true
|
||||
|
||||
# Engine
|
||||
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxjjjayrwlo3cnv+rX1EX
|
||||
lJN9vHS9MNfvE7zFOHr2JEAx2fRosb2oRzNK0ssoHJFOgrwLWIqrLVS8bTHRujsF
|
||||
asck2Z1RY5UGe34vNQ5u5MZvm4G25LggC6+ei2kEptoAfgp9kjmeKVPiSnruLn7N
|
||||
YQc9U4nmr/vJg+SNmy00EkXFU5z3ZsLf8aCjx9rtogZzyZmVPXEDGY3ZjzZxOpv9
|
||||
TAvSQlmrc6qmLlY7XZmJMtbzCTq+qqemZBKp6WpNmEogpPgXamOrET434+oE7OCz
|
||||
+WCFKsVN8qbrQdFLf1HSjghvDoIjHcGfz6cP4nBonSKIfMcr+NziAVmimfqOiDxa
|
||||
nwIDAQAB
|
||||
-----END PUBLIC KEY-----
|
BIN
testkeystore.jks
BIN
testkeystore.jks
Binary file not shown.
Loading…
Reference in a new issue