diff --git a/build/build-image/gen-grpc-rust.sh b/build/build-image/gen-grpc-rust.sh index 3663072b57..bdeff8959b 100644 --- a/build/build-image/gen-grpc-rust.sh +++ b/build/build-image/gen-grpc-rust.sh @@ -1,4 +1,23 @@ #!/usr/bin/env bash +# Copyright 2018 Google Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + cd /go/src/agones.dev/agones protoc --rust_out sdks/rust/src/grpc --grpc_out=sdks/rust/src/grpc --plugin=protoc-gen-grpc=`which grpc_rust_plugin` sdk.proto + +cat ./build/boilerplate.go.txt ./sdks/rust/src/grpc/sdk.rs >> ./sdk.rs +cat ./build/boilerplate.go.txt ./sdks/rust/src/grpc/sdk_grpc.rs >> ./sdk_grpc.rs +mv ./sdk.rs ./sdks/rust/src/grpc/ +mv ./sdk_grpc.rs ./sdks/rust/src/grpc/ \ No newline at end of file diff --git a/examples/rust-simple/Cargo.toml b/examples/rust-simple/Cargo.toml index 14393eeac9..6a03117d8a 100644 --- a/examples/rust-simple/Cargo.toml +++ b/examples/rust-simple/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2018 Google Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + [package] name = "rust-simple" version = "0.1.0" diff --git a/examples/rust-simple/Dockerfile b/examples/rust-simple/Dockerfile index 787907d465..68b280d75b 100644 --- a/examples/rust-simple/Dockerfile +++ b/examples/rust-simple/Dockerfile @@ -1,3 +1,17 @@ +# Copyright 2018 Google Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + FROM rust:1.25.0 as builder RUN useradd -m build diff --git a/examples/rust-simple/Makefile b/examples/rust-simple/Makefile index 1e2ab23b4c..2dd408a8a9 100644 --- a/examples/rust-simple/Makefile +++ b/examples/rust-simple/Makefile @@ -1,3 +1,17 @@ +# Copyright 2018 Google Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # # Makefile for building the world's simplest Rust game server # diff --git a/examples/rust-simple/gameserver.yaml b/examples/rust-simple/gameserver.yaml index abf2b6b147..51eb108850 100644 --- a/examples/rust-simple/gameserver.yaml +++ b/examples/rust-simple/gameserver.yaml @@ -1,3 +1,17 @@ +# Copyright 2018 Google Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + apiVersion: "stable.agones.dev/v1alpha1" kind: GameServer metadata: diff --git a/examples/rust-simple/src/main.rs b/examples/rust-simple/src/main.rs index d819606007..b0a7355cff 100644 --- a/examples/rust-simple/src/main.rs +++ b/examples/rust-simple/src/main.rs @@ -1,3 +1,17 @@ +// Copyright 2018 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + extern crate agones; use std::result::Result; diff --git a/sdks/rust/Cargo.toml b/sdks/rust/Cargo.toml index 1562ee0ead..fc4127c8aa 100644 --- a/sdks/rust/Cargo.toml +++ b/sdks/rust/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2018 Google Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + [package] name = "agones" version = "0.1.0" diff --git a/sdks/rust/src/errors.rs b/sdks/rust/src/errors.rs index 7802c86565..79f59e80a2 100644 --- a/sdks/rust/src/errors.rs +++ b/sdks/rust/src/errors.rs @@ -1,3 +1,18 @@ +// Copyright 2018 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + // Wrap in a new error error_chain!{ foreign_links { diff --git a/sdks/rust/src/grpc/mod.rs b/sdks/rust/src/grpc/mod.rs index cd6e8899b4..66de973def 100644 --- a/sdks/rust/src/grpc/mod.rs +++ b/sdks/rust/src/grpc/mod.rs @@ -1,2 +1,16 @@ +// Copyright 2017 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + pub mod sdk; pub mod sdk_grpc; diff --git a/sdks/rust/src/grpc/sdk.rs b/sdks/rust/src/grpc/sdk.rs index 645d1148bd..6a74237efb 100644 --- a/sdks/rust/src/grpc/sdk.rs +++ b/sdks/rust/src/grpc/sdk.rs @@ -1,3 +1,18 @@ +// Copyright 2018 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. // This file is generated by rust-protobuf 2.0.2. Do not edit // @generated diff --git a/sdks/rust/src/grpc/sdk_grpc.rs b/sdks/rust/src/grpc/sdk_grpc.rs index c27b3f2dc1..fb97967b24 100644 --- a/sdks/rust/src/grpc/sdk_grpc.rs +++ b/sdks/rust/src/grpc/sdk_grpc.rs @@ -1,3 +1,18 @@ +// Copyright 2018 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was autogenerated. Do not edit directly. // This file is generated. Do not edit // @generated diff --git a/sdks/rust/src/lib.rs b/sdks/rust/src/lib.rs index add2b520ca..e1125bb885 100644 --- a/sdks/rust/src/lib.rs +++ b/sdks/rust/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2018 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //! the Rust game server SDK #[macro_use] extern crate error_chain; diff --git a/sdks/rust/src/sdk.rs b/sdks/rust/src/sdk.rs index f4365b6ebc..934d9548bd 100644 --- a/sdks/rust/src/sdk.rs +++ b/sdks/rust/src/sdk.rs @@ -1,3 +1,18 @@ +// Copyright 2018 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + use std::sync::{Arc, Mutex}; use std::time::Duration; use grpcio;