Data Models

These are the core data structures used throughout the friend system. All models are in the ElderWorldStudio.FriendList.Models namespace and are marked [Serializable] for Unity serialization.

Friend

Scripts/Models/Friend.cs

Represents a friend in your list.

PropertyTypeDescription
UserIdstringUnique identifier
DisplayNamestringVisible name
StatusFriendStatusOnline/Offline/InRoom
CurrentRoomRoomInfoRoom data if in room
AddedTimestamplongUnix time added
CustomDatastringExtra data

FriendRequest

Scripts/Models/FriendRequest.cs

Represents a friend request between users.

PropertyTypeDescription
RequestIdstringUnique request ID
SenderIdstringWho sent it
ReceiverIdstringWho receives it
SenderNamestringSender's display name
StatusFriendRequestStatusPending/Accepted/Rejected
CreatedAtlongUnix timestamp

FriendInvitation

Scripts/Models/FriendInvitation.cs

Represents a game invitation sent to a friend.

PropertyTypeDescription
IdstringUnique invitation ID
FromUserIdstringWho sent it
FromUsernamestringSender's name
ToUserIdstringWho receives
MessagestringPersonal message
RoomInfoRoomInfoRoom to join
CustomDataDictionary<string,string>Extra data
StatusInvitationStatusPending/Accepted/Declined
CreatedAtlongUnix timestamp

RoomInfo

Scripts/Models/RoomInfo.cs

Information about a game room or session.

PropertyTypeDescription
RoomIdstringUnique room ID
RoomNamestringDisplay name
HostIdstringHost user ID
MaxPlayersintMax capacity
CurrentPlayersintCurrent count
IsPrivateboolPassword protected

BlockEntry

Scripts/Models/BlockEntry.cs

Represents a blocked user entry.

PropertyTypeDescription
UserIdstringBlocked user's ID
BlockedAtlongUnix timestamp

Status Enums

FriendStatus

Online status of a friend:

  • Online - Connected and available
  • Offline - Not connected
  • InRoom - In a game room
  • Away - Marked as away

FriendRequestStatus

Status of a friend request:

  • Pending - Awaiting response
  • Accepted - Accepted by receiver
  • Rejected - Declined by receiver
  • Cancelled - Cancelled by sender

InvitationStatus

Status of a game invitation:

  • Pending - Awaiting response
  • Accepted - Accepted
  • Declined - Declined
  • Expired - Timed out

NetworkBackendType

Supported networking backends:

  • PhotonPUN
  • PhotonFusion
  • Mirror
  • UnityNetcode
  • FishNet
  • Custom