void OnNewClient(OpenSim.Framework.IClientAPI client) { // Use our convenience method below to get the client name, then send them a modal alert message // we use our m_ExampleConfig for the message - we can set that in the ini client.SendAgentAlertMessage(String.Format("Hello! {0}! {1}", GetClientName(client), m_ExampleMessage), true); m_log.InfoFormat("[ExampleModule]: NewClient {0} @ {1}", client.Name, client.RemoteEndPoint.ToString()); }
void HandleOnMakeRootAgent(ScenePresence obj) { ScenePresence sp = (ScenePresence)obj; OpenSim.Framework.IClientAPI client = sp.ControllingClient; client.SendAgentAlertMessage(String.Format("Welcome to my sim!"), true); client.Kick("too late bud"); }
void HandleOnMakeRootAgent(ScenePresence obj) { ScenePresence sp = (ScenePresence)obj; OpenSim.Framework.IClientAPI client = sp.ControllingClient; // Use our convenience method below to get the client name, then send them a modal alert message // we use our m_ExampleConfig for the message - we can set that in the ini client.SendAgentAlertMessage(String.Format("Hello! {0}! {1}", GetClientName(client), m_ExampleMessage), true); m_log.InfoFormat("[ExampleModule]: RootAgent {0} @ {1}", client.Name, client.RemoteEndPoint.ToString()); }
void OnNewClient(OpenSim.Framework.IClientAPI client) { // Just for fun - the new agent will not be a root agent // They are placed in the region as a child, then upgraded // See HandleOnMakeRootAgent below where we handle that event. string agent_type = "Root"; if (client.SceneAgent.IsChildAgent) { agent_type = "Child"; } // Use our convenience method below to get the client name, then send them a modal alert message // we use our m_ExampleConfig for the message - we can set that in the ini m_log.InfoFormat("[ExampleModule]: NewClient {0} {1} @ {2}", agent_type, client.Name, client.Scene.RegionInfo.RegionName); }
// We can add convenience methods to do tedious tasks and use them private string GetClientName(OpenSim.Framework.IClientAPI client) { return(String.Format("{0} {1}", client.FirstName, client.LastName)); }