mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-09-12 05:40:06 +00:00
Item Manager (Second Phase)
This commit is contained in:
parent
4c47d08e71
commit
4aac7e6e34
@ -17,12 +17,26 @@ void ItemManager::itemMoveHandler(CNSocket* sock, CNPacketData* data) {
|
||||
PlayerView plr = PlayerManager::players[sock];
|
||||
|
||||
sP_FE2CL_PC_ITEM_MOVE_SUCC* resp = (sP_FE2CL_PC_ITEM_MOVE_SUCC*)xmalloc(sizeof(sP_FE2CL_PC_ITEM_MOVE_SUCC));
|
||||
|
||||
DEBUGLOG(
|
||||
std::cout << "Item Move Received:" << std::endl;
|
||||
std::cout << "\teFrom: " << itemmove->eFrom << std::endl;
|
||||
std::cout << "\tiFromSlotNum: " << itemmove->iFromSlotNum << std::endl;
|
||||
std::cout << "\teTo: " << itemmove->eTo << std::endl;
|
||||
std::cout << "\tiToSlotNum: " << itemmove->iToSlotNum << std::endl;
|
||||
)
|
||||
|
||||
resp->eFrom = itemmove->eFrom;
|
||||
resp->iFromSlotNum = itemmove->iFromSlotNum;
|
||||
resp->FromSlotItem = plr.plr.Equip[1];
|
||||
resp->eTo = itemmove->eTo;
|
||||
resp->iToSlotNum = itemmove->iToSlotNum;
|
||||
|
||||
//please don't reee at me
|
||||
if (itemmove->eFrom < 1) {
|
||||
resp->FromSlotItem = plr.plr.Equip[1];
|
||||
} else {
|
||||
resp->FromSlotItem = plr.plr.Equip[1];
|
||||
}
|
||||
resp->ToSlotItem = plr.plr.Equip[1];
|
||||
|
||||
sock->sendPacket(new CNPacketData((void*)resp, P_FE2CL_PC_ITEM_MOVE_SUCC, sizeof(sP_FE2CL_PC_ITEM_MOVE_SUCC), sock->getFEKey()));
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include "CNShardServer.hpp"
|
||||
#include "PlayerManager.hpp"
|
||||
#include "ChatManager.hpp"
|
||||
#include "ItemManager.hpp"
|
||||
|
||||
#include "settings.hpp"
|
||||
|
||||
@ -28,6 +29,7 @@ int main() {
|
||||
std::cout << "[INFO] Intializing Packet Managers..." << std::endl;
|
||||
PlayerManager::init();
|
||||
ChatManager::init();
|
||||
ItemManager::init();
|
||||
|
||||
std::cout << "[INFO] Starting Server Threads..." << std::endl;
|
||||
CNLoginServer loginServer(settings::LOGINPORT);
|
||||
|
Loading…
x
Reference in New Issue
Block a user