From 5ebc04ab29e8d19a40f36d59861355eeadf2cb35 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 27 Jan 2020 11:59:17 -0500 Subject: [PATCH 1/3] Update SERVERLIST.md --- SERVERLIST.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SERVERLIST.md b/SERVERLIST.md index 5d3c0370c5..659daddfb8 100644 --- a/SERVERLIST.md +++ b/SERVERLIST.md @@ -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. 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. -2. **Set an aproppriate MOTD, name and description.** This is set with `config `. "Aproppriate" means that: +2. **Set an approppriate MOTD, name and description.** This is set with `config `. "Approppriate" means that: - 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. - 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. From d849a3a87fc43ce9576e89e8eade4276b76a3b41 Mon Sep 17 00:00:00 2001 From: Daniel Jennings <582974+danieljennings@users.noreply.github.com> Date: Mon, 27 Jan 2020 09:17:52 -0800 Subject: [PATCH 2/3] Adding Steam Rich Presence support. (#1453) * Steam Rich Presence support. I opted to put this code inside of DesktopLauncher.java instead of SNet.java because it heavily overlaps with the work the DiscordRPC code was already doing. Testing wasn't easy because I had to figure out how the Steam version actually runs normally, but it was straightforward once I figured out what version information to slam into the JAR and fixed 'desktop:steamtest' to work locally with my paths. Because of how Steam currently expects SetRichPresence to be used, I had to upload to the Steam partner site a trivial Rich Presence loc token called 'steam_status_raw' that just gets entirely substituted for the 'steam_status' RP token string. I didn't expect that I'd need to do anything for localization support (and instead just let it use English for everyone like Discord) but apparently Steam isn't happy if you directly set 'steam_display' to a raw string (but I'm going to look at that when I'm back at work because I don't know that we need that requirement.) * Whoops, left this in there from debugging the Steam connection. * Fixing coding style, and also triggering another CI build --- .../mindustry/desktop/DesktopLauncher.java | 67 +++++++++++++------ 1 file changed, 48 insertions(+), 19 deletions(-) diff --git a/desktop/src/mindustry/desktop/DesktopLauncher.java b/desktop/src/mindustry/desktop/DesktopLauncher.java index b09894e521..0ada554894 100644 --- a/desktop/src/mindustry/desktop/DesktopLauncher.java +++ b/desktop/src/mindustry/desktop/DesktopLauncher.java @@ -243,36 +243,65 @@ public class DesktopLauncher extends ClientLauncher{ @Override 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)){ - String map = world.getMap() == null ? "Unknown Map" : world.isZone() ? world.getZone().localizedName : Strings.capitalize(world.getMap().name()); - String mode = state.rules.pvp ? "PvP" : state.rules.attackMode ? "Attack" : "Survival"; - String players = net.active() && playerGroup.size() > 1 ? " | " + playerGroup.size() + " Players" : ""; - - presence.state = mode + players; - - if(!state.rules.waves){ - presence.details = map; - }else{ - presence.details = map + " | Wave " + state.wave; - presence.largeImageText = "Wave " + state.wave; + if(inGame){ + if(world.getMap() != null){ + gameMapWithWave = world.isZone() ? world.getZone().localizedName : Strings.capitalize(world.getMap().name()); + } + if(state.rules.waves){ + gameMapWithWave += " | Wave " + state.wave; + } + gameMode = state.rules.pvp ? "PvP" : state.rules.attackMode ? "Attack" : "Survival"; + if(net.active() && playerGroup.size() > 1){ + gamePlayersSuffix = " | " + playerGroup.size() + " Players"; } }else{ if(ui.editor != null && ui.editor.isShown()){ - presence.state = "In Editor"; + uiState = "In Editor"; }else if(ui.deploy != null && ui.deploy.isShown()){ - presence.state = "In Launch Selection"; + uiState = "In Launch Selection"; }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 From 881eca636db0c4627c405ef1b1b79ab6449dabeb Mon Sep 17 00:00:00 2001 From: MWestfall Date: Mon, 27 Jan 2020 12:55:18 -0500 Subject: [PATCH 3/3] Update servers.json (#1457) --- servers.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/servers.json b/servers.json index 81ea4bf021..8812eee20f 100644 --- a/servers.json +++ b/servers.json @@ -1,5 +1,11 @@ [ { "address": "mindustry.us.to" + }, + { + "address": "mindustry.ecansol.com:6597" + }, + { + "address": "mindustry.ecansol.com:6499" } ]