()
| 92 | } |
| 93 | |
| 94 | func LoadGameTimeConfigs() { |
| 95 | |
| 96 | start := time.Now() |
| 97 | |
| 98 | path := string(configs.GetFilePathsConfig().DataFiles) + `/gametime.yaml` |
| 99 | |
| 100 | bytes, err := util.ReadFile(path) |
| 101 | if err != nil { |
| 102 | panic(errors.Wrap(err, `filepath: `+path)) |
| 103 | } |
| 104 | |
| 105 | err = yaml.Unmarshal(bytes, &gameTimeData) |
| 106 | if err != nil { |
| 107 | panic(errors.Wrap(err, `filepath: `+path)) |
| 108 | } |
| 109 | |
| 110 | if gameTimeData.Calendars == nil { |
| 111 | gameTimeData.Calendars = make(map[string]CalendarConfig) |
| 112 | } |
| 113 | |
| 114 | if _, ok := gameTimeData.Calendars[`default`]; !ok { |
| 115 | gameTimeData.Calendars[`default`] = failoverConfig |
| 116 | } |
| 117 | |
| 118 | for name, cfg := range gameTimeData.Calendars { |
| 119 | applyCalendarConfig(name, cfg) |
| 120 | } |
| 121 | |
| 122 | mudlog.Info("...LoadGameTimeConfigs()", "loadedCount", len(gameTimeData.Calendars), "Time Taken", time.Since(start)) |
| 123 | } |
| 124 | |
| 125 | // applyCalendarConfig pre-computes all derived constants from c and stores them |
| 126 | // in activeCalendar[name]. It also resets the round-date cache when the "default" |
no test coverage detected