Partial passing of StartAnim and StopAnim through CM
parent
838ffc27ed
commit
9f515cb623
|
@ -747,7 +747,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
}
|
||||
|
||||
UUID agentID = data["agentID"].AsUUID();
|
||||
// m_log.DebugFormat("{0} SendAnimations for {1}", LogHeader, agentID.ToString());
|
||||
m_log.DebugFormat("{0} SendAnimations for {1}", LogHeader, agentID.ToString());
|
||||
|
||||
OSDArray animatA = (OSDArray)data["animations"];
|
||||
UUID[] animIDs = new UUID[animatA.Count];
|
||||
|
@ -884,6 +884,8 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
client.OnGrabObject += HandleGrabObject;
|
||||
client.OnGrabUpdate += HandleGrabUpdate;
|
||||
client.OnDeGrabObject += HandleDeGrabObject;
|
||||
client.OnStartAnim += HandleStartAnim;
|
||||
client.OnStopAnim += HandleStopAnim;
|
||||
}
|
||||
|
||||
public void EventManager_OnMakeChildAgent(ScenePresence scenep)
|
||||
|
@ -894,6 +896,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
OSDMap data = new OSDMap(1);
|
||||
data["agentID"] = OSD.FromUUID(scenep.ControllingClient.AgentId);
|
||||
Send(new RegionSyncMessage(RegionSyncMessage.MsgType.AgentRemove, OSDParser.SerializeJsonString(data)));
|
||||
// shouldn't we unsubscribe from all the events?
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1034,6 +1037,24 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
Send(new RegionSyncMessage(RegionSyncMessage.MsgType.DeGrabObject, OSDParser.SerializeJsonString(data)));
|
||||
}
|
||||
|
||||
public void HandleStartAnim(IClientAPI remoteClient, UUID animID)
|
||||
{
|
||||
m_log.DebugFormat("[REGION SYNC CLIENT] HandleStartAnim for {0}", remoteClient.AgentId.ToString());
|
||||
OSDMap data = new OSDMap(3);
|
||||
data["agentID"] = OSD.FromUUID(remoteClient.AgentId);
|
||||
data["animID"] = OSD.FromUUID(animID);
|
||||
Send(new RegionSyncMessage(RegionSyncMessage.MsgType.StartAnim, OSDParser.SerializeJsonString(data)));
|
||||
}
|
||||
|
||||
public void HandleStopAnim(IClientAPI remoteClient, UUID animID)
|
||||
{
|
||||
m_log.DebugFormat("[REGION SYNC CLIENT] HandleStopAnim for {0}", remoteClient.AgentId.ToString());
|
||||
OSDMap data = new OSDMap(3);
|
||||
data["agentID"] = OSD.FromUUID(remoteClient.AgentId);
|
||||
data["animID"] = OSD.FromUUID(animID);
|
||||
Send(new RegionSyncMessage(RegionSyncMessage.MsgType.StopAnim, OSDParser.SerializeJsonString(data)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert a list of SurfaceTouchEventArgs into an OSDArray for transmission.
|
||||
/// Return an array of maps which each are a list entry.
|
||||
|
|
|
@ -549,7 +549,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
UUID targetID = data["targetID"].AsUUID();
|
||||
Vector3 offset = data["offset"].AsVector3();
|
||||
|
||||
m_log.DebugFormat("{0} AgentRequestSit for {1}", LogHeader, agentID.ToString());
|
||||
// m_log.DebugFormat("{0} AgentRequestSit for {1}", LogHeader, agentID.ToString());
|
||||
|
||||
ScenePresence sp;
|
||||
m_scene.TryGetScenePresence(agentID, out sp);
|
||||
|
@ -569,7 +569,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
}
|
||||
UUID agentID = data["agentID"].AsUUID();
|
||||
|
||||
m_log.DebugFormat("{0} AgentSit for {1}", LogHeader, agentID.ToString());
|
||||
// m_log.DebugFormat("{0} AgentSit for {1}", LogHeader, agentID.ToString());
|
||||
|
||||
ScenePresence sp;
|
||||
m_scene.TryGetScenePresence(agentID, out sp);
|
||||
|
@ -579,6 +579,48 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
}
|
||||
return;
|
||||
}
|
||||
case RegionSyncMessage.MsgType.StartAnim:
|
||||
{
|
||||
OSDMap data = DeserializeMessage(msg);
|
||||
if (data == null)
|
||||
{
|
||||
RegionSyncMessage.HandleError(LogHeader, msg, "Could not deserialize JSON data.");
|
||||
return;
|
||||
}
|
||||
UUID agentID = data["agentID"].AsUUID();
|
||||
UUID animID = data["id"].AsUUID();
|
||||
|
||||
m_log.DebugFormat("{0} AnimStart for {1}", LogHeader, agentID.ToString());
|
||||
|
||||
ScenePresence sp;
|
||||
m_scene.TryGetScenePresence(agentID, out sp);
|
||||
if (sp != null)
|
||||
{
|
||||
sp.Animator.AddAnimation(animID, UUID.Zero);
|
||||
}
|
||||
return;
|
||||
}
|
||||
case RegionSyncMessage.MsgType.StopAnim:
|
||||
{
|
||||
OSDMap data = DeserializeMessage(msg);
|
||||
if (data == null)
|
||||
{
|
||||
RegionSyncMessage.HandleError(LogHeader, msg, "Could not deserialize JSON data.");
|
||||
return;
|
||||
}
|
||||
UUID agentID = data["agentID"].AsUUID();
|
||||
UUID animID = data["id"].AsUUID();
|
||||
|
||||
m_log.DebugFormat("{0} AnimStop for {1}", LogHeader, agentID.ToString());
|
||||
|
||||
ScenePresence sp;
|
||||
m_scene.TryGetScenePresence(agentID, out sp);
|
||||
if (sp != null)
|
||||
{
|
||||
sp.Animator.RemoveAnimation(animID);
|
||||
}
|
||||
return;
|
||||
}
|
||||
case RegionSyncMessage.MsgType.GrabObject:
|
||||
{
|
||||
OSDMap data = DeserializeMessage(msg);
|
||||
|
|
|
@ -47,6 +47,8 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
GrabObject,
|
||||
GrabUpdate,
|
||||
DeGrabObject,
|
||||
StartAnim,
|
||||
StopAnim,
|
||||
GetTerrain,
|
||||
GetObjects,
|
||||
SubscribeObjects,
|
||||
|
|
|
@ -367,6 +367,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
OSDArray obIDA = new OSDArray();
|
||||
foreach (UUID ii in objectIDs) obIDA.Add(OSD.FromUUID(ii));
|
||||
data["objectIDs"] = obIDA;
|
||||
m_log.DebugFormat("[REGION SYNC SERVER MODULE] Broadcast animations to {0}", agentID.ToString());
|
||||
RegionSyncMessage rsm = new RegionSyncMessage(RegionSyncMessage.MsgType.SendAnimations, OSDParser.SerializeJsonString(data));
|
||||
m_server.Broadcast(rsm);
|
||||
// m_clientView.Send(rsm);
|
||||
|
|
|
@ -781,6 +781,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
m_log.DebugFormat("[SCENE PRESENCE]: Setting local handler for HandleAgentRequestSit"); //RA
|
||||
m_controllingClient.OnAgentRequestSit += HandleAgentRequestSit;
|
||||
m_controllingClient.OnAgentSit += HandleAgentSit;
|
||||
m_controllingClient.OnStartAnim += HandleStartAnim;
|
||||
m_controllingClient.OnStopAnim += HandleStopAnim;
|
||||
}
|
||||
|
||||
m_controllingClient.OnRequestWearables += SendWearables;
|
||||
|
@ -788,8 +790,6 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
//m_controllingClient.OnCompleteMovementToRegion += SendInitialData;
|
||||
|
||||
m_controllingClient.OnSetAlwaysRun += HandleSetAlwaysRun;
|
||||
m_controllingClient.OnStartAnim += HandleStartAnim;
|
||||
m_controllingClient.OnStopAnim += HandleStopAnim;
|
||||
m_controllingClient.OnForceReleaseControls += HandleForceReleaseControls;
|
||||
m_controllingClient.OnAutoPilotGo += DoAutoPilot;
|
||||
m_controllingClient.AddGenericPacketHandler("autopilot", DoMoveToPosition);
|
||||
|
|
Loading…
Reference in New Issue