Giter Club home page Giter Club logo

Comments (11)

pansz avatar pansz commented on July 24, 2024

这个可以有。
预先给我多留个。因为这里的 -server 可能是房间服务器或者大厅服务器。
我目前在整大厅服务器,所以看来是要多加个启动选项。
只是我一直是用 hg 的,总觉得开多了分支会给他人带来困惑,相关代码就一直没 push 了。

from qsanguosha.

pansz avatar pansz commented on July 24, 2024

另外需要考虑一下,作弊是哪个层面的。--test 是不是跟 --local 一致,因为显然你不太可能在 client/server 模式下引入作弊体系。

from qsanguosha.

gutenye avatar gutenye commented on July 24, 2024

--test是额外的

--server  # 没作弊
--server --test # 有作弊
--local 
--local --test

或着这样子.

./QSanguosha server --test
./QSanguosha client 

from qsanguosha.

pansz avatar pansz commented on July 24, 2024

服务器支持作弊的话,那测试命令是否每个终端都有权发出?测试性作弊是否同步到每个客户端?

from qsanguosha.

gutenye avatar gutenye commented on July 24, 2024

只要 server --testlocal --test就好了, client --test不需要.

服务器端支持作弊的话, 每个客户端都有作弊菜单了. 客户端发出作弊就和客户端使用了一个技能一样, 同步到每一个客户端的。

如果要做命令行的话, 顺便把要用的都补全把。

./QSanguosha [command] [options]
    command ::= server client local hall
    options 
        --test
        --name <name>
        --limit <secs>
        --mode <mode>
        --package <package ..>

这样你可以开机 用一个命令 就能自动启动神杀服务器了.

from qsanguosha.

pansz avatar pansz commented on July 24, 2024

那是否该把服务器改造为不从 config.ini 读取,而是读取命令行参数?

顺便说说:看看我现在的服务器启动脚本。

$ cat ~/bin/qsgs_start
#!/bin/sh
pwd
while true
do
date
./QSanguosha -server
sleep 1
done

为啥要这样呢,因为这个服务器太容易崩溃了。多连上来玩几次就 stackdump。

from qsanguosha.

gutenye avatar gutenye commented on July 24, 2024

原来已经有-server参数了啊, 好东西啊。 那cpp应该可以用一个处理命令行参数的库, (比如c的getopt, getopt_long)

先读取config.ini, 再读取命令行参数 (命令行参数参数优先级更高). 命令行里面只是为了更快速的调整一些常用的配置.(比如gameMode)

from qsanguosha.

gutenye avatar gutenye commented on July 24, 2024

所以要加一个 -h, --help 参数. 我一直以为没任何参数的。。。

from qsanguosha.

pansz avatar pansz commented on July 24, 2024

现在只有一个 -server 参数,别的都没有。

from qsanguosha.

haveatry823 avatar haveatry823 commented on July 24, 2024

其实现在每局游戏开始都会重新加载 lua/ai 里面的脚本的啦。

from qsanguosha.

gutenye avatar gutenye commented on July 24, 2024

@haveatry823 thanks. 果然有了.

from qsanguosha.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.