Fix sélection de map : débloquer Map01/02/03 (mapRowNamesUnlocked) + squad solo dans TryGetCompleteSquadInfo
Build & Deploy / build (push) Successful in 32s
Build & Deploy / build (push) Successful in 32s
Sans maps débloquées, le client ne propose/déploie que la 1re map (Bright Sands) quel que soit le choix. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
73178ed8c3
commit
5d98768349
@@ -71,12 +71,11 @@ public class TryGetCompleteSquadInfoFunction : ICloudScriptFunction<TryGetComple
|
|||||||
throw new CloudScriptException("CloudScript was not called within a http request");
|
throw new CloudScriptException("CloudScript was not called within a http request");
|
||||||
}
|
}
|
||||||
var userId = context.User.FindAuthUserId();
|
var userId = context.User.FindAuthUserId();
|
||||||
var squad = _squadService.GetByUser(userId);
|
var squad = _squadService.GetByUser(userId)
|
||||||
if (squad == null)
|
// Solo : on matérialise un squad d'un membre (soi-même) pour renvoyer la
|
||||||
{
|
// liste des cartes débloquées, sinon le client n'en voit aucune et déploie
|
||||||
// Not in a squad yet — return an empty squad (same as the previous stub).
|
// toujours sur la 1re map.
|
||||||
return Task.FromResult(new FYPlayFabSquad());
|
?? _squadService.JoinOrCreate(userId, userId, "");
|
||||||
}
|
|
||||||
_logger.LogInformation("TryGetCompleteSquadInfo: user {User} in squad {Squad} ({Count} member(s))", userId, squad.SquadId, squad.Members.Count);
|
_logger.LogInformation("TryGetCompleteSquadInfo: user {User} in squad {Squad} ({Count} member(s))", userId, squad.SquadId, squad.Members.Count);
|
||||||
return Task.FromResult(_squadService.ToClientSquad(squad));
|
return Task.FromResult(_squadService.ToClientSquad(squad));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,11 @@ public class SquadInfo
|
|||||||
|
|
||||||
public class SquadService
|
public class SquadService
|
||||||
{
|
{
|
||||||
|
// Cartes sélectionnables (rows de la DataTable maps du client) : Bright Sands,
|
||||||
|
// Crescent Falls, Tharis Island. Sans ça (liste vide), le client ne « débloque »
|
||||||
|
// que la 1re map et déploie toujours dessus quel que soit le choix.
|
||||||
|
public static readonly string[] AllMapRows = { "Map01", "Map02", "Map03" };
|
||||||
|
|
||||||
private readonly ConcurrentDictionary<string, SquadInfo> _squads = new();
|
private readonly ConcurrentDictionary<string, SquadInfo> _squads = new();
|
||||||
private readonly ConcurrentDictionary<string, string> _userToSquad = new();
|
private readonly ConcurrentDictionary<string, string> _userToSquad = new();
|
||||||
|
|
||||||
@@ -92,7 +97,7 @@ public class SquadService
|
|||||||
selectedMapName = m.SelectedMap,
|
selectedMapName = m.SelectedMap,
|
||||||
isSecretLeader = m.IsLeader,
|
isSecretLeader = m.IsLeader,
|
||||||
},
|
},
|
||||||
mapRowNamesUnlocked = Array.Empty<string>(),
|
mapRowNamesUnlocked = AllMapRows,
|
||||||
}).ToArray(),
|
}).ToArray(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user