<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>在Linux中运行ygopro</title>
    <link>https://ygobbs2.com/t/%E5%9C%A8linux%E4%B8%AD%E8%BF%90%E8%A1%8Cygopro/224549</link>
    <description>也看到一些网友尝试在Linux上运行ygopro,但在不同Linux发行版上编译ygopro或多或少会遇到问题,不过在Debian上可以稳定使用,于是想着把编译环境、过程都打包好,以Docker方式运行,这样不同的Linux发行版也能用。虽然Linux用户不多,还是发出来和大家分享下。

Linux上ygopro已知问题:
1、无法输入中文,是游戏引擎问题,编辑卡组时只有用文本编辑器打开.ydk文件,直接在文件里改卡密,为此我还专门开发了一个查卡器,查了卡密后复制进去。。 :joy::https://github.com/1u4nx/yugioh_card_query

现在把Docker环境发布在了Github上:https://github.com/1u4nx/ygopro-for-docker

# 使用方法

大部分都写在Github上了,这里简单说下:

1、系统需要安装Docker、Docker-Compose

2、要在Docker中运行图形化界面程序,需要和宿主机共享X11,要安装x11-xserver-utils

3、禁卡表、卡片数据库等这些为了方便更新,我没打包在容器里,而是需要单独拷贝过来,因此可以从其他地方安装的ygopro中拷贝出cards.cdb(卡片数据库)、lflist.conf(禁卡表)、pics(卡图)、script(脚本)

4、宿主机上执行:xhost +

5、启动游戏:docker-compose up

