diff --git a/Core/bottypes/AVstorageBot.cs b/Core/bottypes/AVstorageBot.cs index effe68b..81dc987 100644 --- a/Core/bottypes/AVstorageBot.cs +++ b/Core/bottypes/AVstorageBot.cs @@ -9,6 +9,9 @@ namespace BSB.bottypes { public abstract class AVstorageBot : AtHome { + protected UUID master_uuid = UUID.Zero; + public UUID getMaster_uuid { get { return master_uuid; } } + protected Dictionary AvatarStorageLastUsed = new Dictionary(); protected Dictionary AvatarName2Key = new Dictionary(); protected Dictionary AvatarKey2Name = new Dictionary(); @@ -137,10 +140,13 @@ namespace BSB.bottypes } foreach(string purge in PurgeAvatars) { - AvatarStorageLastUsed.Remove(purge); - UUID avuuid = AvatarName2Key[purge]; - AvatarName2Key.Remove(purge); - AvatarKey2Name.Remove(avuuid); + if (purge != myconfig.master) + { + AvatarStorageLastUsed.Remove(purge); + UUID avuuid = AvatarName2Key[purge]; + AvatarName2Key.Remove(purge); + AvatarKey2Name.Remove(avuuid); + } } } @@ -151,6 +157,10 @@ namespace BSB.bottypes { Client.Avatars.UUIDNameReply += Key2NameEvent; 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); } } + if (helpers.notempty(myconfig.master) == true) + { + if(myconfig.master == av_name) + { + master_uuid = av_uuid; + } + } } }