- Joined
- Nov 11, 2004
- Messages
- 15
- Reaction score
- 8
in src\EclipseStudio\Sources\UI\HUDPause.cpp]
Search for
add above
search for
add above
in src\EclipseStudio\Sources\UI\HUDPause.h
seach for
add above
in src\EclipseStudio\Sources\multiplayer\P2PMessages.h
search for
add above
search for
add above
in server\WO_GameServer\Sources\ObjectsCode\obj_ServerPlayer.cpp
search for
add above
search for
add above
in server\WO_GameServer\Sources\ObjectsCode\obj_ServerPlayer.h
search for
add above
Recompile the Server and Client..
Search for
Code:
void HUDPause::eventBackpackDrop(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount)
{
r3d_assert(argCount==1);
int slotID = args[0].GetInt();
obj_Player* plr = gClientLogic().localPlayer_;
r3d_assert(plr);
plr->DropItem(slotID);
updateSurvivorTotalWeight();
gfxMovie.Invoke("_root.api.backpackGridSwapSuccess", "");
}
add above
Code:
void HUDPause::eventBackpackUnloadClip(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount)
{
obj_Player* plr = gClientLogic().localPlayer_;
int slotID = args[0].GetInt();
uint32_t itemID = args[0].GetUInt();
wiInventoryItem& wi = plr->CurLoadout.Items[slotID];
const WeaponConfig* wc = g_pWeaponArmory->getWeaponConfig(itemID);
r3d_assert(argCount==1);
r3d_assert(plr);
r3d_assert(wi.itemID && wi.quantity > 0);
{
const WeaponConfig* wc = g_pWeaponArmory->getWeaponConfig(wi.itemID);
if(wc)
{
// UNLOAD CLIP
if(wc->category >= storecat_ASR && wc->category <= storecat_SMG)
{
if(wi.Var1 > 0)
{
PKT_C2S_UnloadClipReq_s n;
n.slotID = slotID;
p2pSendToHost(gClientLogic().localPlayer_, &n, sizeof(n), true);
wi.Var1 = 0;
plr->CurLoadout.Items[slotID] = wi;
plr->OnBackpackChanged(slotID);
updateSurvivorTotalWeight();
}
Scaleform::GFx::Value var[2];
var[0].SetString("Erro ao descarregar");
var[1].SetInt(2);
gfxMovie.Invoke("_root.api.Main.Inventory.addContextMenuOption", var, 2);
return;
}
}
}
}
search for
Code:
gfxMovie.RegisterEventHandler("eventBackpackDrop", MAKE_CALLBACK(eventBackpackDrop));
add above
Code:
gfxMovie.RegisterEventHandler("eventBackpackUnloadClip", MAKE_CALLBACK(eventBackpackUnloadClip));
in src\EclipseStudio\Sources\UI\HUDPause.h
seach for
Code:
void eventBackpackDrop(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount);
add above
Code:
void eventBackpackUnloadClip(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount);
in src\EclipseStudio\Sources\multiplayer\P2PMessages.h
search for
Code:
PKT_C2S_DisconnectReq,
add above
Code:
PKT_C2S_UnloadClipReq,
search for
Code:
struct PKT_C2S_DisconnectReq_s : public DefaultPacketMixin<PKT_C2S_DisconnectReq>
{
};
add above
Code:
struct PKT_C2S_UnloadClipReq_s : public DefaultPacketMixin<PKT_C2S_UnloadClipReq>
{
int slotID;
};
in server\WO_GameServer\Sources\ObjectsCode\obj_ServerPlayer.cpp
search for
Code:
void obj_ServerPlayer::OnNetPacket(const PKT_C2S_InventoryOp_s& n)
{
}
add above
Code:
void obj_ServerPlayer::OnNetPacket(const PKT_C2S_UnloadClipReq_s& n)
{
if(loadout_->Alive == 0)
return;
wiInventoryItem item = loadout_->Items[n.slotID];
const WeaponConfig* wc = g_pWeaponArmory->getWeaponConfig(item.itemID);
//m_WeaponArray[n.slotID]
if(wc)
{
if(wc->category >= storecat_ASR && wc->category <= storecat_SMG)
{
if(item.Var1 > 0 && item.Var2 > 0)
{
wiInventoryItem wi;
wi.itemID = item.Var2;
wi.quantity = 1;
wi.Var1 = item.Var1;
item.Var1 = 0;
item.Var2 = wi.itemID;
if(BackpackAddItem(wi))
loadout_->Items[n.slotID] = item;
OnBackpackChanged(n.slotID);
}else{
gServerLogic.LogCheat(peerId_, PKT_S2C_CheatWarning_s::CHEAT_Protocol, false, "Clip is serverside empty",
"slot%d %d - %d", n.slotID, item.itemID, item.Var1);
}
}
}
}
search for
Code:
DEFINE_GAMEOBJ_PACKET_HANDLER(PKT_C2C_PlayerUseItem);
add above
Code:
DEFINE_GAMEOBJ_PACKET_HANDLER(PKT_C2S_UnloadClipReq);
in server\WO_GameServer\Sources\ObjectsCode\obj_ServerPlayer.h
search for
Code:
void OnNetPacket(const PKT_C2S_DisconnectReq_s& n);
add above
Code:
void OnNetPacket(const PKT_C2S_UnloadClipReq_s& n);
Recompile the Server and Client..
Last edited:

