fix: Timescale fixes for seasons

This commit is contained in:
Matthe815
2023-07-06 17:00:17 -04:00
parent 830bee8c6f
commit 6938b57a60
5 changed files with 2391 additions and 11 deletions

2372
bin/quests/desktop.ini Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -17,8 +17,8 @@
"AutoCreateAccount": true, "AutoCreateAccount": true,
"CleanDB": false, "CleanDB": false,
"MaxLauncherHR": false, "MaxLauncherHR": false,
"LogInboundMessages": false, "LogInboundMessages": true,
"LogOutboundMessages": false, "LogOutboundMessages": true,
"MaxHexdumpLength": 256, "MaxHexdumpLength": 256,
"DivaEvent": 0, "DivaEvent": 0,
"FestaEvent": -1, "FestaEvent": -1,
@@ -29,7 +29,7 @@
"QuestDebugTools": false, "QuestDebugTools": false,
"EarthStatusOverride": 0, "EarthStatusOverride": 0,
"EarthIDOverride": 0, "EarthIDOverride": 0,
"DynamicSeasons": false, "DynamicSeasons": true,
"EarthMonsterOverride": 0, "EarthMonsterOverride": 0,
"SaveDumps": { "SaveDumps": {
"Enabled": true, "Enabled": true,
@@ -111,9 +111,9 @@
], ],
"Database": { "Database": {
"Host": "localhost", "Host": "localhost",
"Port": 5432, "Port": 5433,
"User": "postgres", "User": "postgres",
"Password": "", "Password": "admin",
"Database": "erupe" "Database": "erupe"
}, },
"Sign": { "Sign": {
@@ -137,6 +137,13 @@
{ "Port": 54001, "MaxPlayers": 100 }, { "Port": 54001, "MaxPlayers": 100 },
{ "Port": 54002, "MaxPlayers": 100 } { "Port": 54002, "MaxPlayers": 100 }
] ]
},
{
"Name": "Newbie 2", "Description": "", "IP": "", "Type": 3, "Recommended": 2, "AllowedClientFlags": 0,
"Channels": [
{ "Port": 54009, "MaxPlayers": 100 },
{ "Port": 54010, "MaxPlayers": 100 }
]
}, { }, {
"Name": "Normal", "Description": "", "IP": "", "Type": 1, "Recommended": 0, "AllowedClientFlags": 0, "Name": "Normal", "Description": "", "IP": "", "Type": 1, "Recommended": 0, "AllowedClientFlags": 0,
"Channels": [ "Channels": [

View File

@@ -4,6 +4,7 @@ import (
"erupe-ce/common/byteframe" "erupe-ce/common/byteframe"
ps "erupe-ce/common/pascalstring" ps "erupe-ce/common/pascalstring"
"erupe-ce/network/mhfpacket" "erupe-ce/network/mhfpacket"
"go.uber.org/zap" "go.uber.org/zap"
) )

View File

@@ -81,18 +81,18 @@ func seasonConversion(s *Session, questPath string) string {
// remove the last 6 from the quest path // remove the last 6 from the quest path
newQuestPath := questPath[:len(questPath)-6] newQuestPath := questPath[:len(questPath)-6]
// Calculate the current day of the season in order to determine time scale
currentDayOfSeason := (time.Now().Unix()/6000)%15 + 1
// Determine if it is day or night based on the current day of the season // Determine if it is day or night based on the current day of the season
timeCycle := uint8(((currentDayOfSeason % 1) * 24)) < 12 timeCycle := uint8(time.Now().Unix()/3000) % 2
// Determine the current season based on a modulus of the current time // Determine the current season based on a modulus of the current time
season := uint8((int(float64((time.Now().Unix() * int64(s.server.ID)) / (6000 * 15)))) % 3) sid := (4096 + s.server.ID*256) * 6000
season := uint8((int(float64((time.Now().Unix() * int64(sid)) / (6000 * 15)))) % 3)
var timeSet string var timeSet string
// Determine the letter to append for day / night // Determine the letter to append for day / night
if timeCycle { if timeCycle == 0 {
timeSet = "n" timeSet = "n"
} else { } else {
timeSet = "d" timeSet = "d"

View File

@@ -33,7 +33,7 @@ func encodeServerInfo(config *_config.Config, s *Server, local bool) []byte {
continue continue
} }
} }
sid := (4096 + serverIdx*256) + 16 sid := (4096 + serverIdx*256) * 6000
//season := (uint8(float64((time.Now().Unix() + int64(sid)) / 1000))) % 3 //season := (uint8(float64((time.Now().Unix() + int64(sid)) / 1000))) % 3
season := uint8((int(float64((time.Now().Unix() * int64(sid)) / (6000 * 15)))) % 3) season := uint8((int(float64((time.Now().Unix() * int64(sid)) / (6000 * 15)))) % 3)
if si.IP == "" { if si.IP == "" {