Compare commits
10 Commits
9a7a123284
...
displaynam
| Author | SHA1 | Date | |
|---|---|---|---|
|
9e280a3285
|
|||
| 2cdd6874b4 | |||
| f248c19b07 | |||
| c400d2d58b | |||
|
0405aba995
|
|||
|
d3f2d336a0
|
|||
| 83ebab1cc6 | |||
|
0773cba6c7
|
|||
|
63ad706dd9
|
|||
|
8dce6ee1ba
|
44
.drone.yml
44
.drone.yml
@@ -6,7 +6,7 @@ name: generate-go-grpc
|
|||||||
steps:
|
steps:
|
||||||
- name: clone-external
|
- name: clone-external
|
||||||
image: alpine/git
|
image: alpine/git
|
||||||
commands:
|
commands:
|
||||||
- git clone https://${GIT_USER}:${GIT_PASS}@git.itzana.me/StrafesNET/go-grpc.git
|
- git clone https://${GIT_USER}:${GIT_PASS}@git.itzana.me/StrafesNET/go-grpc.git
|
||||||
environment:
|
environment:
|
||||||
GIT_USER:
|
GIT_USER:
|
||||||
@@ -46,7 +46,7 @@ name: generate-rust-grpc
|
|||||||
steps:
|
steps:
|
||||||
- name: clone-external
|
- name: clone-external
|
||||||
image: alpine/git
|
image: alpine/git
|
||||||
commands:
|
commands:
|
||||||
- git clone https://${GIT_USER}:${GIT_PASS}@git.itzana.me/StrafesNET/rust-grpc.git
|
- git clone https://${GIT_USER}:${GIT_PASS}@git.itzana.me/StrafesNET/rust-grpc.git
|
||||||
environment:
|
environment:
|
||||||
GIT_USER:
|
GIT_USER:
|
||||||
@@ -78,43 +78,3 @@ trigger:
|
|||||||
|
|
||||||
image_pull_secrets:
|
image_pull_secrets:
|
||||||
- dockerconfigjson
|
- dockerconfigjson
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: generate-python-grpc
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: clone-external
|
|
||||||
image: alpine/git
|
|
||||||
commands:
|
|
||||||
- git clone https://$GIT_USER:$GIT_PASS@git.itzana.me/StrafesNET/python-grpc.git
|
|
||||||
environment:
|
|
||||||
GIT_USER:
|
|
||||||
from_secret: GIT_USER
|
|
||||||
GIT_PASS:
|
|
||||||
from_secret: GIT_PASS
|
|
||||||
|
|
||||||
- name: generate
|
|
||||||
image: registry.itzana.me/strafesnet/tools/python-grpc:latest
|
|
||||||
commands:
|
|
||||||
- scripts/python-gen.sh
|
|
||||||
|
|
||||||
- name: commit
|
|
||||||
image: alpine/git
|
|
||||||
commands:
|
|
||||||
- cd python-grpc
|
|
||||||
- git add *
|
|
||||||
- 'git commit -m "Autogenerated update for ${DRONE_COMMIT_LINK}" || true'
|
|
||||||
- git push https://$GIT_USER:$GIT_PASS@git.itzana.me/StrafesNET/python-grpc.git --all
|
|
||||||
environment:
|
|
||||||
GIT_USER:
|
|
||||||
from_secret: GIT_USER
|
|
||||||
GIT_PASS:
|
|
||||||
from_secret: GIT_PASS
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/master
|
|
||||||
|
|
||||||
image_pull_secrets:
|
|
||||||
- dockerconfigjson
|
|
||||||
14
auth.proto
14
auth.proto
@@ -11,6 +11,7 @@ service AuthService {
|
|||||||
rpc GetGroupRole(IdMessage) returns (RoleReponse);
|
rpc GetGroupRole(IdMessage) returns (RoleReponse);
|
||||||
rpc ValidateSession(IdMessage) returns (ValidateResponse);
|
rpc ValidateSession(IdMessage) returns (ValidateResponse);
|
||||||
rpc GetAuthMetadata(google.protobuf.Empty) returns (AuthMetadataResponse);
|
rpc GetAuthMetadata(google.protobuf.Empty) returns (AuthMetadataResponse);
|
||||||
|
rpc GetAvatars(AvatarListRequest) returns (AvatarListResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
message IdMessage {
|
message IdMessage {
|
||||||
@@ -43,3 +44,16 @@ message AuthMetadataResponse {
|
|||||||
string AccountURL = 3;
|
string AccountURL = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message AvatarListRequest {
|
||||||
|
repeated uint64 UserIDs = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message AvatarItem {
|
||||||
|
uint64 UserID = 1;
|
||||||
|
string AvatarURL = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message AvatarListResponse {
|
||||||
|
repeated AvatarItem Avatars = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
11
bot_analyzer.proto
Normal file
11
bot_analyzer.proto
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
option go_package = "git.itzana.me/strafesnet/go-grpc/bot_analyzer";
|
||||||
|
|
||||||
|
package bot_analyzer;
|
||||||
|
|
||||||
|
service BotAnalyzer { rpc Analyze(DownloadUrl) returns (AnalysisResponse); }
|
||||||
|
|
||||||
|
message DownloadUrl { string Url = 1; }
|
||||||
|
|
||||||
|
message AnalysisResponse { string Analysis = 1; }
|
||||||
81
mapfixes.proto
Normal file
81
mapfixes.proto
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package mapfixes;
|
||||||
|
|
||||||
|
option go_package = "git.itzana.me/strafesnet/go-grpc/mapfixes";
|
||||||
|
|
||||||
|
service MapfixesService {
|
||||||
|
rpc Get(MapfixId) returns (MapfixResponse);
|
||||||
|
rpc GetList(MapfixIdList) returns (MapfixList);
|
||||||
|
rpc List(ListRequest) returns (MapfixList);
|
||||||
|
}
|
||||||
|
|
||||||
|
message MapfixIdList {
|
||||||
|
repeated int64 ID = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message MapfixId {
|
||||||
|
int64 ID = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum MapfixStatus {
|
||||||
|
// Phase: Creation
|
||||||
|
MapfixStatusUnderConstruction = 0;
|
||||||
|
MapfixStatusChangesRequested = 1;
|
||||||
|
|
||||||
|
// Phase: Review
|
||||||
|
MapfixStatusSubmitting = 2;
|
||||||
|
MapfixStatusSubmitted = 3;
|
||||||
|
|
||||||
|
// Phase: Testing
|
||||||
|
MapfixStatusAcceptedUnvalidated = 4; // pending script review, can re-trigger validation
|
||||||
|
MapfixStatusValidating = 5;
|
||||||
|
MapfixStatusValidated = 6;
|
||||||
|
MapfixStatusUploading = 7;
|
||||||
|
MapfixStatusUploaded = 8; // uploaded to the group, but pending release
|
||||||
|
MapfixStatusReleasing = 11;
|
||||||
|
|
||||||
|
// Phase: Final MapfixStatus
|
||||||
|
MapfixStatusRejected = 9;
|
||||||
|
MapfixStatusReleased = 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
message MapfixResponse {
|
||||||
|
int64 ID = 1;
|
||||||
|
string DisplayName = 2;
|
||||||
|
string Creator = 3;
|
||||||
|
uint32 GameID = 4;
|
||||||
|
int64 CreatedAt = 5;
|
||||||
|
int64 UpdatedAt = 6;
|
||||||
|
uint64 Submitter = 7;
|
||||||
|
uint64 AssetID = 8;
|
||||||
|
uint64 AssetVersion = 9;
|
||||||
|
optional uint64 ValidatedAssetID = 10;
|
||||||
|
optional uint64 ValidatedAssetVersion = 11;
|
||||||
|
uint64 TargetAssetID = 12;
|
||||||
|
MapfixStatus StatusID = 13;
|
||||||
|
}
|
||||||
|
|
||||||
|
message MapfixFilter {
|
||||||
|
optional MapfixStatus StatusID = 1;
|
||||||
|
optional string DisplayName = 2;
|
||||||
|
optional string Creator = 3;
|
||||||
|
optional uint32 GameID = 4;
|
||||||
|
optional uint64 Submitter = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
message MapfixList {
|
||||||
|
repeated MapfixResponse Mapfixes = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ListRequest {
|
||||||
|
MapfixFilter Filter = 1;
|
||||||
|
Pagination Page = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Pagination {
|
||||||
|
uint32 Size = 1;
|
||||||
|
uint32 Number = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message NullResponse {}
|
||||||
@@ -38,6 +38,7 @@ message MapRequest {
|
|||||||
message MapFilter {
|
message MapFilter {
|
||||||
optional string DisplayName = 2;
|
optional string DisplayName = 2;
|
||||||
optional int32 GameID = 4;
|
optional int32 GameID = 4;
|
||||||
|
optional string DisplayNameSubstring = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message MapList {
|
message MapList {
|
||||||
|
|||||||
@@ -12,8 +12,11 @@ service MapsService {
|
|||||||
rpc Delete(MapId) returns (NullResponse);
|
rpc Delete(MapId) returns (NullResponse);
|
||||||
rpc List(ListRequest) returns (MapList);
|
rpc List(ListRequest) returns (MapList);
|
||||||
rpc IncrementLoadCount(MapId) returns (NullResponse);
|
rpc IncrementLoadCount(MapId) returns (NullResponse);
|
||||||
|
rpc GetSnfmDownloadUrl(MapId) returns (SnfmDownloadUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message SnfmDownloadUrl { string Url = 1; }
|
||||||
|
|
||||||
message MapIdList { repeated int64 ID = 1; }
|
message MapIdList { repeated int64 ID = 1; }
|
||||||
|
|
||||||
message MapId { int64 ID = 1; }
|
message MapId { int64 ID = 1; }
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
mkdir -p strafesnet
|
|
||||||
cp *.proto strafesnet/
|
|
||||||
python3 -m grpc_tools.protoc -I./strafesnet --python_out=./python-grpc/strafesnet --grpc_python_out=./python-grpc/strafesnet *.proto
|
|
||||||
sed -i 's/^\(import.*pb2\)/from . \1/g' ./python-grpc/strafesnet/*.py
|
|
||||||
80
submissions.proto
Normal file
80
submissions.proto
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package submissions;
|
||||||
|
|
||||||
|
option go_package = "git.itzana.me/strafesnet/go-grpc/submissions";
|
||||||
|
|
||||||
|
service SubmissionsService {
|
||||||
|
rpc Get(SubmissionId) returns (SubmissionResponse);
|
||||||
|
rpc GetList(SubmissionIdList) returns (SubmissionList);
|
||||||
|
rpc List(ListRequest) returns (SubmissionList);
|
||||||
|
}
|
||||||
|
|
||||||
|
message SubmissionIdList {
|
||||||
|
repeated int64 ID = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message SubmissionId {
|
||||||
|
int64 ID = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SubmissionStatus {
|
||||||
|
// Phase: Creation
|
||||||
|
SubmissionStatusUnderConstruction = 0;
|
||||||
|
SubmissionStatusChangesRequested = 1;
|
||||||
|
|
||||||
|
// Phase: Review
|
||||||
|
SubmissionStatusSubmitting = 2;
|
||||||
|
SubmissionStatusSubmitted = 3;
|
||||||
|
|
||||||
|
// Phase: Testing
|
||||||
|
SubmissionStatusAcceptedUnvalidated = 4; // pending script review, can re-trigger validation
|
||||||
|
SubmissionStatusValidating = 5;
|
||||||
|
SubmissionStatusValidated = 6;
|
||||||
|
SubmissionStatusUploading = 7;
|
||||||
|
SubmissionStatusUploaded = 8; // uploaded to the group, but pending release
|
||||||
|
|
||||||
|
// Phase: Final SubmissionStatus
|
||||||
|
SubmissionStatusRejected = 9;
|
||||||
|
SubmissionStatusReleased = 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
message SubmissionResponse {
|
||||||
|
int64 ID = 1;
|
||||||
|
string DisplayName = 2;
|
||||||
|
string Creator = 3;
|
||||||
|
uint32 GameID = 4;
|
||||||
|
int64 CreatedAt = 7;
|
||||||
|
int64 UpdatedAt = 8;
|
||||||
|
uint64 Submitter = 9;
|
||||||
|
uint64 AssetID = 10;
|
||||||
|
uint64 AssetVersion = 11;
|
||||||
|
optional uint64 ValidatedAssetID = 12;
|
||||||
|
optional uint64 ValidatedAssetVersion = 13;
|
||||||
|
optional uint64 UploadedAssetID = 14;
|
||||||
|
SubmissionStatus StatusID = 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
message SubmissionFilter {
|
||||||
|
optional SubmissionStatus StatusID = 1;
|
||||||
|
optional string DisplayName = 2;
|
||||||
|
optional string Creator = 3;
|
||||||
|
optional uint32 GameID = 4;
|
||||||
|
optional uint64 Submitter = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
message SubmissionList {
|
||||||
|
repeated SubmissionResponse Submissions = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ListRequest {
|
||||||
|
SubmissionFilter Filter = 1;
|
||||||
|
Pagination Page = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Pagination {
|
||||||
|
uint32 Size = 1;
|
||||||
|
uint32 Number = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message NullResponse {}
|
||||||
@@ -11,6 +11,7 @@ service UsersService {
|
|||||||
rpc Create(UserRequest) returns (IdMessage);
|
rpc Create(UserRequest) returns (IdMessage);
|
||||||
rpc Delete(IdMessage) returns (NullResponse);
|
rpc Delete(IdMessage) returns (NullResponse);
|
||||||
rpc List(ListRequest) returns (UserList);
|
rpc List(ListRequest) returns (UserList);
|
||||||
|
rpc SearchByUsername(SearchByUsernameRequest) returns (UserList);
|
||||||
}
|
}
|
||||||
|
|
||||||
message IdList {
|
message IdList {
|
||||||
@@ -55,6 +56,11 @@ message Pagination {
|
|||||||
int32 Number = 2;
|
int32 Number = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message SearchByUsernameRequest {
|
||||||
|
string Query = 1;
|
||||||
|
Pagination Page = 2;
|
||||||
|
}
|
||||||
|
|
||||||
message NullResponse {
|
message NullResponse {
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,6 @@ service ValidatorSubmissionService {
|
|||||||
rpc SetStatusUploaded(StatusUploadedRequest) returns (NullResponse);
|
rpc SetStatusUploaded(StatusUploadedRequest) returns (NullResponse);
|
||||||
rpc SetStatusNotUploaded(SubmissionID) returns (NullResponse);
|
rpc SetStatusNotUploaded(SubmissionID) returns (NullResponse);
|
||||||
rpc SetStatusReleased(SubmissionReleaseRequest) returns (NullResponse);
|
rpc SetStatusReleased(SubmissionReleaseRequest) returns (NullResponse);
|
||||||
rpc SetStatusNotReleased(SubmissionID) returns (NullResponse);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message MapfixID { uint64 ID = 1; }
|
message MapfixID { uint64 ID = 1; }
|
||||||
|
|||||||
Reference in New Issue
Block a user