private ClientMessage Deserialize(byte[] bytes) { MemoryStream stream = new MemoryStream(bytes); return(serializer.Deserialize(stream, new ClientMessage(), typeof(ClientMessage)) as ClientMessage); //return Serializer.Deserialize<ClientMessage> (stream); }
public static ItemSlots GetItemSlots(Character character) { if (character.itemSlotData == null) { Debug.Log("ItemSlotData is null"); return new ItemSlots(); } GmSerializer serializer = new GmSerializer(); MemoryStream stream = new MemoryStream(System.Convert.FromBase64String(character.itemSlotData)); return serializer.Deserialize(stream, new ItemSlots(), typeof(ItemSlots)) as ItemSlots; }
private static Characters Load() { if (!PlayerPrefs.HasKey("npcs")) { return(null); } byte[] bytes = Convert.FromBase64String(PlayerPrefs.GetString("npcs")); MemoryStream stream = new MemoryStream(bytes); GmSerializer serializer = new GmSerializer(); return(serializer.Deserialize(stream, new Characters(), typeof(Characters)) as Characters); }
public static ItemSlots GetItemSlots(Character character) { if (character.itemSlotData == null) { Debug.Log("ItemSlotData is null"); return(new ItemSlots()); } GmSerializer serializer = new GmSerializer(); MemoryStream stream = new MemoryStream(System.Convert.FromBase64String(character.itemSlotData)); return(serializer.Deserialize(stream, new ItemSlots(), typeof(ItemSlots)) as ItemSlots); }
private static Characters Load() { if (!PlayerPrefs.HasKey("npcs")) { return null; } byte[] bytes = Convert.FromBase64String(PlayerPrefs.GetString("npcs")); MemoryStream stream = new MemoryStream(bytes); GmSerializer serializer = new GmSerializer(); return serializer.Deserialize(stream, new Characters(), typeof(Characters)) as Characters; }