Merging networking features #5

Merged
gskeough merged 27 commits from feature/godot-steam-integration into develop 2024-12-14 03:37:16 +00:00
Showing only changes of commit 3f44872418 - Show all commits

View File

@ -13,12 +13,13 @@ var lobby_type: int = Steam.LOBBY_TYPE_PUBLIC
var steam_id: int = 0
var steam_username: String = ""
var avatar_texture_cache: Dictionary = {}
var host_id: int = 0
signal lobby_created(lobby_id: int)
signal lobby_joined(lobby_id: int)
signal user_joined_lobby(user_id: int)
signal user_left_lobby(user_id: int)
signal avatar_loaded(user_id: int, avatar_texture: ImageTexture)
signal host_left_lobby()
func _ready() -> void:
@ -91,6 +92,7 @@ func _on_lobby_created(connect: int, this_lobby_id: int) -> void:
lobby_id = this_lobby_id
lobby_created.emit(lobby_id)
print("Lobby created with ID: " + str(lobby_id))
host_id = steam_id
Steam.setLobbyJoinable(lobby_id, true)
Steam.setLobbyData(lobby_id, "name", str(steam_username) + "'s Lobby")
@ -206,7 +208,7 @@ func leave_lobby():
for this_member in lobby_members:
if this_member["steam_id"] != steam_id:
Steam.closeP2PSessionWithUser(this_member["steam_id"])
lobby_members.clear()
print("Left lobby.")