public void SaveAllPlayerData(bool isLocalGame) { foreach (String username in PlayerEntities.Keys.ToList()) { EntityFactory.DumpEntityIntoSaveFile(PlayerEntities[username], PlayerSaves[username]); FileGrabber.SavePlayer(isLocalGame, PlayerSaves[username]); } }
public void HandleDisconnect(bool isLocalGame, string username) { if (PlayerEntities.ContainsKey(username)) { EntityFactory.DumpEntityIntoSaveFile(PlayerEntities[username], PlayerSaves[username]); FileGrabber.SavePlayer(isLocalGame, PlayerSaves[username]); PlayerEntities.Remove(username); PlayerSaves.Remove(username); RUIDUsernames.Remove(username); } }