iOS: update wrapper, cleanup and improvement
parent
9733d497ec
commit
da5ce7d07a
|
@ -37,12 +37,18 @@
|
|||
4B35A9F71EEE018D00274961 /* scripting_server.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B35A9F51EEE018D00274961 /* scripting_server.cpp */; };
|
||||
842A808C2339174C00A89418 /* ads.mm in Sources */ = {isa = PBXBuildFile; fileRef = 842A808B2339174C00A89418 /* ads.mm */; };
|
||||
844B495F228606B200EB60EF /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 844B495D228606B200EB60EF /* Main.storyboard */; };
|
||||
844E20202454737E00CD5A35 /* dummy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 844E201F2454737E00CD5A35 /* dummy.swift */; };
|
||||
8465A76522A7D4500095B7CA /* libintl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8465A76422A7D4500095B7CA /* libintl.cpp */; };
|
||||
849C4F86209656D3005EB041 /* ru.lproj in Resources */ = {isa = PBXBuildFile; fileRef = 849C4F85209656D2005EB041 /* ru.lproj */; };
|
||||
84CD4A4D24877FA20019B81D /* VersionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CD4A4C24877FA20019B81D /* VersionManager.m */; };
|
||||
84CD4A64248782720019B81D /* MainWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84CD4A59248782720019B81D /* MainWindow.swift */; };
|
||||
84CD4A65248782720019B81D /* ProgressViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 84CD4A5B248782720019B81D /* ProgressViewController.xib */; };
|
||||
84CD4A66248782720019B81D /* MessageViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 84CD4A5C248782720019B81D /* MessageViewController.xib */; };
|
||||
84CD4A67248782720019B81D /* BasePresentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84CD4A5D248782720019B81D /* BasePresentViewController.swift */; };
|
||||
84CD4A68248782720019B81D /* MessageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84CD4A5E248782720019B81D /* MessageViewController.swift */; };
|
||||
84CD4A69248782720019B81D /* ProgressViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84CD4A5F248782720019B81D /* ProgressViewController.swift */; };
|
||||
84CD4A6C2487A0180019B81D /* ZipManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84CD4A6B2487A0170019B81D /* ZipManager.swift */; };
|
||||
84FE40E224439C2F008E29DB /* libcurl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 84FE40E124439C2F008E29DB /* libcurl.a */; };
|
||||
8E0FFE3234B35EC9603EC82A /* Pods_MultiCraft.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73B0001862274A8FCC7614F0 /* Pods_MultiCraft.framework */; };
|
||||
F856B5C31F55F7EE00FE9494 /* bg.png in Resources */ = {isa = PBXBuildFile; fileRef = F856B5C21F55F7EE00FE9494 /* bg.png */; };
|
||||
F87DC8BA210887C700393B64 /* mapgen_v7p.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F87DC8B9210887C700393B64 /* mapgen_v7p.cpp */; };
|
||||
F8E6C4E91DCA3B7900F64426 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F8E6C4E81DCA3B7900F64426 /* Assets.xcassets */; };
|
||||
F8E6C4EC1DCA3B7900F64426 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F8E6C4EA1DCA3B7900F64426 /* LaunchScreen.storyboard */; };
|
||||
|
@ -285,14 +291,22 @@
|
|||
842A808A2339174B00A89418 /* ads.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ads.h; path = Ads/ads.h; sourceTree = "<group>"; };
|
||||
842A808B2339174C00A89418 /* ads.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ads.mm; path = Ads/ads.mm; sourceTree = "<group>"; };
|
||||
844B495E228606B200EB60EF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
844E201F2454737E00CD5A35 /* dummy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = dummy.swift; sourceTree = "<group>"; };
|
||||
8465A76122A7D4500095B7CA /* MessageCatalog.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = MessageCatalog.hpp; path = ../../../../lib/intl/MessageCatalog.hpp; sourceTree = "<group>"; };
|
||||
8465A76222A7D4500095B7CA /* libintl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = libintl.h; path = ../../../../lib/intl/libintl.h; sourceTree = "<group>"; };
|
||||
8465A76322A7D4500095B7CA /* Util.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Util.hpp; path = ../../../../lib/intl/Util.hpp; sourceTree = "<group>"; };
|
||||
8465A76422A7D4500095B7CA /* libintl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = libintl.cpp; path = ../../../../lib/intl/libintl.cpp; sourceTree = "<group>"; };
|
||||
849C4F85209656D2005EB041 /* ru.lproj */ = {isa = PBXFileReference; lastKnownFileType = folder; path = ru.lproj; sourceTree = "<group>"; };
|
||||
84CD4A4B24877FA20019B81D /* VersionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VersionManager.h; sourceTree = "<group>"; };
|
||||
84CD4A4C24877FA20019B81D /* VersionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VersionManager.m; sourceTree = "<group>"; };
|
||||
84CD4A55248781420019B81D /* Bridge-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Bridge-Header.h"; sourceTree = "<group>"; };
|
||||
84CD4A59248782720019B81D /* MainWindow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainWindow.swift; sourceTree = "<group>"; };
|
||||
84CD4A5B248782720019B81D /* ProgressViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ProgressViewController.xib; sourceTree = "<group>"; };
|
||||
84CD4A5C248782720019B81D /* MessageViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MessageViewController.xib; sourceTree = "<group>"; };
|
||||
84CD4A5D248782720019B81D /* BasePresentViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BasePresentViewController.swift; sourceTree = "<group>"; };
|
||||
84CD4A5E248782720019B81D /* MessageViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MessageViewController.swift; sourceTree = "<group>"; };
|
||||
84CD4A5F248782720019B81D /* ProgressViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProgressViewController.swift; sourceTree = "<group>"; };
|
||||
84CD4A6B2487A0170019B81D /* ZipManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ZipManager.swift; sourceTree = "<group>"; };
|
||||
84FE40E124439C2F008E29DB /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = ../deps/libcurl/lib/libcurl.a; sourceTree = "<group>"; };
|
||||
F856B5C21F55F7EE00FE9494 /* bg.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = bg.png; path = ../../../../textures/base/bg.png; sourceTree = "<group>"; };
|
||||
F87DC8B8210887C600393B64 /* mapgen_v7p.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mapgen_v7p.h; path = ../../../../src/mapgen_v7p.h; sourceTree = "<group>"; };
|
||||
F87DC8B9210887C700393B64 /* mapgen_v7p.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mapgen_v7p.cpp; path = ../../../../src/mapgen_v7p.cpp; sourceTree = "<group>"; };
|
||||
F8E6C4D91DCA3B7900F64426 /* MultiCraft.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MultiCraft.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
|
@ -304,7 +318,6 @@
|
|||
F8E6C4F71DCA3F9900F64426 /* activeobject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = activeobject.h; path = ../../../../src/activeobject.h; sourceTree = "<group>"; };
|
||||
F8E6C4F81DCA3F9900F64426 /* ban.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ban.cpp; path = ../../../../src/ban.cpp; sourceTree = "<group>"; };
|
||||
F8E6C4F91DCA3F9900F64426 /* ban.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ban.h; path = ../../../../src/ban.h; sourceTree = "<group>"; };
|
||||
F8E6C4FA1DCA3F9900F64426 /* basicmacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = basicmacros.h; path = ../../../../src/basicmacros.h; sourceTree = "<group>"; };
|
||||
F8E6C4FB1DCA3F9900F64426 /* camera.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = camera.cpp; path = ../../../../src/camera.cpp; sourceTree = "<group>"; };
|
||||
F8E6C4FC1DCA3F9900F64426 /* camera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = camera.h; path = ../../../../src/camera.h; sourceTree = "<group>"; };
|
||||
F8E6C4FD1DCA3F9900F64426 /* cavegen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cavegen.cpp; path = ../../../../src/cavegen.cpp; sourceTree = "<group>"; };
|
||||
|
@ -438,7 +451,6 @@
|
|||
F8E6C5811DCA3F9900F64426 /* mapblock_mesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mapblock_mesh.h; path = ../../../../src/mapblock_mesh.h; sourceTree = "<group>"; };
|
||||
F8E6C5821DCA3F9900F64426 /* mapblock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mapblock.cpp; path = ../../../../src/mapblock.cpp; sourceTree = "<group>"; };
|
||||
F8E6C5831DCA3F9900F64426 /* mapblock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mapblock.h; path = ../../../../src/mapblock.h; sourceTree = "<group>"; };
|
||||
F8E6C5841DCA3F9900F64426 /* mapchunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mapchunk.h; path = ../../../../src/mapchunk.h; sourceTree = "<group>"; };
|
||||
F8E6C5851DCA3F9900F64426 /* mapgen_flat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mapgen_flat.cpp; path = ../../../../src/mapgen_flat.cpp; sourceTree = "<group>"; };
|
||||
F8E6C5861DCA3F9900F64426 /* mapgen_flat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mapgen_flat.h; path = ../../../../src/mapgen_flat.h; sourceTree = "<group>"; };
|
||||
F8E6C58D1DCA3F9900F64426 /* mapgen_v6.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mapgen_v6.cpp; path = ../../../../src/mapgen_v6.cpp; sourceTree = "<group>"; };
|
||||
|
@ -730,6 +742,27 @@
|
|||
name = intl;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
84CD4A56248782720019B81D /* Main */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
84CD4A59248782720019B81D /* MainWindow.swift */,
|
||||
84CD4A6B2487A0170019B81D /* ZipManager.swift */,
|
||||
);
|
||||
path = Main;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
84CD4A5A248782720019B81D /* UI */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
84CD4A5B248782720019B81D /* ProgressViewController.xib */,
|
||||
84CD4A5C248782720019B81D /* MessageViewController.xib */,
|
||||
84CD4A5D248782720019B81D /* BasePresentViewController.swift */,
|
||||
84CD4A5E248782720019B81D /* MessageViewController.swift */,
|
||||
84CD4A5F248782720019B81D /* ProgressViewController.swift */,
|
||||
);
|
||||
path = UI;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
87D06CD2CC310BE5E73639F4 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
@ -775,15 +808,18 @@
|
|||
F8E6C4DC1DCA3B7900F64426 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
84CD4A56248782720019B81D /* Main */,
|
||||
84CD4A5A248782720019B81D /* UI */,
|
||||
84CD4A55248781420019B81D /* Bridge-Header.h */,
|
||||
F8E6C4F31DCA3EA400F64426 /* ioswrap.h */,
|
||||
F8E6C4F41DCA3EA400F64426 /* ioswrap.m */,
|
||||
84CD4A4B24877FA20019B81D /* VersionManager.h */,
|
||||
84CD4A4C24877FA20019B81D /* VersionManager.m */,
|
||||
840E2F9E233410F90088E7F7 /* SDVersion.h */,
|
||||
842A808A2339174B00A89418 /* ads.h */,
|
||||
842A808B2339174C00A89418 /* ads.mm */,
|
||||
F8E6C7E01DCA4EB300F64426 /* assets.zip */,
|
||||
F8E6C7E21DCA511700F64426 /* worlds.zip */,
|
||||
F856B5C21F55F7EE00FE9494 /* bg.png */,
|
||||
844E201F2454737E00CD5A35 /* dummy.swift */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
|
@ -794,7 +830,6 @@
|
|||
F8E6C4F71DCA3F9900F64426 /* activeobject.h */,
|
||||
F8E6C4F81DCA3F9900F64426 /* ban.cpp */,
|
||||
F8E6C4F91DCA3F9900F64426 /* ban.h */,
|
||||
F8E6C4FA1DCA3F9900F64426 /* basicmacros.h */,
|
||||
F8E6C4FB1DCA3F9900F64426 /* camera.cpp */,
|
||||
F8E6C4FC1DCA3F9900F64426 /* camera.h */,
|
||||
F8E6C4FD1DCA3F9900F64426 /* cavegen.cpp */,
|
||||
|
@ -942,7 +977,6 @@
|
|||
F8E6C5811DCA3F9900F64426 /* mapblock_mesh.h */,
|
||||
F8E6C5821DCA3F9900F64426 /* mapblock.cpp */,
|
||||
F8E6C5831DCA3F9900F64426 /* mapblock.h */,
|
||||
F8E6C5841DCA3F9900F64426 /* mapchunk.h */,
|
||||
F8E6C5851DCA3F9900F64426 /* mapgen_flat.cpp */,
|
||||
F8E6C5861DCA3F9900F64426 /* mapgen_flat.h */,
|
||||
F8E6C58D1DCA3F9900F64426 /* mapgen_v6.cpp */,
|
||||
|
@ -1334,6 +1368,7 @@
|
|||
F8E6C4D71DCA3B7900F64426 /* Resources */,
|
||||
E156912616D2E9233FC1C9F4 /* [CP] Copy Pods Resources */,
|
||||
7055146ABE25F98BDC1A6400 /* [CP] Embed Pods Frameworks */,
|
||||
4EB364AA68EABAF7EBC092CB /* Upload Bugsnag dSYM */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
|
@ -1391,15 +1426,35 @@
|
|||
849C4F86209656D3005EB041 /* ru.lproj in Resources */,
|
||||
F8E6C4EC1DCA3B7900F64426 /* LaunchScreen.storyboard in Resources */,
|
||||
844B495F228606B200EB60EF /* Main.storyboard in Resources */,
|
||||
F856B5C31F55F7EE00FE9494 /* bg.png in Resources */,
|
||||
F8E6C7E11DCA4EB300F64426 /* assets.zip in Resources */,
|
||||
F8E6C7E31DCA511700F64426 /* worlds.zip in Resources */,
|
||||
84CD4A65248782720019B81D /* ProgressViewController.xib in Resources */,
|
||||
84CD4A66248782720019B81D /* MessageViewController.xib in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
4EB364AA68EABAF7EBC092CB /* Upload Bugsnag dSYM */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Upload Bugsnag dSYM";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = "/usr/bin/env ruby";
|
||||
shellScript = "# First, attempt to get the API key from an environment variable\napi_key = ENV[\"BUGSNAG_API_KEY\"]\n\n# If not present, attempt to lookup the value from the Info.plist\nif !api_key\n default_info_plist_location = Dir.glob(\"./{ios/,}*/Info.plist\").reject {|path| path =~ /build|test/i }\n plist_buddy_response = `/usr/libexec/PlistBuddy -c \"print :BugsnagAPIKey\" \"#{default_info_plist_location.first}\"`\n api_key = plist_buddy_response if $?.success?\nend\n\nfork do\n Process.setsid\n STDIN.reopen(\"/dev/null\")\n STDOUT.reopen(\"/dev/null\", \"a\")\n STDERR.reopen(\"/dev/null\", \"a\")\n\n require 'shellwords'\n\n Dir[\"#{ENV[\"DWARF_DSYM_FOLDER_PATH\"]}/*/Contents/Resources/DWARF/*\"].each do |dsym|\n curl_command = \"curl -F dsym=@#{Shellwords.escape(dsym)} -F projectRoot=#{Shellwords.escape(ENV[\"PROJECT_DIR\"])} \"\n curl_command += \"-F apiKey=#{Shellwords.escape(api_key)} \" if api_key\n curl_command += \"https://upload.bugsnag.com/\"\n system(curl_command)\n end\nend\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
7055146ABE25F98BDC1A6400 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
|
@ -1506,9 +1561,12 @@
|
|||
F8E6C6581DCA3F9900F64426 /* sound_openal.cpp in Sources */,
|
||||
F8E6C6401DCA3F9900F64426 /* nameidmapping.cpp in Sources */,
|
||||
F8E6C6571DCA3F9900F64426 /* socket.cpp in Sources */,
|
||||
84CD4A64248782720019B81D /* MainWindow.swift in Sources */,
|
||||
84CD4A67248782720019B81D /* BasePresentViewController.swift in Sources */,
|
||||
4B35A9B01EEDD15500274961 /* clientenvironment.cpp in Sources */,
|
||||
F8E6C7C21DCA428800F64426 /* timetaker.cpp in Sources */,
|
||||
F8E6C6211DCA3F9900F64426 /* hud.cpp in Sources */,
|
||||
84CD4A4D24877FA20019B81D /* VersionManager.m in Sources */,
|
||||
F8E6C6DF1DCA413A00F64426 /* clientpackethandler.cpp in Sources */,
|
||||
F8E6C6261DCA3F9900F64426 /* itemdef.cpp in Sources */,
|
||||
F8E6C61B1DCA3F9900F64426 /* guiKeyChangeMenu.cpp in Sources */,
|
||||
|
@ -1610,6 +1668,7 @@
|
|||
F8E6C7501DCA420A00F64426 /* l_nodetimer.cpp in Sources */,
|
||||
F87DC8BA210887C700393B64 /* mapgen_v7p.cpp in Sources */,
|
||||
F8E6C6141DCA3F9900F64426 /* game.cpp in Sources */,
|
||||
84CD4A6C2487A0180019B81D /* ZipManager.swift in Sources */,
|
||||
F8E6C6051DCA3F9900F64426 /* craftdef.cpp in Sources */,
|
||||
4B0F49CF1E424FDF0003953D /* enriched_string.cpp in Sources */,
|
||||
4B0F49D31E42501D0003953D /* static_text.cpp in Sources */,
|
||||
|
@ -1624,6 +1683,7 @@
|
|||
F8E6C6041DCA3F9900F64426 /* convert_json.cpp in Sources */,
|
||||
4B35A9F41EEE017000274961 /* scripting_client.cpp in Sources */,
|
||||
F8E6C6ED1DCA41A600F64426 /* scripting_mainmenu.cpp in Sources */,
|
||||
84CD4A68248782720019B81D /* MessageViewController.swift in Sources */,
|
||||
F8E6C65F1DCA3F9900F64426 /* treegen.cpp in Sources */,
|
||||
F8E6C5F61DCA3F9900F64426 /* chat.cpp in Sources */,
|
||||
F8E6C60B1DCA3F9900F64426 /* debug.cpp in Sources */,
|
||||
|
@ -1654,8 +1714,8 @@
|
|||
F8E6C6591DCA3F9900F64426 /* sound.cpp in Sources */,
|
||||
F8E6C60D1DCA3F9900F64426 /* drawscene.cpp in Sources */,
|
||||
F8E6C71D1DCA41EF00F64426 /* s_security.cpp in Sources */,
|
||||
84CD4A69248782720019B81D /* ProgressViewController.swift in Sources */,
|
||||
F8E6C7641DCA423C00F64426 /* event.cpp in Sources */,
|
||||
844E20202454737E00CD5A35 /* dummy.swift in Sources */,
|
||||
4B35A9E51EEE00F900274961 /* l_localplayer.cpp in Sources */,
|
||||
F8E6C6501DCA3F9900F64426 /* serialization.cpp in Sources */,
|
||||
F8E6C6281DCA3F9900F64426 /* light.cpp in Sources */,
|
||||
|
@ -1694,6 +1754,7 @@
|
|||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
COMPRESS_PNG_FILES = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
|
@ -1720,6 +1781,7 @@
|
|||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
COMPRESS_PNG_FILES = NO;
|
||||
ENABLE_BITCODE = NO;
|
||||
|
@ -1797,8 +1859,10 @@
|
|||
"-L${SRCROOT}/../deps/libcurl/lib",
|
||||
"-Wl,-dead_strip",
|
||||
);
|
||||
OTHER_SWIFT_FLAGS = "$(inherited) -DDEBUG";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = mobi.MultiCraft;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "MultiCraft/Bridge-Header.h";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
|
@ -1863,6 +1927,7 @@
|
|||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = mobi.MultiCraft;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "MultiCraft/Bridge-Header.h";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
26
build/iOS/MultiCraft/MultiCraft/Assets.xcassets/icon_bg.imageset/Contents.json
vendored
Normal file
26
build/iOS/MultiCraft/MultiCraft/Assets.xcassets/icon_bg.imageset/Contents.json
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "bg.png",
|
||||
"idiom" : "universal",
|
||||
"resizing" : {
|
||||
"cap-insets" : {
|
||||
"bottom" : 0,
|
||||
"left" : 0,
|
||||
"right" : 0,
|
||||
"top" : 0
|
||||
},
|
||||
"center" : {
|
||||
"height" : 64,
|
||||
"mode" : "tile",
|
||||
"width" : 64
|
||||
},
|
||||
"mode" : "9-part"
|
||||
}
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 8.3 KiB |
|
@ -1,7 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
|
@ -14,9 +15,20 @@
|
|||
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="1366" height="1024"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_bg" translatesAutoresizingMaskIntoConstraints="NO" id="fTI-Ku-Y1H">
|
||||
<rect key="frame" x="0.0" y="0.0" width="1366" height="1024"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="fTI-Ku-Y1H" secondAttribute="bottom" id="3ns-jA-B7s"/>
|
||||
<constraint firstAttribute="trailing" secondItem="fTI-Ku-Y1H" secondAttribute="trailing" id="4PF-Ah-Qfx"/>
|
||||
<constraint firstItem="fTI-Ku-Y1H" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="fpu-XR-JMN"/>
|
||||
<constraint firstItem="fTI-Ku-Y1H" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="jgz-hu-RZn"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
|
@ -24,4 +36,7 @@
|
|||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="icon_bg" width="64" height="64"/>
|
||||
</resources>
|
||||
</document>
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
#import "VersionManager.h"
|
||||
#import "ioswrap.h"
|
|
@ -0,0 +1,17 @@
|
|||
import UIKit
|
||||
|
||||
final class MainWindow: UIWindow {
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
init() {
|
||||
super.init(frame: UIScreen.main.bounds)
|
||||
}
|
||||
|
||||
@objc func run() {
|
||||
backgroundColor = UIColor(patternImage: UIImage(named: "icon_bg")!)
|
||||
rootViewController = UIViewController()
|
||||
makeKeyAndVisible()
|
||||
}
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
import Foundation
|
||||
import SSZipArchive
|
||||
|
||||
private enum Constants {
|
||||
static let percentProgressIndex: Int = 0
|
||||
}
|
||||
|
||||
private struct Asset {
|
||||
let name: String
|
||||
let path: UnzipPath
|
||||
let versioned: Bool
|
||||
|
||||
var destinationPath: String {
|
||||
switch path {
|
||||
case .documents:
|
||||
return NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]
|
||||
|
||||
case .library:
|
||||
let path = NSSearchPathForDirectoriesInDomains(.libraryDirectory, .userDomainMask, true)[0]
|
||||
return (path as NSString).appendingPathComponent("Application Support")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private enum UnzipPath: Int {
|
||||
case documents
|
||||
case library
|
||||
}
|
||||
|
||||
final class ZipManager: NSObject {
|
||||
private var assets: [Asset] = [.init(name: "assets", path: .library, versioned: true),
|
||||
.init(name: "worlds", path: .documents, versioned: false)]
|
||||
|
||||
@objc func runProcess(_ progress: @escaping (_ percent: Int) -> Void) {
|
||||
let versionRuntime = VersionManager.parseVersion()
|
||||
|
||||
for (index, asset) in assets.enumerated() {
|
||||
let zippath = Bundle.main.path(forResource: asset.name, ofType: "zip") ?? ""
|
||||
let versionDisk = VersionManager.readVersion(withPath: asset.destinationPath)
|
||||
|
||||
if !asset.versioned && versionDisk != 0 { // worlds
|
||||
continue
|
||||
}
|
||||
|
||||
#if !DEBUG
|
||||
if versionDisk == versionRuntime {
|
||||
continue
|
||||
}
|
||||
#endif
|
||||
|
||||
unzipFile(at: zippath, to: asset.destinationPath, vRuntime: versionRuntime) { (percent) in
|
||||
if index == Constants.percentProgressIndex {
|
||||
progress(percent)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private extension ZipManager {
|
||||
func unzipFile(at path: String, to destination: String, vRuntime: UInt32, _ block: @escaping (_ percent: Int) -> Void) {
|
||||
let fileManager = FileManager.default
|
||||
let files = (try? fileManager.contentsOfDirectory(atPath: destination)) ?? []
|
||||
|
||||
for file in files {
|
||||
do {
|
||||
try fileManager.removeItem(atPath: (destination as NSString).appendingPathComponent(file))
|
||||
} catch {
|
||||
print(error)
|
||||
}
|
||||
}
|
||||
|
||||
SSZipArchive.unzipFile(atPath: path, toDestination: destination, overwrite: true, password: ZIPPWD, progressHandler: { (file, zipInfo, progress, total) in
|
||||
block(progress * 100 / total)
|
||||
|
||||
}) { (path, success, error) in
|
||||
block(100)
|
||||
}
|
||||
|
||||
VersionManager.writeVersion(withPath: destination, ver: vRuntime)
|
||||
}
|
||||
}
|
|
@ -154,7 +154,7 @@ typedef NS_ENUM(NSInteger, DeviceVersion){
|
|||
@"iPad5,2" : @(iPadMini4),
|
||||
@"iPad11,1" : @(iPadMini5),
|
||||
@"iPad11,2" : @(iPadMini5),
|
||||
|
||||
|
||||
@"iPad6,3" : @(iPadPro9Dot7Inch),
|
||||
@"iPad6,4" : @(iPadPro9Dot7Inch),
|
||||
@"iPad7,3" : @(iPadPro10Dot5Inch),
|
||||
|
@ -189,7 +189,7 @@ typedef NS_ENUM(NSInteger, DeviceVersion){
|
|||
struct utsname systemInfo;
|
||||
uname(&systemInfo);
|
||||
NSString *code = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
|
||||
DeviceVersion version = (DeviceVersion)[[self.deviceNamesByCode objectForKey:code] integerValue];
|
||||
DeviceVersion version = (DeviceVersion)[self.deviceNamesByCode[code] integerValue];
|
||||
return version;
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
import UIKit
|
||||
|
||||
class BasePresentViewController: UIViewController {
|
||||
@objc func present(in viewController: UIViewController) {
|
||||
viewController.addChild(self)
|
||||
didMove(toParent: viewController)
|
||||
view.frame = viewController.view.bounds
|
||||
viewController.view.addSubview(view)
|
||||
}
|
||||
|
||||
@objc func dismissView() {
|
||||
willMove(toParent: nil)
|
||||
view.removeFromSuperview()
|
||||
removeFromParent()
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
import UIKit
|
||||
import UITextView_Placeholder
|
||||
|
||||
final class MessageViewController: BasePresentViewController {
|
||||
@objc var didSendMessage: ((String) -> Void)?
|
||||
|
||||
@IBOutlet private weak var textView: UITextView!
|
||||
|
||||
@objc var message: String = ""
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
textView.text = message
|
||||
textView.placeholder = NSLocalizedString("Text Input", comment: "")
|
||||
textView.font = UIFont.systemFont(ofSize: 16)
|
||||
textView.becomeFirstResponder()
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(_:)), name: UIResponder.keyboardWillShowNotification, object: nil)
|
||||
}
|
||||
|
||||
@IBAction private func sendTapped(_ sender: Any) {
|
||||
if textView.text.isEmpty == false {
|
||||
didSendMessage?(textView.text)
|
||||
}
|
||||
|
||||
dismissView()
|
||||
}
|
||||
}
|
||||
|
||||
private extension MessageViewController {
|
||||
@objc func keyboardWillShow(_ notification: Notification) {
|
||||
if let keyboardSize = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue {
|
||||
textView.constraints.first(where: { $0.firstAttribute == .height })?.constant = view.frame.size.height - keyboardSize.height
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_1" orientation="landscape" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MessageViewController" customModule="MultiCraft" customModuleProvider="target">
|
||||
<connections>
|
||||
<outlet property="textView" destination="Qs8-4Q-9sM" id="bBm-yT-kmT"/>
|
||||
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="896" height="414"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="Qs8-4Q-9sM">
|
||||
<rect key="frame" x="44" y="0.0" width="758" height="100"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="100" id="WaU-xO-O6K"/>
|
||||
</constraints>
|
||||
<color key="textColor" systemColor="labelColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
|
||||
</textView>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="CuG-Jd-IMd">
|
||||
<rect key="frame" x="802" y="30" width="50" height="40"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="50" id="JUK-h7-HaL"/>
|
||||
<constraint firstAttribute="height" constant="40" id="yZa-L7-Y2j"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
|
||||
<state key="normal" title="OK"/>
|
||||
<connections>
|
||||
<action selector="sendTapped:" destination="-1" eventType="touchUpInside" id="fca-Q3-eq1"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="CuG-Jd-IMd" secondAttribute="trailing" id="Fum-bD-ZLH"/>
|
||||
<constraint firstItem="CuG-Jd-IMd" firstAttribute="leading" secondItem="Qs8-4Q-9sM" secondAttribute="trailing" id="TNa-EV-8S1"/>
|
||||
<constraint firstItem="CuG-Jd-IMd" firstAttribute="centerY" secondItem="Qs8-4Q-9sM" secondAttribute="centerY" id="Wxd-Lw-JPF"/>
|
||||
<constraint firstItem="Qs8-4Q-9sM" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="ZAp-9h-SBA"/>
|
||||
<constraint firstItem="Qs8-4Q-9sM" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="hwf-QH-sZX"/>
|
||||
</constraints>
|
||||
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
|
||||
<point key="canvasLocation" x="139" y="153"/>
|
||||
</view>
|
||||
</objects>
|
||||
</document>
|
|
@ -0,0 +1,45 @@
|
|||
import UIKit
|
||||
|
||||
extension UIColor {
|
||||
convenience init(red: Int, green: Int, blue: Int) {
|
||||
self.init(red: CGFloat(red) / 255.0, green: CGFloat(green) / 255.0, blue: CGFloat(blue) / 255.0, alpha: 1.0)
|
||||
}
|
||||
|
||||
convenience init(_ red: Int, _ green: Int, _ blue: Int) {
|
||||
self.init(red: red, green: green, blue: blue)
|
||||
}
|
||||
|
||||
convenience init(netHex: Int) {
|
||||
self.init(red: (netHex >> 16) & 0xff, green: (netHex >> 8) & 0xff, blue: netHex & 0xff)
|
||||
}
|
||||
}
|
||||
|
||||
final class ProgressViewController: BasePresentViewController {
|
||||
@IBOutlet private weak var progressSize: NSLayoutConstraint!
|
||||
@IBOutlet private weak var labelProgress: UILabel!
|
||||
@IBOutlet private weak var viewProgress: UIView!
|
||||
@IBOutlet private weak var viewProgressIndicator: UIView!
|
||||
|
||||
override func viewDidLayoutSubviews() {
|
||||
let height = view.frame.size.width * 0.55 / 8
|
||||
viewProgress.constraints.first(where: {$0.firstAttribute == .height})?.constant = height
|
||||
viewProgress.layer.cornerRadius = height / 2
|
||||
viewProgress.layer.borderWidth = 3
|
||||
viewProgress.layer.borderColor = UIColor.black.cgColor
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
}
|
||||
|
||||
@objc func updateProgress(_ progress: Int) {
|
||||
if viewProgress.isHidden {
|
||||
viewProgress.isHidden = false
|
||||
}
|
||||
labelProgress.text = "\(NSLocalizedString("Loading...", comment: "")) \(progress)%"
|
||||
progressSize.constant = CGFloat(progress) * viewProgress.frame.size.width / 100
|
||||
|
||||
let color = UIColor(255 - progress * 2, progress * 2, 25)
|
||||
viewProgressIndicator.backgroundColor = color
|
||||
}
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_1" orientation="landscape" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ProgressViewController" customModule="MultiCraft" customModuleProvider="target">
|
||||
<connections>
|
||||
<outlet property="labelProgress" destination="usA-fz-fuD" id="P3m-fi-ZYX"/>
|
||||
<outlet property="progressSize" destination="cy6-8m-alO" id="SkG-0g-IcD"/>
|
||||
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
|
||||
<outlet property="viewProgress" destination="n5b-J8-Ygo" id="QhU-eo-v7I"/>
|
||||
<outlet property="viewProgressIndicator" destination="h4C-c1-Qn2" id="ptz-Ig-4rf"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="896" height="414"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view hidden="YES" clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="n5b-J8-Ygo">
|
||||
<rect key="frame" x="201.5" y="183" width="493" height="48"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="h4C-c1-Qn2">
|
||||
<rect key="frame" x="0.0" y="0.0" width="500" height="48"/>
|
||||
<color key="backgroundColor" red="0.21568627450980393" green="0.78431372549019607" blue="0.098039215686274508" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="500" id="cy6-8m-alO"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Loading..." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="usA-fz-fuD">
|
||||
<rect key="frame" x="0.0" y="0.0" width="493" height="48"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.45098039215686275" green="0.45098039215686275" blue="0.45098039215686275" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="usA-fz-fuD" secondAttribute="bottom" id="5jE-PZ-5uu"/>
|
||||
<constraint firstItem="usA-fz-fuD" firstAttribute="leading" secondItem="n5b-J8-Ygo" secondAttribute="leading" id="9V6-7I-T71"/>
|
||||
<constraint firstAttribute="height" constant="48" id="AMQ-N1-e1n"/>
|
||||
<constraint firstItem="h4C-c1-Qn2" firstAttribute="top" secondItem="n5b-J8-Ygo" secondAttribute="top" id="MNE-0K-ssb"/>
|
||||
<constraint firstItem="h4C-c1-Qn2" firstAttribute="leading" secondItem="n5b-J8-Ygo" secondAttribute="leading" id="Vjl-JK-PV8"/>
|
||||
<constraint firstAttribute="trailing" secondItem="usA-fz-fuD" secondAttribute="trailing" id="atA-9i-WwJ"/>
|
||||
<constraint firstAttribute="bottom" secondItem="h4C-c1-Qn2" secondAttribute="bottom" id="bS2-Qd-mYO"/>
|
||||
<constraint firstItem="usA-fz-fuD" firstAttribute="top" secondItem="n5b-J8-Ygo" secondAttribute="top" id="he0-0M-fW4"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="n5b-J8-Ygo" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="9hb-81-0QM"/>
|
||||
<constraint firstItem="n5b-J8-Ygo" firstAttribute="centerY" secondItem="i5M-Pr-FkT" secondAttribute="centerY" id="iao-NL-WJi"/>
|
||||
<constraint firstItem="n5b-J8-Ygo" firstAttribute="width" secondItem="i5M-Pr-FkT" secondAttribute="width" multiplier="0.55" id="iqM-nv-o8W"/>
|
||||
</constraints>
|
||||
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
|
||||
<point key="canvasLocation" x="139" y="153"/>
|
||||
</view>
|
||||
</objects>
|
||||
</document>
|
|
@ -0,0 +1,9 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface VersionManager : NSObject
|
||||
|
||||
+ (uint32_t) readVersionWithPath:(NSString *) path;
|
||||
+ (uint32_t) parseVersion;
|
||||
+ (void) writeVersionWithPath:(NSString *) path ver: (uint32_t) ver;
|
||||
|
||||
@end
|
|
@ -0,0 +1,34 @@
|
|||
#import "VersionManager.h"
|
||||
|
||||
@implementation VersionManager
|
||||
|
||||
+ (uint32_t) readVersionWithPath:(NSString *) path
|
||||
{
|
||||
NSString *filename = [path stringByAppendingPathComponent:@"_version"];
|
||||
NSError *error;
|
||||
NSString *content = [NSString stringWithContentsOfFile:filename encoding:NSASCIIStringEncoding error:&error];
|
||||
if (error)
|
||||
return 0;
|
||||
return [content intValue];
|
||||
}
|
||||
|
||||
+ (uint32_t) parseVersion
|
||||
{
|
||||
NSString *revstr = [[NSBundle mainBundle] infoDictionary][@"CFBundleVersion"];
|
||||
uint8_t revision = [revstr intValue];
|
||||
|
||||
// compatibility with old versions, DON'T CHANGE
|
||||
uint32_t ret = revision | (2 << 24);
|
||||
|
||||
NSLog(@"App revision %@ -> %u", revstr, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
+ (void) writeVersionWithPath:(NSString *) path ver: (uint32_t) ver
|
||||
{
|
||||
NSString *filename = [path stringByAppendingPathComponent:@"_version"];
|
||||
NSString *content = [NSString stringWithFormat:@"%d", ver];
|
||||
[content writeToFile:filename atomically:NO encoding:NSASCIIStringEncoding error:nil];
|
||||
}
|
||||
|
||||
@end
|
|
@ -1 +0,0 @@
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
#include "ads.h"
|
||||
#else
|
||||
#define ZIPPWD @"1" // zip password
|
||||
#define CrashliticsApiKey @"1" // crashlitics key
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -18,12 +19,18 @@ enum {
|
|||
};
|
||||
|
||||
void ioswrap_log(const char *message);
|
||||
|
||||
void ioswrap_paths(int type, char *dest, size_t destlen);
|
||||
|
||||
void ioswrap_assets(void); // extracts assets.zip to PATH_LIBRARY_SUPPORT
|
||||
void ioswrap_asset_refresh(void);
|
||||
|
||||
void ioswrap_size(unsigned int *dest);
|
||||
|
||||
void ioswrap_show_dialog(void *uiviewcontroller, const char *accept, const char *hint, const char *current, int type);
|
||||
int ioswrap_get_dialog(const char **text);
|
||||
int ioswrap_get_dialog(const char **text);
|
||||
|
||||
void init_IOS_Settings();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -1,67 +1,20 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <SSZipArchive/SSZipArchive.h>
|
||||
#import <MultiCraft-Swift.h>
|
||||
#import "VersionManager.h"
|
||||
#import <Bugsnag/Bugsnag.h>
|
||||
#include "ioswrap.h"
|
||||
|
||||
// returns the app version as an integer
|
||||
static uint32_t parse_version()
|
||||
{
|
||||
NSString *revstr = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
|
||||
uint8_t revision = [revstr intValue];
|
||||
|
||||
// compatibility with old versions, DON'T CHANGE
|
||||
uint32_t ret = revision | (2 << 24);
|
||||
|
||||
NSLog(@"App revision %@ -> %u", revstr, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static uint32_t read_version(NSString *path)
|
||||
{
|
||||
NSString *filename = [path stringByAppendingPathComponent:@"_version"];
|
||||
NSError *error;
|
||||
NSString *content = [NSString stringWithContentsOfFile:filename encoding:NSASCIIStringEncoding error:&error];
|
||||
if (error)
|
||||
return 0;
|
||||
return [content intValue];
|
||||
}
|
||||
|
||||
static inline void write_version(NSString *path, uint32_t ver)
|
||||
{
|
||||
NSString *filename = [path stringByAppendingPathComponent:@"_version"];
|
||||
NSString *content = [NSString stringWithFormat:@"%d", ver];
|
||||
[content writeToFile:filename atomically:NO encoding:NSASCIIStringEncoding error:nil];
|
||||
}
|
||||
|
||||
static void recursive_delete(NSString *path)
|
||||
{
|
||||
NSFileManager *fm = [NSFileManager defaultManager];
|
||||
for (NSString* file in [fm contentsOfDirectoryAtPath:path error:nil])
|
||||
[fm removeItemAtPath:[path stringByAppendingPathComponent:file] error:nil];
|
||||
}
|
||||
|
||||
static void loading_alert(UIViewController *viewc, NSString *text)
|
||||
{
|
||||
if (text == nil) {
|
||||
[viewc dismissViewControllerAnimated:NO completion:nil];
|
||||
return;
|
||||
}
|
||||
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:text preferredStyle:UIAlertControllerStyleAlert];
|
||||
UIActivityIndicatorView *loading = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
|
||||
[loading startAnimating];
|
||||
loading.frame = CGRectMake(10, 5, 50, 50);
|
||||
|
||||
[alert.view addSubview:loading];
|
||||
[viewc presentViewController:alert animated:NO completion:nil];
|
||||
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, YES);
|
||||
}
|
||||
|
||||
/**************/
|
||||
|
||||
void ioswrap_log(const char *message)
|
||||
{
|
||||
#if !NDEBUG
|
||||
NSLog(@"%s", message);
|
||||
#endif
|
||||
}
|
||||
|
||||
void init_IOS_Settings()
|
||||
{
|
||||
[Bugsnag startBugsnagWithApiKey:CrashliticsApiKey];
|
||||
}
|
||||
|
||||
void ioswrap_paths(int type, char *dest, size_t destlen)
|
||||
|
@ -86,54 +39,33 @@ void ioswrap_paths(int type, char *dest, size_t destlen)
|
|||
snprintf(dest, destlen, "%s/Caches", path_c);
|
||||
}
|
||||
|
||||
|
||||
static void recursive_delete(NSString *path)
|
||||
{
|
||||
NSFileManager *fm = [NSFileManager defaultManager];
|
||||
for (NSString *file in [fm contentsOfDirectoryAtPath:path error:nil])
|
||||
[fm removeItemAtPath:[path stringByAppendingPathComponent:file] error:nil];
|
||||
}
|
||||
|
||||
|
||||
void ioswrap_assets()
|
||||
{
|
||||
// versioned: update and DELETE previous files with each App update
|
||||
const struct { const char *name; int path; BOOL versioned; } assets[] = {
|
||||
{ .name = "assets", .path = PATH_LIBRARY_SUPPORT, .versioned = YES },
|
||||
{ .name = "worlds", .path = PATH_DOCUMENTS, .versioned = NO },
|
||||
{ NULL, 0 },
|
||||
};
|
||||
char buf[256];
|
||||
uint32_t v_runtime = parse_version();
|
||||
// create our own UIWindow so we can indicate progress
|
||||
UIWindow *win = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||
UIViewController *viewc = [[UIViewController alloc] init];
|
||||
win.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bg.png"]];
|
||||
win.rootViewController = viewc;
|
||||
[win makeKeyAndVisible];
|
||||
MainWindow *window = [[MainWindow alloc] init];
|
||||
[window run];
|
||||
|
||||
loading_alert(viewc, NSLocalizedString(@"Loading...", @""));
|
||||
for (int i = 0; assets[i].name != NULL; i++) {
|
||||
ioswrap_paths(assets[i].path, buf, sizeof(buf));
|
||||
NSString *destpath = [NSString stringWithUTF8String:buf];
|
||||
NSString *zippath = [[NSBundle mainBundle] pathForResource:[NSString stringWithUTF8String:assets[i].name] ofType:@"zip"];
|
||||
NSString *password = ZIPPWD;
|
||||
ProgressViewController *progressVC = [[ProgressViewController alloc] initWithNibName:@"ProgressViewController" bundle:nil];
|
||||
[progressVC presentIn:window.rootViewController];
|
||||
|
||||
#ifdef DEBUG
|
||||
// always replace assets in debug mode
|
||||
recursive_delete(destpath);
|
||||
goto extract;
|
||||
#else
|
||||
if (!assets[i].versioned)
|
||||
goto extract;
|
||||
#endif
|
||||
uint32_t v_disk = read_version(destpath);
|
||||
if (v_runtime == v_disk) {
|
||||
NSLog(@"%s: skipping update (%d)", assets[i].name, v_disk);
|
||||
continue;
|
||||
}
|
||||
NSLog(@"%s: updating from %d to %d", assets[i].name, v_disk, v_runtime);
|
||||
recursive_delete(destpath); // delete assets before updating them
|
||||
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, YES);
|
||||
|
||||
extract:
|
||||
NSLog(@"%s: extract %@ to %@", assets[i].name, zippath, destpath);
|
||||
[SSZipArchive unzipFileAtPath:zippath toDestination:destpath overwrite:YES password:password error:nil];
|
||||
write_version(destpath, v_runtime);
|
||||
}
|
||||
ZipManager *manager = [[ZipManager alloc] init];
|
||||
[manager runProcess:^(NSInteger progress) {
|
||||
[progressVC updateProgress:progress];
|
||||
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, YES);
|
||||
}];
|
||||
|
||||
loading_alert(viewc, nil);
|
||||
win.backgroundColor = [UIColor blackColor];
|
||||
[progressVC dismissView];
|
||||
window.backgroundColor = [UIColor blackColor];
|
||||
}
|
||||
|
||||
void ioswrap_asset_refresh(void)
|
||||
|
@ -142,17 +74,17 @@ void ioswrap_asset_refresh(void)
|
|||
ioswrap_paths(PATH_LIBRARY_SUPPORT, buf, sizeof(buf));
|
||||
NSString *destpath = [NSString stringWithUTF8String:buf];
|
||||
|
||||
// set asset version to 0, will be extracted next time
|
||||
write_version(destpath, 0);
|
||||
// set asset version to 1, will be extracted next time
|
||||
[VersionManager writeVersionWithPath:destpath ver:1];
|
||||
}
|
||||
|
||||
void ioswrap_size(unsigned int *dest)
|
||||
{
|
||||
CGSize bounds = [[UIScreen mainScreen] bounds].size;
|
||||
CGFloat scale = [[UIScreen mainScreen] scale];
|
||||
dest[0] = bounds.width * scale;
|
||||
dest[1] = bounds.height * scale;
|
||||
dest[2] = scale;
|
||||
dest[0] = (unsigned int) (bounds.width * scale);
|
||||
dest[1] = (unsigned int) (bounds.height * scale);
|
||||
dest[2] = (unsigned int) scale;
|
||||
}
|
||||
|
||||
/********/
|
||||
|
@ -166,24 +98,37 @@ static char dialog_text[512];
|
|||
|
||||
void ioswrap_show_dialog(void *uiviewcontroller, const char *accept, const char *hint, const char *current, int type)
|
||||
{
|
||||
UIViewController *viewc = (__bridge UIViewController*) uiviewcontroller;
|
||||
NSString *accept_ = [NSString stringWithUTF8String:accept];
|
||||
(void) hint; // unused
|
||||
UIViewController *viewc = (__bridge UIViewController *) uiviewcontroller;
|
||||
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Text Input" message:nil preferredStyle:UIAlertControllerStyleAlert];
|
||||
[alert addTextFieldWithConfigurationHandler:^(UITextField *textField) {
|
||||
textField.text = [NSString stringWithUTF8String:current];
|
||||
if (type == DIALOG_PASSWORD)
|
||||
textField.secureTextEntry = YES;
|
||||
}];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:accept_ style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
||||
dialog_state = 0;
|
||||
strncpy(dialog_text, alert.textFields[0].text.UTF8String, sizeof(dialog_text));
|
||||
}]];
|
||||
if (type == DIALOG_MULTILINE) {
|
||||
MessageViewController *vc = [[MessageViewController alloc] initWithNibName:@"MessageViewController" bundle:nil];
|
||||
vc.message = [NSString stringWithUTF8String:current];
|
||||
[vc setDidSendMessage:^(NSString *message) {
|
||||
dialog_state = 0;
|
||||
strncpy(dialog_text, message.UTF8String, sizeof(dialog_text));
|
||||
}];
|
||||
[vc presentIn:viewc];
|
||||
|
||||
dialog_state = -1;
|
||||
dialog_text[0] = 0;
|
||||
[viewc presentViewController:alert animated:YES completion:nil];
|
||||
dialog_state = -1;
|
||||
dialog_text[0] = 0;
|
||||
} else {
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Text Input", nil) message:nil preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[alert addTextFieldWithConfigurationHandler:^(UITextField *textField) {
|
||||
textField.text = [NSString stringWithUTF8String:current];
|
||||
if (type == DIALOG_PASSWORD)
|
||||
textField.secureTextEntry = YES;
|
||||
}];
|
||||
|
||||
[alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
||||
dialog_state = 0;
|
||||
strncpy(dialog_text, alert.textFields[0].text.UTF8String, sizeof(dialog_text));
|
||||
}]];
|
||||
|
||||
dialog_state = -1;
|
||||
dialog_text[0] = 0;
|
||||
[viewc presentViewController:alert animated:YES completion:nil];
|
||||
}
|
||||
}
|
||||
|
||||
int ioswrap_get_dialog(const char **text)
|
||||
|
|
Binary file not shown.
|
@ -18,10 +18,12 @@ target 'MultiCraft' do
|
|||
source 'https://cdn.cocoapods.org/'
|
||||
source 'https://github.com/MoNTE48/VorbisOgg-Specs.git'
|
||||
|
||||
pod 'SSZipArchive'
|
||||
pod 'Bugsnag', '5.23.1'
|
||||
pod 'leveldb-library'
|
||||
pod 'LuaJITPod', :git => 'https://github.com/MoNTE48/LuaJITPod'
|
||||
pod 'libvorbis'
|
||||
pod 'LuaJITPod', :git => 'https://github.com/MoNTE48/LuaJITPod'
|
||||
pod 'SSZipArchive'
|
||||
pod 'UITextView+Placeholder'
|
||||
|
||||
appodeal
|
||||
end
|
||||
|
|
|
@ -37,6 +37,7 @@ namespace porting {
|
|||
path_locale = std::string(buf) + "/locale";
|
||||
ioswrap_paths(PATH_LIBRARY_CACHE, buf, sizeof(buf));
|
||||
path_cache = std::string(buf);
|
||||
init_IOS_Settings();
|
||||
}
|
||||
|
||||
void copyAssets() {
|
||||
|
|
Loading…
Reference in New Issue