每次玩完就要刪除..實在是很麻煩!!
所以啦~在還沒真正解決四轉技能為何會造成無法登入之前..先簡單寫個鳥程式來解決吧!XD
首先開啟MySQLM.cpp,找個你喜歡的地方將下面的程式碼貼上
//add by squall
void MySQL::delete4thSkills(int id){
char query[500];
sprintf_s(query, 500, "DELETE FROM skills WHERE charid='%d' AND (skillid LIKE '%s' OR skillid LIKE '%s' OR skillid LIKE '%s' OR skillid LIKE '%s' OR skillid LIKE '%s' OR skillid LIKE '%s' OR skillid LIKE '%s' OR skillid LIKE '%s' OR skillid LIKE '%s' OR skillid LIKE '%s');", id, "112%","122%","132%","212%","222%","232%","312%","412%","422%");
mysql_real_query(&maple_db, query, strlen(query));
}
在MySQLM.h加入
static void delete4thSkills(int id);
最後在Player.cpp中加入
//add by squall (delete 4thJob Skills)
MySQL::delete4thSkills(getPlayerid());
這邊有一個地方要注意的,必須放在取得技能之前,所以建議放在[color=Red]int skill[200][2];[/color]的下面一行...
看起來如下
int skill[200][2];
//add by squall (delete 4thJob Skills)
MySQL::delete4thSkills(getPlayerid()); // 這段是新加進去的唷!!
many = MySQL::getSkills(getPlayerid(), skill);
好啦~這樣每次玩遊戲都可以放心的玩四轉技能囉! 不過還是希望盡快找出四轉技能會當機的問題...囧!==================補充說明==================
看樣子大家似乎都有遇到類似的問題
是Player.CPP不是Players.CPP
所以可能要請大家找 many = MySQL::getSkills(getPlayerid(), skill); 或是 getSkills
只要把MySQL::delete4thSkills(getPlayerid()); 這段放在取得技能之前即可
類似這樣...大家在努力試試看吧! :)
for(int i=0; i Item* item = new Item;
item->id = items[i][0];
item->inv = items[i][1];
item->pos = items[i][2];
item->amount = items[i][3];
inv->addItem(item);
}
int skill[200][2];
//add by squall (delete 4thJob Skills)
MySQL::delete4thSkills(getPlayerid());
many = MySQL::getSkills(getPlayerid(), skill);
for(int i=0; i skills->addSkillLevel(skill[i][0], skill[i][1]);
//SkillsPacket::addSkill(this, skill[i][0] , skills->getSkillLevel(skill[i][0]));
}
沒有留言:
張貼留言