"content":"Hi there!<br>First of all, welcome to Grasscutter. If you have any issues, please let us know so that Lawnmower can help you! Check out our:<br><div><p style=\"white-space: pre-wrap;\"><strong>¡þDiscord¡þ</strong></p><p style=\"white-space: pre-wrap;\"><a href=\"https://discord.gg/T5vZU6UyeG\">https://discord.gg/T5vZU6UyeG</a></p><p style=\"white-space: pre-wrap;\"><strong>¡þGitHub¡þ</strong></p><p style=\"white-space: pre-wrap;\"><a href=\"https://github.com/Grasscutters/Grasscutter\">https://github.com/Grasscutters/Grasscutter</a></p></div>",
"content":"<p>Hi there!</p><p>First of all, welcome to Grasscutter. If you have any issues, please let us know so that Lawnmower can help you!</p><br><p><strong>〓Discord〓</strong></p><a href=\"https://discord.gg/T5vZU6UyeG\">https://discord.gg/T5vZU6UyeG</a><br><br><p><strong>〓GitHub〓</strong><a href=\"https://github.com/Grasscutters/Grasscutter\">https://github.com/Grasscutters/Grasscutter</a>",
"lang":"es-es"
"lang":"en-US"
},
},
{
{
"ann_id":2,
"ann_id":2,
"title":"<b>How to use announcements</b>",
"title":"<strong>How to use announcements</strong>",
"content":"<strong>Tips<br></strong>>How to use announcements<br><br>>Announcement content can use HTML<br><br>>The specific content of the announcement is stored in the program directory<code>data/GameAnnouncement.json</code>, while<code>GameAnnouncementList.json</code> stores the announcement list data<br><br><strong>How to use</strong><br>>In <code>GameAnnouncement</code><table><thead><thead><tr><th>Parameters</th><th>Description</th></thead></thead><thbody><thead><tr><th>ann_Id</th><th>Announcement unique id</th></thead><thead><tr><th>title</th><th>Show at the top of the content</th></thead><thead><tr><th>subtitle</th><th>title shown on the left</th></thead><thead><tr><th>banner</th><th>Display between content and title</th></thead><thead><tr><th>content</th><th>as u see</th></thead><thead><tr><th>lang</th><th>display language</th></thead><thead><tr><th>total</th><th>Announcement quantity</th></thead></thbody></table><br><br>>In <code>GameAnnouncementList</code><br>If you want to add an annouement, please add the list data in the announcement type corresponding to GameAnnouncementList, and finally add the announcement content in GameAnnouncement",
"content":"<p>Announcement content uses HTML. The specific content of the announcement is stored in the program directory <code>GameAnnouncement.json</code>, while <code>GameAnnouncementList.json</code> stores the announcement list data.</p><h2><code>GameAnnouncement</code></h2><table><tr><th>Parameter</th><th>Description</th></tr><tr><td>ann_id</td><td>Unique ID</td></tr><tr><td>title</td><td>Title shown at the top of the content</td></tr><tr><td>subtitle</td><td>Short title shown on the left</td></tr><tr><td>banner</td><td>Image to display between content and title</td></tr><tr><td>content</td><td>Content body in HTML</td></tr><tr><td>lang</td><td>Language code for this entry</td></tr></table><h2><code>GameAnnouncementList</code></h2><p>If you want to add an announcement, please add the list data in the announcement type corresponding to <code>GameAnnouncementList</code>, and finally add the announcement content in <code>GameAnnouncement</code>.</p>",
"lang":"es-es"
"lang":"en-US"
},
{
"ann_id":3,
"title":"<b>ÕâÊǻ¹«¸æ--This is the event announcement</b>",
@@ -127,6 +131,9 @@ public final class Grasscutter {
...
@@ -127,6 +131,9 @@ public final class Grasscutter {
httpServer.addRouter(LegacyAuthHandler.class);
httpServer.addRouter(LegacyAuthHandler.class);
httpServer.addRouter(GachaHandler.class);
httpServer.addRouter(GachaHandler.class);
// TODO: find a better place?
StaminaManager.initialize();
// Start servers.
// Start servers.
varrunMode=SERVER.runMode;
varrunMode=SERVER.runMode;
if(runMode==ServerRunMode.HYBRID){
if(runMode==ServerRunMode.HYBRID){
...
@@ -178,15 +185,20 @@ public final class Grasscutter {
...
@@ -178,15 +185,20 @@ public final class Grasscutter {
* Attempts to load the configuration from a file.
* Attempts to load the configuration from a file.
*/
*/
publicstaticvoidloadConfig(){
publicstaticvoidloadConfig(){
// Check if config.json exists. If not, we generate a new config.
if(!configFile.exists()){
getLogger().info("config.json could not be found. Generating a default configuration ...");
config=newConfigContainer();
Grasscutter.saveConfig(config);
return;
}
// If the file already exists, we attempt to load it.
try(FileReaderfile=newFileReader(configFile)){
try(FileReaderfile=newFileReader(configFile)){
config=gson.fromJson(file,ConfigContainer.class);
config=gson.fromJson(file,ConfigContainer.class);
}catch(Exceptionexception){
}catch(Exceptionexception){
Grasscutter.saveConfig(null);
getLogger().error("There was an error while trying to load the configuration from config.json. Please make sure that there are no syntax errors. If you want to start with a default configuration, delete your existing config.json.");
config=newConfigContainer();
System.exit(1);
}catch(Errorerror){
// Occurred probably from an outdated config file.