-
Notifications
You must be signed in to change notification settings - Fork 1
/
controller.go
67 lines (61 loc) · 3.54 KB
/
controller.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package got5
import (
"context"
"io"
)
// Auth Auth interface handles auth
type Auth interface {
EventAuth(ctx context.Context, auth string) error
MatchAuth(ctx context.Context, mid int, auth string) error
CheckDemoAuth(ctx context.Context, mid int, filename string, mapNumber int, auth string) error
}
// EventHandler EventHandler interface handles read operation by get5 events
type EventHandler interface {
Close() error
// GET5 Events
HandleOnGameStateChanged(ctx context.Context, p OnGameStateChangedPayload) error
HandleOnPreLoadMatchConfig(ctx context.Context, p OnPreLoadMatchConfigPayload) error
HandleOnLoadMatchConfigFailed(ctx context.Context, p OnLoadMatchConfigFailedPayload) error
HandleOnSeriesInit(ctx context.Context, p OnSeriesInitPayload) error
HandleOnMapResult(ctx context.Context, p OnMapResultPayload) error
HandleOnSeriesResult(ctx context.Context, p OnSeriesResultPayload) error
HandleOnSidePicked(ctx context.Context, p OnSidePickedPayload) error
HandleOnMapPicked(ctx context.Context, p OnMapPickedPayload) error
HandleOnMapVetoed(ctx context.Context, p OnMapVetoedPayload) error
HandleOnBackupRestore(ctx context.Context, p OnBackupRestorePayload) error
HandleOnDemoFinished(ctx context.Context, p OnDemoFinishedPayload) error
HandleOnDemoUploadEnded(ctx context.Context, p OnDemoUploadEndedPayload) error
HandleOnMatchPaused(ctx context.Context, p OnMatchPausedPayload) error
HandleOnMatchUnpaused(ctx context.Context, p OnMatchUnpausedPayload) error
HandleOnPauseBegan(ctx context.Context, p OnPauseBeganPayload) error
HandleOnKnifeRoundStarted(ctx context.Context, p OnKnifeRoundStartedPayload) error
HandleOnKnifeRoundWon(ctx context.Context, p OnKnifeRoundWonPayload) error
HandleOnTeamReadyStatusChanged(ctx context.Context, p OnTeamReadyStatusChangedPayload) error
HandleOnGoingLive(ctx context.Context, p OnGoingLivePayload) error
HandleOnRoundStart(ctx context.Context, p OnRoundStartPayload) error
HandleOnRoundEnd(ctx context.Context, p OnRoundEndPayload) error
HandleOnRoundStatsUpdated(ctx context.Context, p OnRoundStatsUpdatedPayload) error
HandleOnPlayerBecameMVP(ctx context.Context, p OnPlayerBecameMVPPayload) error
HandleOnGrenadeThrown(ctx context.Context, p OnGrenadeThrownPayload) error
HandleOnPlayerDeath(ctx context.Context, p OnPlayerDeathPayload) error
HandleOnHEGrenadeDetonated(ctx context.Context, p OnHEGrenadeDetonatedPayload) error
HandleOnMolotovDetonated(ctx context.Context, p OnMolotovDetonatedPayload) error
HandleOnFlashbangDetonated(ctx context.Context, p OnFlashbangDetonatedPayload) error
HandleOnSmokeGrenadeDetonated(ctx context.Context, p OnSmokeGrenadeDetonatedPayload) error
HandleOnDecoyStarted(ctx context.Context, p OnDecoyStartedPayload) error
HandleOnBombPlanted(ctx context.Context, p OnBombPlantedPayload) error
HandleOnBombDefused(ctx context.Context, p OnBombDefusedPayload) error
HandleOnBombExploded(ctx context.Context, p OnBombExplodedPayload) error
HandleOnPlayerConnected(ctx context.Context, p OnPlayerConnectedPayload) error
HandleOnPlayerDisconnected(ctx context.Context, p OnPlayerDisconnectedPayload) error
HandleOnPlayerSay(ctx context.Context, p OnPlayerSayPayload) error
}
// MatchLoader is for Read Operation(get5_loadmatch_url)
type MatchLoader interface {
// Load respond to get5_loadmatch_url
Load(ctx context.Context, mid int) (*Match, error)
}
// DemoUploader is for Demo Upload Operation(get5_dem_upload_url)
type DemoUploader interface {
Upload(ctx context.Context, mid int, filename string, mapNumber int, r io.Reader) error // demoファイルの登録処理
}