Steam fixes

This commit is contained in:
Anuken
2019-10-30 16:29:01 -04:00
parent 8616a82efc
commit 06e7b94b60
4 changed files with 12 additions and 17 deletions

View File

@@ -27,7 +27,7 @@ allprojects{
appName = 'Mindustry' appName = 'Mindustry'
gdxVersion = '1.9.10' gdxVersion = '1.9.10'
roboVMVersion = '2.3.8-SNAPSHOT' roboVMVersion = '2.3.8-SNAPSHOT'
steamworksVersion = '1.8.0' steamworksVersion = 'f9ed19bbddd71f07999ca8f0ef354c04938aca41'
arcHash = null arcHash = null
debugged = { debugged = {
@@ -149,8 +149,7 @@ project(":desktop"){
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop" compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
compile "com.code-disaster.steamworks4j:steamworks4j:$steamworksVersion" compile "com.github.Anuken:steamworks4j:$steamworksVersion"
compile "com.code-disaster.steamworks4j:steamworks4j-server:$steamworksVersion"
compile arcModule("backends:backend-sdl") compile arcModule("backends:backend-sdl")
compile 'com.github.MinnDevelopment:java-discord-rpc:v2.0.1' compile 'com.github.MinnDevelopment:java-discord-rpc:v2.0.1'

View File

@@ -136,12 +136,8 @@ public class DesktopLauncher extends ClientLauncher{
}); });
}); });
try{
try{ try{
SteamAPI.loadLibraries(); SteamAPI.loadLibraries();
}catch(Throwable t){
logSteamError(t);
}
if(!SteamAPI.init()){ if(!SteamAPI.init()){
loadError = true; loadError = true;

View File

@@ -64,7 +64,7 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback,
try{ try{
//accept users on request //accept users on request
if(con == null){ if(con == null){
con = new SteamConnection(SteamID.createFromNativeHandle(SteamNativeHandle.getNativeHandle(from))); con = new SteamConnection(SteamID.createFromNativeHandle(from.handle()));
Connect c = new Connect(); Connect c = new Connect();
c.addressTCP = "steam:" + from.getAccountID(); c.addressTCP = "steam:" + from.getAccountID();
@@ -315,7 +315,7 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback,
SteamID lobby = smat.getLobbyByIndex(i); SteamID lobby = smat.getLobbyByIndex(i);
Host out = new Host( Host out = new Host(
smat.getLobbyData(lobby, "name"), smat.getLobbyData(lobby, "name"),
"steam:" + SteamNativeHandle.getNativeHandle(lobby), "steam:" + lobby.handle(),
smat.getLobbyData(lobby, "mapname"), smat.getLobbyData(lobby, "mapname"),
Strings.parseInt(smat.getLobbyData(lobby, "wave"), -1), Strings.parseInt(smat.getLobbyData(lobby, "wave"), -1),
smat.getNumLobbyMembers(lobby), smat.getNumLobbyMembers(lobby),

View File

@@ -128,7 +128,7 @@ public class SWorkshop implements SteamUGCCallback{
}).size(210f, 64f); }).size(210f, 64f);
dialog.show(); dialog.show();
}else{ }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){ }else if(details.getResult() == SteamResult.FileNotFound){
p.removeSteamID(); p.removeSteamID();
@@ -143,12 +143,12 @@ public class SWorkshop implements SteamUGCCallback{
} }
void viewListingID(SteamPublishedFileID id){ 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){ void update(Publishable p, SteamPublishedFileID id, String changelog){
Log.info("Calling update({0}) {1}", p.steamTitle(), SteamNativeHandle.getNativeHandle(id)); Log.info("Calling update({0}) {1}", p.steamTitle(), id.handle());
String sid = SteamNativeHandle.getNativeHandle(id) + ""; String sid = id.handle() + "";
updateItem(id, h -> { updateItem(id, h -> {
if(p.steamDescription() != null){ if(p.steamDescription() != null){
@@ -201,7 +201,7 @@ public class SWorkshop implements SteamUGCCallback{
void updateItem(SteamPublishedFileID publishedFileID, Cons<SteamUGCUpdateHandle> tagger, Runnable updated){ void updateItem(SteamPublishedFileID publishedFileID, Cons<SteamUGCUpdateHandle> tagger, Runnable updated){
try{ try{
SteamUGCUpdateHandle h = ugc.startItemUpdate(SVars.steamID, publishedFileID); 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); tagger.get(h);
Log.info("Tagged."); Log.info("Tagged.");
@@ -290,10 +290,10 @@ public class SWorkshop implements SteamUGCCallback{
@Override @Override
public void onSubmitItemUpdate(SteamPublishedFileID publishedFileID, boolean needsToAcceptWLA, SteamResult result){ public void onSubmitItemUpdate(SteamPublishedFileID publishedFileID, boolean needsToAcceptWLA, SteamResult result){
ui.loadfrag.hide(); 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){ if(result == SteamResult.OK){
//redirect user to page for further updates //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){ if(needsToAcceptWLA){
SVars.net.friends.activateGameOverlayToWebPage("https://steamcommunity.com/sharedfiles/workshoplegalagreement"); SVars.net.friends.activateGameOverlayToWebPage("https://steamcommunity.com/sharedfiles/workshoplegalagreement");
} }