mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-13 07:25:03 +01:00
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"Host": "127.0.0.1",
|
"Host": "127.0.0.1",
|
||||||
"BinPath": "bin",
|
"BinPath": "bin",
|
||||||
|
"Language": "en",
|
||||||
"DisableSoftCrash": false,
|
"DisableSoftCrash": false,
|
||||||
"FeaturedWeapons": 1,
|
"FeaturedWeapons": 1,
|
||||||
"HideLoginNotice": true,
|
"HideLoginNotice": true,
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import (
|
|||||||
type Config struct {
|
type Config struct {
|
||||||
Host string `mapstructure:"Host"`
|
Host string `mapstructure:"Host"`
|
||||||
BinPath string `mapstructure:"BinPath"`
|
BinPath string `mapstructure:"BinPath"`
|
||||||
|
Language string
|
||||||
DisableSoftCrash bool // Disables the 'Press Return to exit' dialog allowing scripts to reboot the server automatically
|
DisableSoftCrash bool // Disables the 'Press Return to exit' dialog allowing scripts to reboot the server automatically
|
||||||
FeaturedWeapons int // Number of Active Feature weapons to generate daily
|
FeaturedWeapons int // Number of Active Feature weapons to generate daily
|
||||||
HideLoginNotice bool // Hide the Erupe notice on login
|
HideLoginNotice bool // Hide the Erupe notice on login
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ func handleMsgSysLogin(s *Session, p mhfpacket.MHFPacket) {
|
|||||||
s.charID = pkt.CharID0
|
s.charID = pkt.CharID0
|
||||||
s.token = pkt.LoginTokenString
|
s.token = pkt.LoginTokenString
|
||||||
s.Unlock()
|
s.Unlock()
|
||||||
|
|
||||||
updateRights(s)
|
updateRights(s)
|
||||||
bf := byteframe.NewByteFrame()
|
bf := byteframe.NewByteFrame()
|
||||||
bf.WriteUint32(uint32(Time_Current_Adjusted().Unix())) // Unix timestamp
|
bf.WriteUint32(uint32(Time_Current_Adjusted().Unix())) // Unix timestamp
|
||||||
|
|||||||
@@ -94,7 +94,8 @@ func handleMsgMhfGetCafeDuration(s *Session, p mhfpacket.MHFPacket) {
|
|||||||
}
|
}
|
||||||
bf.WriteUint32(cafeTime) // Total cafe time
|
bf.WriteUint32(cafeTime) // Total cafe time
|
||||||
bf.WriteUint16(0)
|
bf.WriteUint16(0)
|
||||||
ps.Uint16(bf, fmt.Sprintf("Resets on %s %d", cafeReset.Month().String(), cafeReset.Day()), true)
|
ps.Uint16(bf, fmt.Sprintf(s.server.dict["cafeReset"], int(cafeReset.Month()), cafeReset.Day()), true)
|
||||||
|
|
||||||
doAckBufSucceed(s, pkt.AckHandle, bf.Data())
|
doAckBufSucceed(s, pkt.AckHandle, bf.Data())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,10 +62,9 @@ func handleMsgMhfPostGuildScout(s *Session, p mhfpacket.MHFPacket) {
|
|||||||
mail := &Mail{
|
mail := &Mail{
|
||||||
SenderID: s.charID,
|
SenderID: s.charID,
|
||||||
RecipientID: pkt.CharID,
|
RecipientID: pkt.CharID,
|
||||||
Subject: "Invitation!",
|
Subject: s.server.dict["guildInviteName"],
|
||||||
Body: fmt.Sprintf(
|
Body: fmt.Sprintf(
|
||||||
"%s has invited you to join 「%s」\nDo you want to accept?",
|
s.server.dict["guildInvite"],
|
||||||
getCharacterName(s, s.charID),
|
|
||||||
guildInfo.Name,
|
guildInfo.Name,
|
||||||
),
|
),
|
||||||
IsGuildInvite: true,
|
IsGuildInvite: true,
|
||||||
@@ -149,30 +148,30 @@ func handleMsgMhfAnswerGuildScout(s *Session, p mhfpacket.MHFPacket) {
|
|||||||
err = guild.AcceptApplication(s, s.charID)
|
err = guild.AcceptApplication(s, s.charID)
|
||||||
mail = append(mail, Mail{
|
mail = append(mail, Mail{
|
||||||
RecipientID: s.charID,
|
RecipientID: s.charID,
|
||||||
Subject: "Success!",
|
Subject: s.server.dict["guildInviteSuccessName"],
|
||||||
Body: fmt.Sprintf("You successfully joined 「%s」.", guild.Name),
|
Body: fmt.Sprintf(s.server.dict["guildInviteSuccess"], guild.Name),
|
||||||
IsSystemMessage: true,
|
IsSystemMessage: true,
|
||||||
})
|
})
|
||||||
mail = append(mail, Mail{
|
mail = append(mail, Mail{
|
||||||
SenderID: s.charID,
|
SenderID: s.charID,
|
||||||
RecipientID: pkt.LeaderID,
|
RecipientID: pkt.LeaderID,
|
||||||
Subject: "Accepted",
|
Subject: s.server.dict["guildInviteAcceptedName"],
|
||||||
Body: fmt.Sprintf("%s accepted your invitation to join 「%s」.", s.Name, guild.Name),
|
Body: fmt.Sprintf(s.server.dict["guildInviteAccepted"], guild.Name),
|
||||||
IsSystemMessage: true,
|
IsSystemMessage: true,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
err = guild.RejectApplication(s, s.charID)
|
err = guild.RejectApplication(s, s.charID)
|
||||||
mail = append(mail, Mail{
|
mail = append(mail, Mail{
|
||||||
RecipientID: s.charID,
|
RecipientID: s.charID,
|
||||||
Subject: "Declined",
|
Subject: s.server.dict["guildInviteRejectName"],
|
||||||
Body: fmt.Sprintf("You declined the invitation to join 「%s」.", guild.Name),
|
Body: fmt.Sprintf(s.server.dict["guildInviteReject"], guild.Name),
|
||||||
IsSystemMessage: true,
|
IsSystemMessage: true,
|
||||||
})
|
})
|
||||||
mail = append(mail, Mail{
|
mail = append(mail, Mail{
|
||||||
SenderID: s.charID,
|
SenderID: s.charID,
|
||||||
RecipientID: pkt.LeaderID,
|
RecipientID: pkt.LeaderID,
|
||||||
Subject: "Declined",
|
Subject: s.server.dict["guildInviteDeclined"],
|
||||||
Body: fmt.Sprintf("%s declined your invitation to join 「%s」.", s.Name, guild.Name),
|
Body: fmt.Sprintf(s.server.dict["guildInviteDeclined"], guild.Name),
|
||||||
IsSystemMessage: true,
|
IsSystemMessage: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,9 @@ type Server struct {
|
|||||||
stagesLock sync.RWMutex
|
stagesLock sync.RWMutex
|
||||||
stages map[string]*Stage
|
stages map[string]*Stage
|
||||||
|
|
||||||
|
// Used to map different languages
|
||||||
|
dict map[string]string
|
||||||
|
|
||||||
// UserBinary
|
// UserBinary
|
||||||
userBinaryPartsLock sync.RWMutex
|
userBinaryPartsLock sync.RWMutex
|
||||||
userBinaryParts map[userBinaryPartID][]byte
|
userBinaryParts map[userBinaryPartID][]byte
|
||||||
@@ -164,6 +167,8 @@ func NewServer(config *Config) *Server {
|
|||||||
// MezFes
|
// MezFes
|
||||||
s.stages["sl1Ns462p0a0u0"] = NewStage("sl1Ns462p0a0u0")
|
s.stages["sl1Ns462p0a0u0"] = NewStage("sl1Ns462p0a0u0")
|
||||||
|
|
||||||
|
s.dict = getLangStrings(s)
|
||||||
|
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,6 +284,7 @@ func (s *Server) WorldcastMHF(pkt mhfpacket.MHFPacket, ignoredSession *Session,
|
|||||||
bf := byteframe.NewByteFrame()
|
bf := byteframe.NewByteFrame()
|
||||||
bf.WriteUint16(uint16(pkt.Opcode()))
|
bf.WriteUint16(uint16(pkt.Opcode()))
|
||||||
pkt.Build(bf, session.clientContext)
|
pkt.Build(bf, session.clientContext)
|
||||||
|
bf.WriteUint16(0x0010)
|
||||||
session.QueueSendNonBlocking(bf.Data())
|
session.QueueSendNonBlocking(bf.Data())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -313,15 +319,17 @@ func (s *Server) BroadcastRaviente(ip uint32, port uint16, stage []byte, _type u
|
|||||||
var text string
|
var text string
|
||||||
switch _type {
|
switch _type {
|
||||||
case 2:
|
case 2:
|
||||||
text = "<Great Slaying: Berserk> is being held!"
|
text = s.dict["ravienteBerserk"]
|
||||||
|
case 3:
|
||||||
|
text = s.dict["ravienteExtreme"]
|
||||||
case 4:
|
case 4:
|
||||||
text = "<Great Slaying: Extreme> is being held!"
|
text = s.dict["ravienteExtremeLimited"]
|
||||||
case 5:
|
case 5:
|
||||||
text = "<Great Slaying: Berserk Practice> is being held!"
|
text = s.dict["ravienteBerserkSmall"]
|
||||||
default:
|
default:
|
||||||
s.logger.Error("Unk raviente type", zap.Uint8("_type", _type))
|
s.logger.Error("Unk raviente type", zap.Uint8("_type", _type))
|
||||||
}
|
}
|
||||||
ps.Uint16(bf, text, false)
|
ps.Uint16(bf, text, true)
|
||||||
bf.WriteBytes([]byte{0x5F, 0x53, 0x00})
|
bf.WriteBytes([]byte{0x5F, 0x53, 0x00})
|
||||||
bf.WriteUint32(ip) // IP address
|
bf.WriteUint32(ip) // IP address
|
||||||
bf.WriteUint16(port) // Port
|
bf.WriteUint16(port) // Port
|
||||||
|
|||||||
52
server/channelserver/sys_language.go
Normal file
52
server/channelserver/sys_language.go
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
package channelserver
|
||||||
|
|
||||||
|
func getLangStrings(s *Server) map[string]string {
|
||||||
|
strings := make(map[string]string)
|
||||||
|
switch s.erupeConfig.Language {
|
||||||
|
case "jp":
|
||||||
|
strings["language"] = "日本語"
|
||||||
|
strings["cafeReset"] = "%d/%dにリセット"
|
||||||
|
strings["ravienteBerserk"] = "<大討伐:猛狂期>が開催されました!"
|
||||||
|
strings["ravienteExtreme"] = "<大討伐:猛狂期【極】>が開催されました!"
|
||||||
|
strings["ravienteExtremeLimited"] = "<大討伐:猛狂期【極】(制限付)>が開催されました!"
|
||||||
|
strings["ravienteBerserkSmall"] = "<大討伐:猛狂期(小数)>が開催されました!"
|
||||||
|
|
||||||
|
strings["guildInviteName"] = "猟団勧誘のご案内"
|
||||||
|
strings["guildInvite"] = "猟団「%s」からの勧誘通知です。\n「勧誘に返答」より、返答を行ってください。"
|
||||||
|
|
||||||
|
strings["guildInviteSuccessName"] = "成功"
|
||||||
|
strings["guildInviteSuccess"] = "あなたは「%s」に参加できました。"
|
||||||
|
|
||||||
|
strings["guildInviteAcceptedName"] = "承諾されました"
|
||||||
|
strings["guildInviteAccepted"] = "招待した狩人が「%s」への招待を承諾しました。"
|
||||||
|
|
||||||
|
strings["guildInviteRejectName"] = "却下しました"
|
||||||
|
strings["guildInviteReject"] = "あなたは「%s」への参加を却下しました。"
|
||||||
|
|
||||||
|
strings["guildInviteDeclinedName"] = "辞退しました"
|
||||||
|
strings["guildInviteDeclined"] = "招待した狩人が「%s」への招待を辞退しました。"
|
||||||
|
default:
|
||||||
|
strings["language"] = "English"
|
||||||
|
strings["cafeReset"] = "Resets on %d/%d"
|
||||||
|
strings["ravienteBerserk"] = "<Great Slaying: Berserk> is being held!"
|
||||||
|
strings["ravienteExtreme"] = "<Great Slaying: Extreme> is being held!"
|
||||||
|
strings["ravienteExtremeLimited"] = "<Great Slaying: Extreme (Limited)> is being held!"
|
||||||
|
strings["ravienteBerserkSmall"] = "<Great Slaying: Berserk (Small)> is being held!"
|
||||||
|
|
||||||
|
strings["guildInviteName"] = "Invitation!"
|
||||||
|
strings["guildInvite"] = "You have been invited to join\n「%s」\nDo you want to accept?"
|
||||||
|
|
||||||
|
strings["guildInviteSuccessName"] = "Success!"
|
||||||
|
strings["guildInviteSuccess"] = "You have successfully joined\n「%s」."
|
||||||
|
|
||||||
|
strings["guildInviteAcceptedName"] = "Accepted"
|
||||||
|
strings["guildInviteAccepted"] = "The recipient accepted your invitation to join\n「%s」."
|
||||||
|
|
||||||
|
strings["guildInviteRejectName"] = "Rejected"
|
||||||
|
strings["guildInviteReject"] = "You rejected the invitation to join\n「%s」."
|
||||||
|
|
||||||
|
strings["guildInviteDeclinedName"] = "Declined"
|
||||||
|
strings["guildInviteDeclined"] = "The recipient declined your invitation to join\n「%s」."
|
||||||
|
}
|
||||||
|
return strings
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user