[General] Rename packets to show they are for players only, not NPCs

pull/163/head
David Cernat 8 years ago
parent 3a29b2d41d
commit 04d45b9dbb

@ -108,9 +108,9 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
return;
}
}
else if (packet->data[0] == ID_GAME_BASE_INFO)
else if (packet->data[0] == ID_PLAYER_BASEINFO)
{
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_GAME_BASE_INFO about %s",
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_PLAYER_BASEINFO about %s",
player->npc.mName.c_str());
myPacket->Read(player);
@ -128,9 +128,9 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
switch (packet->data[0])
{
case ID_GAME_BASE_INFO:
case ID_PLAYER_BASEINFO:
{
/*LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_GAME_BASE_INFO about %s",
/*LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_PLAYER_BASEINFO about %s",
player->npc.mName.c_str());
myPacket->Read(player);
@ -138,9 +138,9 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
break;
}
case ID_GAME_POS:
case ID_PLAYER_POS:
{
//DEBUG_PRINTF("ID_GAME_POS \n");
//DEBUG_PRINTF("ID_PLAYER_POS \n");
if (!player->creatureStats.mDead)
{
@ -210,7 +210,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
break;
}
case ID_GAME_LEVEL:
case ID_PLAYER_LEVEL:
{
if (!player->creatureStats.mDead)
@ -223,9 +223,9 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
break;
}
case ID_GAME_EQUIPMENT:
case ID_PLAYER_EQUIPMENT:
{
DEBUG_PRINTF("ID_GAME_EQUIPMENT\n");
DEBUG_PRINTF("ID_PLAYER_EQUIPMENT\n");
myPacket->Read(player);
myPacket->Send(player, true);
@ -235,9 +235,9 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
break;
}
case ID_GAME_INVENTORY:
case ID_PLAYER_INVENTORY:
{
DEBUG_PRINTF("ID_GAME_INVENTORY\n");
DEBUG_PRINTF("ID_PLAYER_INVENTORY\n");
myPacket->Read(player);
Script::Call<Script::CallbackIdentity("OnPlayerInventoryChange")>(player->getId());
@ -245,9 +245,9 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
break;
}
case ID_GAME_SPELLBOOK:
case ID_PLAYER_SPELLBOOK:
{
DEBUG_PRINTF("ID_GAME_SPELLBOOK\n");
DEBUG_PRINTF("ID_PLAYER_SPELLBOOK\n");
myPacket->Read(player);
Script::Call<Script::CallbackIdentity("OnPlayerSpellbookChange")>(player->getId(), player->spellbookChanges.action);
@ -255,9 +255,9 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
break;
}
case ID_GAME_JOURNAL:
case ID_PLAYER_JOURNAL:
{
DEBUG_PRINTF("ID_GAME_JOURNAL\n");
DEBUG_PRINTF("ID_PLAYER_JOURNAL\n");
myPacket->Read(player);
Script::Call<Script::CallbackIdentity("OnPlayerJournalChange")>(player->getId());
@ -265,9 +265,9 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
break;
}
case ID_GAME_ATTACK:
case ID_PLAYER_ATTACK:
{
DEBUG_PRINTF("ID_GAME_ATTACK\n");
DEBUG_PRINTF("ID_PLAYER_ATTACK\n");
if (!player->creatureStats.mDead)
{
@ -292,14 +292,14 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
}
myPacket->Send(player, true);
playerController->GetPacket(ID_GAME_DYNAMICSTATS)->RequestData(player->attack.target);
playerController->GetPacket(ID_PLAYER_DYNAMICSTATS)->RequestData(player->attack.target);
}
break;
}
case ID_GAME_DYNAMICSTATS:
case ID_PLAYER_DYNAMICSTATS:
{
DEBUG_PRINTF("ID_GAME_DYNAMICSTATS\n");
DEBUG_PRINTF("ID_PLAYER_DYNAMICSTATS\n");
myPacket->Read(player);
myPacket->Send(player, true);
break;
@ -340,7 +340,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
//packetResurrect.Read(player);
player->creatureStats.mDead = false;
myPacket->Send(player, true);
playerController->GetPacket(ID_GAME_POS)->RequestData(player->guid);
playerController->GetPacket(ID_PLAYER_POS)->RequestData(player->guid);
playerController->GetPacket(ID_PLAYER_CELL_CHANGE)->RequestData(player->guid);
Script::Call<Script::CallbackIdentity("OnPlayerResurrect")>(player->getId());
@ -348,9 +348,9 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
break;
}
case ID_GAME_DRAWSTATE:
case ID_PLAYER_DRAWSTATE:
{
DEBUG_PRINTF("ID_GAME_DRAWSTATE\n");
DEBUG_PRINTF("ID_PLAYER_DRAWSTATE\n");
myPacket->Read(player);
myPacket->Send(player, true);
break;
@ -372,9 +372,9 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
}
break;
}
case ID_GAME_CHARGEN:
case ID_PLAYER_CHARGEN:
{
DEBUG_PRINTF("ID_GAME_CHARGEN\n");
DEBUG_PRINTF("ID_PLAYER_CHARGEN\n");
myPacket->Read(player);
if (player->charGenStage.current == player->charGenStage.end && player->charGenStage.current != 0)
@ -395,9 +395,9 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
break;
}
case ID_GAME_CHARCLASS:
case ID_PLAYER_CHARCLASS:
{
DEBUG_PRINTF("ID_GAME_CHARCLASS\n");
DEBUG_PRINTF("ID_PLAYER_CHARCLASS\n");
myPacket->Read(player);
break;
}
@ -689,11 +689,11 @@ void Networking::update(RakNet::Packet *packet)
void Networking::newPlayer(RakNet::RakNetGUID guid)
{
playerController->GetPacket(ID_GAME_BASE_INFO)->RequestData(guid);
playerController->GetPacket(ID_GAME_DYNAMICSTATS)->RequestData(guid);
playerController->GetPacket(ID_GAME_POS)->RequestData(guid);
playerController->GetPacket(ID_PLAYER_BASEINFO)->RequestData(guid);
playerController->GetPacket(ID_PLAYER_DYNAMICSTATS)->RequestData(guid);
playerController->GetPacket(ID_PLAYER_POS)->RequestData(guid);
playerController->GetPacket(ID_PLAYER_CELL_CHANGE)->RequestData(guid);
playerController->GetPacket(ID_GAME_EQUIPMENT)->RequestData(guid);
playerController->GetPacket(ID_PLAYER_EQUIPMENT)->RequestData(guid);
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Sending info about other players to %lu",
guid.g);
@ -712,13 +712,13 @@ void Networking::newPlayer(RakNet::RakNetGUID guid)
// If we are iterating over a player who has inputted their name, proceed
else if (pl->second->getLoadState() == Player::POSTLOADED)
{
playerController->GetPacket(ID_GAME_BASE_INFO)->Send(pl->second, guid);
playerController->GetPacket(ID_GAME_DYNAMICSTATS)->Send(pl->second, guid);
playerController->GetPacket(ID_PLAYER_BASEINFO)->Send(pl->second, guid);
playerController->GetPacket(ID_PLAYER_DYNAMICSTATS)->Send(pl->second, guid);
playerController->GetPacket(ID_PLAYER_ATTRIBUTE)->Send(pl->second, guid);
playerController->GetPacket(ID_PLAYER_SKILL)->Send(pl->second, guid);
playerController->GetPacket(ID_GAME_POS)->Send(pl->second, guid);
playerController->GetPacket(ID_PLAYER_POS)->Send(pl->second, guid);
playerController->GetPacket(ID_PLAYER_CELL_CHANGE)->Send(pl->second, guid);
playerController->GetPacket(ID_GAME_EQUIPMENT)->Send(pl->second, guid);
playerController->GetPacket(ID_PLAYER_EQUIPMENT)->Send(pl->second, guid);
}
}

@ -15,7 +15,7 @@ void CharClassFunctions::SendClass(unsigned short pid) noexcept
Player *player;
GET_PLAYER(pid, player,);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_CHARCLASS)->Send(player, false);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_PLAYER_CHARCLASS)->Send(player, false);
}
void CharClassFunctions::SetDefaultClass(unsigned short pid, const char *id) noexcept

@ -29,7 +29,7 @@ void ItemFunctions::EquipItem(unsigned short pid, unsigned short slot, const cha
Player *player;
GET_PLAYER(pid, player,);
player->equipedItems[slot].refid = itemId;
player->equipedItems[slot].refId = itemId;
player->equipedItems[slot].count = count;
player->equipedItems[slot].health = health;
}
@ -48,7 +48,7 @@ void ItemFunctions::AddItem(unsigned short pid, const char* itemId, unsigned int
GET_PLAYER(pid, player, );
Item item;
item.refid = itemId;
item.refId = itemId;
item.count = count;
item.health = health;
@ -62,7 +62,7 @@ void ItemFunctions::RemoveItem(unsigned short pid, const char* itemId, unsigned
GET_PLAYER(pid, player, );
Item item;
item.refid = itemId;
item.refId = itemId;
item.count = count;
player->inventoryChangesBuffer.items.push_back(item);
@ -84,7 +84,7 @@ bool ItemFunctions::HasItemEquipped(unsigned short pid, const char* itemId)
GET_PLAYER(pid, player, false);
for (int slot = 0; slot < MWWorld::InventoryStore::Slots; slot++)
if (Misc::StringUtils::ciEqual(player->equipedItems[slot].refid, itemId))
if (Misc::StringUtils::ciEqual(player->equipedItems[slot].refId, itemId))
return true;
return false;
}
@ -94,7 +94,7 @@ const char *ItemFunctions::GetEquipmentItemId(unsigned short pid, unsigned short
Player *player;
GET_PLAYER(pid, player, 0);
return player->equipedItems[slot].refid.c_str();
return player->equipedItems[slot].refId.c_str();
}
int ItemFunctions::GetEquipmentItemCount(unsigned short pid, unsigned short slot) noexcept
@ -121,7 +121,7 @@ const char *ItemFunctions::GetInventoryItemId(unsigned short pid, unsigned int i
if (i >= player->inventoryChanges.count)
return "invalid";
return player->inventoryChanges.items.at(i).refid.c_str();
return player->inventoryChanges.items.at(i).refId.c_str();
}
int ItemFunctions::GetInventoryItemCount(unsigned short pid, unsigned int i) noexcept
@ -145,8 +145,8 @@ void ItemFunctions::SendEquipment(unsigned short pid) noexcept
Player *player;
GET_PLAYER(pid, player, );
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_EQUIPMENT)->Send(player, false);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_EQUIPMENT)->Send(player, true);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_PLAYER_EQUIPMENT)->Send(player, false);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_PLAYER_EQUIPMENT)->Send(player, true);
}
void ItemFunctions::SendInventoryChanges(unsigned short pid) noexcept
@ -155,7 +155,7 @@ void ItemFunctions::SendInventoryChanges(unsigned short pid) noexcept
GET_PLAYER(pid, player, );
std::swap(player->inventoryChanges, player->inventoryChangesBuffer);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_INVENTORY)->Send(player, false);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_PLAYER_INVENTORY)->Send(player, false);
player->inventoryChanges = std::move(player->inventoryChangesBuffer);
player->inventoryChangesBuffer.items.clear();
}

@ -109,5 +109,5 @@ void PositionFunctions::SendPos(unsigned short pid) noexcept
Player *player;
GET_PLAYER(pid, player, );
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_POS)->Send(player, false);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_PLAYER_POS)->Send(player, false);
}

@ -73,7 +73,7 @@ void QuestFunctions::SendJournalChanges(unsigned short pid) noexcept
GET_PLAYER(pid, player, );
std::swap(player->journalChanges, player->journalChangesBuffer);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_JOURNAL)->Send(player, false);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_PLAYER_JOURNAL)->Send(player, false);
player->journalChanges = std::move(player->journalChangesBuffer);
player->journalChangesBuffer.journalItems.clear();
}

@ -64,7 +64,7 @@ void SpellFunctions::SendSpellbookChanges(unsigned short pid) noexcept
GET_PLAYER(pid, player, );
std::swap(player->spellbookChanges, player->spellbookChangesBuffer);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_SPELLBOOK)->Send(player, false);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_PLAYER_SPELLBOOK)->Send(player, false);
player->spellbookChanges = std::move(player->spellbookChangesBuffer);
player->spellbookChangesBuffer.spells.clear();
}

@ -453,7 +453,7 @@ void StatsFunctions::SetCharGenStage(unsigned short pid, int start, int end) noe
player->charGenStage.current = start;
player->charGenStage.end = end;
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_CHARGEN)->Send(player, false);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_PLAYER_CHARGEN)->Send(player, false);
}
void StatsFunctions::Resurrect(unsigned short pid)
@ -468,16 +468,16 @@ void StatsFunctions::SendBaseInfo(unsigned short pid) noexcept
Player *player;
GET_PLAYER(pid, player,);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_BASE_INFO)->Send(player, false);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_BASE_INFO)->Send(player, true);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_PLAYER_BASEINFO)->Send(player, false);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_PLAYER_BASEINFO)->Send(player, true);
}
void StatsFunctions::SendDynamicStats(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, );
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_DYNAMICSTATS)->Send(player, false);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_DYNAMICSTATS)->Send(player, true);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_PLAYER_DYNAMICSTATS)->Send(player, false);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_PLAYER_DYNAMICSTATS)->Send(player, true);
}
void StatsFunctions::SendAttributes(unsigned short pid) noexcept
@ -503,6 +503,6 @@ void StatsFunctions::SendLevel(unsigned short pid) noexcept
Player *player;
GET_PLAYER(pid, player, );
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_LEVEL)->Send(player, false);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_LEVEL)->Send(player, true);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_PLAYER_LEVEL)->Send(player, false);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_PLAYER_LEVEL)->Send(player, true);
}

@ -294,7 +294,7 @@ void DedicatedPlayer::updateEquipment()
{
MWWorld::ContainerStoreIterator it = invStore.getSlot(slot);
const string &dedicItem = equipedItems[slot].refid;
const string &dedicItem = equipedItems[slot].refId;
std::string item = "";
bool equal = false;
if (it != invStore.end())

@ -108,7 +108,7 @@ bool LocalPlayer::charGenThread()
windowManager->pushGuiMode(MWGui::GM_Review);
break;
}
getNetworking()->getPlayerPacket(ID_GAME_CHARGEN)->Send(this);
getNetworking()->getPlayerPacket(ID_PLAYER_CHARGEN)->Send(this);
charGenStage.current++;
return false;
@ -123,8 +123,8 @@ bool LocalPlayer::charGenThread()
npc = *player.get<ESM::NPC>()->mBase;
birthsign = world->getPlayer().getBirthSign();
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_GAME_BASE_INFO to server with my CharGen info");
getNetworking()->getPlayerPacket(ID_GAME_BASE_INFO)->Send(this);
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_PLAYER_BASEINFO to server with my CharGen info");
getNetworking()->getPlayerPacket(ID_PLAYER_BASEINFO)->Send(this);
// Send stats packets if this is the 2nd round of CharGen that
// only happens for new characters
@ -136,7 +136,7 @@ bool LocalPlayer::charGenThread()
updateLevel(true);
sendClass();
sendSpellbook();
getNetworking()->getPlayerPacket(ID_GAME_CHARGEN)->Send(this);
getNetworking()->getPlayerPacket(ID_PLAYER_CHARGEN)->Send(this);
}
sendCellStates();
@ -183,7 +183,7 @@ void LocalPlayer::updateDynamicStats(bool forceUpdate)
timer = 0;
getNetworking()->getPlayerPacket(ID_GAME_DYNAMICSTATS)->Send(this);
getNetworking()->getPlayerPacket(ID_PLAYER_DYNAMICSTATS)->Send(this);
}
}
}
@ -256,7 +256,7 @@ void LocalPlayer::updateLevel(bool forceUpdate)
if (ptrNpcStats.getLevel() != creatureStats.mLevel || forceUpdate)
{
creatureStats.mLevel = ptrNpcStats.getLevel();
getNetworking()->getPlayerPacket(ID_GAME_LEVEL)->Send(this);
getNetworking()->getPlayerPacket(ID_PLAYER_LEVEL)->Send(this);
// Also update skills to refresh level progress and attribute bonuses
// for next level up
@ -296,7 +296,7 @@ void LocalPlayer::updatePosition(bool forceUpdate)
direction.pos[1] = move.mPosition[1];
direction.pos[2] = move.mPosition[2];
getNetworking()->getPlayerPacket(ID_GAME_POS)->Send(this);
getNetworking()->getPlayerPacket(ID_PLAYER_POS)->Send(this);
}
else if (isJumping && world->isOnGround(player))
{
@ -308,7 +308,7 @@ void LocalPlayer::updatePosition(bool forceUpdate)
{
sentJumpEnd = true;
position = ptrPos;
getNetworking()->getPlayerPacket(ID_GAME_POS)->Send(this);
getNetworking()->getPlayerPacket(ID_PLAYER_POS)->Send(this);
}
}
@ -395,11 +395,11 @@ void LocalPlayer::updateEquipment(bool forceUpdate)
for (int slot = 0; slot < MWWorld::InventoryStore::Slots; slot++)
{
MWWorld::ContainerStoreIterator it = invStore.getSlot(slot);
if (it != invStore.end() && !::Misc::StringUtils::ciEqual(it->getCellRef().getRefId(), equipedItems[slot].refid))
if (it != invStore.end() && !::Misc::StringUtils::ciEqual(it->getCellRef().getRefId(), equipedItems[slot].refId))
{
equipChanged = true;
equipedItems[slot].refid = it->getCellRef().getRefId();
equipedItems[slot].refId = it->getCellRef().getRefId();
equipedItems[slot].health = it->getCellRef().getCharge();
if (slot == MWWorld::InventoryStore::Slot_CarriedRight)
{
@ -411,10 +411,10 @@ void LocalPlayer::updateEquipment(bool forceUpdate)
else
equipedItems[slot].count = invStore.count(it->getCellRef().getRefId());
}
else if (it == invStore.end() && !equipedItems[slot].refid.empty())
else if (it == invStore.end() && !equipedItems[slot].refId.empty())
{
equipChanged = true;
equipedItems[slot].refid = "";
equipedItems[slot].refId = "";
equipedItems[slot].count = 0;
equipedItems[slot].health = 0;
}
@ -424,7 +424,7 @@ void LocalPlayer::updateEquipment(bool forceUpdate)
{
RakNet::BitStream bs;
bs.ResetWritePointer();
getNetworking()->getPlayerPacket((RakNet::MessageID) ID_GAME_EQUIPMENT)->Packet(&bs, this, true);
getNetworking()->getPlayerPacket((RakNet::MessageID) ID_PLAYER_EQUIPMENT)->Packet(&bs, this, true);
getNetworking()->sendData(&bs);
equipChanged = false;
}
@ -448,8 +448,8 @@ void LocalPlayer::updateInventory(bool forceUpdate)
MWWorld::ContainerStoreIterator result(ptrInventory.begin());
for (; result != ptrInventory.end(); ++result)
{
item.refid = result->getCellRef().getRefId();
if (item.refid.find("$dynamic") != string::npos) // skip generated items (self enchanted for e.g.)
item.refId = result->getCellRef().getRefId();
if (item.refId.find("$dynamic") != string::npos) // skip generated items (self enchanted for e.g.)
continue;
item.count = result->getRefData().getCount();
@ -470,8 +470,8 @@ void LocalPlayer::updateInventory(bool forceUpdate)
{
for (MWWorld::ContainerStoreIterator iter(ptrInventory.begin()); iter != ptrInventory.end(); ++iter)
{
item.refid = iter->getCellRef().getRefId();
if (item.refid.find("$dynamic") != string::npos) // skip generated items (self enchanted for e.g.)
item.refId = iter->getCellRef().getRefId();
if (item.refId.find("$dynamic") != string::npos) // skip generated items (self enchanted for e.g.)
continue;
item.count = iter->getRefData().getCount();
@ -525,7 +525,7 @@ void LocalPlayer::updateAttackState(bool forceUpdate)
attack.refid = spell;
/*RakNet::BitStream bs;
getNetworking()->getPlayerPacket((RakNet::MessageID) ID_GAME_ATTACK)->Packet(&bs, this, true);
getNetworking()->getPlayerPacket((RakNet::MessageID) ID_PLAYER_ATTACK)->Packet(&bs, this, true);
getNetworking()->SendData(&bs);*/
}
else if (state == MWMechanics::DrawState_Weapon)
@ -623,7 +623,7 @@ void LocalPlayer::updateDrawStateAndFlags(bool forceUpdate)
mwmp::Main::get().getLocalPlayer()->updatePosition(true); // fix position after jump;
RakNet::BitStream bs;
getNetworking()->getPlayerPacket((RakNet::MessageID) ID_GAME_DRAWSTATE)->Packet(&bs, this, true);
getNetworking()->getPlayerPacket((RakNet::MessageID) ID_PLAYER_DRAWSTATE)->Packet(&bs, this, true);
getNetworking()->sendData(&bs);
//timer = 0;
}
@ -637,7 +637,7 @@ void LocalPlayer::addItems()
for (unsigned int i = 0; i < inventoryChanges.count; i++)
{
mwmp::Item item = inventoryChanges.items[i];
MWWorld::Ptr itemPtr = *ptrStore.add(item.refid, item.count, ptrPlayer);
MWWorld::Ptr itemPtr = *ptrStore.add(item.refId, item.count, ptrPlayer);
if (item.health != -1)
itemPtr.getCellRef().setCharge(item.health);
}
@ -689,7 +689,7 @@ void LocalPlayer::removeItems()
for (unsigned int i = 0; i < inventoryChanges.count; i++)
{
mwmp::Item item = inventoryChanges.items[i];
ptrStore.remove(item.refid, item.count, ptrPlayer);
ptrStore.remove(item.refId, item.count, ptrPlayer);
}
}
@ -866,19 +866,19 @@ void LocalPlayer::setEquipment()
{
mwmp::Item *currentItem = &equipedItems[slot];
if (!currentItem->refid.empty())
if (!currentItem->refId.empty())
{
MWWorld::ContainerStoreIterator it = ptrInventory.begin();
for (; it != ptrInventory.end(); ++it) // find item in inventory
{
if (::Misc::StringUtils::ciEqual(it->getCellRef().getRefId(), currentItem->refid))
if (::Misc::StringUtils::ciEqual(it->getCellRef().getRefId(), currentItem->refId))
break;
}
if (it == ptrInventory.end()) // if not exists add item
ptrInventory.equip(
slot,
ptrInventory.ContainerStore::add(
equipedItems[slot].refid.c_str(),
equipedItems[slot].refId.c_str(),
equipedItems[slot].count,
ptrPlayer),
ptrPlayer);
@ -952,7 +952,7 @@ void LocalPlayer::sendClass()
else
charClass.mId = cls->mId;
getNetworking()->getPlayerPacket(ID_GAME_CHARCLASS)->Send(this);
getNetworking()->getPlayerPacket(ID_PLAYER_CHARCLASS)->Send(this);
}
void LocalPlayer::sendInventory()
@ -965,8 +965,8 @@ void LocalPlayer::sendInventory()
for (MWWorld::ContainerStoreIterator iter(ptrInventory.begin()); iter != ptrInventory.end(); ++iter)
{
item.refid = iter->getCellRef().getRefId();
if (item.refid.find("$dynamic") != string::npos) // skip generated items (self enchanted for e.g.)
item.refId = iter->getCellRef().getRefId();
if (item.refId.find("$dynamic") != string::npos) // skip generated items (self enchanted for e.g.)
continue;
item.count = iter->getRefData().getCount();
@ -977,7 +977,7 @@ void LocalPlayer::sendInventory()
inventoryChanges.count = (unsigned int) inventoryChanges.items.size();
inventoryChanges.action = InventoryChanges::SET;
Main::get().getNetworking()->getPlayerPacket(ID_GAME_INVENTORY)->Send(this);
Main::get().getNetworking()->getPlayerPacket(ID_PLAYER_INVENTORY)->Send(this);
}
void LocalPlayer::sendSpellbook()
@ -999,7 +999,7 @@ void LocalPlayer::sendSpellbook()
}
spellbookChanges.action = SpellbookChanges::SET;
Main::get().getNetworking()->getPlayerPacket(ID_GAME_SPELLBOOK)->Send(this);
Main::get().getNetworking()->getPlayerPacket(ID_PLAYER_SPELLBOOK)->Send(this);
}
void LocalPlayer::sendCellStates()
@ -1020,7 +1020,7 @@ void LocalPlayer::sendSpellAddition(std::string id)
spellbookChanges.spells.push_back(spell);
spellbookChanges.action = SpellbookChanges::ADD;
Main::get().getNetworking()->getPlayerPacket(ID_GAME_SPELLBOOK)->Send(this);
Main::get().getNetworking()->getPlayerPacket(ID_PLAYER_SPELLBOOK)->Send(this);
}
void LocalPlayer::sendSpellRemoval(std::string id)
@ -1035,7 +1035,7 @@ void LocalPlayer::sendSpellRemoval(std::string id)
spellbookChanges.spells.push_back(spell);
spellbookChanges.action = SpellbookChanges::REMOVE;
Main::get().getNetworking()->getPlayerPacket(ID_GAME_SPELLBOOK)->Send(this);
Main::get().getNetworking()->getPlayerPacket(ID_PLAYER_SPELLBOOK)->Send(this);
}
void LocalPlayer::sendSpellAddition(const ESM::Spell &spell)
@ -1063,7 +1063,7 @@ void LocalPlayer::sendJournalEntry(const std::string& quest, int index, const MW
journalChanges.journalItems.push_back(journalItem);
Main::get().getNetworking()->getPlayerPacket(ID_GAME_JOURNAL)->Send(this);
Main::get().getNetworking()->getPlayerPacket(ID_PLAYER_JOURNAL)->Send(this);
}
void LocalPlayer::sendJournalIndex(const std::string& quest, int index)
@ -1077,7 +1077,7 @@ void LocalPlayer::sendJournalIndex(const std::string& quest, int index)
journalChanges.journalItems.push_back(journalItem);
Main::get().getNetworking()->getPlayerPacket(ID_GAME_JOURNAL)->Send(this);
Main::get().getNetworking()->getPlayerPacket(ID_PLAYER_JOURNAL)->Send(this);
}
void LocalPlayer::sendAttack(Attack::TYPE type)
@ -1087,7 +1087,7 @@ void LocalPlayer::sendAttack(Attack::TYPE type)
attack.type = type;
attack.pressed = false;
RakNet::BitStream bs;
getNetworking()->getPlayerPacket((RakNet::MessageID) ID_GAME_ATTACK)->Packet(&bs, this, true);
getNetworking()->getPlayerPacket((RakNet::MessageID) ID_PLAYER_ATTACK)->Packet(&bs, this, true);
getNetworking()->sendData(&bs);
}
@ -1146,6 +1146,6 @@ void LocalPlayer::prepareAttack(Attack::TYPE type, bool state)
attack.attacker = guid;
RakNet::BitStream bs;
getNetworking()->getPlayerPacket((RakNet::MessageID) ID_GAME_ATTACK)->Packet(&bs, this, true);
getNetworking()->getPlayerPacket((RakNet::MessageID) ID_PLAYER_ATTACK)->Packet(&bs, this, true);
getNetworking()->sendData(&bs);
}

