Browse Source

Merge remote-tracking branch 'refs/remotes/RogueException/dev' into dev

pull/33/head
Justas Dabrila 9 years ago
parent
commit
19b5af52ec
11 changed files with 63 additions and 66 deletions
  1. +1
    -1
      README.md
  2. +2
    -2
      src/Discord.Net.Audio/project.json
  3. +21
    -21
      src/Discord.Net.Commands/project.json
  4. +1
    -1
      src/Discord.Net.Modules/ModuleManager.cs
  5. +22
    -22
      src/Discord.Net.Modules/project.json
  6. +1
    -1
      src/Discord.Net/API/Client/GatewaySocket/Commands/Identify.cs
  7. +1
    -6
      src/Discord.Net/DiscordClient.cs
  8. +2
    -5
      src/Discord.Net/DiscordConfig.cs
  9. +1
    -1
      src/Discord.Net/Net/WebSockets/GatewaySocket.cs
  10. +2
    -3
      src/Discord.Net/ServiceManager.cs
  11. +9
    -3
      src/Discord.Net/project.json

+ 1
- 1
README.md View File

@@ -1,4 +1,4 @@
# Discord.Net v0.9.0
# Discord.Net v0.9.0-rc3
An unofficial .Net API Wrapper for the Discord client (http://discordapp.com). An unofficial .Net API Wrapper for the Discord client (http://discordapp.com).


Check out the [documentation](https://discordnet.readthedocs.org/en/latest/) or join the [Discord API Chat](https://discord.gg/0SBTUU1wZTVjAMPx). Check out the [documentation](https://discordnet.readthedocs.org/en/latest/) or join the [Discord API Chat](https://discord.gg/0SBTUU1wZTVjAMPx).


+ 2
- 2
src/Discord.Net.Audio/project.json View File

@@ -1,5 +1,5 @@
{ {
"version": "0.9.0",
"version": "0.9.0-rc3",
"description": "A Discord.Net extension adding voice support.", "description": "A Discord.Net extension adding voice support.",
"authors": [ "RogueException" ], "authors": [ "RogueException" ],
"tags": [ "discord", "discordapp" ], "tags": [ "discord", "discordapp" ],
@@ -18,7 +18,7 @@
}, },


"dependencies": { "dependencies": {
"Discord.Net": "0.9.0"
"Discord.Net": "0.9.0-rc3"
}, },
"frameworks": { "frameworks": {
"net45": { }, "net45": { },


+ 21
- 21
src/Discord.Net.Commands/project.json View File

@@ -1,25 +1,25 @@
{ {
"version": "0.9.0",
"description": "A Discord.Net extension adding basic command support.",
"authors": [ "RogueException" ],
"tags": [ "discord", "discordapp" ],
"projectUrl": "https://github.com/RogueException/Discord.Net",
"licenseUrl": "http://opensource.org/licenses/MIT",
"repository": {
"type": "git",
"url": "git://github.com/RogueException/Discord.Net"
},
"compile": [ "**/*.cs", "../Discord.Net.Shared/*.cs" ],
"version": "0.9.0-rc3",
"description": "A Discord.Net extension adding basic command support.",
"authors": [ "RogueException" ],
"tags": [ "discord", "discordapp" ],
"projectUrl": "https://github.com/RogueException/Discord.Net",
"licenseUrl": "http://opensource.org/licenses/MIT",
"repository": {
"type": "git",
"url": "git://github.com/RogueException/Discord.Net"
},
"compile": [ "**/*.cs", "../Discord.Net.Shared/*.cs" ],


"compilationOptions": {
"warningsAsErrors": true
},
"compilationOptions": {
"warningsAsErrors": true
},


"dependencies": {
"Discord.Net": "0.9.0"
},
"frameworks": {
"net45": { },
"dotnet5.4": { }
}
"dependencies": {
"Discord.Net": "0.9.0-rc3"
},
"frameworks": {
"net45": { },
"dotnet5.4": { }
}
} }

+ 1
- 1
src/Discord.Net.Modules/ModuleManager.cs View File

@@ -98,7 +98,7 @@ namespace Discord.Modules
client.RoleDeleted += (s, e) => { if (HasIndirectServer(e.Server)) RoleDeleted(s, e); }; client.RoleDeleted += (s, e) => { if (HasIndirectServer(e.Server)) RoleDeleted(s, e); };


client.JoinedServer += (s, e) => { if (_allowAll) JoinedServer(s, e); }; client.JoinedServer += (s, e) => { if (_allowAll) JoinedServer(s, e); };
client.LeftServer += (s, e) => { if (HasIndirectServer(e.Server)) { DisableServer(e.Server); LeftServer(s, e); } };
client.LeftServer += (s, e) => { if (HasIndirectServer(e.Server)) LeftServer(s, e); };
client.ServerUpdated += (s, e) => { if (HasIndirectServer(e.After)) ServerUpdated(s, e); }; client.ServerUpdated += (s, e) => { if (HasIndirectServer(e.After)) ServerUpdated(s, e); };
client.ServerUnavailable += (s, e) => { if (HasIndirectServer(e.Server)) ServerUnavailable(s, e); }; client.ServerUnavailable += (s, e) => { if (HasIndirectServer(e.Server)) ServerUnavailable(s, e); };
client.ServerAvailable += (s, e) => { if (HasIndirectServer(e.Server)) ServerAvailable(s, e); }; client.ServerAvailable += (s, e) => { if (HasIndirectServer(e.Server)) ServerAvailable(s, e); };


+ 22
- 22
src/Discord.Net.Modules/project.json View File

@@ -1,26 +1,26 @@
{ {
"version": "0.9.0",
"description": "A Discord.Net extension adding basic plugin support.",
"authors": [ "RogueException" ],
"tags": [ "discord", "discordapp" ],
"projectUrl": "https://github.com/RogueException/Discord.Net",
"licenseUrl": "http://opensource.org/licenses/MIT",
"repository": {
"type": "git",
"url": "git://github.com/RogueException/Discord.Net"
},
"compile": [ "**/*.cs", "../Discord.Net.Shared/*.cs" ],
"version": "0.9.0-rc3",
"description": "A Discord.Net extension adding basic plugin support.",
"authors": [ "RogueException" ],
"tags": [ "discord", "discordapp" ],
"projectUrl": "https://github.com/RogueException/Discord.Net",
"licenseUrl": "http://opensource.org/licenses/MIT",
"repository": {
"type": "git",
"url": "git://github.com/RogueException/Discord.Net"
},
"compile": [ "**/*.cs", "../Discord.Net.Shared/*.cs" ],


"compilationOptions": {
"warningsAsErrors": true
},
"compilationOptions": {
"warningsAsErrors": true
},


"dependencies": {
"Discord.Net": "0.9.0",
"Discord.Net.Commands": "0.9.0"
},
"frameworks": {
"net45": { },
"dotnet5.4": { }
}
"dependencies": {
"Discord.Net": "0.9.0-rc3",
"Discord.Net.Commands": "0.9.0-rc3"
},
"frameworks": {
"net45": { },
"dotnet5.4": { }
}
} }

+ 1
- 1
src/Discord.Net/API/Client/GatewaySocket/Commands/Identify.cs View File

@@ -17,7 +17,7 @@ namespace Discord.API.Client.GatewaySocket
[JsonProperty("properties")] [JsonProperty("properties")]
public Dictionary<string, string> Properties { get; set; } public Dictionary<string, string> Properties { get; set; }
[JsonProperty("large_threshold", NullValueHandling = NullValueHandling.Ignore)] [JsonProperty("large_threshold", NullValueHandling = NullValueHandling.Ignore)]
public int? LargeThreshold { get; set; }
public int LargeThreshold { get; set; }
[JsonProperty("compress")] [JsonProperty("compress")]
public bool UseCompression { get; set; } public bool UseCompression { get; set; }
} }


+ 1
- 6
src/Discord.Net/DiscordClient.cs View File

@@ -896,12 +896,7 @@ namespace Discord
break; break;
} }
else else
{
if (Config.UseLargeThreshold)
user = server.AddUser(data.User.Id);
else
user = server.GetUser(data.User.Id);
}
user = server.AddUser(data.User.Id);
} }


if (user != null) if (user != null)


+ 2
- 5
src/Discord.Net/DiscordConfig.cs View File

@@ -34,8 +34,6 @@ namespace Discord


/// <summary> Gets or sets whether an encrypted login token should be saved to temp dir after successful login. </summary> /// <summary> Gets or sets whether an encrypted login token should be saved to temp dir after successful login. </summary>
public bool CacheToken { get; set; } = true; public bool CacheToken { get; set; } = true;
/// <summary> Gets or sets whether Discord should send information about offline users, for servers with more than 100 users. </summary>
public bool UseLargeThreshold { get; set; } = false;
/// <summary> Gets or sets the number of messages per channel that should be kept in cache. Setting this to zero disables the message cache entirely. </summary> /// <summary> Gets or sets the number of messages per channel that should be kept in cache. Setting this to zero disables the message cache entirely. </summary>
public int MessageCacheSize { get; set; } = 100; public int MessageCacheSize { get; set; } = 100;
/// <summary> Gets or sets whether the permissions cache should be used. This makes operations such as User.GetPermissions(Channel), User.ServerPermissions and Channel.Members </summary> /// <summary> Gets or sets whether the permissions cache should be used. This makes operations such as User.GetPermissions(Channel), User.ServerPermissions and Channel.Members </summary>
@@ -74,7 +72,7 @@ namespace Discord
public int ReconnectDelay { get; } public int ReconnectDelay { get; }
public int FailedReconnectDelay { get; } public int FailedReconnectDelay { get; }


