public static Protobuf.Player CreateBufferedPlayer(Player player) { var translation = new Protobuf.Player(); translation.PlayerId = player.PlayerId; translation.Team = player.Team; if (player.LatencyInMS != null) { translation.LatencyInMs = new Dictionary <string, int>(); foreach (KeyValuePair <string, int> entry in player.LatencyInMS) { translation.LatencyInMs.Add(entry.Key, entry.Value); } } if (player.PlayerAttributes != null) { translation.PlayerAttributes = new Dictionary <string, Protobuf.AttributeValue>(); foreach (KeyValuePair <string, AttributeValue> entry in player.PlayerAttributes) { translation.PlayerAttributes.Add(entry.Key, BackfillDataMapper.CreateBufferedAttributeValue(entry.Value)); } } return(translation); }
public static Com.Amazon.Whitewater.Auxproxy.Pbuffer.Player CreateBufferedPlayer(Player player) { var translation = new Com.Amazon.Whitewater.Auxproxy.Pbuffer.Player(); translation.PlayerId = player.PlayerId; translation.Team = player.Team; if (player.LatencyInMS != null) { foreach (KeyValuePair <string, int> entry in player.LatencyInMS) { translation.LatencyInMs.Add(entry.Key, entry.Value); } } if (player.PlayerAttributes != null) { foreach (KeyValuePair <string, AttributeValue> entry in player.PlayerAttributes) { translation.PlayerAttributes.Add(entry.Key, BackfillDataMapper.CreateBufferedAttributeValue(entry.Value)); } } return(translation); }
CreateBufferedBackfillMatchmakingRequest(StartMatchBackfillRequest request) { Com.Amazon.Whitewater.Auxproxy.Pbuffer.BackfillMatchmakingRequest translated = new Com.Amazon.Whitewater.Auxproxy.Pbuffer.BackfillMatchmakingRequest(); translated.TicketId = request.TicketId; translated.GameSessionArn = request.GameSessionArn; translated.MatchmakingConfigurationArn = request.MatchmakingConfigurationArn; for (int i = 0; i < request.Players.Length; i++) { translated.Players.Add(BackfillDataMapper.CreateBufferedPlayer(request.Players[i])); } return(translated); }
public static Protobuf.BackfillMatchmakingRequest CreateBufferedBackfillMatchmakingRequest( StartMatchBackfillRequest request) { Protobuf.BackfillMatchmakingRequest translated = new Protobuf.BackfillMatchmakingRequest(); translated.TicketId = request.TicketId; translated.GameSessionArn = request.GameSessionArn; translated.MatchmakingConfigurationArn = request.MatchmakingConfigurationArn; if (request.Players != null) { translated.Players = new Protobuf.Player[request.Players.Length]; for (int i = 0; i < request.Players.Length; i++) { translated.Players[i] = BackfillDataMapper.CreateBufferedPlayer(request.Players[i]); } } return(translated); }