mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-12 15:04:38 +01:00
fix: Timescale fixes for seasons
This commit is contained in:
2372
bin/quests/desktop.ini
Normal file
2372
bin/quests/desktop.ini
Normal file
File diff suppressed because it is too large
Load Diff
17
config.json
17
config.json
@@ -17,8 +17,8 @@
|
||||
"AutoCreateAccount": true,
|
||||
"CleanDB": false,
|
||||
"MaxLauncherHR": false,
|
||||
"LogInboundMessages": false,
|
||||
"LogOutboundMessages": false,
|
||||
"LogInboundMessages": true,
|
||||
"LogOutboundMessages": true,
|
||||
"MaxHexdumpLength": 256,
|
||||
"DivaEvent": 0,
|
||||
"FestaEvent": -1,
|
||||
@@ -29,7 +29,7 @@
|
||||
"QuestDebugTools": false,
|
||||
"EarthStatusOverride": 0,
|
||||
"EarthIDOverride": 0,
|
||||
"DynamicSeasons": false,
|
||||
"DynamicSeasons": true,
|
||||
"EarthMonsterOverride": 0,
|
||||
"SaveDumps": {
|
||||
"Enabled": true,
|
||||
@@ -111,9 +111,9 @@
|
||||
],
|
||||
"Database": {
|
||||
"Host": "localhost",
|
||||
"Port": 5432,
|
||||
"Port": 5433,
|
||||
"User": "postgres",
|
||||
"Password": "",
|
||||
"Password": "admin",
|
||||
"Database": "erupe"
|
||||
},
|
||||
"Sign": {
|
||||
@@ -137,6 +137,13 @@
|
||||
{ "Port": 54001, "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,
|
||||
"Channels": [
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"erupe-ce/common/byteframe"
|
||||
ps "erupe-ce/common/pascalstring"
|
||||
"erupe-ce/network/mhfpacket"
|
||||
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
|
||||
@@ -81,18 +81,18 @@ func seasonConversion(s *Session, questPath string) string {
|
||||
// remove the last 6 from the quest path
|
||||
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
|
||||
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
|
||||
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
|
||||
|
||||
// Determine the letter to append for day / night
|
||||
if timeCycle {
|
||||
if timeCycle == 0 {
|
||||
timeSet = "n"
|
||||
} else {
|
||||
timeSet = "d"
|
||||
|
||||
@@ -33,7 +33,7 @@ func encodeServerInfo(config *_config.Config, s *Server, local bool) []byte {
|
||||
continue
|
||||
}
|
||||
}
|
||||
sid := (4096 + serverIdx*256) + 16
|
||||
sid := (4096 + serverIdx*256) * 6000
|
||||
//season := (uint8(float64((time.Now().Unix() + int64(sid)) / 1000))) % 3
|
||||
season := uint8((int(float64((time.Now().Unix() * int64(sid)) / (6000 * 15)))) % 3)
|
||||
if si.IP == "" {
|
||||
|
||||
Reference in New Issue
Block a user