public override bool HandleIn(RegionSyncModule pRegionContext) { if (base.HandleIn(pRegionContext)) { m_log.DebugFormat("{0} SyncMsgChatFromWorld: {1} : {2}", LogHeader, ChatMessage.From, ChatMessage.Message); pRegionContext.RememberLocallyGeneratedEvent(MsgType.ChatFromWorld, ChatMessage); // Let ChatModule get the event and deliver it to avatars pRegionContext.Scene.EventManager.TriggerOnChatFromWorld(ChatMessage.SenderObject, ChatMessage); pRegionContext.ForgetLocallyGeneratedEvent(); } return true; }
public override bool HandleIn(RegionSyncModule pRegionContext) { if (base.HandleIn(pRegionContext)) { SceneObjectPart part = pRegionContext.Scene.GetSceneObjectPart(PrimID); if (part == null) { m_log.WarnFormat("{0} HandleRemoteEvent_OnAttach: no part with UUID {1} found", LogHeader, PrimID); return false; } uint localID = part.LocalId; pRegionContext.RememberLocallyGeneratedEvent(MsgType.Attach, localID, ItemID, AvatarID); pRegionContext.Scene.EventManager.TriggerOnAttach(localID, ItemID, AvatarID); pRegionContext.ForgetLocallyGeneratedEvent(); } return true; }
public override bool HandleIn(RegionSyncModule pRegionContext) { if (base.HandleIn(pRegionContext)) { m_log.DebugFormat("{0} SyncMsgChatBroadcast: {1} : {2}", LogHeader, ChatMessage.From, ChatMessage.Message); pRegionContext.RememberLocallyGeneratedEvent(MsgType.ChatBroadcast, ChatMessage); pRegionContext.Scene.EventManager.TriggerOnChatBroadcast(ChatMessage.SenderObject, ChatMessage); pRegionContext.ForgetLocallyGeneratedEvent(); } return true; }
public override bool HandleIn(RegionSyncModule pRegionContext) { if (base.HandleIn(pRegionContext)) { if (SyncedProperties != null && SyncedProperties.Count > 0) { // Update local sync info and scene object/presence pRegionContext.RememberLocallyGeneratedEvent(MType); HashSet<SyncableProperties.Type> propertiesUpdated = pRegionContext.InfoManager.UpdateSyncInfoBySync(Uuid, SyncedProperties); if (propertiesUpdated.Contains(RegionSync.SyncableProperties.Type.AvatarAppearance)) m_log.DebugFormat("{0} SyncMsgUpdatedProperties:HandleIn AvatarAppearance for uuid {1}", LogHeader, Uuid); pRegionContext.ForgetLocallyGeneratedEvent(); // Do our own detail logging after we know which properties are actually updated (in propertiesUpdated) pRegionContext.DetailedUpdateLogging(Uuid, propertiesUpdated, "RecUpdateN", ConnectorContext.otherSideActorID, DataLength); // Relay the update properties if (pRegionContext.IsSyncRelay) pRegionContext.EnqueueUpdatedProperty(Uuid, propertiesUpdated); } } return true; }
public override bool HandleIn(RegionSyncModule pRegionContext) { if (base.HandleIn(pRegionContext)) { ArrayList errors = new ArrayList(); if (PrimID != UUID.Zero) { SceneObjectPart sop = pRegionContext.Scene.GetSceneObjectPart(PrimID); if (sop != null) { TaskInventoryItem taskItem = sop.Inventory.GetInventoryItem(ItemID); taskItem.AssetID = AssetID; sop.ParentGroup.UpdateInventoryItem(taskItem); if (IsRunning) { // Scripts are recreated when edited so replace the new script inventory item sop.Inventory.RemoveScriptInstance(ItemID, false); sop.Inventory.CreateScriptInstance(ItemID, 0, false, pRegionContext.Scene.DefaultScriptEngine, 0); errors = sop.Inventory.GetScriptErrors(ItemID); } sop.ParentGroup.ResumeScripts(); if (errors.Count > 0) { m_log.ErrorFormat("{0} Script errors detected. TODO: Send errors back to actor that created script", LogHeader); } //trigger the event in the local scene pRegionContext.RememberLocallyGeneratedEvent(MsgType.UpdateScript, AgentID, ItemID, PrimID, IsRunning, AssetID); pRegionContext.Scene.EventManager.TriggerUpdateScript(AgentID, ItemID, PrimID, IsRunning, AssetID); pRegionContext.ForgetLocallyGeneratedEvent(); } } } return true; }
public override bool HandleIn(RegionSyncModule pRegionContext) { if (base.HandleIn(pRegionContext)) { SceneObjectPart part = pRegionContext.Scene.GetSceneObjectPart(PrimID); if (part == null || part.ParentGroup.IsDeleted) { m_log.ErrorFormat("{0}: part {1} does not exist, or is deleted", LogHeader, PrimID); return false; } pRegionContext.RememberLocallyGeneratedEvent(MsgType.ScriptReset, part.LocalId, ItemID); pRegionContext.Scene.EventManager.TriggerScriptReset(part.LocalId, ItemID); pRegionContext.ForgetLocallyGeneratedEvent(); } return false; }
public override bool HandleIn(RegionSyncModule pRegionContext) { if (base.HandleIn(pRegionContext)) { ColliderArgs CollidingMessage = new ColliderArgs(); CollidingMessage.Colliders = Colliders; // m_log.DebugFormat("ScriptLandCollidingStart received for {0}", CollideeID); pRegionContext.RememberLocallyGeneratedEvent(MType, CollideeID, CollidingMessage); pRegionContext.Scene.EventManager.TriggerScriptLandCollidingStart(CollideeID, CollidingMessage); pRegionContext.ForgetLocallyGeneratedEvent(); } return true; }
public override bool HandleIn(RegionSyncModule pRegionContext) { bool ret = base.HandleIn(pRegionContext); if (ret) { pRegionContext.RememberLocallyGeneratedEvent(MsgType.ObjectGrabbing, SOP.LocalId, OriginalID, OffsetPos, SP.ControllingClient, SurfaceArgs); pRegionContext.Scene.EventManager.TriggerObjectGrabbing(SOP.LocalId, OriginalID, OffsetPos, SP.ControllingClient, SurfaceArgs); pRegionContext.ForgetLocallyGeneratedEvent(); } return ret; }
public override bool HandleIn(RegionSyncModule pRegionContext) { if (base.HandleIn(pRegionContext)) { SceneObjectPart localPart = pRegionContext.Scene.GetSceneObjectPart(Uuid); if (localPart == null || localPart.ParentGroup.IsDeleted) { m_log.ErrorFormat("{0}: HandleRemoteEvent_OnNewScript: prim {1} no longer in local SceneGraph", LogHeader, Uuid); return false; } if (UpdatedProperties.Count > 0) { HashSet<SyncableProperties.Type> propertiesUpdated = pRegionContext.InfoManager.UpdateSyncInfoBySync(Uuid, UpdatedProperties); } //The TaskInventory value might have already been sync'ed by UpdatedPrimProperties, //but we still need to create the script instance by reading out the inventory. pRegionContext.RememberLocallyGeneratedEvent(MsgType.NewScript, AgentID, localPart, ItemID); pRegionContext.Scene.EventManager.TriggerNewScript(AgentID, localPart, ItemID); pRegionContext.ForgetLocallyGeneratedEvent(); } return true; }
public override bool HandleIn(RegionSyncModule pRegionContext) { if (base.HandleIn(pRegionContext)) { pRegionContext.RememberLocallyGeneratedEvent(MType); // If this is a relay node, forward the message if (pRegionContext.IsSyncRelay) pRegionContext.SendSpecialUpdateToRelevantSyncConnectors(ConnectorContext.otherSideActorID, this); //Add the list of PrimSyncInfo to SyncInfoManager foreach (SyncInfoBase syncInfo in SyncInfos.Values) pRegionContext.InfoManager.InsertSyncInfo(syncInfo.UUID, syncInfo); // Add the decoded object to Scene // This will invoke OnObjectAddedToScene but the syncinfo has already been created so that's a NOP pRegionContext.Scene.EventManager.TriggerParcelPrimCountTainted(); pRegionContext.Scene.AddNewSceneObject(SOG, true); // If it's an attachment, connect this to the presence if (SOG.IsAttachmentCheckFull()) { //m_log.WarnFormat("{0}: HandleSyncNewObject: Adding attachement to presence", LogHeader); ScenePresence sp = pRegionContext.Scene.GetScenePresence(SOG.AttachedAvatar); if (sp != null) { sp.AddAttachment(SOG); SOG.RootPart.SetParentLocalId(sp.LocalId); // In case it is later dropped, don't let it get cleaned up SOG.RootPart.RemFlag(PrimFlags.TemporaryOnRez); SOG.HasGroupChanged = true; } } /* Uncomment when quarks exist //If we just keep a copy of the object in our local Scene, //and is not supposed to operation on it (e.g. object in //passive quarks), then ignore the event. if (!ToOperateOnObject(group)) return; */ // Now that (if) the PhysActor of each part in sog has been created, set the PhysActor properties. if (SOG.RootPart.PhysActor != null) { foreach (SyncInfoBase syncInfo in SyncInfos.Values) { // m_log.DebugFormat("{0}: HandleSyncNewObject: setting physical properties", LogHeader); syncInfo.SetPropertyValues(SyncableProperties.PhysActorProperties); } } SOG.CreateScriptInstances(0, false, pRegionContext.Scene.DefaultScriptEngine, 0); SOG.ResumeScripts(); // Trigger aggregateScriptEventSubscriptions since it may access PhysActor to link collision events foreach (SceneObjectPart part in SOG.Parts) part.aggregateScriptEvents(); SOG.ScheduleGroupForFullUpdate(); } return true; }