Skip to content

Commit

Permalink
Some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
IndianBartonka committed Oct 21, 2023
1 parent b7f006d commit 6463f36
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/me/indian/bds/BDSAutoEnable.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void init() {
this.watchDog.getPackModule().initPackModule();
new RestWebsite(this).init();
this.discord.init();
this.serverManager.getStatsManager().startCountServerTime(serverProcess);
this.serverManager.getStatsManager().startCountServerTime(this.serverProcess);
this.serverProcess.startProcess();
this.versionManager.getVersionUpdater().checkForUpdate();
new AutoMessages(this).start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@ private String generateRawMessage(final Message message){
}

private String generatorReply(final Message messageReference) {
//TODO: Dodać opcje wykrycia ręcznego oznaczeń
return messageReference == null ? "" : this.discordConfig.getDiscordMessagesConfig().getReplyStatement()
.replaceAll("<msg>", this.generateRawMessage(messageReference))
.replaceAll("<msg>", this.generateRawMessage(messageReference).replaceAll("\\*\\*", ""))
.replaceAll("<author>", this.getUserName(messageReference.getMember(), messageReference.getAuthor()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public ServerManager(final BDSAutoEnable bdsAutoEnable) {

public void initFromLog(final String logEntry) {
this.service.execute(() -> {
//Metody związane z graczem
this.playerJoin(logEntry);
this.playerQuit(logEntry);
this.chatMessage(logEntry);
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/me/indian/bds/server/ServerProcess.java
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ public void sendToConsole(final String command) {

outputStream.write((command + "\n").getBytes());
outputStream.flush();
this.logger.debug("Wysłano &b" + command);

} catch(final Exception exception){
this.logger.error("Wystąpił błąd podczas próby wysłania polecenia do konsoli" , exception);
Expand Down Expand Up @@ -439,8 +440,6 @@ public Process getProcess() {
return this.process;
}

//TODO: dodać metodę do liczenia czasu online servera

private boolean containsNotAllowedToFileLog(final String msg) {
for (final String s : this.config.getLogConfig().getNoFile()) {
if (msg.toLowerCase().contains(s.toLowerCase())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ public void restart(final boolean alert) {
this.logger.error("Nie można zrestartować servera gdy jest on wyłączony!");
return;
}
this.serverProcess.tellrawToAllAndLogger(this.prefix,
"&aPrzygotowanie do&b restartu&a servera",
LogState.WARNING);
this.watchDog.saveAndResume();
if (alert) this.restartAlert();
this.serverProcess.kickAllPlayers("&aServer jest restartowany....");
Expand Down

0 comments on commit 6463f36

Please sign in to comment.