Add player profile and appearance foundation
This commit is contained in:
parent
e53ad1ac38
commit
0b5b78a553
25 changed files with 1424 additions and 76 deletions
|
|
@ -9,6 +9,9 @@ class PeerRecord:
|
|||
var display_name: String = ""
|
||||
var protocol_version: int = 0
|
||||
var joined_at_unix: int = 0
|
||||
var appearance_snapshot: Dictionary = (
|
||||
CharacterCustomizationCatalog.default_snapshot()
|
||||
)
|
||||
|
||||
|
||||
var _records: Dictionary[int, PeerRecord] = {}
|
||||
|
|
@ -50,6 +53,14 @@ func update_display_name(peer_id: int, display_name: String) -> bool:
|
|||
return true
|
||||
|
||||
|
||||
func update_appearance(peer_id: int, snapshot: Dictionary) -> bool:
|
||||
var record: PeerRecord = _records.get(peer_id)
|
||||
if record == null or not CharacterCustomizationCatalog.validate_snapshot(snapshot):
|
||||
return false
|
||||
record.appearance_snapshot = snapshot.duplicate(true)
|
||||
return true
|
||||
|
||||
|
||||
func has_peer(peer_id: int) -> bool:
|
||||
return _records.has(peer_id)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue