* Refactored OutPacket and FirstName/LastName out of Friends Module.

0.6.0-stable
Teravus Ovares 2008-05-14 03:57:30 +00:00
parent 92128d4ef9
commit 9e1cc72c6e
5 changed files with 66 additions and 29 deletions

View File

@ -663,7 +663,7 @@ namespace OpenSim.Framework
event ChatFromViewer OnChatFromViewer;
[Obsolete("LLClientView Specific - Replace with more bare-bones arguments.")]
event TextureRequest OnRequestTexture;
[Obsolete("LLClientView Specific - Remove bitbuckets.")]
[Obsolete("LLClientView Specific - Remove bitbuckets. Adam, can you be more specific here.. as I don't see any bit buckets.")]
event RezObject OnRezObject;
[Obsolete("LLClientView Specific - Replace with more suitable arguments.")]
event ModifyTerrain OnModifyTerrain;
@ -965,7 +965,9 @@ namespace OpenSim.Framework
LLUUID OwnerUUID, string TouchTitle, byte[] TextureID, string SitTitle, string ItemName,
string ItemDescription, uint OwnerMask, uint NextOwnerMask, uint GroupMask, uint EveryoneMask,
uint BaseMask);
void SendAgentOffline(LLUUID[] agentIDs);
void SendAgentOnline(LLUUID[] agentIDs);
byte[] GetThrottlesPacked(float multiplier);

View File

@ -5704,6 +5704,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OutPacket(logReply, ThrottleOutPacketType.Task);
}
public void SendHealth(float health)
{
HealthMessagePacket healthpacket = (HealthMessagePacket)PacketPool.Instance.GetPacket(PacketType.HealthMessage);
@ -5711,6 +5712,33 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OutPacket(healthpacket, ThrottleOutPacketType.Task);
}
public void SendAgentOnline(LLUUID[] agentIDs)
{
OnlineNotificationPacket onp = new OnlineNotificationPacket();
OnlineNotificationPacket.AgentBlockBlock[] onpb = new OnlineNotificationPacket.AgentBlockBlock[agentIDs.Length];
for (int i = 0; i < agentIDs.Length; i++)
{
OnlineNotificationPacket.AgentBlockBlock onpbl = new OnlineNotificationPacket.AgentBlockBlock();
onpbl.AgentID = agentIDs[i];
onpb[i] = onpbl;
}
onp.AgentBlock = onpb;
OutPacket(onp, ThrottleOutPacketType.Task);
}
public void SendAgentOffline(LLUUID[] agentIDs)
{
OfflineNotificationPacket offp = new OfflineNotificationPacket();
OfflineNotificationPacket.AgentBlockBlock[] offpb = new OfflineNotificationPacket.AgentBlockBlock[agentIDs.Length];
for (int i = 0; i < agentIDs.Length; i++)
{
OfflineNotificationPacket.AgentBlockBlock onpbl = new OfflineNotificationPacket.AgentBlockBlock();
onpbl.AgentID = agentIDs[i];
offpb[i] = onpbl;
}
offp.AgentBlock = offpb;
OutPacket(offp, ThrottleOutPacketType.Task);
}
public ClientInfo GetClientInfo()
{
//MainLog.Instance.Verbose("CLIENT", "GetClientInfo BGN");

View File

@ -164,13 +164,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
if (fli.Friend == client.AgentId)
{
fli.onlinestatus = true;
OnlineNotificationPacket onp = new OnlineNotificationPacket();
OnlineNotificationPacket.AgentBlockBlock[] onpb = new OnlineNotificationPacket.AgentBlockBlock[1];
OnlineNotificationPacket.AgentBlockBlock onpbl = new OnlineNotificationPacket.AgentBlockBlock();
onpbl.AgentID = client.AgentId;
onpb[0] = onpbl;
onp.AgentBlock = onpb;
av.ControllingClient.OutPacket(onp, ThrottleOutPacketType.Task);
LLUUID[] Agents = new LLUUID[1];
Agents[0] = client.AgentId;
av.ControllingClient.SendAgentOnline(Agents);
}
}
}
@ -179,16 +176,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
if (UpdateUsers.Count > 0)
{
OnlineNotificationPacket onp = new OnlineNotificationPacket();
OnlineNotificationPacket.AgentBlockBlock[] onpb = new OnlineNotificationPacket.AgentBlockBlock[UpdateUsers.Count];
for (int i = 0; i < UpdateUsers.Count; i++)
{
OnlineNotificationPacket.AgentBlockBlock onpbl = new OnlineNotificationPacket.AgentBlockBlock();
onpbl.AgentID = UpdateUsers[i];
onpb[i] = onpbl;
}
onp.AgentBlock = onpb;
client.OutPacket(onp, ThrottleOutPacketType.Task);
client.SendAgentOnline(UpdateUsers.ToArray());
}
}
@ -278,13 +268,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
ScenePresence av = GetPresenceFromAgentID(updateUsers[i]);
if (av != null)
{
OfflineNotificationPacket onp = new OfflineNotificationPacket();
OfflineNotificationPacket.AgentBlockBlock[] onpb = new OfflineNotificationPacket.AgentBlockBlock[1];
OfflineNotificationPacket.AgentBlockBlock onpbl = new OfflineNotificationPacket.AgentBlockBlock();
onpbl.AgentID = AgentId;
onpb[0] = onpbl;
onp.AgentBlock = onpb;
av.ControllingClient.OutPacket(onp, ThrottleOutPacketType.Task);
LLUUID[] agents = new LLUUID[1];
agents[0] = AgentId;
av.ControllingClient.SendAgentOffline(agents);
}
}
}
@ -388,7 +374,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
msg.timestamp = timestamp;
if (client != null)
{
msg.fromAgentName = client.FirstName + " " + client.LastName; // fromAgentName;
msg.fromAgentName = client.Name; // fromAgentName;
}
else
{
@ -439,7 +425,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
GridInstantMessage msg = new GridInstantMessage();
msg.toAgentID = m_pendingFriendRequests[transactionID].UUID;
msg.fromAgentID = agentID.UUID;
msg.fromAgentName = client.FirstName + " " + client.LastName;
msg.fromAgentName = client.Name;
msg.fromAgentSession = client.SessionId.UUID;
msg.fromGroup = false;
msg.imSessionID = transactionID.UUID;
@ -477,7 +463,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
GridInstantMessage msg = new GridInstantMessage();
msg.toAgentID = m_pendingFriendRequests[transactionID].UUID;
msg.fromAgentID = agentID.UUID;
msg.fromAgentName = client.FirstName + " " + client.LastName;
msg.fromAgentName = client.Name;
msg.fromAgentSession = client.SessionId.UUID;
msg.fromGroup = false;
msg.imSessionID = transactionID.UUID;

View File

@ -83,6 +83,16 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
Position, m_scene.RegionInfo.RegionID, new byte[0]);
}
public void SendAgentOffline(LLUUID[] agentIDs)
{
}
public void SendAgentOnline(LLUUID[] agentIDs)
{
}
public LLUUID GetDefaultAnimation(string name)
{
return LLUUID.Zero;

View File

@ -563,6 +563,17 @@ namespace OpenSim.Region.Examples.SimpleModule
{
}
public void SendAgentOffline(LLUUID[] agentIDs)
{
}
public void SendAgentOnline(LLUUID[] agentIDs)
{
}
private void Update()
{
frame++;