![2021-02-24 14-29-04屏幕截图|700x295](upload://e2YhR7m2Ms3C2gLsomZBqYkYKwk.png)</description>
    <language>zh-CN</language>
    <lastBuildDate>Fri, 25 Feb 2022 06:33:38 +0000</lastBuildDate>
    <category>日常交流</category>
    <atom:link href="https://ygobbs2.com/t/%E5%9C%A8linux%E4%B8%AD%E8%BF%90%E8%A1%8Cygopro/224549.rss" rel="self" type="application/rss+xml" />
      <item>
        <title>在Linux中运行ygopro</title>
        <dc:creator><![CDATA[kikyoulzg1]]></dc:creator>
        <description><![CDATA[
            <p>能帮忙看看是什么问题吗<br>
<aside class="onebox githubissue">
  <header class="source">
      <a href="https://github.com/lu4nx/yugioh_card_query/issues/1" target="_blank" rel="noopener nofollow ugc">github.com/lu4nx/yugioh_card_query</a>
  </header>
  <article class="onebox-body">
    <div class="github-row">
  <div class="github-icon-container" title="Issue">
	  <svg width="60" height="60" class="github-icon" viewBox="0 0 14 16" aria-hidden="true"><path d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg>
  </div>

  <div class="github-info-container">
    <h4>
      <a href="https://github.com/lu4nx/yugioh_card_query/issues/1" target="_blank" rel="noopener nofollow ugc">linux下终端运行报错</a>
    </h4>

    <div class="github-info">
      <div class="date">
        opened <span class="discourse-local-date" data-format="ll" data-date="2022-02-25" data-time="06:32:41" data-timezone="UTC">06:32AM - 25 Feb 22 UTC</span>
      </div>

        <div class="date">
          closed <span class="discourse-local-date" data-format="ll" data-date="2022-03-11" data-time="02:37:17" data-timezone="UTC">02:37AM - 11 Mar 22 UTC</span>
        </div>

      <div class="user">
        <a href="https://github.com/kikyoulzg" target="_blank" rel="noopener nofollow ugc">
          <img alt="kikyoulzg" src="https://avatars.githubusercontent.com/u/30227052?v=4" class="onebox-avatar-inline" width="20" height="20">
          kikyoulzg
        </a>
      </div>
    </div>
  </div>
</div>

<div class="github-row">
  <p class="github-content">环境:
deepin20.4, python 3.7.3, pyqt 5.15.4
报错内容:
Traceback (most recent call last):
File "/usr/bin/yugioh_card_query", line 10, in 
from PyQt5 import QtCore
ImportError: /home/kikyoulzg/.local/lib/python3.7/site-packages/PyQt5/QtCore.abi3.so: symbol _ZdlPvm version...</p>
</div>

<div class="labels">
</div>

  </article>
  <div class="onebox-metadata">
    
    
  </div>
  <div style="clear: both"></div>
</aside>
</p>
          <p><a href="https://ygobbs2.com/t/%E5%9C%A8linux%E4%B8%AD%E8%BF%90%E8%A1%8Cygopro/224549/4">阅读整个主题</a></p>
        ]]></description>
        <link>https://ygobbs2.com/t/%E5%9C%A8linux%E4%B8%AD%E8%BF%90%E8%A1%8Cygopro/224549/4</link>
        <pubDate>Fri, 25 Feb 2022 06:33:38 +0000</pubDate>
        <guid isPermaLink="false">ygobbs2.com-post-224549-4</guid>
        <source url="https://ygobbs2.com/t/%E5%9C%A8linux%E4%B8%AD%E8%BF%90%E8%A1%8Cygopro/224549.rss">在Linux中运行ygopro</source>
      </item>
      <item>
        <title>在Linux中运行ygopro</title>
        <dc:creator><![CDATA[Nanahira]]></dc:creator>
        <description><![CDATA[
            <p>我调了半天似乎没能摆脱cuda运行ygopro的样子。<br>
<aside class="onebox githubblob">
  <header class="source">
      <a href="https://github.com/purerosefallen/ygopro/blob/docker-user/Dockerfile" target="_blank" rel="noopener">github.com</a>
  </header>
  <article class="onebox-body">
    <h4><a href="https://github.com/purerosefallen/ygopro/blob/docker-user/Dockerfile" target="_blank" rel="noopener">purerosefallen/ygopro/blob/docker-user/Dockerfile</a></h4>
<pre><code class="lang-">FROM nvidia/cudagl:10.2-devel-ubuntu18.04
LABEL Author="Nanahira &lt;nanahira@momobako.com&gt;"

RUN rm -rf /etc/apt/sources.list.d/* &amp;&amp; \
	apt update &amp;&amp; \
	env DEBIAN_FRONTEND=noninteractive apt -y install wget tar git autoconf automake build-essential libfreetype6-dev libevent-dev libsqlite3-dev libgl1-mesa-dev libglu-dev liblua5.3-dev libxxf86vm-dev p7zip-full mono-complete &amp;&amp; \
	rm -rf /var/tmp/* /tmp/* /var/lib/apt/lists/*


WORKDIR /usr/src/app
COPY . ./

	# irrlicht
RUN git clone --depth=1 https://code.mycard.moe/mycard/irrlicht irrlicht_linux &amp;&amp; \
	# irrklang
	#wget -O irrKlang.zip https://www.ambiera.at/downloads/irrKlang-64bit-1.6.0.zip &amp;&amp; \
	#7z x -y irrKlang.zip &amp;&amp; \
	#mv irrKlang-64bit-1.6.0 irrklang &amp;&amp; \
	#cp -rf irrklang/bin/linux-gcc-64/libIrrKlang.so . &amp;&amp; \
	# premake
</code></pre>

  This file has been truncated. <a href="https://github.com/purerosefallen/ygopro/blob/docker-user/Dockerfile" target="_blank" rel="noopener">show original</a>

  </article>
  <div class="onebox-metadata">
    
    
  </div>
  <div style="clear: both"></div>
</aside>
</p>
<p>这是我打包的镜像。FROM nvidia/cudagl:10.2-devel-ubuntu18.04 做的。这个镜像需要安装nvidia驱动,cuda,还有nvidia-container-runtime才能运行。我不知道怎么摆脱nvidia驱动来运行这东西。如果让用户安装nvidia驱动来安装这东西感觉太肥了。</p>
<pre><code class="lang-auto">version: '2.4'
services:
  ygopro:
    image: ccr.ccs.tencentyun.com/nanahira/ygopro:latest
    devices:
      - /dev/snd
    runtime: nvidia
    environment:
      - DISPLAY=unix$DISPLAY
      #- GDK_SCALE
      #- GDK_DPI_SCALE
    volumes:
      - /tmp/.X11-unix:/tmp/.X11-unix
      - /home/nanahira/ygo/ygopro-222DIY-cards/expansions:/usr/src/app/expansions:ro
      - ./system_user.conf:/usr/src/app/system_user.conf
      - ./deck:/usr/src/app/deck
      - ./replay:/usr/src/app/replay
      - ./screenshots:/usr/src/app/screenshots
</code></pre>
<p>我用的 docker-compose 文件是这样的。我不知道有什么坑在里面。</p>
<p>另外 irrklang 感觉我也没调好的样子。无论如何要么少库要么怎么样的没办法播放出声音。我感觉可能需要调一下 pulseaudio。</p>
<p>希望大大指点一下。</p>
          <p><a href="https://ygobbs2.com/t/%E5%9C%A8linux%E4%B8%AD%E8%BF%90%E8%A1%8Cygopro/224549/3">阅读整个主题</a></p>
        ]]></description>
        <link>https://ygobbs2.com/t/%E5%9C%A8linux%E4%B8%AD%E8%BF%90%E8%A1%8Cygopro/224549/3</link>
        <pubDate>Wed, 24 Feb 2021 12:05:47 +0000</pubDate>
        <guid isPermaLink="false">ygobbs2.com-post-224549-3</guid>
        <source url="https://ygobbs2.com/t/%E5%9C%A8linux%E4%B8%AD%E8%BF%90%E8%A1%8Cygopro/224549.rss">在Linux中运行ygopro</source>
      </item>
      <item>
        <title>在Linux中运行ygopro</title>
        <dc:creator><![CDATA[Nanahira]]></dc:creator>
        <description><![CDATA[
            <p>您好,docker ygopro方案我也是想过的。<br>
我这里之前制作过一个镜像,是支持nvidia cuda显卡加速的。您是否有兴趣研究研究?<br>
可以的话加下我的QQ 78877,我们私聊详谈。</p>
          <p><a href="https://ygobbs2.com/t/%E5%9C%A8linux%E4%B8%AD%E8%BF%90%E8%A1%8Cygopro/224549/2">阅读整个主题</a></p>
        ]]></description>
        <link>https://ygobbs2.com/t/%E5%9C%A8linux%E4%B8%AD%E8%BF%90%E8%A1%8Cygopro/224549/2</link>
        <pubDate>Wed, 24 Feb 2021 08:31:29 +0000</pubDate>
        <guid isPermaLink="false">ygobbs2.com-post-224549-2</guid>
        <source url="https://ygobbs2.com/t/%E5%9C%A8linux%E4%B8%AD%E8%BF%90%E8%A1%8Cygopro/224549.rss">在Linux中运行ygopro</source>
      </item>
      <item>
        <title>在Linux中运行ygopro</title>
        <dc:creator><![CDATA[lu4nx]]></dc:creator>
        <description><![CDATA[
            <p>也看到一些网友尝试在Linux上运行ygopro,但在不同Linux发行版上编译ygopro或多或少会遇到问题,不过在Debian上可以稳定使用,于是想着把编译环境、过程都打包好,以Docker方式运行,这样不同的Linux发行版也能用。虽然Linux用户不多,还是发出来和大家分享下。</p>
<p>Linux上ygopro已知问题:<br>
1、无法输入中文,是游戏引擎问题,编辑卡组时只有用文本编辑器打开.ydk文件,直接在文件里改卡密,为此我还专门开发了一个查卡器,查了卡密后复制进去。。 <img src="https://ygobbs-poll.moenext.com:444/images/emoji/google_classic/joy.png?v=9" title=":joy:" class="emoji" alt=":joy:">:<a href="https://github.com/1u4nx/yugioh_card_query" rel="noopener nofollow ugc">https://github.com/1u4nx/yugioh_card_query</a></p>
<p>现在把Docker环境发布在了Github上:<a href="https://github.com/1u4nx/ygopro-for-docker" rel="noopener nofollow ugc">https://github.com/1u4nx/ygopro-for-docker</a></p>
<h1>使用方法</h1>
<p>大部分都写在Github上了,这里简单说下:</p>
<p>1、系统需要安装Docker、Docker-Compose</p>
<p>2、要在Docker中运行图形化界面程序,需要和宿主机共享X11,要安装x11-xserver-utils</p>
<p>3、禁卡表、卡片数据库等这些为了方便更新,我没打包在容器里,而是需要单独拷贝过来,因此可以从其他地方安装的ygopro中拷贝出cards.cdb(卡片数据库)、lflist.conf(禁卡表)、pics(卡图)、script(脚本)</p>
<p>4、宿主机上执行:xhost +</p>
<p>5、启动游戏:docker-compose up</p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://cdntx.moecube.com/ygobbs/original/3X/6/2/6274738cf0bc4fd808e1d67799e20578da73bb6c.png" data-download-href="/uploads/short-url/e2YhR7m2Ms3C2gLsomZBqYkYKwk.png?dl=1" title="2021-02-24 14-29-04屏幕截图" rel="noopener nofollow ugc"><img src="https://cdntx.moecube.com/ygobbs/optimized/3X/6/2/6274738cf0bc4fd808e1d67799e20578da73bb6c_2_700x295.png" alt="2021-02-24 14-29-04屏幕截图" data-base62-sha1="e2YhR7m2Ms3C2gLsomZBqYkYKwk" width="700" height="295" srcset="https://cdntx.moecube.com/ygobbs/optimized/3X/6/2/6274738cf0bc4fd808e1d67799e20578da73bb6c_2_700x295.png, https://cdntx.moecube.com/ygobbs/optimized/3X/6/2/6274738cf0bc4fd808e1d67799e20578da73bb6c_2_1050x442.png 1.5x, https://cdntx.moecube.com/ygobbs/optimized/3X/6/2/6274738cf0bc4fd808e1d67799e20578da73bb6c_2_1400x590.png 2x, https://cdntx.moecube.com/ygobbs/original/3X/6/2/6274738cf0bc4fd808e1d67799e20578da73bb6c.png 3x" data-small-upload="https://cdntx.moecube.com/ygobbs/optimized/3X/6/2/6274738cf0bc4fd808e1d67799e20578da73bb6c_2_10x10.png"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use xlink:href="#far-image"></use></svg><span class="filename">2021-02-24 14-29-04屏幕截图</span><span class="informations">1734×732 874 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use xlink:href="#discourse-expand"></use></svg></div></a></div></p>
          <p><a href="https://ygobbs2.com/t/%E5%9C%A8linux%E4%B8%AD%E8%BF%90%E8%A1%8Cygopro/224549/1">阅读整个主题</a></p>
        ]]></description>
        <link>https://ygobbs2.com/t/%E5%9C%A8linux%E4%B8%AD%E8%BF%90%E8%A1%8Cygopro/224549/1</link>
        <pubDate>Wed, 24 Feb 2021 06:30:13 +0000</pubDate>
        <guid isPermaLink="false">ygobbs2.com-post-224549-1</guid>
        <source url="https://ygobbs2.com/t/%E5%9C%A8linux%E4%B8%AD%E8%BF%90%E8%A1%8Cygopro/224549.rss">在Linux中运行ygopro</source>
      </item>
  </channel>
</rss>