This commit is contained in:
aozhiwei 2024-05-24 08:24:54 +08:00
parent 4d79482d50
commit 1c089f1375
3 changed files with 39 additions and 2 deletions

View File

@ -11,7 +11,7 @@ type app struct {
}
func (this *app) GetPkgName() string {
return "mailserver"
return "gamelog"
}
func (this *app) GetHttpListenPort() int32 {

View File

@ -1,6 +1,8 @@
package controller
import (
"q5"
"f5"
"github.com/gin-gonic/gin"
)
@ -9,5 +11,40 @@ type GameLog struct {
}
func (this *GameLog) caCustomReport(c *gin.Context) {
accountId := c.DefaultQuery("account_id", "")
sessionId := c.DefaultQuery("session_id", "")
distinctId := c.DefaultQuery("localuuid", "")
channel := c.DefaultQuery("channel", "")
eventName := c.DefaultQuery("event_name", "")
_os := c.DefaultQuery("_os", "")
_net := c.DefaultQuery("_net", "")
gameId := c.DefaultQuery("gameid", "")
_serverTime := f5.GetApp().GetRealSeconds()
ip := ""
data := map[string]interface{}{}
if accountId != "" {
data["account_id"] = accountId
registerTime := f5.ExtractRegisterTimeFromSessionId(sessionId)
registerDate := q5.FormatUnixDateTime(f5.GetApp().GetRealSeconds(), f5.GetApp().GetLocation())
data["account_register_utctime"] = registerTime
data["account_register_date"] = registerDate
}
if distinctId != "" {
data["localuuid"] = distinctId
}
data["channel"] = channel
data["event_name"] = eventName
data["_os"] = _os
data["_net"] = _net
data["gameid"] = gameId
data["_server_time"] = _serverTime
f5.GetTgLog().AddCustomLog(
2006,
accountId,
distinctId,
ip,
data)
}

2
third_party/f5 vendored

@ -1 +1 @@
Subproject commit 14ec9834496a58b833feb0f91f71b655de6314ad
Subproject commit 0ff501959028f0495977b9a5a59031d0c2ec4320