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
295cc65d
Commit
295cc65d
authored
May 09, 2012
by
Max-Wilhelm Bruker
Browse files
minor fix wrt issue #42
parent
b9087715
Changes
4
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/abstractclient.cpp
View file @
295cc65d
...
...
@@ -119,7 +119,7 @@ void AbstractClient::sendCommand(PendingCommand *pend)
void
AbstractClient
::
queuePendingCommand
(
PendingCommand
*
pend
)
{
// This function is always called from the client thread via signal/slot.
const
int
cmdId
=
next
CmdId
++
;
const
int
cmdId
=
getNew
CmdId
()
;
pend
->
getCommandContainer
().
set_cmd_id
(
cmdId
);
pendingCommands
.
insert
(
cmdId
,
pend
);
...
...
cockatrice/src/abstractclient.h
View file @
295cc65d
...
...
@@ -73,6 +73,7 @@ protected:
QMap
<
int
,
PendingCommand
*>
pendingCommands
;
QString
userName
,
password
;
void
setStatus
(
ClientStatus
_status
);
int
getNewCmdId
()
{
return
nextCmdId
++
;
}
virtual
void
sendCommandContainer
(
const
CommandContainer
&
cont
)
=
0
;
public:
AbstractClient
(
QObject
*
parent
=
0
);
...
...
cockatrice/src/remoteclient.cpp
View file @
295cc65d
...
...
@@ -9,7 +9,7 @@
#include
"pb/server_message.pb.h"
#include
"pb/event_server_identification.pb.h"
static
const
unsigned
int
protocolVersion
=
1
4
;
static
const
unsigned
int
protocolVersion
=
1
3
;
RemoteClient
::
RemoteClient
(
QObject
*
parent
)
:
AbstractClient
(
parent
),
timeRunning
(
0
),
lastDataReceived
(
0
),
messageInProgress
(
false
),
handshakeStarted
(
false
),
messageLength
(
0
)
...
...
@@ -50,6 +50,7 @@ void RemoteClient::slotConnected()
// dirty hack to be compatible with v14 server
sendCommandContainer
(
CommandContainer
());
getNewCmdId
();
// end of hack
setStatus
(
StatusAwaitingWelcome
);
...
...
common/server_protocolhandler.cpp
View file @
295cc65d
...
...
@@ -260,7 +260,7 @@ void Server_ProtocolHandler::processCommandContainer(const CommandContainer &con
{
lastDataReceived
=
timeRunning
;
ResponseContainer
responseContainer
(
cont
.
cmd_id
());
ResponseContainer
responseContainer
(
cont
.
has_
cmd_id
()
?
cont
.
cmd_id
()
:
-
1
);
Response
::
ResponseCode
finalResponseCode
;
if
(
cont
.
game_command_size
())
...
...
@@ -276,7 +276,7 @@ void Server_ProtocolHandler::processCommandContainer(const CommandContainer &con
else
finalResponseCode
=
Response
::
RespInvalidCommand
;
if
(
finalResponseCode
!=
Response
::
RespNothing
)
if
(
(
finalResponseCode
!=
Response
::
RespNothing
)
)
sendResponseContainer
(
responseContainer
,
finalResponseCode
);
}
...
...
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