Border crossing in multi-region CMs and many debug messages for appearance

dsg
Robert Adams 2010-10-14 14:31:28 -07:00
parent 32b9a8d78d
commit de9427e545
10 changed files with 93 additions and 36 deletions

View File

@ -428,6 +428,7 @@ namespace OpenSim.Framework
public static Primitive.TextureEntry GetDefaultTexture() public static Primitive.TextureEntry GetDefaultTexture()
{ {
Primitive.TextureEntry textu = new Primitive.TextureEntry(new UUID("C228D1CF-4B5D-4BA8-84F4-899A0796AA97")); Primitive.TextureEntry textu = new Primitive.TextureEntry(new UUID("C228D1CF-4B5D-4BA8-84F4-899A0796AA97"));
/* recommended by MB
textu.CreateFace(0).TextureID = new UUID("00000000-0000-1111-9999-000000000012"); textu.CreateFace(0).TextureID = new UUID("00000000-0000-1111-9999-000000000012");
textu.CreateFace(1).TextureID = Util.BLANK_TEXTURE_UUID; textu.CreateFace(1).TextureID = Util.BLANK_TEXTURE_UUID;
textu.CreateFace(2).TextureID = Util.BLANK_TEXTURE_UUID; textu.CreateFace(2).TextureID = Util.BLANK_TEXTURE_UUID;
@ -435,6 +436,7 @@ namespace OpenSim.Framework
textu.CreateFace(4).TextureID = new UUID("7CA39B4C-BD19-4699-AFF7-F93FD03D3E7B"); textu.CreateFace(4).TextureID = new UUID("7CA39B4C-BD19-4699-AFF7-F93FD03D3E7B");
textu.CreateFace(5).TextureID = new UUID("00000000-0000-1111-9999-000000000010"); textu.CreateFace(5).TextureID = new UUID("00000000-0000-1111-9999-000000000010");
textu.CreateFace(6).TextureID = new UUID("00000000-0000-1111-9999-000000000011"); textu.CreateFace(6).TextureID = new UUID("00000000-0000-1111-9999-000000000011");
*/
return textu; return textu;
} }

View File

@ -5630,10 +5630,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// What would happen if we ignore any SetAppearance packet that does not include textures? // What would happen if we ignore any SetAppearance packet that does not include textures?
if (te == null) if (te == null)
{ {
//m_log.WarnFormat("[LLCLIENTVIEW] Received SetAppearance from {0} ( )", Name); m_log.WarnFormat("[LLCLIENTVIEW] Received SetAppearance from {0} ( )", Name);
return true; return true;
} }
//m_log.WarnFormat("[LLCLIENTVIEW] Received SetAppearance from {0} (TE)", Name); m_log.WarnFormat("[LLCLIENTVIEW] Received SetAppearance from {0} (TE)", Name);
if (handlerSetAppearanceRaw != null) if (handlerSetAppearanceRaw != null)
handlerSetAppearanceRaw(this, AgentId, visualparams, te); handlerSetAppearanceRaw(this, AgentId, visualparams, te);
if (handlerSetAppearance != null) if (handlerSetAppearance != null)

View File

