當前位置: 首頁>>代碼示例>>C#>>正文


C# BaseHttpServer.AddHTTPHandler方法代碼示例

本文整理匯總了C#中OpenSim.Framework.Servers.HttpServer.BaseHttpServer.AddHTTPHandler方法的典型用法代碼示例。如果您正苦於以下問題:C# BaseHttpServer.AddHTTPHandler方法的具體用法?C# BaseHttpServer.AddHTTPHandler怎麽用?C# BaseHttpServer.AddHTTPHandler使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OpenSim.Framework.Servers.HttpServer.BaseHttpServer的用法示例。


在下文中一共展示了BaseHttpServer.AddHTTPHandler方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: RegisterHandlers

        public void RegisterHandlers(BaseHttpServer httpServer, bool registerOpenIDHandlers)
        {
            m_httpServer = httpServer;

            m_httpServer.AddHTTPHandler("login", ProcessHTMLLogin); 
            
            m_httpServer.AddXmlRPCHandler("login_to_simulator", XmlRpcLoginMethod);
            m_httpServer.AddXmlRPCHandler("set_login_params", XmlRPCSetLoginParams);
            m_httpServer.AddXmlRPCHandler("check_auth_session", XmlRPCCheckAuthSession, false);

            // New Style
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("login_to_simulator"), XmlRpcLoginMethod));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("set_login_params"), XmlRPCSetLoginParams));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("check_auth_session"), XmlRPCCheckAuthSession));

            if (registerOpenIDHandlers)
            {
                // Handler for OpenID avatar identity pages
                m_httpServer.AddStreamHandler(new OpenIdStreamHandler("GET", "/users/", this));
                // Handlers for the OpenID endpoint server
                m_httpServer.AddStreamHandler(new OpenIdStreamHandler("POST", "/openid/server/", this));
                m_httpServer.AddStreamHandler(new OpenIdStreamHandler("GET", "/openid/server/", this));
            }
        }
開發者ID:M-O-S-E-S,項目名稱:halcyon,代碼行數:24,代碼來源:UserLoginService.cs

示例2: RegisterHandlers

        public void RegisterHandlers(BaseHttpServer httpServer, bool registerLLSDHandler, bool registerOpenIDHandlers)
        {
            m_httpServer = httpServer;

            //m_httpServer.AddXmlRPCHandler("login_to_simulator", XmlRpcLoginMethod);
            m_httpServer.AddXmlRPCHandler("login_to_simulator", m_LoginSwitch.XmlRpcLoginMethodSwitch);
            m_httpServer.AddHTTPHandler("login", ProcessHTMLLogin);
            m_httpServer.AddXmlRPCHandler("set_login_params", XmlRPCSetLoginParams);
            //m_httpServer.AddXmlRPCHandler("check_auth_session", XmlRPCCheckAuthSession, false);
            m_httpServer.AddXmlRPCHandler("check_auth_session", m_LoginSwitch.XmlRPCCheckAuthSessionSwitch, false);

            if (registerLLSDHandler)
            {
                m_httpServer.SetDefaultLLSDHandler(LLSDLoginMethod);
            }

            // Handler for the root page
            m_httpServer.AddStreamHandler(new RootPageStreamHandler("GET", "/", this));

            if (!String.IsNullOrEmpty(m_config.ContentFilePath))
            {
                // Handler for misc. web content
                m_httpServer.AddStreamHandler(new FilesystemStreamHandler("GET", "/content/", m_config.ContentFilePath, this));
            }

            if (registerOpenIDHandlers)
            {
                CableBeachLoginService loginService = new CableBeachLoginService(this.UserManager, this.InterInventoryService,
                    this.LibraryRootFolder, this.m_config, this.WelcomeMessage, this.RegionProfileService);
                CableBeachState.LoginService = loginService;

                // Handler for OpenID avatar identity pages
                m_httpServer.AddStreamHandler(new OpenIdUserPageStreamHandler("GET", "/users/", this));

                // Handlers for the OpenID endpoint server
                m_httpServer.AddStreamHandler(new OpenIdProviderStreamHandler("POST", "/openid/server", this));
                m_httpServer.AddStreamHandler(new OpenIdProviderStreamHandler("GET", "/openid/server", this));

                // Handlers for the Cable Beach login page
                m_httpServer.AddStreamHandler(new OpenIdLoginStreamHandler("POST", "/login", this));
                m_httpServer.AddStreamHandler(new OpenIdLoginStreamHandler("GET", "/login", this));

                // Handler for the Facebook Connect login path
                m_httpServer.AddStreamHandler(new FacebookStreamHandler("GET", "/facebook/login", this));
            }
        }
開發者ID:AlphaStaxLLC,項目名稱:taiga,代碼行數:46,代碼來源:UserLoginService.cs


注:本文中的OpenSim.Framework.Servers.HttpServer.BaseHttpServer.AddHTTPHandler方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。