git repos / oastat

src/oss2db/Point2Db.cpp

browsing at commit = 4650efdefee78b3eb18a8c05811ca5157e7f5fb3

raw · blame · history

/* 
 * File:   Point2Db.cpp
 * Author: poul
 * 
 * Created on 10. januar 2011, 21:32
 */

#include "Point2Db.hpp"


string Point2Db::getCommand() {
    return "PlayerScore";
}

bool Point2Db::canProcess(OaStatStruct oss) {
    if(oss.command != getCommand() || oss.parameters.size()<2 || oss.parameters.at(0)<0)
        return false;
    return true;
}

void Point2Db::process(OaStatStruct oss) {
    if(!canProcess(oss))
        return; //Invalid oss

    string player = clientIdMap[oss.parameters.at(0)];

    dp->addScoreInfo(oss.second,player,oss.parameters.at(1));
}