summaryrefslogtreecommitdiff
path: root/server/src/server.cc
diff options
context:
space:
mode:
authordeva <deva>2009-02-11 07:14:22 +0000
committerdeva <deva>2009-02-11 07:14:22 +0000
commit4df8884f155f7558c07949426c248e066df7936f (patch)
tree61030bad443e366b8fb0e097200693ab56df01c4 /server/src/server.cc
parentbbe2b5f899a9c1bd7c99181f8702ec03c60f3028 (diff)
Added QueryHandler for both Pentominos and Pracro. Added source string to all values, and use these to set the prefill value in the macros.
Diffstat (limited to 'server/src/server.cc')
-rw-r--r--server/src/server.cc27
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++;
}