public static void OnSetFaction(ref MyEventSetFaction msg)
        {
            Log("On set faction for : " + msg.SenderConnection.GetPlayerName() + ", faction: " + MyFactionConstants.GetFactionProperties(msg.Faction).Name);

            // Change only player faction, his ship can't change faction until respawn
            var player = (MyPlayerRemote)msg.SenderConnection.Tag;
            player.Faction = msg.Faction;

            if (IsStory())
            {
                MySession.Static.Player.Faction = msg.Faction;
            }
        }
 public void SendFaction(MyMwcObjectBuilder_FactionEnum faction)
 {
     Log("Set faction: " + MyFactionConstants.GetFactionProperties(faction).Name);
     var factionMsg = new MyEventSetFaction();
     factionMsg.Faction = faction;
     Peers.SendToAll(ref factionMsg, NetDeliveryMethod.ReliableOrdered);
 }