From 4df8884f155f7558c07949426c248e066df7936f Mon Sep 17 00:00:00 2001 From: deva Date: Wed, 11 Feb 2009 07:14:22 +0000 Subject: Added QueryHandler for both Pentominos and Pracro. Added source string to all values, and use these to set the prefill value in the macros. --- server/src/server.cc | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'server/src/server.cc') 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++; } -- cgit v1.2.3