protected void ShutdownClientServer(RegionInfo whichRegion) { // Close and remove the clientserver for a region bool foundClientServer = false; int clientServerElement = 0; Location location = new Location(whichRegion.RegionHandle); for (int i = 0; i < m_clientServers.Count; i++) { if (m_clientServers[i].HandlesRegion(location)) { clientServerElement = i; foundClientServer = true; break; } } if (foundClientServer) { m_clientServers[clientServerElement].Stop(); m_clientServers.RemoveAt(clientServerElement); } }
public void AddScene(IScene scene) { if (m_scene != null) { m_log.Error("[LLUDPSERVER]: AddScene() called on an LLUDPServer that already has a scene"); return; } if (!(scene is Scene)) { m_log.Error("[LLUDPSERVER]: AddScene() called with an unrecognized scene type " + scene.GetType()); return; } m_scene = (Scene)scene; m_location = new Location(m_scene.RegionInfo.RegionHandle); StatsManager.RegisterStat( new Stat( "InboxPacketsCount", "Number of LL protocol packets waiting for the second stage of processing after initial receive.", "Number of LL protocol packets waiting for the second stage of processing after initial receive.", "", "clientstack", scene.Name, StatType.Pull, MeasuresOfInterest.AverageChangeOverTime, stat => stat.Value = packetInbox.Count, StatVerbosity.Debug)); // XXX: These stats are also pool stats but we register them separately since they are currently not // turned on and off by EnablePools()/DisablePools() StatsManager.RegisterStat( new PercentageStat( "PacketsReused", "Packets reused", "Number of packets reused out of all requests to the packet pool", "clientstack", m_scene.Name, StatType.Pull, stat => { PercentageStat pstat = (PercentageStat)stat; pstat.Consequent = PacketPool.Instance.PacketsRequested; pstat.Antecedent = PacketPool.Instance.PacketsReused; }, StatVerbosity.Debug)); StatsManager.RegisterStat( new PercentageStat( "PacketDataBlocksReused", "Packet data blocks reused", "Number of data blocks reused out of all requests to the packet pool", "clientstack", m_scene.Name, StatType.Pull, stat => { PercentageStat pstat = (PercentageStat)stat; pstat.Consequent = PacketPool.Instance.BlocksRequested; pstat.Antecedent = PacketPool.Instance.BlocksReused; }, StatVerbosity.Debug)); StatsManager.RegisterStat( new Stat( "PacketsPoolCount", "Objects within the packet pool", "The number of objects currently stored within the packet pool", "", "clientstack", m_scene.Name, StatType.Pull, stat => stat.Value = PacketPool.Instance.PacketsPooled, StatVerbosity.Debug)); StatsManager.RegisterStat( new Stat( "PacketDataBlocksPoolCount", "Objects within the packet data block pool", "The number of objects currently stored within the packet data block pool", "", "clientstack", m_scene.Name, StatType.Pull, stat => stat.Value = PacketPool.Instance.BlocksPooled, StatVerbosity.Debug)); // We delay enabling pool stats to AddScene() instead of Initialize() so that we can distinguish pool stats by // scene name if (UsePools) EnablePoolStats(); MainConsole.Instance.Commands.AddCommand( "Debug", false, "debug lludp packet", "debug lludp packet [--default] <level> [<avatar-first-name> <avatar-last-name>]", "Turn on packet debugging", "If level > 255 then all incoming and outgoing packets are logged.\n" + "If level <= 255 then incoming AgentUpdate and outgoing SimStats and SimulatorViewerTimeMessage packets are not logged.\n" + "If level <= 200 then incoming RequestImage and outgoing ImagePacket, ImageData, LayerData and CoarseLocationUpdate packets are not logged.\n" + "If level <= 100 then incoming ViewerEffect and AgentAnimation and outgoing ViewerEffect and AvatarAnimation packets are not logged.\n" + "If level <= 50 then outgoing ImprovedTerseObjectUpdate packets are not logged.\n" + "If level <= 0 then no packets are logged.\n" + "If --default is specified then the level becomes the default logging level for all subsequent agents.\n" + "In this case, you cannot also specify an avatar name.\n" + "If an avatar name is given then only packets from that avatar are logged.", HandlePacketCommand); MainConsole.Instance.Commands.AddCommand( "Debug", false, "debug lludp start", "debug lludp start <in|out|all>", "Control LLUDP packet processing.", "No effect if packet processing has already started.\n" + "in - start inbound processing.\n" + "out - start outbound processing.\n" + "all - start in and outbound processing.\n", HandleStartCommand); MainConsole.Instance.Commands.AddCommand( "Debug", false, "debug lludp stop", "debug lludp stop <in|out|all>", "Stop LLUDP packet processing.", "No effect if packet processing has already stopped.\n" + "in - stop inbound processing.\n" + "out - stop outbound processing.\n" + "all - stop in and outbound processing.\n", HandleStopCommand); MainConsole.Instance.Commands.AddCommand( "Debug", false, "debug lludp pool", "debug lludp pool <on|off>", "Turn object pooling within the lludp component on or off.", HandlePoolCommand); MainConsole.Instance.Commands.AddCommand( "Debug", false, "debug lludp status", "debug lludp status", "Return status of LLUDP packet processing.", HandleStatusCommand); MainConsole.Instance.Commands.AddCommand( "Debug", false, "debug lludp toggle agentupdate", "debug lludp toggle agentupdate", "Toggle whether agentupdate packets are processed or simply discarded.", HandleAgentUpdateCommand); }
public bool HandlesRegion(Location x) { return x == m_location; }
public void AddScene(IScene scene) { if (m_scene != null) { m_log.Error("[LLUDPSERVER]: AddScene() called on an LLUDPServer that already has a scene"); return; } if (!(scene is Scene)) { m_log.Error("[LLUDPSERVER]: AddScene() called with an unrecognized scene type " + scene.GetType()); return; } m_scene = (Scene)scene; m_location = new Location(m_scene.RegionInfo.RegionHandle); }
public bool HandlesRegion(Location x) { return m_udpServer.HandlesRegion(x); }
protected void ShutdownClientServer(RegionInfo whichRegion) { if (m_log.IsDebugEnabled) { m_log.DebugFormat ("{0} called", System.Reflection.MethodBase.GetCurrentMethod ().Name); } // Close and remove the clientserver for a region bool foundClientServer = false; int clientServerElement = 0; Location location = new Location(whichRegion.RegionHandle); for (int i = 0; i < m_clientServers.Count; i++) { if (m_clientServers[i].HandlesRegion(location)) { clientServerElement = i; foundClientServer = true; break; } } if (foundClientServer) { m_clientServers[clientServerElement].Stop(); m_clientServers.RemoveAt(clientServerElement); } }
public void AddScene(IScene scene) { if (Scene != null) { m_log.Error("[LLUDPSERVER]: AddScene() called on an LLUDPServer that already has a scene"); return; } if (!(scene is Scene)) { m_log.Error("[LLUDPSERVER]: AddScene() called with an unrecognized scene type " + scene.GetType()); return; } Scene = (Scene)scene; m_location = new Location(Scene.RegionInfo.RegionHandle); IpahEngine = new JobEngine( string.Format("Incoming Packet Async Handling Engine ({0})", Scene.Name), "INCOMING PACKET ASYNC HANDLING ENGINE"); OqrEngine = new JobEngine( string.Format("Outgoing Queue Refill Engine ({0})", Scene.Name), "OUTGOING QUEUE REFILL ENGINE"); StatsManager.RegisterStat( new Stat( "InboxPacketsCount", "Number of LL protocol packets waiting for the second stage of processing after initial receive.", "Number of LL protocol packets waiting for the second stage of processing after initial receive.", "", "clientstack", scene.Name, StatType.Pull, MeasuresOfInterest.AverageChangeOverTime, stat => stat.Value = packetInbox.Count, StatVerbosity.Debug)); // XXX: These stats are also pool stats but we register them separately since they are currently not // turned on and off by EnablePools()/DisablePools() StatsManager.RegisterStat( new PercentageStat( "PacketsReused", "Packets reused", "Number of packets reused out of all requests to the packet pool", "clientstack", Scene.Name, StatType.Pull, stat => { PercentageStat pstat = (PercentageStat)stat; pstat.Consequent = PacketPool.Instance.PacketsRequested; pstat.Antecedent = PacketPool.Instance.PacketsReused; }, StatVerbosity.Debug)); StatsManager.RegisterStat( new PercentageStat( "PacketDataBlocksReused", "Packet data blocks reused", "Number of data blocks reused out of all requests to the packet pool", "clientstack", Scene.Name, StatType.Pull, stat => { PercentageStat pstat = (PercentageStat)stat; pstat.Consequent = PacketPool.Instance.BlocksRequested; pstat.Antecedent = PacketPool.Instance.BlocksReused; }, StatVerbosity.Debug)); StatsManager.RegisterStat( new Stat( "PacketsPoolCount", "Objects within the packet pool", "The number of objects currently stored within the packet pool", "", "clientstack", Scene.Name, StatType.Pull, stat => stat.Value = PacketPool.Instance.PacketsPooled, StatVerbosity.Debug)); StatsManager.RegisterStat( new Stat( "PacketDataBlocksPoolCount", "Objects within the packet data block pool", "The number of objects currently stored within the packet data block pool", "", "clientstack", Scene.Name, StatType.Pull, stat => stat.Value = PacketPool.Instance.BlocksPooled, StatVerbosity.Debug)); StatsManager.RegisterStat( new Stat( "OutgoingPacketsQueuedCount", "Packets queued for outgoing send", "Number of queued outgoing packets across all connections", "", "clientstack", Scene.Name, StatType.Pull, MeasuresOfInterest.AverageChangeOverTime, stat => stat.Value = GetTotalQueuedOutgoingPackets(), StatVerbosity.Info)); StatsManager.RegisterStat( new Stat( "IncomingPacketAsyncRequestsWaiting", "Number of incoming packets waiting for async processing in engine.", "", "", "clientstack", Scene.Name, StatType.Pull, MeasuresOfInterest.None, stat => stat.Value = IpahEngine.JobsWaiting, StatVerbosity.Debug)); StatsManager.RegisterStat( new Stat( "OQRERequestsWaiting", "Number of outgong queue refill requests waiting for processing.", "", "", "clientstack", Scene.Name, StatType.Pull, MeasuresOfInterest.None, stat => stat.Value = OqrEngine.JobsWaiting, StatVerbosity.Debug)); // We delay enabling pool stats to AddScene() instead of Initialize() so that we can distinguish pool stats by // scene name if (UsePools) EnablePoolStats(); LLUDPServerCommands commands = new LLUDPServerCommands(MainConsole.Instance, this); commands.Register(); }
public bool Equals(Location loc) { return loc.X == X && loc.Y == Y; }
public void AddScene(IScene scene) { if (m_scene != null) { m_log.Error("[LLUDPSERVER]: AddScene() called on an LLUDPServer that already has a scene"); return; } if (!(scene is Scene)) { m_log.Error("[LLUDPSERVER]: AddScene() called with an unrecognized scene type " + scene.GetType()); return; } m_scene = (Scene)scene; m_location = new Location(m_scene.RegionInfo.RegionHandle); // XXX: These stats are also pool stats but we register them separately since they are currently not // turned on and off by EnablePools()/DisablePools() StatsManager.RegisterStat( new PercentageStat( "PacketsReused", "Packets reused", "Number of packets reused out of all requests to the packet pool", "clientstack", m_scene.Name, StatType.Pull, stat => { PercentageStat pstat = (PercentageStat)stat; pstat.Consequent = PacketPool.Instance.PacketsRequested; pstat.Antecedent = PacketPool.Instance.PacketsReused; }, StatVerbosity.Debug)); StatsManager.RegisterStat( new PercentageStat( "PacketDataBlocksReused", "Packet data blocks reused", "Number of data blocks reused out of all requests to the packet pool", "clientstack", m_scene.Name, StatType.Pull, stat => { PercentageStat pstat = (PercentageStat)stat; pstat.Consequent = PacketPool.Instance.BlocksRequested; pstat.Antecedent = PacketPool.Instance.BlocksReused; }, StatVerbosity.Debug)); StatsManager.RegisterStat( new Stat( "PacketsPoolCount", "Objects within the packet pool", "The number of objects currently stored within the packet pool", "", "clientstack", m_scene.Name, StatType.Pull, stat => stat.Value = PacketPool.Instance.PacketsPooled, StatVerbosity.Debug)); StatsManager.RegisterStat( new Stat( "PacketDataBlocksPoolCount", "Objects within the packet data block pool", "The number of objects currently stored within the packet data block pool", "", "clientstack", m_scene.Name, StatType.Pull, stat => stat.Value = PacketPool.Instance.BlocksPooled, StatVerbosity.Debug)); // We delay enabling pool stats to AddScene() instead of Initialize() so that we can distinguish pool stats by // scene name if (UsePools) EnablePoolStats(); MainConsole.Instance.Commands.AddCommand( "Debug", false, "debug lludp start", "debug lludp start <in|out|all>", "Control LLUDP packet processing.", "No effect if packet processing has already started.\n" + "in - start inbound processing.\n" + "out - start outbound processing.\n" + "all - start in and outbound processing.\n", HandleStartCommand); MainConsole.Instance.Commands.AddCommand( "Debug", false, "debug lludp stop", "debug lludp stop <in|out|all>", "Stop LLUDP packet processing.", "No effect if packet processing has already stopped.\n" + "in - stop inbound processing.\n" + "out - stop outbound processing.\n" + "all - stop in and outbound processing.\n", HandleStopCommand); MainConsole.Instance.Commands.AddCommand( "Debug", false, "debug lludp pool", "debug lludp pool <on|off>", "Turn object pooling within the lludp component on or off.", HandlePoolCommand); MainConsole.Instance.Commands.AddCommand( "Debug", false, "debug lludp status", "debug lludp status", "Return status of LLUDP packet processing.", HandleStatusCommand); }
public bool HandlesRegion(Location x) { //return x.RegionHandle == m_location.RegionHandle; return x == m_location; }
public void handleRestartRegion(RegionInfo whichRegion) { m_log.Info("[OPENSIM]: Got restart signal from SceneManager"); // Shutting down the client server bool foundClientServer = false; int clientServerElement = 0; Location location = new Location(whichRegion.RegionHandle); for (int i = 0; i < m_clientServers.Count; i++) { if (m_clientServers[i].HandlesRegion(location)) { clientServerElement = i; foundClientServer = true; break; } } if (foundClientServer) { m_clientServers[clientServerElement].Server.Close(); m_clientServers.RemoveAt(clientServerElement); } IScene scene; CreateRegion(whichRegion, true, out scene); }
public void AddScene(IScene scene) { if (m_scene != null) { m_log.Error("[LLUDPSERVER]: AddScene() called on an LLUDPServer that already has a scene"); return; } if (!(scene is Scene)) { m_log.Error("[LLUDPSERVER]: AddScene() called with an unrecognized scene type " + scene.GetType()); return; } m_scene = (Scene)scene; m_location = new Location(m_scene.RegionInfo.RegionHandle); MainConsole.Instance.Commands.AddCommand( "Debug", false, "debug lludp start", "debug lludp start <in|out|all>", "Control LLUDP packet processing.", "No effect if packet processing has already started.\n" + "in - start inbound processing.\n" + "out - start outbound processing.\n" + "all - start in and outbound processing.\n", HandleStartCommand); MainConsole.Instance.Commands.AddCommand( "Debug", false, "debug lludp stop", "debug lludp stop <in|out|all>", "Stop LLUDP packet processing.", "No effect if packet processing has already stopped.\n" + "in - stop inbound processing.\n" + "out - stop outbound processing.\n" + "all - stop in and outbound processing.\n", HandleStopCommand); MainConsole.Instance.Commands.AddCommand( "Debug", false, "debug lludp pool", "debug lludp pool <on|off>", "Turn object pooling within the lludp component on or off.", HandlePoolCommand); MainConsole.Instance.Commands.AddCommand( "Debug", false, "debug lludp status", "debug lludp status", "Return status of LLUDP packet processing.", HandleStatusCommand); }