mirror of
https://git.minecraftlegacy.com/backups/LCEMP.git
synced 2026-11-30 13:31:31 +00:00
Initial commit - LCEMP source code (assets excluded)
This commit is contained in:
commit
21a5a4aef0
2946 files changed
+577259
No files matched your search
@@ -0,0 +1,59 @@
|
||||
#include "stdafx.h"
|
||||
#include "SetExperiencePacket.h"
|
||||
#include "PacketListener.h"
|
||||
#include "InputOutputStream.h"
|
||||
|
||||
|
||||
|
||||
SetExperiencePacket::SetExperiencePacket()
|
||||
{
|
||||
this->experienceProgress = 0;
|
||||
this->totalExperience = 0;
|
||||
this->experienceLevel = 0;
|
||||
}
|
||||
|
||||
SetExperiencePacket::SetExperiencePacket(float experienceProgress, int totalExperience, int experienceLevel)
|
||||
{
|
||||
this->experienceProgress = experienceProgress;
|
||||
this->totalExperience = totalExperience;
|
||||
this->experienceLevel = experienceLevel;
|
||||
}
|
||||
|
||||
void SetExperiencePacket::read(DataInputStream *dis)
|
||||
{
|
||||
experienceProgress = dis->readFloat();
|
||||
experienceLevel = dis->readShort();
|
||||
totalExperience = dis->readShort();
|
||||
}
|
||||
|
||||
void SetExperiencePacket::write(DataOutputStream *dos)
|
||||
{
|
||||
dos->writeFloat(experienceProgress);
|
||||
dos->writeShort(experienceLevel);
|
||||
dos->writeShort(totalExperience);
|
||||
}
|
||||
|
||||
void SetExperiencePacket::handle(PacketListener *listener)
|
||||
{
|
||||
listener->handleSetExperience(shared_from_this());
|
||||
}
|
||||
|
||||
int SetExperiencePacket::getEstimatedSize()
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
|
||||
bool SetExperiencePacket::canBeInvalidated()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SetExperiencePacket::isInvalidatedBy(shared_ptr<Packet> packet)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SetExperiencePacket::isAync()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
Reference in new issue
Block a user