use sequential seasons

This commit is contained in:
wish
2022-08-07 17:16:54 +10:00
parent 0b90dfd458
commit f8ed2ef40d

View File

@@ -168,9 +168,6 @@ func main() {
ci := 0 ci := 0
count := 1 count := 1
for _, ee := range erupeConfig.Entrance.Entries { for _, ee := range erupeConfig.Entrance.Entries {
rand.Seed(time.Now().UnixNano())
// Randomly generate a season for the World
season := rand.Intn(3) + 1
for _, ce := range ee.Channels { for _, ce := range ee.Channels {
sid := (4096 + si*256) + (16 + ci) sid := (4096 + si*256) + (16 + ci)
c := *channelserver.NewServer(&channelserver.Config{ c := *channelserver.NewServer(&channelserver.Config{
@@ -190,7 +187,7 @@ func main() {
if err != nil { if err != nil {
preventClose(fmt.Sprintf("Failed to start channel server: %s", err.Error())) preventClose(fmt.Sprintf("Failed to start channel server: %s", err.Error()))
} else { } else {
channelQuery += fmt.Sprintf("INSERT INTO servers (server_id, season, current_players) VALUES (%d, %d, 0);", sid, season) channelQuery += fmt.Sprintf("INSERT INTO servers (server_id, season, current_players) VALUES (%d, %d, 0);", sid, si%3)
channels = append(channels, &c) channels = append(channels, &c)
logger.Info(fmt.Sprintf("Started channel server %d on port %d", count, ce.Port)) logger.Info(fmt.Sprintf("Started channel server %d on port %d", count, ce.Port))
ci++ ci++