SharedHumanoidAppearanceSystem.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  1. using System.IO;
  2. using System.Linq;
  3. using System.Numerics;
  4. using Content.Shared.CCVar;
  5. using Content.Shared.Decals;
  6. using Content.Shared.Examine;
  7. using Content.Shared.Humanoid.Markings;
  8. using Content.Shared.Humanoid.Prototypes;
  9. using Content.Shared.IdentityManagement;
  10. using Content.Shared.Inventory;
  11. using Content.Shared.Preferences;
  12. using Robust.Shared;
  13. using Robust.Shared.Configuration;
  14. using Robust.Shared.GameObjects.Components.Localization;
  15. using Robust.Shared.Network;
  16. using Robust.Shared.Player;
  17. using Robust.Shared.Prototypes;
  18. using Robust.Shared.Serialization.Manager;
  19. using Robust.Shared.Serialization.Markdown;
  20. using Robust.Shared.Utility;
  21. using YamlDotNet.RepresentationModel;
  22. namespace Content.Shared.Humanoid;
  23. /// <summary>
  24. /// HumanoidSystem. Primarily deals with the appearance and visual data
  25. /// of a humanoid entity. HumanoidVisualizer is what deals with actually
  26. /// organizing the sprites and setting up the sprite component's layers.
  27. ///
  28. /// This is a shared system, because while it is server authoritative,
  29. /// you still need a local copy so that players can set up their
  30. /// characters.
  31. /// </summary>
  32. public abstract class SharedHumanoidAppearanceSystem : EntitySystem
  33. {
  34. [Dependency] private readonly IConfigurationManager _cfgManager = default!;
  35. [Dependency] private readonly INetManager _netManager = default!;
  36. [Dependency] private readonly IPrototypeManager _proto = default!;
  37. [Dependency] private readonly ISerializationManager _serManager = default!;
  38. [Dependency] private readonly MarkingManager _markingManager = default!;
  39. [ValidatePrototypeId<SpeciesPrototype>]
  40. public const string DefaultSpecies = "Human";
  41. public override void Initialize()
  42. {
  43. base.Initialize();
  44. SubscribeLocalEvent<HumanoidAppearanceComponent, ComponentInit>(OnInit);
  45. SubscribeLocalEvent<HumanoidAppearanceComponent, ExaminedEvent>(OnExamined);
  46. }
  47. public DataNode ToDataNode(HumanoidCharacterProfile profile)
  48. {
  49. var export = new HumanoidProfileExport()
  50. {
  51. ForkId = _cfgManager.GetCVar(CVars.BuildForkId),
  52. Profile = profile,
  53. };
  54. var dataNode = _serManager.WriteValue(export, alwaysWrite: true, notNullableOverride: true);
  55. return dataNode;
  56. }
  57. public HumanoidCharacterProfile FromStream(Stream stream, ICommonSession session)
  58. {
  59. using var reader = new StreamReader(stream, EncodingHelpers.UTF8);
  60. var yamlStream = new YamlStream();
  61. yamlStream.Load(reader);
  62. var root = yamlStream.Documents[0].RootNode;
  63. var export = _serManager.Read<HumanoidProfileExport>(root.ToDataNode(), notNullableOverride: true);
  64. /*
  65. * Add custom handling here for forks / version numbers if you care.
  66. */
  67. var profile = export.Profile;
  68. var collection = IoCManager.Instance;
  69. profile.EnsureValid(session, collection!);
  70. return profile;
  71. }
  72. private void OnInit(EntityUid uid, HumanoidAppearanceComponent humanoid, ComponentInit args)
  73. {
  74. if (string.IsNullOrEmpty(humanoid.Species) || _netManager.IsClient && !IsClientSide(uid))
  75. {
  76. return;
  77. }
  78. if (string.IsNullOrEmpty(humanoid.Initial)
  79. || !_proto.TryIndex(humanoid.Initial, out HumanoidProfilePrototype? startingSet))
  80. {
  81. LoadProfile(uid, HumanoidCharacterProfile.DefaultWithSpecies(humanoid.Species), humanoid);
  82. return;
  83. }
  84. // Do this first, because profiles currently do not support custom base layers
  85. foreach (var (layer, info) in startingSet.CustomBaseLayers)
  86. {
  87. humanoid.CustomBaseLayers.Add(layer, info);
  88. }
  89. LoadProfile(uid, startingSet.Profile, humanoid);
  90. }
  91. private void OnExamined(EntityUid uid, HumanoidAppearanceComponent component, ExaminedEvent args)
  92. {
  93. var identity = Identity.Entity(uid, EntityManager);
  94. var species = GetSpeciesRepresentation(component.Species).ToLower();
  95. var age = GetAgeRepresentation(component.Species, component.Age);
  96. args.PushText(Loc.GetString("humanoid-appearance-component-examine", ("user", identity), ("age", age), ("species", species)));
  97. }
  98. /// <summary>
  99. /// Toggles a humanoid's sprite layer visibility.
  100. /// </summary>
  101. /// <param name="ent">Humanoid entity</param>
  102. /// <param name="layer">Layer to toggle visibility for</param>
  103. /// <param name="visible">Whether to hide or show the layer. If more than once piece of clothing is hiding the layer, it may remain hidden.</param>
  104. /// <param name="source">Equipment slot that has the clothing that is (or was) hiding the layer. If not specified, the change is "permanent" (i.e., see <see cref="HumanoidAppearanceComponent.PermanentlyHidden"/>)</param>
  105. public void SetLayerVisibility(Entity<HumanoidAppearanceComponent?> ent,
  106. HumanoidVisualLayers layer,
  107. bool visible,
  108. SlotFlags? source = null)
  109. {
  110. if (!Resolve(ent.Owner, ref ent.Comp, false))
  111. return;
  112. var dirty = false;
  113. SetLayerVisibility(ent!, layer, visible, source, ref dirty);
  114. if (dirty)
  115. Dirty(ent);
  116. }
  117. /// <summary>
  118. /// Clones a humanoid's appearance to a target mob, provided they both have humanoid components.
  119. /// </summary>
  120. /// <param name="source">Source entity to fetch the original appearance from.</param>
  121. /// <param name="target">Target entity to apply the source entity's appearance to.</param>
  122. /// <param name="sourceHumanoid">Source entity's humanoid component.</param>
  123. /// <param name="targetHumanoid">Target entity's humanoid component.</param>
  124. public void CloneAppearance(EntityUid source, EntityUid target, HumanoidAppearanceComponent? sourceHumanoid = null,
  125. HumanoidAppearanceComponent? targetHumanoid = null)
  126. {
  127. if (!Resolve(source, ref sourceHumanoid) || !Resolve(target, ref targetHumanoid))
  128. return;
  129. targetHumanoid.Species = sourceHumanoid.Species;
  130. targetHumanoid.SkinColor = sourceHumanoid.SkinColor;
  131. targetHumanoid.EyeColor = sourceHumanoid.EyeColor;
  132. targetHumanoid.Age = sourceHumanoid.Age;
  133. SetSex(target, sourceHumanoid.Sex, false, targetHumanoid);
  134. targetHumanoid.CustomBaseLayers = new(sourceHumanoid.CustomBaseLayers);
  135. targetHumanoid.MarkingSet = new(sourceHumanoid.MarkingSet);
  136. targetHumanoid.Gender = sourceHumanoid.Gender;
  137. if (TryComp<GrammarComponent>(target, out var grammar))
  138. grammar.Gender = sourceHumanoid.Gender;
  139. Dirty(target, targetHumanoid);
  140. }
  141. /// <summary>
  142. /// Sets the visibility for multiple layers at once on a humanoid's sprite.
  143. /// </summary>
  144. /// <param name="ent">Humanoid entity</param>
  145. /// <param name="layers">An enumerable of all sprite layers that are going to have their visibility set</param>
  146. /// <param name="visible">The visibility state of the layers given</param>
  147. public void SetLayersVisibility(Entity<HumanoidAppearanceComponent?> ent,
  148. IEnumerable<HumanoidVisualLayers> layers,
  149. bool visible)
  150. {
  151. if (!Resolve(ent.Owner, ref ent.Comp, false))
  152. return;
  153. var dirty = false;
  154. foreach (var layer in layers)
  155. {
  156. SetLayerVisibility(ent!, layer, visible, null, ref dirty);
  157. }
  158. if (dirty)
  159. Dirty(ent);
  160. }
  161. /// <inheritdoc cref="SetLayerVisibility(Entity{HumanoidAppearanceComponent?},HumanoidVisualLayers,bool,Nullable{SlotFlags})"/>
  162. public virtual void SetLayerVisibility(
  163. Entity<HumanoidAppearanceComponent> ent,
  164. HumanoidVisualLayers layer,
  165. bool visible,
  166. SlotFlags? source,
  167. ref bool dirty)
  168. {
  169. #if DEBUG
  170. if (source is {} s)
  171. {
  172. DebugTools.AssertNotEqual(s, SlotFlags.NONE);
  173. // Check that only a single bit in the bitflag is set
  174. var powerOfTwo = BitOperations.RoundUpToPowerOf2((uint)s);
  175. DebugTools.AssertEqual((uint)s, powerOfTwo);
  176. }
  177. #endif
  178. if (visible)
  179. {
  180. if (source is not {} slot)
  181. {
  182. dirty |= ent.Comp.PermanentlyHidden.Remove(layer);
  183. }
  184. else if (ent.Comp.HiddenLayers.TryGetValue(layer, out var oldSlots))
  185. {
  186. // This layer might be getting hidden by more than one piece of equipped clothing.
  187. // remove slot flag from the set of slots hiding this layer, then check if there are any left.
  188. ent.Comp.HiddenLayers[layer] = ~slot & oldSlots;
  189. if (ent.Comp.HiddenLayers[layer] == SlotFlags.NONE)
  190. ent.Comp.HiddenLayers.Remove(layer);
  191. dirty |= (oldSlots & slot) != 0;
  192. }
  193. }
  194. else
  195. {
  196. if (source is not { } slot)
  197. {
  198. dirty |= ent.Comp.PermanentlyHidden.Add(layer);
  199. }
  200. else
  201. {
  202. var oldSlots = ent.Comp.HiddenLayers.GetValueOrDefault(layer);
  203. ent.Comp.HiddenLayers[layer] = slot | oldSlots;
  204. dirty |= (oldSlots & slot) != slot;
  205. }
  206. }
  207. }
  208. /// <summary>
  209. /// Set a humanoid mob's species. This will change their base sprites, as well as their current
  210. /// set of markings to fit against the mob's new species.
  211. /// </summary>
  212. /// <param name="uid">The humanoid mob's UID.</param>
  213. /// <param name="species">The species to set the mob to. Will return if the species prototype was invalid.</param>
  214. /// <param name="sync">Whether to immediately synchronize this to the humanoid mob, or not.</param>
  215. /// <param name="humanoid">Humanoid component of the entity</param>
  216. public void SetSpecies(EntityUid uid, string species, bool sync = true, HumanoidAppearanceComponent? humanoid = null)
  217. {
  218. if (!Resolve(uid, ref humanoid) || !_proto.TryIndex<SpeciesPrototype>(species, out var prototype))
  219. {
  220. return;
  221. }
  222. humanoid.Species = species;
  223. humanoid.MarkingSet.EnsureSpecies(species, humanoid.SkinColor, _markingManager);
  224. var oldMarkings = humanoid.MarkingSet.GetForwardEnumerator().ToList();
  225. humanoid.MarkingSet = new(oldMarkings, prototype.MarkingPoints, _markingManager, _proto);
  226. if (sync)
  227. Dirty(uid, humanoid);
  228. }
  229. /// <summary>
  230. /// Sets the skin color of this humanoid mob. Will only affect base layers that are not custom,
  231. /// custom base layers should use <see cref="SetBaseLayerColor"/> instead.
  232. /// </summary>
  233. /// <param name="uid">The humanoid mob's UID.</param>
  234. /// <param name="skinColor">Skin color to set on the humanoid mob.</param>
  235. /// <param name="sync">Whether to synchronize this to the humanoid mob, or not.</param>
  236. /// <param name="verify">Whether to verify the skin color can be set on this humanoid or not</param>
  237. /// <param name="humanoid">Humanoid component of the entity</param>
  238. public virtual void SetSkinColor(EntityUid uid, Color skinColor, bool sync = true, bool verify = true, HumanoidAppearanceComponent? humanoid = null)
  239. {
  240. if (!Resolve(uid, ref humanoid))
  241. return;
  242. if (!_proto.TryIndex<SpeciesPrototype>(humanoid.Species, out var species))
  243. {
  244. return;
  245. }
  246. if (verify && !SkinColor.VerifySkinColor(species.SkinColoration, skinColor))
  247. {
  248. skinColor = SkinColor.ValidSkinTone(species.SkinColoration, skinColor);
  249. }
  250. humanoid.SkinColor = skinColor;
  251. if (sync)
  252. Dirty(uid, humanoid);
  253. }
  254. /// <summary>
  255. /// Sets the base layer ID of this humanoid mob. A humanoid mob's 'base layer' is
  256. /// the skin sprite that is applied to the mob's sprite upon appearance refresh.
  257. /// </summary>
  258. /// <param name="uid">The humanoid mob's UID.</param>
  259. /// <param name="layer">The layer to target on this humanoid mob.</param>
  260. /// <param name="id">The ID of the sprite to use. See <see cref="HumanoidSpeciesSpriteLayer"/>.</param>
  261. /// <param name="sync">Whether to synchronize this to the humanoid mob, or not.</param>
  262. /// <param name="humanoid">Humanoid component of the entity</param>
  263. public void SetBaseLayerId(EntityUid uid, HumanoidVisualLayers layer, string? id, bool sync = true,
  264. HumanoidAppearanceComponent? humanoid = null)
  265. {
  266. if (!Resolve(uid, ref humanoid))
  267. return;
  268. if (humanoid.CustomBaseLayers.TryGetValue(layer, out var info))
  269. humanoid.CustomBaseLayers[layer] = info with { Id = id };
  270. else
  271. humanoid.CustomBaseLayers[layer] = new(id);
  272. if (sync)
  273. Dirty(uid, humanoid);
  274. }
  275. /// <summary>
  276. /// Sets the color of this humanoid mob's base layer. See <see cref="SetBaseLayerId"/> for a
  277. /// description of how base layers work.
  278. /// </summary>
  279. /// <param name="uid">The humanoid mob's UID.</param>
  280. /// <param name="layer">The layer to target on this humanoid mob.</param>
  281. /// <param name="color">The color to set this base layer to.</param>
  282. public void SetBaseLayerColor(EntityUid uid, HumanoidVisualLayers layer, Color? color, bool sync = true, HumanoidAppearanceComponent? humanoid = null)
  283. {
  284. if (!Resolve(uid, ref humanoid))
  285. return;
  286. if (humanoid.CustomBaseLayers.TryGetValue(layer, out var info))
  287. humanoid.CustomBaseLayers[layer] = info with { Color = color };
  288. else
  289. humanoid.CustomBaseLayers[layer] = new(null, color);
  290. if (sync)
  291. Dirty(uid, humanoid);
  292. }
  293. /// <summary>
  294. /// Set a humanoid mob's sex. This will not change their gender.
  295. /// </summary>
  296. /// <param name="uid">The humanoid mob's UID.</param>
  297. /// <param name="sex">The sex to set the mob to.</param>
  298. /// <param name="sync">Whether to immediately synchronize this to the humanoid mob, or not.</param>
  299. /// <param name="humanoid">Humanoid component of the entity</param>
  300. public void SetSex(EntityUid uid, Sex sex, bool sync = true, HumanoidAppearanceComponent? humanoid = null)
  301. {
  302. if (!Resolve(uid, ref humanoid) || humanoid.Sex == sex)
  303. return;
  304. var oldSex = humanoid.Sex;
  305. humanoid.Sex = sex;
  306. humanoid.MarkingSet.EnsureSexes(sex, _markingManager);
  307. RaiseLocalEvent(uid, new SexChangedEvent(oldSex, sex));
  308. if (sync)
  309. {
  310. Dirty(uid, humanoid);
  311. }
  312. }
  313. /// <summary>
  314. /// Loads a humanoid character profile directly onto this humanoid mob.
  315. /// </summary>
  316. /// <param name="uid">The mob's entity UID.</param>
  317. /// <param name="profile">The character profile to load.</param>
  318. /// <param name="humanoid">Humanoid component of the entity</param>
  319. public virtual void LoadProfile(EntityUid uid, HumanoidCharacterProfile? profile, HumanoidAppearanceComponent? humanoid = null)
  320. {
  321. if (profile == null)
  322. return;
  323. if (!Resolve(uid, ref humanoid))
  324. {
  325. return;
  326. }
  327. SetSpecies(uid, profile.Species, false, humanoid);
  328. SetSex(uid, profile.Sex, false, humanoid);
  329. humanoid.EyeColor = profile.Appearance.EyeColor;
  330. SetSkinColor(uid, profile.Appearance.SkinColor, false);
  331. humanoid.MarkingSet.Clear();
  332. // Add markings that doesn't need coloring. We store them until we add all other markings that doesn't need it.
  333. var markingFColored = new Dictionary<Marking, MarkingPrototype>();
  334. foreach (var marking in profile.Appearance.Markings)
  335. {
  336. if (_markingManager.TryGetMarking(marking, out var prototype))
  337. {
  338. if (!prototype.ForcedColoring)
  339. {
  340. AddMarking(uid, marking.MarkingId, marking.MarkingColors, false);
  341. }
  342. else
  343. {
  344. markingFColored.Add(marking, prototype);
  345. }
  346. }
  347. }
  348. // Hair/facial hair - this may eventually be deprecated.
  349. // We need to ensure hair before applying it or coloring can try depend on markings that can be invalid
  350. var hairColor = _markingManager.MustMatchSkin(profile.Species, HumanoidVisualLayers.Hair, out var hairAlpha, _proto)
  351. ? profile.Appearance.SkinColor.WithAlpha(hairAlpha) : profile.Appearance.HairColor;
  352. var facialHairColor = _markingManager.MustMatchSkin(profile.Species, HumanoidVisualLayers.FacialHair, out var facialHairAlpha, _proto)
  353. ? profile.Appearance.SkinColor.WithAlpha(facialHairAlpha) : profile.Appearance.FacialHairColor;
  354. if (_markingManager.Markings.TryGetValue(profile.Appearance.HairStyleId, out var hairPrototype) &&
  355. _markingManager.CanBeApplied(profile.Species, profile.Sex, hairPrototype, _proto))
  356. {
  357. AddMarking(uid, profile.Appearance.HairStyleId, hairColor, false);
  358. }
  359. if (_markingManager.Markings.TryGetValue(profile.Appearance.FacialHairStyleId, out var facialHairPrototype) &&
  360. _markingManager.CanBeApplied(profile.Species, profile.Sex, facialHairPrototype, _proto))
  361. {
  362. AddMarking(uid, profile.Appearance.FacialHairStyleId, facialHairColor, false);
  363. }
  364. humanoid.MarkingSet.EnsureSpecies(profile.Species, profile.Appearance.SkinColor, _markingManager, _proto);
  365. // Finally adding marking with forced colors
  366. foreach (var (marking, prototype) in markingFColored)
  367. {
  368. var markingColors = MarkingColoring.GetMarkingLayerColors(
  369. prototype,
  370. profile.Appearance.SkinColor,
  371. profile.Appearance.EyeColor,
  372. humanoid.MarkingSet
  373. );
  374. AddMarking(uid, marking.MarkingId, markingColors, false);
  375. }
  376. EnsureDefaultMarkings(uid, humanoid);
  377. humanoid.Gender = profile.Gender;
  378. if (TryComp<GrammarComponent>(uid, out var grammar))
  379. {
  380. grammar.Gender = profile.Gender;
  381. }
  382. humanoid.Age = profile.Age;
  383. Dirty(uid, humanoid);
  384. }
  385. /// <summary>
  386. /// Adds a marking to this humanoid.
  387. /// </summary>
  388. /// <param name="uid">Humanoid mob's UID</param>
  389. /// <param name="marking">Marking ID to use</param>
  390. /// <param name="color">Color to apply to all marking layers of this marking</param>
  391. /// <param name="sync">Whether to immediately sync this marking or not</param>
  392. /// <param name="forced">If this marking was forced (ignores marking points)</param>
  393. /// <param name="humanoid">Humanoid component of the entity</param>
  394. public void AddMarking(EntityUid uid, string marking, Color? color = null, bool sync = true, bool forced = false, HumanoidAppearanceComponent? humanoid = null)
  395. {
  396. if (!Resolve(uid, ref humanoid)
  397. || !_markingManager.Markings.TryGetValue(marking, out var prototype))
  398. {
  399. return;
  400. }
  401. var markingObject = prototype.AsMarking();
  402. markingObject.Forced = forced;
  403. if (color != null)
  404. {
  405. for (var i = 0; i < prototype.Sprites.Count; i++)
  406. {
  407. markingObject.SetColor(i, color.Value);
  408. }
  409. }
  410. humanoid.MarkingSet.AddBack(prototype.MarkingCategory, markingObject);
  411. if (sync)
  412. Dirty(uid, humanoid);
  413. }
  414. private void EnsureDefaultMarkings(EntityUid uid, HumanoidAppearanceComponent? humanoid)
  415. {
  416. if (!Resolve(uid, ref humanoid))
  417. {
  418. return;
  419. }
  420. humanoid.MarkingSet.EnsureDefault(humanoid.SkinColor, humanoid.EyeColor, _markingManager);
  421. }
  422. /// <summary>
  423. ///
  424. /// </summary>
  425. /// <param name="uid">Humanoid mob's UID</param>
  426. /// <param name="marking">Marking ID to use</param>
  427. /// <param name="colors">Colors to apply against this marking's set of sprites.</param>
  428. /// <param name="sync">Whether to immediately sync this marking or not</param>
  429. /// <param name="forced">If this marking was forced (ignores marking points)</param>
  430. /// <param name="humanoid">Humanoid component of the entity</param>
  431. public void AddMarking(EntityUid uid, string marking, IReadOnlyList<Color> colors, bool sync = true, bool forced = false, HumanoidAppearanceComponent? humanoid = null)
  432. {
  433. if (!Resolve(uid, ref humanoid)
  434. || !_markingManager.Markings.TryGetValue(marking, out var prototype))
  435. {
  436. return;
  437. }
  438. var markingObject = new Marking(marking, colors);
  439. markingObject.Forced = forced;
  440. humanoid.MarkingSet.AddBack(prototype.MarkingCategory, markingObject);
  441. if (sync)
  442. Dirty(uid, humanoid);
  443. }
  444. /// <summary>
  445. /// Takes ID of the species prototype, returns UI-friendly name of the species.
  446. /// </summary>
  447. public string GetSpeciesRepresentation(string speciesId)
  448. {
  449. if (_proto.TryIndex<SpeciesPrototype>(speciesId, out var species))
  450. {
  451. return Loc.GetString(species.Name);
  452. }
  453. Log.Error("Tried to get representation of unknown species: {speciesId}");
  454. return Loc.GetString("humanoid-appearance-component-unknown-species");
  455. }
  456. public string GetAgeRepresentation(string species, int age)
  457. {
  458. if (!_proto.TryIndex<SpeciesPrototype>(species, out var speciesPrototype))
  459. {
  460. Log.Error("Tried to get age representation of species that couldn't be indexed: " + species);
  461. return Loc.GetString("identity-age-young");
  462. }
  463. if (age < speciesPrototype.YoungAge)
  464. {
  465. return Loc.GetString("identity-age-young");
  466. }
  467. if (age < speciesPrototype.OldAge)
  468. {
  469. return Loc.GetString("identity-age-middle-aged");
  470. }
  471. return Loc.GetString("identity-age-old");
  472. }
  473. }