diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLUserData.cs | 18 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLUserData.cs | 18 | ||||
-rw-r--r-- | OpenSim/Data/NHibernate/NHibernateUserData.cs | 4 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteUserData.cs | 18 | ||||
-rw-r--r-- | OpenSim/Data/UserDataBase.cs | 14 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 22 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 7 |
7 files changed, 60 insertions, 41 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLUserData.cs b/OpenSim/Data/MSSQL/MSSQLUserData.cs index 4904bfe..844b7fa 100644 --- a/OpenSim/Data/MSSQL/MSSQLUserData.cs +++ b/OpenSim/Data/MSSQL/MSSQLUserData.cs | |||
@@ -747,15 +747,15 @@ namespace OpenSim.Data.MSSQL | |||
747 | 747 | ||
748 | /// Appearance | 748 | /// Appearance |
749 | /// TODO: stubs for now to get us to a compiling state gently | 749 | /// TODO: stubs for now to get us to a compiling state gently |
750 | override public AvatarAppearance GetUserAppearance(LLUUID user) | 750 | // override public AvatarAppearance GetUserAppearance(LLUUID user) |
751 | { | 751 | // { |
752 | return new AvatarAppearance(); | 752 | // return new AvatarAppearance(); |
753 | } | 753 | // } |
754 | 754 | ||
755 | override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) | 755 | // override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) |
756 | { | 756 | // { |
757 | return; | 757 | // return; |
758 | } | 758 | // } |
759 | 759 | ||
760 | override public void AddAttachment(LLUUID user, LLUUID item) | 760 | override public void AddAttachment(LLUUID user, LLUUID item) |
761 | { | 761 | { |
diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs index 622a618..a1e1094 100644 --- a/OpenSim/Data/MySQL/MySQLUserData.cs +++ b/OpenSim/Data/MySQL/MySQLUserData.cs | |||
@@ -630,15 +630,15 @@ namespace OpenSim.Data.MySQL | |||
630 | 630 | ||
631 | /// Appearance | 631 | /// Appearance |
632 | /// TODO: stubs for now to get us to a compiling state gently | 632 | /// TODO: stubs for now to get us to a compiling state gently |
633 | override public AvatarAppearance GetUserAppearance(LLUUID user) | 633 | // override public AvatarAppearance GetUserAppearance(LLUUID user) |
634 | { | 634 | // { |
635 | return new AvatarAppearance(); | 635 | // return new AvatarAppearance(); |
636 | } | 636 | // } |
637 | 637 | ||
638 | override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) | 638 | // override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) |
639 | { | 639 | // { |
640 | return; | 640 | // return; |
641 | } | 641 | // } |
642 | 642 | ||
643 | override public void AddAttachment(LLUUID user, LLUUID item) | 643 | override public void AddAttachment(LLUUID user, LLUUID item) |
644 | { | 644 | { |
diff --git a/OpenSim/Data/NHibernate/NHibernateUserData.cs b/OpenSim/Data/NHibernate/NHibernateUserData.cs index 81af4d4..6ba2783 100644 --- a/OpenSim/Data/NHibernate/NHibernateUserData.cs +++ b/OpenSim/Data/NHibernate/NHibernateUserData.cs | |||
@@ -306,7 +306,7 @@ namespace OpenSim.Data.NHibernate | |||
306 | 306 | ||
307 | /// Appearance | 307 | /// Appearance |
308 | /// TODO: stubs for now to get us to a compiling state gently | 308 | /// TODO: stubs for now to get us to a compiling state gently |
309 | override public AvatarAppearance GetUserAppearance(LLUUID user) | 309 | public AvatarAppearance GetUserAppearance(LLUUID user) |
310 | { | 310 | { |
311 | AvatarAppearance appearance; | 311 | AvatarAppearance appearance; |
312 | // TODO: I'm sure I'll have to do something silly here | 312 | // TODO: I'm sure I'll have to do something silly here |
@@ -328,7 +328,7 @@ namespace OpenSim.Data.NHibernate | |||
328 | } | 328 | } |
329 | 329 | ||
330 | 330 | ||
331 | override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) | 331 | public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) |
332 | { | 332 | { |
333 | bool exists = ExistsAppearance(user); | 333 | bool exists = ExistsAppearance(user); |
334 | using (ISession session = factory.OpenSession()) | 334 | using (ISession session = factory.OpenSession()) |
diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs index e80a0a9..8f78e0b 100644 --- a/OpenSim/Data/SQLite/SQLiteUserData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserData.cs | |||
@@ -480,15 +480,15 @@ namespace OpenSim.Data.SQLite | |||
480 | 480 | ||
481 | /// Appearance | 481 | /// Appearance |
482 | /// TODO: stubs for now to get us to a compiling state gently | 482 | /// TODO: stubs for now to get us to a compiling state gently |
483 | override public AvatarAppearance GetUserAppearance(LLUUID user) | 483 | // override public AvatarAppearance GetUserAppearance(LLUUID user) |
484 | { | 484 | // { |
485 | return new AvatarAppearance(); | 485 | // return new AvatarAppearance(); |
486 | } | 486 | // } |
487 | 487 | ||
488 | override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) | 488 | // override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) |
489 | { | 489 | // { |
490 | return; | 490 | // return; |
491 | } | 491 | // } |
492 | 492 | ||
493 | override public void AddAttachment(LLUUID user, LLUUID item) | 493 | override public void AddAttachment(LLUUID user, LLUUID item) |
494 | { | 494 | { |
diff --git a/OpenSim/Data/UserDataBase.cs b/OpenSim/Data/UserDataBase.cs index fb784dc..a4e2941 100644 --- a/OpenSim/Data/UserDataBase.cs +++ b/OpenSim/Data/UserDataBase.cs | |||
@@ -33,6 +33,8 @@ namespace OpenSim.Data | |||
33 | { | 33 | { |
34 | public abstract class UserDataBase : IUserData | 34 | public abstract class UserDataBase : IUserData |
35 | { | 35 | { |
36 | private Dictionary<LLUUID, AvatarAppearance> aplist = new Dictionary<LLUUID, AvatarAppearance>(); | ||
37 | |||
36 | public abstract UserProfileData GetUserByUUID(LLUUID user); | 38 | public abstract UserProfileData GetUserByUUID(LLUUID user); |
37 | public abstract UserProfileData GetUserByName(string fname, string lname); | 39 | public abstract UserProfileData GetUserByName(string fname, string lname); |
38 | public abstract UserAgentData GetAgentByUUID(LLUUID user); | 40 | public abstract UserAgentData GetAgentByUUID(LLUUID user); |
@@ -53,8 +55,16 @@ namespace OpenSim.Data | |||
53 | public abstract string Name {get;} | 55 | public abstract string Name {get;} |
54 | public abstract void Initialise(string connect); | 56 | public abstract void Initialise(string connect); |
55 | public abstract List<AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query); | 57 | public abstract List<AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query); |
56 | public abstract AvatarAppearance GetUserAppearance(LLUUID user); | 58 | public AvatarAppearance GetUserAppearance(LLUUID user) { |
57 | public abstract void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance); | 59 | if (aplist[user] != null) { |
60 | aplist[user] = new AvatarAppearance(); | ||
61 | aplist[user].Owner = user; | ||
62 | } | ||
63 | return aplist[user]; | ||
64 | } | ||
65 | public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) { | ||
66 | aplist[user] = appearance; | ||
67 | } | ||
58 | public abstract void AddAttachment(LLUUID user, LLUUID item); | 68 | public abstract void AddAttachment(LLUUID user, LLUUID item); |
59 | public abstract void RemoveAttachment(LLUUID user, LLUUID item); | 69 | public abstract void RemoveAttachment(LLUUID user, LLUUID item); |
60 | public abstract List<LLUUID> GetAttachments(LLUUID user); | 70 | public abstract List<LLUUID> GetAttachments(LLUUID user); |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 51f2942..1964ef4 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -1797,16 +1797,18 @@ namespace OpenSim.Region.Environment.Scenes | |||
1797 | 1797 | ||
1798 | protected void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance) | 1798 | protected void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance) |
1799 | { | 1799 | { |
1800 | if (m_AvatarFactory == null || | 1800 | appearance = CommsManager.UserService.GetUserAppearance(client.AgentId); |
1801 | !m_AvatarFactory.TryGetAvatarAppearance(client.AgentId, out appearance)) | 1801 | |
1802 | { | 1802 | // if (m_AvatarFactory == null || |
1803 | //not found Appearance | 1803 | // !m_AvatarFactory.TryGetAvatarAppearance(client.AgentId, out appearance)) |
1804 | m_log.Warn("[AVATAR DEBUGGING]: Couldn't fetch avatar appearance from factory, please report this to the opensim mantis"); | 1804 | // { |
1805 | byte[] visualParams; | 1805 | // //not found Appearance |
1806 | AvatarWearable[] wearables; | 1806 | // m_log.Warn("[AVATAR DEBUGGING]: Couldn't fetch avatar appearance from factory, please report this to the opensim mantis"); |
1807 | GetDefaultAvatarAppearance(out wearables, out visualParams); | 1807 | // byte[] visualParams; |
1808 | appearance = new AvatarAppearance(client.AgentId, wearables, visualParams); | 1808 | // AvatarWearable[] wearables; |
1809 | } | 1809 | // GetDefaultAvatarAppearance(out wearables, out visualParams); |
1810 | // appearance = new AvatarAppearance(client.AgentId, wearables, visualParams); | ||
1811 | // } | ||
1810 | } | 1812 | } |
1811 | 1813 | ||
1812 | /// <summary> | 1814 | /// <summary> |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 3815dfb..f8f96a0 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -405,6 +405,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
405 | RegisterToEvents(); | 405 | RegisterToEvents(); |
406 | SetDirectionVectors(); | 406 | SetDirectionVectors(); |
407 | 407 | ||
408 | m_appearance = m_scene.CommsManager.UserService.GetUserAppearance(client.AgentId); | ||
409 | |||
408 | try | 410 | try |
409 | { | 411 | { |
410 | m_scene.LandChannel.SendLandUpdate(this, true); | 412 | m_scene.LandChannel.SendLandUpdate(this, true); |
@@ -1465,6 +1467,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1465 | public void SetWearable(IClientAPI client, int wearableId, AvatarWearable wearable) | 1467 | public void SetWearable(IClientAPI client, int wearableId, AvatarWearable wearable) |
1466 | { | 1468 | { |
1467 | m_appearance.SetWearable(wearableId, wearable); | 1469 | m_appearance.SetWearable(wearableId, wearable); |
1470 | m_scene.CommsManager.UserService.UpdateUserAppearance(client.AgentId, m_appearance); | ||
1468 | client.SendWearables(m_appearance.Wearables, m_appearance.Serial++); | 1471 | client.SendWearables(m_appearance.Wearables, m_appearance.Serial++); |
1469 | } | 1472 | } |
1470 | 1473 | ||
@@ -1506,6 +1509,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1506 | public void SetAppearance(byte[] texture, List<byte> visualParam) | 1509 | public void SetAppearance(byte[] texture, List<byte> visualParam) |
1507 | { | 1510 | { |
1508 | m_appearance.SetAppearance(texture, visualParam); | 1511 | m_appearance.SetAppearance(texture, visualParam); |
1512 | m_scene.CommsManager.UserService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance); | ||
1509 | SetHeight(m_appearance.AvatarHeight); | 1513 | SetHeight(m_appearance.AvatarHeight); |
1510 | 1514 | ||
1511 | SendAppearanceToAllOtherAgents(); | 1515 | SendAppearanceToAllOtherAgents(); |
@@ -1804,6 +1808,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1804 | 1808 | ||
1805 | static ScenePresence() | 1809 | static ScenePresence() |
1806 | { | 1810 | { |
1811 | |||
1807 | LLObject.TextureEntry textu = AvatarAppearance.GetDefaultTexture(); | 1812 | LLObject.TextureEntry textu = AvatarAppearance.GetDefaultTexture(); |
1808 | DefaultTexture = textu.ToBytes(); | 1813 | DefaultTexture = textu.ToBytes(); |
1809 | } | 1814 | } |
@@ -2030,6 +2035,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
2030 | m_controllingClient = client; | 2035 | m_controllingClient = client; |
2031 | m_regionInfo = region; | 2036 | m_regionInfo = region; |
2032 | m_scene = scene; | 2037 | m_scene = scene; |
2038 | m_appearance = m_scene.CommsManager.UserService.GetUserAppearance(client.AgentId); | ||
2039 | |||
2033 | RegisterToEvents(); | 2040 | RegisterToEvents(); |
2034 | 2041 | ||
2035 | /* | 2042 | /* |