Skip to content

Commit

Permalink
Update Game_Server.gd
Browse files Browse the repository at this point in the history
  • Loading branch information
derac committed Mar 11, 2020
1 parent 582163e commit 3d5ab03
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Classes/0_Global/Game_Server.gd
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ func start_serving(retries : int = 3) -> int:

func stop_serving() -> void:
UDP_Broadcast.stop_serving()
peer.close_connection()
if peer.get_connection_status() != 0:
peer.close_connection()
is_server = false
Global.game_state = {}

Expand All @@ -122,7 +123,8 @@ func start_client(ip : String, server_port : int) -> int:
return error

func stop_client() -> void:
peer.close_connection()
if peer.get_connection_status() != 0:
peer.close_connection()
is_client = false
Global.game_state = {}

Expand Down

0 comments on commit 3d5ab03

Please sign in to comment.