Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GameParty.Size serialization exception #955

Merged
merged 1 commit into from
Feb 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Discord.Net.Core/Entities/Activities/GameParty.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
namespace Discord
namespace Discord
{
public class GameParty
{
internal GameParty() { }

public string Id { get; internal set; }
public int Members { get; internal set; }
public int Capacity { get; internal set; }
public long Members { get; internal set; }
public long Capacity { get; internal set; }
}
}
}
6 changes: 3 additions & 3 deletions src/Discord.Net.Rest/API/Common/GameParty.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using Newtonsoft.Json;

namespace Discord.API
{
Expand All @@ -7,6 +7,6 @@ internal class GameParty
[JsonProperty("id")]
public string Id { get; set; }
[JsonProperty("size")]
public int[] Size { get; set; }
public long[] Size { get; set; }
}
}
}
4 changes: 2 additions & 2 deletions src/Discord.Net.WebSocket/Extensions/EntityExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Discord.WebSocket
namespace Discord.WebSocket
{
internal static class EntityExtensions
{
Expand Down Expand Up @@ -56,7 +56,7 @@ public static GameAsset[] ToEntity(this API.GameAssets model, ulong appId)
public static GameParty ToEntity(this API.GameParty model)
{
// Discord will probably send bad data since they don't validate anything
int current = 0, cap = 0;
long current = 0, cap = 0;
if (model.Size?.Length == 2)
{
current = model.Size[0];
Expand Down