Skip to content

Commit

Permalink
switch ex
Browse files Browse the repository at this point in the history
  • Loading branch information
PinkieSwirl committed Mar 17, 2024
1 parent 60fdea3 commit b98cf13
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ public static boolean restartAppIfNecessary(int appId) throws SteamException {
return nativeRestartAppIfNecessary(appId);
}

public static boolean init() throws SteamException {
return InitResult.byOrdinal(nativeInit()) == InitResult.OK;
public static boolean initEx() throws SteamException {
return init() == InitResult.OK;
}

// public static InitResult initEx() throws SteamException {
//
// if (!isNativeAPILoaded) {
// throw new SteamException("Native libraries not loaded.\nEnsure to call SteamAPI.loadLibraries() first!");
// }
//
// InitResult result = InitResult.byOrdinal(nativeInit());
// isRunning = result == InitResult.OK;
//
// return result;
// }
public static InitResult init() throws SteamException {

if (!isNativeAPILoaded) {
throw new SteamException("Native libraries not loaded.\nEnsure to call SteamAPI.loadLibraries() first!");
}

InitResult result = InitResult.byOrdinal(nativeInit());
isRunning = result == InitResult.OK;

return result;
}

public static void shutdown() {
isRunning = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private boolean runAsClient() throws SteamException {

System.out.println("Initialise Steam client API ...");

SteamAPI.InitResult result = SteamAPI.initEx();
SteamAPI.InitResult result = SteamAPI.init();
if (result != SteamAPI.InitResult.OK) {
System.err.println("SteamAPI.initEx() failed: " + result.name());
SteamAPI.printDebugInfo(System.err);
Expand Down Expand Up @@ -167,7 +167,7 @@ private boolean runAsGameServer(boolean dedicated) throws SteamException {

System.out.println("Initialise Steam client API ...");

if (!SteamAPI.init()) {
if (!SteamAPI.initEx()) {
SteamAPI.printDebugInfo(System.err);
return false;
}
Expand Down

0 comments on commit b98cf13

Please sign in to comment.