mirror of
https://github.com/CPunch/gopenfusion.git
synced 2024-11-21 06:50:06 +00:00
login: minor refactoring
This commit is contained in:
parent
141858d6c3
commit
3a14d807d2
@ -280,11 +280,6 @@ func (server *LoginServer) ShardSelect(peer *cnet.Peer, pkt protocol.Packet) err
|
||||
return fmt.Errorf("loginServer has found no linked shards")
|
||||
}
|
||||
|
||||
key, err := protocol.GenSerialKey()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// TODO: better shard selection logic pls
|
||||
// for now, pick random shard
|
||||
shard := shards[rand.Intn(len(shards))]
|
||||
@ -302,6 +297,11 @@ func (server *LoginServer) ShardSelect(peer *cnet.Peer, pkt protocol.Packet) err
|
||||
return SendFail(peer)
|
||||
}
|
||||
|
||||
key, err := protocol.GenSerialKey()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// share the login attempt
|
||||
server.redisHndlr.QueueLogin(key, redis.LoginMetadata{
|
||||
FEKey: peer.FE_key,
|
||||
|
Loading…
Reference in New Issue
Block a user