Added code in SyncDebug to debug the save-and-refire of collision_start event.

dsg
Huaiyu (Kitty) Liu 2011-06-05 11:18:35 -07:00
parent fb716dbd68
commit 90abbe26d3
1 changed files with 73 additions and 16 deletions

View File

@ -479,7 +479,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
Command cmdSyncDebug = new Command("debug", CommandIntentions.COMMAND_HAZARDOUS, SyncDebug, "Trigger some debugging functions"); Command cmdSyncDebug = new Command("debug", CommandIntentions.COMMAND_HAZARDOUS, SyncDebug, "Trigger some debugging functions");
//for sync state comparison, //for sync state comparison,
Command cmdSyncStateDetailReport = new Command("state detail", CommandIntentions.COMMAND_HAZARDOUS, SyncStateDetailReport, "Trigger synchronization state comparision functions"); Command cmdSyncStateDetailReport = new Command("state_detail", CommandIntentions.COMMAND_HAZARDOUS, SyncStateDetailReport, "Trigger synchronization state comparision functions");
//for sync state comparison, //for sync state comparison,
Command cmdSyncStateReport = new Command("state", CommandIntentions.COMMAND_HAZARDOUS, SyncStateReport, "Trigger synchronization state comparision functions"); Command cmdSyncStateReport = new Command("state", CommandIntentions.COMMAND_HAZARDOUS, SyncStateReport, "Trigger synchronization state comparision functions");
@ -487,7 +487,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
m_commander.RegisterCommand("stop", cmdSyncStop); m_commander.RegisterCommand("stop", cmdSyncStop);
m_commander.RegisterCommand("status", cmdSyncStatus); m_commander.RegisterCommand("status", cmdSyncStatus);
m_commander.RegisterCommand("debug", cmdSyncDebug); m_commander.RegisterCommand("debug", cmdSyncDebug);
m_commander.RegisterCommand("state detail", cmdSyncStateDetailReport); m_commander.RegisterCommand("state_detail", cmdSyncStateDetailReport);
m_commander.RegisterCommand("state", cmdSyncStateReport); m_commander.RegisterCommand("state", cmdSyncStateReport);
lock (m_scene) lock (m_scene)
@ -1394,6 +1394,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
private void SyncDebug(Object[] args) private void SyncDebug(Object[] args)
{ {
/*
if (m_scene != null) if (m_scene != null)
{ {
EntityBase[] entities = m_scene.GetEntities(); EntityBase[] entities = m_scene.GetEntities();
@ -1410,6 +1411,48 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
} }
} }
} }
* */
//Test HandleRemoteEvent_ScriptCollidingStart
if (m_scene != null)
{
EntityBase[] entities = m_scene.GetEntities();
SceneObjectGroup sog = null;
foreach (EntityBase entity in entities)
{
if (entity is SceneObjectGroup)
{
sog = (SceneObjectGroup)entity;
break;
}
}
if (sog != null)
{
SceneObjectPart part = sog.RootPart;
OSDArray collisionUUIDs = new OSDArray();
UUID collider = UUID.Random();
collisionUUIDs.Add(OSD.FromUUID(collider));
OSDMap data = new OSDMap();
data["primUUID"] = OSD.FromUUID(part.UUID);
data["collisionUUIDs"] = collisionUUIDs;
//SendSceneEvent(SymmetricSyncMessage.MsgType.ScriptCollidingStart, data);
ulong evSeq = GetNextEventSeq();
data["actorID"] = OSD.FromString(m_actorID);
data["seqNum"] = OSD.FromULong(evSeq);
SymmetricSyncMessage rsm = new SymmetricSyncMessage(SymmetricSyncMessage.MsgType.ScriptCollidingStart, OSDParser.SerializeJsonString(data));
HandleRemoteEvent_ScriptCollidingStart(m_actorID, evSeq, data, DateTime.Now.Ticks);
}
}
} }
private void PrimSyncSerializationDebug() private void PrimSyncSerializationDebug()
@ -2498,6 +2541,20 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
if (collidersNotFound.Count > 0) if (collidersNotFound.Count > 0)
{ {
TimeSpan msgExpireTime = new TimeSpan(0, 1, 0);
TimeSpan msgSavedTime = new TimeSpan(DateTime.Now.Ticks - recvTime);
if (msgSavedTime < msgExpireTime)
{
//for testing only, need to remove after testing
/*
TimeSpan testTime = new TimeSpan(0, 0, 10);
if (msgSavedTime > testTime)
{
collidersNotFound.Clear();
collidersNotFound.Add(OSD.FromUUID(new UUID("fe3bc3cc-3ec5-423d-bd2b-d19386210368")));
}
* */
OSDMap newdata = new OSDMap(); OSDMap newdata = new OSDMap();
newdata["primUUID"] = OSD.FromUUID(part.UUID); newdata["primUUID"] = OSD.FromUUID(part.UUID);
@ -2515,6 +2572,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
m_savedSyncMessage.Add(syncMsgToSave); m_savedSyncMessage.Add(syncMsgToSave);
} }
} }
}
if (colliding.Count > 0) if (colliding.Count > 0)
@ -3003,7 +3061,6 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
OSDMap data = DeserializeMessage(msg); OSDMap data = DeserializeMessage(msg);
string init_actorID = data["actorID"].AsString(); string init_actorID = data["actorID"].AsString();
ulong evSeqNum = data["seqNum"].AsULong(); ulong evSeqNum = data["seqNum"].AsULong();
bool savedForLater = false;
HandleRemoteEvent_ScriptCollidingStart(init_actorID, evSeqNum, data, syncMsgSaved.ReceivedTime); HandleRemoteEvent_ScriptCollidingStart(init_actorID, evSeqNum, data, syncMsgSaved.ReceivedTime);
break; break;
} }