aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
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