aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2013-05-08 21:51:48 +0100
committerMelanie2013-05-08 21:51:48 +0100
commitcdaceea5a633683c713f084d9beb93a14061772f (patch)
tree66798e45deff0d13e78740130dde68955a3ba86c /OpenSim/Region
parentMerge branch 'master' into careminster (diff)
parentGuard the scene list when estates are updated (diff)
downloadopensim-SC_OLD-cdaceea5a633683c713f084d9beb93a14061772f.zip
opensim-SC_OLD-cdaceea5a633683c713f084d9beb93a14061772f.tar.gz
opensim-SC_OLD-cdaceea5a633683c713f084d9beb93a14061772f.tar.bz2
opensim-SC_OLD-cdaceea5a633683c713f084d9beb93a14061772f.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Framework/IClientAPI.cs OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs66
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs59
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/XEstateConnector.cs17
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/XEstateModule.cs6
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs6
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs6
6 files changed, 149 insertions, 11 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 800488d..17b59da 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -84,6 +84,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
84 public event ModifyTerrain OnModifyTerrain; 84 public event ModifyTerrain OnModifyTerrain;
85 public event Action<IClientAPI> OnRegionHandShakeReply; 85 public event Action<IClientAPI> OnRegionHandShakeReply;
86 public event GenericCall1 OnRequestWearables; 86 public event GenericCall1 OnRequestWearables;
87 public event CachedTextureRequest OnCachedTextureRequest;
87 public event SetAppearance OnSetAppearance; 88 public event SetAppearance OnSetAppearance;
88 public event AvatarNowWearing OnAvatarNowWearing; 89 public event AvatarNowWearing OnAvatarNowWearing;
89 public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv; 90 public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv;
@@ -11707,8 +11708,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11707 } 11708 }
11708 11709
11709 /// <summary> 11710 /// <summary>
11710 /// Send a response back to a client when it asks the asset server (via the region server) if it has
11711 /// its appearance texture cached.
11712 /// </summary> 11711 /// </summary>
11713 /// <remarks> 11712 /// <remarks>
11714 /// At the moment, we always reply that there is no cached texture. 11713 /// At the moment, we always reply that there is no cached texture.
@@ -11716,6 +11715,35 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11716 /// <param name="simclient"></param> 11715 /// <param name="simclient"></param>
11717 /// <param name="packet"></param> 11716 /// <param name="packet"></param>
11718 /// <returns></returns> 11717 /// <returns></returns>
11718 // TODO: Convert old handler to use new method
11719 /*protected bool HandleAgentTextureCached(IClientAPI simclient, Packet packet)
11720 {
11721 AgentCachedTexturePacket cachedtex = (AgentCachedTexturePacket)packet;
11722
11723 if (cachedtex.AgentData.SessionID != SessionId)
11724 return false;
11725
11726
11727 List<CachedTextureRequestArg> requestArgs = new List<CachedTextureRequestArg>();
11728
11729 for (int i = 0; i < cachedtex.WearableData.Length; i++)
11730 {
11731 CachedTextureRequestArg arg = new CachedTextureRequestArg();
11732 arg.BakedTextureIndex = cachedtex.WearableData[i].TextureIndex;
11733 arg.WearableHashID = cachedtex.WearableData[i].ID;
11734
11735 requestArgs.Add(arg);
11736 }
11737
11738 CachedTextureRequest handlerCachedTextureRequest = OnCachedTextureRequest;
11739 if (handlerCachedTextureRequest != null)
11740 {
11741 handlerCachedTextureRequest(simclient,cachedtex.AgentData.SerialNum,requestArgs);
11742 }
11743
11744 return true;
11745 }*/
11746
11719 protected bool HandleAgentTextureCached(IClientAPI simclient, Packet packet) 11747 protected bool HandleAgentTextureCached(IClientAPI simclient, Packet packet)
11720 { 11748 {
11721 //m_log.Debug("texture cached: " + packet.ToString()); 11749 //m_log.Debug("texture cached: " + packet.ToString());
@@ -11874,6 +11902,40 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11874 return true; 11902 return true;
11875 } 11903 }
11876 11904
11905 /// <summary>
11906 /// Send a response back to a client when it asks the asset server (via the region server) if it has
11907 /// its appearance texture cached.
11908 /// </summary>
11909 /// <param name="avatar"></param>
11910 /// <param name="serial"></param>
11911 /// <param name="cachedTextures"></param>
11912 /// <returns></returns>
11913 public void SendCachedTextureResponse(ISceneEntity avatar, int serial, List<CachedTextureResponseArg> cachedTextures)
11914 {
11915 ScenePresence presence = avatar as ScenePresence;
11916 if (presence == null)
11917 return;
11918
11919 AgentCachedTextureResponsePacket cachedresp = (AgentCachedTextureResponsePacket)PacketPool.Instance.GetPacket(PacketType.AgentCachedTextureResponse);
11920
11921 // TODO: don't create new blocks if recycling an old packet
11922 cachedresp.AgentData.AgentID = m_agentId;
11923 cachedresp.AgentData.SessionID = m_sessionId;
11924 cachedresp.AgentData.SerialNum = serial;
11925 cachedresp.WearableData = new AgentCachedTextureResponsePacket.WearableDataBlock[cachedTextures.Count];
11926
11927 for (int i = 0; i < cachedTextures.Count; i++)
11928 {
11929 cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock();
11930 cachedresp.WearableData[i].TextureIndex = (byte)cachedTextures[i].BakedTextureIndex;
11931 cachedresp.WearableData[i].TextureID = cachedTextures[i].BakedTextureID;
11932 cachedresp.WearableData[i].HostName = new byte[0];
11933 }
11934
11935 cachedresp.Header.Zerocoded = true;
11936 OutPacket(cachedresp, ThrottleOutPacketType.Task);
11937 }
11938
11877 protected bool HandleMultipleObjUpdate(IClientAPI simClient, Packet packet) 11939 protected bool HandleMultipleObjUpdate(IClientAPI simClient, Packet packet)
11878 { 11940 {
11879 MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet; 11941 MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet;
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index bc79944..09cc998 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -55,6 +55,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
55 55
56 private int m_savetime = 5; // seconds to wait before saving changed appearance 56 private int m_savetime = 5; // seconds to wait before saving changed appearance
57 private int m_sendtime = 2; // seconds to wait before sending changed appearance 57 private int m_sendtime = 2; // seconds to wait before sending changed appearance
58 private bool m_reusetextures = false;
58 59
59 private int m_checkTime = 500; // milliseconds to wait between checks for appearance updates 60 private int m_checkTime = 500; // milliseconds to wait between checks for appearance updates
60 private System.Timers.Timer m_updateTimer = new System.Timers.Timer(); 61 private System.Timers.Timer m_updateTimer = new System.Timers.Timer();
@@ -73,6 +74,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
73 { 74 {
74 m_savetime = Convert.ToInt32(appearanceConfig.GetString("DelayBeforeAppearanceSave",Convert.ToString(m_savetime))); 75 m_savetime = Convert.ToInt32(appearanceConfig.GetString("DelayBeforeAppearanceSave",Convert.ToString(m_savetime)));
75 m_sendtime = Convert.ToInt32(appearanceConfig.GetString("DelayBeforeAppearanceSend",Convert.ToString(m_sendtime))); 76 m_sendtime = Convert.ToInt32(appearanceConfig.GetString("DelayBeforeAppearanceSend",Convert.ToString(m_sendtime)));
77 m_reusetextures = appearanceConfig.GetBoolean("ReuseTextures",m_reusetextures);
78
76 // m_log.InfoFormat("[AVFACTORY] configured for {0} save and {1} send",m_savetime,m_sendtime); 79 // m_log.InfoFormat("[AVFACTORY] configured for {0} save and {1} send",m_savetime,m_sendtime);
77 } 80 }
78 81
@@ -131,6 +134,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
131 client.OnRequestWearables += Client_OnRequestWearables; 134 client.OnRequestWearables += Client_OnRequestWearables;
132 client.OnSetAppearance += Client_OnSetAppearance; 135 client.OnSetAppearance += Client_OnSetAppearance;
133 client.OnAvatarNowWearing += Client_OnAvatarNowWearing; 136 client.OnAvatarNowWearing += Client_OnAvatarNowWearing;
137 client.OnCachedTextureRequest += Client_OnCachedTextureRequest;
134 } 138 }
135 139
136 #endregion 140 #endregion
@@ -1068,6 +1072,61 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
1068 QueueAppearanceSave(client.AgentId); 1072 QueueAppearanceSave(client.AgentId);
1069 } 1073 }
1070 } 1074 }
1075
1076 /// <summary>
1077 /// Respond to the cached textures request from the client
1078 /// </summary>
1079 /// <param name="client"></param>
1080 /// <param name="serial"></param>
1081 /// <param name="cachedTextureRequest"></param>
1082 private void Client_OnCachedTextureRequest(IClientAPI client, int serial, List<CachedTextureRequestArg> cachedTextureRequest)
1083 {
1084 // m_log.WarnFormat("[AVFACTORY]: Client_OnCachedTextureRequest called for {0} ({1})", client.Name, client.AgentId);
1085 ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
1086
1087 List<CachedTextureResponseArg> cachedTextureResponse = new List<CachedTextureResponseArg>();
1088 foreach (CachedTextureRequestArg request in cachedTextureRequest)
1089 {
1090 UUID texture = UUID.Zero;
1091 int index = request.BakedTextureIndex;
1092
1093 if (m_reusetextures)
1094 {
1095 // this is the most insanely dumb way to do this... however it seems to
1096 // actually work. if the appearance has been reset because wearables have
1097 // changed then the texture entries are zero'd out until the bakes are
1098 // uploaded. on login, if the textures exist in the cache (eg if you logged
1099 // into the simulator recently, then the appearance will pull those and send
1100 // them back in the packet and you won't have to rebake. if the textures aren't
1101 // in the cache then the intial makeroot() call in scenepresence will zero
1102 // them out.
1103 //
1104 // a better solution (though how much better is an open question) is to
1105 // store the hashes in the appearance and compare them. Thats's coming.
1106
1107 Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[index];
1108 if (face != null)
1109 texture = face.TextureID;
1110
1111 // m_log.WarnFormat("[AVFACTORY]: reuse texture {0} for index {1}",texture,index);
1112 }
1113
1114 CachedTextureResponseArg response = new CachedTextureResponseArg();
1115 response.BakedTextureIndex = index;
1116 response.BakedTextureID = texture;
1117 response.HostName = null;
1118
1119 cachedTextureResponse.Add(response);
1120 }
1121
1122 // m_log.WarnFormat("[AVFACTORY]: serial is {0}",serial);
1123 // The serial number appears to be used to match requests and responses
1124 // in the texture transaction. We just send back the serial number
1125 // that was provided in the request. The viewer bumps this for us.
1126 client.SendCachedTextureResponse(sp, serial, cachedTextureResponse);
1127 }
1128
1129
1071 #endregion 1130 #endregion
1072 1131
1073 public void WriteBakedTexturesReport(IScenePresence sp, ReportOutputAction outputAction) 1132 public void WriteBakedTexturesReport(IScenePresence sp, ReportOutputAction outputAction)
diff --git a/OpenSim/Region/CoreModules/World/Estate/XEstateConnector.cs b/OpenSim/Region/CoreModules/World/Estate/XEstateConnector.cs
index 948c893..73e706c 100644
--- a/OpenSim/Region/CoreModules/World/Estate/XEstateConnector.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/XEstateConnector.cs
@@ -136,15 +136,18 @@ namespace OpenSim.Region.CoreModules.World.Estate
136 136
137 // Handle local regions locally 137 // Handle local regions locally
138 // 138 //
139 foreach (Scene s in m_EstateModule.Scenes) 139 lock (m_EstateModule.Scenes)
140 { 140 {
141 if (regions.Contains(s.RegionInfo.RegionID)) 141 foreach (Scene s in m_EstateModule.Scenes)
142 { 142 {
143 // All regions in one estate are in the same scope. 143 if (regions.Contains(s.RegionInfo.RegionID))
144 // Use that scope. 144 {
145 // 145 // All regions in one estate are in the same scope.
146 ScopeID = s.RegionInfo.ScopeID; 146 // Use that scope.
147 regions.Remove(s.RegionInfo.RegionID); 147 //
148 ScopeID = s.RegionInfo.ScopeID;
149 regions.Remove(s.RegionInfo.RegionID);
150 }
148 } 151 }
149 } 152 }
150 153
diff --git a/OpenSim/Region/CoreModules/World/Estate/XEstateModule.cs b/OpenSim/Region/CoreModules/World/Estate/XEstateModule.cs
index 1f099c6..f54ab2c 100644
--- a/OpenSim/Region/CoreModules/World/Estate/XEstateModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/XEstateModule.cs
@@ -93,7 +93,8 @@ namespace OpenSim.Region.CoreModules.World.Estate
93 93
94 public void AddRegion(Scene scene) 94 public void AddRegion(Scene scene)
95 { 95 {
96 m_Scenes.Add(scene); 96 lock (m_Scenes)
97 m_Scenes.Add(scene);
97 98
98 scene.EventManager.OnNewClient += OnNewClient; 99 scene.EventManager.OnNewClient += OnNewClient;
99 } 100 }
@@ -111,7 +112,8 @@ namespace OpenSim.Region.CoreModules.World.Estate
111 { 112 {
112 scene.EventManager.OnNewClient -= OnNewClient; 113 scene.EventManager.OnNewClient -= OnNewClient;
113 114
114 m_Scenes.Remove(scene); 115 lock (m_Scenes)
116 m_Scenes.Remove(scene);
115 } 117 }
116 118
117 public string Name 119 public string Name
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index 686c605..550f089 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -660,6 +660,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
660 public event BakeTerrain OnBakeTerrain; 660 public event BakeTerrain OnBakeTerrain;
661 public event EstateChangeInfo OnEstateChangeInfo; 661 public event EstateChangeInfo OnEstateChangeInfo;
662 public event EstateManageTelehub OnEstateManageTelehub; 662 public event EstateManageTelehub OnEstateManageTelehub;
663 public event CachedTextureRequest OnCachedTextureRequest;
663 public event SetAppearance OnSetAppearance; 664 public event SetAppearance OnSetAppearance;
664 public event AvatarNowWearing OnAvatarNowWearing; 665 public event AvatarNowWearing OnAvatarNowWearing;
665 public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv; 666 public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv;
@@ -943,7 +944,12 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
943 { 944 {
944 945
945 } 946 }
947
948 public void SendCachedTextureResponse(ISceneEntity avatar, int serial, List<CachedTextureResponseArg> cachedTextures)
949 {
946 950
951 }
952
947 public void SendStartPingCheck(byte seq) 953 public void SendStartPingCheck(byte seq)
948 { 954 {
949 955
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 7918c22..d1bb547 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -393,6 +393,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
393 public event EstateTeleportAllUsersHomeRequest OnEstateTeleportAllUsersHomeRequest; 393 public event EstateTeleportAllUsersHomeRequest OnEstateTeleportAllUsersHomeRequest;
394 public event EstateChangeInfo OnEstateChangeInfo; 394 public event EstateChangeInfo OnEstateChangeInfo;
395 public event EstateManageTelehub OnEstateManageTelehub; 395 public event EstateManageTelehub OnEstateManageTelehub;
396 public event CachedTextureRequest OnCachedTextureRequest;
396 public event ScriptReset OnScriptReset; 397 public event ScriptReset OnScriptReset;
397 public event GetScriptRunning OnGetScriptRunning; 398 public event GetScriptRunning OnGetScriptRunning;
398 public event SetScriptRunning OnSetScriptRunning; 399 public event SetScriptRunning OnSetScriptRunning;
@@ -573,6 +574,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC
573 { 574 {
574 } 575 }
575 576
577 public void SendCachedTextureResponse(ISceneEntity avatar, int serial, List<CachedTextureResponseArg> cachedTextures)
578 {
579
580 }
581
576 public virtual void Kick(string message) 582 public virtual void Kick(string message)
577 { 583 {
578 } 584 }