Steam stuff
This commit is contained in:
@@ -95,6 +95,7 @@ server.versions = Your version:[accent] {0}[]\nServer version:[accent] {1}[]
|
|||||||
host.info = The [accent]host[] button hosts a server on port [scarlet]6567[]. \nAnybody on the same [lightgray]wifi or local network[] should be able to see your server in their server list.\n\nIf you want people to be able to connect from anywhere by IP, [accent]port forwarding[] is required.\n\n[lightgray]Note: If someone is experiencing trouble connecting to your LAN game, make sure you have allowed Mindustry access to your local network in your firewall settings. Note that public networks sometimes do not allow server discovery.
|
host.info = The [accent]host[] button hosts a server on port [scarlet]6567[]. \nAnybody on the same [lightgray]wifi or local network[] should be able to see your server in their server list.\n\nIf you want people to be able to connect from anywhere by IP, [accent]port forwarding[] is required.\n\n[lightgray]Note: If someone is experiencing trouble connecting to your LAN game, make sure you have allowed Mindustry access to your local network in your firewall settings. Note that public networks sometimes do not allow server discovery.
|
||||||
join.info = Here, you can enter a [accent]server IP[] to connect to, or discover [accent]local network[] servers to connect to.\nBoth LAN and WAN multiplayer is supported.\n\n[lightgray]Note: There is no automatic global server list; if you want to connect to someone by IP, you would need to ask the host for their IP.
|
join.info = Here, you can enter a [accent]server IP[] to connect to, or discover [accent]local network[] servers to connect to.\nBoth LAN and WAN multiplayer is supported.\n\n[lightgray]Note: There is no automatic global server list; if you want to connect to someone by IP, you would need to ask the host for their IP.
|
||||||
hostserver = Host Multiplayer Game
|
hostserver = Host Multiplayer Game
|
||||||
|
invitefriends = Invite Friends
|
||||||
hostserver.mobile = Host\nGame
|
hostserver.mobile = Host\nGame
|
||||||
host = Host
|
host = Host
|
||||||
hosting = [accent]Opening server...
|
hosting = [accent]Opening server...
|
||||||
|
|||||||
@@ -58,12 +58,16 @@ public class PausedDialog extends FloatingDialog{
|
|||||||
cont.row();
|
cont.row();
|
||||||
|
|
||||||
cont.addButton("$hostserver", () -> {
|
cont.addButton("$hostserver", () -> {
|
||||||
if(steam){
|
if(net.active() && steam){
|
||||||
ui.host.runHost();
|
platform.inviteFriends();
|
||||||
}else{
|
}else{
|
||||||
ui.host.show();
|
if(steam){
|
||||||
|
ui.host.runHost();
|
||||||
|
}else{
|
||||||
|
ui.host.show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}).disabled(b -> net.active()).colspan(2).width(dw * 2 + 20f);
|
}).disabled(b -> net.active() && !steam).colspan(2).width(dw * 2 + 20f).update(e -> e.setText(net.active() && steam ? "$invitefriends" : "$hostserver"));
|
||||||
}
|
}
|
||||||
|
|
||||||
cont.row();
|
cont.row();
|
||||||
|
|||||||
@@ -161,8 +161,8 @@ public class MenuFragment extends Fragment{
|
|||||||
new Buttoni("$loadgame", Icon.loadSmall, ui.load::show),
|
new Buttoni("$loadgame", Icon.loadSmall, ui.load::show),
|
||||||
new Buttoni("$tutorial", Icon.infoSmall, control::playTutorial)
|
new Buttoni("$tutorial", Icon.infoSmall, control::playTutorial)
|
||||||
),
|
),
|
||||||
steam ? new Buttoni("$workshop", Icon.saveSmall, platform::openWorkshop) : null,
|
|
||||||
new Buttoni("$editor", Icon.editorSmall, ui.maps::show),
|
new Buttoni("$editor", Icon.editorSmall, ui.maps::show),
|
||||||
|
steam ? new Buttoni("$workshop", Icon.saveSmall, platform::openWorkshop) : null,
|
||||||
new Buttoni("$settings", Icon.toolsSmall, ui.settings::show),
|
new Buttoni("$settings", Icon.toolsSmall, ui.settings::show),
|
||||||
new Buttoni("$about.button", Icon.infoSmall, ui.about::show),
|
new Buttoni("$about.button", Icon.infoSmall, ui.about::show),
|
||||||
new Buttoni("$quit", Icon.exitSmall, Core.app::exit)
|
new Buttoni("$quit", Icon.exitSmall, Core.app::exit)
|
||||||
|
|||||||
@@ -210,14 +210,7 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLobbyInvite(SteamID steamIDUser, SteamID steamIDLobby, long gameID){
|
public void onLobbyInvite(SteamID steamIDUser, SteamID steamIDLobby, long gameID){
|
||||||
Log.info("lobby invite {0} {1} {2}", steamIDLobby.getAccountID(), steamIDUser.getAccountID(), gameID);
|
Log.info("onLobbyInvite {0} {1} {2}", steamIDLobby.getAccountID(), steamIDUser.getAccountID(), gameID);
|
||||||
|
|
||||||
//ignore invites when hosting.
|
|
||||||
if(net.server()) return;
|
|
||||||
|
|
||||||
ui.showConfirm("Someone has invited you to a game.", "But do you accept?", () -> {
|
|
||||||
smat.joinLobby(steamIDLobby);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -393,8 +386,8 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onGameLobbyJoinRequested(SteamID steamID, SteamID steamID1){
|
public void onGameLobbyJoinRequested(SteamID steamID, SteamID steamIDFriend){
|
||||||
|
Log.info("onGameLobbyJoinRequested {0} {1}", steamID, steamIDFriend);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -408,12 +401,12 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onGameRichPresenceJoinRequested(SteamID steamID, String s){
|
public void onGameRichPresenceJoinRequested(SteamID steamID, String connect){
|
||||||
|
Log.info("onGameRichPresenceJoinRequested {0} {1}", steamID, connect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onGameServerChangeRequested(String s, String s1){
|
public void onGameServerChangeRequested(String server, String password){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public class SWorkshop implements SteamUGCCallback{
|
|||||||
ugc.setItemTitle(h, map.name());
|
ugc.setItemTitle(h, map.name());
|
||||||
ugc.setItemDescription(h, map.description());
|
ugc.setItemDescription(h, map.description());
|
||||||
ugc.setItemTags(h, new String[]{"map", mode.name()});
|
ugc.setItemTags(h, new String[]{"map", mode.name()});
|
||||||
ugc.setItemVisibility(h, PublishedFileVisibility.Public);
|
ugc.setItemVisibility(h, PublishedFileVisibility.Private);
|
||||||
ugc.setItemPreview(h, map.previewFile().absolutePath());
|
ugc.setItemPreview(h, map.previewFile().absolutePath());
|
||||||
ugc.setItemContent(h, mapFile.parent().absolutePath());
|
ugc.setItemContent(h, mapFile.parent().absolutePath());
|
||||||
ugc.addItemKeyValueTag(h, "mode", mode.name());
|
ugc.addItemKeyValueTag(h, "mode", mode.name());
|
||||||
@@ -102,6 +102,9 @@ public class SWorkshop implements SteamUGCCallback{
|
|||||||
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/" + SteamNativeHandle.getNativeHandle(publishedFileID));
|
||||||
|
if(needsToAcceptWLA){
|
||||||
|
SVars.net.friends.activateGameOverlayToWebPage("https://steamcommunity.com/sharedfiles/workshoplegalagreement");
|
||||||
|
}
|
||||||
Events.fire(new MapPublishEvent());
|
Events.fire(new MapPublishEvent());
|
||||||
}else{
|
}else{
|
||||||
ui.showErrorMessage(Core.bundle.format("map.publish.error ", result.name()));
|
ui.showErrorMessage(Core.bundle.format("map.publish.error ", result.name()));
|
||||||
|
|||||||
Reference in New Issue
Block a user