1
This commit is contained in:
parent
b854b9fd80
commit
3f61a38840
@ -3,6 +3,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
|
"fmt"
|
||||||
"q5"
|
"q5"
|
||||||
"f5"
|
"f5"
|
||||||
)
|
)
|
||||||
@ -148,7 +149,8 @@ func (this *Game2005) internalSendMail(to string,
|
|||||||
subject string,
|
subject string,
|
||||||
sendTime int32,
|
sendTime int32,
|
||||||
expireTime int32,
|
expireTime int32,
|
||||||
attachments string) bool {
|
attachments string,
|
||||||
|
uniqueKey string) bool {
|
||||||
gameMailApiUrl := "https://gamemail.kingsome.cn/webapp/index.php"
|
gameMailApiUrl := "https://gamemail.kingsome.cn/webapp/index.php"
|
||||||
if !f5.IsOnlineEnv() {
|
if !f5.IsOnlineEnv() {
|
||||||
gameMailApiUrl = "https://gamemail-test.kingsome.cn/webapp/index.php"
|
gameMailApiUrl = "https://gamemail-test.kingsome.cn/webapp/index.php"
|
||||||
@ -166,6 +168,7 @@ func (this *Game2005) internalSendMail(to string,
|
|||||||
params.SetXValue("sendtime", q5.NewXInt32(sendTime))
|
params.SetXValue("sendtime", q5.NewXInt32(sendTime))
|
||||||
params.SetXValue("expiretime", q5.NewXInt32(expireTime))
|
params.SetXValue("expiretime", q5.NewXInt32(expireTime))
|
||||||
params.SetXValue("attachments", q5.NewXString(attachments))
|
params.SetXValue("attachments", q5.NewXString(attachments))
|
||||||
|
params.SetXValue("unique_key", q5.NewXString(uniqueKey))
|
||||||
respObj, respStr, err := q5.HttpGetAsJson(gameMailApiUrl, params.AsXObject())
|
respObj, respStr, err := q5.HttpGetAsJson(gameMailApiUrl, params.AsXObject())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
f5.SysLog().Warning("url:%s resp:%s", gameMailApiUrl, respStr)
|
f5.SysLog().Warning("url:%s resp:%s", gameMailApiUrl, respStr)
|
||||||
@ -182,6 +185,7 @@ func (this *Game2005) internalSendMail(to string,
|
|||||||
func (this *Game2005) SendVipLvUpMail(accountId string, oldLv int32, newLv int32, upTime int32) bool {
|
func (this *Game2005) SendVipLvUpMail(accountId string, oldLv int32, newLv int32, upTime int32) bool {
|
||||||
mailMeta := this.vipLvUpMailMeta
|
mailMeta := this.vipLvUpMailMeta
|
||||||
for vipLv := oldLv + 1; vipLv <= newLv; vipLv++ {
|
for vipLv := oldLv + 1; vipLv <= newLv; vipLv++ {
|
||||||
|
uniqueKey := fmt.Sprintf("vipLvUp_%d_%s", vipLv, accountId)
|
||||||
ok := this.internalSendMail(
|
ok := this.internalSendMail(
|
||||||
accountId,
|
accountId,
|
||||||
-2,
|
-2,
|
||||||
@ -189,7 +193,8 @@ func (this *Game2005) SendVipLvUpMail(accountId string, oldLv int32, newLv int32
|
|||||||
mailMeta.GetSubject(),
|
mailMeta.GetSubject(),
|
||||||
upTime,
|
upTime,
|
||||||
upTime + 3600 * 24 * 30,
|
upTime + 3600 * 24 * 30,
|
||||||
mailMeta.GetAttachmentsByLv(vipLv))
|
mailMeta.GetAttachmentsByLv(vipLv),
|
||||||
|
uniqueKey)
|
||||||
if !ok {
|
if !ok {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -199,6 +204,7 @@ func (this *Game2005) SendVipLvUpMail(accountId string, oldLv int32, newLv int32
|
|||||||
|
|
||||||
func (this *Game2005) SendPriviDailyMail(accountId string, priviLv int32, sendTime int32) bool {
|
func (this *Game2005) SendPriviDailyMail(accountId string, priviLv int32, sendTime int32) bool {
|
||||||
mailMeta := this.priviDailyMailMeta
|
mailMeta := this.priviDailyMailMeta
|
||||||
|
uniqueKey := fmt.Sprintf("priviDaily_%s_%s", q5.FormatUnixDateEx(int64(sendTime)), accountId)
|
||||||
ok := this.internalSendMail(
|
ok := this.internalSendMail(
|
||||||
accountId,
|
accountId,
|
||||||
-3,
|
-3,
|
||||||
@ -206,12 +212,14 @@ func (this *Game2005) SendPriviDailyMail(accountId string, priviLv int32, sendTi
|
|||||||
mailMeta.GetSubject(),
|
mailMeta.GetSubject(),
|
||||||
sendTime,
|
sendTime,
|
||||||
sendTime + 3600 * 24 * 30,
|
sendTime + 3600 * 24 * 30,
|
||||||
mailMeta.GetAttachmentsByLv(priviLv))
|
mailMeta.GetAttachmentsByLv(priviLv),
|
||||||
|
uniqueKey)
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Game2005) SendVipWeeklyMail(accountId string, vipLv int32, sendTime int32) bool {
|
func (this *Game2005) SendVipWeeklyMail(accountId string, vipLv int32, sendTime int32) bool {
|
||||||
mailMeta := this.vipWeeklyMailMeta
|
mailMeta := this.vipWeeklyMailMeta
|
||||||
|
uniqueKey := fmt.Sprintf("vipWeekly_%s_%s", q5.FormatUnixDateEx(int64(sendTime)), accountId)
|
||||||
ok := this.internalSendMail(
|
ok := this.internalSendMail(
|
||||||
accountId,
|
accountId,
|
||||||
-4,
|
-4,
|
||||||
@ -219,7 +227,8 @@ func (this *Game2005) SendVipWeeklyMail(accountId string, vipLv int32, sendTime
|
|||||||
mailMeta.GetSubject(),
|
mailMeta.GetSubject(),
|
||||||
sendTime,
|
sendTime,
|
||||||
sendTime + 3600 * 24 * 30,
|
sendTime + 3600 * 24 * 30,
|
||||||
mailMeta.GetAttachmentsByLv(vipLv))
|
mailMeta.GetAttachmentsByLv(vipLv),
|
||||||
|
uniqueKey)
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
third_party/q5
vendored
2
third_party/q5
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 70271a1b60abea42e643a8b54ca73a4d1e4a044b
|
Subproject commit a7c34b44d7244328b94beae4a3379ee4cdcc4def
|
Loading…
x
Reference in New Issue
Block a user