(tools, server) feat: Replace TCP server with gRPC server

This commit is contained in:
2025-07-13 15:44:55 +08:00
parent 820a3cfe32
commit 3df2a3ee2c
10 changed files with 941 additions and 158 deletions

View File

@ -1,3 +1,52 @@
syntax = "proto3";
option csharp_namespace = "Protocol";
package protocol;
// Define services
service GeneralService {
// Get server info from server.
//
// This parameter actually doesn't accept any arguments,
// but it is still required owing to Protobuf grammar.
rpc GetServerInfo(Empty) returns (ServerInfo);
}
service GameService {
rpc Login(LoginRequest) returns (LoginResponse);
rpc Signup(SignupRequest) returns (SignupResponse);
}
// Define messages
enum RequestResult {
Success = 0;
Fail = 1;
}
message Empty {}
message ServerInfo {
string Lang = 1;
string ver = 2;
}
message LoginRequest {
string Username = 1;
string Password = 2;
}
message LoginResponse {
RequestResult result = 1;
string message = 2;
}
message SignupRequest {
string Username = 1;
string Password = 2;
}
message SignupResponse {
RequestResult result = 1;
string message = 2;
}