OpenMetaverse.AgentManager.EstablishAgentCommunicationEventHandler C# (CSharp) Méthode

EstablishAgentCommunicationEventHandler() private méthode

private EstablishAgentCommunicationEventHandler ( string message, OSD osd, Simulator simulator ) : void
message string
osd OSD
simulator Simulator
Résultat void
        private void EstablishAgentCommunicationEventHandler(string message, OSD osd, Simulator simulator)
        {
            StructuredData.OSDMap body = (StructuredData.OSDMap)osd;

            if (Client.Settings.MULTIPLE_SIMS && body.ContainsKey("sim-ip-and-port"))
            {
                string ipAndPort = body["sim-ip-and-port"].AsString();
                string[] pieces = ipAndPort.Split(':');
                IPEndPoint endPoint = new IPEndPoint(IPAddress.Parse(pieces[0]), Convert.ToInt32(pieces[1]));
                Simulator sim = Client.Network.FindSimulator(endPoint);

                if (sim == null)
                {
                    Logger.Log("Got EstablishAgentCommunication for unknown sim " + ipAndPort,
                        Helpers.LogLevel.Error, Client);

                    // FIXME: Should we use this opportunity to connect to the simulator?
                }
                else
                {
                    Logger.Log("Got EstablishAgentCommunication for " + sim.ToString(),
                        Helpers.LogLevel.Info, Client);

                    sim.SetSeedCaps(body["seed-capability"].AsString());
                }
            }
        }