@echo off

if not exist "./gen" (
    mkdir "./gen"
)

protoc --proto_path=./sources --go_out=./gen ./sources/*.proto
xcopy "./gen/common" "../../../Server/common" /E /I /Y /Q

if not exist "./gen/client" (
    mkdir "./gen/client"
)
protoc --proto_path=./sources --csharp_out=./gen/client ./sources/*.proto
xcopy "./gen/client" "../../../Client/Point/Assets/Scripts/Proto" /E /I /Y /Q