add server console input
This commit is contained in:
21
scripts/globals/consoler.gd
Normal file
21
scripts/globals/consoler.gd
Normal file
@@ -0,0 +1,21 @@
|
||||
extends Node
|
||||
|
||||
var input_thread: Thread
|
||||
|
||||
|
||||
func _enter_tree() -> void:
|
||||
input_thread = Thread.new()
|
||||
input_thread.start(_process_input)
|
||||
|
||||
|
||||
func _exit_tree() -> void:
|
||||
input_thread.wait_to_finish()
|
||||
|
||||
|
||||
func _process_input() -> void:
|
||||
var text := ""
|
||||
while text != "quit":
|
||||
print("Insert some text: ")
|
||||
text = OS.read_string_from_stdin().strip_edges()
|
||||
Referencer.chat.send_server_message(text)
|
||||
get_tree().quit()
|
||||
Reference in New Issue
Block a user