adjustments to the avatar storage engine to try and catch some trash
This commit is contained in:
parent
e4e264ea92
commit
48fd3f6e0d
1 changed files with 26 additions and 14 deletions
|
|
@ -134,13 +134,20 @@ namespace BSB.bottypes
|
|||
{
|
||||
long dif = now - entry.Value;
|
||||
if(dif > max_db_storage_age)
|
||||
{
|
||||
if (PurgeAvatars.Contains(entry.Key) == false)
|
||||
{
|
||||
PurgeAvatars.Add(entry.Key);
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach(string purge in PurgeAvatars)
|
||||
{
|
||||
if (purge != myconfig.master)
|
||||
{
|
||||
if (AvatarStorageLastUsed.ContainsKey(purge) == true)
|
||||
{
|
||||
if(AvatarName2Key.ContainsKey(purge) == true)
|
||||
{
|
||||
AvatarStorageLastUsed.Remove(purge);
|
||||
UUID avuuid = AvatarName2Key[purge];
|
||||
|
|
@ -149,6 +156,8 @@ namespace BSB.bottypes
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void AfterBotLoginHandler()
|
||||
{
|
||||
|
|
@ -184,6 +193,8 @@ namespace BSB.bottypes
|
|||
if ((av_name != "null") && (av_name != null))
|
||||
{
|
||||
if (AvatarStorageLastUsed.ContainsKey(av_name) == false)
|
||||
{
|
||||
if (av_uuid != UUID.Zero)
|
||||
{
|
||||
AvatarName2Key.Add(av_name, av_uuid);
|
||||
AvatarKey2Name.Add(av_uuid, av_name);
|
||||
|
|
@ -197,6 +208,7 @@ namespace BSB.bottypes
|
|||
PendingAvatarFinds_viauuid.Remove(av_uuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (helpers.notempty(myconfig.master) == true)
|
||||
{
|
||||
if(myconfig.master == av_name)
|
||||
|
|
|
|||
Loading…
Reference in a new issue