Exemplo n.º 1
0
        public static void InsertDiscord(ulong steamID, string discordID, string discordName, Dictionary <ulong, string> RoleData)
        {
            if (steamID == 0)
            {
                Log.Info($"Cannont Insert Discord, SteamId is 0");
                return;
            }

            Log.Info($"DiscordID for {steamID} received from SEDB!... Inserting into player account ({discordID})");
            var AccModule = new PlayerAccountModule();
            var account   = AccModule.GetAccount(steamID);

            account.DiscordData.DiscordID   = ulong.Parse(discordID);
            account.DiscordData.DiscordName = discordName;
            foreach (var role in RoleData)
            {
                if (account.DiscordData.DiscordID == ulong.Parse(discordID))
                {
                    account.DiscordData.DiscordName = discordName;
                    if (!account.DiscordData.Roles.ContainsKey(role.Key))
                    {
                        account.DiscordData.Roles.Add(role.Key, role.Value);
                    }
                }
            }

            AccModule.UpdatePlayerAccount(account);
        }
Exemplo n.º 2
0
 public static void InsertDiscordID(ulong steamID, string discordID, string discordName, Dictionary <ulong, string> RoleData)
 {
     PlayerAccountModule.InsertDiscord(steamID, discordID, discordName, RoleData);
 }