public bool UseLargeThreshold { get; }
public int LargeThreshold { get; } = 250;
public int MessageCacheSize { get; } public int MessageCacheSize { get; }
public bool UsePermissionsCache { get; } public bool UsePermissionsCache { get; }
public bool EnablePreUpdateEvents { get; } public bool EnablePreUpdateEvents { get; }
@@ -90,8 +88,7 @@ namespace Discord
ConnectionTimeout = builder.ConnectionTimeout; ConnectionTimeout = builder.ConnectionTimeout;
ReconnectDelay = builder.ReconnectDelay; ReconnectDelay = builder.ReconnectDelay;
FailedReconnectDelay = builder.FailedReconnectDelay; FailedReconnectDelay = builder.FailedReconnectDelay;

UseLargeThreshold = builder.UseLargeThreshold;
MessageCacheSize = builder.MessageCacheSize; MessageCacheSize = builder.MessageCacheSize;
UsePermissionsCache = builder.UsePermissionsCache; UsePermissionsCache = builder.UsePermissionsCache;
EnablePreUpdateEvents = builder.EnablePreUpdateEvents; EnablePreUpdateEvents = builder.EnablePreUpdateEvents;


+ 1
- 1
src/Discord.Net/Net/WebSockets/GatewaySocket.cs View File

@@ -161,7 +161,7 @@ namespace Discord.Net.WebSockets
Version = 3, Version = 3,
Token = token, Token = token,
Properties = props, Properties = props,
LargeThreshold = _config.UseLargeThreshold ? 100 : (int?)null,
LargeThreshold = _config.LargeThreshold,
UseCompression = true UseCompression = true
}; };
QueueMessage(msg); QueueMessage(msg);


+ 2
- 3
src/Discord.Net/ServiceManager.cs View File

@@ -38,8 +38,7 @@ namespace Discord
return singletonT; return singletonT;
} }


IEnumerator<IService> IEnumerable<IService>.GetEnumerator() => _services.Values.GetEnumerator();

public IEnumerator GetEnumerator() => _services.Values.GetEnumerator();
public IEnumerator<IService> GetEnumerator() => _services.Values.GetEnumerator();
IEnumerator IEnumerable.GetEnumerator() => _services.Values.GetEnumerator();
} }
} }

+ 9
- 3
src/Discord.Net/project.json View File

@@ -1,5 +1,5 @@
{ {
"version": "0.9.0",
"version": "0.9.0-rc3-2",
"description": "An unofficial .Net API wrapper for the Discord client.", "description": "An unofficial .Net API wrapper for the Discord client.",
"authors": [ "authors": [
"RogueException" "RogueException"
@@ -63,8 +63,14 @@
}, },
"net45": { "net45": {
"frameworkAssemblies": { "frameworkAssemblies": {
"System.Runtime": "4.0.0.0",
"System.Threading.Tasks": "4.0.0.0"
"System.Runtime": {
"type": "build",
"version": ""
},
"System.Threading.Tasks": {
"type": "build",
"version": ""
}
}, },
"dependencies": { "dependencies": {
"WebSocket4Net": "0.14.1", "WebSocket4Net": "0.14.1",


Loading…
Cancel
Save