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
e326f961
Commit
e326f961
authored
Jun 24, 2012
by
Max-Wilhelm Bruker
Browse files
added numberPools=0 option to make server unthreaded
parent
87584a3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
servatrice/src/servatrice.cpp
View file @
e326f961
...
@@ -43,6 +43,15 @@ Servatrice_GameServer::Servatrice_GameServer(Servatrice *_server, int _numberPoo
...
@@ -43,6 +43,15 @@ Servatrice_GameServer::Servatrice_GameServer(Servatrice *_server, int _numberPoo
:
QTcpServer
(
parent
),
:
QTcpServer
(
parent
),
server
(
_server
)
server
(
_server
)
{
{
if
(
_numberPools
==
0
)
{
Servatrice_DatabaseInterface
*
newDatabaseInterface
=
new
Servatrice_DatabaseInterface
(
0
,
server
);
Servatrice_ConnectionPool
*
newPool
=
new
Servatrice_ConnectionPool
(
newDatabaseInterface
);
server
->
addDatabaseInterface
(
thread
(),
newDatabaseInterface
);
newDatabaseInterface
->
initDatabase
(
_sqlDatabase
);
connectionPools
.
append
(
newPool
);
}
else
for
(
int
i
=
0
;
i
<
_numberPools
;
++
i
)
{
for
(
int
i
=
0
;
i
<
_numberPools
;
++
i
)
{
Servatrice_DatabaseInterface
*
newDatabaseInterface
=
new
Servatrice_DatabaseInterface
(
i
,
server
);
Servatrice_DatabaseInterface
*
newDatabaseInterface
=
new
Servatrice_DatabaseInterface
(
i
,
server
);
Servatrice_ConnectionPool
*
newPool
=
new
Servatrice_ConnectionPool
(
newDatabaseInterface
);
Servatrice_ConnectionPool
*
newPool
=
new
Servatrice_ConnectionPool
(
newDatabaseInterface
);
...
...
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