From ccc8ffaaec915f0561d9aded6cc4b32b911f473c Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Tue, 18 Dec 2007 12:08:34 +0000 Subject: * Added Incomplete Handling of the RegionInfoRequest packet * Added Incomplete Handling of the EstateCovenantRequest packet * Added Incomplete Handling of the EstateOwnerMessageRequest.ChangeEstateCovenantid method * Fixed a race condition with avatar animations --- OpenSim/Framework/IClientAPI.cs | 9 ++++ OpenSim/Framework/RegionInfo.cs | 8 +++- OpenSim/Region/ClientStack/ClientView.cs | 28 ++++++++---- OpenSim/Region/Environment/EstateManager.cs | 52 ++++++++++++++++++++++ .../Region/Environment/Scenes/AvatarAnimations.cs | 9 ++-- OpenSim/Region/Environment/Scenes/Scene.cs | 2 + .../Region/Examples/SimpleApp/MyNpcCharacter.cs | 7 ++- 7 files changed, 101 insertions(+), 14 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 7d9fd9a..fde74d6 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -320,6 +320,10 @@ namespace OpenSim.Framework public delegate void EstateOwnerMessageRequest(EstateOwnerMessagePacket packet, IClientAPI remote_client); + public delegate void RegionInfoRequest(IClientAPI remote_client, LLUUID sessionID); + + public delegate void EstateCovenantRequest(IClientAPI remote_client, LLUUID sessionID); + public delegate void UUIDNameRequest(LLUUID id, IClientAPI remote_client); public delegate void AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape); @@ -466,6 +470,10 @@ namespace OpenSim.Framework event ParcelSelectObjects OnParcelSelectObjects; event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; event EstateOwnerMessageRequest OnEstateOwnerMessage; + event RegionInfoRequest OnRegionInfoRequest; + event EstateCovenantRequest OnEstateCovenantRequest; + + LLVector3 StartPos { get; set; } @@ -551,6 +559,7 @@ namespace OpenSim.Framework void SendNameReply(LLUUID profileId, string firstname, string lastname); void SendAlertMessage(string message); + void SendAgentAlertMessage(string message, bool modal); void SendLoadURL(string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, string message, string url); bool AddMoney(int debit); diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index fba78a9..6a9de2c 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -199,6 +199,7 @@ namespace OpenSim.Framework public bool commFailTF = false; public LLUUID MasterAvatarAssignedUUID = LLUUID.Zero; + public LLUUID CovenantID = LLUUID.Zero; public string MasterAvatarFirstName = ""; public string MasterAvatarLastName = ""; public string MasterAvatarSandboxPassword = ""; @@ -316,7 +317,8 @@ namespace OpenSim.Framework configMember.addConfigurationOption("internal_ip_address", ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS, "Internal IP Address for incoming UDP client connections", "0.0.0.0", false); configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Internal IP Port for incoming UDP client connections", NetworkServersInfo.DefaultHttpListenerPort.ToString(), false); configMember.addConfigurationOption("external_host_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "External Host Name", "127.0.0.1", false); - configMember.addConfigurationOption("master_avatar_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "Master Avatar UUID", LLUUID.Zero.ToString(), true); + configMember.addConfigurationOption("master_avatar_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "Master Avatar UUID", LLUUID.Zero.ToStringHyphenated(), true); + configMember.addConfigurationOption("estate_covanant_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "Estate Covenant", LLUUID.Zero.ToStringHyphenated(), true); configMember.addConfigurationOption("master_avatar_first", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "First Name of Master Avatar", "Test", false,(ConfigurationOption.ConfigurationOptionShouldBeAsked)shouldMasterAvatarDetailsBeAsked); configMember.addConfigurationOption("master_avatar_last", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Last Name of Master Avatar", "User", false, (ConfigurationOption.ConfigurationOptionShouldBeAsked)shouldMasterAvatarDetailsBeAsked); configMember.addConfigurationOption("master_avatar_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "(Sandbox Mode Only)Password for Master Avatar account", "test", false, (ConfigurationOption.ConfigurationOptionShouldBeAsked)shouldMasterAvatarDetailsBeAsked); @@ -370,6 +372,10 @@ namespace OpenSim.Framework case "master_avatar_uuid": this.MasterAvatarAssignedUUID = (LLUUID)configuration_result; break; + case "estate_covanant_uuid": + this.CovenantID = (LLUUID)configuration_result; + break; + case "master_avatar_first": this.MasterAvatarFirstName = (string)configuration_result; break; diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index df52745..3c35270 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -529,6 +529,9 @@ namespace OpenSim.Region.ClientStack public event ParcelSelectObjects OnParcelSelectObjects; public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; public event EstateOwnerMessageRequest OnEstateOwnerMessage; + public event RegionInfoRequest OnRegionInfoRequest; + public event EstateCovenantRequest OnEstateCovenantRequest; + #region Scene/Avatar to Client @@ -3216,7 +3219,21 @@ namespace OpenSim.Region.ClientStack OnEstateOwnerMessage(messagePacket, this); } break; - + case PacketType.RequestRegionInfo: + RequestRegionInfoPacket.AgentDataBlock mPacket = ((RequestRegionInfoPacket)Pack).AgentData; + if (OnRegionInfoRequest != null) + { + OnRegionInfoRequest(this, mPacket.SessionID); + } + break; + case PacketType.EstateCovenantRequest: + // TODO: handle this packet + EstateCovenantRequestPacket.AgentDataBlock epack = ((EstateCovenantRequestPacket)Pack).AgentData; + if (OnEstateCovenantRequest != null) + { + OnEstateCovenantRequest(this, epack.SessionID); + } + break; case PacketType.AgentThrottle: AgentThrottlePacket atpack = (AgentThrottlePacket)Pack; m_packetQueue.SetThrottleFromClient(atpack.Throttle.Throttles); @@ -3278,10 +3295,7 @@ namespace OpenSim.Region.ClientStack // TODO: handle this packet MainLog.Instance.Warn("CLIENT", "unhandled ViewerStats packet"); break; - case PacketType.EstateCovenantRequest: - // TODO: handle this packet - MainLog.Instance.Warn("CLIENT", "unhandled EstateCovenantRequest packet"); - break; + case PacketType.CreateGroupRequest: // TODO: handle this packet MainLog.Instance.Warn("CLIENT", "unhandled CreateGroupRequest packet"); @@ -3343,10 +3357,6 @@ namespace OpenSim.Region.ClientStack // TODO: handle this packet MainLog.Instance.Warn("CLIENT", "unhandled UserInfoRequest packet"); break; - case PacketType.RequestRegionInfo: - // TODO: handle this packet - MainLog.Instance.Warn("CLIENT", "unhandled RequestRegionInfo packet"); - break; case PacketType.InventoryDescendents: // TODO: handle this packet MainLog.Instance.Warn("CLIENT", "unhandled InventoryDescent packet"); diff --git a/OpenSim/Region/Environment/EstateManager.cs b/OpenSim/Region/Environment/EstateManager.cs index e1bb4d8..081a8cd 100644 --- a/OpenSim/Region/Environment/EstateManager.cs +++ b/OpenSim/Region/Environment/EstateManager.cs @@ -177,6 +177,12 @@ namespace OpenSim.Region.Environment estateRestartSim(packet); } break; + case "estatechangecovenantid": + if (m_scene.PermissionsMngr.CanEditEstateTerrain(remote_client.AgentId)) + { + EstateChangeCovenant(packet); + } + break; default: MainLog.Instance.Error("EstateOwnerMessage: Unknown method requested\n" + packet.ToString()); break; @@ -340,8 +346,54 @@ namespace OpenSim.Region.Environment } } + private void EstateChangeCovenant(EstateOwnerMessagePacket packet) + { + foreach (EstateOwnerMessagePacket.ParamListBlock block in packet.ParamList) + { + LLUUID newCovenantID = new LLUUID(Helpers.FieldToUTF8String(block.Parameter)); + m_regInfo.CovenantID = newCovenantID; + } + + } + public void HandleRegionInfoRequest(IClientAPI client, LLUUID sessionID) + { + RegionInfoPacket rinfopack = new RegionInfoPacket(); + RegionInfoPacket.RegionInfoBlock rinfoblk = new RegionInfoPacket.RegionInfoBlock(); + + rinfoblk.BillableFactor = 0; + rinfoblk.EstateID = 02; + rinfoblk.MaxAgents = 100; + rinfoblk.ObjectBonusFactor = 1.0f; + rinfoblk.ParentEstateID = 0; + rinfoblk.PricePerMeter = 0; + rinfoblk.RedirectGridX = 0; + rinfoblk.RedirectGridY = 0; + rinfoblk.RegionFlags = (uint)m_regInfo.EstateSettings.regionFlags; + rinfoblk.SimAccess = (byte)m_regInfo.EstateSettings.simAccess; + rinfoblk.SunHour = m_regInfo.EstateSettings.sunHour; + rinfoblk.TerrainLowerLimit = 20; + rinfoblk.TerrainRaiseLimit = 20; + rinfoblk.UseEstateSun = true; + rinfoblk.WaterHeight = m_regInfo.EstateSettings.waterHeight; + rinfoblk.SimName = Helpers.StringToField(m_regInfo.RegionName); + + rinfopack.RegionInfo = rinfoblk; + + client.OutPacket(rinfopack, ThrottleOutPacketType.Task); + } + public void HandleEstateCovenantRequest(IClientAPI client, LLUUID sessionID) + { + EstateCovenantReplyPacket einfopack = new EstateCovenantReplyPacket(); + EstateCovenantReplyPacket.DataBlock edata = new EstateCovenantReplyPacket.DataBlock(); + edata.CovenantID = m_regInfo.CovenantID; + edata.CovenantTimestamp = 0; + edata.EstateOwnerID = m_regInfo.MasterAvatarAssignedUUID; + edata.EstateName = Helpers.StringToField(m_regInfo.MasterAvatarFirstName + " " + m_regInfo.MasterAvatarLastName); + einfopack.Data = edata; + client.OutPacket(einfopack, ThrottleOutPacketType.Task); + } #endregion #region Outgoing Packets diff --git a/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs b/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs index d508c9e..82ecda8 100644 --- a/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs +++ b/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs @@ -59,10 +59,13 @@ namespace OpenSim.Region.Environment.Scenes } // MainLog.Instance.Verbose("CLIENT", "Loaded " + AnimsLLUUID.Count.ToString() + " animation(s)"); - - foreach (KeyValuePair kp in ScenePresence.Animations.AnimsLLUUID) + + lock (ScenePresence.Animations.AnimsLLUUID) { - AnimsNames.Add(kp.Value, kp.Key); + foreach (KeyValuePair kp in ScenePresence.Animations.AnimsLLUUID) + { + AnimsNames.Add(kp.Value, kp.Key); + } } } } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 9ca23d5..eec07fc 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -1122,6 +1122,8 @@ namespace OpenSim.Region.Environment.Scenes client.OnParcelAccessListUpdateRequest += new ParcelAccessListUpdateRequest(m_LandManager.handleParcelAccessUpdateRequest); client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage); + client.OnRegionInfoRequest += m_estateManager.HandleRegionInfoRequest; + client.OnEstateCovenantRequest += m_estateManager.HandleEstateCovenantRequest; client.OnRequestGodlikePowers += handleRequestGodlikePowers; client.OnGodKickUser += handleGodlikeKickUser; client.OnObjectPermissions += HandleObjectPermissionsUpdate; diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs index 505d0bb..a59e7d6 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs @@ -137,6 +137,9 @@ namespace SimpleApp public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; public event ObjectDeselect OnObjectDeselect; public event EstateOwnerMessageRequest OnEstateOwnerMessage; + public event RegionInfoRequest OnRegionInfoRequest; + public event EstateCovenantRequest OnEstateCovenantRequest; + #pragma warning restore 67 @@ -364,7 +367,9 @@ namespace SimpleApp public void SendAgentAlertMessage(string message, bool modal) { } - + public void SendSystemAlertMessage(string message) + { + } public void SendLoadURL(string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, string message, string url) { -- cgit v1.1