Merge branch 'master' into crater
This commit is contained in:
@@ -8,7 +8,7 @@ You may want to add your server to this list. The steps for getting this done ar
|
|||||||
1. **Ensure your server is properly moderated.** For the most part, this applies to survival servers, but PvP servers can be affected as well.
|
1. **Ensure your server is properly moderated.** For the most part, this applies to survival servers, but PvP servers can be affected as well.
|
||||||
You'll need to either hire some moderators, or make use of (currently non-existent) anti-grief and anti-curse plugins.
|
You'll need to either hire some moderators, or make use of (currently non-existent) anti-grief and anti-curse plugins.
|
||||||
*Consider enabling a rate limit:* `config messageRateLimit 2` will make it so that players can only send messages every 2 seconds, for example.
|
*Consider enabling a rate limit:* `config messageRateLimit 2` will make it so that players can only send messages every 2 seconds, for example.
|
||||||
2. **Set an aproppriate MOTD, name and description.** This is set with `config <name/desc/motd> <value>`. "Aproppriate" means that:
|
2. **Set an approppriate MOTD, name and description.** This is set with `config <name/desc/motd> <value>`. "Approppriate" means that:
|
||||||
- Your name or description must reflect the type of server you're hosting.
|
- Your name or description must reflect the type of server you're hosting.
|
||||||
Since new players may be exposed to the server list early on, put in a phrase like "Co-op survival" or "PvP" so players know what they're getting into. Yes, this is also displayed in the server mode info text, but having extra info in the name doesn't hurt.
|
Since new players may be exposed to the server list early on, put in a phrase like "Co-op survival" or "PvP" so players know what they're getting into. Yes, this is also displayed in the server mode info text, but having extra info in the name doesn't hurt.
|
||||||
- Make sure players know where to refer to for server support. It should be fairly clear that the server owner is not me, but you.
|
- Make sure players know where to refer to for server support. It should be fairly clear that the server owner is not me, but you.
|
||||||
|
|||||||
@@ -243,36 +243,65 @@ public class DesktopLauncher extends ClientLauncher{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateRPC(){
|
public void updateRPC(){
|
||||||
if(!useDiscord) return;
|
//if we're using neither discord nor steam, do no work
|
||||||
|
if(!useDiscord && !steam) return;
|
||||||
|
|
||||||
DiscordRichPresence presence = new DiscordRichPresence();
|
//common elements they each share
|
||||||
|
boolean inGame = !state.is(State.menu);
|
||||||
|
String gameMapWithWave = "Unknown Map";
|
||||||
|
String gameMode = "";
|
||||||
|
String gamePlayersSuffix = "";
|
||||||
|
String uiState = "";
|
||||||
|
|
||||||
if(!state.is(State.menu)){
|
if(inGame){
|
||||||
String map = world.getMap() == null ? "Unknown Map" : world.isZone() ? world.getZone().localizedName : Strings.capitalize(world.getMap().name());
|
if(world.getMap() != null){
|
||||||
String mode = state.rules.pvp ? "PvP" : state.rules.attackMode ? "Attack" : "Survival";
|
gameMapWithWave = world.isZone() ? world.getZone().localizedName : Strings.capitalize(world.getMap().name());
|
||||||
String players = net.active() && playerGroup.size() > 1 ? " | " + playerGroup.size() + " Players" : "";
|
}
|
||||||
|
if(state.rules.waves){
|
||||||
presence.state = mode + players;
|
gameMapWithWave += " | Wave " + state.wave;
|
||||||
|
}
|
||||||
if(!state.rules.waves){
|
gameMode = state.rules.pvp ? "PvP" : state.rules.attackMode ? "Attack" : "Survival";
|
||||||
presence.details = map;
|
if(net.active() && playerGroup.size() > 1){
|
||||||
}else{
|
gamePlayersSuffix = " | " + playerGroup.size() + " Players";
|
||||||
presence.details = map + " | Wave " + state.wave;
|
|
||||||
presence.largeImageText = "Wave " + state.wave;
|
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if(ui.editor != null && ui.editor.isShown()){
|
if(ui.editor != null && ui.editor.isShown()){
|
||||||
presence.state = "In Editor";
|
uiState = "In Editor";
|
||||||
}else if(ui.deploy != null && ui.deploy.isShown()){
|
}else if(ui.deploy != null && ui.deploy.isShown()){
|
||||||
presence.state = "In Launch Selection";
|
uiState = "In Launch Selection";
|
||||||
}else{
|
}else{
|
||||||
presence.state = "In Menu";
|
uiState = "In Menu";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
presence.largeImageKey = "logo";
|
if(useDiscord){
|
||||||
|
DiscordRichPresence presence = new DiscordRichPresence();
|
||||||
|
|
||||||
DiscordRPC.INSTANCE.Discord_UpdatePresence(presence);
|
if(inGame){
|
||||||
|
presence.state = gameMode + gamePlayersSuffix;
|
||||||
|
presence.details = gameMapWithWave;
|
||||||
|
if(state.rules.waves){
|
||||||
|
presence.largeImageText = "Wave " + state.wave;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
presence.state = uiState;
|
||||||
|
}
|
||||||
|
|
||||||
|
presence.largeImageKey = "logo";
|
||||||
|
|
||||||
|
DiscordRPC.INSTANCE.Discord_UpdatePresence(presence);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(steam){
|
||||||
|
//Steam mostly just expects us to give it a nice string, but it apparently expects "steam_display" to always be a loc token, so I've uploaded this one which just passes through 'steam_status' raw.
|
||||||
|
SVars.net.friends.setRichPresence("steam_display", "#steam_status_raw");
|
||||||
|
|
||||||
|
if(inGame){
|
||||||
|
SVars.net.friends.setRichPresence("steam_status", gameMapWithWave);
|
||||||
|
}else{
|
||||||
|
SVars.net.friends.setRichPresence("steam_status", uiState);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user