private void LoadList() { byte[] bytes = PlayerPrefsFile.GetBytes("BanList", null, false); if (bytes == null || bytes.Length == 0) { this.kickedSteamIds = new List <CoopKick.KickedPlayer>(); return; } try { BinaryFormatter binaryFormatter = new BinaryFormatter(); using (MemoryStream memoryStream = new MemoryStream(bytes)) { this.kickedSteamIds = (List <CoopKick.KickedPlayer>)binaryFormatter.Deserialize(memoryStream); } } catch (Exception exception) { Debug.LogException(exception); this.kickedSteamIds = new List <CoopKick.KickedPlayer>(); } }
public CoopKick() { try { byte[] bytes = PlayerPrefsFile.GetBytes("BanList", null, false); if (bytes != null) { IFormatter formatter = new BinaryFormatter(); using (MemoryStream memoryStream = new MemoryStream(bytes)) { this.kickedSteamIds = (List <CoopKick.KickedPlayer>)formatter.Deserialize(memoryStream); } } else { this.kickedSteamIds = new List <CoopKick.KickedPlayer>(); } } catch (Exception exception) { Debug.LogException(exception); this.kickedSteamIds = new List <CoopKick.KickedPlayer>(); } }