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

C# Framework.AgentCircuitData类代码示例

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

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



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

示例1: IsAuthorizedForRegion

        public bool IsAuthorizedForRegion(GridRegion region, AgentCircuitData agent, bool isRootAgent, out string reason)
        {
            ISceneManager manager = m_registry.RequestModuleInterface<ISceneManager>();
            if (manager != null)
            {
#if (!ISWIN)
                foreach (IScene scene in manager.GetAllScenes())
                {
                    if (scene.RegionInfo.RegionID == region.RegionID)
                    {
                        //Found the region, check permissions
                        return scene.Permissions.AllowedIncomingAgent(agent, isRootAgent, out reason);
                    }
                }
#else
                foreach (IScene scene in manager.GetAllScenes().Where(scene => scene.RegionInfo.RegionID == region.RegionID))
                {
                    //Found the region, check permissions
                    return scene.Permissions.AllowedIncomingAgent(agent, isRootAgent, out reason);
                }
#endif
            }
            reason = "Not Authorized as region does not exist.";
            return false;
        }
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:25,代码来源:AuthorizationService.cs


示例2: CreateAgent

        public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string myipaddress, out string reason)
        {
            // MainConsole.Instance.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: CreateAgent start");

            myipaddress = String.Empty;
            reason = String.Empty;

            if (destination == null)
            {
                MainConsole.Instance.Debug ("[GATEKEEPER SERVICE CONNECTOR]: Given destination is null");
                return false;
            }

            string uri = (destination.ServerURI.EndsWith ("/") ? destination.ServerURI : (destination.ServerURI + "/"))
                + AgentPath () + 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 (flags.ToString ());

                OSDMap result = WebUtils.PostToService (uri, args, true, true);
                if (result["Success"].AsBoolean ())
                {
                    OSDMap unpacked = (OSDMap)result["_Result"];

                    if (unpacked != null)
                    {
                        reason = unpacked["reason"].AsString ();
                        myipaddress = unpacked["your_ip"].AsString ();
                        return unpacked["success"].AsBoolean ();
                    }
                }

                reason = result["Message"] != null ? result["Message"].AsString () : "error";
                return false;
            }
            catch (Exception e)
            {
                MainConsole.Instance.Warn ("[REMOTE SIMULATION CONNECTOR]: CreateAgent failed with exception: " + e.ToString ());
                reason = e.Message;
            }

            return false;
        }
开发者ID:djphil,项目名称:Aurora-HG-Plugin,代码行数:50,代码来源:GatekeeperServiceConnector.cs


示例3: AddNewCircuit

 /// <summary>
 ///   Add information about a new circuit so that later on we can authenticate a new client session.
 /// </summary>
 /// <param name = "circuitCode"></param>
 /// <param name = "agentData"></param>
 public virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData)
 {
     lock (AgentCircuits)
     {
         AgentCircuits[circuitCode] = agentData;
     }
 }
开发者ID:samiam123,项目名称:Aurora-Sim,代码行数:12,代码来源:AgentCircuitManager.cs


示例4: ArrivedAtDestination

        public static OSDMap ArrivedAtDestination(UUID AgentID, int DrawDistance, AgentCircuitData circuit,
                                                  ulong requestingRegion)
        {
            OSDMap llsdBody = new OSDMap
                                  {
                                      {"AgentID", AgentID},
                                      {"DrawDistance", DrawDistance},
                                      {"Circuit", circuit.PackAgentCircuitData()}
                                  };

            return buildEvent("ArrivedAtDestination", llsdBody, AgentID, requestingRegion);
        }
开发者ID:samiam123,项目名称:Aurora-Sim,代码行数:12,代码来源:SyncMessageHelper.cs


示例5: ProduceUserUniversalIdentifier

        /// <summary>
        /// </summary>
        /// <param name = "acircuit"></param>
        /// <returns>uuid[;endpoint[;name]]</returns>
        public static string ProduceUserUniversalIdentifier(AgentCircuitData acircuit)
        {
            if (acircuit.ServiceURLs.ContainsKey("HomeURI"))
            {
                string agentsURI = acircuit.ServiceURLs["HomeURI"].ToString();
                if (!agentsURI.EndsWith("/"))
                    agentsURI += "/";

                // This is ugly, but there's no other way, given that the name is changed
                // in the agent circuit data for foreigners
                if (acircuit.lastname.Contains("@"))
                {
                    string[] parts = acircuit.firstname.Split(new[] {'.'});
                    if (parts.Length == 2)
                        return acircuit.AgentID.ToString() + ";" + agentsURI + ";" + parts[0] + " " + parts[1];
                }
                return acircuit.AgentID.ToString() + ";" + agentsURI + ";" + acircuit.firstname + " " +
                       acircuit.lastname;
            }
            else
                return acircuit.AgentID.ToString();
        }
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:26,代码来源:HGUtil.cs


