Location in Amazon Simple Storage Service (Amazon S3) where a build's files are stored. This location is assigned in response to a CreateBuild call, and is always in the same region as the service used to create the build. For more details see the Amazon S3 documentation.
Пример #1
0
        static async Task <string> CreateBuild(string name, string version, Amazon.GameLift.Model.S3Location s3Location)
        {
            using (var aglc = new AmazonGameLiftClient(new AmazonGameLiftConfig
            {
                RegionEndpoint = region
            }))
            {
                try
                {
                    CreateBuildResponse cbres = await aglc.CreateBuildAsync(new CreateBuildRequest
                    {
                        Name            = name,
                        Version         = version,
                        StorageLocation = s3Location
                    });

                    return(cbres.Build.BuildId);
                }
                catch (AmazonGameLiftException glException)
                {
                    Console.WriteLine(glException.Message, glException.InnerException);
                    throw;
                }
            }
        }
Пример #2
0
        static Amazon.GameLift.Model.S3Location UploadBuild(string zipfile, string roleArn)
        {
            try
            {
                TransferUtility fileTransferUtility =
                    new TransferUtility(new AmazonS3Client(region));

                fileTransferUtility.Upload(zipfile, bucket, "build.zip");
            }
            catch (AmazonS3Exception s3Exception)
            {
                Console.WriteLine(s3Exception.Message, s3Exception.InnerException);
                throw;
            }
            var s3Location = new Amazon.GameLift.Model.S3Location();

            s3Location.Bucket  = bucket;
            s3Location.Key     = "build.zip";
            s3Location.RoleArn = roleArn;
            return(s3Location);
        }