This repository has been archived on 2023-12-19. You can view files and clone it, but cannot push or open issues or pull requests.
MUR/scripts/networking/game_server.gd

46 lines
802 B
GDScript

extends Spatial
class_name GameServer
const SERVER_ADDR = "mur-server.lh8.de"
const API_ADDR = "https://" + SERVER_ADDR + "/"
const HEADERS = ["Content-Type: application/json"]
const SSL = false
var server_addr:String = SERVER_ADDR
var api_addr:String = API_ADDR
var headers:Array = HEADERS
var ssl:bool = SSL
func http():
var game_server_requests = GameServerRequests.new()
add_child(game_server_requests)
return game_server_requests
func get_server_addr():
return server_addr
func set_server_addr(new_server_addr:String):
server_addr = new_server_addr
func get_api_addr():
return api_addr
func set_api_addr(new_api_addr:String):
if not new_api_addr.ends_with("/"):
new_api_addr += "/"
api_addr = new_api_addr
func get_headers():
return headers
func get_ssl():
return ssl