int main() { msg::Msg_Spe(msg::MSG_FLAG_ENUM::GREEN, "############# TEST MVC #############\n"); ///////////////// Initialisation ///////////////////// IniConfigReader iniReader("../resources/Configuration/WindowConfig.ini"); iniReader.Read(); std::map<std::string, std::map<std::string, std::string> > config = iniReader.GetConfig(); /////////////////////////////////////////// // HANDLERS INIT /////////////////////////////////////////// ControlerHandler vHandler(config); vHandler.Init(); // /////////////////////////////////////////// // // APPLICATION MAIN LOOP // /////////////////////////////////////////// vHandler.MainLoop(); msg::Msg_Spe(msg::MSG_FLAG_ENUM::GREEN, "\n######################################"); return EXIT_SUCCESS; }
void OnPVPKill(Player* killer, Player* victim) { ChatHandler kHandler(killer->GetSession()); ChatHandler vHandler(victim->GetSession()); if(killer->GetGUID() == victim->GetGUID()) { return; } else { if(killer->pvpInfo.inFFAPvPArea && victim->pvpInfo.inFFAPvPArea) //gets updated by UpdatePvPState { if(killer->GetMoney() + FFA_REWARD < MAX_MONEY_AMOUNT) { killer->SetMoney(killer->GetMoney() + FFA_REWARD); kHandler.PSendSysMessage(KILL_FFA_MSG); } else kHandler.PSendSysMessage(ERR_TOO_MUCH_MONEY); if(victim->GetMoney() - FFA_LOST > 0) { if(victim->GetMoney() != 0){ victim->SetMoney(victim->GetMoney() - FFA_LOST); } vHandler.PSendSysMessage(LOST_GOLD_MSG); } } else { if(killer->GetMoney() + NORMAL_REWARD < MAX_MONEY_AMOUNT) { killer->SetMoney(killer->GetMoney() + NORMAL_REWARD); kHandler.PSendSysMessage(KILL_MSG); } else kHandler.PSendSysMessage(ERR_TOO_MUCH_MONEY); } } }