/// <summary> /// Assoziates a steamid with a tribe withhin a guild(discord server) /// </summary> /// <param name="guildid"></param> /// <param name="steamid"></param> /// <param name="tribe"></param> public static void SetTribe(ulong guildid, SteamIDData steamid, TribeData tribe) { if (!Directory.Exists(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid.SteamID)) { Directory.CreateDirectory(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid.SteamID); } if (tribe != null) { File.WriteAllText(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid.SteamID + "\\Tribe.txt", tribe.ID.ToString()); } else { File.Delete(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid.SteamID + "\\Tribe.txt"); if (Directory.GetFiles(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid.SteamID).Length == 0) { Directory.Delete(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid.SteamID); } } }
/// <summary> /// Sets a custom name for a steamid withhin a guild(discord server) /// </summary> /// <param name="guildid"></param> /// <param name="steamid"></param> /// <param name="name"></param> public static void SetName(ulong guildid, SteamIDData steamid, string name) { if (!Directory.Exists(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid.SteamID)) { Directory.CreateDirectory(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid.SteamID); } if (name != null && name != "") { File.WriteAllText(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid.SteamID + "\\Name.txt", name); } else { File.Delete(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid.SteamID + "\\Name.txt"); if (Directory.GetFiles(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid.SteamID).Length == 0) { Directory.Delete(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid.SteamID); } } }
/// <summary> /// Sets the relationship of a steamid /// </summary> /// <param name="guildid"></param> /// <param name="tribe"></param> /// <param name="relation"></param> public static void SetRelationship(ulong guildid, SteamIDData steamid, Relationship relation) { if (!Directory.Exists(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid.SteamID)) { Directory.CreateDirectory(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid.SteamID); } if (relation.CompareTo(Relationship.invalid) != 0 && relation.CompareTo(Relationship.unknown) != 0) { File.WriteAllText(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid.SteamID + "\\Relationship.txt", ((int)relation).ToString()); } else { File.Delete(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid.SteamID + "\\Relationship.txt"); if (Directory.GetFiles(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid.SteamID).Length == 0) { Directory.Delete(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid.SteamID); } } }
/// <summary> /// Returns the data for a certain steamid /// </summary> /// <param name="guilid"></param> /// <returns></returns> public static SteamIDData GetSteamID(ulong guildid, ulong steamid) { SteamIDData rg = new SteamIDData { SteamID = steamid }; if (Directory.Exists(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid)) { if (File.Exists(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid + "\\Name.txt")) { rg.name = File.ReadAllText(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid + "\\Name.txt"); } if (File.Exists(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid + "\\Relationship.txt")) { rg.relation = Compfort.IntToRelationship(int.Parse(File.ReadAllText(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid + "\\Relationship.txt"))); } if (File.Exists(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid + "\\Tribe.txt")) { rg.tribe = Compfort.GetTribeByID(guildid, int.Parse(File.ReadAllText(AppContext.BaseDirectory + "\\Guilds\\" + guildid + "\\SteamIDs\\" + steamid + "\\Tribe.txt"))); } } return(rg); }
/// <summary> /// Assoziates a steamid with a tribe withhin a guild(discord server) /// </summary> /// <param name="guildid"></param> /// <param name="steamid"></param> /// <param name="tribe"></param> public static void SetTribe(ulong guildid, SteamIDData steamid, TribeData tribe) { }
/// <summary> /// Sets a custom name for a steamid withhin a guild(discord server) /// </summary> /// <param name="guildid"></param> /// <param name="steamid"></param> /// <param name="name"></param> public static void SetName(ulong guildid, SteamIDData steamid, string name) { }
/// <summary> /// Sets the relationship of a steamid /// </summary> /// <param name="guildid"></param> /// <param name="tribe"></param> /// <param name="relation"></param> public static void SetRelationship(ulong guildid, SteamIDData steamid, Relationship relation) { }