Exemplo n.º 1
0
    public static void CalcCharacterOperateError(Resp resp)
    {
        if (resp == Resp.TYPE_NO || resp == Resp.TYPE_YES)
        {
            return;
        }
        string       key = resp.ToString();
        DLocalString db  = ReadCfgLocalString.GetDataById(key);

        if (db == null)
        {
            return;
        }
        GTItemHelper.ShowTip(db.Value);
    }
Exemplo n.º 2
0
        //
        // Make external XMLRPC request
        //
        private Hashtable GenericXMLRPCRequest(Hashtable ReqParams, string method)
        {
            if (m_debug)
            {
                m_log.DebugFormat("[{0}]: GenericXMLRPCRequest Method:{1}", m_moduleName, method);
            }
            ArrayList SendParams = new ArrayList();

            SendParams.Add(ReqParams);

            // Send Request
            XmlRpcResponse Resp;

            try
            {
                XmlRpcRequest Req = new XmlRpcRequest(method, SendParams);
                Resp = Req.Send(m_SearchServer, 30000);
                if (m_debug)
                {
                    string reqDebug = Resp.ToString();
                    m_log.DebugFormat("[{0}]: Answer from SearchServer: {1}", m_moduleName, reqDebug);
                }
            }
            catch (WebException ex)
            {
                m_log.ErrorFormat("[{0}]: (1) Unable to connect to Search Server {1}.  Exception {2}", m_moduleName, m_SearchServer, ex);

                Hashtable ErrorHash = new Hashtable();
                ErrorHash["success"]      = false;
                ErrorHash["errorMessage"] = "Unable to search at this time. ";
                ErrorHash["errorURI"]     = "";

                return(ErrorHash);
            }
            catch (SocketException ex)
            {
                m_log.ErrorFormat("[{0}]: (2) Unable to connect to Search Server {1}. Exception {2}", m_moduleName, m_SearchServer, ex);

                Hashtable ErrorHash = new Hashtable();
                ErrorHash["success"]      = false;
                ErrorHash["errorMessage"] = "Unable to search at this time. ";
                ErrorHash["errorURI"]     = "";

                return(ErrorHash);
            }
            catch (XmlException ex)
            {
                m_log.ErrorFormat("[{0}]: (3GetHashCode) Unable to connect to Search Server {1}. Exception {2}", m_moduleName, m_SearchServer, ex.GetHashCode());
                m_log.ErrorFormat("[{0}]: (3data) Unable to connect to Search Server {1}. Exception {2}", m_moduleName, m_SearchServer, ex.GetType());
                m_log.ErrorFormat("[{0}]: (3HelpLink) Unable to connect to Search Server {1}. Exception {2}", m_moduleName, m_SearchServer, ex.HelpLink);
                m_log.ErrorFormat("[{0}]: (3InnerException) Unable to connect to Search Server {1}. Exception {2}", m_moduleName, m_SearchServer, ex.InnerException);
                m_log.ErrorFormat("[{0}]: (3LineNumber) Unable to connect to Search Server {1}. Exception {2}", m_moduleName, m_SearchServer, ex.LineNumber);
                m_log.ErrorFormat("[{0}]: (3LinePosition) Unable to connect to Search Server {1}. Exception {2}", m_moduleName, m_SearchServer, ex.LinePosition);
                m_log.ErrorFormat("[{0}]: (3Source) Unable to connect to Search Server {1}. Exception {2}", m_moduleName, m_SearchServer, ex.Source);
                m_log.ErrorFormat("[{0}]: (3SourceUri) Unable to connect to Search Server {1}. Exception {2}", m_moduleName, m_SearchServer, ex.SourceUri);
                m_log.ErrorFormat("[{0}]: (3StackTrace) Unable to connect to Search Server {1}. Exception {2}", m_moduleName, m_SearchServer, ex.StackTrace);
                m_log.ErrorFormat("[{0}]: (3TargetSite) Unable to connect to Search Server {1}. Exception {2}", m_moduleName, m_SearchServer, ex.TargetSite);
                m_log.ErrorFormat("[{0}]: (3ToString) Unable to connect to Search Server {1}. Exception {2}", m_moduleName, m_SearchServer, ex.ToString());
                Hashtable ErrorHash = new Hashtable();
                ErrorHash["success"]      = false;
                ErrorHash["errorMessage"] = "Unable to search at this time. ";
                ErrorHash["errorURI"]     = "";

                return(ErrorHash);
            }
            if (Resp.IsFault)
            {
                m_log.ErrorFormat("[{0}]: response (IsFault): {1}", m_moduleName, Resp.ToString());
                Hashtable ErrorHash = new Hashtable();
                ErrorHash["success"]      = false;
                ErrorHash["errorMessage"] = "Unable to search at this time. ";
                ErrorHash["errorURI"]     = "";
                return(ErrorHash);
            }
            Hashtable RespData = (Hashtable)Resp.Value;

            return(RespData);
        }
Exemplo n.º 3
0
        //
        // Make external XMLRPC request
        //
        private Hashtable GenericXMLRPCRequest(Hashtable ReqParams, string method)
        {
            ArrayList SendParams = new ArrayList();

            SendParams.Add(ReqParams);

            // Send Request
            XmlRpcResponse Resp;

            try
            {
                XmlRpcRequest Req = new XmlRpcRequest(method, SendParams);
                Resp = Req.Send(m_SearchServer, 30000);
//				m_log.ErrorFormat("[SEARCH]response: "+Resp.ToString());
            }
            catch (WebException ex)
            {
                m_log.ErrorFormat("[SEARCH]1: Unable to connect to Search " +
                                  "Server {0}.  Exception {1}", m_SearchServer, ex);

                Hashtable ErrorHash = new Hashtable();
                ErrorHash["success"]      = false;
                ErrorHash["errorMessage"] = "Unable to search at this time. ";
                ErrorHash["errorURI"]     = "";

                return(ErrorHash);
            }
            catch (SocketException ex)
            {
                m_log.ErrorFormat(
                    "[SEARCH]2: Unable to connect to Search Server {0}. " +
                    "Exception {1}", m_SearchServer, ex);

                Hashtable ErrorHash = new Hashtable();
                ErrorHash["success"]      = false;
                ErrorHash["errorMessage"] = "Unable to search at this time. ";
                ErrorHash["errorURI"]     = "";

                return(ErrorHash);
            }
            catch (XmlException ex)
            {
                m_log.ErrorFormat(
                    "[SEARCH]3: Unable to connect to Search Server {0}. " +
                    "Exception {1}", m_SearchServer, ex);

                Hashtable ErrorHash = new Hashtable();
                ErrorHash["success"]      = false;
                ErrorHash["errorMessage"] = "Unable to search at this time. ";
                ErrorHash["errorURI"]     = "";

                return(ErrorHash);
            }
            if (Resp.IsFault)
            {
                m_log.ErrorFormat("[SEARCH]response (IsFault): " + Resp.ToString());
                Hashtable ErrorHash = new Hashtable();
                ErrorHash["success"]      = false;
                ErrorHash["errorMessage"] = "Unable to search at this time. ";
                ErrorHash["errorURI"]     = "";
                return(ErrorHash);
            }
            Hashtable RespData = (Hashtable)Resp.Value;

            return(RespData);
        }