@ -188,9 +188,9 @@ void Main::updateWorld(float dt) const
if (init)
{
init = false;
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_GAME_BASE_INFO to server");
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_PLAYER_BASEINFO to server");
mNetworking->getPlayerPacket(ID_GAME_BASE_INFO)->Send(getLocalPlayer());
mNetworking->getPlayerPacket(ID_PLAYER_BASEINFO)->Send(getLocalPlayer());
mNetworking->getPlayerPacket(ID_LOADED)->Send(getLocalPlayer());
mLocalPlayer->updateDynamicStats(true);
get().getGUIController()->setChatVisible(true);

@ -193,9 +193,9 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
myPacket->Send(getLocalPlayer(), serverAddr);
break;
}
case ID_GAME_BASE_INFO:
case ID_PLAYER_BASEINFO:
{
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_GAME_BASE_INFO from server");
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_PLAYER_BASEINFO from server");
if (guid == myGuid)
{
@ -228,13 +228,13 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
}
break;
}
case ID_GAME_POS:
case ID_PLAYER_POS:
{
if (guid == myGuid)
{
if (packet->length != myPacket->headerSize())
{
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "ID_GAME_POS changed by server");
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "ID_PLAYER_POS changed by server");
myPacket->Packet(&bsIn, getLocalPlayer(), false);
getLocalPlayer()->setPosition();
}
@ -263,7 +263,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
Players::disconnectPlayer(guid);
}
case ID_GAME_EQUIPMENT:
case ID_PLAYER_EQUIPMENT:
{
if (guid == myGuid)
{
@ -284,7 +284,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
}
break;
}
case ID_GAME_INVENTORY:
case ID_PLAYER_INVENTORY:
{
if (guid == myGuid)
{
@ -313,7 +313,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
}
break;
}
case ID_GAME_SPELLBOOK:
case ID_PLAYER_SPELLBOOK:
{
if (guid == myGuid)
{
@ -342,7 +342,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
}
break;
}
case ID_GAME_JOURNAL:
case ID_PLAYER_JOURNAL:
{
if (guid == myGuid)
{
@ -358,7 +358,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
}
break;
}
case ID_GAME_ATTACK:
case ID_PLAYER_ATTACK:
{
if (pl != 0)
{
@ -425,7 +425,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
}
break;
}
case ID_GAME_DYNAMICSTATS:
case ID_PLAYER_DYNAMICSTATS:
{
if (guid == myGuid)
{
@ -492,7 +492,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
myPacket->Send(getLocalPlayer(), serverAddr);
getLocalPlayer()->updateDynamicStats(true);
playerController.GetPacket(ID_GAME_DYNAMICSTATS)->Send(getLocalPlayer(), serverAddr);
playerController.GetPacket(ID_PLAYER_DYNAMICSTATS)->Send(getLocalPlayer(), serverAddr);
}
else if (pl != 0)
{
@ -538,7 +538,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
break;
}
case ID_GAME_DRAWSTATE:
case ID_PLAYER_DRAWSTATE:
{
if (guid == myGuid)
getLocalPlayer()->updateDrawStateAndFlags(true);
@ -566,7 +566,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
break;
}
case ID_GAME_CHARGEN:
case ID_PLAYER_CHARGEN:
{
if (guid == myGuid)
{
@ -634,7 +634,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
}
break;
}
case ID_GAME_LEVEL:
case ID_PLAYER_LEVEL:
{
if (guid == myGuid)
{
@ -682,7 +682,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
}
break;
}
case ID_GAME_CHARCLASS:
case ID_PLAYER_CHARCLASS:
{
if (guid == myGuid)
{

@ -152,14 +152,16 @@ add_component_dir (openmw-mp
Controllers/PlayerPacketController Controllers/WorldPacketController
Packets/BasePacket Packets/Player/PlayerPacket Packets/World/WorldPacket
Packets/Player/PacketBaseInfo Packets/Player/PacketPosition Packets/Player/PacketEquipment
Packets/Player/PacketAttack Packets/Player/PacketDynamicStats Packets/Player/PacketDrawState
Packets/Player/PacketChatMessage Packets/Player/PacketCharGen Packets/Player/PacketPlayerAttribute
Packets/Player/PacketPlayerSkill Packets/Player/PacketLevel Packets/Player/PacketHandshake
Packets/Player/PacketGUIBoxes Packets/Player/PacketClass Packets/Player/PacketTime
Packets/Player/PacketInventory Packets/Player/PacketSpellbook Packets/Player/PacketJournal
Packets/Player/PacketActiveSkills Packets/Player/PacketPlayerCellChange
Packets/Player/PacketPlayerCellState
Packets/Player/PacketHandshake Packets/Player/PacketChatMessage
Packets/Player/PacketPlayerBaseInfo Packets/Player/PacketPlayerPosition Packets/Player/PacketPlayerEquipment
Packets/Player/PacketPlayerAttack Packets/Player/PacketPlayerDynamicStats Packets/Player/PacketPlayerDrawState
Packets/Player/PacketPlayerCharGen Packets/Player/PacketPlayerAttribute Packets/Player/PacketPlayerSkill
Packets/Player/PacketPlayerLevel Packets/Player/PacketPlayerClass Packets/Player/PacketPlayerInventory
Packets/Player/PacketPlayerSpellbook Packets/Player/PacketPlayerJournal Packets/Player/PacketPlayerActiveSkills
Packets/Player/PacketPlayerCellChange Packets/Player/PacketPlayerCellState
Packets/Player/PacketGUIBoxes Packets/Player/PacketTime
Packets/World/PacketObjectDelete Packets/World/PacketObjectPlace Packets/World/PacketObjectScale
Packets/World/PacketObjectHealth Packets/World/PacketObjectLock Packets/World/PacketObjectUnlock

@ -37,12 +37,12 @@ namespace mwmp
struct Item
{
std::string refid;
std::string refId;
int count;
int health;
inline bool operator==(const Item& rhs)
{
return refid == rhs.refid && count == rhs.count && health == rhs.health;
return refId == rhs.refId && count == rhs.count && health == rhs.health;
}
};

@ -2,33 +2,33 @@
#include <boost/foreach.hpp>
#include <boost/make_shared.hpp>
#include "../Packets/Player/PacketClass.hpp"
#include "../Packets/Player/PacketPosition.hpp"
#include "../Packets/Player/PacketPlayerClass.hpp"
#include "../Packets/Player/PacketPlayerPosition.hpp"
#include "../Packets/Player/PacketPlayerCellChange.hpp"
#include "../Packets/Player/PacketPlayerCellState.hpp"
#include "../Packets/Player/PacketBaseInfo.hpp"
#include "../Packets/Player/PacketEquipment.hpp"
#include "../Packets/Player/PacketAttack.hpp"
#include "../Packets/Player/PacketDynamicStats.hpp"
#include "../Packets/Player/PacketPlayerBaseInfo.hpp"
#include "../Packets/Player/PacketPlayerEquipment.hpp"
#include "../Packets/Player/PacketPlayerAttack.hpp"
#include "../Packets/Player/PacketPlayerDynamicStats.hpp"
#include "../Packets/Player/PacketResurrect.hpp"
#include "../Packets/Player/PacketDie.hpp"
#include "../Packets/Player/PacketSendMyID.hpp"
#include "../Packets/Player/PacketDisconnect.hpp"
#include "../Packets/Player/PacketDrawState.hpp"
#include "../Packets/Player/PacketPlayerDrawState.hpp"
#include "../Packets/Player/PacketChatMessage.hpp"
#include "../Packets/Player/PacketCharGen.hpp"
#include "../Packets/Player/PacketPlayerCharGen.hpp"
#include "../Packets/Player/PacketPlayerAttribute.hpp"
#include "../Packets/Player/PacketPlayerSkill.hpp"
#include "../Packets/Player/PacketLevel.hpp"
#include "../Packets/Player/PacketPlayerLevel.hpp"
#include "../Packets/Player/PacketHandshake.hpp"
#include "../Packets/Player/PacketGUIBoxes.hpp"
#include "../Packets/Player/PacketTime.hpp"
#include "../Packets/Player/PacketLoaded.hpp"
#include "../Packets/Player/PacketInventory.hpp"
#include "../Packets/Player/PacketSpellbook.hpp"
#include "../Packets/Player/PacketJournal.hpp"
#include "../Packets/Player/PacketPlayerInventory.hpp"
#include "../Packets/Player/PacketPlayerSpellbook.hpp"
#include "../Packets/Player/PacketPlayerJournal.hpp"
#include "../Packets/Player/PacketConsole.hpp"
#include "../Packets/Player/PacketActiveSkills.hpp"
#include "../Packets/Player/PacketPlayerActiveSkills.hpp"
#include "PlayerPacketController.hpp"
@ -42,38 +42,38 @@ inline void AddPacket(mwmp::PlayerPacketController::packets_t *packets, RakNet::
mwmp::PlayerPacketController::PlayerPacketController(RakNet::RakPeerInterface *peer)
{
AddPacket<PacketPosition>(&packets, peer);
AddPacket<PacketPlayerPosition>(&packets, peer);
AddPacket<PacketPlayerCellChange>(&packets, peer);
AddPacket<PacketPlayerCellState>(&packets, peer);
AddPacket<PacketBaseInfo>(&packets, peer);
AddPacket<PacketEquipment>(&packets, peer);
AddPacket<PacketPlayerBaseInfo>(&packets, peer);
AddPacket<PacketPlayerEquipment>(&packets, peer);
AddPacket<PacketAttack>(&packets, peer);
AddPacket<PacketDynamicStats>(&packets, peer);
AddPacket<PacketPlayerAttack>(&packets, peer);
AddPacket<PacketPlayerDynamicStats>(&packets, peer);
AddPacket<PacketResurrect>(&packets, peer);
AddPacket<PacketDie>(&packets, peer);
AddPacket<PacketDrawState>(&packets, peer);
AddPacket<PacketPlayerDrawState>(&packets, peer);
AddPacket<PacketSendMyID>(&packets, peer);
AddPacket<PacketDisconnect>(&packets, peer);
AddPacket<PacketChatMessage>(&packets, peer);
AddPacket<PacketCharGen>(&packets, peer);
AddPacket<PacketPlayerCharGen>(&packets, peer);
AddPacket<PacketPlayerAttribute>(&packets, peer);
AddPacket<PacketPlayerSkill>(&packets, peer);
AddPacket<PacketLevel>(&packets, peer);
AddPacket<PacketPlayerLevel>(&packets, peer);
AddPacket<PacketHandshake>(&packets, peer);
AddPacket<PacketGUIBoxes>(&packets, peer);
AddPacket<PacketClass>(&packets, peer);
AddPacket<PacketPlayerClass>(&packets, peer);
AddPacket<PacketTime>(&packets, peer);
AddPacket<PacketLoaded>(&packets, peer);
AddPacket<PacketInventory>(&packets, peer);
AddPacket<PacketSpellbook>(&packets, peer);
AddPacket<PacketJournal>(&packets, peer);
AddPacket<PacketPlayerInventory>(&packets, peer);
AddPacket<PacketPlayerSpellbook>(&packets, peer);
AddPacket<PacketPlayerJournal>(&packets, peer);
AddPacket<PacketActiveSkills>(&packets, peer);
AddPacket<PacketPlayerActiveSkills>(&packets, peer);
AddPacket<PacketConsole>(&packets, peer);
}

@ -10,31 +10,31 @@
enum GameMessages
{
ID_MASTER_QUERY = ID_USER_PACKET_ENUM+1,
ID_GAME_BASE_INFO,
ID_GAME_CHARGEN,
ID_GAME_POS,
ID_GAME_DYNAMICSTATS,
ID_GAME_ATTACK,
ID_PLAYER_BASEINFO,
ID_PLAYER_CHARGEN,
ID_PLAYER_POS,
ID_PLAYER_DYNAMICSTATS,
ID_PLAYER_ATTACK,
ID_USER_MYID,
ID_GAME_EQUIPMENT,
ID_PLAYER_EQUIPMENT,
ID_USER_DISCONNECTED,
ID_GAME_DIE,
ID_GAME_RESURRECT,
ID_CHAT_MESSAGE,
ID_GAME_DRAWSTATE,
ID_PLAYER_DRAWSTATE,
ID_PLAYER_ATTRIBUTE,
ID_PLAYER_SKILL,
ID_GAME_LEVEL,
ID_GAME_CHARCLASS,
ID_PLAYER_LEVEL,
ID_PLAYER_CHARCLASS,
ID_HANDSHAKE,
ID_LOADED,
ID_GUI_MESSAGEBOX,
ID_GAME_TIME,
ID_GAME_INVENTORY,
ID_GAME_SPELLBOOK,
ID_GAME_JOURNAL,
ID_GAME_ACTIVESKILLS,
ID_PLAYER_INVENTORY,
ID_PLAYER_SPELLBOOK,
ID_PLAYER_JOURNAL,
ID_PLAYER_ACTIVESKILLS,
ID_PLAYER_CELL_CHANGE,
ID_PLAYER_CELL_STATE,

@ -1,21 +0,0 @@
//
// Created by koncord on 03.12.16.
//
#ifndef OPENMW_PACKETACTIVESKILLS_HPP
#define OPENMW_PACKETACTIVESKILLS_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
namespace mwmp
{
class PacketActiveSkills : public PlayerPacket
{
public:
PacketActiveSkills(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send);
};
}
#endif //OPENMW_PACKETACTIVESKILLS_HPP

@ -1,21 +0,0 @@
//
// Created by koncord on 07.01.16.
//
#ifndef OPENMW_PACKETBASEINFO_HPP
#define OPENMW_PACKETBASEINFO_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
namespace mwmp
{
class PacketBaseInfo : public PlayerPacket
{
public:
PacketBaseInfo(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send);
};
}
#endif //OPENMW_PACKETBASEINFO_HPP

@ -1,19 +0,0 @@
//
// Created by koncord on 08.03.16.
//
#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketCharGen.hpp"
mwmp::PacketCharGen::PacketCharGen(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
{
packetID = ID_GAME_CHARGEN;
}
void mwmp::PacketCharGen::Packet(RakNet::BitStream *bs, mwmp::BasePlayer *player, bool send)
{
PlayerPacket::Packet(bs, player, send);
RW(player->charGenStage, send);
}

@ -1,20 +0,0 @@
//
// Created by koncord on 15.01.16.
//
#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketDrawState.hpp"
mwmp::PacketDrawState::PacketDrawState(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
{
packetID = ID_GAME_DRAWSTATE;
}
void mwmp::PacketDrawState::Packet(RakNet::BitStream *bs, mwmp::BasePlayer *player, bool send)
{
PlayerPacket::Packet(bs, player, send);
RW(player->movementFlags, send);
RW(player->drawState, send);
}

@ -1,23 +0,0 @@
//
// Created by koncord on 15.01.16.
//
#ifndef OPENMW_PACKETDRAWSTATE_HPP
#define OPENMW_PACKETDRAWSTATE_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
namespace mwmp
{
class PacketDrawState : public PlayerPacket
{
public:
PacketDrawState(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send);
};
}
#endif //OPENMW_PACKETDRAWSTATE_HPP

@ -1,22 +0,0 @@
//
// Created by koncord on 22.10.16.
//
#ifndef OPENMW_PACKETINVENTORY_HPP
#define OPENMW_PACKETINVENTORY_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
namespace mwmp
{
class PacketInventory : public PlayerPacket
{
public:
PacketInventory(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send);
};
}
#endif //OPENMW_PACKETINVENTORY_HPP

@ -1,18 +0,0 @@
#ifndef OPENMW_PACKETJOURNAL_HPP
#define OPENMW_PACKETJOURNAL_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
namespace mwmp
{
class PacketJournal : public PlayerPacket
{
public:
PacketJournal(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send);
};
}
#endif //OPENMW_PACKETJOURNAL_HPP

@ -1,20 +0,0 @@
//
// Created by David Cernat on 25.09.16.
//
#include "PacketLevel.hpp"
#include <components/openmw-mp/NetworkMessages.hpp>
using namespace mwmp;
PacketLevel::PacketLevel(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
{
packetID = ID_GAME_LEVEL;
}
void PacketLevel::Packet(RakNet::BitStream *bs, BasePlayer *player, bool send)
{
PlayerPacket::Packet(bs, player, send);
RW(player->creatureStats.mLevel, send);
}

@ -1,21 +0,0 @@
//
// Created by David Cernat on 25.09.16.
//
#ifndef OPENMW_PACKETLEVEL_HPP
#define OPENMW_PACKETLEVEL_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
namespace mwmp
{
class PacketLevel : public PlayerPacket
{
public:
PacketLevel(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send);
};
}
#endif //OPENMW_PACKETLEVEL_HPP

@ -2,17 +2,17 @@
// Created by koncord on 03.12.16.
//
#include "PacketActiveSkills.hpp"
#include "PacketPlayerActiveSkills.hpp"
#include <components/openmw-mp/NetworkMessages.hpp>
using namespace mwmp;
PacketActiveSkills::PacketActiveSkills(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
PacketPlayerActiveSkills::PacketPlayerActiveSkills(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
{
packetID = ID_GAME_ACTIVESKILLS;
packetID = ID_PLAYER_ACTIVESKILLS;
}
void PacketActiveSkills::Packet(RakNet::BitStream *bs, mwmp::BasePlayer *player, bool send)
void PacketPlayerActiveSkills::Packet(RakNet::BitStream *bs, mwmp::BasePlayer *player, bool send)
{
PlayerPacket::Packet(bs, player, send);

@ -0,0 +1,21 @@
//
// Created by koncord on 03.12.16.
//
#ifndef OPENMW_PACKETPLAYERACTIVESKILLS_HPP
#define OPENMW_PACKETPLAYERACTIVESKILLS_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
namespace mwmp
{
class PacketPlayerActiveSkills : public PlayerPacket
{
public:
PacketPlayerActiveSkills(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send);
};
}
#endif //OPENMW_PACKETPLAYERACTIVESKILLS_HPP

@ -3,16 +3,16 @@
//
#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketAttack.hpp"
#include "PacketPlayerAttack.hpp"
using namespace mwmp;
PacketAttack::PacketAttack(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
PacketPlayerAttack::PacketPlayerAttack(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
{
packetID = ID_GAME_ATTACK;
packetID = ID_PLAYER_ATTACK;
}
void PacketAttack::Packet(RakNet::BitStream *bs, mwmp::BasePlayer *player, bool send)
void PacketPlayerAttack::Packet(RakNet::BitStream *bs, mwmp::BasePlayer *player, bool send)
{
PlayerPacket::Packet(bs, player, send);

@ -2,21 +2,21 @@
// Created by koncord on 13.01.16.
//
#ifndef OPENMW_PACKETATTACK_HPP
#define OPENMW_PACKETATTACK_HPP
#ifndef OPENMW_PACKETPLAYERATTACK_HPP
#define OPENMW_PACKETPLAYERATTACK_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
namespace mwmp
{
class PacketAttack : public PlayerPacket
class PacketPlayerAttack : public PlayerPacket
{
public:
PacketAttack(RakNet::RakPeerInterface *peer);
PacketPlayerAttack(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send);
};
}
#endif //OPENMW_PACKETATTACK_HPP
#endif //OPENMW_PACKETPLAYERATTACK_HPP

@ -2,17 +2,17 @@
// Created by koncord on 07.01.16.
//
#include "PacketBaseInfo.hpp"
#include "PacketPlayerBaseInfo.hpp"
#include <components/openmw-mp/NetworkMessages.hpp>
using namespace mwmp;
PacketBaseInfo::PacketBaseInfo(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
PacketPlayerBaseInfo::PacketPlayerBaseInfo(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
{
packetID = ID_GAME_BASE_INFO;
packetID = ID_PLAYER_BASEINFO;
}
void PacketBaseInfo::Packet(RakNet::BitStream *bs, BasePlayer *player, bool send)
void PacketPlayerBaseInfo::Packet(RakNet::BitStream *bs, BasePlayer *player, bool send)
{
PlayerPacket::Packet(bs, player, send);

@ -2,20 +2,20 @@
// Created by koncord on 07.01.16.
//
#ifndef OPENMW_PACKETEQUIPMENT_HPP
#define OPENMW_PACKETEQUIPMENT_HPP
#ifndef OPENMW_PACKETPLAYERBASEINFO_HPP
#define OPENMW_PACKETPLAYERBASEINFO_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
namespace mwmp
{
class PacketEquipment : public PlayerPacket
class PacketPlayerBaseInfo : public PlayerPacket
{
public:
PacketEquipment(RakNet::RakPeerInterface *peer);
PacketPlayerBaseInfo(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send);
};
}
#endif //OPENMW_PACKETEQUIPMENT_HPP
#endif //OPENMW_PACKETPLAYERBASEINFO_HPP

@ -0,0 +1,19 @@
//
// Created by koncord on 08.03.16.
//
#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketPlayerCharGen.hpp"
mwmp::PacketPlayerCharGen::PacketPlayerCharGen(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
{
packetID = ID_PLAYER_CHARGEN;
}
void mwmp::PacketPlayerCharGen::Packet(RakNet::BitStream *bs, mwmp::BasePlayer *player, bool send)
{
PlayerPacket::Packet(bs, player, send);
RW(player->charGenStage, send);
}

@ -2,18 +2,18 @@
// Created by koncord on 08.03.16.
//
#ifndef OPENMW_PACKETCHARGEN_HPP
#define OPENMW_PACKETCHARGEN_HPP
#ifndef OPENMW_PACKETPLAYERCHARGEN_HPP
#define OPENMW_PACKETPLAYERCHARGEN_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
namespace mwmp
{
class PacketCharGen : public PlayerPacket
class PacketPlayerCharGen : public PlayerPacket
{
public:
PacketCharGen(RakNet::RakPeerInterface *peer);
PacketPlayerCharGen(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send);
};
@ -21,4 +21,4 @@ namespace mwmp
#endif //OPENMW_PACKETCHARGEN_HPP
#endif //OPENMW_PACKETPLAYERCHARGEN_HPP

@ -3,14 +3,14 @@
//
#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketClass.hpp"
#include "PacketPlayerClass.hpp"
mwmp::PacketClass::PacketClass(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
mwmp::PacketPlayerClass::PacketPlayerClass(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
{
packetID = ID_GAME_CHARCLASS;
packetID = ID_PLAYER_CHARCLASS;
}
void mwmp::PacketClass::Packet(RakNet::BitStream *bs, mwmp::BasePlayer *player, bool send)
void mwmp::PacketPlayerClass::Packet(RakNet::BitStream *bs, mwmp::BasePlayer *player, bool send)
{
PlayerPacket::Packet(bs, player, send);

@ -2,22 +2,22 @@
// Created by koncord on 29.08.16.
//
#ifndef OPENMW_PACKETCLASS_HPP
#define OPENMW_PACKETCLASS_HPP
#ifndef OPENMW_PACKETPLAYERCLASS_HPP
#define OPENMW_PACKETPLAYERCLASS_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
namespace mwmp
{
class PacketClass : public PlayerPacket
class PacketPlayerClass : public PlayerPacket
{
public:
PacketClass(RakNet::RakPeerInterface *peer);
PacketPlayerClass(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send);
};
}
#endif //OPENMW_PACKETCLASS_HPP
#endif //OPENMW_PACKETPLAYERCLASS_HPP

@ -0,0 +1,20 @@
//
// Created by koncord on 15.01.16.
//
#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketPlayerDrawState.hpp"
mwmp::PacketPlayerDrawState::PacketPlayerDrawState(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
{
packetID = ID_PLAYER_DRAWSTATE;
}
void mwmp::PacketPlayerDrawState::Packet(RakNet::BitStream *bs, mwmp::BasePlayer *player, bool send)
{
PlayerPacket::Packet(bs, player, send);
RW(player->movementFlags, send);
RW(player->drawState, send);
}

@ -0,0 +1,23 @@
//
// Created by koncord on 15.01.16.
//
#ifndef OPENMW_PACKETPLAYERDRAWSTATE_HPP
#define OPENMW_PACKETPLAYERDRAWSTATE_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
namespace mwmp
{
class PacketPlayerDrawState : public PlayerPacket
{
public:
PacketPlayerDrawState(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send);
};
}
#endif //OPENMW_PACKETPLAYERDRAWSTATE_HPP

@ -2,17 +2,17 @@
// Created by koncord on 13.01.16.
//
#include "PacketDynamicStats.hpp"
#include "PacketPlayerDynamicStats.hpp"
#include <components/openmw-mp/NetworkMessages.hpp>
using namespace mwmp;
PacketDynamicStats::PacketDynamicStats(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
PacketPlayerDynamicStats::PacketPlayerDynamicStats(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
{
packetID = ID_GAME_DYNAMICSTATS;
packetID = ID_PLAYER_DYNAMICSTATS;
}
void PacketDynamicStats::Packet(RakNet::BitStream *bs, BasePlayer *player, bool send)
void PacketPlayerDynamicStats::Packet(RakNet::BitStream *bs, BasePlayer *player, bool send)
{
PlayerPacket::Packet(bs, player, send);
RW(player->creatureStats.mDynamic[0], send); // health

@ -2,21 +2,21 @@
// Created by koncord on 13.01.16.
//
#ifndef OPENMW_PACKAGEDYNAMICSTATS_HPP
#define OPENMW_PACKAGEDYNAMICSTATS_HPP
#ifndef OPENMW_PACKETDYNAMICSTATS_HPP
#define OPENMW_PACKETDYNAMICSTATS_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
namespace mwmp
{
class PacketDynamicStats : public PlayerPacket
class PacketPlayerDynamicStats : public PlayerPacket
{
public:
PacketDynamicStats(RakNet::RakPeerInterface *peer);
PacketPlayerDynamicStats(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send);
};
}
#endif //OPENMW_PACKAGEDYNAMICSTATS_HPP
#endif //OPENMW_PACKETDYNAMICSTATS_HPP

@ -2,23 +2,23 @@
// Created by koncord on 07.01.16.
//
#include "PacketEquipment.hpp"
#include "PacketPlayerEquipment.hpp"
#include <components/openmw-mp/NetworkMessages.hpp>
using namespace mwmp;
PacketEquipment::PacketEquipment(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
PacketPlayerEquipment::PacketPlayerEquipment(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
{
packetID = ID_GAME_EQUIPMENT;
packetID = ID_PLAYER_EQUIPMENT;
}
void PacketEquipment::Packet(RakNet::BitStream *bs, BasePlayer *player, bool send)
void PacketPlayerEquipment::Packet(RakNet::BitStream *bs, BasePlayer *player, bool send)
{
PlayerPacket::Packet(bs, player, send);
for (int i = 0; i < 19; i++)
{
RW(player->equipedItems[i].refid, send);
RW(player->equipedItems[i].refId, send);
RW(player->equipedItems[i].count, send);
RW(player->equipedItems[i].health, send);
}

@ -0,0 +1,21 @@
//
// Created by koncord on 07.01.16.
//
#ifndef OPENMW_PACKETPLAYEREQUIPMENT_HPP
#define OPENMW_PACKETPLAYEREQUIPMENT_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
namespace mwmp
{
class PacketPlayerEquipment : public PlayerPacket
{
public:
PacketPlayerEquipment(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send);
};
}
#endif //OPENMW_PACKETPLAYEREQUIPMENT_HPP

@ -3,17 +3,17 @@
//
#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketInventory.hpp"
#include "PacketPlayerInventory.hpp"
using namespace std;
using namespace mwmp;
PacketInventory::PacketInventory(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
PacketPlayerInventory::PacketPlayerInventory(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
{
packetID = ID_GAME_INVENTORY;
packetID = ID_PLAYER_INVENTORY;
}
void PacketInventory::Packet(RakNet::BitStream *bs, BasePlayer *player, bool send)
void PacketPlayerInventory::Packet(RakNet::BitStream *bs, BasePlayer *player, bool send)
{
PlayerPacket::Packet(bs, player, send);
@ -33,13 +33,13 @@ void PacketInventory::Packet(RakNet::BitStream *bs, BasePlayer *player, bool sen
if (send)
{
item = player->inventoryChanges.items[i];
RW(item.refid, send);
RW(item.refId, send);
RW(item.count, send);
RW(item.health, send);
}
else
{
RW(item.refid, send);
RW(item.refId, send);
RW(item.count, send);
RW(item.health, send);
player->inventoryChanges.items.push_back(item);

@ -0,0 +1,22 @@
//
// Created by koncord on 22.10.16.
//
#ifndef OPENMW_PACKETPLAYERINVENTORY_HPP
#define OPENMW_PACKETPLAYERINVENTORY_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
namespace mwmp
{
class PacketPlayerInventory : public PlayerPacket
{
public:
PacketPlayerInventory(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send);
};
}
#endif //OPENMW_PACKETPLAYERINVENTORY_HPP

@ -1,15 +1,15 @@
#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketJournal.hpp"
#include "PacketPlayerJournal.hpp"
using namespace std;
using namespace mwmp;
PacketJournal::PacketJournal(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
PacketPlayerJournal::PacketPlayerJournal(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
{
packetID = ID_GAME_JOURNAL;
packetID = ID_PLAYER_JOURNAL;
}
void PacketJournal::Packet(RakNet::BitStream *bs, BasePlayer *player, bool send)
void PacketPlayerJournal::Packet(RakNet::BitStream *bs, BasePlayer *player, bool send)
{
PlayerPacket::Packet(bs, player, send);

@ -0,0 +1,18 @@
#ifndef OPENMW_PACKETPLAYERJOURNAL_HPP
#define OPENMW_PACKETPLAYERJOURNAL_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
namespace mwmp
{
class PacketPlayerJournal : public PlayerPacket
{
public:
PacketPlayerJournal(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send);
};
}
#endif //OPENMW_PACKETPLAYERJOURNAL_HPP

@ -0,0 +1,16 @@
#include "PacketPlayerLevel.hpp"
#include <components/openmw-mp/NetworkMessages.hpp>
using namespace mwmp;
PacketPlayerLevel::PacketPlayerLevel(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
{
packetID = ID_PLAYER_LEVEL;
}
void PacketPlayerLevel::Packet(RakNet::BitStream *bs, BasePlayer *player, bool send)
{
PlayerPacket::Packet(bs, player, send);
RW(player->creatureStats.mLevel, send);
}

@ -0,0 +1,17 @@
#ifndef OPENMW_PACKETPLAYERLEVEL_HPP
#define OPENMW_PACKETPLAYERLEVEL_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
namespace mwmp
{
class PacketPlayerLevel : public PlayerPacket
{
public:
PacketPlayerLevel(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send);
};
}
#endif //OPENMW_PACKETPLAYERLEVEL_HPP

@ -2,20 +2,20 @@
// Created by koncord on 05.01.16.
//
#include "PacketPosition.hpp"
#include "PacketPlayerPosition.hpp"
#include <components/openmw-mp/NetworkMessages.hpp>
using namespace std;
using namespace mwmp;
PacketPosition::PacketPosition(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
PacketPlayerPosition::PacketPlayerPosition(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
{
packetID = ID_GAME_POS;
packetID = ID_PLAYER_POS;
priority = MEDIUM_PRIORITY;
//reliability = UNRELIABLE_SEQUENCED;
}
void PacketPosition::Packet(RakNet::BitStream *bs, BasePlayer *player, bool send)
void PacketPlayerPosition::Packet(RakNet::BitStream *bs, BasePlayer *player, bool send)
{
PlayerPacket::Packet(bs, player, send);

@ -2,20 +2,20 @@
// Created by koncord on 05.01.16.
//
#ifndef OPENMW_PACKETPOSITION_HPP
#define OPENMW_PACKETPOSITION_HPP
#ifndef OPENMW_PACKETPLAYERPOSITION_HPP
#define OPENMW_PACKETPLAYERPOSITION_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
namespace mwmp
{
class PacketPosition : public PlayerPacket
class PacketPlayerPosition : public PlayerPacket
{
public:
PacketPosition(RakNet::RakPeerInterface *peer);
PacketPlayerPosition(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send);
};
}
#endif //OPENMW_PACKETPOSITION_HPP
#endif //OPENMW_PACKETPLAYERPOSITION_HPP

@ -1,15 +1,15 @@
#include <components/openmw-mp/NetworkMessages.hpp>
#include "PacketSpellbook.hpp"
#include "PacketPlayerSpellbook.hpp"
using namespace std;
using namespace mwmp;
PacketSpellbook::PacketSpellbook(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
PacketPlayerSpellbook::PacketPlayerSpellbook(RakNet::RakPeerInterface *peer) : PlayerPacket(peer)
{
packetID = ID_GAME_SPELLBOOK;
packetID = ID_PLAYER_SPELLBOOK;
}
void PacketSpellbook::Packet(RakNet::BitStream *bs, BasePlayer *player, bool send)
void PacketPlayerSpellbook::Packet(RakNet::BitStream *bs, BasePlayer *player, bool send)
{
PlayerPacket::Packet(bs, player, send);

@ -0,0 +1,18 @@
#ifndef OPENMW_PACKETPLAYERSPELLBOOK_HPP
#define OPENMW_PACKETPLAYERSPELLBOOK_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
namespace mwmp
{
class PacketPlayerSpellbook : public PlayerPacket
{
public:
PacketPlayerSpellbook(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send);
};
}
#endif //OPENMW_PACKETPLAYERSPELLBOOK_HPP

@ -1,18 +0,0 @@
#ifndef OPENMW_PACKETSPELLBOOK_HPP
#define OPENMW_PACKETSPELLBOOK_HPP
#include <components/openmw-mp/Packets/Player/PlayerPacket.hpp>
namespace mwmp
{
class PacketSpellbook : public PlayerPacket
{
public:
PacketSpellbook(RakNet::RakPeerInterface *peer);
virtual void Packet(RakNet::BitStream *bs, BasePlayer *player, bool send);
};
}
#endif //OPENMW_PACKETSPELLBOOK_HPP
Loading…
Cancel
Save