diff --git a/common/config.go b/common/config.go index f3648f0..3a2b99b 100644 --- a/common/config.go +++ b/common/config.go @@ -13,6 +13,7 @@ type Config struct { DatabaseName string `xml:"databaseName"` Address string `xml:"address"` AssetsPath string `xml:"assetsPath"` + ServerURL string `xml:"serverURL"` } func CheckError(err error) { diff --git a/config-example.xml b/config-example.xml index 243bada..30150ed 100644 --- a/config-example.xml +++ b/config-example.xml @@ -12,4 +12,5 @@ mc-assets + http://localhost:9011 \ No newline at end of file diff --git a/first/addition.go b/first/addition.go index 5e1a60c..28016ea 100644 --- a/first/addition.go +++ b/first/addition.go @@ -5,8 +5,11 @@ import ( _ "embed" "encoding/json" "fmt" - "github.com/WiiLink24/MiiContestChannel/common" + "io" "math" + "net/http" + + "github.com/WiiLink24/MiiContestChannel/common" ) type Root struct { @@ -123,7 +126,23 @@ func (l *Languages) GetLanguageFromJSON(language uint32) *Entry { } func MakeAddition() error { - marqueeText := []byte("WiiLink Mii Contest Channel!!!!") + var marqueeText []byte + var baseText = []byte("WiiLink Mii Contest Channel!!!!") + + resp, error := http.Get(common.GetConfig().ServerURL + "/assets/marquee/marquee.txt") + if error != nil { + marqueeText = baseText + } else { + defer resp.Body.Close() + + body, err := io.ReadAll(resp.Body) + if err != nil { + marqueeText = baseText + } else { + marqueeText = body + } + } + var actual [1536]byte copy(actual[:], marqueeText)