Comments (3)
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.
有些功能必须被重复。我来解释一下:
1。对于任何一个操作,服务器端接收到之后,需要检查这个操作的合法性,例如我可以杀一个距离8的人,或者杀空城诸葛亮,服务器应当期待从客户端而言,可能发出任何指令。——所以对服务器提起一个操作之后,服务器要有权说不。此时返回客户端之后,相当于该操作没有发生。
2。对于任何你可能发生非法操作之前,客户端可以从『方便用户』的角度,对某些非法操作进行屏蔽,例如使用杀的时候,自动把超过攻击范围的角色,以及空城诸葛,都给屏蔽了。——但客户端的这个行为,只是一种辅助性 AI ,用来辅助用户操作的,它不可以被依赖为检验动作合法性的标准,服务器端才是用于检测这个动作合法性的实体。
所以,某些操作必然是在客户端存在,同时在服务器端也存在的,虽然他们的用途不完全相同。客户端的存在意义只是帮助用户筛选出合法的操作,但客户端也有权不帮助用户进行这种筛选(例如 3V3 比赛中,你可以故意进行非法操作,扣技术分,然后达到某种目的),真正筛选的是服务器端,这样对所有客户端一视同仁,客户端即使是 AI 也不能作弊了。
from qsanguosha.
@pansz That is what this patch is intended for.
from qsanguosha.
Related Issues (20)
- Debian wheezy编译错误。 HOT 3
- git 版运行时错误 HOT 2
- 陆逊加淑慎伏皇后死循环 HOT 3
- Linux下4个包无法加载,选将界面看不到图片,怎么解决? HOT 6
- Lua脚本错误 HOT 3
- 2013-06-10 tag 版本linux下编译错误,以前曾经好像编译通过的 HOT 2
- vs2010下调试无图像显示,即使已经拷贝了qjpeg4.dll HOT 1
- Lua error in Kubuntu 12.04 64bit HOT 1
- 继续 make -f linux.mk 编译后无法make install HOT 4
- ubuntu13.04 X64,完全不会编译什么的……能不能帮忙打个deb包或者编译好…… HOT 1
- vs2010 build failed HOT 9
- sp-ai.lua 报错 HOT 2
- 凌统旋风依旧无法发动 HOT 3
- 关于 serverplayer 里面存在的循环依赖的问题。 HOT 1
- 编译时候sanguosha_wrap.cxx好多错误 HOT 11
- 编译问题 HOT 5
- 64位 Fedora 20下编译问题 HOT 10
- 这玩意现在该咋编译= = HOT 16
- [solved]swig/pregen_sanguosha_wrap.cxx编译错误 HOT 6
- windows+qt5下编译问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qsanguosha.