src/oss2db/Award2Db.cpp
browsing at commit = 9b4c0187fcffdf8370ac7e453393512c7e62fa73
/*
* File: Award2Db.cpp
* Author: poul
*
* Created on 7. juni 2010, 19:41
*/
#include "Award2Db.h"
string Award2Db::getCommand() {
return "Award";
}
bool Award2Db::canProcess(OaStatStruct oss) {
if(oss.command != getCommand() || oss.parameters.size()<2 || oss.parameters.at(0)<0)
return false;
return true;
}
void Award2Db::process(OaStatStruct oss) {
if(!canProcess(oss))
return; //Invalid oss
if(oss.parameters.at(0)>-1 && oss.parameters.at(0)<MAX_ID)
return; //Not valid player
string player = clientIdMap.at(oss.parameters.at(0));
dp->addAward(oss.second,player,oss.parameters.at(1));
}