多语言增加西班牙语
This commit is contained in:
parent
fb4367080d
commit
69cbb39221
@ -27,6 +27,8 @@ func GetLanguage(lang msg.LANG_TYPE, key string) string {
|
||||
return gamedata.GetStringValue(data, "pt_BR")
|
||||
case msg.LANG_TYPE_LANG_CN:
|
||||
return gamedata.GetStringValue(data, "zh_CN")
|
||||
case msg.LANG_TYPE_LANG_ES_LATAM:
|
||||
return gamedata.GetStringValue(data, "es_LATAM")
|
||||
default:
|
||||
return key
|
||||
}
|
||||
|
||||
@ -485,25 +485,6 @@ func ReqGmCommand_(player *Player, Command string) error {
|
||||
EndTime: EndTime,
|
||||
Num: int32(Times),
|
||||
})
|
||||
case "sendMail":
|
||||
MailMod := player.PlayMod.getMailMod()
|
||||
title := `MMM圣诞节奖励`
|
||||
content := `测试`
|
||||
MailMod.Send(title, "副标题", content, title, "副标题", content, []*item.Item{
|
||||
{
|
||||
Id: item.ITEM_DIAMOND_ID,
|
||||
Num: 10,
|
||||
},
|
||||
{
|
||||
Id: item.ITEM_ENERGY_ID,
|
||||
Num: 10,
|
||||
},
|
||||
{
|
||||
Id: item.ITEM_STAR_ID,
|
||||
Num: 10,
|
||||
},
|
||||
}, 2)
|
||||
player.PushClientRes(MailMod.BackData())
|
||||
case "resetNpc":
|
||||
FriendMod := player.PlayMod.getFriendMod()
|
||||
FriendMod.Npc = []int{}
|
||||
|
||||
@ -380,9 +380,16 @@ func (p *Player) handle(m *msg.Msg) error {
|
||||
MailMod := p.PlayMod.getMailMod()
|
||||
mt, mc, mt_en, mc_en := mailCfg.GetChargeSendMail(PlayerSimpleData.Name)
|
||||
Items := p.ChargeItem(C.ChargeId)
|
||||
MailId := MailMod.Send(mt, "", mc, mt_en, "", mc_en, Items, mail.MAIL_TYPE_GIFT)
|
||||
p.AddLog(m.From, friend.LOG_TYPE_CHARGE_SEND, fmt.Sprintf("%d", MailId), m.SendT)
|
||||
p.PushClientRes(MailMod.NotifyMail(MailId))
|
||||
mailId := MailMod.SendMail(&mail.MailStruct{
|
||||
Title: mt,
|
||||
Content: mc,
|
||||
TitleEn: mt_en,
|
||||
ContentEn: mc_en,
|
||||
Items: Items,
|
||||
Type: mail.MAIL_TYPE_GIFT,
|
||||
})
|
||||
p.AddLog(m.From, friend.LOG_TYPE_CHARGE_SEND, fmt.Sprintf("%d", mailId), m.SendT)
|
||||
p.PushClientRes(MailMod.NotifyMail(mailId))
|
||||
case msg.HANDLE_TYPE_CHARGE_RECEIVE: // 收到好友的感谢信
|
||||
Content, ok := m.Extra.(string)
|
||||
if !ok {
|
||||
@ -391,9 +398,15 @@ func (p *Player) handle(m *msg.Msg) error {
|
||||
PlayerSimpleData := G_GameLogicPtr.GetResSimplePlayerByUid(m.From)
|
||||
MailMod := p.PlayMod.getMailMod()
|
||||
mt, mc, mt_en, mc_en := mailCfg.GetChargeReceiveMail(PlayerSimpleData.Name, Content)
|
||||
MailId := MailMod.Send(mt, "", mc, mt_en, "", mc_en, nil, mail.MAIL_TYPE_NORMAL)
|
||||
p.AddLog(m.From, friend.LOG_TYPE_CHARGE_RECEIVE, fmt.Sprintf("%d", MailId), m.SendT)
|
||||
p.PushClientRes(MailMod.NotifyMail(MailId))
|
||||
mailId := MailMod.SendMail(&mail.MailStruct{
|
||||
Title: mt,
|
||||
Content: mc,
|
||||
TitleEn: mt_en,
|
||||
ContentEn: mc_en,
|
||||
Type: mail.MAIL_TYPE_NORMAL,
|
||||
})
|
||||
p.AddLog(m.From, friend.LOG_TYPE_CHARGE_RECEIVE, fmt.Sprintf("%d", mailId), m.SendT)
|
||||
p.PushClientRes(MailMod.NotifyMail(mailId))
|
||||
case msg.HANDLE_TYPE_WISHLIST_SEND: // 发送愿望单请求
|
||||
FriendMod := p.PlayMod.getFriendMod()
|
||||
FriendMod.AddWishApply(int64(m.From))
|
||||
|
||||
@ -36,6 +36,10 @@ type MailInfo struct {
|
||||
TitlePtBr string
|
||||
SubTitlePtBr string
|
||||
ContentPtBr string
|
||||
// 西班牙语 拉丁美洲
|
||||
TitleEsLatam string
|
||||
SubTitleEsLatam string
|
||||
ContentEsLatam string
|
||||
|
||||
Items []*item.Item // 邮件道具
|
||||
Type int //邮件类型
|
||||
@ -63,6 +67,11 @@ type MailStruct struct {
|
||||
SubTitlePtBr string
|
||||
ContentPtBr string
|
||||
|
||||
// 西班牙语 拉丁美洲
|
||||
TitleEsLatam string
|
||||
SubTitleEsLatam string
|
||||
ContentEsLatam string
|
||||
|
||||
Items []*item.Item
|
||||
Type int
|
||||
}
|
||||
@ -81,30 +90,16 @@ func (m *MailMod) SendMail(mail *MailStruct) int {
|
||||
SubTitleEn: mail.SubTitleEn,
|
||||
ContentEn: mail.ContentEn,
|
||||
|
||||
TitlePtBr: mail.TitlePtBr,
|
||||
SubTitlePtBr: mail.SubTitlePtBr,
|
||||
ContentPtBr: mail.ContentPtBr,
|
||||
Items: mail.Items,
|
||||
Send: GoUtil.Now(),
|
||||
Type: mail.Type,
|
||||
Status: MAIL_STATUS_IDLE,
|
||||
}
|
||||
return m.AutoId
|
||||
}
|
||||
|
||||
// 发送邮件
|
||||
func (m *MailMod) Send(Title, SubTitle, Content, TitleEn, SubTitleEn, ContentEn string, Items []*item.Item, t int) int {
|
||||
m.AutoId++
|
||||
m.List[m.AutoId] = &MailInfo{
|
||||
Title: Title,
|
||||
SubTitle: SubTitle,
|
||||
Content: Content,
|
||||
TitleEn: TitleEn,
|
||||
SubTitleEn: SubTitleEn,
|
||||
ContentEn: ContentEn,
|
||||
Items: Items,
|
||||
Send: GoUtil.Now(),
|
||||
Type: t,
|
||||
TitlePtBr: mail.TitlePtBr,
|
||||
SubTitlePtBr: mail.SubTitlePtBr,
|
||||
ContentPtBr: mail.ContentPtBr,
|
||||
TitleEsLatam: mail.TitleEsLatam,
|
||||
SubTitleEsLatam: mail.SubTitleEsLatam,
|
||||
ContentEsLatam: mail.ContentEsLatam,
|
||||
Items: mail.Items,
|
||||
Send: GoUtil.Now(),
|
||||
Type: mail.Type,
|
||||
Status: MAIL_STATUS_IDLE,
|
||||
}
|
||||
return m.AutoId
|
||||
}
|
||||
@ -167,10 +162,13 @@ func (m *MailMod) BackData() *msg.ResMailList {
|
||||
TitlePtBr: v.TitlePtBr,
|
||||
SubTitlePtBr: v.SubTitlePtBr,
|
||||
ContentPtBr: v.ContentPtBr,
|
||||
TitleEsLa: v.TitleEsLatam,
|
||||
SubTitleEsLa: v.SubTitleEsLatam,
|
||||
ContentEsLa: v.ContentEsLatam,
|
||||
Type: int32(v.Type),
|
||||
Items: item.ItemToMsg(v.Items),
|
||||
Status: int32(v.Status),
|
||||
Time: int32(v.Send),
|
||||
Type: int32(v.Type),
|
||||
}
|
||||
}
|
||||
return res
|
||||
@ -192,10 +190,13 @@ func (m *MailMod) NotifyMail(Id int) *msg.MailNotify {
|
||||
SubTitlePtBr: mailInfo.SubTitlePtBr,
|
||||
ContentPtBr: mailInfo.ContentPtBr,
|
||||
|
||||
Type: int32(mailInfo.Type),
|
||||
Items: item.ItemToMsg(mailInfo.Items),
|
||||
Status: int32(mailInfo.Status),
|
||||
Time: int32(mailInfo.Send),
|
||||
TitleEsLa: mailInfo.TitleEsLatam,
|
||||
SubTitleEsLa: mailInfo.SubTitleEsLatam,
|
||||
ContentEsLa: mailInfo.ContentEsLatam,
|
||||
Type: int32(mailInfo.Type),
|
||||
Items: item.ItemToMsg(mailInfo.Items),
|
||||
Status: int32(mailInfo.Status),
|
||||
Time: int32(mailInfo.Send),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user