Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Sources/Nakama/Models/Party.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@ import Foundation
/// Incoming information about a party.
public struct Party {
/// The unique party identifier.
let id: String
public let id: String

/// If the party is open to join.
let open: Bool
public let open: Bool

/// The maximum number of party members.
let maxSize: Int
public let maxSize: Int

/// The current user in this party. i.e. Yourself.
let self_p: UserPresence
public let self_p: UserPresence

/// The current party leader.
let leader: UserPresence
public let leader: UserPresence

/// All members currently in the party.
var presences: [UserPresence]
public var presences: [UserPresence]

/// Apply the joins and leaves from a presence event to the presences tracked by the party.
mutating func updatePresences(event: PartyPresenceEvent) {
Expand Down
14 changes: 7 additions & 7 deletions Sources/Nakama/Models/UserPresence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@
import Foundation

public final class UserPresence: Hashable {
let userId: String
let sessionId: String
let username: String
let persistence: Bool
let status: String?
public let userId: String
public let sessionId: String
public let username: String
public let persistence: Bool
public let status: String?

init(userId: String, sessionId: String, username: String, persistence: Bool, status: String? = nil) {
public init(userId: String, sessionId: String, username: String, persistence: Bool, status: String? = nil) {
self.userId = userId
self.sessionId = sessionId
self.username = username
self.persistence = persistence
self.status = status
}

convenience init(from rtUserPresence: Nakama_Realtime_UserPresence) {
public convenience init(from rtUserPresence: Nakama_Realtime_UserPresence) {
self.init(
userId: rtUserPresence.userID,
sessionId: rtUserPresence.sessionID,
Expand Down
Loading