修复CPU占用问题,添加servers.JOIN,LEAVE,LIST包

This commit is contained in:
2025-07-11 02:27:16 +08:00
parent e5e02d2430
commit f5290d8585
13 changed files with 303 additions and 113 deletions

View File

@ -2,12 +2,19 @@ package router
import (
"coreapp/router/minecraft"
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
)
func Route(server *gin.Engine) {
server.Use(cors.New(cors.Config{
AllowAllOrigins: true,
AllowCredentials: true,
AllowMethods: []string{"*"},
ExposeHeaders: []string{"*"},
AllowHeaders: []string{"*"},
}))
rootGroup := server.Group("/")
minecraftGroup := rootGroup.Group("/minecraft")
{
servers := minecraftGroup.Group("/servers")