浏览代码

GameLift export script updated based on pr feedback. Adding a (q)uitoption

Signed-off-by: Gene Walters <[email protected]>
Gene Walters 2 年之前
父节点
当前提交
70e0839c0c
共有 2 个文件被更改,包括 13 次插入7 次删除
  1. 6 0
      MPSGameLift/Documentation/GameLift.md
  2. 7 7
      MPSGameLift/Scripts/export_gamelift_server_package.py

+ 6 - 0
MPSGameLift/Documentation/GameLift.md

@@ -23,6 +23,12 @@ This README covers optional setup, testing and running on [Amazon GameLift](http
     ```sh
     ```sh
     <path-to-o3de-engine>\scripts\o3de.bat export-project -es <path-to-multiplayer-sample>\MPSGameLift\Scripts\export_gamelift_server_package.py --code --assets -ll INFO
     <path-to-o3de-engine>\scripts\o3de.bat export-project -es <path-to-multiplayer-sample>\MPSGameLift\Scripts\export_gamelift_server_package.py --code --assets -ll INFO
     ```
     ```
+    ---
+    **Important**
+
+    The export_gamelift_server_package script only works for projects built using engine source, and won't work with engine as an sdk. 
+
+    ---
     
     
 1. Bundle Content
 1. Bundle Content
 
 

+ 7 - 7
MPSGameLift/Scripts/export_gamelift_server_package.py

@@ -36,8 +36,8 @@ parser.add_argument('--assets', action='store_true', help='Build assets')
 
 
 args = parser.parse_args(o3de_context.args)
 args = parser.parse_args(o3de_context.args)
 
 
-if not args.code and not args.assets:
-    user_input = input('No build command specified. Do you want to build code, assets, or both? (c/a/b): ')
+while not args.code and not args.assets:
+    user_input = input('No build command specified. Do you want to build code, assets, or both? (c/a/b). Quit(q): ')
     if user_input.lower() == 'c':
     if user_input.lower() == 'c':
         args.code = True
         args.code = True
     elif user_input.lower() == 'a':
     elif user_input.lower() == 'a':
@@ -45,9 +45,13 @@ if not args.code and not args.assets:
     elif user_input.lower() == 'b':
     elif user_input.lower() == 'b':
         args.code = True
         args.code = True
         args.assets = True
         args.assets = True
+    elif user_input.lower() == 'q':
+        quit()
     else:
     else:
         print('Invalid input. Please enter c, a, or b.')
         print('Invalid input. Please enter c, a, or b.')
 
 
+build_folder = os.path.join(o3de_context.project_path, "build", "windows")
+
 # Build code
 # Build code
 if (args.code):
 if (args.code):
     # Enable GameLift gems
     # Enable GameLift gems
@@ -59,19 +63,15 @@ if (args.code):
         quit()
         quit()
 
 
     # Build server launcher
     # Build server launcher
-    build_folder = os.path.join(o3de_context.project_path, "build", "windows")
     os.makedirs(build_folder, exist_ok=True)
     os.makedirs(build_folder, exist_ok=True)
     o3de_logger.info(f"Building {project_name}.ServerLauncher")
     o3de_logger.info(f"Building {project_name}.ServerLauncher")
 
 
     if (process_command(["cmake", "-B", build_folder, "-S", o3de_context.project_path, "-G", "Visual Studio 16"])):
     if (process_command(["cmake", "-B", build_folder, "-S", o3de_context.project_path, "-G", "Visual Studio 16"])):
         quit()
         quit()
 
 
-    if (process_command(["cmake", "--build", build_folder, "--target", f"{project_name}.ServerLauncher", "--config", "profile", "--", "/m"]) != 0):
+    if (process_command(["cmake", "--build", build_folder, "--target", f"{project_name}.ServerLauncher", "AssetBundler", "--config", "profile", "--", "/m"]) != 0):
         quit()
         quit()
         
         
-    if (process_command(["cmake", "--build", build_folder, "--target", f"AssetBundler", "--config", "profile", "--", "/m"]) != 0):
-        quit()
-
     # Build monolithic server launcher build
     # Build monolithic server launcher build
     monolithic_build_folder = os.path.join(o3de_context.project_path, "build", "windows_mono")
     monolithic_build_folder = os.path.join(o3de_context.project_path, "build", "windows_mono")
     os.makedirs(monolithic_build_folder, exist_ok=True)
     os.makedirs(monolithic_build_folder, exist_ok=True)