forked from realDragonium/Ultraviolet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
633d54d
commit 0acc267
Showing
27 changed files
with
2,644 additions
and
633 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
package config | ||
|
||
import ( | ||
"crypto/ecdsa" | ||
"time" | ||
|
||
"github.com/realDragonium/Ultraviolet/mc" | ||
) | ||
|
||
type ServerState byte | ||
|
||
const ( | ||
UNKNOWN ServerState = iota | ||
ONLINE | ||
OFFLINE | ||
UPDATE | ||
) | ||
|
||
func (state ServerState) String() string { | ||
var text string | ||
switch state { | ||
case UNKNOWN: | ||
text = "Unknown" | ||
case ONLINE: | ||
text = "Online" | ||
case OFFLINE: | ||
text = "Offline" | ||
case UPDATE: | ||
text = "Update" | ||
} | ||
return text | ||
} | ||
|
||
type ServerConfigFile struct { | ||
} | ||
|
||
func (file ServerConfigFile) ReadConfig() { | ||
|
||
} | ||
|
||
type RateLimitConfig struct { | ||
rateCounter int | ||
rateStartTime time.Time | ||
rateLimit int | ||
rateLimitStatus bool | ||
rateCooldown time.Duration | ||
} | ||
|
||
type StateConfig struct { | ||
state ServerState | ||
stateCooldown time.Duration | ||
stateUpdateCh chan ServerState | ||
} | ||
|
||
type OldRealIPConfig struct { | ||
} | ||
|
||
type NewRealIPConfig struct { | ||
keyPath string | ||
realIPKey *ecdsa.PrivateKey | ||
} | ||
|
||
type OfflineStatusConfig struct { | ||
offlineStatus mc.Packet | ||
} | ||
|
||
type CacheStatusConfig struct { | ||
cachedStatus mc.Packet | ||
statusCooldown time.Duration | ||
statusCacheTime time.Time | ||
statusLatency time.Duration | ||
statusHandshake mc.Packet | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
github.com/cloudflare/tableflip v1.2.2 h1:WkhiowHlg0nZuH7Y2beLVIZDfxtSvKta1f22PEgUN7w= | ||
github.com/cloudflare/tableflip v1.2.2/go.mod h1:P4gRehmV6Z2bY5ao5ml9Pd8u6kuEnlB37pUFMmv7j2E= | ||
github.com/pires/go-proxyproto v0.5.0 h1:A4Jv4ZCaV3AFJeGh5mGwkz4iuWUYMlQ7IoO/GTuSuLo= | ||
github.com/pires/go-proxyproto v0.5.0/go.mod h1:Odh9VFOZJCf9G8cLW5o435Xf1J95Jw9Gw5rnCjcwzAY= | ||
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k= | ||
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.