Пример #1
0
        public void RegisterHandlers(BaseHttpServer httpServer)
        {
            m_httpServer = httpServer;

            // Rest
            m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod));

            // XmlRpc
            m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod);

            // New Style
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("get_grid_info"), m_gridInfoService.XmlRpcGridInfoMethod));
        }
Пример #2
0
 public void RegisterHandlers(BaseHttpServer httpServer)
 {
     m_httpServer = httpServer;
     m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info",
                                                        m_gridInfoService.RestGetGridInfoMethod));
     m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod);
 }
Пример #3
0
        public void RegisterHandlers(BaseHttpServer httpServer)
        {
            m_httpServer = httpServer;

            m_httpServer.AddXmlRPCHandler("add_new_user_friend", XmlRpcResponseXmlRPCAddUserFriend);
            m_httpServer.AddXmlRPCHandler("remove_user_friend", XmlRpcResponseXmlRPCRemoveUserFriend);
            m_httpServer.AddXmlRPCHandler("update_user_friend_perms", XmlRpcResponseXmlRPCUpdateUserFriendPerms);
            m_httpServer.AddXmlRPCHandler("get_user_friend_list", XmlRpcResponseXmlRPCGetUserFriendList);

            // New Style
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("add_new_user_friend"), XmlRpcResponseXmlRPCAddUserFriend));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("remove_user_friend"), XmlRpcResponseXmlRPCRemoveUserFriend));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("update_user_friend_perms"), XmlRpcResponseXmlRPCUpdateUserFriendPerms));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("get_user_friend_list"), XmlRpcResponseXmlRPCGetUserFriendList));

            // Protobuf Handlers
            m_httpServer.AddStreamHandler(new BufferStreamHandler("POST", "/get_user_friend_list2/", HandleGetUserFriendList2));
        }
        public void RegisterHandlers(BaseHttpServer httpServer)
        {
            m_httpServer = httpServer;
            
            m_httpServer.AddXmlRPCHandler("get_avatar_appearance", XmlRPCGetAvatarAppearance);
            m_httpServer.AddXmlRPCHandler("get_bot_outfit", XmlRPCGetBotOutfit);
            m_httpServer.AddXmlRPCHandler("update_avatar_appearance", XmlRPCUpdateAvatarAppearance);
            m_httpServer.AddXmlRPCHandler("add_bot_outfit", XmlRPCAddBotOutfit);
            m_httpServer.AddXmlRPCHandler("remove_bot_outfit", XmlRPCRemoveBotOutfit);
            m_httpServer.AddXmlRPCHandler("get_bot_outfits_by_owner", XmlRPCGetBotOutfitsByOwner);
            m_httpServer.AddXmlRPCHandler("get_cached_baked_textures", XmlRPCGetCachedBakedTextures);
            m_httpServer.AddXmlRPCHandler("set_cached_baked_textures", XmlRPCSetCachedBakedTextures);

            // New Style
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("get_avatar_appearance"), XmlRPCGetAvatarAppearance));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("get_bot_outfit"), XmlRPCGetBotOutfit));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("update_avatar_appearance"), XmlRPCUpdateAvatarAppearance));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("add_bot_outfit"), XmlRPCAddBotOutfit));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("remove_bot_outfit"), XmlRPCRemoveBotOutfit));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("get_bot_outfits_by_owner"), XmlRPCGetBotOutfitsByOwner));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("get_cached_baked_textures"), XmlRPCGetCachedBakedTextures));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("set_cached_baked_textures"), XmlRPCSetCachedBakedTextures));
        }
Пример #5
0
		public void AddRegion(Scene scene)
		{
			//m_log.InfoFormat("[MONEY]: AddRegion:");

			if (scene==null) return;

			scene.RegisterModuleInterface<IMoneyModule>(this);	// 競合するモジュールの排除

			lock (m_sceneList)
			{
				if (m_sceneList.Count==0)
				{
					if (!string.IsNullOrEmpty(m_moneyServURL))
					{
						HttpServer = new BaseHttpServer(9000);
						HttpServer.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(scene.RegionInfo));

						HttpServer.AddXmlRPCHandler("OnMoneyTransfered", OnMoneyTransferedHandler);
						HttpServer.AddXmlRPCHandler("UpdateBalance", BalanceUpdateHandler);
						HttpServer.AddXmlRPCHandler("UserAlert", UserAlertHandler);
						HttpServer.AddXmlRPCHandler("GetBalance", GetBalanceHandler);						// added
						HttpServer.AddXmlRPCHandler("AddBankerMoney", AddBankerMoneyHandler);				// added
						HttpServer.AddXmlRPCHandler("SendMoneyBalance", SendMoneyBalanceHandler);			// added
						//HttpServer.AddXmlRPCHandler("UploadCovered", UploadCoveredHandler);				// added for Aurora-Sim
						//HttpServer.AddXmlRPCHandler("UploadCharge", UploadChargeHandler);					// added for Aurora-Sim

						MainServer.Instance.AddXmlRPCHandler("OnMoneyTransfered", OnMoneyTransferedHandler);
						MainServer.Instance.AddXmlRPCHandler("UpdateBalance", BalanceUpdateHandler);
						MainServer.Instance.AddXmlRPCHandler("UserAlert", UserAlertHandler);
						MainServer.Instance.AddXmlRPCHandler("GetBalance", GetBalanceHandler);				// added
						MainServer.Instance.AddXmlRPCHandler("AddBankerMoney", AddBankerMoneyHandler);		// added
						MainServer.Instance.AddXmlRPCHandler("SendMoneyBalance", SendMoneyBalanceHandler);	// added
						//MainServer.Instance.AddXmlRPCHandler("UploadCovered", UploadCoveredHandler);		// added for Aurora-Sim
						//MainServer.Instance.AddXmlRPCHandler("UploadCharge", UploadChargeHandler);		// added for Aurora-Sim
					}
				}

				if (m_sceneList.ContainsKey(scene.RegionInfo.RegionHandle))
				{
					m_sceneList[scene.RegionInfo.RegionHandle] = scene;
				}
				else
				{
					m_sceneList.Add(scene.RegionInfo.RegionHandle, scene);
				}

			}

			scene.EventManager.OnNewClient			+= OnNewClient;
			scene.EventManager.OnMakeRootAgent		+= OnMakeRootAgent;
			scene.EventManager.OnMakeChildAgent		+= MakeChildAgent;

			// for OpenSim
			scene.EventManager.OnMoneyTransfer	+= MoneyTransferAction;
			scene.EventManager.OnValidateLandBuy	+= ValidateLandBuy;
			scene.EventManager.OnLandBuy 			+= processLandBuy;
		}
Пример #6
0
        public void RegisterHandlers(BaseHttpServer httpServer)
        {
            m_httpServer = httpServer;

            m_httpServer.AddStreamHandler(new RestStreamHandler("POST", "/auth/jwt/", RESTRequestToken));
        }
Пример #7
0
        public void RegisterHandlers()
        {
            //have these in separate method as some servers restart the http server and reregister all the handlers.
            m_httpServer = m_gridCore.GetHttpServer();

            // Message Server ---> Grid Server
            m_httpServer.AddXmlRPCHandler("register_messageserver", XmlRPCRegisterMessageServer);
            m_httpServer.AddXmlRPCHandler("deregister_messageserver", XmlRPCDeRegisterMessageServer);

            // New Style service interface
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("register_messageserver"), XmlRPCRegisterMessageServer));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("deregister_messageserver"), XmlRPCDeRegisterMessageServer));
        }
