Skip to content

Commit

Permalink
129
Browse files Browse the repository at this point in the history
  • Loading branch information
buthed010203 committed Jul 28, 2021
1 parent 7bc5dd8 commit 2495477
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 42 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repositories{
}

ext{
mindustryVersion = 'v128.1'
mindustryVersion = 'v129.1'
}

dependencies{
Expand Down
42 changes: 1 addition & 41 deletions src/SNet.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
import com.codedisaster.steamworks.SteamNetworking.*;
import mindustry.core.*;
import mindustry.game.EventType.*;
import mindustry.game.*;
import mindustry.net.ArcNetProvider.*;
import mindustry.net.*;
import mindustry.net.ArcNetProvider.*;
import mindustry.net.Net.*;
import mindustry.net.Packets.*;

Expand Down Expand Up @@ -295,45 +294,6 @@ public void onLobbyChatUpdate(SteamID lobby, SteamID who, SteamID changer, ChatM
}
}

@Override
public void onLobbyMatchList(int matches){
Log.info("found @ matches", matches);

if(lobbyDoneCallback != null){
Seq<Host> hosts = new Seq<>();
for(int i = 0; i < matches; i++){
try{
SteamID lobby = smat.getLobbyByIndex(i);
String mode = smat.getLobbyData(lobby, "gamemode");
//make sure versions are equal, don't list incompatible lobbies
if(mode == null || mode.isEmpty() || (Version.build != -1 && Strings.parseInt(smat.getLobbyData(lobby, "version"), -1) != Version.build)) continue;
Host out = new Host(
-1, //invalid ping
smat.getLobbyData(lobby, "name"),
"steam:" + lobby.handle(),
smat.getLobbyData(lobby, "mapname"),
Strings.parseInt(smat.getLobbyData(lobby, "wave"), -1),
smat.getNumLobbyMembers(lobby),
Strings.parseInt(smat.getLobbyData(lobby, "version"), -1),
smat.getLobbyData(lobby, "versionType"),
Gamemode.valueOf(mode),
smat.getLobbyMemberLimit(lobby),
"",
null
);
hosts.add(out);
}catch(Exception e){
Log.err(e);
}
}

hosts.sort(Structs.comparingInt(h -> -h.players));
hosts.each(lobbyCallback);

lobbyDoneCallback.run();
}
}

@Override
public void onLobbyCreated(SteamResult result, SteamID steamID){
if(!net.server()){
Expand Down

0 comments on commit 2495477

Please sign in to comment.