コード例 #1
0
 public void AllRoomsBroadcast(LitePeer peer,
                               OperationRequest operationRequest,
                               SendParameters sendParameters,
                               byte EventCode)
 {
     foreach (string roomName in roomList)
     {
         RoomReference  rr             = DiscussionGameCache.Instance.GetRoomReference(roomName);
         DiscussionRoom discussionRoom = rr.Room as DiscussionRoom;
         if (discussionRoom != null)
         {
             discussionRoom.Broadcast(peer,
                                      operationRequest,
                                      sendParameters,
                                      EventCode,
                                      BroadcastTo.RoomAll);
         }
     }
     BroadcastLobby(operationRequest, sendParameters, EventCode);
 }
コード例 #2
0
ファイル: EventLogger.cs プロジェクト: z-saffarpour/duscusys
        public static bool LogAndBroadcast(DiscCtx ctx, DiscussionRoom room, StEvent ev, int usrId, int topicId)
        {
            var res = EventLogger.Log(ctx,
                                      ev,
                                      usrId,
                                      room.DiscId,
                                      topicId,
                                      DeviceType.Wpf);

            if (res)
            {
                room.BroadcastReliableToRoom((byte)DiscussionEventCode.StatsEvent,
                                             Serializers.WriteStatEventParams(ev,
                                                                              usrId,
                                                                              room.DiscId,
                                                                              topicId,
                                                                              DeviceType.Wpf)
                                             );
            }
            return(res);
        }
コード例 #3
0
ファイル: EventLogger.cs プロジェクト: gdlprj/duscusys
        public static bool LogAndBroadcast(DiscCtx ctx, DiscussionRoom room, StEvent ev, int usrId, int topicId)
        {
            var res = EventLogger.Log(ctx,
                                      ev,
                                      usrId,
                                      room.DiscId,
                                      topicId,
                                      DeviceType.Wpf);

            if (res)
            {
                room.BroadcastReliableToRoom((byte) DiscussionEventCode.StatsEvent,
                                             Serializers.WriteStatEventParams(ev,
                                                                              usrId,
                                                                              room.DiscId,
                                                                              topicId,
                                                                              DeviceType.Wpf)
                    );
            }
            return res;
        }
コード例 #4
0
ファイル: VectProcessor.cs プロジェクト: gdlprj/duscusys
        public VectProcessor(int topicId, DiscussionRoom room)
        {
            _topicId = topicId;
            _room = room;

            //restore annotation
            using (var dbCtx = new DiscCtx(Discussions.ConfigManager.ConnStr))
            {
                var topic = dbCtx.Topic.FirstOrDefault(t0 => t0.Id == topicId);
                if (topic!=null && topic.Annotation != null)
                {
                    var str = new MemoryStream();
                    str.Write(topic.Annotation, 0, topic.Annotation.Count());
                    str.Position = 0;
                    var reader = new BinaryReader(str);
                    Read(reader);
                }
                else
                {
                    //no annotations saved for this topic yet
                    Read(null);
                }
            }
        }
コード例 #5
0
        public VectProcessor(int topicId, DiscussionRoom room)
        {
            _topicId = topicId;
            _room    = room;

            //restore annotation
            using (var dbCtx = new DiscCtx(Discussions.ConfigManager.ConnStr))
            {
                var topic = dbCtx.Topic.FirstOrDefault(t0 => t0.Id == topicId);
                if (topic != null && topic.Annotation != null)
                {
                    var str = new MemoryStream();
                    str.Write(topic.Annotation, 0, topic.Annotation.Count());
                    str.Position = 0;
                    var reader = new BinaryReader(str);
                    Read(reader);
                }
                else
                {
                    //no annotations saved for this topic yet
                    Read(null);
                }
            }
        }
コード例 #6
0
ファイル: ClusterTopology.cs プロジェクト: gdlprj/duscusys
        public ClusterTopology(DiscussionRoom room, BinaryReader reader)
        {
            _room = room;

            Read(reader);
        }
コード例 #7
0
        public ClusterTopology(DiscussionRoom room, BinaryReader reader)
        {
            _room = room;

            Read(reader);
        }