diff options
Diffstat (limited to 'server/src/server.cc')
-rw-r--r-- | server/src/server.cc | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/server/src/server.cc b/server/src/server.cc index b49f5b2..1ea2020 100644 --- a/server/src/server.cc +++ b/server/src/server.cc @@ -41,7 +41,11 @@ #include "transactionparser.h" #include "templateparser.h" #include "macroparser.h" + #include "queryhandler.h" +#include "queryhandlerpracro.h" +#include "queryhandlerpentominos.h" + #include "queryparser.h" #include "luaquerymapper.h" #include "database.h" @@ -179,12 +183,25 @@ static std::string handleTransaction(Transaction *transaction, //////////////////////// std::vector< Query >::iterator qi = m->queries.begin(); while(qi != m->queries.end()) { - /////////////////////////////// - // Send the queries to Pentominos (if any) - QueryHandler qh(pentominos_socket, transaction->cpr); - QueryResult queryresult = qh.exec(*qi); - lqm.addQueryResult(queryresult); + Query &query = *qi; + std::string service = query.attributes["service"]; + + if(service == "pentominos") { + // Send the queries to Pentominos (if any) + QueryHandlerPentominos qh(pentominos_socket, transaction->cpr); + + QueryResult queryresult = qh.exec(*qi); + lqm.addQueryResult(queryresult); + } + + if(service == "pracro") { + // Send the queries to Pentominos (if any) + QueryHandlerPracro qh(db, transaction->cpr); + + QueryResult queryresult = qh.exec(*qi); + lqm.addQueryResult(queryresult); + } qi++; } |