// This is the very first agent public Agent(string gridserver, string gridserverkey, ulong regionhandle, IPEndPoint endpoint, uint httpport) { GridServerURL = gridserver; GridServerSendKey = gridserverkey; TheRegion = new RegionInfo(); uint x = 0, y = 0; Utils.LongToUInts(regionhandle, out x, out y); TheRegion.RegionLocX = x; TheRegion.RegionLocY = y; //region.RegionHandle = regionhandle; TheRegion.ExternalHostName = endpoint.Address.ToString(); TheRegion.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)0); TheRegion.HttpPort = httpport; //regionHandle = regionhandle; regionEndPoint = endpoint; //simHttpPort = httpport; CapsSeed = agentCircuitData.CapsPath; if (Home == null) Home = TheRegion; RegClient = new RegionClient(proxy, "http://" + TheRegion.ExternalHostName + ":" + TheRegion.HttpPort.ToString(), CapsSeed); SetupEQ(); Console.WriteLine("[Grider]: New agent for region " + TheRegion.ExternalEndPoint.Address + ":" + TheRegion.HttpPort + " at " + TheRegion.RegionLocX + "-" + TheRegion.RegionLocY); }
// All other agents public Agent(RegionInfo regInfo, Vector3 pos, Vector3 look) { TheRegion = regInfo; regionEndPoint = TheRegion.ExternalEndPoint; position = pos; lookAt = look; CapsSeed = CapsUtil.GetRandomCapsObjectPath(); RegClient = new RegionClient(proxy, "http://" + TheRegion.ExternalHostName + ":" + TheRegion.HttpPort.ToString(), CapsSeed); SetupEQ(); Console.WriteLine("[Grider]: New agent for region " + TheRegion.ExternalEndPoint.Address + ":" + TheRegion.HttpPort + " at " + TheRegion.RegionLocX + "-" + TheRegion.RegionLocY + " with caps seed " + CapsSeed); }