Skip to content

Commit

Permalink
send online-patch when enter a lobby
Browse files Browse the repository at this point in the history
  • Loading branch information
inada-s committed Jul 3, 2021
1 parent bd5b123 commit 21b5f8f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions gdxsv/lbs_lobby.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,20 @@ func (l *LbsLobby) printLobbyReminder(p *LbsPeer) {

func (l *LbsLobby) Enter(p *LbsPeer) {
l.Users[p.UserID] = &p.DBUser

// Send game patch for offline testing
if l.LobbySetting.PatchNames != "" {
patchList := l.makePatchList()
logger.Info("patchList", zap.Any("patchList", patchList))
patchBin, err := pb.Marshal(patchList)
if err != nil {
logger.Error("pb.Marshal patch", zap.Error(err))
return
}
patchMsg := NewServerNotice(lbsGamePatch)
patchMsg.Writer().Write(patchBin)
p.SendMessage(patchMsg)
}
}

func (l *LbsLobby) Exit(userID string) {
Expand Down

0 comments on commit 21b5f8f

Please sign in to comment.