Пример #8
0
        public void PostInitialize()
        {
            if (IsEnabled())
            {
                // Start http server
                // Attach xmlrpc handlers
                m_log.Info("[REMOTE_DATA]: " +
                           "Starting XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands.");

                BaseHttpServer httpServer = new BaseHttpServer((uint) m_remoteDataPort, null);
                
                // XmlRpc
                httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData);
                
                // New Style
                httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("llRemoteData"), XmlRpcRemoteData));

                httpServer.Start();
            }
        }
Пример #9
0
        public void RegisterHandlers()
        {
            //have these in separate method as some servers restart the http server and reregister all the handlers.
            m_httpServer = m_gridCore.GetHttpServer();

            // Old Method
            m_httpServer.AddXmlRPCHandler("simulator_login", XmlRpcSimulatorLoginMethod);
            m_httpServer.AddXmlRPCHandler("simulator_data_request", XmlRpcSimulatorDataRequestMethod);
            m_httpServer.AddXmlRPCHandler("simulator_after_region_moved", XmlRpcDeleteRegionMethod);
            m_httpServer.AddXmlRPCHandler("map_block", XmlRpcMapBlockMethod);
            m_httpServer.AddXmlRPCHandler("search_for_region_by_name", XmlRpcSearchForRegionMethod);

            // New Methods
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("simulator_login"), XmlRpcSimulatorLoginMethod));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("simulator_data_request"), XmlRpcSimulatorDataRequestMethod));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("simulator_after_region_moved"), XmlRpcDeleteRegionMethod));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("map_block"), XmlRpcMapBlockMethod));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("search_for_region_by_name"), XmlRpcSearchForRegionMethod));
        }
Пример #10
0
        public void RegisterHandlers(BaseHttpServer httpServer)
        {
            m_httpServer = httpServer;

            // Rest
            m_httpServer.AddStreamHandler(new RestStreamHandler("DELETE", "/usersessions/", RestDeleteUserSessionMethod)); 
            m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/users/", RESTGetUserProfile));
            //m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/users/", RESTGetUserInterests));

            // XmlRpc
            m_httpServer.AddXmlRPCHandler("get_user_by_name", XmlRPCGetUserMethodName);
            m_httpServer.AddXmlRPCHandler("get_user_by_uuid", XmlRPCGetUserMethodUUID);
            m_httpServer.AddXmlRPCHandler("get_avatar_picker_avatar", XmlRPCGetAvatarPickerAvatar);
            m_httpServer.AddXmlRPCHandler("update_user_current_region", XmlRPCAtRegion);
            m_httpServer.AddXmlRPCHandler("logout_of_simulator", XmlRPCLogOffUserMethodUUID);
            m_httpServer.AddXmlRPCHandler("get_agent_by_uuid", XmlRPCGetAgentMethodUUID);
            m_httpServer.AddXmlRPCHandler("update_user_profile", XmlRpcResponseXmlRPCUpdateUserProfile);
            //m_httpServer.AddXmlRPCHandler("update_user_interests", XmlRpcResponseXmlRPCUpdateUserInterests);
            m_httpServer.AddXmlRPCHandler("get_user_preferences", XmlRpcGetUserPreferences);
            m_httpServer.AddXmlRPCHandler("save_user_preferences", XmlRpcSaveUserPreferences);

            // New Style
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("get_user_by_name"), XmlRPCGetUserMethodName));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("get_user_by_uuid"), XmlRPCGetUserMethodUUID));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("get_avatar_picker_avatar"), XmlRPCGetAvatarPickerAvatar));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("update_user_current_region"), XmlRPCAtRegion));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("logout_of_simulator"), XmlRPCLogOffUserMethodUUID));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("get_agent_by_uuid"), XmlRPCGetAgentMethodUUID));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("update_user_profile"), XmlRpcResponseXmlRPCUpdateUserProfile));
            //m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("update_user_interests"), XmlRpcResponseXmlRPCUpdateUserInterests));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("get_user_preferences"), XmlRpcGetUserPreferences));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("save_user_preferences"), XmlRpcSaveUserPreferences));
        }
