mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 18:55:58 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs OpenSim/Region/Framework/Scenes/Scene.Inventory.cs OpenSim/Region/Framework/Scenes/Scene.cs
This commit is contained in:
@@ -50,7 +50,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests
|
||||
TestHelpers.InMethod();
|
||||
// log4net.Config.XmlConfigurator.Configure();
|
||||
|
||||
TestScene scene = SceneHelpers.SetupScene();
|
||||
TestScene scene = new SceneHelpers().SetupScene();
|
||||
IConfigSource configSource = new IniConfigSource();
|
||||
IConfig config = configSource.AddConfig("Groups");
|
||||
config.Set("Enabled", true);
|
||||
|
||||
@@ -76,22 +76,27 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
|
||||
public void Say(string message)
|
||||
{
|
||||
SendOnChatFromClient(message, ChatTypeEnum.Say);
|
||||
SendOnChatFromClient(0, message, ChatTypeEnum.Say);
|
||||
}
|
||||
|
||||
public void Shout(string message)
|
||||
public void Say(int channel, string message)
|
||||
{
|
||||
SendOnChatFromClient(message, ChatTypeEnum.Shout);
|
||||
SendOnChatFromClient(channel, message, ChatTypeEnum.Say);
|
||||
}
|
||||
|
||||
public void Whisper(string message)
|
||||
public void Shout(int channel, string message)
|
||||
{
|
||||
SendOnChatFromClient(message, ChatTypeEnum.Whisper);
|
||||
SendOnChatFromClient(channel, message, ChatTypeEnum.Shout);
|
||||
}
|
||||
|
||||
public void Whisper(int channel, string message)
|
||||
{
|
||||
SendOnChatFromClient(channel, message, ChatTypeEnum.Whisper);
|
||||
}
|
||||
|
||||
public void Broadcast(string message)
|
||||
{
|
||||
SendOnChatFromClient(message, ChatTypeEnum.Broadcast);
|
||||
SendOnChatFromClient(0, message, ChatTypeEnum.Broadcast);
|
||||
}
|
||||
|
||||
public void GiveMoney(UUID target, int amount)
|
||||
@@ -146,10 +151,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
|
||||
#region Internal Functions
|
||||
|
||||
private void SendOnChatFromClient(string message, ChatTypeEnum chatType)
|
||||
private void SendOnChatFromClient(int channel, string message, ChatTypeEnum chatType)
|
||||
{
|
||||
OSChatMessage chatFromClient = new OSChatMessage();
|
||||
chatFromClient.Channel = 0;
|
||||
chatFromClient.Channel = channel;
|
||||
chatFromClient.From = Name;
|
||||
chatFromClient.Message = message;
|
||||
chatFromClient.Position = StartPos;
|
||||
|
||||
@@ -212,6 +212,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
}
|
||||
|
||||
public bool Say(UUID agentID, Scene scene, string text)
|
||||
{
|
||||
return Say(agentID, scene, text, 0);
|
||||
}
|
||||
|
||||
public bool Say(UUID agentID, Scene scene, string text, int channel)
|
||||
{
|
||||
lock (m_avatars)
|
||||
{
|
||||
@@ -220,7 +225,25 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
ScenePresence sp;
|
||||
scene.TryGetScenePresence(agentID, out sp);
|
||||
|
||||
m_avatars[agentID].Say(text);
|
||||
m_avatars[agentID].Say(channel, text);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool Shout(UUID agentID, Scene scene, string text, int channel)
|
||||
{
|
||||
lock (m_avatars)
|
||||
{
|
||||
if (m_avatars.ContainsKey(agentID))
|
||||
{
|
||||
ScenePresence sp;
|
||||
scene.TryGetScenePresence(agentID, out sp);
|
||||
|
||||
m_avatars[agentID].Shout(channel, text);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -247,6 +270,24 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool Whisper(UUID agentID, Scene scene, string text, int channel)
|
||||
{
|
||||
lock (m_avatars)
|
||||
{
|
||||
if (m_avatars.ContainsKey(agentID))
|
||||
{
|
||||
ScenePresence sp;
|
||||
scene.TryGetScenePresence(agentID, out sp);
|
||||
|
||||
m_avatars[agentID].Whisper(channel, text);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool Stand(UUID agentID, Scene scene)
|
||||
{
|
||||
lock (m_avatars)
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
|
||||
m_attMod = new AttachmentsModule();
|
||||
m_npcMod = new NPCModule();
|
||||
|
||||
m_scene = SceneHelpers.SetupScene();
|
||||
m_scene = new SceneHelpers().SetupScene();
|
||||
SceneHelpers.SetupSceneModules(m_scene, config, m_afMod, m_umMod, m_attMod, m_npcMod, new BasicInventoryAccessModule());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user