diff --git a/backend/app/Savor22b/GraphTypes/Query/GetUnsignedTransactionHex.cs b/backend/app/Savor22b/GraphTypes/Query/GetUnsignedTransactionHex.cs index f3e3aa24..79f1a954 100644 --- a/backend/app/Savor22b/GraphTypes/Query/GetUnsignedTransactionHex.cs +++ b/backend/app/Savor22b/GraphTypes/Query/GetUnsignedTransactionHex.cs @@ -42,9 +42,9 @@ public GetUnsignedTransactionHex( _blockChain = blockChain; _swarm = swarm; -#if DEBUG - Signing(UnsignedTransactionHex); -#endif +// #if DEBUG +// Signing(UnsignedTransactionHex); +// #endif } public string UnsignedTransactionHex { get; private set; } diff --git a/frontend/Saver-22b-godot/Config.cs b/frontend/Saver-22b-godot/Config.cs deleted file mode 100644 index 242eac9c..00000000 --- a/frontend/Saver-22b-godot/Config.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Godot; -using System; -using System.IO; -using Newtonsoft.Json.Linq; - -public partial class Config : Node -{ - public string GraphQLUrl { get; private set; } - - public static Config Instance { get; private set; } - - public override void _Ready() - { - Instance = this; - LoadConfig(); - } - - public void LoadConfig() - { - string filePath = "res://config.json"; // 파일 경로 - string jsonText = File.ReadAllText(filePath); - JObject config = JObject.Parse(jsonText); - - GraphQLUrl = config["GraphQLUrl"].ToString(); - } -} diff --git a/frontend/Saver-22b-godot/gql/GraphQLClient.cs b/frontend/Saver-22b-godot/gql/GraphQLClient.cs deleted file mode 100644 index 380820e9..00000000 --- a/frontend/Saver-22b-godot/gql/GraphQLClient.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Godot; -using GraphQL.Client; -using GraphQL.Client.Http; -using GraphQL.Client.Serializer.Newtonsoft; -using System.Threading.Tasks; - -public partial class GraphQLClient : Node -{ - private GraphQLHttpClient client; - - public static GraphQLClient Instance { get; private set; } - - public override void _Ready() - { - Instance = this; - - client = new GraphQLHttpClient(Config.Instance.GraphQLUrl, new NewtonsoftJsonSerializer()); - } - - public async Task QueryAsync(string query) - { - var request = new GraphQLHttpRequest { Query = query }; - var response = await client.SendQueryAsync(request); - if (response.Errors != null) - { - GD.Print("Error: ", response.Errors[0].Message); - } - // else - // { - // GD.Print("Response: ", response.Data); - // } - return response.Data; - } -} diff --git a/frontend/Saver-22b-godot/gql/Queries.cs b/frontend/Saver-22b-godot/gql/Queries.cs deleted file mode 100644 index 0a472ec1..00000000 --- a/frontend/Saver-22b-godot/gql/Queries.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace GQL { - public static class Queries - { - public static string GetVillages => @" - query { - villages { - id - name - width - height - worldX - worldY - } - }"; - } -} diff --git a/frontend/Saver-22b-godot/gql/query.gd b/frontend/Saver-22b-godot/gql/query.gd new file mode 100644 index 00000000..645c0163 --- /dev/null +++ b/frontend/Saver-22b-godot/gql/query.gd @@ -0,0 +1,10 @@ +var get_villages_query = "query { + villages { + id + name + width + height + worldX + worldY + } +}" diff --git a/frontend/Saver-22b-godot/gql/svr_gql_client.gd b/frontend/Saver-22b-godot/gql/svr_gql_client.gd new file mode 100644 index 00000000..12099a28 --- /dev/null +++ b/frontend/Saver-22b-godot/gql/svr_gql_client.gd @@ -0,0 +1,5 @@ +extends GQLClient + +func _ready(): + print("client ready") + set_endpoint(false, "localhost", 38080, "/graphql") diff --git a/frontend/Saver-22b-godot/project.godot b/frontend/Saver-22b-godot/project.godot index efd79037..68894b15 100644 --- a/frontend/Saver-22b-godot/project.godot +++ b/frontend/Saver-22b-godot/project.godot @@ -19,8 +19,7 @@ config/icon="res://icon.svg" [autoload] GlobalSigner="*res://scripts/sign/Signer.gd" -GraphQlClient="*res://gql/GraphQLClient.cs" -Config="*res://Config.cs" +SvrGqlClient="*res://gql/svr_gql_client.gd" [display] @@ -32,6 +31,12 @@ window/stretch/mode="canvas_items" project/assembly_name="Saver-22b-godot" +[file_customization] + +folder_colors={ +"res://scenes/": "yellow" +} + [rendering] renderer/rendering_method="gl_compatibility" diff --git a/frontend/Saver-22b-godot/scenes/install_kitchen_equipment.tscn b/frontend/Saver-22b-godot/scenes/install_kitchen_equipment.tscn new file mode 100644 index 00000000..e2b425e7 --- /dev/null +++ b/frontend/Saver-22b-godot/scenes/install_kitchen_equipment.tscn @@ -0,0 +1,21 @@ +[gd_scene format=3 uid="uid://c7g8if1jb33im"] + +[node name="InstallKitchenEquipment" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Background" type="ColorRect" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = -1.0 +offset_right = -1120.0 +offset_bottom = -581.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(1, 0.623529, 0, 1) diff --git a/frontend/Saver-22b-godot/scenes/intro.tscn b/frontend/Saver-22b-godot/scenes/intro.tscn index f4f31e27..ee4ce9f9 100644 --- a/frontend/Saver-22b-godot/scenes/intro.tscn +++ b/frontend/Saver-22b-godot/scenes/intro.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=2 format=3 uid="uid://cg773cnsx4rb0"] +[gd_scene load_steps=3 format=3 uid="uid://cg773cnsx4rb0"] [ext_resource type="Script" path="res://scripts/intro.gd" id="1_0m54y"] +[ext_resource type="Script" path="res://scripts/gql_test.gd" id="2_yxm3e"] [node name="Intro" type="Control"] layout_mode = 3 @@ -96,5 +97,8 @@ grow_vertical = 2 theme_override_font_sizes/font_size = 70 text = "Play" +[node name="gql_test" type="Node" parent="."] +script = ExtResource("2_yxm3e") + [connection signal="button_down" from="QuitButtonContainer/Button" to="." method="_on_quit_button_button_down"] [connection signal="button_down" from="PlayButtonContainer/Button" to="." method="_on_play_button_button_down"] diff --git a/frontend/Saver-22b-godot/scripts/gql_test.gd b/frontend/Saver-22b-godot/scripts/gql_test.gd new file mode 100644 index 00000000..4d3b39fd --- /dev/null +++ b/frontend/Saver-22b-godot/scripts/gql_test.gd @@ -0,0 +1,27 @@ +extends Node + +var queryExecutor: GQLQueryExecuter + +# Called when the node enters the scene tree for the first time. +func _ready(): + var query = GQLQuery.new("villages").set_props([ + "id", + "name", + "width", + "height", + "worldX", + "worldY", + ]) + + queryExecutor = SvrGqlClient.query('query', {}, query) + queryExecutor.graphql_response.connect(self.graphql_response) + add_child(queryExecutor) + + queryExecutor.run({}) + +func graphql_response(data: Dictionary): + print(data) + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass