Commit 17c74a17c8ac557ce9884639018e01939b420d74
1 parent
77da2da8
fix: update time
Showing
4 changed files
with
7 additions
and
3 deletions
Show diff stats
cmd/gameserver/service/agent.go
| @@ -109,7 +109,7 @@ func (c *Agent) SendMsg(errCode int32, cmd uint32, msg interface{}, preserve uin | @@ -109,7 +109,7 @@ func (c *Agent) SendMsg(errCode int32, cmd uint32, msg interface{}, preserve uin | ||
| 109 | 109 | ||
| 110 | func (c *Agent) OnMessage(msg components.IMessage) error { | 110 | func (c *Agent) OnMessage(msg components.IMessage) error { |
| 111 | atomic.StoreInt64(&c.lastHeartCheckTime, common.Timex()) | 111 | atomic.StoreInt64(&c.lastHeartCheckTime, common.Timex()) |
| 112 | - logger.Debug("req protocolID: %d, %s", msg.GetHeader().GetMsgID(), msg.GetData()) | 112 | + logger.Debug("req protocolID: %d", msg.GetHeader().GetMsgID()) |
| 113 | //heart | 113 | //heart |
| 114 | if msg.GetHeader().GetMsgID() == uint32(pb.ProtoCode_HeartRpc) { | 114 | if msg.GetHeader().GetMsgID() == uint32(pb.ProtoCode_HeartRpc) { |
| 115 | return nil | 115 | return nil |
cmd/gameserver/service/game.go
| @@ -76,7 +76,7 @@ func (s *GameServer) Timeout() { | @@ -76,7 +76,7 @@ func (s *GameServer) Timeout() { | ||
| 76 | 76 | ||
| 77 | func (s *GameServer) Start() error { | 77 | func (s *GameServer) Start() error { |
| 78 | //设置随机种子 | 78 | //设置随机种子 |
| 79 | - rand.Seed(time.Now().Unix()) | 79 | + rand.Seed(common.Timex()) |
| 80 | 80 | ||
| 81 | //启动定时器 | 81 | //启动定时器 |
| 82 | s.Timeout() | 82 | s.Timeout() |
cmd/httpserver/service/http.go
| @@ -46,7 +46,7 @@ func (s *AccountServer) Start() error { | @@ -46,7 +46,7 @@ func (s *AccountServer) Start() error { | ||
| 46 | return err | 46 | return err |
| 47 | } | 47 | } |
| 48 | //设置随机种子 | 48 | //设置随机种子 |
| 49 | - rand.Seed(time.Now().Unix()) | 49 | + rand.Seed(common.Timex()) |
| 50 | //开始定时器 | 50 | //开始定时器 |
| 51 | s.TimeOut() | 51 | s.TimeOut() |
| 52 | 52 |