Пример #11
0
        public void RegisterHandlers(BaseHttpServer httpServer)
        {
            m_httpServer = httpServer;

            m_httpServer.AddXmlRPCHandler("region_startup", RegionStartup);
            m_httpServer.AddXmlRPCHandler("region_shutdown", RegionShutdown);	
            m_httpServer.AddXmlRPCHandler("agent_location", AgentLocation);
            m_httpServer.AddXmlRPCHandler("agent_leaving", AgentLeaving);

            // New Style
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("region_startup"), RegionStartup));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("region_shutdown"), RegionShutdown));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("agent_location"), AgentLocation));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("agent_leaving"), AgentLeaving));
			
            // Message Server ---> User Server
            m_httpServer.AddXmlRPCHandler("register_messageserver", XmlRPCRegisterMessageServer);
            m_httpServer.AddXmlRPCHandler("agent_change_region", XmlRPCUserMovedtoRegion);
            m_httpServer.AddXmlRPCHandler("deregister_messageserver", XmlRPCDeRegisterMessageServer);

            // New Style
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("register_messageserver"), XmlRPCRegisterMessageServer));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("agent_change_region"), XmlRPCUserMovedtoRegion));
            m_httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("deregister_messageserver"), XmlRPCDeRegisterMessageServer));
        }
Пример #12
0
        public void RegisterHandlers()
        {
            //have these in separate method as some servers restart the http server and reregister all the handlers.
            m_httpServer = m_gridCore.GetHttpServer();

            m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/sims/", RestGetSimMethod));
            m_httpServer.AddStreamHandler(new RestStreamHandler("POST", "/sims/", RestSetSimMethod));

            m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/regions/", RestGetRegionMethod));
            m_httpServer.AddStreamHandler(new RestStreamHandler("POST", "/regions/", RestSetRegionMethod));
        }
Пример #13
0
        public void Initialise(OpenSimBase openSim)
        {
            m_log.Info("[MapService]: initialized!");
            _app = openSim;
            _httpd = openSim.HttpServer;
            layerDict = new Dictionary<string, BaseLayer>();

            // read app config from OpenSim.MapService.ini
            LayerParams objLayerParams = new LayerParams();
            LayerParams terrainLayerParams = new LayerParams();
            LayerParams agentLayerParams = new LayerParams();
            try
            {
                m_config = new IniConfigSource("OpenSim.MapService.ini");
                getLayerParams(m_config.Configs["Object"], ref objLayerParams);
                getLayerParams(m_config.Configs["Terrain"], ref terrainLayerParams);
                getLayerParams(m_config.Configs["Agent"], ref agentLayerParams);
            }
            catch (Exception e)
            {
                Console.WriteLine("Read Map Service config failure");
                Console.WriteLine(e.ToString());
            }

            // initailize new feature layers and register them
            m_objectLayer = new ObjectLayer(_app.SceneManager,  objLayerParams);
            m_terrainLayer = new TerrainLayer(_app.SceneManager, terrainLayerParams);
            m_agentLayer = new AgentLayer(_app.SceneManager, agentLayerParams);
            layerDict.Add(m_objectLayer.Name, m_objectLayer);
            layerDict.Add(m_terrainLayer.Name, m_terrainLayer);
            layerDict.Add(m_agentLayer.Name, m_agentLayer);

            // register ows handler
            string httpMethod = "GET";
            string path = "/ows";
            OWSStreamHandler h = new OWSStreamHandler(httpMethod, path, owsHandler);
            _httpd.AddStreamHandler(h);
        }
Пример #14
0
        /// <summary>
        /// Called publicly by server code that is not hosting a scene, but wants remote admin support
        /// </summary>
        /// <param name="server"></param>
        public void AddHandler(BaseHttpServer server)
        {
            m_log.Info("[RADMIN]: Remote Admin CoreInit");

            server.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("RemoteAdmin"), XmlRpcCommand));
        }
