2024-04-05 10:52:30 +01:00
|
|
|
extends Node
|
|
|
|
|
|
|
|
var appid : int = 2835570
|
|
|
|
|
2024-10-28 16:42:34 +00:00
|
|
|
const PACKET_READ_LIMIT: int = 32
|
|
|
|
|
|
|
|
var DATA
|
|
|
|
var LOBBY_ID = 0
|
|
|
|
var LOBBY_MEMBERS = []
|
|
|
|
var USER_ID_LIST_TO_IGNORE : Array[int]
|
|
|
|
var LOBBY_INVITE_ARG = false
|
|
|
|
var STEAM_ID = 0
|
|
|
|
var STEAM_NAME = ""
|
|
|
|
var ONLINE = false
|
|
|
|
var HOST_ID = 0
|
|
|
|
|
2024-04-05 10:52:30 +01:00
|
|
|
func _ready():
|
2024-10-28 16:42:34 +00:00
|
|
|
process_priority = 1000
|
|
|
|
set_process_internal(true)
|
|
|
|
InitializeSteam()
|
|
|
|
|
|
|
|
ONLINE = Steam.loggedOn()
|
|
|
|
STEAM_ID = Steam.getSteamID()
|
|
|
|
STEAM_NAME = Steam.getPersonaName()
|
|
|
|
print("online ... ", ONLINE, " ... steam id ... ", STEAM_ID, " ... steam name ... ", STEAM_NAME)
|
2024-04-05 10:52:30 +01:00
|
|
|
|
|
|
|
func _process(_delta: float) -> void:
|
2024-10-28 16:42:34 +00:00
|
|
|
#OS.delay_msec(17)
|
|
|
|
Steam.run_callbacks()
|
2024-04-05 10:52:30 +01:00
|
|
|
|
|
|
|
func InitializeSteam():
|
2024-04-13 15:32:57 +01:00
|
|
|
if GlobalVariables.using_steam:
|
|
|
|
OS.set_environment("SteamAppId", str(appid))
|
|
|
|
OS.set_environment("SteamGameId", str(appid))
|
|
|
|
|
|
|
|
var INIT: Dictionary = Steam.steamInit(false)
|
|
|
|
print("steam init: ", str(INIT))
|
|
|
|
else: print("steam not initialized - not running steam version")
|