adds master_uuid auto loading
getMaster_uuid (public) value and master key2name avatar storage protection
This commit is contained in:
parent
2849b615e6
commit
dfd99d8c26
1 changed files with 21 additions and 4 deletions
|
|
@ -9,6 +9,9 @@ namespace BSB.bottypes
|
||||||
{
|
{
|
||||||
public abstract class AVstorageBot : AtHome
|
public abstract class AVstorageBot : AtHome
|
||||||
{
|
{
|
||||||
|
protected UUID master_uuid = UUID.Zero;
|
||||||
|
public UUID getMaster_uuid { get { return master_uuid; } }
|
||||||
|
|
||||||
protected Dictionary<string, long> AvatarStorageLastUsed = new Dictionary<string, long>();
|
protected Dictionary<string, long> AvatarStorageLastUsed = new Dictionary<string, long>();
|
||||||
protected Dictionary<string, UUID> AvatarName2Key = new Dictionary<string, UUID>();
|
protected Dictionary<string, UUID> AvatarName2Key = new Dictionary<string, UUID>();
|
||||||
protected Dictionary<UUID, string> AvatarKey2Name = new Dictionary<UUID, string>();
|
protected Dictionary<UUID, string> AvatarKey2Name = new Dictionary<UUID, string>();
|
||||||
|
|
@ -137,10 +140,13 @@ namespace BSB.bottypes
|
||||||
}
|
}
|
||||||
foreach(string purge in PurgeAvatars)
|
foreach(string purge in PurgeAvatars)
|
||||||
{
|
{
|
||||||
AvatarStorageLastUsed.Remove(purge);
|
if (purge != myconfig.master)
|
||||||
UUID avuuid = AvatarName2Key[purge];
|
{
|
||||||
AvatarName2Key.Remove(purge);
|
AvatarStorageLastUsed.Remove(purge);
|
||||||
AvatarKey2Name.Remove(avuuid);
|
UUID avuuid = AvatarName2Key[purge];
|
||||||
|
AvatarName2Key.Remove(purge);
|
||||||
|
AvatarKey2Name.Remove(avuuid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -151,6 +157,10 @@ namespace BSB.bottypes
|
||||||
{
|
{
|
||||||
Client.Avatars.UUIDNameReply += Key2NameEvent;
|
Client.Avatars.UUIDNameReply += Key2NameEvent;
|
||||||
Client.Directory.DirPeopleReply += Name2KeyEvent;
|
Client.Directory.DirPeopleReply += Name2KeyEvent;
|
||||||
|
if(helpers.notempty(myconfig.master) == true)
|
||||||
|
{
|
||||||
|
FindAvatarName2Key(myconfig.master);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -187,6 +197,13 @@ namespace BSB.bottypes
|
||||||
PendingAvatarFinds_viauuid.Remove(av_uuid);
|
PendingAvatarFinds_viauuid.Remove(av_uuid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (helpers.notempty(myconfig.master) == true)
|
||||||
|
{
|
||||||
|
if(myconfig.master == av_name)
|
||||||
|
{
|
||||||
|
master_uuid = av_uuid;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue