From 55c8dfd3793762dc65909941f3e575b75af6e8b5 Mon Sep 17 00:00:00 2001 From: Rhys Lloyd Date: Fri, 25 Jul 2025 19:43:10 -0700 Subject: [PATCH 1/7] sessions --- sessions.proto | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 sessions.proto diff --git a/sessions.proto b/sessions.proto new file mode 100644 index 0000000..e028804 --- /dev/null +++ b/sessions.proto @@ -0,0 +1,54 @@ +syntax = "proto3"; + +option go_package = "git.itzana.me/strafesnet/go-grpc/sessions"; + +package sessions; + +service SessionsService { + rpc Get(SessionId) returns (SessionResponse); + rpc Create(SessionCreate) returns (SessionId); + rpc List(ListRequest) returns (SessionList); +} + +message SessionIdList { repeated int64 ID = 1; } + +message SessionId { int64 ID = 1; } + +message SessionResponse { + int64 ID = 1; + uint64 UserID = 2; + uint64 MapID = 3; + int64 Date = 4; + uint32 Duration = 5; +} + +message SessionCreate { + uint64 UserID = 1; + uint64 MapID = 2; + int64 Date = 3; + uint32 Duration = 4; +} + +enum SessionSort { + SessionSortDateDescending = 0; +} + +message SessionFilter { + optional uint64 UserID = 1; + optional uint64 MapID = 2; +} + +message SessionList { repeated SessionResponse Sessions = 1; } + +message ListRequest { + SessionFilter Filter = 1; + Pagination Page = 2; + Sort SessionSort = 3; +} + +message Pagination { + uint32 Size = 1; + uint32 Number = 2; +} + +message NullResponse {} -- 2.49.1 From 1969f9e2fef7073d89f9c222118b5d8942be60da Mon Sep 17 00:00:00 2001 From: Rhys Lloyd Date: Fri, 25 Jul 2025 19:46:17 -0700 Subject: [PATCH 2/7] sessions: extend with attempts --- sessions.proto | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sessions.proto b/sessions.proto index e028804..54a062a 100644 --- a/sessions.proto +++ b/sessions.proto @@ -20,6 +20,7 @@ message SessionResponse { uint64 MapID = 3; int64 Date = 4; uint32 Duration = 5; + uint32 Attempts = 6; } message SessionCreate { @@ -27,6 +28,7 @@ message SessionCreate { uint64 MapID = 2; int64 Date = 3; uint32 Duration = 4; + uint32 Attempts = 5; } enum SessionSort { -- 2.49.1 From 62ffc6a3657df2993656b1862500e5ad0010cdb5 Mon Sep 17 00:00:00 2001 From: Rhys Lloyd Date: Fri, 25 Jul 2025 19:49:31 -0700 Subject: [PATCH 3/7] sessions: aggregate request --- sessions.proto | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sessions.proto b/sessions.proto index 54a062a..bbc029b 100644 --- a/sessions.proto +++ b/sessions.proto @@ -8,6 +8,7 @@ service SessionsService { rpc Get(SessionId) returns (SessionResponse); rpc Create(SessionCreate) returns (SessionId); rpc List(ListRequest) returns (SessionList); + rpc Aggregate(SessionFilter) returns (SessionAggregate); } message SessionIdList { repeated int64 ID = 1; } @@ -53,4 +54,9 @@ message Pagination { uint32 Number = 2; } +message SessionAggregate { + uint64 Duration = 1; + uint64 Attempts = 2; +} + message NullResponse {} -- 2.49.1 From 8a5f33b1b40438d872ba853efab0dae2b8941099 Mon Sep 17 00:00:00 2001 From: Rhys Lloyd Date: Fri, 25 Jul 2025 19:58:51 -0700 Subject: [PATCH 4/7] times: record attempt number to time entry --- times.proto | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/times.proto b/times.proto index cdab41d..10a6d85 100644 --- a/times.proto +++ b/times.proto @@ -28,6 +28,7 @@ message TimeRequest { optional int32 StyleID = 6; optional int32 ModeID = 7; optional int32 GameID = 8; + optional uint32 Attempt = 9; } message TimeFilter { @@ -51,6 +52,9 @@ message TimeResponse { int32 StyleID = 7; int32 ModeID = 8; int32 GameID = 9; + // How many times did the player leave the start zone + // during their full play history of the map + uint32 Attempt = 10; } message IdMessage { @@ -100,4 +104,4 @@ message Pagination { message NullResponse { -} \ No newline at end of file +} -- 2.49.1 From 149ee727cad1ef6f5acf5a210b4ffa003cf5d2c0 Mon Sep 17 00:00:00 2001 From: Rhys Lloyd Date: Fri, 25 Jul 2025 20:09:09 -0700 Subject: [PATCH 5/7] sessions: track GameID --- sessions.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sessions.proto b/sessions.proto index bbc029b..230f641 100644 --- a/sessions.proto +++ b/sessions.proto @@ -22,6 +22,7 @@ message SessionResponse { int64 Date = 4; uint32 Duration = 5; uint32 Attempts = 6; + uint32 GameID = 7; } message SessionCreate { @@ -30,6 +31,7 @@ message SessionCreate { int64 Date = 3; uint32 Duration = 4; uint32 Attempts = 5; + uint32 GameID = 6; } enum SessionSort { @@ -39,6 +41,7 @@ enum SessionSort { message SessionFilter { optional uint64 UserID = 1; optional uint64 MapID = 2; + optional uint32 GameID = 3; } message SessionList { repeated SessionResponse Sessions = 1; } -- 2.49.1 From a3a63a84756707020183cc1b47a7b590f224a491 Mon Sep 17 00:00:00 2001 From: Rhys Lloyd Date: Fri, 25 Jul 2025 20:16:45 -0700 Subject: [PATCH 6/7] sessions: track StyleID --- sessions.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sessions.proto b/sessions.proto index 230f641..7ecdbfd 100644 --- a/sessions.proto +++ b/sessions.proto @@ -23,6 +23,7 @@ message SessionResponse { uint32 Duration = 5; uint32 Attempts = 6; uint32 GameID = 7; + uint32 StyleID = 8; } message SessionCreate { @@ -32,6 +33,7 @@ message SessionCreate { uint32 Duration = 4; uint32 Attempts = 5; uint32 GameID = 6; + uint32 StyleID = 7; } enum SessionSort { @@ -42,6 +44,7 @@ message SessionFilter { optional uint64 UserID = 1; optional uint64 MapID = 2; optional uint32 GameID = 3; + optional uint32 StyleID = 4; } message SessionList { repeated SessionResponse Sessions = 1; } -- 2.49.1 From a18a5c423b0dbaad9c8ef5ee9b6760f3a624d4fa Mon Sep 17 00:00:00 2001 From: Rhys Lloyd Date: Fri, 25 Jul 2025 20:22:08 -0700 Subject: [PATCH 7/7] sessions: remove SessionsService.Get I can't think of any scenario where getting a session by ID is required. --- sessions.proto | 1 - 1 file changed, 1 deletion(-) diff --git a/sessions.proto b/sessions.proto index 7ecdbfd..d3f735b 100644 --- a/sessions.proto +++ b/sessions.proto @@ -5,7 +5,6 @@ option go_package = "git.itzana.me/strafesnet/go-grpc/sessions"; package sessions; service SessionsService { - rpc Get(SessionId) returns (SessionResponse); rpc Create(SessionCreate) returns (SessionId); rpc List(ListRequest) returns (SessionList); rpc Aggregate(SessionFilter) returns (SessionAggregate); -- 2.49.1