static Play() { peer = new PlayPeer(); Player = new Player(peer); lobby = new PlayLobby(); EevntMessageQueue = new Queue <PlayEventMessage>(); Play.OnPlayEvent += InvokeEvent; Play.SubscribeNoticeReceived(new PlayRPCListener()); Play.SubscribeNoticeReceived(new RoomJoinListener()); Play.SubscribeNoticeReceived(new RoomOnlineListener()); Play.SubscribeNoticeReceived(new RoomOfflineListener()); Play.SubscribeNoticeReceived(new RoomUpdateListener()); Play.SubscribeNoticeReceived(new RoomLeftListener()); Play.SubscribeNoticeReceived(new RoomMasterClientSwitchListener()); Play.SubscribeNoticeReceived(new PlayerPropertyListener()); Play.SubscribeNoticeReceived(new RoomOpenListener()); Play.SubscribeNoticeReceived(new RoomVisibleListener()); Play.StartListen(); Play.RegisterSynchronousObjectType <PlayRoom>(); Play.RegisterSynchronousObjectType <Player>(); Play.RegisterSynchronousObjectType <PlayLobby>(); }
internal Player(PlayPeer peer) : this(peer, null) { }
internal Player(PlayPeer peer, PlayRoom room) : this() { Peer = peer; SetRoom(room); }