public PatientController(IPatientRepository patientRepository, IMessageRepository messageRepository, RoomClient roomClient, ILogger <PatientController> logger) { _logger = logger; _patientRepository = patientRepository; _messageRepository = messageRepository; _roomClient = roomClient; }
protected override void ReleaseUnManagedResource() { try { Me.DownMic(); if (RoomClient != null && RoomClient.State == System.ServiceModel.CommunicationState.Opened) { if (RoomClient.GetMusicPlayer(RoomVM.Id) == Me.Id) { RoomClient.DownPlayMusic(RoomVM.Id); } RoomClient.LeaveRoom(RoomVM.Id); RoomClient.Close(); RoomClient = null; } if (RoomCallback != null) { UnRegisterEvents(); } Me.RoomWindowVM = null; ReleaseAudio(); } catch { } base.ReleaseUnManagedResource(); }
private void Awake() { client = GetComponentInParent <RoomClient>(); avatars = new Dictionary <NetworkId, Avatar>(); peers = new Dictionary <NetworkId, PeerInfo>(); localAvatarArgs = new AvatarArgs(); }
public ActionResult ApproveRequest(long IdBooking, int page = 1, int pageSize = 10) { RoomClient RC = new RoomClient(); var model = RC.findRoomAvailable(IdBooking, page, pageSize); ViewBag.IdBooking = IdBooking; return(View(model)); }
private void Start() { if (socialMenu && socialMenu.roomClient && socialMenu.networkScene) { roomClient = socialMenu.roomClient; networkScene = socialMenu.networkScene; roomClient.OnJoinedRoom.AddListener(RoomClient_OnJoinedRoom); } }
private void Awake() { peerConnectionSource = new RTCPeerConnectionSource(); client = GetComponentInParent <RoomClient>(); peerUuidToConnection = new Dictionary <string, VoipPeerConnection>(); OnPeerConnection.SetExisting(peerUuidToConnection.Values); audioSource = CreateAudioSource(); audioSource.StartAudio(); }
public bool ScoreExchange(int userId, int toExchangeScore, int getMoney) { if (RoomClient.ScoreExchange(userId, toExchangeScore, getMoney)) { Me.Score = Me.Score - toExchangeScore; Me.Money = Me.Money + getMoney; return true; } return false; }
/// <summary> /// Init Room Service /// </summary> /// <param name="databaseContext">Database Context</param> /// <param name="mapper">Mapper</param> /// <param name="configuration">Configuration</param> /// <param name="userService">User Service</param> public RoomService(DatabaseContext databaseContext, IMapper mapper, IConfiguration configuration, IUserService userService) : base(databaseContext, mapper) { _mapper = mapper; _userService = userService; _lk_key = configuration["Livekit:key"]; _lk_secret = configuration["Livekit:secret"]; _lk_empty = uint.Parse(configuration["Livekit:emptyTimeout"]); _lk_max = uint.Parse(configuration["Livekit:maxParticipants"]); client = new RoomClient(configuration["Livekit:host"], _lk_key, _lk_secret); }
public void Bind(RoomClient client, IPeer peer, bool isMe) { ClearBinding(); this.roomClient = client; this.peer = peer; this.isMe = isMe; this.peerConnectionManager = VoipPeerConnectionManager.Find(this); OnBind.Invoke(client, peer); }
public void SetUp() { fixture = SparkTestFixture.Instance; Assert.IsNotNull(fixture); //spark = fixture.spark; spark = fixture.CreateSpark(); Assert.IsNotNull(spark); room = spark.Rooms; Assert.IsNotNull(room); }
public void SendGift(int giftGroupId, int giftId, int receiverId, int count) { var group = GiftGroupVMs.FirstOrDefault(g => g.Id == giftGroupId); if (group != null) { var gift = group.GiftVMs.FirstOrDefault(g => g.Id == giftId); if (gift != null) { if (Me.Money > gift.Price * count) { RoomClient.SendGift(RoomVM.Id, receiverId, giftId, count); } } } }
public static void Main(string[] args) { try { // loads the config file RemotingConfiguration.Configure("RoomClient.exe.config", true); } catch (Exception e) { Console.WriteLine(e.Message); } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); rc = new RoomClient(); mf = new MainForm(); Application.Run(mf); }
public void Enter() { if (RoomClient.EnterRoom(RoomVM.Id, ApplicationVM.LocalCache.CurrentUserVM.GetConcretEntity<User>())) { Me.RoomWindowVM = this; RegisterEvents(); timer = new Timer(TimeSpan.FromSeconds(20).TotalMilliseconds); timer.Elapsed += timer_Elapsed; timer.Start(); Messenger.Default.Send<EnumNotificationMessage<object, HallWindowAction>>(new EnumNotificationMessage<object, HallWindowAction>(HallWindowAction.EnterRoomSucceeded, this)); } else { Messenger.Default.Send<EnumNotificationMessage<object, HallWindowAction>>(new EnumNotificationMessage<object, HallWindowAction>(HallWindowAction.EnterRoomFailed, this)); } }
public void MenuClicked(string userId, string cmdId) { int uid = -1; int cid = -1; if (int.TryParse(userId, out uid) && int.TryParse(cmdId, out cid)) { var targetUser = GetUser(uid); if (targetUser != null) { if (Me.HasCommand(RoomVM.Id, cid, targetUser.RoleVM.Id)) { RoomClient.ExecuteCommand(RoomVM.Id, cid, targetUser.Id); } } } }
public void SendChatMessage(string message, int toUserId, bool isPrivate) { RoomMessage msg = new RoomMessage(); msg.MotionMessages = new List<MotionImagesMessage>(); msg.MessageType = isPrivate ? RoomMessageType.PrivateChatMessage : RoomMessageType.PublicChatMessage; msg.SenderId = Me.Id; msg.ReceiverId = toUserId; msg.Content = message; msg.Time = DateTime.Now.ToString(); //int offset = 0; //int firstImgIndex = message.IndexOf("<IMG"); //while (firstImgIndex != -1) //{ // message = message.Substring(firstImgIndex, message.Length - firstImgIndex); // int srcStartIndex = message.IndexOf("\""); // if (srcStartIndex != -1) // { // message = message.Substring(srcStartIndex + 1, message.Length - srcStartIndex - 1); // int srcEndIndex = message.IndexOf("\""); // string path = message.Substring(0, srcEndIndex); // var img = ApplicationVM.LocalCache.AllImages[BuiltIns.SmileImageType.Id].Values.FirstOrDefault( // r => r.StaticImageFile == path); // if (img == null) // customized motion image // { // MotionImagesMessage mImageMsg = new MotionImagesMessage(); // mImageMsg.IsCustomizedImage = true; // mImageMsg.Id = -1; // mImageMsg.Bytes = Utility.GetImageBytesFromFile(path); // mImageMsg.Offset = firstImgIndex + offset; // mImageMsg.Path = path; // msg.MotionMessages.Add(mImageMsg); // } // message = message.Substring(srcEndIndex + 1, message.Length - srcEndIndex - 1); // offset += firstImgIndex + srcStartIndex + 1 + srcEndIndex + 1; // firstImgIndex = message.IndexOf("<IMG"); // } //} RoomClient.SendRoomMessage(RoomVM.Id, msg); }
private void OnMicCommandExecute(SecureCommandArgs args) { if (args != null) { MicType micType = (MicType)args.Content; if (Me.MicStatus == MicStatusMessage.MicStatus_Off) { RoomClient.OnMic(RoomVM.Id, micType, -1); } else { switch (micType) { case MicType.Private: PrivateMicUserVMs.Remove(Me); break; case MicType.Secret: SecretMicUserVMs.Remove(Me); break; case MicType.Public: switch (Me.MicIndex) { case 0: FirstMicUserVM = null; break; case 1: SecondMicUserVM = null; break; case 2: ThirdMicUserVM = null; break; } break; } RoomClient.DownMic(RoomVM.Id, micType, Me.MicIndex); Me.DownMic(); updateMicImage(Me.Id, false);// update the local image manually as the downmic meesage will not be received by itself. } } }
public void Bind(RoomClient client) { Joincode.text = client.Room.JoinCode.ToUpperInvariant(); var image = client.Room["scene-image"]; if (image != null && image != existing) { client.GetBlob(client.Room.UUID, image, (base64image) => { if (base64image.Length > 0) { var texture = new Texture2D(1, 1); texture.LoadImage(Convert.FromBase64String(base64image)); existing = image; ScenePreview.texture = texture; } }); } }
private void Reset() { if (roomClient == null) { roomClient = GetComponentInParent <RoomClient>(); } #if UNITY_EDITOR if (catalogue == null) { try { var asset = UnityEditor.AssetDatabase.FindAssets("Prefab Catalogue").FirstOrDefault(); var path = UnityEditor.AssetDatabase.GUIDToAssetPath(asset); catalogue = UnityEditor.AssetDatabase.LoadAssetAtPath <PrefabCatalogue>(path); } catch { // if the default prefab has gone away, no problem } } #endif }
public void Bind(RoomArgs args, RoomClient client) { Name.text = args.name; SceneName.text = args.properties["scene-name"]; var image = args.properties["scene-image"]; if (image != null && image != existing) { client.GetBlob(args.guid, image, (base64image) => { if (base64image.Length > 0) { var texture = new Texture2D(1, 1); texture.LoadImage(Convert.FromBase64String(base64image)); existing = image; ScenePreview.texture = texture; } }); } room = args; }
public void Bind(IRoom args, RoomClient client) { Name.text = args.Name; Scene.text = args["scene-name"]; ScenePath.text = args["scene-path"]; Uuid.text = args.UUID; var image = args["scene-image"]; if (image != null && image != existing) { client.GetBlob(args.UUID, image, (base64image) => { if (base64image.Length > 0) { var texture = new Texture2D(1, 1); texture.LoadImage(Convert.FromBase64String(base64image)); existing = image; PreviewImage.texture = texture; } }); } }
public void Bind(RoomClient client, IRoom roomInfo) { Name.text = roomInfo.Name; SceneName.text = roomInfo["scene-name"]; var image = roomInfo["scene-image"]; if (image != null && image != existing) { client.GetBlob(roomInfo.UUID, image, (base64image) => { if (base64image.Length > 0) { var texture = new Texture2D(1, 1); texture.LoadImage(Convert.FromBase64String(base64image)); existing = image; ScenePreview.texture = texture; } }); } OnBind.Invoke(client, roomInfo); }
public override void LoadAsync() { //Task.Factory.StartNew(() => // { lock (UserVMs) { var users = RoomClient.GetRoomUsers(RoomVM.Id); if (users != null && users.Length > 0) { foreach (var user in users) { UserEntered(user, false); } } } var micUsers = RoomClient.GetMicUsers(RoomVM.Id, MicType.Public); if (micUsers != null && micUsers.Count > 0) { if (micUsers.ContainsKey(0) && micUsers[0].MicStatus != MicStatusMessage.MicStatus_Off) { FirstMicUserVM = UserVMs.FirstOrDefault(u => u.Id == micUsers[0].UserId); FirstMicUserVM.OnMic(MicType.Public, 0, micUsers[0].StreamGuid, micUsers[0].MicStatus); if ((FirstMicUserVM.MicStatus & MicStatusMessage.MicStatus_Audio) != MicStatusMessage.MicStatus_Off) { StartAudioPlaying(FirstMicUserVM.Id); } } if (micUsers.ContainsKey(1) && micUsers[1].MicStatus != MicStatusMessage.MicStatus_Off) { SecondMicUserVM = UserVMs.FirstOrDefault(u => u.Id == micUsers[1].UserId); SecondMicUserVM.OnMic(MicType.Public, 1, micUsers[1].StreamGuid, micUsers[1].MicStatus); if ((SecondMicUserVM.MicStatus & MicStatusMessage.MicStatus_Audio) != MicStatusMessage.MicStatus_Off) { StartAudioPlaying(SecondMicUserVM.Id); } } if (micUsers.ContainsKey(2) && micUsers[2].MicStatus != MicStatusMessage.MicStatus_Off) { ThirdMicUserVM = UserVMs.FirstOrDefault(u => u.Id == micUsers[2].UserId); ThirdMicUserVM.OnMic(MicType.Public, 2, micUsers[2].StreamGuid, micUsers[2].MicStatus); if ((ThirdMicUserVM.MicStatus & MicStatusMessage.MicStatus_Audio) != MicStatusMessage.MicStatus_Off) { StartAudioPlaying(ThirdMicUserVM.Id); } } } micUsers = RoomClient.GetMicUsers(RoomVM.Id, MicType.Private); if (micUsers != null && micUsers.Count > 0) { foreach (var mic in micUsers.Values) { if (mic.MicStatus != MicStatusMessage.MicStatus_Off) { var uvm = UserVMs.FirstOrDefault(u => u.Id == mic.UserId); if (uvm != null) { PrivateMicUserVMs.Add(uvm); uvm.OnMic(MicType.Private, mic.MicIndex, mic.StreamGuid, mic.MicStatus); if ((uvm.MicStatus & MicStatusMessage.MicStatus_Audio) != MicStatusMessage.MicStatus_Off) { StartAudioPlaying(uvm.Id); } } } } } micUsers = RoomClient.GetMicUsers(RoomVM.Id, MicType.Secret); if (micUsers != null && micUsers.Count > 0) { foreach (var mic in micUsers.Values) { if (mic.MicStatus != MicStatusMessage.MicStatus_Off) { var uvm = UserVMs.FirstOrDefault(u => u.Id == mic.UserId); if (uvm != null) { SecretMicUserVMs.Add(uvm); uvm.OnMic(MicType.Secret, mic.MicIndex, mic.StreamGuid, mic.MicStatus); if ((uvm.MicStatus & MicStatusMessage.MicStatus_Audio) != MicStatusMessage.MicStatus_Off) { StartAudioPlaying(uvm.Id); } } } } } RoomMessage msg = RoomClient.GetRoomMessage(RoomMessageType.GiftMessage); if (msg != null) { UserViewModel sender = null; UserViewModel receiver = null; lock (UserVMs) { sender = UserVMs.FirstOrDefault(u => u.Id == msg.SenderId); if (sender == null) { sender = ApplicationVM.LocalCache.AllUserVMs[msg.SenderId]; if (sender == null) { var usr = RoomClient.GetUser(msg.SenderId); if (usr != null) { sender = new UserViewModel(usr); sender.Initialize(); ApplicationVM.LocalCache.AllUserVMs[msg.SenderId] = sender; } } else { if (!sender.IsInitialized) { sender.Initialize(); } } } receiver = UserVMs.FirstOrDefault(u => u.Id == msg.ReceiverId); if (receiver == null) { receiver = ApplicationVM.LocalCache.AllUserVMs[msg.ReceiverId]; if (receiver == null) { var usr = RoomClient.GetUser(msg.ReceiverId); if (usr != null) { receiver = new UserViewModel(usr); receiver.Initialize(); ApplicationVM.LocalCache.AllUserVMs[msg.ReceiverId] = receiver; } } else { if (!receiver.IsInitialized) { receiver.Initialize(); } } } } GiftViewModel gift = ApplicationVM.LocalCache.AllGiftVMs.FirstOrDefault(g => g.Id == msg.ItemId); if (sender != null && receiver != null && gift != null) { string header = "<img title='" + sender.RoleVM.Name + "' src='" + sender.ImageVM.StaticImageFile + "'><u style='color:gold;margin-right:10px'><span onclick='window.external.SelectUser(" + sender.Id + ")'" + " oncontextmenu='window.external.SelectUser(" + sender.Id + ")'/>" + sender.NickName + "(" + sender.Id + ")" + "</span></u></img> 送给 " + "<img title='" + receiver.RoleVM.Name + "' src='" + receiver.ImageVM.StaticImageFile + "'><u style='color:purple;margin-left:10px;margin-right:10px'><span onclick='window.external.SelectUser(" + receiver.Id + ")'" + "oncontextmenu='window.external.SelectUser(" + receiver.Id + ")'/>" + receiver.NickName + "(" + receiver.Id + ")" + "</span></u></img>"; string htmlmsg = string.Empty; htmlmsg += "<img style='margin-left:20px;margin-right:20px;' src='" + gift.ImageVM.DynamicImageFile + "'/>"; htmlmsg += header + msg.Count + gift.Unit + gift.Name + "<span style='color:blue'>" + msg.Time + "</span>"; CallJavaScript("ScrollMessage", htmlmsg); } } XmlLanguage enus = XmlLanguage.GetLanguage("en-us"); XmlLanguage zhcn = XmlLanguage.GetLanguage("zh-cn"); string fontname = ""; foreach (FontFamily fontfamily in Fonts.SystemFontFamilies) { if (fontfamily.FamilyNames.ContainsKey(zhcn)) { fontfamily.FamilyNames.TryGetValue(zhcn, out fontname); FontFamilies.Insert(0, fontname); } else if (fontfamily.FamilyNames.ContainsKey(enus)) { fontfamily.FamilyNames.TryGetValue(enus, out fontname); FontFamilies.Add(fontname); } } FontSizes.Add(14); FontSizes.Add(16); FontSizes.Add(18); FontSizes.Add(20); FontSizes.Add(22); FontSizes.Add(24); FontSizes.Add(28); FontSizes.Add(32); FontSizes.Add(36); CallJavaScript("InitUsers", UsersJson); CallJavaScript("InitFonts", FontFamiliesJson, FontSizesJson); CallJavaScript("InitStamp", StampImagesJson); for (int i = 0; i < MotionImagesJson.Count; i++) { CallJavaScript("InitFaceTab", MotionImagesJson[i], i == MotionImagesJson.Count - 1); } CallJavaScript("InitMoneyForHorn", ApplicationVM.LocalCache.HornMsgMoney, ApplicationVM.LocalCache.HallHornMsgMoney, ApplicationVM.LocalCache.GlobalHornMsgMoney); int scoreToMoney = 0; if (ApplicationVM.LocalCache.AllExchangeRateVMs.Count > 0) { try { var exchangeVM = ApplicationVM.LocalCache.AllExchangeRateVMs.OrderBy(r => r).Where(r => Convert.ToDateTime(r.ValidTime) >= (DateTime.Now)).ToList().FirstOrDefault(); if (exchangeVM != null) { scoreToMoney = exchangeVM.ScoreToMoney; } } catch (Exception ex) { } } CallJavaScript("InitExchangeRate", scoreToMoney); //}); }
private void PlayMusicCommandExecute(SecureCommandArgs args) { bool canPlay = RoomClient.OnPlayMusic(RoomVM.Id, Me.Id); Messenger.Default.Send <EnumNotificationMessage <object, RoomWindowAction> >(new EnumNotificationMessage <object, RoomWindowAction>(RoomWindowAction.PlayMusic, canPlay)); }
static void Main(string[] args) { //Service1Client client = new Service1Client("BasicHttpBinding_IService1"); //WCFATest.CompositeType value = new WCFATest.CompositeType(); //value.BoolValue = true; //value.StringValue = "TEST!!!!"; //String reString = client.GetData(333); //WCFATest.CompositeType reComposite = client.GetDataUsingDataContract(value); ChannelFactory<IRoom> factory = new ChannelFactory<IRoom>(new ServiceEndpoint( ContractDescription.GetContract(typeof(IRoom)), new NetTcpBinding(), new EndpointAddress(new Uri("net.tcp://localhost/wcf/roomwcfservice")))); String result; try { TRADE_SEARCH_INFO search = new TRADE_SEARCH_INFO(); search.item_index = 1; search.category = 1; search.kind = 1; search.section = 1; search.item_rank = 1; search.req_level = 1; search.page_no = 1; search.page_size = 1; Trade trade = new Trade(); //try //{ System.Xml.XmlNode node = trade.GetTradeListInfo( search ); //} //catch( Exception e ) //{ // Console.WriteLine( e.Message ); //} RoomService.RoomSearchKey key = new RoomService.RoomSearchKey(); key._category = 1; key._location_main = 2; key._location_sub = 3; //IRoom proxy = factory.CreateChannel(); //ROOM_RESULT rr2 = proxy.CreateRoomDb("9CA1A2F4-AA7C-462C-96D2-1F5FE26D691D", key, "첫방", "아무나오지말고", "1111111", 10); //(proxy as IDisposable).Dispose(); RoomClient test = new RoomClient("BasicHttpBinding_IRoom"); RoomClient testTcp = new RoomClient("NetTcpBinding_IRoomLocal"); ROOM_RESULT rr = new ROOM_RESULT(); String resultString = test.Test2("콜콜"); ROOM_RESULT test2 = test.Test("UISEREWRWERWE"); bool test3 = test.LoginUser("test_userno1", "*****@*****.**", "최진혁", new DateTime(), 1, "wefwefwefwe"); bool test4 = test.LoginUser("test_userno2", "*****@*****.**", "두번째", new DateTime(), 1, "wefwefwefwe"); JOIN_ROOM_DETAIL detail = test.GetLoginUser(); ROOM_INFO_LIST room_info_list = test.MyRoomList(" TEST"); ROOM_RESULT result12 = test.CreateRoomDb("410fba26-f787-421e-9bbe-1e13f9866da8", key, "내방은", "아무나와요", "1111111", 10); //ROOM_RESULT result12 = test.CreateRoomDb("9CA1A2F4-AA7C-462C-96D2-1F5FE26D691D", key, "웹에서", "아무나오지말고", "1111111", 10); //410fba26-f787-421e-9bbe-1e13f9866da8 //ROOM_RESULT result111 = test.Push("f34d46277322e73b8e67b23c8339158a1621f1c49a05127fd839e4d0f7c4f6c6", "좋다", 1); IRoom proxy = factory.CreateChannel(); //ROOM_RESULT rr2 = proxy.Push("f34d46277322e73b8e67b23c8339158a1621f1c49a05127fd839e4d0f7c4f6c6", "잇힝", 1); ROOM_RESULT rr2 = proxy.Push("a2df3ffc3a216b535907d042412c75694a704a82d18d61ab85d081d06073e857", "잇힝", 1); (proxy as IDisposable).Dispose(); } catch (FaultException<RoomService.MyFaultException> ee) { result = "Exception : " + ee.Detail.Reason ; Console.WriteLine(result); } }
private void Awake() { client = GetComponentInParent <RoomClient>(); peerUUIDToConnection = new Dictionary <string, WebRtcPeerConnection>(); }
private void Awake() { client = GetComponentInParent <RoomClient>(); boids = new Dictionary <int, Boids>(); }
private void BrowseRoomControl_OnBind(RoomClient roomClient, IRoom roomInfo) { this.roomClient = roomClient; this.joincode = roomInfo.JoinCode; }
public void SetPerformer(RoomClient performer) { Performer = performer; }
private void timer_Elapsed(object sender, ElapsedEventArgs e) { RoomClient.KeepAlive(); }
private void Awake() { client = GetComponentInParent <RoomClient>(); }
public void SendGlobalHornMsg(string message) { RoomMessage msg = InitAnnouncementMsg(RoomMessageType.GlobalHornMessage, message); RoomClient.SendRoomMessage(RoomVM.Id, msg); }