mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-11 05:12:29 +08:00
优化服务器之间的底层连接方式
This commit is contained in:
@@ -18,6 +18,8 @@ func (m *MessageQueue) getTopic(serverType string, appId string) string {
|
||||
func (m *MessageQueue) SendToGate(appId string, netMsg *NetMsg) {
|
||||
netMsg.Topic = m.getTopic(api.GATE, appId)
|
||||
originServerType, originServerAppId := m.getOriginServer()
|
||||
netMsg.ServerType = api.GATE
|
||||
netMsg.AppId = appId
|
||||
netMsg.OriginServerType = originServerType
|
||||
netMsg.OriginServerAppId = originServerAppId
|
||||
m.netMsgInput <- netMsg
|
||||
@@ -26,6 +28,8 @@ func (m *MessageQueue) SendToGate(appId string, netMsg *NetMsg) {
|
||||
func (m *MessageQueue) SendToGs(appId string, netMsg *NetMsg) {
|
||||
netMsg.Topic = m.getTopic(api.GS, appId)
|
||||
originServerType, originServerAppId := m.getOriginServer()
|
||||
netMsg.ServerType = api.GS
|
||||
netMsg.AppId = appId
|
||||
netMsg.OriginServerType = originServerType
|
||||
netMsg.OriginServerAppId = originServerAppId
|
||||
m.netMsgInput <- netMsg
|
||||
@@ -34,6 +38,8 @@ func (m *MessageQueue) SendToGs(appId string, netMsg *NetMsg) {
|
||||
func (m *MessageQueue) SendToFight(appId string, netMsg *NetMsg) {
|
||||
netMsg.Topic = m.getTopic(api.FIGHT, appId)
|
||||
originServerType, originServerAppId := m.getOriginServer()
|
||||
netMsg.ServerType = api.FIGHT
|
||||
netMsg.AppId = appId
|
||||
netMsg.OriginServerType = originServerType
|
||||
netMsg.OriginServerAppId = originServerAppId
|
||||
m.netMsgInput <- netMsg
|
||||
@@ -42,6 +48,8 @@ func (m *MessageQueue) SendToFight(appId string, netMsg *NetMsg) {
|
||||
func (m *MessageQueue) SendToPathfinding(appId string, netMsg *NetMsg) {
|
||||
netMsg.Topic = m.getTopic(api.PATHFINDING, appId)
|
||||
originServerType, originServerAppId := m.getOriginServer()
|
||||
netMsg.ServerType = api.PATHFINDING
|
||||
netMsg.AppId = appId
|
||||
netMsg.OriginServerType = originServerType
|
||||
netMsg.OriginServerAppId = originServerAppId
|
||||
m.netMsgInput <- netMsg
|
||||
|
||||
Reference in New Issue
Block a user