add server console input

This commit is contained in:
2025-02-15 02:02:05 +10:00
parent 809da74969
commit ed41775543
4 changed files with 40 additions and 8 deletions

View 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()