Giter Club home page Giter Club logo

Comments (3)

 avatar commented on July 24, 2024

In the end we need to move currentPlayer, currentPhase and what ever states that are shared by client/server into RoomState rather than duplicating them. But duplicating it seems to be the only feasible way in the first pass.

from qsanguosha.

pansz avatar pansz commented on July 24, 2024

有些功能必须被重复。我来解释一下:

1。对于任何一个操作,服务器端接收到之后,需要检查这个操作的合法性,例如我可以杀一个距离8的人,或者杀空城诸葛亮,服务器应当期待从客户端而言,可能发出任何指令。——所以对服务器提起一个操作之后,服务器要有权说不。此时返回客户端之后,相当于该操作没有发生。

2。对于任何你可能发生非法操作之前,客户端可以从『方便用户』的角度,对某些非法操作进行屏蔽,例如使用杀的时候,自动把超过攻击范围的角色,以及空城诸葛,都给屏蔽了。——但客户端的这个行为,只是一种辅助性 AI ,用来辅助用户操作的,它不可以被依赖为检验动作合法性的标准,服务器端才是用于检测这个动作合法性的实体。

所以,某些操作必然是在客户端存在,同时在服务器端也存在的,虽然他们的用途不完全相同。客户端的存在意义只是帮助用户筛选出合法的操作,但客户端也有权不帮助用户进行这种筛选(例如 3V3 比赛中,你可以故意进行非法操作,扣技术分,然后达到某种目的),真正筛选的是服务器端,这样对所有客户端一视同仁,客户端即使是 AI 也不能作弊了。

from qsanguosha.

 avatar commented on July 24, 2024

@pansz That is what this patch is intended for.

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.