diff --git a/aid/fiber.go b/aid/fiber.go index 81ee0ea..610bd8c 100644 --- a/aid/fiber.go +++ b/aid/fiber.go @@ -1,6 +1,7 @@ package aid import ( + "strings" "time" "github.com/gofiber/fiber/v2" @@ -12,6 +13,9 @@ import ( func FiberLogger() fiber.Handler { return logger.New(logger.Config{ Format: "(${method}) (${status}) (${latency}) ${path}\n", + Next: func(c *fiber.Ctx) bool { + return strings.Contains(c.Path(), "//") + }, }) } diff --git a/aid/syncer.go b/aid/syncer.go new file mode 100644 index 0000000..ffbe3f3 --- /dev/null +++ b/aid/syncer.go @@ -0,0 +1,32 @@ +package aid + +import ( + "sync" +) + +type GenericSyncMap[T any] struct { + m sync.Map +} + +func (s *GenericSyncMap[T]) Add(key string, value *T) { + s.m.Store(key, value) +} + +func (s *GenericSyncMap[T]) Get(key string) (*T, bool) { + v, ok := s.m.Load(key) + if !ok { + return nil, false + } + + return v.(*T), true +} + +func (s *GenericSyncMap[T]) Delete(key string) { + s.m.Delete(key) +} + +func (s *GenericSyncMap[T]) Range(f func(key string, value *T) bool) { + s.m.Range(func(key, value interface{}) bool { + return f(key.(string), value.(*T)) + }) +} \ No newline at end of file diff --git a/go.mod b/go.mod index d75a751..bed7af3 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,8 @@ go 1.21.3 require ( github.com/bwmarrin/discordgo v0.27.1 github.com/goccy/go-json v0.10.2 - github.com/gofiber/fiber/v2 v2.50.0 + github.com/gofiber/contrib/websocket v1.3.0 + github.com/gofiber/fiber/v2 v2.51.0 github.com/golang-jwt/jwt/v5 v5.2.0 github.com/google/uuid v1.4.0 github.com/lib/pq v1.10.9 @@ -18,26 +19,28 @@ require ( require ( github.com/andybalholm/brotli v1.0.6 // indirect + github.com/fasthttp/websocket v1.5.7 // indirect github.com/gorilla/websocket v1.4.2 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect github.com/jackc/pgx/v5 v5.4.3 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect - github.com/klauspost/compress v1.17.2 // indirect + github.com/klauspost/compress v1.17.3 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect github.com/philhofer/fwd v1.1.2 // indirect github.com/rivo/uniseg v0.4.4 // indirect - github.com/stretchr/testify v1.8.4 // indirect + github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee // indirect github.com/tinylib/msgp v1.1.8 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.50.0 // indirect + github.com/valyala/fasthttp v1.51.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect + golang.org/x/crypto v0.15.0 // indirect + golang.org/x/net v0.18.0 // indirect + golang.org/x/sys v0.14.0 // indirect + golang.org/x/text v0.14.0 // indirect ) diff --git a/go.sum b/go.sum index 4ea5257..9c410d2 100644 --- a/go.sum +++ b/go.sum @@ -5,10 +5,14 @@ github.com/bwmarrin/discordgo v0.27.1/go.mod h1:NJZpH+1AfhIcyQsPeuBKsUtYrRnjkyu0 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fasthttp/websocket v1.5.7 h1:0a6o2OfeATvtGgoMKleURhLT6JqWPg7fYfWnH4KHau4= +github.com/fasthttp/websocket v1.5.7/go.mod h1:bC4fxSono9czeXHQUVKxsC0sNjbm7lPJR04GDFqClfU= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/gofiber/fiber/v2 v2.50.0 h1:ia0JaB+uw3GpNSCR5nvC5dsaxXjRU5OEu36aytx+zGw= -github.com/gofiber/fiber/v2 v2.50.0/go.mod h1:21eytvay9Is7S6z+OgPi7c7n4++tnClWmhpimVHMimw= +github.com/gofiber/contrib/websocket v1.3.0 h1:XADFAGorer1VJ1bqC4UkCjqS37kwRTV0415+050NrMk= +github.com/gofiber/contrib/websocket v1.3.0/go.mod h1:xguaOzn2ZZ759LavtosEP+rcxIgBEE/rdumPINhR+Xo= +github.com/gofiber/fiber/v2 v2.51.0 h1:JNACcZy5e2tGApWB2QrRpenTWn0fq0hkFm6k0C86gKQ= +github.com/gofiber/fiber/v2 v2.51.0/go.mod h1:xaQRZQJGqnKOQnbQw+ltvku3/h8QxvNi8o6JiJ7Ll0U= github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= @@ -25,8 +29,8 @@ github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= -github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= +github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -47,6 +51,8 @@ github.com/r3labs/diff/v3 v3.0.1/go.mod h1:f1S9bourRbiM66NskseyUdo0fTmEE0qKrikYJ github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee h1:8Iv5m6xEo1NR1AvpV+7XmhI4r39LGNzwUL4YpMuL5vk= +github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee/go.mod h1:qwtSXrKuJh/zsFQ12yEE89xfCrGKK63Rr7ctU/uCo4g= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -57,8 +63,8 @@ github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0= github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.50.0 h1:H7fweIlBm0rXLs2q0XbalvJ6r0CUPFWK3/bB4N13e9M= -github.com/valyala/fasthttp v1.50.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= +github.com/valyala/fasthttp v1.51.0 h1:8b30A5JlZ6C7AS81RsWjYMQmrZG6feChmgAolCl1SqA= +github.com/valyala/fasthttp v1.51.0/go.mod h1:oI2XroL+lI7vdXyYoQk03bXBThfFl2cVdIA3Xl7cH8g= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= @@ -69,14 +75,16 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= +golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= +golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -88,8 +96,8 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= +golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= @@ -97,8 +105,8 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= diff --git a/handlers/auth.go b/handlers/auth.go index df4bf4d..52ae1e3 100644 --- a/handlers/auth.go +++ b/handlers/auth.go @@ -11,7 +11,7 @@ import ( var ( oauthTokenGrantTypes = map[string]func(c *fiber.Ctx, body *FortniteTokenBody) error{ - // "client_credentials": PostTokenClientCredentials, // spams the api?? like wtf + "client_credentials": PostTokenClientCredentials, // spams the api?? like wtf "password": PostTokenPassword, "exchange_code": PostTokenExchangeCode, } @@ -40,13 +40,10 @@ func PostFortniteToken(c *fiber.Ctx) error { } func PostTokenClientCredentials(c *fiber.Ctx, body *FortniteTokenBody) error { - client, sig := aid.KeyPair.EncryptAndSignB64([]byte(c.IP())) - hash := aid.Hash([]byte(client + "." + sig)) - return c.Status(fiber.StatusOK).JSON(aid.JSON{ - "access_token": "eg1~" + hash, + "access_token": "snow", "token_type": "bearer", - "client_id": c.IP(), + "client_id": aid.Hash([]byte(c.IP())), "client_service": "fortnite", "internal_client": true, "expires_in": 3600, diff --git a/handlers/socket.go b/handlers/socket.go new file mode 100644 index 0000000..7e86540 --- /dev/null +++ b/handlers/socket.go @@ -0,0 +1,64 @@ +package handlers + +import ( + "github.com/ectrc/snow/aid" + "github.com/ectrc/snow/person" + "github.com/gofiber/contrib/websocket" + "github.com/gofiber/fiber/v2" + "github.com/google/uuid" +) + +type Socket struct { + ID string + Connection *websocket.Conn + Person *person.Person +} + +var ( + sockets = aid.GenericSyncMap[Socket]{} +) + +func MiddlewareWebsocket(c *fiber.Ctx) error { + if !websocket.IsWebSocketUpgrade(c) { + return fiber.ErrUpgradeRequired + } + + c.Locals("protocol", c.Get("Sec-WebSocket-Protocol")) + c.Locals("uuid", uuid.New().String()) + return c.Next() +} + +func WebsocketConnection(c *websocket.Conn) { + protocol := c.Locals("protocol").(string) + uuid := c.Locals("uuid").(string) + + sockets.Add(uuid, &Socket{ + ID: uuid, + Connection: c, + }) + defer close(uuid) + + switch protocol { + case "xmpp": + aid.Print("(xmpp) new connection: ", uuid) + default: + aid.Print("(unknown) new connection: ", uuid) + } + + for { + _, _, err := c.ReadMessage() + if err != nil { + break + } + } +} + +func close(id string) { + socket, ok := sockets.Get(id) + if !ok { + return + } + socket.Connection.Close() + sockets.Delete(id) + aid.Print("(xmpp) connection closed", id) +} \ No newline at end of file diff --git a/handlers/storage.go b/handlers/storage.go index a52d4d9..7c6d6e1 100644 --- a/handlers/storage.go +++ b/handlers/storage.go @@ -14,7 +14,7 @@ func GetCloudStorageFiles(c *fiber.Ctx) error { sum := sha1.Sum(storage.GetDefaultEngine()) more := sha256.Sum256(storage.GetDefaultEngine()) - return c.Status(fiber.StatusOK).JSON([]aid.JSON{ + return c.Status(fiber.StatusOK).JSON([]fiber.Map{ { "uniqueFilename": "DefaultEngine.ini", "filename": "DefaultEngine.ini", @@ -22,22 +22,25 @@ func GetCloudStorageFiles(c *fiber.Ctx) error { "hash256": hex.EncodeToString(more[:]), "length": len(storage.GetDefaultEngine()), "contentType": "application/octet-stream", - "uploaded": "0000-00-00T00:00:00.000Z", + "uploaded": aid.TimeStartOfDay(), "storageType": "S3", + "storageIds": fiber.Map{ + "primary": "primary", + }, "doNotCache": false, }, }) } func GetCloudStorageConfig(c *fiber.Ctx) error { - return c.Status(fiber.StatusOK).JSON(aid.JSON{ + return c.Status(fiber.StatusOK).JSON(fiber.Map{ "enumerateFilesPath": "/api/cloudstorage/system", "enableMigration": true, "enableWrites": true, "epicAppName": "Live", "isAuthenticated": true, "disableV2": true, - "lastUpdated": "0000-00-00T00:00:00.000Z", + "lastUpdated": aid.TimeStartOfDay(), "transports": []string{}, }) } @@ -45,7 +48,10 @@ func GetCloudStorageConfig(c *fiber.Ctx) error { func GetCloudStorageFile(c *fiber.Ctx) error { switch c.Params("fileName") { case "DefaultEngine.ini": - return c.Status(fiber.StatusOK).Send(storage.GetDefaultEngine()) + c.Set("Content-Type", "application/octet-stream") + c.Status(fiber.StatusOK) + c.Send(storage.GetDefaultEngine()) + return nil } return c.Status(400).JSON(aid.ErrorBadRequest) diff --git a/main.go b/main.go index 3e147b2..96712c5 100644 --- a/main.go +++ b/main.go @@ -12,6 +12,7 @@ import ( "github.com/ectrc/snow/storage" "github.com/goccy/go-json" + "github.com/gofiber/contrib/websocket" "github.com/gofiber/fiber/v2" ) @@ -66,6 +67,9 @@ func main() { r.Put("/profile/play_region", handlers.AnyNoContent) r.Get("/api/v1/search/:accountId", handlers.GetPersonSearch) r.Post("/api/v1/assets/Fortnite/:versionId/:assetName", handlers.PostAssets) + + r.Get("//", func(c *fiber.Ctx) error { return c.Redirect("/socket") }) + r.Get("/socket", handlers.MiddlewareWebsocket, websocket.New(handlers.WebsocketConnection)) account := r.Group("/account/api") account.Get("/public/account", handlers.GetPublicAccounts) diff --git a/storage/hotfix.go b/storage/hotfix.go index 7628a10..60b9186 100644 --- a/storage/hotfix.go +++ b/storage/hotfix.go @@ -1,25 +1,37 @@ package storage -import "github.com/ectrc/snow/aid" +import ( + "github.com/ectrc/snow/aid" +) func GetDefaultEngine() []byte { return []byte(` +[OnlineSubsystemMcp.Xmpp] +bUseSSL=false +Protocol=ws +ServerAddr="ws://`+ aid.Config.API.Host + aid.Config.API.Port +`" + +[OnlineSubsystemMcp.Xmpp Prod] +bUseSSL=false +Protocol=ws +ServerAddr="ws://`+ aid.Config.API.Host + aid.Config.API.Port +`" + [OnlineSubsystemMcp] bUsePartySystemV2=false [OnlineSubsystemMcp.OnlinePartySystemMcpAdapter] bUsePartySystemV2=false - + [XMPP] bEnableWebsockets=true -[OnlineSubsystemMcp.Xmpp] -bUseSSL=false -ServerAddr="ws://` + aid.Config.API.Host + `/socket/presence" -ServerPort=` + aid.Config.API.Port + ` +[ConsoleVariables] +n.VerifyPeer=0 +FortMatchmakingV2.ContentBeaconFailureCancelsMatchmaking=0 +Fort.ShutdownWhenContentBeaconFails=0 +FortMatchmakingV2.EnableContentBeacon=0 -[OnlineSubsystemMcp.Xmpp Prod] -bUseSSL=false -ServerAddr="ws://` + aid.Config.API.Host + `/socket/presence" -ServerPort=` + aid.Config.API.Port + ``) +[/Script/Qos.QosRegionManager] +NumTestsPerRegion=5 +PingTimeout=3.0`) } \ No newline at end of file