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); }
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); }
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; }
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); } } }
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); } } }
public ClusterTopology(DiscussionRoom room, BinaryReader reader) { _room = room; Read(reader); }