private void GenerateJoinRequests(PlayerCharacter groupLeader, JArray invites) { if (invites == null) { return; } foreach (string leaderid in invites.Select(y => (string)y).ToArray()) { PlayerCharacter requestedGroupJoinLeader = Entity.GetEntity <Player>(Guid.Parse(leaderid)).Character; Party partyOfRequestedGroupJoinLeader = Game.Zone.Parties.FirstOrDefault(x => x.Leader == requestedGroupJoinLeader); Party ownParty = Game.Zone.Parties.FirstOrDefault(x => x.Leader == groupLeader); partyOfRequestedGroupJoinLeader?.AddJoinRequest(ownParty); } }