namespace Supercell.Laser.Logic.Command.Home { using System; using System.Collections.Generic; using Supercell.Laser.Logic.Home; using Supercell.Laser.Titan.DataStream; public class LogicSetSupportedCreatorCodeCommand : Command { public static HashSet ValidCodes = new HashSet(StringComparer.OrdinalIgnoreCase) { "weizy" }; public string Code; public override void Decode(ByteStream stream) { base.Decode(stream); Code = stream.ReadString(); } public override int Execute(HomeMode homeMode) { if (string.IsNullOrWhiteSpace(Code)) { homeMode.Avatar.SupportedCreator = null; return 0; } string clean = Code.Trim(); if (ValidCodes.Count == 0 || ValidCodes.Contains(clean)) { homeMode.Avatar.SupportedCreator = clean; return 0; } return -1; } public override int GetCommandType() { return 528; } } }