Skip to content

Commit

Permalink
game_started = true is now set before synchronisation.
Browse files Browse the repository at this point in the history
Fixed the bug where the guest wasn't able to play if the host decided to go second.
  • Loading branch information
ra314 committed Aug 19, 2021
1 parent e29af45 commit c1cd666
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 268 deletions.
17 changes: 8 additions & 9 deletions Scripts/Levels/Level Main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func show_help_menu():
func remove_reroll_and_start_butttons():
remove_reroll_spawn_button()
get_node("CanvasLayer/Start Game").queue_free()
change_view_of_end_attack(false)
end_attack_enable(false)
game_started = true

remotesync func remove_reroll_spawn_button():
Expand All @@ -124,7 +124,7 @@ remotesync func remove_color_select_buttons():
get_node("CanvasLayer/Play Red").queue_free()
get_node("CanvasLayer/Play Blue").queue_free()

remote func change_view_of_end_attack(hide_boolean):
remote func end_attack_enable(hide_boolean):
if hide_boolean:
get_node("CanvasLayer/End Attack").hide()
else:
Expand Down Expand Up @@ -159,6 +159,7 @@ func set_host_color(color):
if color == "blue":
other_color = "red"
players[other_color].network_id = _root.players["guest"]
game_started = true
synchronize(_root.players["guest"])

# Changing the visibility of relevant buttons
Expand All @@ -167,12 +168,10 @@ func set_host_color(color):

if curr_player.network_id == _root.players[_root.player_name]:
print("changing local button")
change_view_of_end_attack(false)
end_attack_enable(false)
else:
print("changing other guyss button")
rpc_id(curr_player.network_id, "change_view_of_end_attack", false)

game_started = true
rpc_id(curr_player.network_id, "end_attack_enable", false)

# Checks if a country is non adjacent to a player
func is_country_neighbour_of_player(test_country, player):
Expand Down Expand Up @@ -226,7 +225,7 @@ func change_to_reinforcement():
curr_player.give_reinforcements()

# Modifying the visibility of the end attack and end reinforcement buttons
change_view_of_end_attack(true)
end_attack_enable(true)
change_view_of_end_reinforcement(false)

phase = "reinforcement"
Expand All @@ -235,9 +234,9 @@ func change_to_attack():
# Modifying the visibility of the end attack and end reinforcement buttons
if _root.online_game:
change_view_of_end_reinforcement(true)
rpc_id(get_next_player().network_id, "change_view_of_end_attack", false)
rpc_id(get_next_player().network_id, "end_attack_enable", false)
else:
change_view_of_end_attack(false)
end_attack_enable(false)
change_view_of_end_reinforcement(true)

# Cleaning up the dictionary that was tracking where reinforcements were placed
Expand Down
2 changes: 0 additions & 2 deletions Scripts/Main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ const LOCAL_HOST = "127.0.0.1"
# Dictionary mapping player names ("host", "guest") to network ids
var players = {}



remotesync func load_level(scene_str, world_str):
var scene = scene_manager._load_scene(scene_str).init(world_str)
scene_manager._replace_scene(scene)
Expand Down
257 changes: 0 additions & 257 deletions export_presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -63,260 +63,3 @@ application/product_name=""
application/file_description=""
application/copyright=""
application/trademarks=""

[preset.2]

name="Android"
platform="Android"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="./Risky Nodes.apk"
script_export_mode=1
script_encryption_key=""

[preset.2.options]

