mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Use FileMonitor to synchronize Mailer bot (#1108) (v2)
Move SessionFileMonitor into a generic FileMonitor class Use FileMonintor for both SessionCache and the Mailer bot Allows multiple MCC instances to share the same database files (Add files missing in the previous commit)
This commit is contained in:
parent
5028cce2a5
commit
ce83cc0a33
6 changed files with 215 additions and 85 deletions
|
|
@ -1771,12 +1771,14 @@ namespace MinecraftClient
|
|||
public void OnPlayerLeave(Guid uuid)
|
||||
{
|
||||
string username = null;
|
||||
if (onlinePlayers.ContainsKey(uuid))
|
||||
username = onlinePlayers[uuid];
|
||||
|
||||
lock (onlinePlayers)
|
||||
{
|
||||
onlinePlayers.Remove(uuid);
|
||||
if (onlinePlayers.ContainsKey(uuid))
|
||||
{
|
||||
username = onlinePlayers[uuid];
|
||||
onlinePlayers.Remove(uuid);
|
||||
}
|
||||
}
|
||||
|
||||
DispatchBotEvent(bot => bot.OnPlayerLeave(uuid, username));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue