public PartyNameErrorEnum?SetPartyName(string name) { const string PARTY_NAME_REGEX = @"^[A-z0-9\-\s]{2,24}$"; if (PartyManager.Instance.GetGroup(name) != null) { return(PartyNameErrorEnum.PARTY_NAME_ALREADY_USED); } if (!Regex.IsMatch(name, PARTY_NAME_REGEX)) { return(PartyNameErrorEnum.PARTY_NAME_INVALID); } Name = name; PartyHandler.SendPartyNameUpdateMessage(Clients, this); return(null); }