mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-10 16:04:04 +00:00
34 lines
1.1 KiB
GDScript
34 lines
1.1 KiB
GDScript
extends SceneTree
|
|
|
|
const ServerControlScript = preload("res://scripts/server_control.gd")
|
|
const AgonesSDKScript = preload("res://scripts/agones_sdk.gd")
|
|
const PORT := 18081
|
|
|
|
|
|
func _init() -> void:
|
|
var fake_sidecar = ServerControlScript.new()
|
|
root.add_child(fake_sidecar)
|
|
if fake_sidecar.start(PORT) != OK:
|
|
printerr("fake sidecar failed to bind")
|
|
quit(1)
|
|
return
|
|
fake_sidecar.set_process_ready(true)
|
|
var sdk = AgonesSDKScript.new()
|
|
root.add_child(sdk)
|
|
if not sdk.configure_for_testing("http://127.0.0.1:%d" % PORT):
|
|
printerr("SDK test configuration failed")
|
|
quit(1)
|
|
return
|
|
await process_frame
|
|
var health_status := await sdk.health()
|
|
var ready_status := await sdk.mark_ready()
|
|
var annotation_status := await sdk.set_annotation("match", "result")
|
|
var shutdown_status := await sdk.shutdown()
|
|
if health_status != 200 or ready_status != 200 or annotation_status < 400 or shutdown_status < 400:
|
|
printerr("Agones SDK smoke statuses health=%d ready=%d annotation=%d shutdown=%d" % [health_status, ready_status, annotation_status, shutdown_status])
|
|
quit(1)
|
|
return
|
|
print("Agones SDK smoke passed")
|
|
fake_sidecar.stop()
|
|
quit(0)
|