Properly update map name and gamemode on steam (#6449)
* Properly update map name and gamemode on steam This has been bugging me for the longest time but I've been too lazy to fix it, I finally got around to doing so. * fix
This commit is contained in:
@@ -105,11 +105,8 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback,
|
|||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
Events.on(WaveEvent.class, e -> {
|
Events.on(WaveEvent.class, e -> updateWave());
|
||||||
if(currentLobby != null && net.server()){
|
Events.run(Trigger.newGame, this::updateWave);
|
||||||
smat.setLobbyData(currentLobby, "wave", state.wave + "");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSteamClient(){
|
public boolean isSteamClient(){
|
||||||
@@ -201,6 +198,14 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback,
|
|||||||
smat.setLobbyMemberLimit(currentLobby, Core.settings.getInt("playerlimit"));
|
smat.setLobbyMemberLimit(currentLobby, Core.settings.getInt("playerlimit"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void updateWave(){
|
||||||
|
if(currentLobby != null && net.server()){
|
||||||
|
smat.setLobbyData(currentLobby, "mapname", state.map.name());
|
||||||
|
smat.setLobbyData(currentLobby, "wave", state.wave + "");
|
||||||
|
smat.setLobbyData(currentLobby, "gamemode", state.rules.mode().name() + "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeServer(){
|
public void closeServer(){
|
||||||
|
|||||||
Reference in New Issue
Block a user