feat: pushing dragons to server
This commit is contained in:
parent
b080ab7bf4
commit
f9f38ba95c
3 changed files with 13 additions and 6 deletions
|
@ -9,7 +9,7 @@ func _ready() -> void:
|
|||
request_completed.connect(_on_request_completed)
|
||||
|
||||
|
||||
func _on_request_completed(result: int, response_code: int, headers: PackedStringArray, body: PackedByteArray):
|
||||
func _on_request_completed(_result: int, response_code: int, _headers: PackedStringArray, body: PackedByteArray):
|
||||
if response_code != 200:
|
||||
print("HTTP request returned error: ", response_code)
|
||||
return
|
||||
|
@ -20,15 +20,15 @@ func _on_request_completed(result: int, response_code: int, headers: PackedStrin
|
|||
on_dragon_received.emit(properties)
|
||||
|
||||
|
||||
func send(origin: String, name: String, color: int, shirt: int, hat: int, decor: int) -> void:
|
||||
var url: String = 'http://torreta.gerardgascon.com/add/%s/%s/%s/%s/%s/%s/' % [origin, name, color, shirt, hat, decor]
|
||||
var err = request(url)
|
||||
func send(properties: DragonProperties) -> void:
|
||||
var url: String = 'http://torreta.gerardgascon.com/add/%s/%s/%s/%s/%s/%s/' % [properties.origin, properties.name, properties.color, properties.shirt, properties.hat, properties.decor]
|
||||
var err: int = request(url)
|
||||
if err != OK:
|
||||
print("HTTP request failed: ", err)
|
||||
|
||||
|
||||
func receive(origin: String) -> void:
|
||||
var url: String = 'http://torreta.gerardgascon.com/get/%s/' % origin
|
||||
var err = request(url)
|
||||
var err: int = request(url)
|
||||
if err != OK:
|
||||
print("HTTP request failed: ", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue