(tools, client, server) feat: Remove gRPC support, add TCP back and reorganized project
This commit is contained in:
Binary file not shown.
@ -1,35 +1,30 @@
|
||||
from subprocess import Popen
|
||||
from os import path
|
||||
import subprocess
|
||||
import os
|
||||
import shutil
|
||||
|
||||
|
||||
protoc_dir = "./bin/protoc.exe"
|
||||
grpc_cs_plugin_dir = "./bin/grpc_csharp_plugin.exe"
|
||||
|
||||
proto_dir = "./proto"
|
||||
message_dir = proto_dir + "/message.proto"
|
||||
message_dir = f"{proto_dir}/message.proto"
|
||||
|
||||
gen_dir = "./gen"
|
||||
gen_code_dst_dir = "../../Client/Assets/Scripts/Protocol"
|
||||
|
||||
|
||||
def GenerateProtocol():
|
||||
if not path.exists(gen_dir):
|
||||
if not os.path.exists(gen_dir):
|
||||
os.makedirs(gen_dir)
|
||||
|
||||
result = Popen(
|
||||
gen_code = subprocess.Popen(
|
||||
[
|
||||
protoc_dir,
|
||||
f"--proto_path={proto_dir}",
|
||||
f"--csharp_out={gen_dir}",
|
||||
f"--grpc_out={gen_dir}",
|
||||
f"--plugin=protoc-gen-grpc={grpc_cs_plugin_dir}",
|
||||
message_dir,
|
||||
]
|
||||
)
|
||||
|
||||
result.wait()
|
||||
gen_code.wait()
|
||||
|
||||
|
||||
def MoveGeneratedCode():
|
||||
|
@ -2,15 +2,6 @@ syntax = "proto3";
|
||||
|
||||
package protocol;
|
||||
|
||||
// Define services
|
||||
|
||||
service GameService {
|
||||
rpc Login(LoginRequest) returns (LoginResponse);
|
||||
rpc Signup(SignupRequest) returns (SignupResponse);
|
||||
}
|
||||
|
||||
// Define messages
|
||||
|
||||
enum RequestResult {
|
||||
Success = 0;
|
||||
Fail = 1;
|
||||
|
Reference in New Issue
Block a user