77use Illuminate \Support \Facades \Http ;
88use Pterodactyl \BlueprintFramework \Services \PlaceholderService \BlueprintPlaceholderService ;
99use Pterodactyl \BlueprintFramework \Libraries \ExtensionLibrary \Console \BlueprintConsoleLibrary as BlueprintExtensionLibrary ;
10+ use Database \Seeders \BlueprintSeeder ;
1011
1112class BlueprintTelemetryCollectionService
1213{
@@ -16,6 +17,7 @@ class BlueprintTelemetryCollectionService
1617 public function __construct (
1718 private BlueprintExtensionLibrary $ blueprint ,
1819 private BlueprintPlaceholderService $ placeholderService ,
20+ private BlueprintSeeder $ seeder ,
1921 ) {
2022 }
2123
@@ -46,13 +48,30 @@ public function collect(): array
4648 $ this ->blueprint ->dbSet ('blueprint ' , 'internal:uuid ' , $ uuid );
4749 }
4850
51+ $ schema = $ this ->seeder ->getSchema ();
52+ $ flags = [];
53+
54+ if (isset ($ schema ['flags ' ])) {
55+ foreach ($ schema ['flags ' ] as $ flagName => $ config ) {
56+ $ path = "flags: {$ flagName }" ;
57+ $ value = $ this ->blueprint ->dbGet ('blueprint ' , $ path );
58+
59+ if (is_null ($ value )) {
60+ $ value = $ this ->seeder ->getDefaultsForFlag ($ path );
61+ }
62+
63+ $ flags [$ flagName ] = $ value ;
64+ }
65+ }
66+
4967 return [
5068 'id ' => $ uuid ,
5169 'telemetry_version ' => 1 ,
5270
5371 'blueprint ' => [
5472 'version ' => $ this ->placeholderService ->version (),
5573 'extensions ' => $ this ->blueprint ->extensions ()->toArray (),
74+ 'flags ' => $ flags ,
5675 'developer ' => $ this ->blueprint ->dbGet ('blueprint ' , 'flags:is_developer ' , 'false ' ) === "true " ,
5776 'docker ' => file_exists ('/.dockerenv ' ),
5877 ],
0 commit comments