This website works better with JavaScript.
Home
Issues
Pull Requests
Milestones
AI流水线
Repositories
Datasets
Forum
实训
竞赛
大数据
Register
Sign In
youys
/
Discord.Net
Not watched
Unwatch
Watch all
Watch but not notify
1
Star
0
Fork
0
Code
Releases
34
Wiki
Activity
Issues
0
Pull Requests
0
Datasets
Model
Cloudbrain
Browse Source
Refactor GameParty to use dedicated current/capacity values
Per feedback from
@khionu
pull/877/head
Christopher F
7 years ago
parent
b1f442c59b
commit
cb768f55b0
2 changed files
with
11 additions
and
2 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+2
-1
src/Discord.Net.Core/Entities/Activities/GameParty.cs
+9
-1
src/Discord.Net.WebSocket/Extensions/EntityExtensions.cs
+ 2
- 1
src/Discord.Net.Core/Entities/Activities/GameParty.cs
View File
@@ -5,6 +5,7 @@
internal GameParty() { }
public string Id { get; internal set; }
public int[] Size { get; internal set; }
public int Members { get; internal set; }
public int Capacity { get; internal set; }
}
}
+ 9
- 1
src/Discord.Net.WebSocket/Extensions/EntityExtensions.cs
View File
@@ -56,10 +56,18 @@
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;
if (model.Size.Length == 2)
{
current = model.Size[0];
cap = model.Size[1];
}
return new GameParty
{
Id = model.Id,
Size = model.Size
Members = current,
Capacity = cap,
};
}
Write
Preview
Loading…
Cancel
Save