示例6: LaunchAgentDirectly

 protected bool LaunchAgentDirectly(GridRegion region, ref AgentCircuitData aCircuit, out string reason)
 {
     return m_registry.RequestModuleInterface<IAgentProcessing> ().LoginAgent (region, ref aCircuit, out reason);
 }
开发者ID:djphil,项目名称:Aurora-Sim,代码行数:4,代码来源:LLLoginService.cs


示例7: UpdateAgentData

        public void UpdateAgentData(AgentCircuitData agentData)
        {
            if (AgentCircuits.ContainsKey(agentData.circuitcode))
            {
                AgentCircuits[agentData.circuitcode].startpos = agentData.startpos;

                // Updated for when we don't know them before calling Scene.NewUserConnection
                AgentCircuits[agentData.circuitcode].SecureSessionID = agentData.SecureSessionID;
                AgentCircuits[agentData.circuitcode].SessionID = agentData.SessionID;

                // MainConsole.Instance.Debug("update user start pos is " + agentData.startpos.X + " , " + agentData.startpos.Y + " , " + agentData.startpos.Z); //Un-Commented for debugging -VS
            }
        }
开发者ID:samiam123,项目名称:Aurora-Sim,代码行数:13,代码来源:AgentCircuitManager.cs


示例8: CreateCAPS

        public string CreateCAPS (UUID AgentID, string CAPSBase, ulong regionHandle, bool IsRootAgent, AgentCircuitData circuitData, uint port)
        {
            //Now make sure we didn't use an old one or something
            IClientCapsService service = GetOrCreateClientCapsService(AgentID);
            IRegionClientCapsService clientService = service.GetOrCreateCapsService(regionHandle, CAPSBase, circuitData, port);
            
            //Fix the root agent status
            clientService.RootAgent = IsRootAgent;

            m_registry.RequestModuleInterface<ISimulationBase>().EventManager.FireGenericEventHandler("UserLogin", AgentID);
            MainConsole.Instance.Debug("[CapsService]: Adding Caps URL " + clientService.CapsUrl + " for agent " + AgentID);
            return clientService.CapsUrl;
        }
开发者ID:JAllard,项目名称:Aurora-Sim,代码行数:13,代码来源:CapsService.cs


