@@ -60,6 +60,36 @@ echo "Starting with echo server on port: $echo_port and the cmb service on port:
6060
6161# Setup -------------------------------------------------------------------------
6262
63+ # Protocol Buffer Compiler ------------------------------------------------------
64+
65+ # Install Protocol Buffer Compiler (1st attempt)
66+ # apt-get install -y protobuf-compiler
67+
68+ # Download the protocol buffer release for linux
69+ echo " Downloading protocol bufffer compiler..."
70+ PB_REL=" https://github.com/protocolbuffers/protobuf/releases"
71+ curl -LO $PB_REL /download/v31.1/protoc-31.1-linux-x86_64.zip
72+
73+ # Create target folder to unzip protoc binaries.
74+ echo " Creating protocol bufffer folder..."
75+ mkdir -p protoc
76+ protoc_path=" ./protoc"
77+ folder_path=$( realpath " $protoc_path " )
78+
79+ echo " Folder path of protoc: $folder_path "
80+ echo " Unzipping to $folder_path "
81+
82+ # extract binaries to protoc folder
83+ unzip protoc-31.1-linux-x86_64.zip -d ./protoc
84+
85+ # Add the Protocol Buffer Compiler install PROTOC
86+ export PROTOC=" $folder_path "
87+ echo " Set PROTOC = $folder_path "
88+
89+ # Add the Protocol Buffer Compiler install location to the path
90+ export PATH=" $folder_path :$PATH "
91+ echo " Set PATH = $PATH "
92+
6393# clone the cmb service repo
6494git clone https://github.com/Unity-Technologies/mps-common-multiplayer-backend.git
6595# navigate to the cmb service directory
@@ -68,27 +98,16 @@ cd ./mps-common-multiplayer-backend/runtime
6898# Install rust
6999curl --proto ' =https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
70100
71- # Install Protocol Buffer Compiler
72- apt-get install -y protobuf-compiler
73-
74- # Add the Protocol Buffer Compiler install PROTOC
75- export PROTOC=" $HOME /.local/bin/protoc"
76-
77- # Add the Protocol Buffer Compiler install location to the path
78- export PATH=" $HOME /.local/bin:$PATH "
79-
80101# Add the cargo bin directory to the PATH
81102export PATH=" $HOME /.cargo/bin:$PATH "
82103
83-
84104# Echo server -------------------------------------------------------------------
85105
86106# Build the echo server
87107cargo build --example ngo_echo_server
88108# Run the echo server in the background
89109cargo run --example ngo_echo_server -- --port $echo_port &
90110
91-
92111# CMB Service -------------------------------------------------------------------
93112
94113# Build a release version of the standalone cmb service
0 commit comments