Fixed connecting with user tokens and updated gateway OP codespull/399/head
| @@ -18,7 +18,7 @@ namespace Discord.API.Client.GatewaySocket | |||||
| public int LargeThreshold { get; set; } | public int LargeThreshold { get; set; } | ||||
| [JsonProperty("compress")] | [JsonProperty("compress")] | ||||
| public bool UseCompression { get; set; } | public bool UseCompression { get; set; } | ||||
| [JsonProperty("shard")] | |||||
| [JsonProperty("shard", NullValueHandling = NullValueHandling.Ignore)] | |||||
| public int[] ShardingParams { get; set; } | public int[] ShardingParams { get; set; } | ||||
| } | } | ||||
| } | } | ||||
| @@ -18,7 +18,13 @@ | |||||
| Resume = 6, | Resume = 6, | ||||
| /// <summary> C←S - Used to notify a client that they must reconnect to another gateway. </summary> | /// <summary> C←S - Used to notify a client that they must reconnect to another gateway. </summary> | ||||
| Reconnect = 7, | Reconnect = 7, | ||||
| /// <summary> C→S - Used to request all members that were withheld by large_threshold </summary> | |||||
| RequestGuildMembers = 8 | |||||
| /// <summary> C→S - Used to request all members that were withheld by large_threshold. </summary> | |||||
| RequestGuildMembers = 8, | |||||
| /// <summary> C←S - Used to notify the client of an invalid session id. </summary> | |||||
| InvalidSession = 9, | |||||
| /// <summary> C←S - Used to receive heartbeat_interval information and initiate the websocket connection. </summary> | |||||
| Hello = 10, | |||||
| /// <summary> C←S - Used to acknowledge a heartbeat by the client. </summary> | |||||
| HeartbeatACK = 11 | |||||
| } | } | ||||
| } | } | ||||
| @@ -157,10 +157,10 @@ namespace Discord.Net.WebSockets | |||||
| var msg = new IdentifyCommand() | var msg = new IdentifyCommand() | ||||
| { | { | ||||
| Token = token, | Token = token, | ||||
| Properties = props, | |||||
| Properties = props, | |||||
| LargeThreshold = _config.LargeThreshold, | LargeThreshold = _config.LargeThreshold, | ||||
| UseCompression = true, | UseCompression = true, | ||||
| ShardingParams = new int[] { shardId, totalShards }, | |||||
| ShardingParams = token.StartsWith("Bot ") ? new int[] { shardId, totalShards } : null | |||||
| }; | }; | ||||
| QueueMessage(msg); | QueueMessage(msg); | ||||