/// <summary> /// This method is used for Desktop-Sharing for particular receiver id. /// Currently, our application not doing this functionality as we have omitted the /// functionality of desktop-share. /// This function do two things /// First Send message to specified client /// Second Log either Desktop Sharing is Stopped/Started. /// </summary> /// <param name="obj">This is of type MessageObject</param> /// <param name="receiverConnectionID"></param> public void SendPrivateChatMessage(MessageObject obj,int receiverConnectionID) { ClientProfile cp = (ClientProfile)ClientList[receiverConnectionID]; if(cp != null) { IMessageReceiver iMessageReceiver = (IMessageReceiver) Activator.GetObject(typeof(IMessageReceiver), cp.clientURI); iMessageReceiver.ReceiveMessage(obj); // break; } /////////////Transcript if(obj.GetType().Equals(typeof(DesktopSharingControlMessage )) ) { DesktopSharingControlMessage DesktopMsg = (DesktopSharingControlMessage)obj; string curDate= DateTime.Now.Year + "-" + DateTime.Now.Month +"-" + DateTime.Now.Day + " " + DateTime.Now.Hour + ":" + DateTime.Now.Minute + ":" + DateTime.Now.Second; if(DesktopMsg.Start == true && DesktopMsg.Status == 2) { // new desktop sharing has started. addFlowMsgs(DesktopMsg.ConferenceID, curDate , DesktopMsg.senderID+" client id : has started new Desktop sharing " , "Launch Events" ); } else if(DesktopMsg.Start == false && DesktopMsg.Status == -1) { // desktop sharing has closed. addFlowMsgs(DesktopMsg.ConferenceID, curDate , DesktopMsg.SenderID+" client id : has Closed Desktop sharing ", "Launch Events" ); } } }
/// <summary> /// Sends message to all clients. /// </summary> /// <param name="message">Message to send.</param> /// <returns>Number of clients having received this message.</returns> public void SendLoggedMessage(MessageObject message) { // fetch the nickname //string nickname = GenuineUtility.CurrentSession["Nickname"] as string; //Console.WriteLine("Message \"{0}\" will be sent to all clients from {1}.", message, nickname); //IMessageReceiver iMessageReceiver = (IMessageReceiver) this._dispatcher.TransparentProxy; // Zaeem view /// This code should be commented /// if(message.GetType() == typeof(DocumentSharing)) { int x = ((DocumentSharing)message).sessionID; Object obj = DocumentSharingList[x]; if(obj == null) DocumentSharingList.Add(((DocumentSharing)message).sessionID,message); else DocumentSharingList[x] = message; } else if(message.GetType() == typeof(DrawingClearMessage)) { try { DrawingClearMessage dMsg = (DrawingClearMessage)message; if(dMsg.m_ControlType == ControlType.DrawingBoard) { for(int i = LoggedMessages.Count -1 ; i >= 0 ; i --) { MessageObject objMsg = (MessageObject)LoggedMessages[i]; if(objMsg.GetType().Equals(typeof(StateUpdateMessage))) { if(((StateUpdateMessage)objMsg).updateType == UpdateTypeCode.UpdateWhiteboard) { LoggedMessages.Remove(objMsg); } } } } } catch(Exception ee) { } } else if(message.GetType() == typeof(MsgWebBrowseMessage)) { MsgWebBrowseMessage msg = (MsgWebBrowseMessage)message; Object obj = WebBrowserList[msg.webBrowseID]; if(obj == null) WebBrowserList.Add(msg.webBrowseID,message); else WebBrowserList[msg.webBrowseID] = message; } else if(message.GetType().Equals(typeof(StateUpdateMessage))) { StateUpdateMessage msg = (StateUpdateMessage )message; if(msg.updateType != UpdateTypeCode.UpdateAppsharingannotations) LoggedMessages.Add(message); } else if(message.GetType().Equals(typeof(TabPagesSyncrhonizationMsessage))) { msgSynchronization = (TabPagesSyncrhonizationMsessage)message; } else LoggedMessages.Add(message); if(message.GetType() == typeof(ControlMessage)) { ControlMessage tempMessage = (ControlMessage) message; if(tempMessage.Code == ControlCode.AttendeeUpdate) { ClientProfile prof = (ClientProfile)tempMessage.Parameter;// = profile; foreach(ClientProfile cp in ClientList.Values) { if(prof.ClientId == cp.ClientId) { ClientList.Remove(prof.ClientId); ClientList.Add(prof.ClientId,prof); //GenuineUtility.CurrentSession["Profile"] = prof; break; } } } else if(tempMessage.Code == ControlCode.PresenterClosedConference) { CloseConference(tempMessage); } else if(tempMessage.Code == ControlCode.PresenterKickedPerson) { ClientProfile prof = (ClientProfile)tempMessage.Parameter;// = profile; IMessageReceiver iMessageReceiver = (IMessageReceiver) Activator.GetObject(typeof(IMessageReceiver), prof.clientURI); if(iMessageReceiver != null) { iMessageReceiver.ReceiveMessage(tempMessage); LoggedMessages.Remove(message); return; } } } ((IMessageReceiver) this._dispatcher.TransparentProxy).ReceiveMessage(message); }
public void SendNonLoggedMessage( MessageObject message) { try { ((IMessageReceiver) this._dispatcher.TransparentProxy).ReceiveMessage(message); ///////////////////////////////////////TRANSCRIPT/////////////////////// string curDate= DateTime.Now.Year + "-" + DateTime.Now.Month +"-" + DateTime.Now.Day + " " + DateTime.Now.Hour + ":" + DateTime.Now.Minute + ":" + DateTime.Now.Second; if(message.GetType().Equals(typeof(DocumentSharing))) { //DocumentSharing Message = (DocumentSharing)message; if((((DocumentSharing)message).bEnabled== false) && hashCurSlide.Contains(((DocumentSharing)message).sessionID) == true ) { hashCurSlide.Remove( ((DocumentSharing)message).sessionID ); //isFirstSlide = true; //document sharing close addFlowMsgs(((DocumentSharing)message).ConferenceID ,curDate , ((DocumentSharing)message).senderProfile.Name +" : has closed the document sharing where document id is "+ ((DocumentSharing)message).sessionID, "Launch Events" ); } else if( (((DocumentSharing)message).bEnabled== true)&& hashCurSlide.Contains(((DocumentSharing)message).sessionID) == false) /*if(control.sessionID == Message.sessionID)*/ { object obj=new object(); hashCurSlide.Add( ((DocumentSharing)message).sessionID, obj ); //hashCurSlide[((DocumentSharing)message).sessionID] //isFirstSlide = false; //document sharing start addFlowMsgs(((DocumentSharing)message).ConferenceID ,curDate , ((DocumentSharing)message).senderProfile.Name +" : has started the document sharing where document id is "+ ((DocumentSharing)message).sessionID, "Launch Events" ); } //iPrevSlide = ((DocumentSharing)message).CurrentPage; addFlowMsgs(((DocumentSharing)message).ConferenceID ,curDate , ((DocumentSharing)message).senderProfile.Name +" : has changed Slide, Current Slide is " + ((DocumentSharing)message).CurrentPage + " where document id is "+ ((DocumentSharing)message).sessionID ,"Slide Changes" ); } else if(message.GetType().Equals(typeof(WhiteboardMessage))) { //WhiteboardMessage whiteBoardMsg = (WhiteboardMessage)message; if((message.MessageType & (ushort)MessageObjectType.MsgHideWhiteBoard) == (ushort)MessageObjectType.MsgHideWhiteBoard) { // whiteboard closed addFlowMsgs(((WhiteboardMessage)message).ConferenceID, curDate , ((WhiteboardMessage)message).SenderID +" client id :has closed the Whiteboard ", "Launch Events" ); } else if((message.MessageType & (ushort)MessageObjectType.MsgShowWhiteBoard) == (ushort)MessageObjectType.MsgShowWhiteBoard) { // whiteboard opened addFlowMsgs(((WhiteboardMessage)message).ConferenceID, curDate , ((WhiteboardMessage)message).SenderID +" client id :has opened the Whiteboard ", "Launch Events" ); } // else if((message.MessageType & (ushort)MessageObjectType.MsgAppSharingAnnotation) == (ushort)MessageObjectType.MsgAppSharingAnnotation) // { // } // else if((message.MessageType & (ushort)MessageObjectType.MsgWhiteboard) == (ushort)MessageObjectType.MsgWhiteboard) // { // //ClientUI.getInstance().JustOpenWhiteBoard(); // } // else // ClientUI.getInstance().whiteBoard.eventStore.Add(message); // } /*else if(message.GetType().Equals(typeof(DrawingClearMessage))) { DrawingClearMessage CMessage = (DrawingClearMessage)message; if(CMessage.m_ControlType == ControlType.ApplicationSharing) { //clear all drawing from application sharing addFlowMsgs(message.ConferenceID ,curDate , CMessage.sessionID+" client id : has erased all drawing of application sharing "); } else if(CMessage.m_ControlType == ControlType.DrawingBoard) { //clear all drawing from application DrawingBoard addFlowMsgs(message.ConferenceID ,curDate , CMessage.sessionID +" client id : has erased all drawing of white Board "); } else if(CMessage.m_ControlType == ControlType.Browser) { //clear all drawing from application Browser addFlowMsgs(message.ConferenceID ,curDate , CMessage.sessionID+" client id : has erased all drawing of Browser "); } else if(CMessage.m_ControlType == ControlType.DocumentSharing) { //clear all drawing from application DocumentSharing addFlowMsgs(message.ConferenceID ,curDate , CMessage.sessionID +" client id : has erased all drawing of Document Sharing "); } }*/ else if(message.GetType().Equals(typeof(MsgWebBrowseMessage))) { //MsgWebBrowseMessage webBrowse = (MsgWebBrowseMessage)message if( ((MsgWebBrowseMessage)message).active ) { // new web browser has shared. addFlowMsgs(((MsgWebBrowseMessage)message).ConferenceID, curDate , ((MsgWebBrowseMessage)message).SenderID +" client id : has shared new web browser : id = " + ((MsgWebBrowseMessage)message).webBrowseID , "Launch Events" ); } else { // close web browser has shared. addFlowMsgs(((MsgWebBrowseMessage)message).ConferenceID, curDate , ((MsgWebBrowseMessage)message).SenderID +" client id : has closed web browser : id = " + ((MsgWebBrowseMessage)message).webBrowseID , "Launch Events" ); } } else if(message.GetType().Equals(typeof(IMChatMessage))) { IMChatMessage chatMsg = (IMChatMessage)message; Net.Sgoliver.NRtfTree.RtfTree objRTF = new Net.Sgoliver.NRtfTree.RtfTree(); objRTF.LoadRtfText(chatMsg.IMMessage); RtfTreeNode root = objRTF.RootNode; RtfTreeNode node = new RtfTreeNode(); string strText=""; for(int i = 0; i < root.FirstChild.ChildNodes.Count; i++) { node = root.FirstChild.ChildNodes[i]; if(node.NodeType == RTF_NODE_TYPE.TEXT) { strText += node.NodeKey.ToString(); } } if ((message.MessageType & MessageObject.BroadcastMessageFlag) == 0) { //this is a private message addFlowMsgs(chatMsg.ConferenceID,curDate , chatMsg.sender + " says : " + strText + " (private message for)" + chatMsg.RecipientId.ToString(), "Chat" ); } else { //this is a global message addFlowMsgs(chatMsg.ConferenceID ,curDate , chatMsg.sender +" says : "+ strText , "Chat" ); } } else if(message.GetType().Equals(typeof(StateUpdateMessage))) { for(int i=0; i<((WebMeeting.Common.StateUpdateMessage)(message)).dataArray.Count ; i++) { if ( ((MessageObject ) ((WebMeeting.Common.StateUpdateMessage)(message)).dataArray[i]).GetType().Equals( typeof(AppSharingMessageEx))) { AppSharingMessageEx appMsg = (AppSharingMessageEx) ((MessageObject ) ((WebMeeting.Common.StateUpdateMessage)(message)).dataArray[i]); if(appMsg.isDesktopshareing == false ) { if(appMsg.bEnabled == true ) { if(bAppShared == false ) { bAppShared = true; // new app sharing has started. addFlowMsgs(appMsg.ConferenceID , curDate , appMsg.SenderID+" client id : has started new Application sharing " , "Launch Events" ); } } else { if(bAppShared == true ) { bAppShared = false; // new desktop sharing has closed. addFlowMsgs(appMsg.ConferenceID , curDate , appMsg.SenderID+" client id : has Closed Application sharing " , "Launch Events" ); } } } } } } else if(message.GetType().Equals(typeof(AppSharingMessageEx))) { AppSharingMessageEx appMsg = (AppSharingMessageEx)message ; if(appMsg.isDesktopshareing == false ) { if(appMsg.bEnabled == true ) { if(bAppShared == false ) { bAppShared = true; // new app sharing has started. addFlowMsgs(appMsg.ConferenceID , curDate , appMsg.SenderID+" client id : has started new Application sharing " , "Launch Events" ); } } else { if(bAppShared == true ) { bAppShared = false; // new app sharing has closed. addFlowMsgs(appMsg.ConferenceID , curDate , appMsg.SenderID+" client id : has Closed Application sharing " , "Launch Events" ); } } } } else if(message.GetType().Equals(typeof(QAQuestion))) { addFlowMsgs( ((QAQuestion)message).senderProfile.ConferenceID , curDate , ((QAQuestion)message).senderProfile.Name +" has asked Question: " + ((QAQuestion)message).Question + " ? " , "Attendee Question" ); } else if(message.GetType().Equals(typeof(QAAnswer))) { addFlowMsgs( ((QAAnswer)message).senderProfile.ConferenceID , curDate , ((QAAnswer)message).senderProfile.Name +" has Answered : " + ((QAAnswer)message).Answer + " , where Question is : "+ ((QAAnswer)message).Question + " ? " , "Attendee Question" ); } else if(message.GetType().Equals(typeof(NewPollMessage))) { /*addFlowMsgs( ((NewPollMessage)message).ConferenceID , curDate , ((NewPollMessage)message).hostID +" client id : has polled : " + ((NewPollMessage)message).Question , "Polling Questions" ); */ } else if(message.GetType().Equals(typeof(PollAnswerMessage))) { addFlowMsgs2( ((PollAnswerMessage)message).ConferenceID, curDate, ((PollAnswerMessage)message).questiontext,((PollAnswerMessage)message).choiceText,((PollAnswerMessage)message).clientID.ToString() , ((PollAnswerMessage)message).clientName , ((PollAnswerMessage)message).pollType.ToString(), ((PollAnswerMessage)message).choices); } } catch(Exception ex) { ex=ex; } }