moved dest into kraProtocol
parent
4e9f367371
commit
6e11457c3d
|
@ -16,6 +16,15 @@ const (
|
||||||
StatusReply = 16
|
StatusReply = 16
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
DestBackend = 1
|
||||||
|
DestVoice = 2
|
||||||
|
DestMobile = 3
|
||||||
|
|
||||||
|
DestProxy = 10
|
||||||
|
DestPlayersCurrentServer = 11
|
||||||
|
)
|
||||||
|
|
||||||
func SendMessageToClient(status int, cmdID int, cmdNumber int, args interface{}) []byte {
|
func SendMessageToClient(status int, cmdID int, cmdNumber int, args interface{}) []byte {
|
||||||
argType := reflect.TypeOf(args).String()
|
argType := reflect.TypeOf(args).String()
|
||||||
var argLen int
|
var argLen int
|
||||||
|
|
|
@ -2,27 +2,19 @@ package serverCommunication
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/gofiber/websocket/v2"
|
"github.com/gofiber/websocket/v2"
|
||||||
|
"krakatoa.net/backend/modules/kraProtocol"
|
||||||
"krakatoa.net/backend/modules/logger"
|
"krakatoa.net/backend/modules/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
DestBackend = 1
|
|
||||||
DestVoice = 2
|
|
||||||
DestMobile = 3
|
|
||||||
|
|
||||||
DestProxy = 10
|
|
||||||
DestPlayersCurrentServer = 11
|
|
||||||
)
|
|
||||||
|
|
||||||
func getConnForDest(dest int, uuid string) *websocket.Conn {
|
func getConnForDest(dest int, uuid string) *websocket.Conn {
|
||||||
switch dest {
|
switch dest {
|
||||||
case DestVoice:
|
case kraProtocol.DestVoice:
|
||||||
return GetWebClientByUuid(uuid).VoiceConn
|
return GetWebClientByUuid(uuid).VoiceConn
|
||||||
case DestMobile:
|
case kraProtocol.DestMobile:
|
||||||
return GetWebClientByUuid(uuid).MobileConn
|
return GetWebClientByUuid(uuid).MobileConn
|
||||||
case DestProxy:
|
case kraProtocol.DestProxy:
|
||||||
return GetMinecraftClientByName("proxy-1").Connection
|
return GetMinecraftClientByName("proxy-1").Connection
|
||||||
case DestPlayersCurrentServer:
|
case kraProtocol.DestPlayersCurrentServer:
|
||||||
return GetMinecraftClientByName("lobby-1").Connection
|
return GetMinecraftClientByName("lobby-1").Connection
|
||||||
default:
|
default:
|
||||||
logger.Web.Println("conn for dest is nil")
|
logger.Web.Println("conn for dest is nil")
|
||||||
|
|
Loading…
Reference in New Issue