public ClientData(MyObjectBuilder_CubeGrid grid, IMyFaction faction, Vector3I controlledBlock) { Grid = grid; ControlledBlock = controlledBlock; if (faction != null) { Faction = new FactionData(faction); } else { Faction = new FactionData(); } }
public static void RecreateFaction(FactionData data, long requester) { if (string.IsNullOrEmpty(data?.Tag)) { return; } IMyFaction current = MyAPIGateway.Session.Factions.TryGetFactionByTag(data.Tag); if (current == null) { MyAPIGateway.Session.Factions.CreateFaction(requester, data.Tag, data.Name, data.Description, data.PrivateInfo); return; } if (current.IsMember(requester)) { return; } MyAPIGateway.Session.Factions.SendJoinRequest(current.FactionId, requester); MyAPIGateway.Session.Factions.AcceptJoin(current.FactionId, requester); }