From f3581e0a252850a5c9afd0ebb3d2e93f4413c25c Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 26 Apr 2024 13:37:56 +0800 Subject: [PATCH] 1 --- server/adminserver/app/app.go | 4 ++++ server/gameservice/app/app.go | 6 +++++- server/hallserver/app/app.go | 4 ++++ server/hallserver/room/roommgr.go | 2 +- server/mailserver/app/app.go | 4 ++++ server/matchserver/app/app.go | 4 ++++ 6 files changed, 22 insertions(+), 2 deletions(-) diff --git a/server/adminserver/app/app.go b/server/adminserver/app/app.go index 5db02d3b..0211ef1e 100644 --- a/server/adminserver/app/app.go +++ b/server/adminserver/app/app.go @@ -130,3 +130,7 @@ func (this *app) RemoveSession(accountId string) { delete(this.sessionHash, accountId) } } + +func (this *app) HasTask() bool { + return false; +} diff --git a/server/gameservice/app/app.go b/server/gameservice/app/app.go index 7b4fd037..adcffc08 100644 --- a/server/gameservice/app/app.go +++ b/server/gameservice/app/app.go @@ -91,7 +91,7 @@ func (this *app) registerDataSources() { func (this *app) AddSession(accountId string) string { this.sessionLock.Lock() defer this.sessionLock.Unlock() - uuid := f5.GetApp().NewUuid() + uuid := f5.GetApp().NewNodeUuid() str := fmt.Sprintf("%s%d%s%d", accountId, uuid, randStringBytes(12), time.Now().Unix()) md5New := md5.New() strByte := []byte(str) @@ -129,3 +129,7 @@ func (this *app) RemoveSession(accountId string) { delete(this.sessionHash, accountId) } } + +func (this *app) HasTask() bool { + return false +} diff --git a/server/hallserver/app/app.go b/server/hallserver/app/app.go index 59a16ddd..1fcf0f20 100644 --- a/server/hallserver/app/app.go +++ b/server/hallserver/app/app.go @@ -86,3 +86,7 @@ func (this *app) registerDataSources() { func (this *app) GetHttpListenPort() int32 { return mt.Table.HallCluster.GetHttpListenPort() } + +func (this *app) HasTask() bool { + return !this.netMsgQueue.IsEmpty() +} diff --git a/server/hallserver/room/roommgr.go b/server/hallserver/room/roommgr.go index e5f4fa7c..79a06492 100644 --- a/server/hallserver/room/roommgr.go +++ b/server/hallserver/room/roommgr.go @@ -41,7 +41,7 @@ func (this *roomMgr) genRoomId() int32 { } func (this *roomMgr) genRoomIdx() int64 { - return f5.GetApp().NewUuid() + return f5.GetApp().NewNodeUuid() } func (this *roomMgr) ProcessCMMsg(handler *cs.CsNetMsgHandler, hdr *f5.MsgHdr) { diff --git a/server/mailserver/app/app.go b/server/mailserver/app/app.go index af03e1ae..7761a2ae 100644 --- a/server/mailserver/app/app.go +++ b/server/mailserver/app/app.go @@ -55,3 +55,7 @@ func (this *app) registerDataSources() { mt.Table.MailDb.GetById(0).GetDatabase(), 30) } + +func (this *app) HasTask() bool { + return false +} diff --git a/server/matchserver/app/app.go b/server/matchserver/app/app.go index 5c84b0f7..6e54d254 100644 --- a/server/matchserver/app/app.go +++ b/server/matchserver/app/app.go @@ -86,3 +86,7 @@ func (this *app) registerDataSources() { func (this *app) GetHttpListenPort() int32 { return mt.Table.MatchCluster.GetHttpListenPort() } + +func (this *app) HasTask() bool { + return !this.netMsgQueue.IsEmpty() +}