mirror of
https://github.com/renorris/openfsd
synced 2026-03-22 14:35:36 +08:00
Changes:
- Implement bootstrapping library for managing several concurrent internal services
- Refactor concurrency model for connections/logical clients and their associated I/O
- Refactor server context singleton
- Refactor error handling
- Most errors are now gracefully sent to the FSD client directly encoded as an $ER packet,
enhancing visibility and debugging
- Most errors are now rightfully treated as non-fatal
- Refactor package/dependency graph
- Refactor calling conventions/interfaces for many packages
- Refactor database package
- Refactor post office
Features:
- Add VATSIM-esque HTTP/JSON "data feed"
- Add ephemeral in-memory database option
- Add user management REST API
- Add improved web interface
- Add MySQL support (drop SQLite support)
40 lines
777 B
Go
40 lines
777 B
Go
package protocol
|
|
|
|
type PilotRating int
|
|
|
|
const (
|
|
PilotRatingNEW = 0
|
|
PilotRatingPPL = 1
|
|
PilotRatingIR = 3
|
|
PilotRatingCMEL = 7
|
|
PilotRatingATPL = 15
|
|
PilotRatingFI = 31
|
|
PilotRatingFE = 63
|
|
)
|
|
|
|
var pilotRatingToLongString = map[PilotRating]string{
|
|
0: "Basic Member",
|
|
1: "Private Pilot License",
|
|
3: "Instrument Rating",
|
|
7: "Commercial Multi-Engine License",
|
|
15: "Airline Transport Pilot License",
|
|
31: "Flight Instructor",
|
|
63: "Flight Examiner",
|
|
}
|
|
|
|
var pilotRatingToShortString = map[PilotRating]string{
|
|
0: "NEW",
|
|
1: "PPL",
|
|
3: "IR",
|
|
7: "CMEL",
|
|
15: "ATPL",
|
|
31: "FI",
|
|
63: "FE",
|
|
}
|
|
|
|
func ForEachPilotRating(f func(id PilotRating, shortString, longString string)) {
|
|
for k, v := range pilotRatingToShortString {
|
|
f(k, v, pilotRatingToLongString[k])
|
|
}
|
|
}
|