|
|
|
@ -89,7 +89,7 @@ bool LocalPlayer::charGenThread() // todo: need fix
|
|
|
|
|
(*BirthSign()) = world->getPlayer().getBirthSign();
|
|
|
|
|
|
|
|
|
|
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "Sending ID_GAME_BASE_INFO to server with my CharGen info");
|
|
|
|
|
GetNetworking()->GetPacket(ID_GAME_BASE_INFO)->Send(this);
|
|
|
|
|
GetNetworking()->GetPlayerPacket(ID_GAME_BASE_INFO)->Send(this);
|
|
|
|
|
|
|
|
|
|
if (CharGenStage()->end != 1)
|
|
|
|
|
{
|
|
|
|
@ -98,11 +98,11 @@ bool LocalPlayer::charGenThread() // todo: need fix
|
|
|
|
|
updateSkills(true);
|
|
|
|
|
updateLevel(true);
|
|
|
|
|
sendClass();
|
|
|
|
|
GetNetworking()->GetPacket(ID_GAME_CHARGEN)->Send(this);
|
|
|
|
|
GetNetworking()->GetPlayerPacket(ID_GAME_CHARGEN)->Send(this);
|
|
|
|
|
}
|
|
|
|
|
CharGenStage()->end = 0;
|
|
|
|
|
/*RakNet::BitStream bs;
|
|
|
|
|
GetNetworking()->GetPacket(ID_GAME_BASE_INFO)->Packet(&bs, this, true);
|
|
|
|
|
GetNetworking()->GetPlayerPacket(ID_GAME_BASE_INFO)->Packet(&bs, this, true);
|
|
|
|
|
GetNetworking()->SendData(&bs);*/
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -127,7 +127,7 @@ bool LocalPlayer::charGenThread() // todo: need fix
|
|
|
|
|
windowManager->pushGuiMode(MWGui::GM_Review);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
GetNetworking()->GetPacket(ID_GAME_CHARGEN)->Send(this);
|
|
|
|
|
GetNetworking()->GetPlayerPacket(ID_GAME_CHARGEN)->Send(this);
|
|
|
|
|
CharGenStage()->current++;
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
@ -162,7 +162,7 @@ void LocalPlayer::updateDynamicStats(bool forceUpdate)
|
|
|
|
|
|
|
|
|
|
timer = 0;
|
|
|
|
|
|
|
|
|
|
GetNetworking()->GetPacket(ID_GAME_DYNAMICSTATS)->Send(this);
|
|
|
|
|
GetNetworking()->GetPlayerPacket(ID_GAME_DYNAMICSTATS)->Send(this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -184,7 +184,7 @@ void LocalPlayer::updateAttributes(bool forceUpdate)
|
|
|
|
|
|
|
|
|
|
if (isUpdating || forceUpdate)
|
|
|
|
|
{
|
|
|
|
|
GetNetworking()->GetPacket(ID_GAME_ATTRIBUTE)->Send(this);
|
|
|
|
|
GetNetworking()->GetPlayerPacket(ID_GAME_ATTRIBUTE)->Send(this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -220,7 +220,7 @@ void LocalPlayer::updateSkills(bool forceUpdate)
|
|
|
|
|
if (isUpdating || forceUpdate)
|
|
|
|
|
{
|
|
|
|
|
NpcStats()->mLevelProgress = ptrNpcStats.getLevelProgress();
|
|
|
|
|
GetNetworking()->GetPacket(ID_GAME_SKILL)->Send(this);
|
|
|
|
|
GetNetworking()->GetPlayerPacket(ID_GAME_SKILL)->Send(this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -232,7 +232,7 @@ void LocalPlayer::updateLevel(bool forceUpdate)
|
|
|
|
|
if (ptrNpcStats.getLevel() != CreatureStats()->mLevel || forceUpdate)
|
|
|
|
|
{
|
|
|
|
|
CreatureStats()->mLevel = ptrNpcStats.getLevel();
|
|
|
|
|
GetNetworking()->GetPacket(ID_GAME_LEVEL)->Send(this);
|
|
|
|
|
GetNetworking()->GetPlayerPacket(ID_GAME_LEVEL)->Send(this);
|
|
|
|
|
|
|
|
|
|
// Also update skills to refresh level progress and attribute bonuses
|
|
|
|
|
// for next level up
|
|
|
|
@ -272,7 +272,7 @@ void LocalPlayer::updatePosition(bool forceUpdate)
|
|
|
|
|
Dir()->pos[1] = move.mPosition[1];
|
|
|
|
|
Dir()->pos[2] = move.mPosition[2];
|
|
|
|
|
|
|
|
|
|
GetNetworking()->GetPacket(ID_GAME_POS)->Send(this);
|
|
|
|
|
GetNetworking()->GetPlayerPacket(ID_GAME_POS)->Send(this);
|
|
|
|
|
}
|
|
|
|
|
else if (isJumping && world->isOnGround(player))
|
|
|
|
|
{
|
|
|
|
@ -284,7 +284,7 @@ void LocalPlayer::updatePosition(bool forceUpdate)
|
|
|
|
|
{
|
|
|
|
|
sentJumpEnd = true;
|
|
|
|
|
(*Position()) = ptrPos;
|
|
|
|
|
GetNetworking()->GetPacket(ID_GAME_POS)->Send(this);
|
|
|
|
|
GetNetworking()->GetPlayerPacket(ID_GAME_POS)->Send(this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -333,7 +333,7 @@ void LocalPlayer::updateCell(bool forceUpdate)
|
|
|
|
|
updatePosition(true);
|
|
|
|
|
|
|
|
|
|
RakNet::BitStream bs;
|
|
|
|
|
GetNetworking()->GetPacket((RakNet::MessageID) ID_GAME_CELL)->Packet(&bs, this, true);
|
|
|
|
|
GetNetworking()->GetPlayerPacket((RakNet::MessageID) ID_GAME_CELL)->Packet(&bs, this, true);
|
|
|
|
|
GetNetworking()->SendData(&bs);
|
|
|
|
|
|
|
|
|
|
// Also update skill progress
|
|
|
|
@ -396,7 +396,7 @@ void LocalPlayer::updateInventory(bool forceUpdate)
|
|
|
|
|
{
|
|
|
|
|
RakNet::BitStream bs;
|
|
|
|
|
bs.ResetWritePointer();
|
|
|
|
|
GetNetworking()->GetPacket((RakNet::MessageID) ID_GAME_EQUIPMENT)->Packet(&bs, this, true);
|
|
|
|
|
GetNetworking()->GetPlayerPacket((RakNet::MessageID) ID_GAME_EQUIPMENT)->Packet(&bs, this, true);
|
|
|
|
|
GetNetworking()->SendData(&bs);
|
|
|
|
|
invChanged = false;
|
|
|
|
|
}
|
|
|
|
@ -426,7 +426,7 @@ void LocalPlayer::updateAttackState(bool forceUpdate)
|
|
|
|
|
GetAttack()->refid = spell;
|
|
|
|
|
|
|
|
|
|
/*RakNet::BitStream bs;
|
|
|
|
|
GetNetworking()->GetPacket((RakNet::MessageID) ID_GAME_ATTACK)->Packet(&bs, this, true);
|
|
|
|
|
GetNetworking()->GetPlayerPacket((RakNet::MessageID) ID_GAME_ATTACK)->Packet(&bs, this, true);
|
|
|
|
|
GetNetworking()->SendData(&bs);*/
|
|
|
|
|
}
|
|
|
|
|
else if (state == MWMechanics::DrawState_Weapon)
|
|
|
|
@ -457,7 +457,7 @@ void LocalPlayer::updateDeadState(bool forceUpdate)
|
|
|
|
|
{
|
|
|
|
|
CreatureStats()->mDead = true;
|
|
|
|
|
RakNet::BitStream bs;
|
|
|
|
|
GetNetworking()->GetPacket((RakNet::MessageID)ID_GAME_DIE)->Packet(&bs, this, true);
|
|
|
|
|
GetNetworking()->GetPlayerPacket((RakNet::MessageID)ID_GAME_DIE)->Packet(&bs, this, true);
|
|
|
|
|
GetNetworking()->SendData(&bs);
|
|
|
|
|
isDead = true;
|
|
|
|
|
}
|
|
|
|
@ -524,7 +524,7 @@ void LocalPlayer::updateDrawStateAndFlags(bool forceUpdate)
|
|
|
|
|
mwmp::Main::get().getLocalPlayer()->updatePosition(true); // fix position after jump;
|
|
|
|
|
|
|
|
|
|
RakNet::BitStream bs;
|
|
|
|
|
GetNetworking()->GetPacket((RakNet::MessageID) ID_GAME_DRAWSTATE)->Packet(&bs, this, true);
|
|
|
|
|
GetNetworking()->GetPlayerPacket((RakNet::MessageID) ID_GAME_DRAWSTATE)->Packet(&bs, this, true);
|
|
|
|
|
GetNetworking()->SendData(&bs);
|
|
|
|
|
//timer = 0;
|
|
|
|
|
}
|
|
|
|
@ -695,7 +695,7 @@ void LocalPlayer::sendClass()
|
|
|
|
|
else
|
|
|
|
|
charClass.mId = cls->mId;
|
|
|
|
|
|
|
|
|
|
GetNetworking()->GetPacket(ID_GAME_CHARCLASS)->Send(this);
|
|
|
|
|
GetNetworking()->GetPlayerPacket(ID_GAME_CHARCLASS)->Send(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LocalPlayer::sendAttack(char type)
|
|
|
|
@ -713,7 +713,7 @@ void LocalPlayer::sendAttack(char type)
|
|
|
|
|
GetAttack()->type = type;
|
|
|
|
|
GetAttack()->pressed = false;
|
|
|
|
|
RakNet::BitStream bs;
|
|
|
|
|
GetNetworking()->GetPacket((RakNet::MessageID) ID_GAME_ATTACK)->Packet(&bs, this, true);
|
|
|
|
|
GetNetworking()->GetPlayerPacket((RakNet::MessageID) ID_GAME_ATTACK)->Packet(&bs, this, true);
|
|
|
|
|
GetNetworking()->SendData(&bs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -744,6 +744,6 @@ void LocalPlayer::prepareAttack(char type, bool state)
|
|
|
|
|
GetAttack()->attacker = guid;
|
|
|
|
|
|
|
|
|
|
RakNet::BitStream bs;
|
|
|
|
|
GetNetworking()->GetPacket((RakNet::MessageID) ID_GAME_ATTACK)->Packet(&bs, this, true);
|
|
|
|
|
GetNetworking()->GetPlayerPacket((RakNet::MessageID) ID_GAME_ATTACK)->Packet(&bs, this, true);
|
|
|
|
|
GetNetworking()->SendData(&bs);
|
|
|
|
|
}
|
|
|
|
|