added chat messages
This commit is contained in:
@@ -16,6 +16,8 @@ import (
|
||||
"google.golang.org/protobuf/proto"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
@@ -350,6 +352,7 @@ func (d *DemoMatchLoader) gcWorker(apiKey string, rl ratelimit.Limiter) {
|
||||
log.Infof("[DL] Match %d is loaded, but not parsed. Try parsing.", iMatch.ID)
|
||||
demo.MatchId = matchId
|
||||
demo.Url = iMatch.ReplayURL
|
||||
demo.DecryptionKey = iMatch.DecryptionKey
|
||||
err := d.dp.ParseDemo(demo)
|
||||
if err != nil {
|
||||
log.Warningf("[DL] Parsing demo from match %d failed: %v", demo.MatchId, err)
|
||||
@@ -396,6 +399,7 @@ func (d *DemoMatchLoader) gcWorker(apiKey string, rl ratelimit.Limiter) {
|
||||
|
||||
demo.Url = lastRound.GetMap()
|
||||
demo.MatchId = matchZero.GetMatchid()
|
||||
demo.DecryptionKey = []byte(strings.ToUpper(strconv.FormatUint(matchZero.GetWatchablematchinfo().GetClDecryptdataKeyPub(), 16)))
|
||||
|
||||
tMatch, err := d.db.Match.Create().
|
||||
SetID(matchZero.GetMatchid()).
|
||||
@@ -408,6 +412,7 @@ func (d *DemoMatchLoader) gcWorker(apiKey string, rl ratelimit.Limiter) {
|
||||
SetScoreTeamA(int(lastRound.GetTeamScores()[0])).
|
||||
SetScoreTeamB(int(lastRound.GetTeamScores()[1])).
|
||||
SetMatchResult(int(lastRound.GetMatchResult())).
|
||||
SetDecryptionKey(demo.DecryptionKey).
|
||||
Save(context.Background())
|
||||
if err != nil {
|
||||
log.Warningf("[DL] Unable to create match %d: %v", matchZero.GetMatchid(), err)
|
||||
|
Reference in New Issue
Block a user