diff --git a/build.gradle b/build.gradle index 0e557493be..1bf416d43b 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ allprojects{ appName = 'Mindustry' gdxVersion = '1.9.10' roboVMVersion = '2.3.8-SNAPSHOT' - steamworksVersion = '1.8.0' + steamworksVersion = 'f9ed19bbddd71f07999ca8f0ef354c04938aca41' arcHash = null debugged = { @@ -149,8 +149,7 @@ project(":desktop"){ compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop" - compile "com.code-disaster.steamworks4j:steamworks4j:$steamworksVersion" - compile "com.code-disaster.steamworks4j:steamworks4j-server:$steamworksVersion" + compile "com.github.Anuken:steamworks4j:$steamworksVersion" compile arcModule("backends:backend-sdl") compile 'com.github.MinnDevelopment:java-discord-rpc:v2.0.1' diff --git a/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java b/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java index a88d87bd81..dabd4a43bd 100644 --- a/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java +++ b/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java @@ -137,11 +137,7 @@ public class DesktopLauncher extends ClientLauncher{ }); try{ - try{ - SteamAPI.loadLibraries(); - }catch(Throwable t){ - logSteamError(t); - } + SteamAPI.loadLibraries(); if(!SteamAPI.init()){ loadError = true; diff --git a/desktop/src/io/anuke/mindustry/desktop/steam/SNet.java b/desktop/src/io/anuke/mindustry/desktop/steam/SNet.java index b2b1abc25c..526152a52e 100644 --- a/desktop/src/io/anuke/mindustry/desktop/steam/SNet.java +++ b/desktop/src/io/anuke/mindustry/desktop/steam/SNet.java @@ -64,7 +64,7 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback, try{ //accept users on request if(con == null){ - con = new SteamConnection(SteamID.createFromNativeHandle(SteamNativeHandle.getNativeHandle(from))); + con = new SteamConnection(SteamID.createFromNativeHandle(from.handle())); Connect c = new Connect(); c.addressTCP = "steam:" + from.getAccountID(); @@ -315,7 +315,7 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback, SteamID lobby = smat.getLobbyByIndex(i); Host out = new Host( smat.getLobbyData(lobby, "name"), - "steam:" + SteamNativeHandle.getNativeHandle(lobby), + "steam:" + lobby.handle(), smat.getLobbyData(lobby, "mapname"), Strings.parseInt(smat.getLobbyData(lobby, "wave"), -1), smat.getNumLobbyMembers(lobby), diff --git a/desktop/src/io/anuke/mindustry/desktop/steam/SWorkshop.java b/desktop/src/io/anuke/mindustry/desktop/steam/SWorkshop.java index a91c60f1e2..337a938df5 100644 --- a/desktop/src/io/anuke/mindustry/desktop/steam/SWorkshop.java +++ b/desktop/src/io/anuke/mindustry/desktop/steam/SWorkshop.java @@ -128,7 +128,7 @@ public class SWorkshop implements SteamUGCCallback{ }).size(210f, 64f); dialog.show(); }else{ - SVars.net.friends.activateGameOverlayToWebPage("steam://url/CommunityFilePage/" + SteamNativeHandle.getNativeHandle(details.getPublishedFileID())); + SVars.net.friends.activateGameOverlayToWebPage("steam://url/CommunityFilePage/" + details.getPublishedFileID().handle()); } }else if(details.getResult() == SteamResult.FileNotFound){ p.removeSteamID(); @@ -143,12 +143,12 @@ public class SWorkshop implements SteamUGCCallback{ } void viewListingID(SteamPublishedFileID id){ - SVars.net.friends.activateGameOverlayToWebPage("steam://url/CommunityFilePage/" + SteamNativeHandle.getNativeHandle(id)); + SVars.net.friends.activateGameOverlayToWebPage("steam://url/CommunityFilePage/" + id.handle()); } void update(Publishable p, SteamPublishedFileID id, String changelog){ - Log.info("Calling update({0}) {1}", p.steamTitle(), SteamNativeHandle.getNativeHandle(id)); - String sid = SteamNativeHandle.getNativeHandle(id) + ""; + Log.info("Calling update({0}) {1}", p.steamTitle(), id.handle()); + String sid = id.handle() + ""; updateItem(id, h -> { if(p.steamDescription() != null){ @@ -201,7 +201,7 @@ public class SWorkshop implements SteamUGCCallback{ void updateItem(SteamPublishedFileID publishedFileID, Cons tagger, Runnable updated){ try{ SteamUGCUpdateHandle h = ugc.startItemUpdate(SVars.steamID, publishedFileID); - Log.info("begin updateItem({0})", SteamNativeHandle.getNativeHandle(publishedFileID)); + Log.info("begin updateItem({0})", publishedFileID.handle()); tagger.get(h); Log.info("Tagged."); @@ -290,10 +290,10 @@ public class SWorkshop implements SteamUGCCallback{ @Override public void onSubmitItemUpdate(SteamPublishedFileID publishedFileID, boolean needsToAcceptWLA, SteamResult result){ ui.loadfrag.hide(); - Log.info("onsubmititemupdate {0} {1} {2}", SteamNativeHandle.getNativeHandle(publishedFileID), needsToAcceptWLA, result); + Log.info("onsubmititemupdate {0} {1} {2}", publishedFileID.handle(), needsToAcceptWLA, result); if(result == SteamResult.OK){ //redirect user to page for further updates - SVars.net.friends.activateGameOverlayToWebPage("steam://url/CommunityFilePage/" + SteamNativeHandle.getNativeHandle(publishedFileID)); + SVars.net.friends.activateGameOverlayToWebPage("steam://url/CommunityFilePage/" + publishedFileID.handle()); if(needsToAcceptWLA){ SVars.net.friends.activateGameOverlayToWebPage("https://steamcommunity.com/sharedfiles/workshoplegalagreement"); }