From 7d89e122930be39e84a6d174548fa2d12ac0484a Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sat, 6 Sep 2008 07:52:41 +0000 Subject: * This is the fabled LibOMV update with all of the libOMV types from JHurliman * This is a HUGE OMG update and will definitely have unknown side effects.. so this is really only for the strong hearted at this point. Regular people should let the dust settle. * This has been tested to work with most basic functions. However.. make sure you back up 'everything' before using this. It's that big! * Essentially we're back at square 1 in the testing phase.. so lets identify things that broke. --- .../Avatar/AvatarFactory/AvatarFactoryModule.cs | 26 ++-- .../Environment/Modules/Avatar/Chat/ChatModule.cs | 26 ++-- .../Modules/Avatar/Chat/IRCBridgeModule.cs | 10 +- .../Currency/SampleMoney/SampleMoneyModule.cs | 138 ++++++++++----------- .../Modules/Avatar/Friends/FriendsModule.cs | 106 ++++++++-------- .../Modules/Avatar/Groups/GroupsModule.cs | 36 +++--- .../Avatar/InstantMessage/InstantMessageModule.cs | 104 ++++++++-------- .../Modules/Avatar/Inventory/InventoryModule.cs | 24 ++-- .../Avatar/Profiles/AvatarProfilesModule.cs | 6 +- .../Voice/AsterixVoice/AsteriskVoiceModule.cs | 10 +- .../Avatar/Voice/SIPVoice/SIPVoiceModule.cs | 10 +- 11 files changed, 247 insertions(+), 249 deletions(-) (limited to 'OpenSim/Region/Environment/Modules/Avatar') diff --git a/OpenSim/Region/Environment/Modules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/Environment/Modules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 5df3f52..9433cf6 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -29,7 +29,7 @@ using System; using System.Collections.Generic; using System.Threading; -using libsecondlife; +using OpenMetaverse; using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; @@ -43,7 +43,7 @@ namespace OpenSim.Region.Environment.Modules public class AvatarFactoryModule : IAvatarFactory { private Scene m_scene = null; - private readonly Dictionary m_avatarsAppearance = new Dictionary(); + private readonly Dictionary m_avatarsAppearance = new Dictionary(); private bool m_enablePersist = false; private string m_connectionString; @@ -51,10 +51,10 @@ namespace OpenSim.Region.Environment.Modules private BaseDatabaseConnector m_databaseMapper; private AppearanceTableMapper m_appearanceMapper; - private Dictionary m_fetchesInProgress = new Dictionary(); + private Dictionary m_fetchesInProgress = new Dictionary(); private object m_syncLock = new object(); - public bool TryGetAvatarAppearance(LLUUID avatarId, out AvatarAppearance appearance) + public bool TryGetAvatarAppearance(UUID avatarId, out AvatarAppearance appearance) { //should only let one thread at a time do this part @@ -163,7 +163,7 @@ namespace OpenSim.Region.Environment.Modules } } - private AvatarAppearance CreateDefault(LLUUID avatarId) + private AvatarAppearance CreateDefault(UUID avatarId) { AvatarAppearance appearance = null; AvatarWearable[] wearables; @@ -174,7 +174,7 @@ namespace OpenSim.Region.Environment.Modules return appearance; } - private AvatarAppearance CheckDatabase(LLUUID avatarId) + private AvatarAppearance CheckDatabase(UUID avatarId) { AvatarAppearance appearance = null; if (m_enablePersist) @@ -192,7 +192,7 @@ namespace OpenSim.Region.Environment.Modules return appearance; } - private AvatarAppearance CheckCache(LLUUID avatarId) + private AvatarAppearance CheckCache(UUID avatarId) { AvatarAppearance appearance = null; lock (m_avatarsAppearance) @@ -282,16 +282,16 @@ namespace OpenSim.Region.Environment.Modules { if (wear.Type < 13) { - if (wear.ItemID == LLUUID.Zero) + if (wear.ItemID == UUID.Zero) { - avatAppearance.Wearables[wear.Type].ItemID = LLUUID.Zero; - avatAppearance.Wearables[wear.Type].AssetID = LLUUID.Zero; + avatAppearance.Wearables[wear.Type].ItemID = UUID.Zero; + avatAppearance.Wearables[wear.Type].AssetID = UUID.Zero; UpdateDatabase(clientView.AgentId, avatAppearance); } else { - LLUUID assetId; + UUID assetId; InventoryItemBase baseItem = profile.RootFolder.FindItem(wear.ItemID); if (baseItem != null) @@ -310,11 +310,11 @@ namespace OpenSim.Region.Environment.Modules } } - public void UpdateDatabase(LLUUID userID, AvatarAppearance avatAppearance) + public void UpdateDatabase(UUID userID, AvatarAppearance avatAppearance) { if (m_enablePersist) { - m_appearanceMapper.Update(userID.UUID, avatAppearance); + m_appearanceMapper.Update(userID.Guid, avatAppearance); } } diff --git a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs index 1493e32..e1599a8 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs @@ -32,7 +32,7 @@ using System.Net.Sockets; using System.Reflection; using System.Text.RegularExpressions; using System.Threading; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using OpenSim.Framework; @@ -115,7 +115,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat // chat works by redistributing every incoming chat // message to each avatar in the scene - LLVector3 pos = new LLVector3(128, 128, 30); + Vector3 pos = new Vector3(128, 128, 30); ((Scene)c.Scene).ForEachScenePresence(delegate(ScenePresence presence) { if (presence.IsChildAgent) return; @@ -129,12 +129,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat if (null == c.SenderObject) client.SendChatMessage(c.Message, (byte)c.Type, - pos, c.From, LLUUID.Zero, + pos, c.From, UUID.Zero, (byte)ChatSourceType.Agent, (byte)ChatAudibleLevel.Fully); else client.SendChatMessage(c.Message, (byte)c.Type, - pos, c.From, LLUUID.Zero, + pos, c.From, UUID.Zero, (byte)ChatSourceType.Object, (byte)ChatAudibleLevel.Fully); }); @@ -153,13 +153,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat scene = m_scenes[0]; // Filled in since it's easier than rewriting right now. - LLVector3 fromPos = e.Position; - LLVector3 regionPos = new LLVector3(scene.RegionInfo.RegionLocX * Constants.RegionSize, + Vector3 fromPos = e.Position; + Vector3 regionPos = new Vector3(scene.RegionInfo.RegionLocX * Constants.RegionSize, scene.RegionInfo.RegionLocY * Constants.RegionSize, 0); string fromName = e.From; string message = e.Message; - LLUUID fromID = e.SenderUUID; + UUID fromID = e.SenderUUID; if(message.Length >= 1000) // libomv limit message = message.Substring(0, 1000); @@ -172,7 +172,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat if (avatar != null) { fromPos = avatar.AbsolutePosition; - regionPos = new LLVector3(scene.RegionInfo.RegionLocX * Constants.RegionSize, + regionPos = new Vector3(scene.RegionInfo.RegionLocX * Constants.RegionSize, scene.RegionInfo.RegionLocY * Constants.RegionSize, 0); fromName = avatar.Firstname + " " + avatar.Lastname; fromID = e.Sender.AgentId; @@ -217,16 +217,16 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat } } - private void TrySendChatMessage(ScenePresence presence, LLVector3 fromPos, LLVector3 regionPos, - LLUUID fromAgentID, string fromName, ChatTypeEnum type, + private void TrySendChatMessage(ScenePresence presence, Vector3 fromPos, Vector3 regionPos, + UUID fromAgentID, string fromName, ChatTypeEnum type, string message, ChatSourceType src) { // don't send stuff to child agents if (presence.IsChildAgent) return; - LLVector3 fromRegionPos = fromPos + regionPos; - LLVector3 toRegionPos = presence.AbsolutePosition + - new LLVector3(presence.Scene.RegionInfo.RegionLocX * Constants.RegionSize, + Vector3 fromRegionPos = fromPos + regionPos; + Vector3 toRegionPos = presence.AbsolutePosition + + new Vector3(presence.Scene.RegionInfo.RegionLocX * Constants.RegionSize, presence.Scene.RegionInfo.RegionLocY * Constants.RegionSize, 0); int dis = Math.Abs((int) Util.GetDistanceTo(toRegionPos, fromRegionPos)); diff --git a/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs index 9df05e0..8fe5080 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs @@ -32,7 +32,7 @@ using System.Net.Sockets; using System.Reflection; using System.Text.RegularExpressions; using System.Threading; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using OpenSim.Framework; @@ -617,7 +617,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat public void ListenerRun() { string inputLine; - LLVector3 pos = new LLVector3(128, 128, 20); + Vector3 pos = new Vector3(128, 128, 20); while (m_enabled) { try @@ -638,7 +638,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat c.Position = pos; c.From = data["nick"]; c.Sender = null; - c.SenderUUID = LLUUID.Zero; + c.SenderUUID = UUID.Zero; // is message "\001ACTION foo // bar\001"? -> "/me foo bar" @@ -684,9 +684,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat c.Message = String.Format(format, args); c.Type = ChatTypeEnum.Say; c.Channel = 0; - c.Position = new LLVector3(128, 128, 20); + c.Position = new Vector3(128, 128, 20); c.Sender = null; - c.SenderUUID = LLUUID.Zero; + c.SenderUUID = UUID.Zero; foreach (Scene m_scene in m_scenes) { diff --git a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs index 2a0bba4..19c193f 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs @@ -32,7 +32,7 @@ using System.Net; using System.Net.Sockets; using System.Reflection; using System.Xml; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using Nwc.XmlRpc; @@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// /// Where Stipends come from and Fees go to. /// - // private LLUUID EconomyBaseAccount = LLUUID.Zero; + // private UUID EconomyBaseAccount = UUID.Zero; private float EnergyEfficiency = 0f; private bool gridmode = false; @@ -72,7 +72,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney private IConfigSource m_gConfig; private bool m_keepMoneyAcrossLogins = true; - private Dictionary m_KnownClientFunds = new Dictionary(); + private Dictionary m_KnownClientFunds = new Dictionary(); // private string m_LandAddress = String.Empty; private int m_minFundsBeforeRefresh = 100; @@ -81,7 +81,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// /// Region UUIDS indexed by AgentID /// - private Dictionary m_rootAgents = new Dictionary(); + private Dictionary m_rootAgents = new Dictionary(); /// /// Scenes by Region Handle @@ -184,11 +184,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney } } - public void ApplyUploadCharge(LLUUID agentID) + public void ApplyUploadCharge(UUID agentID) { } - public bool ObjectGiveMoney(LLUUID objectID, LLUUID fromID, LLUUID toID, int amount) + public bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, int amount) { string description = String.Format("Object {0} pays {1}", resolveObjectName(objectID), resolveAgentName(toID)); @@ -252,7 +252,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney PriceObjectScaleFactor = startupConfig.GetFloat("PriceObjectScaleFactor", 10); PriceParcelRent = startupConfig.GetInt("PriceParcelRent", 1); PriceGroupCreate = startupConfig.GetInt("PriceGroupCreate", -1); - // string EBA = startupConfig.GetString("EconomyBaseAccount", LLUUID.Zero.ToString()); + // string EBA = startupConfig.GetString("EconomyBaseAccount", UUID.Zero.ToString()); // Helpers.TryParse(EBA, out EconomyBaseAccount); // UserLevelPaysFees = startupConfig.GetInt("UserLevelPaysFees", -1); @@ -294,7 +294,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney if (s != null && agent != null && childYN == false) { //s.RegionInfo.RegionHandle; - LLUUID agentID = LLUUID.Zero; + UUID agentID = UUID.Zero; int funds = 0; Hashtable hbinfo = @@ -302,7 +302,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney s.RegionInfo.regionSecret); if ((bool) hbinfo["success"] == true) { - Helpers.TryParse((string) hbinfo["agentId"], out agentID); + UUID.TryParse((string)hbinfo["agentId"], out agentID); try { funds = (Int32) hbinfo["funds"]; @@ -331,7 +331,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney (string) hbinfo["errorMessage"]); client.SendAlertMessage((string) hbinfo["errorMessage"]); } - SendMoneyBalance(client, agentID, client.SessionId, LLUUID.Zero); + SendMoneyBalance(client, agentID, client.SessionId, UUID.Zero); } } } @@ -365,7 +365,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// /// /// - private bool doMoneyTransfer(LLUUID Sender, LLUUID Receiver, int amount, int transactiontype, string description) + private bool doMoneyTransfer(UUID Sender, UUID Receiver, int amount, int transactiontype, string description) { bool result = false; if (amount >= 0) @@ -425,7 +425,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// /// /// - public void SendMoneyBalance(IClientAPI client, LLUUID agentID, LLUUID SessionID, LLUUID TransactionID) + public void SendMoneyBalance(IClientAPI client, UUID agentID, UUID SessionID, UUID TransactionID) { if (client.AgentId == agentID && client.SessionId == SessionID) { @@ -456,7 +456,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// /// /// - public Hashtable GetBalanceForUserFromMoneyServer(LLUUID agentId, LLUUID secureSessionID, LLUUID regionId, string regionSecret) + public Hashtable GetBalanceForUserFromMoneyServer(UUID agentId, UUID secureSessionID, UUID regionId, string regionSecret) { Hashtable MoneyBalanceRequestParams = new Hashtable(); MoneyBalanceRequestParams["agentId"] = agentId.ToString(); @@ -551,7 +551,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// /// /// - public Hashtable claim_user(LLUUID agentId, LLUUID secureSessionID, LLUUID regionId, string regionSecret) + public Hashtable claim_user(UUID agentId, UUID secureSessionID, UUID regionId, string regionSecret) { Hashtable MoneyBalanceRequestParams = new Hashtable(); MoneyBalanceRequestParams["agentId"] = agentId.ToString(); @@ -563,12 +563,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney IClientAPI sendMoneyBal = LocateClientObject(agentId); if (sendMoneyBal != null) { - SendMoneyBalance(sendMoneyBal, agentId, sendMoneyBal.SessionId, LLUUID.Zero); + SendMoneyBalance(sendMoneyBal, agentId, sendMoneyBal.SessionId, UUID.Zero); } return MoneyRespData; } - private SceneObjectPart findPrim(LLUUID objectID) + private SceneObjectPart findPrim(UUID objectID) { lock (m_scenel) { @@ -584,7 +584,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney return null; } - private string resolveObjectName(LLUUID objectID) + private string resolveObjectName(UUID objectID) { SceneObjectPart part = findPrim(objectID); if (part != null) @@ -594,7 +594,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney return String.Empty; } - private string resolveAgentName(LLUUID agentID) + private string resolveAgentName(UUID agentID) { // try avatar username surname Scene scene = GetRandomScene(); @@ -607,7 +607,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney return String.Empty; } - private void BalanceUpdate(LLUUID senderID, LLUUID receiverID, bool transactionresult, string description) + private void BalanceUpdate(UUID senderID, UUID receiverID, bool transactionresult, string description) { IClientAPI sender = LocateClientObject(senderID); IClientAPI receiver = LocateClientObject(receiverID); @@ -616,12 +616,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney { if (sender != null) { - sender.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(description), GetFundsForAgentID(senderID)); + sender.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(description), GetFundsForAgentID(senderID)); } if (receiver != null) { - receiver.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(description), GetFundsForAgentID(receiverID)); + receiver.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(description), GetFundsForAgentID(receiverID)); } } } @@ -633,7 +633,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// /// /// - public bool TransferMoneyonMoneyServer(LLUUID sourceId, LLUUID destId, int amount, int transactiontype, string description) + public bool TransferMoneyonMoneyServer(UUID sourceId, UUID destId, int amount, int transactiontype, string description) { int aggregatePermInventory = 0; int aggregatePermNextOwner = 0; @@ -709,7 +709,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney return rvalue; } - public int GetRemoteBalance(LLUUID agentId) + public int GetRemoteBalance(UUID agentId) { int funds = 0; @@ -755,7 +755,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney } SetLocalFundsForAgentID(agentId, funds); - SendMoneyBalance(aClient, agentId, aClient.SessionId, LLUUID.Zero); + SendMoneyBalance(aClient, agentId, aClient.SessionId, UUID.Zero); } else { @@ -776,10 +776,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney if (requestData.ContainsKey("agentId")) { - LLUUID agentId = LLUUID.Zero; + UUID agentId = UUID.Zero; - Helpers.TryParse((string) requestData["agentId"], out agentId); - if (agentId != LLUUID.Zero) + UUID.TryParse((string) requestData["agentId"], out agentId); + if (agentId != UUID.Zero) { GetRemoteBalance(agentId); } @@ -809,13 +809,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney Hashtable retparam = new Hashtable(); Hashtable requestData = (Hashtable) request.Params[0]; - LLUUID agentId = LLUUID.Zero; - LLUUID soundId = LLUUID.Zero; - LLUUID regionId = LLUUID.Zero; + UUID agentId = UUID.Zero; + UUID soundId = UUID.Zero; + UUID regionId = UUID.Zero; - Helpers.TryParse((string) requestData["agentId"], out agentId); - Helpers.TryParse((string) requestData["soundId"], out soundId); - Helpers.TryParse((string) requestData["regionId"], out regionId); + UUID.TryParse((string) requestData["agentId"], out agentId); + UUID.TryParse((string) requestData["soundId"], out soundId); + UUID.TryParse((string) requestData["regionId"], out regionId); string text = (string) requestData["text"]; string secret = (string) requestData["secret"]; @@ -828,9 +828,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney IClientAPI client = LocateClientObject(agentId); if (client != null) { - if (soundId != LLUUID.Zero) - client.SendPlayAttachedSound(soundId, LLUUID.Zero, LLUUID.Zero, 1.0f, 0); - client.SendBlueBoxMessage(LLUUID.Zero, LLUUID.Zero, "", text); + + if (soundId != UUID.Zero) + client.SendPlayAttachedSound(soundId, UUID.Zero, UUID.Zero, 1.0f, 0); + + client.SendBlueBoxMessage(UUID.Zero, UUID.Zero, "", text); + retparam.Add("success", true); } else @@ -843,10 +846,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney retparam.Add("success", false); } } - else - { - retparam.Add("success", false); - } + ret.Value = retparam; return ret; } @@ -856,14 +856,14 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney public XmlRpcResponse quote_func(XmlRpcRequest request) { Hashtable requestData = (Hashtable) request.Params[0]; - LLUUID agentId = LLUUID.Zero; + UUID agentId = UUID.Zero; int amount = 0; Hashtable quoteResponse = new Hashtable(); XmlRpcResponse returnval = new XmlRpcResponse(); if (requestData.ContainsKey("agentId") && requestData.ContainsKey("currencyBuy")) { - Helpers.TryParse((string) requestData["agentId"], out agentId); + UUID.TryParse((string) requestData["agentId"], out agentId); try { amount = (Int32) requestData["currencyBuy"]; @@ -894,11 +894,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney public XmlRpcResponse buy_func(XmlRpcRequest request) { Hashtable requestData = (Hashtable) request.Params[0]; - LLUUID agentId = LLUUID.Zero; + UUID agentId = UUID.Zero; int amount = 0; if (requestData.ContainsKey("agentId") && requestData.ContainsKey("currencyBuy")) { - Helpers.TryParse((string) requestData["agentId"], out agentId); + UUID.TryParse((string) requestData["agentId"], out agentId); try { amount = (Int32) requestData["currencyBuy"]; @@ -906,7 +906,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney catch (InvalidCastException) { } - if (agentId != LLUUID.Zero) + if (agentId != UUID.Zero) { lock (m_KnownClientFunds) { @@ -922,7 +922,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney IClientAPI client = LocateClientObject(agentId); if (client != null) { - SendMoneyBalance(client, agentId, client.SessionId, LLUUID.Zero); + SendMoneyBalance(client, agentId, client.SessionId, UUID.Zero); } } } @@ -974,11 +974,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney Hashtable retparam = new Hashtable(); Hashtable requestData = (Hashtable) request.Params[0]; - LLUUID agentId = LLUUID.Zero; + UUID agentId = UUID.Zero; int amount = 0; if (requestData.ContainsKey("agentId") && requestData.ContainsKey("currencyBuy")) { - Helpers.TryParse((string) requestData["agentId"], out agentId); + UUID.TryParse((string) requestData["agentId"], out agentId); try { amount = (Int32) requestData["currencyBuy"]; @@ -986,7 +986,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney catch (InvalidCastException) { } - if (agentId != LLUUID.Zero) + if (agentId != UUID.Zero) { lock (m_KnownClientFunds) { @@ -1002,7 +1002,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney IClientAPI client = LocateClientObject(agentId); if (client != null) { - SendMoneyBalance(client, agentId, client.SessionId, LLUUID.Zero); + SendMoneyBalance(client, agentId, client.SessionId, UUID.Zero); } } } @@ -1020,7 +1020,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// Ensures that the agent accounting data is set up in this instance. /// /// - private void CheckExistAndRefreshFunds(LLUUID agentID) + private void CheckExistAndRefreshFunds(UUID agentID) { lock (m_KnownClientFunds) { @@ -1043,7 +1043,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// /// /// - private int GetFundsForAgentID(LLUUID AgentID) + private int GetFundsForAgentID(UUID AgentID) { int returnfunds = 0; lock (m_KnownClientFunds) @@ -1060,7 +1060,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney return returnfunds; } - private void SetLocalFundsForAgentID(LLUUID AgentID, int amount) + private void SetLocalFundsForAgentID(UUID AgentID, int amount) { lock (m_KnownClientFunds) { @@ -1084,7 +1084,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// /// /// - private IClientAPI LocateClientObject(LLUUID AgentID) + private IClientAPI LocateClientObject(UUID AgentID) { ScenePresence tPresence = null; IClientAPI rclient = null; @@ -1110,7 +1110,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney return null; } - private Scene LocateSceneClientIn(LLUUID AgentId) + private Scene LocateSceneClientIn(UUID AgentId) { lock (m_scenel) { @@ -1148,7 +1148,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// /// /// - public Scene GetSceneByUUID(LLUUID RegionID) + public Scene GetSceneByUUID(UUID RegionID) { lock (m_scenel) { @@ -1167,7 +1167,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney #region event Handlers - public void requestPayPrice(IClientAPI client, LLUUID objectID) + public void requestPayPrice(IClientAPI client, UUID objectID) { Scene scene = LocateSceneClientIn(client.AgentId); if (scene == null) @@ -1186,7 +1186,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// When the client closes the connection we remove their accounting info from memory to free up resources. /// /// - public void ClientClosed(LLUUID AgentID) + public void ClientClosed(UUID AgentID) { lock (m_KnownClientFunds) { @@ -1204,7 +1204,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// Event called Economy Data Request handler. /// /// - public void EconomyDataRequestHandler(LLUUID agentId) + public void EconomyDataRequestHandler(UUID agentId) { IClientAPI user = LocateClientObject(agentId); @@ -1309,11 +1309,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney if (e.sender != e.receiver) { - sender.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(e.description), GetFundsForAgentID(e.sender)); + sender.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(e.description), GetFundsForAgentID(e.sender)); } if (receiver != null) { - receiver.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(e.description), GetFundsForAgentID(part.OwnerID)); + receiver.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(e.description), GetFundsForAgentID(part.OwnerID)); } } return; @@ -1330,13 +1330,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney { if (sender != null) { - sender.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(e.description), GetFundsForAgentID(e.sender)); + sender.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(e.description), GetFundsForAgentID(e.sender)); } } if (receiver != null) { - receiver.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(e.description), GetFundsForAgentID(e.receiver)); + receiver.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(e.description), GetFundsForAgentID(e.receiver)); } } else @@ -1369,7 +1369,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// Event Handler for when the client logs out. /// /// - private void ClientLoggedOut(LLUUID AgentId) + private void ClientLoggedOut(UUID AgentId) { lock (m_rootAgents) { @@ -1396,7 +1396,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney /// /// /// - private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, LLUUID regionID) + private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID) { lock (m_rootAgents) { @@ -1404,8 +1404,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney { if (avatar.Scene.RegionInfo.originRegionID != m_rootAgents[avatar.UUID]) { - - m_rootAgents[avatar.UUID] = avatar.Scene.RegionInfo.originRegionID; @@ -1527,7 +1525,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney else { string killer = DeadAvatar.Scene.CommsManager.UUIDNameRequestString(part.OwnerID); - DeadAvatar.ControllingClient.SendAgentAlertMessage("You impailed yourself on " + part.Name + " owned by " + killer +"!", true); + DeadAvatar.ControllingClient.SendAgentAlertMessage("You impaled yourself on " + part.Name + " owned by " + killer +"!", true); } //DeadAvatar.Scene. part.ObjectOwner } @@ -1564,8 +1562,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney #endregion - public void ObjectBuy(IClientAPI remoteClient, LLUUID agentID, - LLUUID sessionID, LLUUID groupID, LLUUID categoryID, + public void ObjectBuy(IClientAPI remoteClient, UUID agentID, + UUID sessionID, UUID groupID, UUID categoryID, uint localID, byte saleType, int salePrice) { GetClientFunds(remoteClient); diff --git a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs index 4a98622..0be540d 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs @@ -28,8 +28,8 @@ using System; using System.Collections; using System.Collections.Generic; using System.Reflection; -using libsecondlife; -using libsecondlife.Packets; +using OpenMetaverse; +using OpenMetaverse.Packets; using log4net; using Nini.Config; using Nwc.XmlRpc; @@ -43,10 +43,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private Dictionary> FriendLists = new Dictionary>(); - private Dictionary m_pendingFriendRequests = new Dictionary(); - private Dictionary m_rootAgents = new Dictionary(); - private Dictionary> StoredFriendListUpdates = new Dictionary>(); + private Dictionary> FriendLists = new Dictionary>(); + private Dictionary m_pendingFriendRequests = new Dictionary(); + private Dictionary m_rootAgents = new Dictionary(); + private Dictionary> StoredFriendListUpdates = new Dictionary>(); private List m_scene = new List(); @@ -98,16 +98,16 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends if (requestData.ContainsKey("agent_id") && requestData.ContainsKey("notify_id") && requestData.ContainsKey("status")) { - LLUUID notifyAgentId = LLUUID.Zero; - LLUUID notifyAboutAgentId = LLUUID.Zero; + UUID notifyAgentId = UUID.Zero; + UUID notifyAboutAgentId = UUID.Zero; bool notifyOnlineStatus = false; if ((string)requestData["status"] == "TRUE") notifyOnlineStatus = true; - Helpers.TryParse((string)requestData["notify_id"], out notifyAgentId); + UUID.TryParse((string)requestData["notify_id"], out notifyAgentId); - Helpers.TryParse((string)requestData["agent_id"], out notifyAboutAgentId); + UUID.TryParse((string)requestData["agent_id"], out notifyAboutAgentId); m_log.InfoFormat("[PRESENCE]: Got presence update for {0}, and we're telling {1}, with a status {2}", notifyAboutAgentId.ToString(), notifyAgentId.ToString(), notifyOnlineStatus.ToString()); ScenePresence avatar = GetPresenceFromAgentID(notifyAgentId); if (avatar != null) @@ -189,7 +189,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends } - private void doFriendListUpdateOnline(LLUUID AgentId) + private void doFriendListUpdateOnline(UUID AgentId) { List fl = new List(); @@ -213,7 +213,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends } } - List UpdateUsers = new List(); + List UpdateUsers = new List(); foreach (FriendListItem f in fl) { @@ -226,7 +226,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends } } } - foreach (LLUUID user in UpdateUsers) + foreach (UUID user in UpdateUsers) { ScenePresence av = GetPresenceFromAgentID(user); if (av != null) @@ -245,7 +245,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends if (fli.Friend == AgentId) { fli.onlinestatus = true; - LLUUID[] Agents = new LLUUID[1]; + UUID[] Agents = new UUID[1]; Agents[0] = AgentId; av.ControllingClient.SendAgentOnline(Agents); @@ -266,7 +266,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends } } - private void ClientLoggedOut(LLUUID AgentId) + private void ClientLoggedOut(UUID AgentId) { lock (m_rootAgents) { @@ -284,7 +284,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends lfli = FriendLists[AgentId]; } } - List updateUsers = new List(); + List updateUsers = new List(); foreach (FriendListItem fli in lfli) { if (fli.onlinestatus == true) @@ -352,7 +352,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends ScenePresence av = GetPresenceFromAgentID(updateUsers[i]); if (av != null) { - LLUUID[] agents = new LLUUID[1]; + UUID[] agents = new UUID[1]; agents[0] = AgentId; av.ControllingClient.SendAgentOffline(agents); } @@ -364,7 +364,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends } } - private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, LLUUID regionID) + private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID) { lock (m_rootAgents) { @@ -427,7 +427,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends } } - private ScenePresence GetPresenceFromAgentID(LLUUID AgentID) + private ScenePresence GetPresenceFromAgentID(UUID AgentID) { ScenePresence returnAgent = null; lock (m_scene) @@ -451,11 +451,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends #region FriendRequestHandling - private void OnInstantMessage(IClientAPI client, LLUUID fromAgentID, - LLUUID fromAgentSession, LLUUID toAgentID, - LLUUID imSessionID, uint timestamp, string fromAgentName, + private void OnInstantMessage(IClientAPI client, UUID fromAgentID, + UUID fromAgentSession, UUID toAgentID, + UUID imSessionID, uint timestamp, string fromAgentName, string message, byte dialog, bool fromGroup, byte offline, - uint ParentEstateID, LLVector3 Position, LLUUID RegionID, + uint ParentEstateID, Vector3 Position, UUID RegionID, byte[] binaryBucket) { // Friend Requests go by Instant Message.. using the dialog param @@ -464,17 +464,17 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends // 38 == Offer friendship if (dialog == (byte) 38) { - LLUUID friendTransactionID = LLUUID.Random(); + UUID friendTransactionID = UUID.Random(); m_pendingFriendRequests.Add(friendTransactionID, fromAgentID); m_log.Info("[FRIEND]: 38 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" + message); GridInstantMessage msg = new GridInstantMessage(); - msg.fromAgentID = fromAgentID.UUID; - msg.fromAgentSession = fromAgentSession.UUID; - msg.toAgentID = toAgentID.UUID; - msg.imSessionID = friendTransactionID.UUID; // This is the item we're mucking with here + msg.fromAgentID = fromAgentID.Guid; + msg.fromAgentSession = fromAgentSession.Guid; + msg.toAgentID = toAgentID.Guid; + msg.imSessionID = friendTransactionID.Guid; // This is the item we're mucking with here m_log.Info("[FRIEND]: Filling Session: " + msg.imSessionID.ToString()); msg.timestamp = timestamp; if (client != null) @@ -490,8 +490,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends msg.fromGroup = fromGroup; msg.offline = offline; msg.ParentEstateID = ParentEstateID; - msg.Position = new sLLVector3(Position); - msg.RegionID = RegionID.UUID; + msg.Position = Position; + msg.RegionID = RegionID.Guid; msg.binaryBucket = binaryBucket; // We don't really care which scene we pipe it through. m_scene[0].TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); @@ -512,7 +512,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends } } - private void OnApprovedFriendRequest(IClientAPI client, LLUUID agentID, LLUUID transactionID, List callingCardFolders) + private void OnApprovedFriendRequest(IClientAPI client, UUID agentID, UUID transactionID, List callingCardFolders) { if (m_pendingFriendRequests.ContainsKey(transactionID)) { @@ -528,18 +528,18 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends // Compose response to other agent. GridInstantMessage msg = new GridInstantMessage(); - msg.toAgentID = m_pendingFriendRequests[transactionID].UUID; - msg.fromAgentID = agentID.UUID; + msg.toAgentID = m_pendingFriendRequests[transactionID].Guid; + msg.fromAgentID = agentID.Guid; msg.fromAgentName = client.Name; - msg.fromAgentSession = client.SessionId.UUID; + msg.fromAgentSession = client.SessionId.Guid; msg.fromGroup = false; - msg.imSessionID = transactionID.UUID; - msg.message = agentID.UUID.ToString(); + msg.imSessionID = transactionID.Guid; + msg.message = agentID.Guid.ToString(); msg.ParentEstateID = 0; msg.timestamp = (uint) Util.UnixTimeSinceEpoch(); - msg.RegionID = SceneAgentIn.RegionInfo.RegionID.UUID; + msg.RegionID = SceneAgentIn.RegionInfo.RegionID.Guid; msg.dialog = (byte) 39; // Approved friend request - msg.Position = new sLLVector3(); + msg.Position = Vector3.Zero; msg.offline = (byte) 0; msg.binaryBucket = new byte[0]; // We don't really care which scene we pipe it through, it goes to the shared IM Module and/or the database @@ -548,7 +548,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends SceneAgentIn.StoreAddFriendship(m_pendingFriendRequests[transactionID], agentID, (uint) 1); - //LLUUID[] Agents = new LLUUID[1]; + //UUID[] Agents = new UUID[1]; //Agents[0] = msg.toAgentID; //av.ControllingClient.SendAgentOnline(Agents); @@ -557,7 +557,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends } } - private void OnDenyFriendRequest(IClientAPI client, LLUUID agentID, LLUUID transactionID, List callingCardFolders) + private void OnDenyFriendRequest(IClientAPI client, UUID agentID, UUID transactionID, List callingCardFolders) { if (m_pendingFriendRequests.ContainsKey(transactionID)) { @@ -571,18 +571,18 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends } // Compose response to other agent. GridInstantMessage msg = new GridInstantMessage(); - msg.toAgentID = m_pendingFriendRequests[transactionID].UUID; - msg.fromAgentID = agentID.UUID; + msg.toAgentID = m_pendingFriendRequests[transactionID].Guid; + msg.fromAgentID = agentID.Guid; msg.fromAgentName = client.Name; - msg.fromAgentSession = client.SessionId.UUID; + msg.fromAgentSession = client.SessionId.Guid; msg.fromGroup = false; - msg.imSessionID = transactionID.UUID; - msg.message = agentID.UUID.ToString(); + msg.imSessionID = transactionID.Guid; + msg.message = agentID.Guid.ToString(); msg.ParentEstateID = 0; msg.timestamp = (uint) Util.UnixTimeSinceEpoch(); - msg.RegionID = SceneAgentIn.RegionInfo.RegionID.UUID; + msg.RegionID = SceneAgentIn.RegionInfo.RegionID.Guid; msg.dialog = (byte) 40; // Deny friend request - msg.Position = new sLLVector3(); + msg.Position = Vector3.Zero; msg.offline = (byte) 0; msg.binaryBucket = new byte[0]; SceneAgentIn.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); @@ -590,7 +590,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends } } - private void OnTerminateFriendship(IClientAPI client, LLUUID agent, LLUUID exfriendID) + private void OnTerminateFriendship(IClientAPI client, UUID agent, UUID exfriendID) { m_scene[0].StoreRemoveFriendship(agent, exfriendID); // TODO: Inform the client that the ExFriend is offline @@ -599,10 +599,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends private void OnGridInstantMessage(GridInstantMessage msg) { // Trigger the above event handler - OnInstantMessage(null, new LLUUID(msg.fromAgentID), new LLUUID(msg.fromAgentSession), - new LLUUID(msg.toAgentID), new LLUUID(msg.imSessionID), msg.timestamp, msg.fromAgentName, + OnInstantMessage(null, new UUID(msg.fromAgentID), new UUID(msg.fromAgentSession), + new UUID(msg.toAgentID), new UUID(msg.imSessionID), msg.timestamp, msg.fromAgentName, msg.message, msg.dialog, msg.fromGroup, msg.offline, msg.ParentEstateID, - new LLVector3(msg.Position.x, msg.Position.y, msg.Position.z), new LLUUID(msg.RegionID), + new Vector3(msg.Position.X, msg.Position.Y, msg.Position.Z), new UUID(msg.RegionID), msg.binaryBucket); } @@ -611,8 +611,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends public struct StoredFriendListUpdate { - public LLUUID storedFor; - public LLUUID storedAbout; + public UUID storedFor; + public UUID storedAbout; public bool OnlineYN; } } diff --git a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs index eaa5013..ad0cac0 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs @@ -28,7 +28,7 @@ using System; using System.Collections.Generic; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using OpenSim.Framework; @@ -41,11 +41,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private Dictionary m_grouplistmap = new Dictionary(); - private Dictionary m_groupmap = new Dictionary(); - private Dictionary m_iclientmap = new Dictionary(); - private Dictionary m_groupUUIDGroup = new Dictionary(); - private LLUUID opensimulatorGroupID = new LLUUID("00000000-68f9-1111-024e-222222111123"); + private Dictionary m_grouplistmap = new Dictionary(); + private Dictionary m_groupmap = new Dictionary(); + private Dictionary m_iclientmap = new Dictionary(); + private Dictionary m_groupUUIDGroup = new Dictionary(); + private UUID opensimulatorGroupID = new UUID("00000000-68f9-1111-024e-222222111123"); private List m_scene = new List(); @@ -161,13 +161,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups client.SendGroupMembership(updateGroups); } - private void OnAgentDataUpdateRequest(IClientAPI remoteClient, LLUUID AgentID, LLUUID SessionID) + private void OnAgentDataUpdateRequest(IClientAPI remoteClient, UUID AgentID, UUID SessionID) { // Adam, this is one of those impossible to refactor items without resorting to .Split hackery string firstname = remoteClient.FirstName; string lastname = remoteClient.LastName; - LLUUID ActiveGroupID = LLUUID.Zero; + UUID ActiveGroupID = UUID.Zero; uint ActiveGroupPowers = 0; string ActiveGroupName = "OpenSimulator Tester"; string ActiveGroupTitle = "I IZ N0T"; @@ -202,11 +202,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups } } - private void OnInstantMessage(IClientAPI client, LLUUID fromAgentID, - LLUUID fromAgentSession, LLUUID toAgentID, - LLUUID imSessionID, uint timestamp, string fromAgentName, + private void OnInstantMessage(IClientAPI client, UUID fromAgentID, + UUID fromAgentSession, UUID toAgentID, + UUID imSessionID, uint timestamp, string fromAgentName, string message, byte dialog, bool fromGroup, byte offline, - uint ParentEstateID, LLVector3 Position, LLUUID RegionID, + uint ParentEstateID, Vector3 Position, UUID RegionID, byte[] binaryBucket) { } @@ -214,16 +214,16 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups private void OnGridInstantMessage(GridInstantMessage msg) { // Trigger the above event handler - OnInstantMessage(null, new LLUUID(msg.fromAgentID), new LLUUID(msg.fromAgentSession), - new LLUUID(msg.toAgentID), new LLUUID(msg.imSessionID), msg.timestamp, msg.fromAgentName, + OnInstantMessage(null, new UUID(msg.fromAgentID), new UUID(msg.fromAgentSession), + new UUID(msg.toAgentID), new UUID(msg.imSessionID), msg.timestamp, msg.fromAgentName, msg.message, msg.dialog, msg.fromGroup, msg.offline, msg.ParentEstateID, - new LLVector3(msg.Position.x, msg.Position.y, msg.Position.z), new LLUUID(msg.RegionID), + new Vector3(msg.Position.X, msg.Position.Y, msg.Position.Z), new UUID(msg.RegionID), msg.binaryBucket); } - private void HandleUUIDGroupNameRequest(LLUUID id,IClientAPI remote_client) + private void HandleUUIDGroupNameRequest(UUID id,IClientAPI remote_client) { string groupnamereply = "Unknown"; - LLUUID groupUUID = LLUUID.Zero; + UUID groupUUID = UUID.Zero; lock (m_groupUUIDGroup) { @@ -236,7 +236,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups } remote_client.SendGroupNameReply(groupUUID, groupnamereply); } - private void OnClientClosed(LLUUID agentID) + private void OnClientClosed(UUID agentID) { lock (m_iclientmap) { diff --git a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs index bb3303f..6b2de80 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs @@ -30,7 +30,7 @@ using System.Collections.Generic; using System.Reflection; using System.Net; using System.Threading; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using Nwc.XmlRpc; @@ -45,7 +45,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private readonly List m_scenes = new List(); - private Dictionary m_userRegionMap = new Dictionary(); + private Dictionary m_userRegionMap = new Dictionary(); #region IRegionModule Members @@ -106,11 +106,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage client.OnInstantMessage += OnInstantMessage; } - private void OnInstantMessage(IClientAPI client, LLUUID fromAgentID, - LLUUID fromAgentSession, LLUUID toAgentID, - LLUUID imSessionID, uint timestamp, string fromAgentName, + private void OnInstantMessage(IClientAPI client, UUID fromAgentID, + UUID fromAgentSession, UUID toAgentID, + UUID imSessionID, uint timestamp, string fromAgentName, string message, byte dialog, bool fromGroup, byte offline, - uint ParentEstateID, LLVector3 Position, LLUUID RegionID, + uint ParentEstateID, Vector3 Position, UUID RegionID, byte[] binaryBucket) { bool dialogHandledElsewhere @@ -122,8 +122,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage // IM dialogs need to be pre-processed and have their sessionID filled by the server // so the sim can match the transaction on the return packet. - // Don't send a Friend Dialog IM with a LLUUID.Zero session. - if (!(dialogHandledElsewhere && imSessionID == LLUUID.Zero)) + // Don't send a Friend Dialog IM with a UUID.Zero session. + if (!(dialogHandledElsewhere && imSessionID == UUID.Zero)) { // Try root avatar only first foreach (Scene scene in m_scenes) @@ -195,10 +195,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage private void OnGridInstantMessage(GridInstantMessage msg) { // Trigger the above event handler - OnInstantMessage(null, new LLUUID(msg.fromAgentID), new LLUUID(msg.fromAgentSession), - new LLUUID(msg.toAgentID), new LLUUID(msg.imSessionID), msg.timestamp, msg.fromAgentName, + OnInstantMessage(null, new UUID(msg.fromAgentID), new UUID(msg.fromAgentSession), + new UUID(msg.toAgentID), new UUID(msg.imSessionID), msg.timestamp, msg.fromAgentName, msg.message, msg.dialog, msg.fromGroup, msg.offline, msg.ParentEstateID, - new LLVector3(msg.Position.x, msg.Position.y, msg.Position.z), new LLUUID(msg.RegionID), + new Vector3(msg.Position.X, msg.Position.Y, msg.Position.Z), new UUID(msg.RegionID), msg.binaryBucket); } @@ -214,10 +214,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage { bool successful = false; // various rational defaults - LLUUID fromAgentID = LLUUID.Zero; - LLUUID fromAgentSession = LLUUID.Zero; - LLUUID toAgentID = LLUUID.Zero; - LLUUID imSessionID = LLUUID.Zero; + UUID fromAgentID = UUID.Zero; + UUID fromAgentSession = UUID.Zero; + UUID toAgentID = UUID.Zero; + UUID imSessionID = UUID.Zero; uint timestamp = 0; string fromAgentName = ""; string message = ""; @@ -225,8 +225,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage bool fromGroup = false; byte offline = (byte)0; uint ParentEstateID=0; - LLVector3 Position = LLVector3.Zero; - LLUUID RegionID = LLUUID.Zero ; + Vector3 Position = Vector3.Zero; + UUID RegionID = UUID.Zero ; byte[] binaryBucket = new byte[0]; float pos_x = 0; @@ -248,11 +248,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage && requestData.ContainsKey("binary_bucket") && requestData.ContainsKey("region_handle")) { // Do the easy way of validating the UUIDs - Helpers.TryParse((string)requestData["from_agent_id"], out fromAgentID); - Helpers.TryParse((string)requestData["from_agent_session"], out fromAgentSession); - Helpers.TryParse((string)requestData["to_agent_id"], out toAgentID); - Helpers.TryParse((string)requestData["im_session_id"], out imSessionID); - Helpers.TryParse((string)requestData["region_id"], out RegionID); + UUID.TryParse((string)requestData["from_agent_id"], out fromAgentID); + UUID.TryParse((string)requestData["from_agent_session"], out fromAgentSession); + UUID.TryParse((string)requestData["to_agent_id"], out toAgentID); + UUID.TryParse((string)requestData["im_session_id"], out imSessionID); + UUID.TryParse((string)requestData["region_id"], out RegionID); # region timestamp try @@ -345,24 +345,24 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage } # endregion - Position = new LLVector3(pos_x, pos_y, pos_z); + Position = new Vector3(pos_x, pos_y, pos_z); binaryBucket = Convert.FromBase64String((string)requestData["binary_bucket"]); // Create a New GridInstantMessageObject the the data GridInstantMessage gim = new GridInstantMessage(); - gim.fromAgentID = fromAgentID.UUID; + gim.fromAgentID = fromAgentID.Guid; gim.fromAgentName = fromAgentName; - gim.fromAgentSession = fromAgentSession.UUID; + gim.fromAgentSession = fromAgentSession.Guid; gim.fromGroup = fromGroup; - gim.imSessionID = imSessionID.UUID; - gim.RegionID = RegionID.UUID; + gim.imSessionID = imSessionID.Guid; + gim.RegionID = RegionID.Guid; gim.timestamp = timestamp; - gim.toAgentID = toAgentID.UUID; + gim.toAgentID = toAgentID.Guid; gim.message = message; gim.dialog = dialog; gim.offline = offline; gim.ParentEstateID = ParentEstateID; - gim.Position = new sLLVector3(Position); + gim.Position = Position; gim.binaryBucket = binaryBucket; @@ -418,11 +418,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage /// /// /// - public delegate void GridInstantMessageDelegate(IClientAPI client, LLUUID fromAgentID, - LLUUID fromAgentSession, LLUUID toAgentID, - LLUUID imSessionID, uint timestamp, string fromAgentName, + public delegate void GridInstantMessageDelegate(IClientAPI client, UUID fromAgentID, + UUID fromAgentSession, UUID toAgentID, + UUID imSessionID, uint timestamp, string fromAgentName, string message, byte dialog, bool fromGroup, byte offline, - uint ParentEstateID, LLVector3 Position, LLUUID RegionID, + uint ParentEstateID, Vector3 Position, UUID RegionID, byte[] binaryBucket, ulong regionhandle, ulong prevRegionHandle); private void GridInstantMessageCompleted(IAsyncResult iar) @@ -432,11 +432,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage } - protected virtual void SendGridInstantMessageViaXMLRPC(IClientAPI client, LLUUID fromAgentID, - LLUUID fromAgentSession, LLUUID toAgentID, - LLUUID imSessionID, uint timestamp, string fromAgentName, + protected virtual void SendGridInstantMessageViaXMLRPC(IClientAPI client, UUID fromAgentID, + UUID fromAgentSession, UUID toAgentID, + UUID imSessionID, uint timestamp, string fromAgentName, string message, byte dialog, bool fromGroup, byte offline, - uint ParentEstateID, LLVector3 Position, LLUUID RegionID, + uint ParentEstateID, Vector3 Position, UUID RegionID, byte[] binaryBucket, ulong regionhandle, ulong prevRegionHandle) { GridInstantMessageDelegate d = SendGridInstantMessageViaXMLRPCAsync; @@ -459,11 +459,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage /// if it's the same as the user's looked up region handle, then we end the recursive loop /// /// - protected virtual void SendGridInstantMessageViaXMLRPCAsync(IClientAPI client, LLUUID fromAgentID, - LLUUID fromAgentSession, LLUUID toAgentID, - LLUUID imSessionID, uint timestamp, string fromAgentName, + protected virtual void SendGridInstantMessageViaXMLRPCAsync(IClientAPI client, UUID fromAgentID, + UUID fromAgentSession, UUID toAgentID, + UUID imSessionID, uint timestamp, string fromAgentName, string message, byte dialog, bool fromGroup, byte offline, - uint ParentEstateID, LLVector3 Position, LLUUID RegionID, + uint ParentEstateID, Vector3 Position, UUID RegionID, byte[] binaryBucket, ulong regionhandle, ulong prevRegionHandle) { UserAgentData upd = null; @@ -527,10 +527,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage if (reginfo != null) { GridInstantMessage msg = new GridInstantMessage(); - msg.fromAgentID = fromAgentID.UUID; - msg.fromAgentSession = fromAgentSession.UUID; - msg.toAgentID = toAgentID.UUID; - msg.imSessionID = imSessionID.UUID; + msg.fromAgentID = fromAgentID.Guid; + msg.fromAgentSession = fromAgentSession.Guid; + msg.toAgentID = toAgentID.Guid; + msg.imSessionID = imSessionID.Guid; msg.timestamp = timestamp; msg.fromAgentName = fromAgentName; msg.message = message; @@ -538,8 +538,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage msg.fromGroup = fromGroup; msg.offline = offline; msg.ParentEstateID = ParentEstateID; - msg.Position = new sLLVector3(Position); - msg.RegionID = RegionID.UUID; + msg.Position = Position; + msg.RegionID = RegionID.Guid; msg.binaryBucket = binaryBucket; Hashtable msgdata = ConvertGridInstantMessageToXMLRPC(msg); @@ -649,7 +649,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage /// /// UUID of region to get the region handle for /// - private ulong getLocalRegionHandleFromUUID(LLUUID regionID) + private ulong getLocalRegionHandleFromUUID(UUID regionID) { ulong returnhandle = 0; @@ -692,13 +692,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage byte[] offlinedata = new byte[1]; offlinedata[0] = msg.offline; gim["offline"] = Convert.ToBase64String(offlinedata, Base64FormattingOptions.None); gim["parent_estate_id"] = msg.ParentEstateID.ToString(); - gim["position_x"] = msg.Position.x.ToString(); - gim["position_y"] = msg.Position.y.ToString(); - gim["position_z"] = msg.Position.z.ToString(); + gim["position_x"] = msg.Position.X.ToString(); + gim["position_y"] = msg.Position.Y.ToString(); + gim["position_z"] = msg.Position.Z.ToString(); gim["region_id"] = msg.RegionID.ToString(); gim["binary_bucket"] = Convert.ToBase64String(msg.binaryBucket,Base64FormattingOptions.None); return gim; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs index d036dbb..344cb5e 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs @@ -27,7 +27,7 @@ using System.Collections.Generic; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using OpenSim.Framework; @@ -46,10 +46,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory /// occurs in the initial offer message, not the accept message. So this dictionary links /// IM Session Ids to ItemIds /// - private IDictionary m_pendingOffers = new Dictionary(); + private IDictionary m_pendingOffers = new Dictionary(); private List m_Scenelist = new List(); - private Dictionary m_AgentRegions = new Dictionary(); + private Dictionary m_AgentRegions = new Dictionary(); #region IRegionModule Members @@ -92,11 +92,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory client.OnInstantMessage += OnInstantMessage; } - private void OnInstantMessage(IClientAPI client, LLUUID fromAgentID, - LLUUID fromAgentSession, LLUUID toAgentID, - LLUUID imSessionID, uint timestamp, string fromAgentName, + private void OnInstantMessage(IClientAPI client, UUID fromAgentID, + UUID fromAgentSession, UUID toAgentID, + UUID imSessionID, uint timestamp, string fromAgentName, string message, byte dialog, bool fromGroup, byte offline, - uint ParentEstateID, LLVector3 Position, LLUUID RegionID, + uint ParentEstateID, Vector3 Position, UUID RegionID, byte[] binaryBucket) { if (dialog == (byte) InstantMessageDialog.InventoryOffered) @@ -117,8 +117,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory // Next 16 bytes are the UUID //Array.Copy(binaryBucket, 1, rawId, 0, 16); - //LLUUID itemId = new LLUUID(new Guid(rawId)); - LLUUID itemId = new LLUUID(binaryBucket, 1); + //UUID itemId = new UUID(new Guid(rawId)); + UUID itemId = new UUID(binaryBucket, 1); m_log.DebugFormat( "[AGENT INVENTORY]: ItemId for giving is {0}", itemId); @@ -225,12 +225,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory } } - public void SetRootAgentScene(LLUUID agentID, Scene scene) + public void SetRootAgentScene(UUID agentID, Scene scene) { m_AgentRegions[agentID] = scene; } - public bool NeedSceneCacheClear(LLUUID agentID, Scene scene) + public bool NeedSceneCacheClear(UUID agentID, Scene scene) { if (!m_AgentRegions.ContainsKey(agentID)) { @@ -279,7 +279,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory return false; } - public void ClientLoggedOut(LLUUID agentID) + public void ClientLoggedOut(UUID agentID) { if (m_AgentRegions.ContainsKey(agentID)) m_AgentRegions.Remove(agentID); diff --git a/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs index 20b1c1c..f9c0dcf 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs @@ -27,7 +27,7 @@ using System; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using OpenSim.Framework; @@ -90,7 +90,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Profiles /// /// /// - public void RequestAvatarProperty(IClientAPI remoteClient, LLUUID avatarID) + public void RequestAvatarProperty(IClientAPI remoteClient, UUID avatarID) { // FIXME: finish adding fields such as url, masking, etc. UserProfileData profile = m_scene.CommsManager.UserService.GetUserProfile(avatarID); @@ -104,7 +104,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Profiles } else { - charterMember = Helpers.StringToField(profile.CustomType); + charterMember = Utils.StringToBytes(profile.CustomType); } remoteClient.SendAvatarProperties(profile.ID, profile.AboutText, diff --git a/OpenSim/Region/Environment/Modules/Avatar/Voice/AsterixVoice/AsteriskVoiceModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Voice/AsterixVoice/AsteriskVoiceModule.cs index 1f41a92..e3a9a45 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Voice/AsterixVoice/AsteriskVoiceModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Voice/AsterixVoice/AsteriskVoiceModule.cs @@ -28,7 +28,7 @@ using System; using System.Collections; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using Nwc.XmlRpc; @@ -125,7 +125,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.AsterixVoice #endregion - public void OnRegisterCaps(LLUUID agentID, Caps caps) + public void OnRegisterCaps(UUID agentID, Caps caps) { m_log.DebugFormat("[ASTERISKVOICE] OnRegisterCaps: agentID {0} caps {1}", agentID, caps); string capsBase = "/CAPS/" + caps.CapsObjectPath; @@ -157,7 +157,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.AsterixVoice /// /// public string ParcelVoiceInfoRequest(string request, string path, string param, - LLUUID agentID, Caps caps) + UUID agentID, Caps caps) { // we need to do: // - send channel_uri: as "sip:regionID@m_sipDomain" @@ -226,7 +226,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.AsterixVoice /// /// public string ProvisionVoiceAccountRequest(string request, string path, string param, - LLUUID agentID, Caps caps) + UUID agentID, Caps caps) { // we need to // - get user data from UserProfileCacheService @@ -289,4 +289,4 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.AsterixVoice } } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/Avatar/Voice/SIPVoice/SIPVoiceModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Voice/SIPVoice/SIPVoiceModule.cs index c6852f7..bd89175 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Voice/SIPVoice/SIPVoiceModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Voice/SIPVoice/SIPVoiceModule.cs @@ -28,7 +28,7 @@ using System; using System.Collections; using System.Reflection; -using libsecondlife; +using OpenMetaverse; using log4net; using Nini.Config; using OpenSim.Framework; @@ -98,7 +98,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.SIPVoice #endregion - public void OnRegisterCaps(LLUUID agentID, Caps caps) + public void OnRegisterCaps(UUID agentID, Caps caps) { m_log.DebugFormat("[VOICE] OnRegisterCaps: agentID {0} caps {1}", agentID, caps); string capsBase = "/CAPS/" + caps.CapsObjectPath; @@ -130,7 +130,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.SIPVoice /// /// public string ParcelVoiceInfoRequest(string request, string path, string param, - LLUUID agentID, Caps caps) + UUID agentID, Caps caps) { try { @@ -172,7 +172,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.SIPVoice /// /// public string ProvisionVoiceAccountRequest(string request, string path, string param, - LLUUID agentID, Caps caps) + UUID agentID, Caps caps) { try { @@ -199,4 +199,4 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Voice.SIPVoice return null; } } -} \ No newline at end of file +} -- cgit v1.1