Skip to content
This repository has been archived by the owner on May 16, 2022. It is now read-only.

PhotonWire.Server.Collections

neuecc edited this page May 30, 2016 · 1 revision

ComparerHelper

public static class PhotonWire.Server.Collections.ComparerHelper

Static Methods

Type Name Summary
IEqualityComparer<T> Create(Func<T, TKey> compareKeySelector)

JoinRoomReason

public enum PhotonWire.Server.Collections.JoinRoomReason
    : Enum, IComparable, IFormattable, IConvertible

Enum

Value Name Summary
0 Joined
1 JoinedAndJustFull
2 NotJoinedAlreadyFull
3 NotJoinedRoomNotFound
4 NotJoinedAlreadyJoined

ReadOnlyHashSet<T>

public class PhotonWire.Server.Collections.ReadOnlyHashSet<T>

Methods

Type Name Summary
IEnumerable<T> AsEnumerable()
Boolean Contains(T item)

RemoveRoomMemberReason

public enum PhotonWire.Server.Collections.RemoveRoomMemberReason
    : Enum, IComparable, IFormattable, IConvertible

Enum

Value Name Summary
0 RemovedMember
1 RemovedAndRoomDeleted
2 NotRemovedRoomNotFound
3 NotRemovedMemberNotFound

RoomBase<TMemberKey, TMember>

Base class for RoomCollection.

public abstract class PhotonWire.Server.Collections.RoomBase<TMemberKey, TMember>

Properties

Type Name Summary
String InternalRoomIdentifier
IEnumerable<IPhotonWirePeer> MemberPeers Peers of room member.
IImmutableDictionary<TMemberKey, TMember> Members Members are immutable, modified only in RoomCollection.
IEqualityComparer<TMemberKey> MembersKeyEqualityComparer Dictionary of Members Key's equality comparer.
IEqualityComparer<TMember> MembersValueEqualityComparer Dictionary of Members Value's equality comparer.

Methods

Type Name Summary
void OnMemberDisconnected(TMember disconnectedMember)

RoomCollection<TRoomKey, TRoom, TMemberKey, TMember>

Threadsafe coordinater, room and members.

public class PhotonWire.Server.Collections.RoomCollection<TRoomKey, TRoom, TMemberKey, TMember>

Methods

Type Name Summary
Boolean CreateRoom(TRoomKey roomKey, TRoom newRoom, TMemberKey memberKey, TMember newMember) Create new room with member.
TRoom[] GetAllRoom() Get all rooms.
TRoom GetRoom(TRoomKey roomKey) Get room. If not found return null.
JoinRoomReason JoinRoom(TRoomKey roomKey, TMemberKey memberKey, TMember member, Nullable<Int32> roomMaxMemberCount, Action<TRoom, TMember> sideEffectBeforeJoin, TRoom& room) Join new room. If JoinRoomReason.Joined* is succeeed otherwise failed.
Boolean ModifyRoom(TRoomKey key, Action<TRoom> sideEffect, TRoom& room) Do side-effect action in key lock, so action should be lightweight.
RemoveRoomMemberReason RemoveMember(TRoomKey roomKey, TMemberKey memberKey, Action<IImmutableDictionary<TMemberKey, TMember>> sideEffectAfterRemove, TRoom& room) Remove member from the room. If RemoveRoomMemberReason.Removed* is succeeed otherwise failed.
Boolean RemoveRoom(TRoomKey roomKey, TRoom& room) Remove room. If can removed return true otherwise else.
Boolean ReplaceMembers(TRoomKey key, Func<TRoom, IImmutableDictionary<TMemberKey, TMember>> newMembersSelector, TRoom& room) Replace Members in key lock.

RoomMemberBase

Bass class for RoomCollection's member.

public abstract class PhotonWire.Server.Collections.RoomMemberBase

Properties

Type Name Summary
IPhotonWirePeer Peer