mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 03:06:05 +08:00
* Submitting 3 files for the messagingserver that I've kept to myself.
This commit is contained in:
71
OpenSim/Grid/MessagingServer/PresenceBackreferenceEntry.cs
Normal file
71
OpenSim/Grid/MessagingServer/PresenceBackreferenceEntry.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using libsecondlife;
|
||||
|
||||
namespace OpenSim.Grid.MessagingServer
|
||||
{
|
||||
// This is a wrapper for a List<LLUUID> so it can be happily stored in a hashtable.
|
||||
public class PresenceBackreferenceEntry
|
||||
{
|
||||
List<LLUUID> AgentList = new List<LLUUID>();
|
||||
|
||||
public PresenceBackreferenceEntry()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Add(LLUUID item)
|
||||
{
|
||||
lock (AgentList)
|
||||
{
|
||||
AgentList.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
public LLUUID getitem(int index)
|
||||
{
|
||||
LLUUID result = null;
|
||||
lock (AgentList)
|
||||
{
|
||||
if (index > 0 && index < AgentList.Count)
|
||||
{
|
||||
result = AgentList[index];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
int count = 0;
|
||||
lock (AgentList)
|
||||
{
|
||||
count = AgentList.Count;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
||||
public void Remove(LLUUID item)
|
||||
{
|
||||
lock (AgentList)
|
||||
{
|
||||
if (AgentList.Contains(item))
|
||||
AgentList.Remove(item);
|
||||
}
|
||||
}
|
||||
|
||||
public bool contains(LLUUID item)
|
||||
{
|
||||
bool result = false;
|
||||
lock (AgentList)
|
||||
{
|
||||
result = AgentList.Contains(item);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user