1
This commit is contained in:
parent
47db6c9c60
commit
05f5ccedec
33
sysutils.go
33
sysutils.go
@ -26,39 +26,6 @@ func IsDevEnv() bool {
|
|||||||
return serverEnv == DEV_ENV
|
return serverEnv == DEV_ENV
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
func ExtractRegisterTimeFromSessionId(sessionId string) int64 {
|
|
||||||
tmpStrings := strings.Split(sessionId, "_")
|
|
||||||
if len(tmpStrings) < 4 {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
return new(q5.XValue).SetString(tmpStrings[1]).GetInt64()
|
|
||||||
}
|
|
||||||
|
|
||||||
func ExtractGameIdFromAccountId(accountId string) int32 {
|
|
||||||
tmpStrings := strings.Split(accountId, "_")
|
|
||||||
if len(tmpStrings) < 2 {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
return new(q5.XValue).SetString(tmpStrings[1]).GetInt32()
|
|
||||||
}
|
|
||||||
|
|
||||||
func ExtractChannelFromAccountId(accountId string) int32 {
|
|
||||||
tmpStrings := strings.Split(accountId, "_")
|
|
||||||
if len(tmpStrings) < 2 {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
return new(q5.XValue).SetString(tmpStrings[0]).GetInt32()
|
|
||||||
}
|
|
||||||
|
|
||||||
func ExtractOpenIdFromAccountId(accountId string) string {
|
|
||||||
tmpStrings := strings.Split(accountId, "_")
|
|
||||||
if len(tmpStrings) < 3 {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
return strings.Join(tmpStrings[2:], "_")
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
func New[T any](cb func(*T)) *T {
|
func New[T any](cb func(*T)) *T {
|
||||||
obj := new(T)
|
obj := new(T)
|
||||||
cb(obj)
|
cb(obj)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user