public IGAnswerFrameChanged(IGConnectionLocal connection, XmlDocument xmlDoc)
     : base(connection, xmlDoc, "frame changed")
 {
 }
 public int ConnectUser(string sUser, string sGuid, out IGConnectionLocal userConnection)
 {
     userConnection = null;
     if (!checkUserName(ref sUser))
         return (int)IGSMAnswer.IGSMANSWER_ERROR_CODE.IGSMANSWER_ERROR_WRONGUSERNAME;
     IGConnection connection;
     int nResult = GetConnection(sUser, out connection);
     if (nResult != (int)IGSMAnswer.IGSMANSWER_ERROR_CODE.IGSMANSWER_ERROR_USERNOTFOUND)
     {
         userConnection = (IGConnectionLocal)connection;
         if (nResult == (int)IGSMAnswer.IGSMANSWER_ERROR_CODE.IGSMANSWER_ERROR_USERCONNECTING)
             return (int)IGSMAnswer.IGSMANSWER_ERROR_CODE.IGSMANSWER_ERROR_USERCONNECTING;
         else
             return (int)IGSMAnswer.IGSMANSWER_ERROR_CODE.IGSMANSWER_ERROR_USERALREADYCONNECTED;
     }
     foreach (IGConnectionLocal localConnection in m_lConnections)
     {
         if (!localConnection.IsUserConnected())
         {
             userConnection = localConnection;
             return localConnection.ConnectUser(sUser, sGuid);
         }
     }
     return (int)IGSMAnswer.IGSMANSWER_ERROR_CODE.IGSMANSWER_ERROR_TOOMANYUSERS;
 }
Esempio n. 3
0
 public IGAnswerFailed(IGConnectionLocal connection, XmlDocument xmlDoc)
     : base(connection, xmlDoc, "request failed")
 {
 }
Esempio n. 4
0
 public override IGConnection CreateConnection()
 {
     m_connection = new IGConnectionLocal(this);
     return m_connection;
 }
Esempio n. 5
0
 public IGAnswerFrameDone(IGConnectionLocal connection, XmlDocument xmlDoc)
     : base(connection, xmlDoc, "done")
 {
 }
Esempio n. 6
0
 public IGAnswerUser(IGConnectionLocal connection, int nAnswerId, string sAnswerString)
     : base(IGANSWER_XMLTEMPLATE, nAnswerId, sAnswerString)
 {
     m_connection = connection;
     if (m_connection != null)
     {
         m_sUser = m_connection.GetName();
         SetAttribute(IGANSWER_USERLOGIN, m_sUser);
     }
 }
Esempio n. 7
0
 public IGAnswerProgress(IGConnectionLocal connection, XmlDocument xmlDoc)
     : base(connection, xmlDoc, "progressing")
 {
 }
Esempio n. 8
0
 public void Init(IGConnectionLocal userConnection)
 {
     IGSMStatusUser userStatus = userConnection.GetUserStatus();
     if (userStatus != null)
     {
         SetParameter(IGSMSTATUS_SESSIONLENGTH, userStatus.m_nSessionLength.ToString());
         SetParameter(IGSMSTATUS_IDLETIME, userStatus.m_nIdleTime.ToString());
         SetParameter(IGSMSTATUS_STATUS, ((int)userStatus.m_eStatus).ToString());
         IGRequestProcessing imProcUser = IGRequestProcessing.GetUserRequest(userStatus.m_sUser);
         SetParameter(IGSMSTATUS_PROGRESS, ((imProcUser == null) || (imProcUser.GetProgress() < 0)) ? "-" : imProcUser.GetProgress().ToString() + "%");
         SetParameter(IGSMSTATUS_LASTREQ, (userStatus.m_nLastReqId > 0) ? userStatus.m_nLastReqId.ToString() : "None");
         List<string> lsImages = new List<string>();
         lock (userStatus.m_lsImages)
         {
             lsImages.AddRange(userStatus.m_lsImages);
         }
         foreach (string sImage in lsImages)
         {
             XmlNode imageNode = m_xmlDoc.CreateNode(XmlNodeType.Element, IGSMSTATUS_IMAGE, null);
             XmlAttribute newAttImageId = m_xmlDoc.CreateAttribute(IGRequest.IGREQUEST_FRAMEID);
             newAttImageId.Value = sImage;
             imageNode.Attributes.Append(newAttImageId);
             IGRequestProcessing imProc = IGRequestProcessing.GetImageRequest(sImage);
             XmlAttribute newAttProgress = m_xmlDoc.CreateAttribute(IGSMSTATUS_PROGRESS);
             newAttProgress.Value = ((imProc == null) || (imProc.GetProgress() < 0)) ? "-" : imProc.GetProgress().ToString() + "%";
             imageNode.Attributes.Append(newAttProgress);
             XmlAttribute newAttStatus = m_xmlDoc.CreateAttribute(IGSMSTATUS_STATUS);
             int nStatus = (imProc == null) ? (int)IGState.IGSMSTATUS_READY : (int)imProc.GetStatus();
             newAttStatus.Value = nStatus.ToString();
             imageNode.Attributes.Append(newAttStatus);/*
             XmlAttribute newAttLastReq = m_xmlDoc.CreateAttribute(IGSMSTATUS_LASTREQ);
             newAttLastReq.Value = (userStatus.m_nLastReqId > 0) ? userStatus.m_nLastReqId.ToString() : "None";
             imageNode.Attributes.Append(newAttLastReq);*/
             m_xmlNodeAnswer.AppendChild(imageNode);
         }
     }
 }
