コード例 #1
0
 /// <summary>
 /// Creates a new instance of the <see cref="IncomingChatListenerPeer"/> class.
 /// </summary>
 /// <param name="initRequest"></param>
 /// <param name="application"> </param>
 public IncomingChatListenerPeer(InitRequest initRequest, ChatApplication application)
     : base(initRequest.Protocol, initRequest.PhotonPeer)
 {
     this.application = application;
     this.chat        = MmoChat.Instance;
     this.channels    = new Dictionary <int, Channel>();
 }
コード例 #2
0
        /// <summary>
        /// Creates a new instance of the <see cref="ChatServerPeer"/> class.
        /// </summary>
        /// <param name="initResponse"></param>
        /// <param name="application"></param>
        public ChatServerPeer(InitResponse initResponse, ChatApplication application)
            : base(initResponse, application)
        {
            this.application = application;

            this.messageFiber = new ThreadFiber(new DefaultQueue(), "ChatMessageFiber", true, ThreadPriority.Highest);
            this.messageFiber.Start();

            this.chat = MmoChat.Instantiate(this);
            // the lock will wait indefinitely
            this.sessions = new ConcurrentStorageMap <int, ISession>(-1);

            this.RequestFiber.Enqueue(this.Register);
        }