private static void OnIdentityRemoveSuccess(ref IdentityRemoveMsg msg, MyNetworkClient sender)
 {
     Sync.Players.RemoveIdentityInternal(new PlayerId(msg.ClientSteamId, msg.PlayerSerialId), msg.IdentityId);
 }
        public void RemoveIdentity(MyPlayer.PlayerId pid, long identityId)
        {
            var msg = new IdentityRemoveMsg();
            msg.IdentityId = identityId;
            msg.ClientSteamId = pid.SteamId;
            msg.PlayerSerialId = pid.SerialId;

            if (Sync.IsServer)
            {
                RemoveIdentityInternal(pid, identityId);
                Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success);
            }
            else
            {
                Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request);
            }
        }