mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 14:22:26 +08:00
协议加密密钥生成算法
This commit is contained in:
@@ -2,6 +2,7 @@ package app
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/nats-io/nats.go"
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
"os/signal"
|
||||
@@ -25,6 +26,20 @@ func Run(ctx context.Context, configFile string) error {
|
||||
|
||||
_ = controller.NewController(db)
|
||||
|
||||
// TODO 临时写一下用来传递新的密钥后面改RPC
|
||||
conn, err := nats.Connect(config.CONF.MQ.NatsUrl)
|
||||
if err != nil {
|
||||
logger.LOG.Error("connect nats error: %v", err)
|
||||
return nil
|
||||
}
|
||||
natsMsg := nats.NewMsg("GATE_KEY_HK4E")
|
||||
natsMsg.Data = []byte{0x00, 0xff}
|
||||
err = conn.PublishMsg(natsMsg)
|
||||
if err != nil {
|
||||
logger.LOG.Error("nats publish msg error: %v", err)
|
||||
return nil
|
||||
}
|
||||
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT)
|
||||
for {
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"hk4e/pkg/logger"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func (c *Controller) headDataVersions(context *gin.Context) {
|
||||
context.Header("Content-Type", "application/octet-stream")
|
||||
context.Header("Content-Length", "514")
|
||||
context.Status(http.StatusOK)
|
||||
}
|
||||
|
||||
func (c *Controller) getDataVersions(context *gin.Context) {
|
||||
dataVersions, err := os.ReadFile("static/data_versions")
|
||||
if err != nil {
|
||||
logger.LOG.Error("open data_versions error")
|
||||
return
|
||||
}
|
||||
context.Data(http.StatusOK, "application/octet-stream", dataVersions)
|
||||
}
|
||||
|
||||
func (c *Controller) headBlk(context *gin.Context) {
|
||||
context.Header("Content-Type", "application/octet-stream")
|
||||
context.Header("Content-Length", "14103")
|
||||
context.Status(http.StatusOK)
|
||||
}
|
||||
|
||||
func (c *Controller) getBlk(context *gin.Context) {
|
||||
blk, err := os.ReadFile("static/29342328.blk")
|
||||
if err != nil {
|
||||
logger.LOG.Error("open 29342328.blk error")
|
||||
return
|
||||
}
|
||||
context.Data(http.StatusOK, "application/octet-stream", blk)
|
||||
}
|
||||
@@ -96,14 +96,6 @@ func (c *Controller) registerRouter() {
|
||||
// 获取combo token
|
||||
engine.POST("/hk4e_global/combo/granter/login/v2/login", c.v2Login)
|
||||
}
|
||||
{
|
||||
// BLK文件补丁下载
|
||||
// autopatchhk.yuanshen.com
|
||||
engine.HEAD("/client_design_data/2.6_live/output_6988297_84eeb1c18b/client_silence/General/AssetBundles/data_versions", c.headDataVersions)
|
||||
engine.GET("/client_design_data/2.6_live/output_6988297_84eeb1c18b/client_silence/General/AssetBundles/data_versions", c.getDataVersions)
|
||||
engine.HEAD("/client_design_data/2.6_live/output_6988297_84eeb1c18b/client_silence/General/AssetBundles/blocks/00/29342328.blk", c.headBlk)
|
||||
engine.GET("/client_design_data/2.6_live/output_6988297_84eeb1c18b/client_silence/General/AssetBundles/blocks/00/29342328.blk", c.getBlk)
|
||||
}
|
||||
{
|
||||
// 日志
|
||||
engine.POST("/sdk/dataUpload", c.sdkDataUpload)
|
||||
|
||||
Reference in New Issue
Block a user