Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
8be55635
Commit
8be55635
authored
Mar 19, 2015
by
Fabio Bas
Browse files
Added user notification for RespChatFlood
parent
0e437cf1
Changes
2
Show whitespace changes
Inline
Side-by-side
cockatrice/src/tab_game.cpp
View file @
8be55635
...
...
@@ -837,6 +837,8 @@ void TabGame::sendGameCommand(PendingCommand *pend, int playerId)
AbstractClient
*
client
=
getClientForPlayer
(
playerId
);
if
(
!
client
)
return
;
connect
(
pend
,
SIGNAL
(
finished
(
Response
,
CommandContainer
,
QVariant
)),
this
,
SLOT
(
commandFinished
(
const
Response
&
)));
client
->
sendCommand
(
pend
);
}
...
...
@@ -845,7 +847,16 @@ void TabGame::sendGameCommand(const google::protobuf::Message &command, int play
AbstractClient
*
client
=
getClientForPlayer
(
playerId
);
if
(
!
client
)
return
;
client
->
sendCommand
(
prepareGameCommand
(
command
));
PendingCommand
*
pend
=
prepareGameCommand
(
command
);
connect
(
pend
,
SIGNAL
(
finished
(
Response
,
CommandContainer
,
QVariant
)),
this
,
SLOT
(
commandFinished
(
const
Response
&
)));
client
->
sendCommand
(
pend
);
}
void
TabGame
::
commandFinished
(
const
Response
&
response
)
{
if
(
response
.
response_code
()
==
Response
::
RespChatFlood
)
messageLog
->
appendMessage
(
tr
(
"You are flooding the game. Please wait a couple of seconds."
));
}
PendingCommand
*
TabGame
::
prepareGameCommand
(
const
::
google
::
protobuf
::
Message
&
cmd
)
...
...
cockatrice/src/tab_game.h
View file @
8be55635
...
...
@@ -198,6 +198,7 @@ private slots:
void
actNextTurn
();
void
addMentionTag
(
QString
value
);
void
commandFinished
(
const
Response
&
response
);
public:
TabGame
(
TabSupervisor
*
_tabSupervisor
,
QList
<
AbstractClient
*>
&
_clients
,
const
Event_GameJoined
&
event
,
const
QMap
<
int
,
QString
>
&
_roomGameTypes
);
TabGame
(
TabSupervisor
*
_tabSupervisor
,
GameReplay
*
replay
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment