Dear Klei Entertainment Team,
I hope this message finds you well. I am writing to report a bug in the game Don't Starve Together related to the SendModRPCToShard function.
Bug Description: When the parameter shards (world ID list) is set to nil, the function SendModRPCToShard sends the RPC to all connected clients, which is not in line with the game's intended behavior.
Here is the relevant section of the official source code and its comments:
==============================================================
-- SendRPCToShard(SHARD_RPC.RPCNAME, shards, ...)
-- shards is either:
-- nil == all connected shards
-- shardid == send to that shard
-- table == list of shards to send to
function SendRPCToShard(code, ...)
.....................
end
==============================================================
As per the code comments, when shards is nil, the function should send the RPC to all connected shards. This intended functionality is correctly implemented. However, the issue arises because the function also sends the RPC to all connected clients, which is an unnecessary and unintended behavior.
Steps to Reproduce:
-
Call
SendModRPCToShardwith theshardsparameter set tonil. - Observe that the RPC is sent to all connected clients in addition to all connected shards.
Expected Behavior: The RPC should only be sent to all connected shards when the shards parameter is nil, as described in the code comments. It should not send the RPC to all connected clients.
I hope this information helps in identifying and fixing the issue. Thank you for your continuous support and efforts in improving the game.
主题:Bug报告:SendModRPCToShard函数行为
尊敬的Klei娱乐团队,
希望您一切安好。我写这封信是为了报告游戏《饥荒联机版》中与SendModRPCToShard函数相关的一个Bug。
Bug描述: 当参数shards(世界ID表)为nil时,函数SendModRPCToShard会将RPC发送给所有连接的客户端玩家,这不符合游戏设定。
以下是官方源码中相关代码和注释:
==============================================================
-- SendRPCToShard(SHARD_RPC.RPCNAME, shards, ...)
-- shards is either:
-- nil == all connected shards
-- shardid == send to that shard
-- table == list of shards to send to
function SendRPCToShard(code, ...)
.....................
end
==============================================================
根据代码注释,当shards为nil时,函数应将RPC发送到所有连接的碎片(shards)。这一预期功能本身实现了,但是问题在于函数还将RPC发送给了所有连接的客户端玩家,这是多余且非预期的行为。
重现步骤:
-
调用
SendModRPCToShard并将shards参数设置为nil。 - 观察到RPC被发送到所有连接的客户端玩家以及所有连接的碎片。
预期行为: 当shards参数为nil时,RPC应仅发送到所有连接的碎片,如代码注释所描述的那样,不应发送给所有连接的客户端玩家。
希望这些信息有助于识别和修复问题。感谢您不断地支持和努力改进游戏。
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now