Browse Source

Moved Roles out of the primary data store

pull/97/head
RogueException 9 years ago
parent
commit
89fadb52f6
2 changed files with 0 additions and 8 deletions
  1. +0
    -3
      src/Discord.Net/WebSocket/Data/DefaultDataStore.cs
  2. +0
    -5
      src/Discord.Net/WebSocket/Data/IDataStore.cs

+ 0
- 3
src/Discord.Net/WebSocket/Data/DefaultDataStore.cs View File

@@ -1,14 +1,12 @@
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Discord.WebSocket.Data
{
public class DefaultDataStore : IDataStore
{
private const double AverageChannelsPerGuild = 10.22; //Source: Googie2149
private const double AverageRolesPerGuild = 5; //Source: Googie2149 //TODO: Get a real value
private const double AverageUsersPerGuild = 47.78; //Source: Googie2149
private const double CollectionMultiplier = 1.05; //Add buffer to handle growth
private const double CollectionConcurrencyLevel = 1; //WebSocket updater/event handler. //TODO: Needs profiling, increase to 2?
@@ -27,7 +25,6 @@ namespace Discord.WebSocket.Data
{
_channels = new ConcurrentDictionary<ulong, Channel>(1, (int)((guildCount * AverageChannelsPerGuild + dmChannelCount) * CollectionMultiplier));
_guilds = new ConcurrentDictionary<ulong, Guild>(1, (int)(guildCount * CollectionMultiplier));
_roles = new ConcurrentDictionary<ulong, Role>(1, (int)(guildCount * AverageRolesPerGuild * CollectionMultiplier));
_users = new ConcurrentDictionary<ulong, User>(1, (int)(guildCount * AverageUsersPerGuild * CollectionMultiplier));
}



+ 0
- 5
src/Discord.Net/WebSocket/Data/IDataStore.cs View File

@@ -6,7 +6,6 @@ namespace Discord.WebSocket.Data
{
IEnumerable<Channel> Channels { get; }
IEnumerable<Guild> Guilds { get; }
IEnumerable<Role> Roles { get; }
IEnumerable<User> Users { get; }

Channel GetChannel(ulong id);
@@ -17,10 +16,6 @@ namespace Discord.WebSocket.Data
void AddGuild(Guild guild);
Guild RemoveGuild(ulong id);

Role GetRole(ulong id);
void AddRole(Role role);
Role RemoveRole(ulong id);

User GetUser(ulong id);
void AddUser(User user);
User RemoveUser(ulong id);


Loading…
Cancel
Save