custom_template/debug=""
custom_template/release=""
custom_template/use_custom_build=false
custom_template/export_format=0
architectures/armeabi-v7a=true
architectures/arm64-v8a=true
architectures/x86=false
architectures/x86_64=false
keystore/debug=""
keystore/debug_user=""
keystore/debug_password=""
keystore/release=""
keystore/release_user=""
keystore/release_password=""
one_click_deploy/clear_previous_install=false
version/code=1
version/name="1.0"
package/unique_name="org.godotengine.$genname"
package/name=""
package/signed=true
launcher_icons/main_192x192=""
launcher_icons/adaptive_foreground_432x432=""
launcher_icons/adaptive_background_432x432=""
graphics/32_bits_framebuffer=true
graphics/opengl_debug=false
xr_features/xr_mode=0
xr_features/degrees_of_freedom=0
xr_features/hand_tracking=0
xr_features/focus_awareness=false
screen/immersive_mode=true
screen/support_small=true
screen/support_normal=true
screen/support_large=true
screen/support_xlarge=true
command_line/extra_args=""
apk_expansion/enable=false
apk_expansion/SALT=""
apk_expansion/public_key=""
permissions/custom_permissions=PoolStringArray( )
permissions/access_checkin_properties=false
permissions/access_coarse_location=false
permissions/access_fine_location=false
permissions/access_location_extra_commands=false
permissions/access_mock_location=false
permissions/access_network_state=false
permissions/access_surface_flinger=false
permissions/access_wifi_state=false
permissions/account_manager=false
permissions/add_voicemail=false
permissions/authenticate_accounts=false
permissions/battery_stats=false
permissions/bind_accessibility_service=false
permissions/bind_appwidget=false
permissions/bind_device_admin=false
permissions/bind_input_method=false
permissions/bind_nfc_service=false
permissions/bind_notification_listener_service=false
permissions/bind_print_service=false
permissions/bind_remoteviews=false
permissions/bind_text_service=false
permissions/bind_vpn_service=false
permissions/bind_wallpaper=false
permissions/bluetooth=false
permissions/bluetooth_admin=false
permissions/bluetooth_privileged=false
permissions/brick=false
permissions/broadcast_package_removed=false
permissions/broadcast_sms=false
permissions/broadcast_sticky=false
permissions/broadcast_wap_push=false
permissions/call_phone=false
permissions/call_privileged=false
permissions/camera=false
permissions/capture_audio_output=false
permissions/capture_secure_video_output=false
permissions/capture_video_output=false
permissions/change_component_enabled_state=false
permissions/change_configuration=false
permissions/change_network_state=false
permissions/change_wifi_multicast_state=false
permissions/change_wifi_state=false
permissions/clear_app_cache=false
permissions/clear_app_user_data=false
permissions/control_location_updates=false
permissions/delete_cache_files=false
permissions/delete_packages=false
permissions/device_power=false
permissions/diagnostic=false
permissions/disable_keyguard=false
permissions/dump=false
permissions/expand_status_bar=false
permissions/factory_test=false
permissions/flashlight=false
permissions/force_back=false
permissions/get_accounts=false
permissions/get_package_size=false
permissions/get_tasks=false
permissions/get_top_activity_info=false
permissions/global_search=false
permissions/hardware_test=false
permissions/inject_events=false
permissions/install_location_provider=false
permissions/install_packages=false
permissions/install_shortcut=false
permissions/internal_system_window=false
permissions/internet=false
permissions/kill_background_processes=false
permissions/location_hardware=false
permissions/manage_accounts=false
permissions/manage_app_tokens=false
permissions/manage_documents=false
permissions/master_clear=false
permissions/media_content_control=false
permissions/modify_audio_settings=false
permissions/modify_phone_state=false
permissions/mount_format_filesystems=false
permissions/mount_unmount_filesystems=false
permissions/nfc=false
permissions/persistent_activity=false
permissions/process_outgoing_calls=false
permissions/read_calendar=false
permissions/read_call_log=false
permissions/read_contacts=false
permissions/read_external_storage=false
permissions/read_frame_buffer=false
permissions/read_history_bookmarks=false
permissions/read_input_state=false
permissions/read_logs=false
permissions/read_phone_state=false
permissions/read_profile=false
permissions/read_sms=false
permissions/read_social_stream=false
permissions/read_sync_settings=false
permissions/read_sync_stats=false
permissions/read_user_dictionary=false
permissions/reboot=false
permissions/receive_boot_completed=false
permissions/receive_mms=false
permissions/receive_sms=false
permissions/receive_wap_push=false
permissions/record_audio=false
permissions/reorder_tasks=false
permissions/restart_packages=false
permissions/send_respond_via_message=false
permissions/send_sms=false
permissions/set_activity_watcher=false
permissions/set_alarm=false
permissions/set_always_finish=false
permissions/set_animation_scale=false
permissions/set_debug_app=false
permissions/set_orientation=false
permissions/set_pointer_speed=false
permissions/set_preferred_applications=false
permissions/set_process_limit=false
permissions/set_time=false
permissions/set_time_zone=false
permissions/set_wallpaper=false
permissions/set_wallpaper_hints=false
permissions/signal_persistent_processes=false
permissions/status_bar=false
permissions/subscribed_feeds_read=false
permissions/subscribed_feeds_write=false
permissions/system_alert_window=false
permissions/transmit_ir=false
permissions/uninstall_shortcut=false
permissions/update_device_stats=false
permissions/use_credentials=false
permissions/use_sip=false
permissions/vibrate=false
permissions/wake_lock=false
permissions/write_apn_settings=false
permissions/write_calendar=false
permissions/write_call_log=false
permissions/write_contacts=false
permissions/write_external_storage=false
permissions/write_gservices=false
permissions/write_history_bookmarks=false
permissions/write_profile=false
permissions/write_secure_settings=false
permissions/write_settings=false
permissions/write_sms=false
permissions/write_social_stream=false
permissions/write_sync_settings=false
permissions/write_user_dictionary=false

[preset.3]

name="Mac OSX"
platform="Mac OSX"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="./Risky Nodes.zip"
script_export_mode=1
script_encryption_key=""

[preset.3.options]

custom_template/debug=""
custom_template/release=""
application/name=""
application/info="Made with Godot Engine"
application/icon=""
application/identifier=""
application/signature=""
application/short_version="1.0"
application/version="1.0"
application/copyright=""
display/high_res=false
privacy/camera_usage_description=""
privacy/microphone_usage_description=""
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false

[preset.4]

name="HTML5"
platform="HTML5"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="./Risky Nodes.html"
script_export_mode=1
script_encryption_key=""

[preset.4.options]

custom_template/debug=""
custom_template/release=""
variant/export_type=0
vram_texture_compression/for_desktop=true
vram_texture_compression/for_mobile=false
html/custom_html_shell=""
html/head_include=""
html/canvas_resize_policy=2
html/experimental_virtual_keyboard=false
34 changes: 34 additions & 0 deletions icon.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

0 comments on commit c1cd666

Please sign in to comment.