aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
authorMW2007-07-19 10:44:19 +0000
committerMW2007-07-19 10:44:19 +0000
commit0b6e332e16cd7df588d3502318a722706d78928c (patch)
tree7e806ab6b6a4f316d5928443a0006a434ef3c451 /OpenSim/Region/Environment/Scenes/Scene.cs
parent* Fixing sandbox mode crash caused by removal of LocalStorage during cleanup ... (diff)
downloadopensim-SC_OLD-0b6e332e16cd7df588d3502318a722706d78928c.zip
opensim-SC_OLD-0b6e332e16cd7df588d3502318a722706d78928c.tar.gz
opensim-SC_OLD-0b6e332e16cd7df588d3502318a722706d78928c.tar.bz2
opensim-SC_OLD-0b6e332e16cd7df588d3502318a722706d78928c.tar.xz
Added some Alert methods to Scene , and a console command handler. So from the console to send alerts use : alert general <message> , for a instance wide message , or use alert firstname secondname <message> to send a alert to one user. (TODO: add region wide messages).
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs54
1 files changed, 54 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 7ed4c96..f435681 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -910,5 +910,59 @@ namespace OpenSim.Region.Environment.Scenes
910 } 910 }
911 911
912 #endregion 912 #endregion
913
914 #region Alert Methods
915 public void SendGeneralAlert(string message)
916 {
917 foreach (ScenePresence presence in this.Avatars.Values)
918 {
919 presence.ControllingClient.SendAlertMessage(message);
920 }
921 }
922
923 public void SendAlertToUser(LLUUID agentID, string message, bool modal)
924 {
925 if (this.Avatars.ContainsKey(agentID))
926 {
927 this.Avatars[agentID].ControllingClient.SendAgentAlertMessage(message, modal);
928 }
929 }
930
931 public void SendAlertToUser(string firstName, string lastName, string message, bool modal)
932 {
933 foreach (ScenePresence presence in this.Avatars.Values)
934 {
935 if ((presence.firstname == firstName) && (presence.lastname == lastName))
936 {
937 presence.ControllingClient.SendAgentAlertMessage(message, modal);
938 break;
939 }
940 }
941 }
942
943 public void HandleAlertCommand(string[] commandParams)
944 {
945 if (commandParams[0] == "general")
946 {
947 string message = this.CombineParams(commandParams, 1);
948 this.SendGeneralAlert(message);
949 }
950 else
951 {
952 string message = this.CombineParams(commandParams, 2);
953 this.SendAlertToUser(commandParams[0], commandParams[1], message, false);
954 }
955 }
956
957 private string CombineParams(string[] commandParams, int pos)
958 {
959 string result = "";
960 for (int i = pos; i < commandParams.Length; i++)
961 {
962 result += commandParams[i]+ " ";
963 }
964 return result;
965 }
966 #endregion
913 } 967 }
914} \ No newline at end of file 968} \ No newline at end of file