- Added music kits
- Minor changes
This commit is contained in:
Dawid Bepierszcz
2024-03-12 14:14:50 +01:00
parent 97e73bfd53
commit 548fdb642d
18 changed files with 697 additions and 75 deletions

View File

@@ -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;