mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 09:16:28 +08:00
IRCBridgeModule (and ChatModule before the refactoring) didn't succeed in
finding out which region a new avatar was logging in to; the same problem occurred when the client/avatar logged out. the reason was mani-fold: - Scene.AddNewClient(...) would call SubscribeToClientEvents(client) which would subscribe to all client events and then call TriggerOnNewClient(...) BEFORE the ScenePresence object had even been created and added. i've moved the TriggerOnNewClient() call to the end of Scene.AddNewClient() - Scene.AddNewClient(...) is called with child == true; a later call to ScenePresence.MakeRootAgent() will turn child to false. When OnNewClient is triggered, child is still true, causing IRCBridgeModule's FindClientRegion to ignore the ScenePresence of the new avatar. i've changed IRCBridgeModule to still use OnNewClient and also OnLogout and OnConnectionClosed but only to signal that the avatar has logged on (logged off respectively). to track whether an avatar has actually entered a region i've added EventManager.OnMakeRootAgent (complementing OnMakeChildAgent). also, i've cleaned up the internal IRCModule code a bit. currently it still uses IClientAPI.SendChatMessage() which replicates the code in ChatModule, that needs to be changed to use TriggerOnChatFromWorld().
This commit is contained in:
@@ -930,12 +930,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// <param name="fromPos"></param>
|
||||
/// <param name="fromName"></param>
|
||||
/// <param name="fromAgentID"></param>
|
||||
public void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID, byte source, byte audible)
|
||||
public void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName,
|
||||
LLUUID fromAgentID, byte source, byte audible)
|
||||
{
|
||||
SendChatMessage(Helpers.StringToField(message), type, fromPos, fromName, fromAgentID, source, audible);
|
||||
}
|
||||
|
||||
public void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID, byte source, byte audible)
|
||||
public void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName,
|
||||
LLUUID fromAgentID, byte source, byte audible)
|
||||
{
|
||||
ChatFromSimulatorPacket reply = (ChatFromSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.ChatFromSimulator);
|
||||
reply.ChatData.Audible = audible;
|
||||
|
||||
Reference in New Issue
Block a user