Skip to content

Commit 4ca0d46

Browse files
committed
fix close server window
1 parent ac1b152 commit 4ca0d46

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

server/assets/cli/cli.gd

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
extends Node
22

33
var thread
4+
var input = ""
5+
6+
func _notification(what):
7+
if (what == NOTIFICATION_WM_CLOSE_REQUEST):
8+
print("stopping cli")
9+
input="stop"
10+
# get_tree().quit()
411

512
func _init():
613
for i in range(OS.get_cmdline_args().size()):
@@ -26,7 +33,7 @@ func _ready():
2633

2734

2835
func _thread_function():
29-
var input = ""
36+
3037
while input != "stop" && input != "quit" && input != "exit":
3138
# printraw("gameserver$ ")
3239
input = OS.read_string_from_stdin().strip_edges()

0 commit comments

Comments
 (0)