-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
138 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
关于 xresloader | ||
=============================================== | ||
|
||
+ 工具集Github仓库地址: https://github.com/xresloader | ||
+ 作者: `owent <https://owent.net>` | ||
|
||
|
||
联系作者请发邮件到 admin@owent.net 或 owt5008137@live.com 。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,68 @@ | ||
FAQ | ||
=============== | ||
|
||
哪里有完整的示例? | ||
------------------------------------------------------------------------------------------------------- | ||
|
||
转表功能和二进制数据读取的示例见: https://github.com/xresloader/xresloader/tree/master/sample | ||
|
||
文本和Msgpack数据读取示例见: https://github.com/xresloader/xresloader/tree/master/loader-binding | ||
|
||
批量转表配置的示例见: https://github.com/xresloader/xresconv-conf | ||
|
||
为什么会读到很多空数据? | ||
------------------------------------------------------------------------------------------------------- | ||
|
||
Excel里编辑过的单元格即便删除了也会留下不可见的样式配置,这时候会导致转出的数据有空行。可以通过在Excel里删除行解决 | ||
|
||
|
||
为什么Excel里填的时间,但是转出来是一个负数? | ||
------------------------------------------------------------------------------------------------------- | ||
|
||
Excel里的日期时间类型转成协议里整数时会转为Unix时间戳,但是Excel的时间是以1900年1月0号为基准的,这意味着如果时间格式是 ``hh:mm:ss`` 的话,``49:30:01`` 会被转为 ``1900-1-2 1:31:01`` 。 | ||
时间戳因为是相对于 ``1970-01-01 00:00:00`` 的秒数,所以会是一个绝对值很大的负数。 | ||
|
||
|
||
Windows下控制台里执行执行会报文件编码错误?(java.nio.charset.UnsupportedCharsetException: cp65001) | ||
------------------------------------------------------------------------------------------------------- | ||
|
||
这个问题涉及的几个Exception是: | ||
|
||
.. code-block:: bash | ||
ERROR StatusLogger Unable to inject fields into builder class for plugin type class org.apache.logging.log4j.core.appender.ConsoleAppender, element Console. | ||
java.nio.charset.UnsupportedCharsetException: cp65001 | ||
at java.nio.charset.Charset.forName(Unknown Source) | ||
at org.apache.logging.log4j.util.PropertiesUtil.getCharsetProperty(PropertiesUtil.java:146) | ||
at org.apache.logging.log4j.util.PropertiesUtil.getCharsetProperty(PropertiesUtil.java:134) | ||
at org.apache.logging.log4j.core.appender.ConsoleAppender$Target.getCharset(ConsoleAppender.java:85) | ||
at org.apache.logging.log4j.core.appender.ConsoleAppender$Target$1.getDefaultCharset(ConsoleAppender.java:71) | ||
at org.apache.logging.log4j.core.appender.ConsoleAppender$Builder.build(ConsoleAppender.java:218) | ||
at org.apache.logging.log4j.core.appender.ConsoleAppender$Builder.build(ConsoleAppender.java:185) | ||
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122) | ||
... | ||
和 | ||
|
||
.. code-block:: bash | ||
ERROR StatusLogger Unable to invoke factory method in class class org.apache.logging.log4j.core.appender.ConsoleAppender for element Console. | ||
java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.ConsoleAppender | ||
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.findFactoryMethod(PluginBuilder.java:224) | ||
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:130) | ||
at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:952) | ||
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:892) | ||
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:884) | ||
at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:508) | ||
at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:232) | ||
at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:244) | ||
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:545) | ||
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:617) | ||
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:634) | ||
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:229) | ||
... | ||
这是因为在Windows控制台中,如果编码是UTF-8,java获取编码时会获取到cp65001,而这个编码java本身是不识别的。这种情况可以按下面的方法解决: | ||
|
||
+ 第一种: 执行xresloader之前先执行 chcp 936,切换到GBK编码 | ||
+ 第二种: 在powershell里执行 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,70 @@ | ||
数据的输出类型和加载方式 | ||
数据的输出类型和数据加载 | ||
============================================= | ||
|
||
所有输出的数据的结构都是按照 https://github.com/xresloader/xresloader/blob/master/header/pb_header_v3.proto 的 ``xresloader_datablocks`` 的结构。 | ||
|
||
转表功能和二进制数据读取的示例见: https://github.com/xresloader/xresloader/tree/master/sample | ||
|
||
文本和Msgpack数据读取示例见: https://github.com/xresloader/xresloader/tree/master/loader-binding | ||
|
||
下面我们对转出数据和加载进一步说明。 | ||
|
||
输出类型 | ||
----------------------------------------------- | ||
|
||
在 :doc:`./xresloader_core` 里可以看到,转表工具可以把Excel数据源导出成多种输出。下面列举重要的几种,项目可以根据自己的情况选择一种或几种导出方式。比如如果做Web端的GM工具,可以使用导出成xml或者javascript代码。 | ||
|
||
.. _export binary: | ||
.. _output-format-export binary: | ||
|
||
导出为协议二进制数据 (推荐) | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
对应 ``-t bin`` 。这是推荐的转出方式,导出的是 ``xresloader_datablocks`` 打包后的二进制数据,文件占用最小。任何支持protobuf的语言和开发环境都可以读取。 | ||
|
||
其中每个 ``data_block`` 数据块都对应Excel里的一行数据,里面的数据格式是用户指定的协议打包成二进制后的数据。 | ||
|
||
.. _output-format-export text: | ||
|
||
Step-5-1(推荐): 导出为协议二进制数据 | ||
导出为json、xml、lua代码等文本数据 (可选) | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
.. _export text: | ||
.. _output-format-export msgpack: | ||
|
||
Step-5-2(可选): 导出为json、xml、lua代码等文本数据 | ||
导出为Msgpack打包的二进制数据 (可选) | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
.. _export enum: | ||
.. _output-format-export enum: | ||
|
||
Step-5-3(可选): 导出枚举类型成代码 | ||
导出枚举类型成代码 (可选) | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
|
||
加载数据 | ||
数据加载 | ||
----------------------------------------------- | ||
|
||
加载数据可以有多种方法,项目可以根据自己的需要选择任意一种或几种合适的加载方法。 | ||
|
||
Step-6-1(推荐): 使用C++加载二进制数据 | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
此加载方式需要上面的 :ref:`export binary` | ||
此加载方式需要上面的 :ref:`output-format-export binary` | ||
|
||
Step-6-2(推荐): 使用lua-pbc加载二进制数据 | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
此加载方式需要上面的 :ref:`export binary` | ||
此加载方式需要上面的 :ref:`output-format-export binary` | ||
|
||
Step-6-3(推荐): 使用C#和DynamicMessage-net加载二进制数据 | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
此加载方式需要上面的 :ref:`export binary` | ||
此加载方式需要上面的 :ref:`output-format-export binary` | ||
|
||
Step-6-4(可选): 使用node.js加载javascript文本数据 | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
此加载方式需要上面的 :ref:`export text` | ||
此加载方式需要上面的 :ref:`output-format-export text` | ||
|
||
Step-6-5(可选): 使用lua加载导出的枚举类型 | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
此加载方式需要上面的 :ref:`export enum` | ||
此加载方式需要上面的 :ref:`output-format-export enum` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters