server-options.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <!DOCTYPE html>
  2. <html class="writer-html5" lang="en" >
  3. <head>
  4. <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>Server options &mdash; Phaser Editor 2D Help</title>
  7. <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
  8. <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  9. <link rel="stylesheet" href="../_static/css/custom.css" type="text/css" />
  10. <link rel="shortcut icon" href="../_static/icon.png"/>
  11. <!--[if lt IE 9]>
  12. <script src="../_static/js/html5shiv.min.js"></script>
  13. <![endif]-->
  14. <script src="../_static/jquery.js?v=5d32c60e"></script>
  15. <script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
  16. <script src="../_static/documentation_options.js?v=a1f35292"></script>
  17. <script src="../_static/doctools.js?v=888ff710"></script>
  18. <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
  19. <script src="../_static/js/theme.js"></script>
  20. <link rel="index" title="Index" href="../genindex.html" />
  21. <link rel="search" title="Search" href="../search.html" />
  22. <link rel="next" title="Resources caching" href="resources-caching.html" />
  23. <link rel="prev" title="Project configuration" href="project-config.html" />
  24. </head>
  25. <body class="wy-body-for-nav">
  26. <div class="wy-grid-for-nav">
  27. <nav data-toggle="wy-nav-shift" class="wy-nav-side">
  28. <div class="wy-side-scroll">
  29. <div class="wy-side-nav-search" style="background: #343131" >
  30. <a href="../index.html" class="icon icon-home">
  31. Phaser Editor 2D
  32. <img src="../_static/logo.png" class="logo" alt="Logo"/>
  33. </a>
  34. <div class="version">
  35. v3.67.0
  36. </div>
  37. <div role="search">
  38. <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
  39. <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
  40. <input type="hidden" name="check_keywords" value="yes" />
  41. <input type="hidden" name="area" value="default" />
  42. </form>
  43. </div>
  44. </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
  45. <ul class="current">
  46. <li class="toctree-l1"><a class="reference internal" href="../intro/index.html">Introduction</a></li>
  47. <li class="toctree-l1"><a class="reference internal" href="../first-steps/index.html">First steps</a></li>
  48. <li class="toctree-l1"><a class="reference internal" href="../workbench/index.html">Workbench</a></li>
  49. <li class="toctree-l1"><a class="reference internal" href="../asset-pack-editor/index.html">Asset Pack Editor</a></li>
  50. <li class="toctree-l1"><a class="reference internal" href="../scene-editor/index.html">Scene Editor</a></li>
  51. <li class="toctree-l1"><a class="reference internal" href="../code-editor/index.html">Code Editor</a></li>
  52. <li class="toctree-l1"><a class="reference internal" href="../animations-editor/index.html">Animations Editor</a></li>
  53. <li class="toctree-l1"><a class="reference internal" href="../atlas-editor/index.html">Atlas Editor</a></li>
  54. <li class="toctree-l1 current"><a class="reference internal" href="index.html">Miscellaneous</a><ul class="current">
  55. <li class="toctree-l2"><a class="reference internal" href="project-config.html">Project configuration</a></li>
  56. <li class="toctree-l2 current"><a class="current reference internal" href="#">Server options</a><ul>
  57. <li class="toctree-l3"><a class="reference internal" href="#getting-the-options-from-a-file">Getting the options from a file</a></li>
  58. </ul>
  59. </li>
  60. <li class="toctree-l2"><a class="reference internal" href="resources-caching.html">Resources caching</a></li>
  61. <li class="toctree-l2"><a class="reference internal" href="resources-filtering.html">Resources filtering</a></li>
  62. <li class="toctree-l2"><a class="reference internal" href="local-preferences.html">Local preferences</a></li>
  63. <li class="toctree-l2"><a class="reference internal" href="content-viewers.html">Content viewers</a></li>
  64. <li class="toctree-l2"><a class="reference internal" href="update.html">Updating the editor</a></li>
  65. <li class="toctree-l2"><a class="reference internal" href="plugins.html">Plugins</a></li>
  66. </ul>
  67. </li>
  68. <li class="toctree-l1"><a class="reference internal" href="../pricing/index.html">License and pricing</a></li>
  69. </ul>
  70. </div>
  71. </div>
  72. </nav>
  73. <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" style="background: #343131" >
  74. <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
  75. <a href="../index.html">Phaser Editor 2D</a>
  76. </nav>
  77. <div class="wy-nav-content">
  78. <div class="rst-content">
  79. <div role="navigation" aria-label="Page navigation">
  80. <ul class="wy-breadcrumbs">
  81. <li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
  82. <li class="breadcrumb-item"><a href="index.html">Miscellaneous</a></li>
  83. <li class="breadcrumb-item active">Server options</li>
  84. <li class="wy-breadcrumbs-aside">
  85. </li>
  86. </ul>
  87. <hr/>
  88. </div>
  89. <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
  90. <div itemprop="articleBody">
  91. <section id="server-options">
  92. <h1>Server options<a class="headerlink" href="#server-options" title="Link to this heading"></a></h1>
  93. <p>To get the full list of options of the <a class="reference external" href="https://phasereditor2d.com">Phaser Editor 2D</a> server you can use the <code class="docutils literal notranslate"><span class="pre">--help</span></code> option. Here we explain them in detail.</p>
  94. <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>PhaserEditor2D<span class="w"> </span>--help
  95. </pre></div>
  96. </div>
  97. <p>Following,</p>
  98. <p><strong>-public</strong></p>
  99. <p>By default, the editor starts as a local application. It allows you to execute third-party tools like <a class="reference external" href="https://code.visualstudio.com">Visual Studio Code</a> or the File Manager and opens the default web browser automatically at the startup.</p>
  100. <p>However, you may want to execute the server in a remote machine. To do this, you have to use the <code class="docutils literal notranslate"><span class="pre">-public</span></code> option. when it is set, the server allows remote connections and disables all the integration with the remote host applications.</p>
  101. <p><strong>-disable-gzip</strong></p>
  102. <p>By default, the server gzip compresses the files sent over the network. It requires an extra usage of the CPU, so you may disable it if you want to use less CPU in the server machine.</p>
  103. <p><strong>-disable-open-browser</strong></p>
  104. <p>If you don’t want to open the default browser at the server startup. Not needed if you run the server with the <code class="docutils literal notranslate"><span class="pre">-public</span></code> option.</p>
  105. <p><strong>-browser-command</strong></p>
  106. <p>When the server starts it opens the default browser of the OS. If you want it to launch a different browser, you can use the <strong>-browser-command</strong> option:</p>
  107. <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>PhaserEditor2D<span class="w"> </span>-browser-command<span class="w"> </span><span class="s2">&quot;/path/to/firefox </span><span class="nv">$URL</span><span class="s2">&quot;</span>
  108. </pre></div>
  109. </div>
  110. <p>In the above command, the server will start firefox. Note the <code class="docutils literal notranslate"><span class="pre">$URL</span></code> variable is replaced by the URL of the editor.</p>
  111. <p>We recommend using Google Chrome. It has an application mode that runs the editor similar to a desktop application. Try running the editor like this:</p>
  112. <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>PhaserEditor2D<span class="w"> </span>-browser-command<span class="w"> </span><span class="s1">&#39;/path/to/google-chrome &quot;--app=$URL&quot;&#39;</span>
  113. </pre></div>
  114. </div>
  115. <p><strong>-external-editor-command</strong></p>
  116. <p>When the server runs in application mode, the IDE allows launching an external editor. By default, it is configured to run <a class="reference external" href="https://code.visualstudio.com">Visual Studio Code</a> (the <code class="docutils literal notranslate"><span class="pre">code</span></code> command).</p>
  117. <p>However, you can change the command to launch a different external editor. For example, if instead of <a class="reference external" href="https://code.visualstudio.com">Visual Studio Code</a> you want to launch the Atom editor, you can run the server with these options:</p>
  118. <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>PhaserEditor2D<span class="w"> </span>-external-editor-command<span class="w"> </span><span class="s1">&#39;/path/to/atom &quot;$LOC&quot;&#39;</span><span class="w"> </span>-external-editor-name<span class="w"> </span>Atom
  119. </pre></div>
  120. </div>
  121. <p>Note the <code class="docutils literal notranslate"><span class="pre">$LOC</span></code> variable will be expanded to the location of the project.</p>
  122. <p><strong>-external-editor-name</strong></p>
  123. <p>The display name of the external editor. Used in the UI. By default it is <strong>Visual Studio Code</strong>.</p>
  124. <p><strong>-editor string</strong></p>
  125. <p>In the installation folder of <a class="reference external" href="https://phasereditor2d.com">Phaser Editor 2D</a> there is the <code class="docutils literal notranslate"><span class="pre">editor</span></code> folder. It contains the code of the IDE. If you want to load other implementation of the IDE, you can use the <code class="docutils literal notranslate"><span class="pre">-editor</span> <span class="pre">/other/editor/implementation</span></code> option. This is useful for testing or developing a different version of the IDE.</p>
  126. <p><strong>-lickey string</strong></p>
  127. <p>Use this option to unlock the editor: <code class="docutils literal notranslate"><span class="pre">-lickey</span> <span class="pre">&lt;valid-lic-key&gt;</span></code>.</p>
  128. <p><strong>-port int</strong></p>
  129. <p>By default, the server uses the <code class="docutils literal notranslate"><span class="pre">1959</span></code> port for HTTP networking. You can use this option to change it.</p>
  130. <p><strong>-project string</strong></p>
  131. <p>This is a mandatory flag. Use it for setting the project path:</p>
  132. <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>PhaserEditor2D<span class="w"> </span>-project<span class="w"> </span>/path/to/project
  133. </pre></div>
  134. </div>
  135. <section id="getting-the-options-from-a-file">
  136. <h2>Getting the options from a file<a class="headerlink" href="#getting-the-options-from-a-file" title="Link to this heading"></a></h2>
  137. <p>You may run the editor always with the same options, and it could be a waste of time typing each option every time.</p>
  138. <p>If it is the case, you can create a script (a batch) to run the editor with the desired options. Or, you can change the <code class="docutils literal notranslate"><span class="pre">flags.txt</span></code> file in the root of the editor installation.</p>
  139. <p>When the editor starts, it reads the <code class="docutils literal notranslate"><span class="pre">flags.txt</span></code> file and reads the options provided there. It is a way to configure the editor.</p>
  140. <p>The format of the <code class="docutils literal notranslate"><span class="pre">flags.txt</span></code> file is simple. Each line contains an argument. For example, if you always want to run the server like this:</p>
  141. <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>PhaserEditor2D<span class="w"> </span>-public<span class="w"> </span>-port<span class="w"> </span><span class="m">80</span><span class="w"> </span>-project<span class="w"> </span>/path/to/project
  142. </pre></div>
  143. </div>
  144. <p>You can write this content in the <code class="docutils literal notranslate"><span class="pre">flags.txt</span></code> file:</p>
  145. <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>-public
  146. -port
  147. <span class="m">80</span>
  148. </pre></div>
  149. </div>
  150. <p>Also, you can write blank lines and comments. Comments are lines that start with the <code class="docutils literal notranslate"><span class="pre">#</span></code> character:</p>
  151. <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>-public
  152. <span class="c1"># -port</span>
  153. <span class="c1"># 80</span>
  154. </pre></div>
  155. </div>
  156. <p>If you have Google Chrome installed, let’s say, in a Windows machine, you can write these lines in the file:</p>
  157. <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>-browser-command
  158. <span class="s2">&quot;C:\Program Files\Google\Chrome\Application\chrome.exe&quot;</span><span class="w"> </span><span class="s2">&quot;--app=</span><span class="nv">$URL</span><span class="s2">&quot;</span>
  159. </pre></div>
  160. </div>
  161. <p>It will open the editor in an instance of the Google Chrome browser but in application mode.</p>
  162. </section>
  163. </section>
  164. </div>
  165. </div>
  166. <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
  167. <a href="project-config.html" class="btn btn-neutral float-left" title="Project configuration" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
  168. <a href="resources-caching.html" class="btn btn-neutral float-right" title="Resources caching" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
  169. </div>
  170. <hr/>
  171. <div role="contentinfo">
  172. <p>&#169; Copyright 2016-2024, Arian Fornaris.</p>
  173. </div>
  174. Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
  175. <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
  176. provided by <a href="https://readthedocs.org">Read the Docs</a>.
  177. </footer>
  178. </div>
  179. </div>
  180. </section>
  181. </div>
  182. <script>
  183. jQuery(function () {
  184. SphinxRtdTheme.Navigation.enable(true);
  185. });
  186. </script>
  187. <!-- Theme Analytics -->
  188. <script async src="https://www.googletagmanager.com/gtag/js?id=UA-67206336-2"></script>
  189. <script>
  190. window.dataLayer = window.dataLayer || [];
  191. function gtag(){dataLayer.push(arguments);}
  192. gtag('js', new Date());
  193. gtag('config', 'UA-67206336-2', {
  194. 'anonymize_ip': false,
  195. });
  196. </script>
  197. </body>
  198. </html>