Browse Source

Prepare auto-update for deployment

master
Luna 7 years ago
parent
commit
0ff3605ae6
6 changed files with 76 additions and 16 deletions
  1. +2
    -0
      .gitignore
  2. +60
    -8
      export_presets.cfg
  3. BIN
      icon.png
  4. +4
    -0
      project.godot
  5. +7
    -6
      scenes/update.tscn
  6. +3
    -2
      scripts/update.gd

+ 2
- 0
.gitignore View File

@ -9,7 +9,9 @@ nohup.out
recordings recordings
ai ai
release release
vanagloria.pck
._* ._*
ehthumbs.db ehthumbs.db
Thumbs.db Thumbs.db

+ 60
- 8
export_presets.cfg View File

@ -4,8 +4,9 @@ name="Windows Desktop"
platform="Windows Desktop" platform="Windows Desktop"
runnable=false runnable=false
custom_features="" custom_features=""
export_filter="all_resources"
include_filter=""
export_filter="resources"
export_files=PoolStringArray( "res://default_env.tres", "res://scenes/update.tscn", "res://scripts/util.gd" )
include_filter="/etc/ssl/certs/ca-certificates.crt"
exclude_filter="" exclude_filter=""
patch_list=PoolStringArray( ) patch_list=PoolStringArray( )
@ -17,11 +18,11 @@ texture_format/etc2=false
binary_format/64_bits=true binary_format/64_bits=true
custom_template/release="" custom_template/release=""
custom_template/debug="" custom_template/debug=""
application/icon=""
application/file_version=""
application/product_version=""
application/company_name=""
application/product_name=""
application/icon="/hdd/documents/src/nv-moba/icon.png"
application/file_version="0.0.0"
application/product_version="0.0.0"
application/company_name="Cosine Gaming"
application/product_name="Vanagloria"
application/file_description="" application/file_description=""
application/copyright="" application/copyright=""
application/trademarks="" application/trademarks=""
@ -32,12 +33,63 @@ name="Linux/X11"
platform="Linux/X11" platform="Linux/X11"
runnable=false runnable=false
custom_features="" custom_features=""
export_filter="resources"
export_files=PoolStringArray( "res://default_env.tres", "res://scenes/update.tscn", "res://scripts/util.gd" )
include_filter="/etc/ssl/certs/ca-certificates.crt"
exclude_filter=""
patch_list=PoolStringArray( )
[preset.1.options]
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
binary_format/64_bits=true
custom_template/release=""
custom_template/debug=""
[preset.2]
name="Mac OSX"
platform="Mac OSX"
runnable=false
custom_features=""
export_filter="resources"
export_files=PoolStringArray( "res://default_env.tres", "res://scenes/update.tscn", "res://scripts/util.gd" )
include_filter="/etc/ssl/certs/ca-certificates.crt"
exclude_filter=""
patch_list=PoolStringArray( )
[preset.2.options]
custom_package/debug=""
custom_package/release=""
application/name="Vanagloria"
application/info="Made with Godot Engine"
application/icon="res://icon.png"
application/identifier="com.cosinegaming.vanagloria"
application/signature="godotmacgame"
application/short_version="0.0"
application/version="0.0.0"
application/copyright=""
application/bits_mode=0
display/high_res=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
[preset.3]
name="Full PCK"
platform="Linux/X11"
runnable=false
custom_features=""
export_filter="all_resources" export_filter="all_resources"
include_filter="" include_filter=""
exclude_filter="" exclude_filter=""
patch_list=PoolStringArray( ) patch_list=PoolStringArray( )
[preset.1.options]
[preset.3.options]
texture_format/s3tc=true texture_format/s3tc=true
texture_format/etc=false texture_format/etc=false


BIN
icon.png View File

Before After
Width: 64  |  Height: 64  |  Size: 3.4 KiB Width: 64  |  Height: 64  |  Size: 2.7 KiB

+ 4
- 0
project.godot View File

@ -55,6 +55,10 @@ hero_5_confirm_portal=[ Object(InputEventMouseButton,"resource_local_to_scene":f
hero_5_remove_portal=[ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":2,"pressed":false,"doubleclick":false,"script":null) hero_5_remove_portal=[ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":2,"pressed":false,"doubleclick":false,"script":null)
] ]
[network]
ssl/certificates="/etc/ssl/certs/ca-certificates.crt"
[rendering] [rendering]
environment/default_environment="res://default_env.tres" environment/default_environment="res://default_env.tres"

+ 7
- 6
scenes/update.tscn View File

@ -5,7 +5,7 @@
[sub_resource type="DynamicFont" id=1] [sub_resource type="DynamicFont" id=1]
size = 0
size = 50
use_mipmaps = false use_mipmaps = false
use_filter = false use_filter = false
font_data = ExtResource( 2 ) font_data = ExtResource( 2 )
@ -81,21 +81,22 @@ anchor_left = 0.5
anchor_top = 0.0 anchor_top = 0.0
anchor_right = 0.5 anchor_right = 0.5
anchor_bottom = 0.0 anchor_bottom = 0.0
margin_left = -20.0
margin_top = 56.0
margin_right = 20.0
margin_bottom = 70.0
margin_left = -209.0
margin_top = 70.0
margin_right = 208.0
margin_bottom = 136.0
rect_pivot_offset = Vector2( 0, 0 ) rect_pivot_offset = Vector2( 0, 0 )
mouse_filter = 2 mouse_filter = 2
mouse_default_cursor_shape = 0 mouse_default_cursor_shape = 0
size_flags_horizontal = 1 size_flags_horizontal = 1
size_flags_vertical = 4 size_flags_vertical = 4
custom_fonts/font = SubResource( 1 ) custom_fonts/font = SubResource( 1 )
custom_colors/font_color = Color( 1, 1, 1, 1 )
text = "VANAGLORIA" text = "VANAGLORIA"
align = 1 align = 1
percent_visible = 1.0 percent_visible = 1.0
lines_skipped = 0 lines_skipped = 0
max_lines_visible = -1 max_lines_visible = -1
_sections_unfolded = [ "custom_fonts" ]
_sections_unfolded = [ "custom_colors", "custom_fonts" ]

+ 3
- 2
scripts/update.gd View File

@ -7,7 +7,7 @@ var time = 0
func _ready(): func _ready():
connect("request_completed", self, "_request_completed") connect("request_completed", self, "_request_completed")
# Check if we need an update # Check if we need an update
request("http://localhost:8080/vanagloria/version")
request("https://cosinegaming.com/vanagloria/version")
set_process(true) set_process(true)
func _request_completed(result, response_code, headers, body): func _request_completed(result, response_code, headers, body):
@ -18,7 +18,8 @@ func _request_completed(result, response_code, headers, body):
if not is_update_payload: if not is_update_payload:
# Just checking if we need an update # Just checking if we need an update
var server = JSON.parse(body.get_string_from_utf8()).result var server = JSON.parse(body.get_string_from_utf8()).result
if server.version == util.version:
# 0.0.0 -> Update-shell application, needs more resources
if server.version == util.version and util.version != "0.0.0":
completed() completed()
else: else:
is_update_payload = true is_update_payload = true


Loading…
Cancel
Save