mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 05:20:05 +00:00
Merge pull request #97 from gsemaj/bugfix1
Preventing spawning of invalid items using /itemN Fix fusion matter amount not displaying on enter
This commit is contained in:
commit
4d437bcb34
@ -47,7 +47,6 @@ void CNShardServer::keepAliveTimer(CNServer* serv, time_t currTime) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CNShardServer::periodicSaveTimer(CNServer* serv, time_t currTime) {
|
void CNShardServer::periodicSaveTimer(CNServer* serv, time_t currTime) {
|
||||||
std::cout << "players size: " << PlayerManager::players.size() << std::endl;
|
|
||||||
for (auto& pair : PlayerManager::players) {
|
for (auto& pair : PlayerManager::players) {
|
||||||
Database::updatePlayer(pair.second.plr);
|
Database::updatePlayer(pair.second.plr);
|
||||||
}
|
}
|
||||||
|
@ -162,6 +162,12 @@ void ItemManager::itemGMGiveHandler(CNSocket* sock, CNPacketData* data) {
|
|||||||
// sock->sendPacket(new CNPacketData((void*)resp, P_FE2CL_REP_PC_GIVE_ITEM_FAIL, sizeof(sP_FE2CL_REP_PC_GIVE_ITEM_FAIL), sock->getFEKey()));
|
// sock->sendPacket(new CNPacketData((void*)resp, P_FE2CL_REP_PC_GIVE_ITEM_FAIL, sizeof(sP_FE2CL_REP_PC_GIVE_ITEM_FAIL), sock->getFEKey()));
|
||||||
} else if (itemreq->eIL == 1 && itemreq->Item.iType >= 0 && itemreq->Item.iType <= 10) {
|
} else if (itemreq->eIL == 1 && itemreq->Item.iType >= 0 && itemreq->Item.iType <= 10) {
|
||||||
|
|
||||||
|
if (ItemData.find(std::pair<int32_t, int32_t>(itemreq->Item.iID, itemreq->Item.iType)) == ItemData.end()) {
|
||||||
|
// invalid item
|
||||||
|
std::cout << "[WARN] Item id " << itemreq->Item.iID << " with type " << itemreq->Item.iType << " is invalid (give item)" << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
INITSTRUCT(sP_FE2CL_REP_PC_GIVE_ITEM_SUCC, resp);
|
INITSTRUCT(sP_FE2CL_REP_PC_GIVE_ITEM_SUCC, resp);
|
||||||
|
|
||||||
resp.eIL = itemreq->eIL;
|
resp.eIL = itemreq->eIL;
|
||||||
|
@ -206,6 +206,7 @@ void PlayerManager::enterPlayer(CNSocket* sock, CNPacketData* data) {
|
|||||||
response.PCLoadData2CL.iHP = plr.HP;
|
response.PCLoadData2CL.iHP = plr.HP;
|
||||||
response.PCLoadData2CL.iLevel = plr.level;
|
response.PCLoadData2CL.iLevel = plr.level;
|
||||||
response.PCLoadData2CL.iCandy = plr.money;
|
response.PCLoadData2CL.iCandy = plr.money;
|
||||||
|
response.PCLoadData2CL.iFusionMatter = plr.fusionmatter;
|
||||||
response.PCLoadData2CL.iMentor = 5; // Computress
|
response.PCLoadData2CL.iMentor = 5; // Computress
|
||||||
response.PCLoadData2CL.iMentorCount = 1; // how many guides the player has had
|
response.PCLoadData2CL.iMentorCount = 1; // how many guides the player has had
|
||||||
response.PCLoadData2CL.iMapNum = 0;
|
response.PCLoadData2CL.iMapNum = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user