• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# AgentData类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中AgentData的典型用法代码示例。如果您正苦于以下问题:C# AgentData类的具体用法?C# AgentData怎么用?C# AgentData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AgentData类属于命名空间,在下文中一共展示了AgentData类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CreateAgent

    void CreateAgent(Coord coordinates, GameObject agent, float elevation)
    {
        var agentData = new AgentData() { coords = new int[] { coordinates.X, coordinates.Y }, prefId = _agentInfoIDs[agent.name] };
        var go = Instantiate(agent, Grid.CoordToPosition(coordinates) + (1 + elevation) * Vector3.up, Quaternion.AngleAxis(45, Vector3.up)) as GameObject;
        go.active = false;
        foreach(var comp in go.GetComponents<Component>())
        {
            if(!comp is Renderer)
            {
                if (comp is MonoBehaviour)
                {
                    (comp as MonoBehaviour).enabled = false;
                }
            }
        }
        foreach(var comp in go.GetComponentsInChildren<Component>())
        {
            if(!comp is Renderer)
            {
                if (comp is MonoBehaviour)
                {
                    (comp as MonoBehaviour).enabled = false;
                }
            }
        }
        agentData.obj = go;

        _agentObjects.Add(go);
        _agents.Add(agentData);
        go.active = true;
    }
开发者ID:FatihBAKIR,项目名称:GGJ2016,代码行数:31,代码来源:EditTool.cs


示例2: Deserialize

        /// <summary>
        /// Deserialize the message
        /// </summary>
        /// <param name="map">An <see cref="OSDMap"/> containing the data</param>
        public void Deserialize(OSDMap map)
        {
            OSDArray agentDataArray = (OSDArray)map["AgentData"];

            AgentDataBlock = new AgentData[agentDataArray.Count];

            for (int i = 0; i < agentDataArray.Count; i++)
            {
                OSDMap agentMap = (OSDMap)agentDataArray[i];
                AgentData agentData = new AgentData();

                agentData.AgentID = agentMap["AgentID"].AsUUID();
                agentData.GroupID = agentMap["GroupID"].AsUUID();

                AgentDataBlock[i] = agentData;
            }
        }
开发者ID:justincc,项目名称:libopenmetaverse,代码行数:21,代码来源:LindenMessages.cs


示例3: ChildAgentDataUpdate

        public void ChildAgentDataUpdate(AgentData cAgentData)
        {
            //MainConsole.Instance.Debug("   >>> ChildAgentDataUpdate <<< " + Scene.RegionInfo.RegionName);
            //if (!IsChildAgent)
            //    return;

            CopyFrom(cAgentData);
        }
开发者ID:satlanski2,项目名称:Aurora-Sim,代码行数:8,代码来源:AsyncScenePresence.cs


示例4: InformClientOfNeighbor

        /// <summary>
        ///   Async component for informing client of which neighbors exist
        /// </summary>
        /// <remarks>
        ///   This needs to run asynchronously, as a network timeout may block the thread for a long while
        /// </remarks>
        /// <param name = "remoteClient"></param>
        /// <param name = "a"></param>
        /// <param name = "regionHandle"></param>
        /// <param name = "endPoint"></param>
        public virtual bool InformClientOfNeighbor(UUID AgentID, ulong requestingRegion, AgentCircuitData circuitData,
                                                   ref GridRegion neighbor,
                                                   uint TeleportFlags, AgentData agentData, out string reason,
                                                   out bool useCallbacks)
        {
            useCallbacks = true;
            if (neighbor == null || neighbor.RegionHandle == 0)
            {
                reason = "Could not find neighbor to inform";
                return false;
            }
            /*if ((neighbor.Flags & (int)Aurora.Framework.RegionFlags.RegionOnline) == 0 &&
                (neighbor.Flags & (int)(Aurora.Framework.RegionFlags.Foreign | Aurora.Framework.RegionFlags.Hyperlink)) == 0)
            {
                reason = "The region you are attempting to teleport to is offline";
                return false;
            }*/
            MainConsole.Instance.Info("[AgentProcessing]: Starting to inform client about neighbor " + neighbor.RegionName);

            //Notes on this method
            // 1) the SimulationService.CreateAgent MUST have a fixed CapsUrl for the region, so we have to create (if needed)
            //       a new Caps handler for it.
            // 2) Then we can call the methods (EnableSimulator and EstatablishAgentComm) to tell the client the new Urls
            // 3) This allows us to make the Caps on the grid server without telling any other regions about what the
            //       Urls are.

            ISimulationService SimulationService = m_registry.RequestModuleInterface<ISimulationService>();
            if (SimulationService != null)
            {
                ICapsService capsService = m_registry.RequestModuleInterface<ICapsService>();
                IClientCapsService clientCaps = capsService.GetClientCapsService(AgentID);

                IRegionClientCapsService oldRegionService = clientCaps.GetCapsService(neighbor.RegionHandle);

                //If its disabled, it should be removed, so kill it!
                if (oldRegionService != null && oldRegionService.Disabled)
                {
                    clientCaps.RemoveCAPS(neighbor.RegionHandle);
                    oldRegionService = null;
                }

                bool newAgent = oldRegionService == null;
                IRegionClientCapsService otherRegionService = clientCaps.GetOrCreateCapsService(neighbor.RegionHandle,
                                                                                                CapsUtil.GetCapsSeedPath
                                                                                                    (CapsUtil.
                                                                                                         GetRandomCapsObjectPath
                                                                                                         ()),
                                                                                                circuitData, 0);

                if (!newAgent)
                {
                    //Note: if the agent is already there, send an agent update then
                    bool result = true;
                    if (agentData != null)
                    {
                        agentData.IsCrossing = false;
                        result = SimulationService.UpdateAgent(neighbor, agentData);
                    }
                    if (result)
                        oldRegionService.Disabled = false;
                    reason = "";
                    return result;
                }

                ICommunicationService commsService = m_registry.RequestModuleInterface<ICommunicationService>();
                if (commsService != null)
                    commsService.GetUrlsForUser(neighbor, circuitData.AgentID);
                        //Make sure that we make userURLs if we need to

                circuitData.CapsPath = CapsUtil.GetCapsPathFromCapsSeed(otherRegionService.CapsUrl); //For OpenSim
                circuitData.firstname = clientCaps.AccountInfo.FirstName;
                circuitData.lastname = clientCaps.AccountInfo.LastName;

                int requestedPort = 0;
                if (circuitData.child)
                    circuitData.reallyischild = true;
                bool regionAccepted = CreateAgent(neighbor, otherRegionService, ref circuitData, SimulationService, ref requestedPort, out reason);
                if (regionAccepted)
                {
                    IPAddress ipAddress = neighbor.ExternalEndPoint.Address;
                    string otherRegionsCapsURL;
                    //If the region accepted us, we should get a CAPS url back as the reason, if not, its not updated or not an Aurora region, so don't touch it.
                    if (reason != "" && reason != "authorized")
                    {
                        OSDMap responseMap = (OSDMap) OSDParser.DeserializeJson(reason);
                        OSDMap SimSeedCaps = (OSDMap) responseMap["CapsUrls"];
                        if (responseMap.ContainsKey("OurIPForClient"))
                        {
                            string ip = responseMap["OurIPForClient"].AsString();
                            if (!IPAddress.TryParse(ip, out ipAddress))
//.........这里部分代码省略.........
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:101,代码来源:AgentProcessing.cs


示例5: spawnAgent

    private void spawnAgent()
    {
        Vector3 spawnPos = GameObject.FindGameObjectWithTag("Spawn").transform.position;
        Quaternion rotate = GameObject.FindGameObjectWithTag("Spawn").transform.rotation;

        GameObject npc = Instantiate(SpawnList[0], spawnPos, rotate) as GameObject;
        AgentData tempData = new AgentData();
        Debug.Log ("ID from npc : " + npc.GetInstanceID());
        tempData.setID(npc.GetInstanceID());
        Debug.Log ("ID from data : " + tempData.getID());
        tempData.setOtherAgents(findOtherAgents());
        Debug.Log ("OtherAgents : " + tempData.getOtherAgents());
        Debug.Log ("Name from npc : " + npc.name);
        tempData.setInitial(npc.name);
        Debug.Log ("Name from data : " + tempData.getInitial());

        npc.GetComponent<Sentry>().setAgentData(tempData);
        Debug.Log (npc.GetComponent<Sentry>().getAgentData().getInitial());

        History.Add(tempData);
        //if (History[agentAttempts] == null) Debug.Log (agentAttempts + " was null");
        //Debug.Log ("History ID : " + History[agentAttempts].getInitial());
        //Debug.Log ("History: " + History.Count());
        agentAttempts++;
        SpawnList.RemoveAt(0);
        Debug.Log ("After SpawnList Remove");
        setWaypointsForNPCs();
    }
开发者ID:kca8,项目名称:Jigsaw,代码行数:28,代码来源:AIDirector.cs


示例6: InformClientOfNeighbor

        public override bool InformClientOfNeighbor(UUID AgentID, ulong requestingRegion, AgentCircuitData circuitData, ref GridRegion neighbor, uint TeleportFlags, AgentData agentData, out string reason, out bool useCallbacks)
        {
            useCallbacks = true;
            if (neighbor == null)
            {
                reason = "Could not find neighbor to inform";
                return false;
            }

            MainConsole.Instance.Info ("[AgentProcessing]: Starting to inform client about neighbor " + neighbor.RegionName);

            //Notes on this method
            // 1) the SimulationService.CreateAgent MUST have a fixed CapsUrl for the region, so we have to create (if needed)
            //       a new Caps handler for it.
            // 2) Then we can call the methods (EnableSimulator and EstatablishAgentComm) to tell the client the new Urls
            // 3) This allows us to make the Caps on the grid server without telling any other regions about what the
            //       Urls are.

            ISimulationService SimulationService = m_registry.RequestModuleInterface<ISimulationService> ();
            if (SimulationService != null)
            {
                ICapsService capsService = m_registry.RequestModuleInterface<ICapsService> ();
                IClientCapsService clientCaps = capsService.GetClientCapsService (AgentID);
                GridRegion originalDest = neighbor;
                if ((neighbor.Flags & (int)Aurora.Framework.RegionFlags.Hyperlink) == (int)Aurora.Framework.RegionFlags.Hyperlink)
                {
                    neighbor = GetFinalDestination (neighbor);
                    if (neighbor == null || neighbor.RegionHandle == 0)
                    {
                        reason = "Could not find neighbor to inform";
                        return false;
                    }
                    //Remove any offenders
                    clientCaps.RemoveCAPS (originalDest.RegionHandle);
                    clientCaps.RemoveCAPS (neighbor.RegionHandle);
                }

                IRegionClientCapsService oldRegionService = clientCaps.GetCapsService (neighbor.RegionHandle);

                //If its disabled, it should be removed, so kill it!
                if (oldRegionService != null && oldRegionService.Disabled)
                {
                    clientCaps.RemoveCAPS (neighbor.RegionHandle);
                    oldRegionService = null;
                }

                bool newAgent = oldRegionService == null;
                IRegionClientCapsService otherRegionService = clientCaps.GetOrCreateCapsService (neighbor.RegionHandle,
                    CapsUtil.GetCapsSeedPath (CapsUtil.GetRandomCapsObjectPath ()), circuitData, 0);

                if (!newAgent)
                {
                    //Note: if the agent is already there, send an agent update then
                    bool result = true;
                    if (agentData != null)
                    {
                        agentData.IsCrossing = false;
                        result = SimulationService.UpdateAgent (neighbor, agentData);
                    }
                    if (result)
                        oldRegionService.Disabled = false;
                    reason = "";
                    return result;
                }

                ICommunicationService commsService = m_registry.RequestModuleInterface<ICommunicationService> ();
                if (commsService != null)
                    commsService.GetUrlsForUser (neighbor, circuitData.AgentID);//Make sure that we make userURLs if we need to

                circuitData.CapsPath = CapsUtil.GetCapsPathFromCapsSeed (otherRegionService.CapsUrl);
                if (clientCaps.AccountInfo != null)
                {
                    circuitData.firstname = clientCaps.AccountInfo.FirstName;
                    circuitData.lastname = clientCaps.AccountInfo.LastName;
                }
                bool regionAccepted = false;
                int requestedUDPPort = 0;
                if ((originalDest.Flags & (int)Aurora.Framework.RegionFlags.Hyperlink) == (int)Aurora.Framework.RegionFlags.Hyperlink)
                {
                    if (circuitData.ServiceURLs == null || circuitData.ServiceURLs.Count == 0)
                    {
                        if (clientCaps.AccountInfo != null)
                        {
                            circuitData.ServiceURLs = new Dictionary<string, object> ();
                            circuitData.ServiceURLs[GetHandlers.Helpers_HomeURI] = GetHandlers.GATEKEEPER_URL;
                            circuitData.ServiceURLs[GetHandlers.Helpers_GatekeeperURI] = GetHandlers.GATEKEEPER_URL;
                            circuitData.ServiceURLs[GetHandlers.Helpers_InventoryServerURI] = GetHandlers.GATEKEEPER_URL;
                            circuitData.ServiceURLs[GetHandlers.Helpers_AssetServerURI] = GetHandlers.GATEKEEPER_URL;
                            circuitData.ServiceURLs[GetHandlers.Helpers_ProfileServerURI] = GetHandlers.GATEKEEPER_URL;
                            circuitData.ServiceURLs[GetHandlers.Helpers_FriendsServerURI] = GetHandlers.GATEKEEPER_URL;
                            circuitData.ServiceURLs[GetHandlers.Helpers_IMServerURI] = GetHandlers.IM_URL;
                            clientCaps.AccountInfo.ServiceURLs = circuitData.ServiceURLs;
                            //Store the new urls
                            m_registry.RequestModuleInterface<IUserAccountService> ().StoreUserAccount (clientCaps.AccountInfo);
                        }
                    }
                    string userAgentDriver = circuitData.ServiceURLs[GetHandlers.Helpers_HomeURI].ToString ();
                    IUserAgentService connector = new UserAgentServiceConnector (userAgentDriver);
                    regionAccepted = connector.LoginAgentToGrid (circuitData, originalDest, neighbor, out reason);
                }
//.........这里部分代码省略.........
开发者ID:djphil,项目名称:Aurora-HG-Plugin,代码行数:101,代码来源:HGAgentProcessing.cs


示例7: CrossAgent

        public virtual bool CrossAgent(GridRegion crossingRegion, Vector3 pos,
                                       Vector3 velocity, AgentCircuitData circuit, AgentData cAgent, UUID AgentID,
                                       ulong requestingRegion, out string reason)
        {
            try
            {
                IClientCapsService clientCaps =
                    m_registry.RequestModuleInterface<ICapsService>().GetClientCapsService(AgentID);
                IRegionClientCapsService requestingRegionCaps = clientCaps.GetCapsService(requestingRegion);
                ISimulationService SimulationService = m_registry.RequestModuleInterface<ISimulationService>();
                if (SimulationService != null)
                {
                    //Note: we have to pull the new grid region info as the one from the region cannot be trusted
                    IGridService GridService = m_registry.RequestModuleInterface<IGridService>();
                    if (GridService != null)
                    {
                        //Set the user in transit so that we block duplicate tps and reset any cancelations
                        if (!SetUserInTransit(AgentID))
                        {
                            reason = "Already in a teleport";
                            return false;
                        }

                        bool result = false;

                        //We need to get it from the grid service again so that we can get the simulation service urls correctly
                        // as regions don't get that info
                        crossingRegion = GridService.GetRegionByUUID(clientCaps.AccountInfo.AllScopeIDs, crossingRegion.RegionID);
                        cAgent.IsCrossing = true;
                        if (!SimulationService.UpdateAgent(crossingRegion, cAgent))
                        {
                            MainConsole.Instance.Warn("[AgentProcessing]: Failed to cross agent " + AgentID +
                                       " because region did not accept it. Resetting.");
                            reason = "Failed to update an agent";
                        }
                        else
                        {
                            IEventQueueService EQService = m_registry.RequestModuleInterface<IEventQueueService>();

                            //Add this for the viewer, but not for the sim, seems to make the viewer happier
                            int XOffset = crossingRegion.RegionLocX - requestingRegionCaps.RegionX;
                            pos.X += XOffset;

                            int YOffset = crossingRegion.RegionLocY - requestingRegionCaps.RegionY;
                            pos.Y += YOffset;

                            IRegionClientCapsService otherRegion = clientCaps.GetCapsService(crossingRegion.RegionHandle);
                            //Tell the client about the transfer
                            EQService.CrossRegion(crossingRegion.RegionHandle, pos, velocity,
                                                  otherRegion.LoopbackRegionIP,
                                                  otherRegion.CircuitData.RegionUDPPort,
                                                  otherRegion.CapsUrl,
                                                  AgentID,
                                                  circuit.SessionID,
                                                  crossingRegion.RegionSizeX,
                                                  crossingRegion.RegionSizeY,
                                                  requestingRegion);

                            result = WaitForCallback(AgentID);
                            if (!result)
                            {
                                MainConsole.Instance.Warn("[AgentProcessing]: Callback never came in crossing agent " + circuit.AgentID +
                                           ". Resetting.");
                                reason = "Crossing timed out";
                            }
                            else
                            {
                                // Next, let's close the child agent connections that are too far away.
                                //Fix the root agent status
                                otherRegion.RootAgent = true;
                                requestingRegionCaps.RootAgent = false;

                                CloseNeighborAgents(requestingRegionCaps.Region, crossingRegion, AgentID);
                                reason = "";
                            }
                        }

                        //All done
                        ResetFromTransit(AgentID);
                        return result;
                    }
                    else
                        reason = "Could not find the GridService";
                }
                else
                    reason = "Could not find the SimulationService";
            }
            catch (Exception ex)
            {
                MainConsole.Instance.WarnFormat("[AgentProcessing]: Failed to cross an agent into a new region. {0}", ex);
            }
            ResetFromTransit(AgentID);
            reason = "Exception occured";
            return false;
        }
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:95,代码来源:AgentProcessing.cs


示例8: IncomingChildAgentDataUpdate

        /// <summary>
        /// We've got an update about an agent that sees into this region, 
        /// send it to ScenePresence for processing  It's the full data.
        /// </summary>
        /// <param name="scene"></param>
        /// <param name="cAgentData">Agent that contains all of the relevant things about an agent.
        /// Appearance, animations, position, etc.</param>
        /// <returns>true if we handled it.</returns>
        public virtual bool IncomingChildAgentDataUpdate (IScene scene, AgentData cAgentData)
        {
            MainConsole.Instance.DebugFormat(
                "[SCENE]: Incoming child agent update for {0} in {1}", cAgentData.AgentID, scene.RegionInfo.RegionName);

            //No null updates!
            if (cAgentData == null)
                return false;

            // We have to wait until the viewer contacts this region after receiving EAC.
            // That calls AddNewClient, which finally creates the ScenePresence and then this gets set up
            // So if the client isn't here yet, save the update for them when they get into the region fully
            IScenePresence SP = scene.GetScenePresence (cAgentData.AgentID);
            if (SP != null)
                SP.ChildAgentDataUpdate (cAgentData);
            else
                lock (m_incomingChildAgentData)
                {
                    if (!m_incomingChildAgentData.ContainsKey (scene))
                        m_incomingChildAgentData.Add (scene, new Dictionary<UUID, AgentData> ());
                    m_incomingChildAgentData[scene][cAgentData.AgentID] = cAgentData;
                    return false;//The agent doesn't exist
                }
            return true;
        }
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:33,代码来源:EntityTransferModule.cs


示例9: DoTeleport

        public virtual void DoTeleport(IScenePresence sp, GridRegion finalDestination, Vector3 position, Vector3 lookAt, uint teleportFlags)
        {
            sp.ControllingClient.SendTeleportProgress(teleportFlags, "sending_dest");
            if (finalDestination == null)
            {
                sp.ControllingClient.SendTeleportFailed("Unable to locate destination");
                return;
            }

            MainConsole.Instance.DebugFormat(
                "[ENTITY TRANSFER MODULE]: Request Teleport to {0}:{1}/{2}",
                finalDestination.ServerURI, finalDestination.RegionName, position);

            sp.ControllingClient.SendTeleportProgress(teleportFlags, "arriving");
            sp.SetAgentLeaving(finalDestination);

            // Fixing a bug where teleporting while sitting results in the avatar ending up removed from
            // both regions
            if (sp.ParentID != UUID.Zero)
                sp.StandUp();

            AgentCircuitData agentCircuit = BuildCircuitDataForPresence(sp, position);

            AgentData agent = new AgentData();
            sp.CopyTo(agent);
            //Fix the position
            agent.Position = position;

            IEventQueueService eq = sp.Scene.RequestModuleInterface<IEventQueueService>();
            if (eq != null)
            {
                ISyncMessagePosterService syncPoster = sp.Scene.RequestModuleInterface<ISyncMessagePosterService>();
                if (syncPoster != null)
                {
                    //This does CreateAgent and sends the EnableSimulator/EstablishAgentCommunication/TeleportFinish
                    //  messages if they need to be called and deals with the callback
                    syncPoster.Get(SyncMessageHelper.TeleportAgent((int)sp.DrawDistance,
                        agentCircuit, agent, teleportFlags, finalDestination, sp.Scene.RegionInfo.RegionHandle),
                        sp.UUID, sp.Scene.RegionInfo.RegionHandle, (map) =>
                        {
                            if (map == null || !map["success"].AsBoolean())
                            {
                                // Fix the agent status
                                sp.IsChildAgent = false;
                                //Tell modules about it
                                sp.AgentFailedToLeave();
                                sp.ControllingClient.SendTeleportFailed(map != null
                                                                            ? map["Reason"].AsString()
                                                                            : "Teleport Failed");
                                return;
                            }
                            //Get the new destintation, it may have changed
                            if (map.ContainsKey("Destination"))
                            {
                                finalDestination = new GridRegion();
                                finalDestination.FromOSD((OSDMap)map["Destination"]);
                            }
                            MakeChildAgent(sp, finalDestination, false);
                        });
                }
            }

        }
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:63,代码来源:EntityTransferModule.cs


示例10: CreateAgent

        public virtual bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags,
                                        AgentData data, out int requestedUDPPort, out string reason)
        {
            reason = String.Empty;
            // Try local first
            if (m_localBackend.CreateAgent(destination, aCircuit, teleportFlags, data, out requestedUDPPort,
                                           out reason))
                return true;
            requestedUDPPort = destination.ExternalEndPoint.Port; //Just make sure..

            reason = String.Empty;

            string uri = MakeUri(destination, true) + aCircuit.AgentID + "/";

            try
            {
                OSDMap args = aCircuit.PackAgentCircuitData();

                args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString());
                args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString());
                args["destination_name"] = OSD.FromString(destination.RegionName);
                args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
                args["teleport_flags"] = OSD.FromString(teleportFlags.ToString());
                if (data != null)
                    args["agent_data"] = data.Pack();

                string resultStr = WebUtils.PostToService(uri, args);
                //Pull out the result and set it as the reason
                if (resultStr == "")
                    return false;
                OSDMap result = OSDParser.DeserializeJson(resultStr) as OSDMap;
                reason = result["reason"] != null ? result["reason"].AsString() : "";
                if (result["success"].AsBoolean())
                {
                    //Not right... don't return true except for opensim combatibility :/
                    if (reason == "" || reason == "authorized")
                        return true;
                    //We were able to contact the region
                    try
                    {
                        //We send the CapsURLs through, so we need these
                        OSDMap responseMap = (OSDMap) OSDParser.DeserializeJson(reason);
                        if (responseMap.ContainsKey("Reason"))
                            reason = responseMap["Reason"].AsString();
                        if (responseMap.ContainsKey("requestedUDPPort"))
                            requestedUDPPort = responseMap["requestedUDPPort"];
                        return result["success"].AsBoolean();
                    }
                    catch
                    {
                        //Something went wrong
                        return false;
                    }
                }

                reason = result.ContainsKey("Message") ? result["Message"].AsString() : "Could not contact the region";
                return false;
            }
            catch (Exception e)
            {
                MainConsole.Instance.Warn("[REMOTE SIMULATION CONNECTOR]: CreateAgent failed with exception: " + e);
                reason = e.Message;
            }

            return false;
        }
开发者ID:rjspence,项目名称:YourSim,代码行数:66,代码来源:SimulationServiceConnector.cs


示例11: GeneratePlatformData

        public PlatformData GeneratePlatformData(AgentData agentData)
        {
            var platformData = new PlatformData(agentData);

            ComponentData[] pendingComponentData = QueryHistory.Select(qh => ComponentDataRetriever.GetData(qh.Value.ToArray()))
                .Where(c => c != null).ToArray();

            pendingComponentData.ForEach(platformData.AddComponent);

            return platformData;
        }
开发者ID:AlphaGit,项目名称:newrelic_microsoft_sqlserver_plugin,代码行数:11,代码来源:SqlEndpointBase.cs


示例12: UpdateAgent

 public bool UpdateAgent(GridRegion destination, AgentData data)
 {
     return UpdateAgent(destination, (IAgentData) data);
 }
开发者ID:rjspence,项目名称:YourSim,代码行数:4,代码来源:SimulationServiceConnector.cs


示例13: RetrieveAgent

        public bool RetrieveAgent(GridRegion destination, UUID id, bool agentIsLeaving, out AgentData agent,
                                  out AgentCircuitData circuitData)
        {
            agent = null;
            // Try local first
            if (m_localBackend.RetrieveAgent(destination, id, agentIsLeaving, out agent, out circuitData))
                return true;

            // else do the remote thing
            if (!m_localBackend.IsLocalRegion(destination.RegionHandle))
            {
                // Eventually, we want to use a caps url instead of the agentID
                string uri = MakeUri(destination, true) + id + "/" + destination.RegionID.ToString() + "/" +
                             agentIsLeaving.ToString() + "/";

                try
                {
                    string resultStr = WebUtils.GetFromService(uri);
                    if (resultStr != "")
                    {
                        OSDMap result = OSDParser.DeserializeJson(resultStr) as OSDMap;
                        if (result["Result"] == "Not Found")
                            return false;
                        agent = new AgentData();

                        if (!result.ContainsKey("AgentData"))
                            return false; //Disable old simulators

                        agent.Unpack((OSDMap)result["AgentData"]);
                        circuitData = new AgentCircuitData();
                        circuitData.UnpackAgentCircuitData((OSDMap)result["CircuitData"]);
                        return true;
                    }
                }
                catch (Exception e)
                {
                    MainConsole.Instance.Warn("[REMOTE SIMULATION CONNECTOR]: UpdateAgent failed with exception: " + e);
                }

                return false;
            }

            return false;
        }
开发者ID:rjspence,项目名称:YourSim,代码行数:44,代码来源:SimulationServiceConnector.cs


示例14: PopulationData

    public PopulationData(ArrayList tested, ArrayList untested)
    {
        testedPools = new ArrayList();
        untestedPools = new ArrayList();
        foreach (ArrayList gen in tested)
        {

            ArrayList newGen = new ArrayList();
            foreach(Agent agent in gen)
            {
                AgentData newAgent = new AgentData(agent);
                newGen.Add(newAgent);
            }

            testedPools.Add(newGen);
        }

        foreach (ArrayList gen in untested)
        {

            ArrayList newGen = new ArrayList();
            foreach (Agent agent in gen)
            {
                AgentData newAgent = new AgentData(agent);
                newGen.Add(newAgent);
            }

            untestedPools.Add(newGen);
        }
    }
开发者ID:CallumCode,项目名称:GeneticAlgorithmGame,代码行数:30,代码来源:PopulationManager.cs


示例15: RestartStatsAndState

		protected abstract void RestartStatsAndState(float percentage, AgentData data);
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:1,代码来源:Enemy.cs


示例16: addToDeathList

 public void addToDeathList(AgentData data)
 {
     DeathList.Add (data);
 }
开发者ID:kca8,项目名称:Jigsaw,代码行数:4,代码来源:AIDirector.cs


示例17: CopyTo

        public void CopyTo(AgentData cAgent)
        {
            cAgent.AgentID = UUID;
            cAgent.RegionID = Scene.RegionInfo.RegionID;

            cAgent.Position = AbsolutePosition + OffsetPosition;
            cAgent.Velocity = Velocity;
            cAgent.Center = m_CameraCenter;
            // Don't copy the size; it is inferred from appearance parameters
            //But it seems we should use it since it doesn't get set right on child tps sometimes
            cAgent.Size = new Vector3(0, 0, m_avHeight);
            cAgent.AtAxis = m_CameraAtAxis;
            cAgent.LeftAxis = m_CameraLeftAxis;
            cAgent.UpAxis = m_CameraUpAxis;

            cAgent.Far = DrawDistance;

            // Throttles 
            float multiplier = 1;
            int innacurateNeighbors = m_scene.RequestModuleInterface<IGridRegisterModule>().GetNeighbors(m_scene).Count;
            if (innacurateNeighbors != 0)
            {
                multiplier = 1f / innacurateNeighbors;
            }
            if (multiplier <= 0.25f)
            {
                multiplier = 0.25f;
            }
            //MainConsole.Instance.Info("[NeighborThrottle]: " + m_scene.GetInaccurateNeighborCount().ToString() + " - m: " + multiplier.ToString());
            cAgent.Throttles = ControllingClient.GetThrottlesPacked(multiplier);

            cAgent.HeadRotation = m_headrotation;
            cAgent.BodyRotation = m_bodyRot;
            cAgent.ControlFlags = (uint)m_AgentControlFlags;

            //This is checked by the other sim, so we don't have to validate it at all
            //if (m_scene.Permissions.IsGod(new UUID(cAgent.AgentID)))
            cAgent.GodLevel = (byte)m_godLevel;
            //else 
            //    cAgent.GodLevel = (byte) 0;

            cAgent.Speed = SpeedModifier;
            cAgent.DrawDistance = DrawDistance;
            cAgent.AlwaysRun = m_setAlwaysRun;
            IAvatarAppearanceModule appearance = RequestModuleInterface<IAvatarAppearanceModule>();
            if (appearance != null)
            {
                cAgent.SentInitialWearables = appearance.InitialHasWearablesBeenSent;
                cAgent.Appearance = new AvatarAppearance(appearance.Appearance);
            }

            IScriptControllerModule m = RequestModuleInterface<IScriptControllerModule>();
            if (m != null)
                cAgent.Controllers = m.Serialize();

            cAgent.SittingObjects = new SittingObjectData();
            if (Sitting)
            {
                ISceneChildEntity child = Scene.GetSceneObjectPart(SittingOnUUID);
                if (child != null && child.ParentEntity != null)
                {
                    cAgent.SittingObjects.m_sittingObjectXML = ((ISceneObject)child.ParentEntity).ToXml2();
                    cAgent.SittingObjects.m_sitTargetPos = OffsetPosition;//Get the difference
                    cAgent.SittingObjects.m_sitTargetRot = m_bodyRot;
                    cAgent.SittingObjects.m_animation = m_nextSitAnimation;
                }
            }

            // Animations
            if (Animator != null)
                cAgent.Anims = Animator.Animations.ToArray();
        }
开发者ID:satlanski2,项目名称:Aurora-Sim,代码行数:72,代码来源:AsyncScenePresence.cs


示例18: RestartStatsAndState

		protected override void RestartStatsAndState(float percentage, AgentData data)
		{
			var creepData = (CreepData)data;
			Stats.Clear();
			CreateStat("Hp", creepData.MaxHp);
			var amountToSubtract = (1 - percentage) * creepData.MaxHp;
			AdjustStat(new StatAdjustment("Hp", "", -amountToSubtract));
			CreateStat("Speed", creepData.Speed);
			CreateStat("Resistance", creepData.Resistance);
			CreateStat("Gold", creepData.GoldReward);
			State = new CreepState();
			foreach (var modifier in creepData.TypeDamageModifier)
				State.SetVulnerabilityWithValue(modifier.Key, modifier.Value);
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:14,代码来源:Creep.cs


示例19: CopyFrom

        public void CopyFrom(AgentData cAgent)
        {
            try
            {
                m_callbackURI = cAgent.CallbackURI;
                m_pos = cAgent.Position;
                if (PhysicsActor != null)
                {
                    AbsolutePosition = cAgent.Position;
                    PhysicsActor.ForceSetPosition(cAgent.Position);
                }
                Velocity = cAgent.Velocity;
                m_CameraCenter = cAgent.Center;
                SetHeight(cAgent.Size.Z);
                m_CameraAtAxis = cAgent.AtAxis;
                m_CameraLeftAxis = cAgent.LeftAxis;
                m_CameraUpAxis = cAgent.UpAxis;

                DrawDistance = cAgent.Far;

                if ((cAgent.Throttles != null) && cAgent.Throttles.Length > 0)
     

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# AgentManager.ControlFlags类代码示例发布时间:2022-05-24
下一篇:
C# AgentCircuitData类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap