From 21b5f8f33bcab1ac32fd89ef48e7fb70b7661f4c Mon Sep 17 00:00:00 2001 From: Shingo INADA Date: Sat, 3 Jul 2021 21:11:37 +0900 Subject: [PATCH] send online-patch when enter a lobby --- gdxsv/lbs_lobby.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gdxsv/lbs_lobby.go b/gdxsv/lbs_lobby.go index 1348cfa..86088c5 100644 --- a/gdxsv/lbs_lobby.go +++ b/gdxsv/lbs_lobby.go @@ -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) {