Пример #15
0
        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));
            }
        }
Пример #16
0
        public void RegisterHandlers(BaseHttpServer httpServer)
        {
            m_httpServer = httpServer;

            m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/users/", RESTGetUserProfile));

            m_httpServer.AddXmlRPCHandler("get_user_by_name", XmlRPCGetUserMethodName);
            m_httpServer.AddXmlRPCHandler("get_user_by_uuid", XmlRPCGetUserMethodUUID);
            m_httpServer.AddXmlRPCHandler("get_avatar_picker_avatar", XmlRPCGetAvatarPickerAvatar);

            m_httpServer.AddXmlRPCHandler("update_user_current_region", XmlRPCAtRegion);
            m_httpServer.AddXmlRPCHandler("logout_of_simulator", XmlRPCLogOffUserMethodUUID);
            m_httpServer.AddXmlRPCHandler("get_agent_by_uuid", XmlRPCGetAgentMethodUUID);

            m_httpServer.AddXmlRPCHandler("update_user_profile", XmlRpcResponseXmlRPCUpdateUserProfile);

            m_httpServer.AddStreamHandler(new RestStreamHandler("DELETE", "/usersessions/", RestDeleteUserSessionMethod));
        }
Пример #17
0
        /// <summary>
        /// Contructor.  Adds "expect_user" and "check" xmlrpc method handlers
        /// </summary>
        /// <param name="servers_info"></param>
        /// <param name="httpServe"></param>
        public OGS1GridServices(NetworkServersInfo servers_info, BaseHttpServer httpServe)
        {
            serversInfo = servers_info;
            httpServer = httpServe;

            //Respond to Grid Services requests
            httpServer.AddXmlRPCHandler("check", PingCheckReply);
            httpServer.AddXmlRPCHandler("land_data", LandData);

            // New Style
            httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("check"), PingCheckReply));
            httpServer.AddStreamHandler(new XmlRpcStreamHandler("POST", Util.XmlRpcRequestPrefix("land_data"), LandData));
        }
