From 24b6f577eef1bba49157c75e7481c25c31043c62 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 30 Jan 2022 14:34:25 +0100 Subject: [PATCH] config sample --- config.sample.yaml | 14 ++++++++++++++ kraSettings.sample.yaml | 16 ++++++++++++++++ serverCommunication/serverCommunication.go | 9 ++++++--- 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 config.sample.yaml create mode 100644 kraSettings.sample.yaml diff --git a/config.sample.yaml b/config.sample.yaml new file mode 100644 index 0000000..3b69b2d --- /dev/null +++ b/config.sample.yaml @@ -0,0 +1,14 @@ +debug: true +kra_settings_config_path: /path/to/kraSettings.yaml # shared config settings between backend and minecraft servers +mongodb: + hostname: 127.0.0.1 + port: 27017 + database: database + username: user + password: password +servers: + minecraft: # socket server for minecraft server + host: 127.0.0.1:50001 + access_key: yourAccessKey # used to auth socket connections from minecraft servers + web: # socket server for voice and mobile web clients + host: 127.0.0.1:50000 \ No newline at end of file diff --git a/kraSettings.sample.yaml b/kraSettings.sample.yaml new file mode 100644 index 0000000..93f8b86 --- /dev/null +++ b/kraSettings.sample.yaml @@ -0,0 +1,16 @@ +web_socket: + access_key: yourAccessKey + protocol: ws + host: 127.0.0.1 + port: 50003 +web: + voice_address: "https://dev.voice.krakatoa-roleplay.umbach.dev/" +mongodb: + host: 127.0.0.1 + port: 27017 + database: database + username: user + password: password +voice_web_code: + letters: 0123456789 # 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + length: 12 \ No newline at end of file diff --git a/serverCommunication/serverCommunication.go b/serverCommunication/serverCommunication.go index 579284b..02e593f 100644 --- a/serverCommunication/serverCommunication.go +++ b/serverCommunication/serverCommunication.go @@ -2,6 +2,9 @@ package serverCommunication import ( "time" + + "krakatoa.net/backend/modules/cache" + "krakatoa.net/backend/modules/logger" ) /* @@ -23,16 +26,16 @@ func getClientByDest(dest int, uuid string) (*structs.WebClient, *structs.Minecr */ func AckHandler() { - ticker := time.NewTicker(20 * time.Millisecond) + ticker := time.NewTicker(5 * time.Second) // 20 * time.Millisecond for _ = range ticker.C { - /*for uuid, webClient := range cache.WebClients { + for uuid, webClient := range cache.WebClients { logger.Web.Println("ackHandler web client", uuid, webClient) } for serverName, mcClient := range cache.MinecraftClients { logger.Web.Println("ackHandler mc client", serverName, mcClient) - } */ + } } }