Esempio n. 9
0
 public IGAnswerDisconnected(IGConnectionLocal connection)
     : base(connection, (int)IGANSWER_ID.IGANSWER_WORKSPACE_DISCONNECTED, "")
 {
 }
Esempio n. 10
0
 public IGAnswerPong(IGConnectionLocal connection, XmlDocument xmlDoc)
     : base(connection, xmlDoc, "pong")
 {
 }
Esempio n. 11
0
 public IGAnswerHearthbeat(IGConnectionLocal connection, XmlDocument xmlDoc)
     : base(connection, xmlDoc, "hearthbeat")
 {
 }
Esempio n. 12
0
 public IGAnswerDisconnected(IGConnectionLocal connection, XmlDocument xmlDoc)
     : base(connection, xmlDoc, "disconnected from server")
 {
 }
Esempio n. 13
0
 public IGAnswerFrameDone(IGConnectionLocal connection, XmlDocument xmlDoc, string sAnswerName)
     : base(connection, xmlDoc, sAnswerName)
 {
 }
 public int DisconnectUser(string sUser, string sGuid, out IGConnectionLocal userConnection)
 {
     userConnection = null;
     IGConnection connection = null;
     int nResult = GetConnection(sUser, out connection);
     if (nResult != IGSMAnswer.IGSMANSWER_ERROR_NONE)
         return nResult;
     userConnection = (IGConnectionLocal)connection;
     IGSMStatusUser statusUser = userConnection.GetUserStatus();
     if (statusUser.m_eStatus != IGSMStatusUser.IGState.IGSMSTATUS_READY)
     {
         nResult = (int)IGSMAnswer.IGSMANSWER_ERROR_CODE.IGSMANSWER_ERROR_SERVERBUSY;
         userConnection.Reset(sGuid);
     }
     else
         userConnection.DisconnectUser(sGuid);
     return nResult;
 }
Esempio n. 15
0
 public IGAnswerPropertyChanged(IGConnectionLocal connection, XmlDocument xmlDoc)
     : base(connection, xmlDoc, "Property changed")
 {
 }
Esempio n. 16
0
 public IGSMStatusUser(IGConnectionLocal userConnection)
     : base(userConnection.GetName())
 {
     Init(userConnection);
 }
Esempio n. 17
0
 public IGAnswerUser(IGConnectionLocal connection, XmlDocument xmlDoc, string sAnswerString)
     : base(xmlDoc, sAnswerString)
 {
     m_connection = connection;
     XmlNode xmlNodeAnswer = m_xmlDoc.SelectSingleNode(IGANSWER_NODENAME);
     XmlNode xmlNodeUser = xmlNodeAnswer.Attributes.GetNamedItem(IGANSWER_USERLOGIN);
     m_sUser = xmlNodeUser.Value;
 }
Esempio n. 18
0
 public IGSMRequestUser(string sName, int nReqId, IGConnectionLocal connection)
     : base(sName, nReqId)
 {
     if (connection != null)
         m_TCPOutput = connection.m_TCPclient;
 }
Esempio n. 19
0
 public IGAnswerConnected(IGConnectionLocal connection, XmlDocument xmlDoc)
     : base(connection, xmlDoc, IGANSWERCONNECTED_STRING)
 {
 }