Пример #18
0
        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));
            }
        }
		/* Public ***************************************************************/
		#region IRegionModule interface

		///
		public void Initialise(Scene scene, IConfigSource source)
		{
			// Handle the parameters errors.
			if (scene == null || source == null) return;

			try
			{
				m_config = source;

				// [Startup] secion
				IConfig networkConfig = m_config.Configs["Network"];

				m_userServIP = "";
				if (networkConfig.Contains("user_server_url")) {
					m_userServIP = Util.GetHostFromURL(networkConfig.GetString("user_server_url")).ToString();
				}

				// [Economy] section
				IConfig economyConfig = m_config.Configs["Economy"];

				if (economyConfig.GetString("EconomyModule").ToString() != Name)
				{
					m_enabled = false;
					m_log.InfoFormat("[MONEY]: The DTLMoneyModule is disabled.");
					return;
				}
				else
				{
					m_log.InfoFormat("[MONEY]: The DTLMoneyModule is enabled.");
				}

				m_sellEnabled = economyConfig.GetBoolean("SellEnabled", false);

				if (m_userServIP=="") {
					m_userServIP = Util.GetHostFromURL(economyConfig.GetString("UserServer")).ToString();
				}
				m_moneyServURL = economyConfig.GetString("CurrencyServer").ToString();

				// Price
				PriceEnergyUnit 		= economyConfig.GetInt("PriceEnergyUnit", 100);
				PriceObjectClaim 		= economyConfig.GetInt("PriceObjectClaim", 10);
				PricePublicObjectDecay 	= economyConfig.GetInt("PricePublicObjectDecay", 4);
				PricePublicObjectDelete = economyConfig.GetInt("PricePublicObjectDelete", 4);
				PriceParcelClaim 		= economyConfig.GetInt("PriceParcelClaim", 1);
				PriceParcelClaimFactor 	= economyConfig.GetFloat("PriceParcelClaimFactor", 1f);
				PriceUpload 			= economyConfig.GetInt("PriceUpload", 0);
				PriceRentLight 			= economyConfig.GetInt("PriceRentLight", 5);
				PriceObjectRent 		= economyConfig.GetFloat("PriceObjectRent", 1);
				PriceObjectScaleFactor 	= economyConfig.GetFloat("PriceObjectScaleFactor", 10);
				PriceParcelRent 		= economyConfig.GetInt("PriceParcelRent", 1);
				PriceGroupCreate 		= economyConfig.GetInt("PriceGroupCreate", 0);
				TeleportMinPrice 		= economyConfig.GetInt("TeleportMinPrice", 2);
				TeleportPriceExponent 	= economyConfig.GetFloat("TeleportPriceExponent", 2f);
				EnergyEfficiency 		= economyConfig.GetFloat("EnergyEfficiency", 1);

			}
			catch
			{
				m_log.ErrorFormat("[MONEY]: Faile to read configuration file.");
			}
			scene.RegisterModuleInterface<IMoneyModule>(this);

			lock (m_sceneList)
			{
				if (m_sceneList.Count == 0)
				{
					if (!string.IsNullOrEmpty(m_moneyServURL))
					{
						HttpServer = new BaseHttpServer(9000);
						HttpServer.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(scene.RegionInfo));

						HttpServer.AddXmlRPCHandler("UpdateBalance", BalanceUpdateHandler);
						HttpServer.AddXmlRPCHandler("UserAlert", UserAlertHandler);
						HttpServer.AddXmlRPCHandler("OnMoneyTransfered", OnMoneyTransferedHandlered);
						HttpServer.AddXmlRPCHandler("AddBankerMoney", AddBankerMoneyHandler);				// added by Fumi.Iseki
						HttpServer.AddXmlRPCHandler("SendMoneyBalance",  SendMoneyBalanceHandler);			// added by Fumi.Iseki
						HttpServer.AddXmlRPCHandler("GetBalance", GetBalanceHandler);						// added by Fumi.Iseki
						//HttpServer.AddXmlRPCHandler("SendConfirmLink", SendConfirmLinkHandler);

						MainServer.Instance.AddXmlRPCHandler("UpdateBalance", BalanceUpdateHandler);
						MainServer.Instance.AddXmlRPCHandler("UserAlert", UserAlertHandler);
						MainServer.Instance.AddXmlRPCHandler("OnMoneyTransfered", OnMoneyTransferedHandlered);
						MainServer.Instance.AddXmlRPCHandler("AddBankerMoney", AddBankerMoneyHandler);		// added by Fumi.Iseki
						MainServer.Instance.AddXmlRPCHandler("SendMoneyBalance",  SendMoneyBalanceHandler);	// added by Fumi.Iseki
						MainServer.Instance.AddXmlRPCHandler("GetBalance", GetBalanceHandler);				// added by Fumi.Iseki
						//MainServer.Instance.AddXmlRPCHandler("SendConfirmLink", SendConfirmLinkHandler);
					}
				}

				if (m_sceneList.ContainsKey(scene.RegionInfo.RegionHandle))
				{
					m_sceneList[scene.RegionInfo.RegionHandle] = scene;
				}
				else
				{
					m_sceneList.Add(scene.RegionInfo.RegionHandle, scene);
				}

			}

			scene.EventManager.OnNewClient += OnNewClient;
			scene.EventManager.OnMakeRootAgent += OnMakeRootAgent;
			scene.EventManager.OnMoneyTransfer += MoneyTransferAction;
			scene.EventManager.OnClientClosed  += ClientClosed;
			scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel;
			scene.EventManager.OnMakeChildAgent  += MakeChildAgent;
			scene.EventManager.OnValidateLandBuy += ValidateLandBuy;
			scene.EventManager.OnLandBuy += processLandBuy;
		}