@ -1199,6 +1199,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
protected List<GridRegion> RequestNeighbours(Scene pScene, uint pRegionLocX, uint pRegionLocY) protected List<GridRegion> RequestNeighbours(Scene pScene, uint pRegionLocX, uint pRegionLocY)
{ {
m_log.DebugFormat("[ENTITY TRANSFER MODULE] Request neighbors for {0} at {1}/{2}",
pScene.RegionInfo.RegionName, pRegionLocX, pRegionLocY);
RegionInfo m_regionInfo = pScene.RegionInfo; RegionInfo m_regionInfo = pScene.RegionInfo;
Border[] northBorders = pScene.NorthBorders.ToArray(); Border[] northBorders = pScene.NorthBorders.ToArray();

View File

@ -350,6 +350,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
return; return;
} }
m_log.DebugFormat("{0} Handle NewAvater for \"{1} {2}\"", LogHeader, first, last);
if (m_remoteAvatars.ContainsKey(agentID)) if (m_remoteAvatars.ContainsKey(agentID))
{ {
RegionSyncMessage.HandleWarning(LogHeader, msg, String.Format("Attempted to add duplicate avatar \"{0} {1}\" ({2})", first, last, agentID.ToString())); RegionSyncMessage.HandleWarning(LogHeader, msg, String.Format("Attempted to add duplicate avatar \"{0} {1}\" ({2})", first, last, agentID.ToString()));
@ -720,7 +721,9 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
Send(new RegionSyncMessage(RegionSyncMessage.MsgType.GetAvatars)); Send(new RegionSyncMessage(RegionSyncMessage.MsgType.GetAvatars));
// Register for events which will be forwarded to authoritative scene // Register for events which will be forwarded to authoritative scene
m_scene.EventManager.OnNewClient += EventManager_OnNewClient; // m_scene.EventManager.OnNewClient += EventManager_OnNewClient;
m_scene.EventManager.OnMakeRootAgent += EventManager_OnMakeRootAgent;
m_scene.EventManager.OnMakeChildAgent += EventManager_OnMakeChildAgent;
m_scene.EventManager.OnClientClosed += new EventManager.ClientClosed(RemoveLocalClient); m_scene.EventManager.OnClientClosed += new EventManager.ClientClosed(RemoveLocalClient);
} }
@ -730,8 +733,10 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
} }
#region MESSAGES SENT FROM CLIENT MANAGER TO SIM #region MESSAGES SENT FROM CLIENT MANAGER TO SIM
public void EventManager_OnNewClient(IClientAPI client) // public void EventManager_OnNewClient(IClientAPI client)
public void EventManager_OnMakeRootAgent(ScenePresence scenep)
{ {
IClientAPI client = scenep.ControllingClient;
// If this client was added in response to NewAvatar message from a synced server, // If this client was added in response to NewAvatar message from a synced server,
// don't subscribe to events or send back to server // don't subscribe to events or send back to server
if (RemoteAvatars.ContainsKey(client.AgentId)) if (RemoteAvatars.ContainsKey(client.AgentId))
@ -747,7 +752,9 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
newlocals.Add(client.AgentId, client); newlocals.Add(client.AgentId, client);
m_localAvatars = newlocals; m_localAvatars = newlocals;
} }
m_log.WarnFormat("{0} New local client \"{1}\" ({2}) being added to remote scene.", LogHeader, client.Name, client.AgentId.ToString());
m_log.WarnFormat("{0} New local client \"{1}\" ({2}) being added to remote scene.",
LogHeader, client.Name, client.AgentId.ToString());
// Let the auth sim know that a new agent has connected // Let the auth sim know that a new agent has connected
OSDMap data = new OSDMap(4); OSDMap data = new OSDMap(4);
data["agentID"] = OSD.FromUUID(client.AgentId); data["agentID"] = OSD.FromUUID(client.AgentId);
@ -763,6 +770,17 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
client.OnChatFromClientRaw += HandleChatFromClientRaw; client.OnChatFromClientRaw += HandleChatFromClientRaw;
} }
public void EventManager_OnMakeChildAgent(ScenePresence scenep)
{
// if demoting from root, tell the server not to track our child
m_log.DebugFormat("{0} Demotion to child. Sending remove for {1}/{2}",
LogHeader, scenep.ControllingClient.Name, scenep.ControllingClient.AgentId);
OSDMap data = new OSDMap(1);
data["agentID"] = OSD.FromUUID(scenep.ControllingClient.AgentId);
Send(new RegionSyncMessage(RegionSyncMessage.MsgType.AgentRemove, OSDParser.SerializeJsonString(data)));
return;
}
private void RemoveLocalClient(UUID clientID, Scene scene) private void RemoveLocalClient(UUID clientID, Scene scene)
{ {
// If the client closed due to load balancing, the presence will stick around // If the client closed due to load balancing, the presence will stick around

View File

@ -69,8 +69,10 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
m_active = true; m_active = true;
m_scene.RegionSyncEnabled = true; m_scene.RegionSyncEnabled = true;
m_scene.RegionSyncMode = "client"; m_scene.RegionSyncMode = "client";
m_serveraddr = syncConfig.GetString("ServerIPAddress", "127.0.0.1"); string serverAddrDefault = syncConfig.GetString("ServerIPAddress", "127.0.0.1");
m_serverport = syncConfig.GetInt("ServerPort", 13000); m_serveraddr = syncConfig.GetString(scene.RegionInfo.RegionName+"_ServerIPAddress", serverAddrDefault);
int serverPortDefault = syncConfig.GetInt("ServerPort", 13000);
m_serverport = syncConfig.GetInt(scene.RegionInfo.RegionName+"_ServerPort", serverPortDefault);
m_scene.RegisterModuleInterface<IRegionSyncClientModule>(this); m_scene.RegisterModuleInterface<IRegionSyncClientModule>(this);
// Setup the command line interface // Setup the command line interface

View File

@ -462,7 +462,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
case RegionSyncMessage.MsgType.AvatarAppearance: case RegionSyncMessage.MsgType.AvatarAppearance:
{ {
int msgID = msgCount; int msgID = msgCount;
//m_log.WarnFormat("{0} START of AvatarAppearance handler <{1}>", LogHeader, msgID); m_log.DebugFormat("{0} START of AvatarAppearance handler <{1}>", LogHeader, msgID);
// Get the data from message and error check // Get the data from message and error check
OSDMap data = DeserializeMessage(msg); OSDMap data = DeserializeMessage(msg);
if (data == null) if (data == null)
@ -507,7 +507,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
} }
} }
//m_log.WarnFormat("{0} {1} Calling presence.SetAppearance {2} <{3}>", LogHeader, name, (missingBakes ? "MISSING BAKES" : "GOT BAKES"), msgID); m_log.DebugFormat("{0} {1} Calling presence.SetAppearance {2} <{3}>", LogHeader, name, (missingBakes ? "MISSING BAKES" : "GOT BAKES"), msgID);
try try
{ {
presence.SetAppearance(te, vp); presence.SetAppearance(te, vp);
@ -520,7 +520,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
RegionSyncMessage.HandleSuccess(LogHeader, msg, String.Format("Set appearance for {0} <{1}>", name, msgID)); RegionSyncMessage.HandleSuccess(LogHeader, msg, String.Format("Set appearance for {0} <{1}>", name, msgID));
else else
RegionSyncMessage.HandleWarning(LogHeader, msg, String.Format("Set appearance for {0} but has missing bakes. <{1}>", name, msgID)); RegionSyncMessage.HandleWarning(LogHeader, msg, String.Format("Set appearance for {0} but has missing bakes. <{1}>", name, msgID));
//m_log.WarnFormat("{0} Calling RegionsSyncServerModule.SendAppearance for {1} {2} <{3}>", LogHeader, name, (missingBakes ? "MISSING BAKES" : "GOT BAKES"), msgID); m_log.DebugFormat("{0} Calling RegionsSyncServerModule.SendAppearance for {1} {2} <{3}>", LogHeader, name, (missingBakes ? "MISSING BAKES" : "GOT BAKES"), msgID);
m_scene.RegionSyncServerModule.SendAppearance(presence.UUID, presence.Appearance.VisualParams, presence.Appearance.Texture); m_scene.RegionSyncServerModule.SendAppearance(presence.UUID, presence.Appearance.VisualParams, presence.Appearance.Texture);
lock (m_appearanceTimers) lock (m_appearanceTimers)
m_appearanceTimers.Remove(agentID); m_appearanceTimers.Remove(agentID);

View File

@ -118,7 +118,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
while (true) while (true)
{ {
// *** Move/Add TRY/CATCH to here, but we don't want to spin loop on the same error // *** Move/Add TRY/CATCH to here, but we don't want to spin loop on the same error
m_log.WarnFormat("[REGION SYNC SERVER] Listening for new connections on port {0}...", m_port.ToString()); m_log.WarnFormat("[REGION SYNC SERVER] Listening for new connections on {0}:{1}...", m_addr.ToString(), m_port.ToString());
TcpClient tcpclient = m_listener.AcceptTcpClient(); TcpClient tcpclient = m_listener.AcceptTcpClient();
IPAddress addr = ((IPEndPoint)tcpclient.Client.RemoteEndPoint).Address; IPAddress addr = ((IPEndPoint)tcpclient.Client.RemoteEndPoint).Address;
int port = ((IPEndPoint)tcpclient.Client.RemoteEndPoint).Port; int port = ((IPEndPoint)tcpclient.Client.RemoteEndPoint).Port;

View File

@ -323,7 +323,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
m_log.WarnFormat("[REGION SYNC SERVER MODULE] <{0}> {1} SendAppearance could not locate presence!", " ", agentID); m_log.WarnFormat("[REGION SYNC SERVER MODULE] <{0}> {1} SendAppearance could not locate presence!", " ", agentID);
return; return;
} }
//m_log.WarnFormat("[REGION SYNC SERVER MODULE] <{0}> {1} ScenePresence called SendAppearance ({2})", sp.Name, agentID, te == null ? " " : "te"); m_log.DebugFormat("[REGION SYNC SERVER MODULE] <{0}> {1} ScenePresence called SendAppearance ({2})", sp.Name, agentID, te == null ? " " : "te");
if(te == null) if(te == null)
return; return;
int delay = 1000; int delay = 1000;
@ -334,7 +334,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
data["te"] = te.GetOSD(); data["te"] = te.GetOSD();
Timer appearanceSetter = new Timer(delegate(object obj) Timer appearanceSetter = new Timer(delegate(object obj)
{ {
//m_log.WarnFormat("[REGION SYNC SERVER MODULE] <{0}> {1} Broadcasting appearance to all client managers", sp.Name, agentID); m_log.DebugFormat("[REGION SYNC SERVER MODULE] <{0}> {1} Broadcasting appearance to all client managers", sp.Name, agentID);
m_server.Broadcast(new RegionSyncMessage(RegionSyncMessage.MsgType.AvatarAppearance, OSDParser.SerializeJsonString(data))); m_server.Broadcast(new RegionSyncMessage(RegionSyncMessage.MsgType.AvatarAppearance, OSDParser.SerializeJsonString(data)));
lock (m_appearanceTimers) lock (m_appearanceTimers)
m_appearanceTimers.Remove(agentID); m_appearanceTimers.Remove(agentID);

View File

@ -1597,6 +1597,18 @@ namespace OpenSim.Region.Framework.Scenes
ForEachScenePresence(delegate(ScenePresence sp) { sp.SendPrimUpdates(); }); ForEachScenePresence(delegate(ScenePresence sp) { sp.SendPrimUpdates(); });
if(m_frame % 20 == 0) if(m_frame % 20 == 0)
RegionSyncClientModule.SendCoarseLocations(); RegionSyncClientModule.SendCoarseLocations();
// make border crossing work in the CMs
m_sceneGraph.ForEachScenePresence(delegate(ScenePresence sp)
{
if (!sp.IsChildAgent)
{
// Check that we have a physics actor or we're sitting on something
if (sp.ParentID == 0 && sp.PhysicsActor != null || sp.ParentID != 0)
{
sp.CheckForBorderCrossing();
}
}
});
} }
else else
{ {
@ -2979,6 +2991,7 @@ namespace OpenSim.Region.Framework.Scenes
m_LastLogin = Util.EnvironmentTickCount(); m_LastLogin = Util.EnvironmentTickCount();
EventManager.TriggerOnNewClient(client); EventManager.TriggerOnNewClient(client);
// m_log.Debug("[Scene] New agent " + client.Name + " vialogin=" + vialogin.ToString());
if (vialogin) if (vialogin)
EventManager.TriggerOnClientLogin(client); EventManager.TriggerOnClientLogin(client);
} }

View File

@ -1122,7 +1122,7 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
public void CompleteMovement(IClientAPI client) public void CompleteMovement(IClientAPI client)
{ {
//m_log.Debug("[SCENE PRESENCE]: CompleteMovement"); m_log.Debug("[SCENE PRESENCE]: CompleteMovement");
Vector3 look = Velocity; Vector3 look = Velocity;
if ((look.X == 0) && (look.Y == 0) && (look.Z == 0)) if ((look.X == 0) && (look.Y == 0) && (look.Z == 0))
@ -1158,8 +1158,10 @@ namespace OpenSim.Region.Framework.Scenes
SendInitialData(); SendInitialData();
// Create child agents in neighbouring regions // Create child agents in neighbouring regions
if (!m_isChildAgent) if (!m_isChildAgent && !m_scene.IsAuthoritativeScene())
{ {
m_log.DebugFormat("[SCENE PRESENCE]: Requesting neighbouring children. cagent={0}, auth={1}",
m_isChildAgent.ToString(), m_scene.IsAuthoritativeScene());
IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>(); IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
if (m_agentTransfer != null) if (m_agentTransfer != null)
m_agentTransfer.EnableChildAgents(this); m_agentTransfer.EnableChildAgents(this);
@ -2472,6 +2474,9 @@ namespace OpenSim.Region.Framework.Scenes
pos.Z += m_appearance.HipOffset; pos.Z += m_appearance.HipOffset;
remoteAvatar.m_controllingClient.SendAvatarDataImmediate(this); remoteAvatar.m_controllingClient.SendAvatarDataImmediate(this);
// Next line added on recommondation of MB
m_controllingClient.SendAppearance(m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes());
m_scene.StatsReporter.AddAgentUpdates(1); m_scene.StatsReporter.AddAgentUpdates(1);
} }
@ -2492,6 +2497,7 @@ namespace OpenSim.Region.Framework.Scenes
// only send if this is the root (children are only "listening posts" in a foreign region) // only send if this is the root (children are only "listening posts" in a foreign region)
if (!IsChildAgent) if (!IsChildAgent)
{ {
m_log.DebugFormat("[SCENE PRESENCE]: SendInitialFullUpdateToAllClients.SendFullUpdateToOtherClient");
SendFullUpdateToOtherClient(avatar); SendFullUpdateToOtherClient(avatar);
} }
@ -2548,8 +2554,11 @@ namespace OpenSim.Region.Framework.Scenes
pos.Z += m_appearance.HipOffset; pos.Z += m_appearance.HipOffset;
m_controllingClient.SendAvatarDataImmediate(this); m_controllingClient.SendAvatarDataImmediate(this);
SendInitialFullUpdateToAllClients(); SendInitialFullUpdateToAllClients();
// Next two lines added on recommondation of MB
if (m_appearance != null && m_appearance.VisualParams != null && m_appearance.Texture != null)
m_controllingClient.SendAppearance(m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes());
SendAppearanceToAllOtherAgents(); SendAppearanceToAllOtherAgents();
} }
@ -2584,7 +2593,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if(client.AgentId != ControllingClient.AgentId) if(client.AgentId != ControllingClient.AgentId)
{ {
//m_log.WarnFormat("[SCENE PRESENCE] Sending {0} appearance to {1} (SendAppearanceToAllOtherAgents)", Name, client.Name); m_log.DebugFormat("[SCENE PRESENCE] Sending {0} appearance to {1} (SendAppearanceToAllOtherAgents)", Name, client.Name);
client.SendAppearance(m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes()); client.SendAppearance(m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes());
} }
}); });
@ -2611,9 +2620,11 @@ namespace OpenSim.Region.Framework.Scenes
public void SendAppearanceToOtherAgent(ScenePresence avatar) public void SendAppearanceToOtherAgent(ScenePresence avatar)
{ {
if (Appearance.Texture == null) if (Appearance.Texture == null)
{
return; return;
}
//m_log.WarnFormat("{0} sending appearance to {1}, owner={2}", UUID, avatar.UUID, m_appearance.Owner); //m_log.WarnFormat("{0} sending appearance to {1}, owner={2}", UUID, avatar.UUID, m_appearance.Owner);
//m_log.WarnFormat("[SCENE PRESENCE] Sending {0} appearance to {1} (SendAppearanceToOtherAgent)", Name, avatar.Name); m_log.DebugFormat("[SCENE PRESENCE] Sending {0} appearance to {1} (SendAppearanceToOtherAgent)", Name, avatar.Name);
m_appearance.Owner = UUID; m_appearance.Owner = UUID;
avatar.ControllingClient.SendAppearance( avatar.ControllingClient.SendAppearance(
m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes()); m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes());
@ -2668,25 +2679,34 @@ namespace OpenSim.Region.Framework.Scenes
#endregion Bake Cache Check #endregion Bake Cache Check
m_appearance.SetAppearance(textureEntry, visualParams); try
if (m_appearance.AvatarHeight > 0)
SetHeight(m_appearance.AvatarHeight);
// This is not needed, because only the transient data changed
//AvatarData adata = new AvatarData(m_appearance);
//m_scene.AvatarService.SetAvatar(m_controllingClient.AgentId, adata);
SendAppearanceToAllOtherAgents();
if (!m_startAnimationSet)
{ {
Animator.UpdateMovementAnimations(); m_appearance.SetAppearance(textureEntry, visualParams);
m_startAnimationSet = true; if (m_appearance.AvatarHeight > 0)
SetHeight(m_appearance.AvatarHeight);
// This is not needed, because only the transient data changed
//AvatarData adata = new AvatarData(m_appearance);
//m_scene.AvatarService.SetAvatar(m_controllingClient.AgentId, adata);
SendAppearanceToAllOtherAgents();
if (!m_startAnimationSet)
{
Animator.UpdateMovementAnimations();
m_startAnimationSet = true;
}
Vector3 pos = m_pos;
pos.Z += m_appearance.HipOffset;
m_controllingClient.SendAvatarDataImmediate(this);
// Next line added on recommondation of MB
m_controllingClient.SendAppearance(m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes());
}
catch (Exception e)
{
m_log.DebugFormat("[SCENE PRESENCE] EXCEPTION setting appearance: {0}", e);
} }
Vector3 pos = m_pos;
pos.Z += m_appearance.HipOffset;
m_controllingClient.SendAvatarDataImmediate(this);
} }
public void SetWearable(int wearableId, AvatarWearable wearable) public void SetWearable(int wearableId, AvatarWearable wearable)
@ -2774,7 +2794,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <summary> /// <summary>
/// Checks to see if the avatar is in range of a border and calls CrossToNewRegion /// Checks to see if the avatar is in range of a border and calls CrossToNewRegion
/// </summary> /// </summary>
protected void CheckForBorderCrossing() public void CheckForBorderCrossing()
{ {
if (IsChildAgent) if (IsChildAgent)
return; return;