public async Task <List <PlayerLocationDto> > GetLocations() { var query = new TableQuery <PlayerLocationEntity>().AsTableQuery(); var results = new List <PlayerLocationDto>(); TableContinuationToken continuationToken = null; do { var queryResult = await _locationsTable.ExecuteQuerySegmentedAsync(query, continuationToken); foreach (var entity in queryResult) { var playerLocationDto = new PlayerLocationDto { GameType = entity.GameType, ServerId = entity.ServerId, ServerName = entity.ServerName, Guid = entity.Guid, PlayerName = entity.PlayerName, GeoLocation = entity.GeoLocation }; results.Add(playerLocationDto); } continuationToken = queryResult.ContinuationToken; } while (continuationToken != null); return(results); }
public async Task UpdateEntry(PlayerLocationDto model) { var playerLocationEntity = new PlayerLocationEntity { PartitionKey = model.ServerId.ToString(), GameType = model.GameType, ServerId = model.ServerId, ServerName = model.ServerName, Guid = model.Guid, PlayerName = model.PlayerName, GeoLocation = model.GeoLocation }; if (string.IsNullOrWhiteSpace(playerLocationEntity.RowKey)) { playerLocationEntity.RowKey = GenerateRowKeyForPlayerLocation(model); } var operation = TableOperation.InsertOrMerge(playerLocationEntity); await _locationsTable.ExecuteAsync(operation); }
public RoomInvitationPlayerAckMessage(ulong unk1, string unk2, PlayerLocationDto location) { Unk1 = unk1; Unk2 = unk2; Location = location; }
public RoomInvitationPlayerAckMessage() { Unk2 = ""; Location = new PlayerLocationDto(); }
private static string GenerateRowKeyForPlayerLocation(PlayerLocationDto playerLocationDto) { return($"{playerLocationDto.GameType}-{playerLocationDto.ServerId}-{playerLocationDto.Guid}"); }
public RoomInvitationPlayerAckMessage(ulong senderid, string sendernickname, PlayerLocationDto location) { SenderId = senderid; SenderNickname = sendernickname; Location = location; }