void sendranking2(const int conn)
{
if (pMob[conn].MOB.CurrentScore.Level < 1000)
{
auto mob = GetMobFromIndex(conn);
auto user = GetUserFromIndex(conn);
int totalkill = GetTotKill(conn);
int curkill = GetCurKill(conn);
int altar = pMob[conn].extra.score;
int wins = pMob[conn].extra.scorewins;
if (wins <= 0)
wins = 0;
char dir[100];
time_t now = time(0);
tm when;
localtime_s(&when, &now);
int score = 0;
FILE* fp;
if (mob->extra.ClassMaster == MORTAL)
{
sprintf_s(dir, "../../Common/RankingApp/Ranking2/%s.txt", mob->MOB.MobName);
}
else
{
sprintf_s(dir, "../../Common/RankingApp/Ranking2/%s_.txt", mob->MOB.MobName);
}
fopen_s(&fp, dir, "w");
int Evolucao = 0;
int sub = 0;
int slot = pUser[conn].Slot;
if (mob->extra.ClassMaster == MORTAL)
Evolucao = 0;
if (mob->extra.ClassMaster == ARCH)
Evolucao = 1;
if (mob->extra.ClassMaster == CELESTIAL)
Evolucao = 2;
if (mob->extra.ClassMaster == CELESTIALCS || mob->extra.ClassMaster == SCELESTIAL)
{
Evolucao = 3;
sub = 1;
}
int levelranking = mob->MOB.CurrentScore.Level * 3 + 1;
score = wins + altar;
if (Evolucao == 2)
score += 0;
if (Evolucao == 3)
score += 0;
if (Evolucao == 4)
score += 0;
int mobclan = mob->MOB.Clan;
if (pMob[conn].extra.clanmode == 1)
{
mobclan = 9;
}
else if (pMob[conn].extra.clanmode == 2)
{
mobclan = 10;
}
if (fp == NULL)
{
printf("[Erro ao gerar ranking \n");
return;
}
else
{
fprintf_s(fp, "%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", mob->MOB.MobName, mob->MOB.CurrentScore.Level, mob->MOB.Class, Evolucao, mobclan, mob->MOB.Guild, mob->MOB.GuildLevel, score, totalkill, sub, mob->extra.QuestInfo.Celestial.SubCelestialLevel, mob->extra.QuestInfo.Celestial.CelestialLevel, slot);
fclose(fp);
return;
}
}
return;
}
trying to implement this to send data to me website need help.
also how do i use the mysql functions to actively update data between db server and my sql data base.