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
4b84168b
Commit
4b84168b
authored
Jun 25, 2011
by
Max-Wilhelm Bruker
Browse files
client/server version bump; eventConnectionStateChanged
parent
d892d320
Changes
24
Show whitespace changes
Inline
Side-by-side
common/server_game.cpp
View file @
4b84168b
...
...
@@ -341,6 +341,13 @@ void Server_Game::nextTurn()
setActivePlayer
(
keys
[
listPos
]);
}
void
Server_Game
::
postConnectionStatusUpdate
(
Server_Player
*
player
,
bool
connectionStatus
)
{
QMutexLocker
locker
(
&
gameMutex
);
sendGameEvent
(
new
Event_ConnectionStateChanged
(
player
->
getPlayerId
(),
connectionStatus
));
}
QList
<
ServerInfo_Player
*>
Server_Game
::
getGameState
(
Server_Player
*
playerWhosAsking
)
const
{
QMutexLocker
locker
(
&
gameMutex
);
...
...
common/server_game.h
View file @
4b84168b
...
...
@@ -88,6 +88,7 @@ public:
void
setActivePlayer
(
int
_activePlayer
);
void
setActivePhase
(
int
_activePhase
);
void
nextTurn
();
void
postConnectionStatusUpdate
(
Server_Player
*
player
,
bool
connectionStatus
);
QList
<
ServerInfo_Player
*>
getGameState
(
Server_Player
*
playerWhosAsking
)
const
;
void
sendGameEvent
(
GameEvent
*
event
,
GameEventContext
*
context
=
0
,
Server_Player
*
exclude
=
0
);
...
...
common/server_protocolhandler.cpp
View file @
4b84168b
...
...
@@ -46,8 +46,10 @@ void Server_ProtocolHandler::prepareDestroy()
if
((
authState
==
UnknownUser
)
||
p
->
getSpectator
())
g
->
removePlayer
(
p
);
else
else
{
p
->
setProtocolHandler
(
0
);
g
->
postConnectionStatusUpdate
(
p
,
false
);
}
}
gameListMutex
.
unlock
();
...
...
@@ -392,6 +394,7 @@ ResponseCode Server_ProtocolHandler::cmdJoinRoom(Command_JoinRoom *cmd, CommandC
for
(
int
j
=
0
;
j
<
gamePlayers
.
size
();
++
j
)
if
(
gamePlayers
[
j
]
->
getUserInfo
()
->
getName
()
==
userInfo
->
getName
())
{
gamePlayers
[
j
]
->
setProtocolHandler
(
this
);
game
->
postConnectionStatusUpdate
(
gamePlayers
[
j
],
true
);
games
.
insert
(
game
->
getGameId
(),
QPair
<
Server_Game
*
,
Server_Player
*>
(
game
,
gamePlayers
[
j
]));
enqueueProtocolItem
(
new
Event_GameJoined
(
game
->
getGameId
(),
game
->
getDescription
(),
gamePlayers
[
j
]
->
getPlayerId
(),
gamePlayers
[
j
]
->
getSpectator
(),
game
->
getSpectatorsCanTalk
(),
game
->
getSpectatorsSeeEverything
(),
true
));
...
...
servatrice/src/servatrice.cpp
View file @
4b84168b
...
...
@@ -423,4 +423,4 @@ void Servatrice::shutdownTimeout()
deleteLater
();
}
const
QString
Servatrice
::
versionString
=
"Servatrice 0.20110
527
"
;
const
QString
Servatrice
::
versionString
=
"Servatrice 0.20110
625
"
;
Prev
1
2
Next
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