示例9: TeleportAgent

        public virtual bool TeleportAgent(ref GridRegion destination, uint TeleportFlags, int DrawDistance,
                                          AgentCircuitData circuit, AgentData agentData, UUID AgentID,
                                          ulong requestingRegion,
                                          out string reason)
        {
            IClientCapsService clientCaps =
                m_registry.RequestModuleInterface<ICapsService>().GetClientCapsService(AgentID);
            IRegionClientCapsService regionCaps = clientCaps.GetCapsService(requestingRegion);

            if (regionCaps == null || !regionCaps.RootAgent)
            {
                reason = "";
                ResetFromTransit(AgentID);
                return false;
            }

            bool result = false;
            try
            {
                bool callWasCanceled = false;

                ISimulationService SimulationService = m_registry.RequestModuleInterface<ISimulationService>();
                if (SimulationService != 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 useCallbacks = false;
                    //Note: we have to pull the new grid region info as the one from the region cannot be trusted
                    GridRegion oldRegion = destination;
                    IGridService GridService = m_registry.RequestModuleInterface<IGridService>();
                    if (GridService != null)
                    {
                        destination = GridService.GetRegionByUUID(clientCaps.AccountInfo.AllScopeIDs, destination.RegionID);
                        if (destination == null) //If its not in this grid
                            destination = oldRegion;
                        //Inform the client of the neighbor if needed
                        circuit.child = false; //Force child status to the correct type
                        circuit.roothandle = destination.RegionHandle;
                        if (!InformClientOfNeighbor(AgentID, requestingRegion, circuit, ref destination, TeleportFlags,
                                                    agentData, out reason, out useCallbacks))
                        {
                            ResetFromTransit(AgentID);
                            return false;
                        }
                    }
                    else
                    {
                        reason = "Could not find the grid service";
                        ResetFromTransit(AgentID);
                        return false;
                    }

                    IEventQueueService EQService = m_registry.RequestModuleInterface<IEventQueueService>();

                    IRegionClientCapsService otherRegion = clientCaps.GetCapsService(destination.RegionHandle);

                    EQService.TeleportFinishEvent(destination.RegionHandle, destination.Access,
                                                  otherRegion.LoopbackRegionIP,
                                                  otherRegion.CircuitData.RegionUDPPort,
                                                  otherRegion.CapsUrl,
                                                  4, AgentID, TeleportFlags,
                                                  destination.RegionSizeX, destination.RegionSizeY,
                                                  requestingRegion);

                    // TeleportFinish makes the client send CompleteMovementIntoRegion (at the destination), which
                    // trigers a whole shebang of things there, including MakeRoot. So let's wait for confirmation
                    // that the client contacted the destination before we send the attachments and close things here.

                    result = !useCallbacks || WaitForCallback(AgentID, out callWasCanceled);
                    if (!result)
                    {
                        //It says it failed, lets call the sim and check
                        AgentData data = null;
                        AgentCircuitData circuitData;
                        result = SimulationService.RetrieveAgent(destination, AgentID, false, out data, out circuitData);
                    }
                    if (!result)
                    {
                        if (!callWasCanceled)
                        {
                            MainConsole.Instance.Warn("[AgentProcessing]: Callback never came for teleporting agent " +
                                       AgentID + ". Resetting.");
                        }
                        //Close the agent at the place we just created if it isn't a neighbor
                        // 7/22 -- Kill the agent no matter what, it obviously is having issues getting there
                        //if (IsOutsideView (regionCaps.RegionX, destination.RegionLocX, regionCaps.Region.RegionSizeX, destination.RegionSizeX,
                        //    regionCaps.RegionY, destination.RegionLocY, regionCaps.Region.RegionSizeY, destination.RegionSizeY))
                        {
                            SimulationService.CloseAgent(destination, AgentID);
                            clientCaps.RemoveCAPS(destination.RegionHandle);
                        }
                        reason = !callWasCanceled ? "The teleport timed out" : "Cancelled";
                    }
                    else
                    {
//.........这里部分代码省略.........
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:101,代码来源:AgentProcessing.cs


示例10: Authenticate

        protected bool Authenticate(AgentCircuitData aCircuit)
        {
            if (!CheckAddress (aCircuit.ServiceSessionID))
                return false;

            string userURL = string.Empty;
            if (aCircuit.ServiceURLs.ContainsKey ("HomeURI"))
                userURL = aCircuit.ServiceURLs["HomeURI"].ToString ();

            if (userURL == string.Empty)
            {
                MainConsole.Instance.DebugFormat ("[GATEKEEPER SERVICE]: Agent did not provide an authentication server URL");
                return false;
            }

            if (userURL == m_ExternalName)
                return m_UserAgentService.VerifyAgent (aCircuit.SessionID, aCircuit.ServiceSessionID);
            else
            {
                //                Object[] args = new Object[] { userURL };
                IUserAgentService userAgentService = new UserAgentServiceConnector (userURL);
                if (userAgentService != null)
                {
                    try
                    {
                        return userAgentService.VerifyAgent (aCircuit.SessionID, aCircuit.ServiceSessionID);
                    }
                    catch
                    {
                        MainConsole.Instance.DebugFormat ("[GATEKEEPER SERVICE]: Unable to contact authentication service at {0}", userURL);
                        return false;
                    }
                }
            }

            return false;
        }
开发者ID:KSLcom,项目名称:Aurora-HG-Plugin,代码行数:37,代码来源:GatekeeperServices.cs


示例11: LoginAgent

        public virtual LoginAgentArgs LoginAgent(GridRegion region, AgentCircuitData aCircuit)
        {
            object retVal = base.DoRemoteByHTTP(_capsURL, region, aCircuit);
            if (retVal != null || m_doRemoteOnly)
            {
                if (retVal == null)
                {
                    ReadRemoteCapsPassword();
                    retVal = base.DoRemoteByHTTP(_capsURL, region, aCircuit);
                }
                return retVal == null ? null : (LoginAgentArgs)retVal;
            }

            bool success = false;
            string seedCap = "";
            string reason = "Could not find the simulation service";
            ICapsService capsService = m_registry.RequestModuleInterface<ICapsService>();
            ISimulationService SimulationService = m_registry.RequestModuleInterface<ISimulationService>();
            if (SimulationService != null)
            {
                // The client is in the region, we need to make sure it gets the right Caps
                // If CreateAgent is successful, it passes back a OSDMap of params that the client 
                //    wants to inform us about, and it includes the Caps SEED url for the region
                IRegionClientCapsService regionClientCaps = null;
                IClientCapsService clientCaps = null;
                if (capsService != null)
                {
                    //Remove any previous users
                    seedCap = capsService.CreateCAPS(aCircuit.AgentID,
                        CapsUtil.GetCapsSeedPath(aCircuit.CapsPath),
                        region.RegionHandle, true, aCircuit, 0);

                    clientCaps = capsService.GetClientCapsService(aCircuit.AgentID);
                    regionClientCaps = clientCaps.GetCapsService(region.RegionHandle);
                }


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

                int requestedUDPPort = 0;
                // As we are creating the agent, we must also initialize the CapsService for the agent
                success = CreateAgent(region, regionClientCaps, ref aCircuit, SimulationService, ref requestedUDPPort, out reason);
                if (requestedUDPPort == 0)
                    requestedUDPPort = region.ExternalEndPoint.Port;
                aCircuit.RegionUDPPort = requestedUDPPort;

                if (!success) // If it failed, do not set up any CapsService for the client
                {
                    if (reason != "")
                    {
                        try
                        {
                            OSDMap reasonMap = OSDParser.DeserializeJson(reason) as OSDMap;
                            if (reasonMap != null && reasonMap.ContainsKey("Reason"))
                                reason = reasonMap["Reason"].AsString();
                        }
                        catch
                        {
                            //If its already not JSON, it'll throw an exception, catch it
                        }
                    }
                    //Delete the Caps!
                    IAgentProcessing agentProcessor = m_registry.RequestModuleInterface<IAgentProcessing>();
                    if (agentProcessor != null && capsService != null)
                        agentProcessor.LogoutAgent(regionClientCaps, true);
                    else if (capsService != null)
                        capsService.RemoveCAPS(aCircuit.AgentID);
                    return new LoginAgentArgs { Success = success, CircuitData = aCircuit, Reason = reason, SeedCap = seedCap };
                }

                IPAddress ipAddress = regionClientCaps.Region.ExternalEndPoint.Address;
                if (capsService != null && reason != "")
                {
                    try
                    {
                        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))
#pragma warning disable 618
                                ipAddress = Dns.GetHostByName(ip).AddressList[0];
#pragma warning restore 618
                        }
                        region.ExternalEndPoint.Address = ipAddress;
                            //Fix this so that it gets sent to the client that way
                        regionClientCaps.AddCAPS(SimSeedCaps);
                        regionClientCaps = clientCaps.GetCapsService(region.RegionHandle);
                        regionClientCaps.LoopbackRegionIP = ipAddress;
                        regionClientCaps.CircuitData.RegionUDPPort = requestedUDPPort;
                        regionClientCaps.RootAgent = true;
                    }
                    catch
                    {
                        //Delete the Caps!
                        IAgentProcessing agentProcessor = m_registry.RequestModuleInterface<IAgentProcessing>();
//.........这里部分代码省略.........
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:101,代码来源:AgentProcessing.cs


示例12: EnableChildAgents

        public virtual void EnableChildAgents(UUID AgentID, ulong requestingRegion, int DrawDistance,
                                              AgentCircuitData circuit)
        {
            Util.FireAndForget((o) =>
                                   {
                                       int count = 0;
                                       int x, y;
                                       ICapsService capsService = m_registry.RequestModuleInterface<ICapsService>();
                                       IClientCapsService clientCaps = capsService.GetClientCapsService(AgentID);
                                       Util.UlongToInts(requestingRegion, out x, out y);
                                       GridRegion ourRegion =
                                           m_registry.RequestModuleInterface<IGridService>().GetRegionByPosition(
                                               clientCaps.AccountInfo.AllScopeIDs, x, y);
                                       if (ourRegion == null)
                                       {
                                           MainConsole.Instance.Info(
                                               "[AgentProcessing]: Failed to inform neighbors about new agent, could not find our region.");
                                           return;
                                       }
                                       List<GridRegion> neighbors = GetNeighbors(clientCaps.AccountInfo.AllScopeIDs, ourRegion, DrawDistance);

                                       clientCaps.GetRootCapsService().CircuitData.DrawDistance = DrawDistance;
                                           //Fix the root agents dd
                                       foreach (GridRegion neighbor in neighbors)
                                       {
                                           if (neighbor.RegionHandle != requestingRegion &&
                                               clientCaps.GetCapsService(neighbor.RegionHandle) == null)
                                           {
                                               string reason;
                                               AgentCircuitData regionCircuitData =
                                                   clientCaps.GetRootCapsService().CircuitData.Copy();
                                               GridRegion nCopy = neighbor;
                                               regionCircuitData.child = true; //Fix child agent status
                                               regionCircuitData.roothandle = requestingRegion;
                                               regionCircuitData.reallyischild = true;
                                               regionCircuitData.DrawDistance = DrawDistance;
                                               bool useCallbacks = false;
                                               InformClientOfNeighbor(AgentID, requestingRegion, regionCircuitData,
                                                                      ref nCopy,
                                                                      (uint) TeleportFlags.Default, null, out reason,
                                                                      out useCallbacks);
                                           }
                                           count++;
                                       }
                                   });
        }
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:46,代码来源:AgentProcessing.cs


示例13: MakeAgent

        protected AgentCircuitData MakeAgent(GridRegion region, UserAccount account,
            AvatarAppearance appearance, UUID session, UUID secureSession, uint circuit, Vector3 position,
            IPEndPoint clientIP)
        {
            AgentCircuitData aCircuit = new AgentCircuitData
                                            {
                                                AgentID = account.PrincipalID,
                                                Appearance = appearance ?? new AvatarAppearance(account.PrincipalID),
                                                CapsPath = CapsUtil.GetRandomCapsObjectPath(),
                                                child = false,
                                                circuitcode = circuit,
                                                SecureSessionID = secureSession,
                                                SessionID = session,
                                                startpos = position,
                                                IPAddress = clientIP.Address.ToString(),
                                                ClientIPEndPoint = clientIP
                                            };


            // the first login agent is root

            return aCircuit;
        }
开发者ID:djphil,项目名称:Aurora-Sim,代码行数:23,代码来源:LLLoginService.cs


示例14: 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


示例15: TryFindGridRegionForAgentLogin

 protected bool TryFindGridRegionForAgentLogin(List<GridRegion> regions, UserAccount account,
     AvatarAppearance appearance, UUID session, UUID secureSession, uint circuitCode, Vector3 position,
     IPEndPoint clientIP, AgentCircuitData aCircuit, out GridRegion destination)
 {
     foreach (GridRegion r in regions)
     {
         string reason;
         bool success = LaunchAgentDirectly(r, ref aCircuit, out reason);
         if (success)
         {
             aCircuit = MakeAgent(r, account, appearance, session, secureSession, circuitCode, position, clientIP);
             destination = r;
             return true;
         }
         m_GridService.SetRegionUnsafe(r.RegionID);
     }
     destination = null;
     return false;
 }
开发者ID:djphil,项目名称:Aurora-Sim,代码行数:19,代码来源:LLLoginService.cs


示例16: FromOSD

 public override void FromOSD(OSDMap map)
 {
     Success = map["Success"];
     CircuitData = new AgentCircuitData();
     CircuitData.FromOSD((OSDMap)map["CircuitData"]);
     SeedCap = map["SeedCap"];
     Reason = map["Reason"];
 }
开发者ID:rjspence,项目名称:YourSim,代码行数:8,代码来源:IAsyncMessagePosterService.cs


示例17: RetrieveAgent

        public bool RetrieveAgent(GridRegion destination, UUID id, bool agentIsLeaving, out AgentData agent,
                                  out AgentCircuitData circuitData)
        {
            agent = null;
            circuitData = null;

            if (destination == null)
                return false;

            foreach (IScene s in m_sceneList)
            {
                if (s.RegionInfo.RegionID == destination.RegionID)
                {
                    //MainConsole.Instance.Debug("[LOCAL COMMS]: Found region to send ChildAgentUpdate");
                    IEntityTransferModule transferModule = s.RequestModuleInterface<IEntityTransferModule>();
                    if (transferModule != null)
                        return transferModule.IncomingRetrieveRootAgent(s, id, agentIsLeaving, out agent,
                                                                        out circuitData);
                }
            }
            return false;
            //MainConsole.Instance.Debug("[LOCAL COMMS]: region not found for ChildAgentUpdate");
        }
开发者ID:rjspence,项目名称:YourSim,代码行数:23,代码来源:LocalSimulationServiceConnector.cs


示例18: CreateAgent

        /**
         * Agent-related communications
         */

        public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags,
                                AgentData data, out int requestedUDPPort, out string reason)
        {
            requestedUDPPort = 0;
            if (destination == null)
            {
                reason = "Given destination was null";
                MainConsole.Instance.DebugFormat("[LOCAL SIMULATION CONNECTOR]: CreateAgent was given a null destination");
                return false;
            }
            if (destination.ExternalEndPoint != null) requestedUDPPort = destination.ExternalEndPoint.Port;

#if (!ISWIN)
            foreach (IScene s in m_sceneList)
            {
                if (s.RegionInfo.RegionID == destination.RegionID)
                {
                    //MainConsole.Instance.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Found region {0} to send SendCreateChildAgent", destination.RegionName);
                    if (data != null)
                        UpdateAgent(destination, data);
                    IEntityTransferModule transferModule = s.RequestModuleInterface<IEntityTransferModule>();
                    if (transferModule != null)
                        return transferModule.NewUserConnection(s, aCircuit, teleportFlags, out requestedUDPPort, out reason);
                }
            }
#else
            foreach (IScene s in m_sceneList.Where(s => s.RegionInfo.RegionID == destination.RegionID))
            {
                //MainConsole.Instance.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Found region {0} to send SendCreateChildAgent", destination.RegionName);
                if (data != null)
                    UpdateAgent(destination, data);
                IEntityTransferModule transferModule = s.RequestModuleInterface<IEntityTransferModule>();
                if (transferModule != null)
                    return transferModule.NewUserConnection(s, aCircuit, teleportFlags, out requestedUDPPort,
                                                            out reason);
            }
#endif

            MainConsole.Instance.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Did not find region {0} for CreateAgent",
                              destination.RegionName);
            OSDMap map = new OSDMap();
            map["Reason"] = "Did not find region " + destination.RegionName;
            map["Success"] = false;
            reason = OSDParser.SerializeJsonString(map);
            return false;
        }
开发者ID:rjspence,项目名称:YourSim,代码行数:50,代码来源:LocalSimulationServiceConnector.cs


示例19: PackCreateAgentArguments

        protected OSDMap PackCreateAgentArguments(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, IPEndPoint ipaddress)
        {
            OSDMap args = null;
            try
            {
                args = aCircuit.PackAgentCircuitData ();
            }
            catch (Exception e)
            {
                MainConsole.Instance.Debug ("[USER AGENT CONNECTOR]: PackAgentCircuitData failed with exception: " + e.Message);
            }
            // Add the input arguments
            args["gatekeeper_serveruri"] = OSD.FromString (gatekeeper.ServerURI);
            args["gatekeeper_host"] = OSD.FromString (gatekeeper.ExternalHostName);
            args["gatekeeper_port"] = OSD.FromString (gatekeeper.HttpPort.ToString ());
            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["destination_serveruri"] = OSD.FromString (destination.ServerURI);

            // 10/3/2010
            // I added the client_ip up to the regular AgentCircuitData, so this doesn't need to be here.
            // This need cleaning elsewhere...
            //if (ipaddress != null)
            //    args["client_ip"] = OSD.FromString(ipaddress.Address.ToString());

            return args;
        }
开发者ID:djphil,项目名称:Aurora-HG-Plugin,代码行数:29,代码来源:UserAgentServiceConnector.cs


示例20: OnMessageReceived

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Framework.AssetBase类代码示例发布时间:2022-05-24
下一篇:
C# World.MabiSkill类代码示例发布时间: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