mirror of
https://github.com/Nereziel/cs2-WeaponPaints.git
synced 2026-03-05 07:00:00 +00:00
2.3a
- Added music kits - Minor changes
This commit is contained in:
25
Utility.cs
25
Utility.cs
@@ -60,12 +60,17 @@ namespace WeaponPaints
|
||||
`weapon_defindex` int(11) NOT NULL,
|
||||
UNIQUE (`steamid`)
|
||||
) ENGINE=InnoDB",
|
||||
@"CREATE TABLE `wp_player_agents` (
|
||||
@"CREATE TABLE IF NOT EXISTS `wp_player_agents` (
|
||||
`steamid` varchar(18) NOT NULL,
|
||||
`agent_ct` varchar(64) DEFAULT NULL,
|
||||
`agent_t` varchar(64) DEFAULT NULL,
|
||||
UNIQUE KEY `steamid` (`steamid`)
|
||||
) ENGINE=InnoDB"
|
||||
UNIQUE (`steamid`)
|
||||
) ENGINE=InnoDB",
|
||||
@"CREATE TABLE IF NOT EXISTS `wp_player_music` (
|
||||
`steamid` varchar(64) NOT NULL,
|
||||
`music_id` int(11) NOT NULL,
|
||||
UNIQUE (`steamid`)
|
||||
) ENGINE=InnoDB",
|
||||
};
|
||||
|
||||
foreach (var query in createTableQueries)
|
||||
@@ -136,6 +141,20 @@ namespace WeaponPaints
|
||||
}
|
||||
}
|
||||
|
||||
internal static void LoadMusicFromFile(string filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
string json = File.ReadAllText(filePath);
|
||||
var deserializedSkins = JsonConvert.DeserializeObject<List<JObject>>(json);
|
||||
WeaponPaints.musicList = deserializedSkins ?? new List<JObject>();
|
||||
}
|
||||
catch (FileNotFoundException)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
internal static void Log(string message)
|
||||
{
|
||||
Console.BackgroundColor = ConsoleColor.DarkGray;
|
||||
|
||||
Reference in New Issue
Block a user