-
Notifications
You must be signed in to change notification settings - Fork 0
/
todo_server.rs
70 lines (57 loc) · 1.79 KB
/
todo_server.rs
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
68
69
70
use yggoxide::{prelude::*, structs::services::PlayerAttributes, traits::services::Services};
#[macro_use]
extern crate rocket;
pub struct TodoImpl;
#[async_trait]
impl Auth for TodoImpl {
/// Authenticate a user with the service
async fn authenticate(&self, _data: PayloadAuthenticate) -> Result<ResponseAuthenticate> {
todo!()
}
/// Refresh an access token
async fn refresh(&self, _data: PayloadRefresh) -> Result<ResponseRefresh> {
todo!()
}
/// Validate an access token
async fn validate(&self, _data: PayloadValidate) -> Result<()> {
todo!()
}
/// Sign out using credentials
async fn signout(&self, _data: PayloadSignout) -> Result<()> {
todo!()
}
/// Invalidate current access token
async fn invalidate(&self, _data: PayloadInvalidate) -> Result<()> {
todo!()
}
}
#[async_trait]
impl Session for TodoImpl {
/// Join a Minecraft server
async fn join_server(&self, _data: PayloadJoinServer) -> Result<()> {
todo!()
}
/// Check whether a client has joined a server and return their user profile
async fn has_joined(&self, _data: QueryHasJoined) -> Result<Profile> {
todo!()
}
/// Fetch a user's profile by their UUID
async fn get_profile(&self, _player_uuid: Uuid) -> Result<Profile> {
todo!()
}
}
#[async_trait]
impl Services for TodoImpl {
/// Fetch attributes for the currently authenticated player
async fn fetch_attributes(&self, _token: AccessToken) -> Result<PlayerAttributes> {
todo!()
}
/// Fetch key-pair for the currently authenticated player
async fn fetch_certificate(&self, _token: AccessToken) -> Result<PlayerCertificate> {
todo!()
}
}
#[launch]
fn rocket() -> _ {
build_managed(Box::new(TodoImpl))
}