Skip to content

Commit

Permalink
1.7.1 (#127)
Browse files Browse the repository at this point in the history
* Fix color issue

* Removed the stafflist command

* Fixed discord bot in https://github.com/SkySwimmer/Centuria-Modding (external repo that affects the PROD server)
  • Loading branch information
SkySwimmer authored Oct 3, 2023
1 parent a5fe850 commit 766fa44
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 91 deletions.
64 changes: 64 additions & 0 deletions Centuria (SideTerminal).launch

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
id 'maven-publish'
}

version = "b1.7"
version = "b1.7.1"
group = "org.asf.centuria"

sourceCompatibility = '1.17'
Expand Down
6 changes: 6 additions & 0 deletions changelogs/b1.7.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Fixes in 1.7.1:
- Fixed the discord bot having issues locating centuria accounts
- Fixed colors in usernames breaking chat partially

Removed commands:
- Removed the 'stafflist' command since it breaks the game with large amounts of saved players (sorry)
4 changes: 2 additions & 2 deletions src/main/java/org/asf/centuria/Centuria.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

public class Centuria {
// Update
public static String SERVER_UPDATE_VERSION = "b1.7";
public static String SERVER_UPDATE_VERSION = "b1.7.1";
public static String DOWNLOAD_BASE_URL = "https://emuferal.ddns.net";

// Configuration
Expand Down Expand Up @@ -141,7 +141,7 @@ public static void main(String[] args)
System.out.println(" Centuria ");
System.out.println(" Fer.al Server Emulator ");
System.out.println(" ");
System.out.println(" Version b1.7 "); // not doing this
System.out.println(" Version b1.7.1 "); // not doing this
// dynamically as
// centering is a
// pain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,6 @@ private boolean handleCommand(String cmd, ChatClient client) {
commandMessages.add("staffroom");
commandMessages.add("listplayers");
}
commandMessages.add("stafflist");
if (client.getPlayer().getSaveSpecificInventory().getSaveSettings().giveAllResources
|| client.getPlayer().getSaveSpecificInventory().getSaveSettings().giveAllCurrency
|| client.getPlayer().getSaveSpecificInventory().getSaveSettings().giveAllFurnitureItems
Expand Down Expand Up @@ -733,91 +732,6 @@ private boolean handleCommand(String cmd, ChatClient client) {
+ "' is now your active quest! Please log out and log back in to complete the process.",
cmd, client);

return true;
} else if (cmdId.equalsIgnoreCase("stafflist")) {
// Staff list
HashMap<CenturiaAccount, String> staffAccounts = new HashMap<CenturiaAccount, String>();
AccountManager.getInstance().runForAllAccounts(t -> {
String lvl = "member";
if (t.getSaveSharedInventory().containsItem("permissions")) {
lvl = t.getSaveSharedInventory().getItem("permissions").getAsJsonObject()
.get("permissionLevel").getAsString();
}
if (GameServer.hasPerm(lvl, "moderator"))
staffAccounts.put(t, lvl);
});

// Create message
String msg = "";

// Go through developers
boolean foundAny = false;
for (CenturiaAccount acc : staffAccounts.keySet()) {
String lvl = staffAccounts.get(acc);
if (lvl.equals("developer")) {
// Check
if (!foundAny) {
foundAny = true;
if (msg.isEmpty())
msg += "Staff list:\n\n";
else
msg += "\n\n";
msg += "List of developers:";
}

// Add
msg += "\n - " + acc.getDisplayName() + " ["
+ (acc.getOnlinePlayerInstance() == null ? "OFFLINE" : "ONLINE") + "]";
}
}

// Go through admins
foundAny = false;
for (CenturiaAccount acc : staffAccounts.keySet()) {
String lvl = staffAccounts.get(acc);
if (lvl.equals("admin")) {
// Check
if (!foundAny) {
foundAny = true;
if (msg.isEmpty())
msg += "Staff list:\n\n";
else
msg += "\n\n";
msg += "List of administrators:";
}

// Add
msg += "\n - " + acc.getDisplayName() + " ["
+ (acc.getOnlinePlayerInstance() == null ? "OFFLINE" : "ONLINE") + "]";
}
}

// Go through moderators
foundAny = false;
for (CenturiaAccount acc : staffAccounts.keySet()) {
String lvl = staffAccounts.get(acc);
if (lvl.equals("moderator")) {
// Check
if (!foundAny) {
foundAny = true;
if (msg.isEmpty())
msg += "Staff list:\n\n";
else
msg += "\n\n";
msg += "List of moderators:";
}

// Add
msg += "\n - " + acc.getDisplayName() + " ["
+ (acc.getOnlinePlayerInstance() == null ? "OFFLINE" : "ONLINE") + "]";
}
}

// Default
if (msg.isEmpty())
msg = "There are no staff users.";
systemMessage(msg, cmd, client);

return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ else if (GameServer.hasPerm(permLevel, "moderator"))
prefix += "[mod] ";

// Return
return prefix + account.getDisplayName();
return prefix + account.getDisplayName() + (color.equals("default") ? "" : "</color>");
}

/**
Expand Down
2 changes: 1 addition & 1 deletion version.info
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=b1.7
version=b1.7.1
channel=beta

0 comments on commit 766fa44

Please sign in to comment.