diff --git a/tglog.go b/tglog.go index 6f393a6..cf2bb23 100644 --- a/tglog.go +++ b/tglog.go @@ -38,22 +38,25 @@ func (this *tgLog) SetPolyLog(isPolyLog bool) { func (this *tgLog) AddTrackLog( gameId int32, accountId string, - remoteAddr string, + distinctId string, + ip string, eventName string, prop map[string]string) { logObj := struct { AccountId string `json:"#account_id"` + DistinctId string `json:"#distinct_id"` Type string `json:"#type""` Time string `json:"#time"` - EventName string `json:"#event_name""` Ip string `json:"#ip""` + EventName string `json:"#event_name""` Properties map[string]string `json:"properties"` }{ AccountId: accountId, + DistinctId: distinctId, Type: "track", - Time: q5.FormatUnixDateTime(_app.GetNowSeconds(), _app.GetLocation()), + Time: q5.FormatUnixDateTime(_app.GetRealSeconds(), _app.GetLocation()), EventName: eventName, - Ip: remoteAddr, + Ip: ip, Properties: prop, } p := new(tgLogMsgNode) @@ -99,7 +102,7 @@ func (this *tgLog) goSaveToFile() { func (this *tgLog) getLogFile(gameId int32) *os.File { fileName := fmt.Sprintf(TGLOG_FILENAME, os.Getpid(), - q5.FormatUnixDateEx(_app.GetNowSeconds(), _app.GetLocation())) + q5.FormatUnixDateEx(_app.GetRealSeconds(), _app.GetLocation())) logDir := "" if this.isPolyLog { logDir = fmt.Sprintf(POLY_TGLOG_ROOT, _app.GetPkgName(), gameId)