View Issue Details

IDProjectCategoryView StatusLast Update
0004365Spring engineGeneralpublic2019-03-06 22:55
ReporterJools Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
Status newResolutionopen 
Product Version96.0.1+git 
Summary0004365: AddChatAction misses a playerID field
DescriptionI have a gadget in xta that allows people to vote if they want to draw the game. It uses a widget for getting user input (they can start the vote with the "/draw" command), and it gets handled by TextCommand function. That function then calls a gadget function which listens to "/luarules votefordraw", which is activated through "gadgetHandler:AddChatAction" function. The problem is that the gadget has no information about called the vote. I want to be able to not allow spectators to call the vote.

To my knowledge, this is not possible with gadgetHandler:AddChatAction. I would like an additional parameter, e.g. playerID, to make this possible.
Steps To ReproduceN/A
Additional InformationIt needs to be in a gadget because it calls the Spring.GameOver function ultimately.I attack a picture of what the vote window looks like for information.
TagsNo tags attached.
Attached Files
screen00346.png (Attachment missing)
Checked infolog.txt for Errors

Activities

sprung

2019-02-26 20:45

reporter   ~0019779

No change required? The function you pass to AddChatAction as the 2nd argument receives playerID as its own 4th argument.


function handleVoteForDraw(cmd, msg, words, playerID)
   if isSpec(playerID) then return end
   ...
end

gadgetHandler:AddChatAction("votefordraw", handleVoteForDraw, "help string")

Google_Frog

2019-02-27 06:18

reporter   ~0019781

It would be nice if gadgets could receive chat actions with a playerID that is not easy to spoof with a widget.

Jools

2019-03-06 22:55

reporter   ~0019800

You realise this report is 5 years old? It's for spring 96.0

Issue History

Date Modified Username Field Change
2014-04-19 06:12 Jools New Issue
2014-04-19 06:12 Jools File Added: screen00346.png
2019-02-26 20:45 sprung Note Added: 0019779
2019-02-27 06:18 Google_Frog Note Added: 0019781
2019-03-06 22:55 Jools Note Added: 0019800