1.8: Added ParticleEffect packet.
This commit is contained in:
parent
71c3369e08
commit
3bd3ac2200
@ -3043,7 +3043,7 @@ void cChunk::BroadcastEntityAnimation(const cEntity & a_Entity, char a_Animation
|
||||
|
||||
|
||||
|
||||
void cChunk::BroadcastParticleEffect(const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmmount, cClientHandle * a_Exclude)
|
||||
void cChunk::BroadcastParticleEffect(const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmount, cClientHandle * a_Exclude)
|
||||
{
|
||||
for (cClientHandleList::iterator itr = m_LoadedByClient.begin(); itr != m_LoadedByClient.end(); ++itr)
|
||||
{
|
||||
@ -3051,7 +3051,7 @@ void cChunk::BroadcastParticleEffect(const AString & a_ParticleName, float a_Src
|
||||
{
|
||||
continue;
|
||||
}
|
||||
(*itr)->SendParticleEffect(a_ParticleName, a_SrcX, a_SrcY, a_SrcZ, a_OffsetX, a_OffsetY, a_OffsetZ, a_ParticleData, a_ParticleAmmount);
|
||||
(*itr)->SendParticleEffect(a_ParticleName, a_SrcX, a_SrcY, a_SrcZ, a_OffsetX, a_OffsetY, a_OffsetZ, a_ParticleData, a_ParticleAmount);
|
||||
} // for itr - LoadedByClient[]
|
||||
}
|
||||
|
||||
|
@ -326,7 +326,7 @@ public:
|
||||
void BroadcastEntityStatus (const cEntity & a_Entity, char a_Status, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastEntityVelocity (const cEntity & a_Entity, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastEntityAnimation (const cEntity & a_Entity, char a_Animation, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastParticleEffect (const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmmount, cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastParticleEffect (const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmount, cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastRemoveEntityEffect (const cEntity & a_Entity, int a_EffectID, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastSoundEffect (const AString & a_SoundName, double a_X, double a_Y, double a_Z, float a_Volume, float a_Pitch, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastSoundParticleEffect(int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data, const cClientHandle * a_Exclude = NULL);
|
||||
|
@ -617,7 +617,7 @@ void cChunkMap::BroadcastEntityAnimation(const cEntity & a_Entity, char a_Animat
|
||||
|
||||
|
||||
|
||||
void cChunkMap::BroadcastParticleEffect(const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmmount, cClientHandle * a_Exclude)
|
||||
void cChunkMap::BroadcastParticleEffect(const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmount, cClientHandle * a_Exclude)
|
||||
{
|
||||
cCSLock Lock(m_CSLayers);
|
||||
int ChunkX, ChunkZ;
|
||||
@ -629,7 +629,7 @@ void cChunkMap::BroadcastParticleEffect(const AString & a_ParticleName, float a_
|
||||
return;
|
||||
}
|
||||
// It's perfectly legal to broadcast packets even to invalid chunks!
|
||||
Chunk->BroadcastParticleEffect(a_ParticleName, a_SrcX, a_SrcY, a_SrcZ, a_OffsetX, a_OffsetY, a_OffsetZ, a_ParticleData, a_ParticleAmmount, a_Exclude);
|
||||
Chunk->BroadcastParticleEffect(a_ParticleName, a_SrcX, a_SrcY, a_SrcZ, a_OffsetX, a_OffsetY, a_OffsetZ, a_ParticleData, a_ParticleAmount, a_Exclude);
|
||||
}
|
||||
|
||||
|
||||
|
@ -87,7 +87,7 @@ public:
|
||||
void BroadcastEntityStatus(const cEntity & a_Entity, char a_Status, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastEntityVelocity(const cEntity & a_Entity, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastEntityAnimation(const cEntity & a_Entity, char a_Animation, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastParticleEffect(const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmmount, cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastParticleEffect(const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmount, cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastRemoveEntityEffect (const cEntity & a_Entity, int a_EffectID, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastSoundEffect(const AString & a_SoundName, double a_X, double a_Y, double a_Z, float a_Volume, float a_Pitch, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastSoundParticleEffect(int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data, const cClientHandle * a_Exclude = NULL);
|
||||
|
@ -2339,9 +2339,9 @@ void cClientHandle::SendMapInfo(int a_ID, unsigned int a_Scale)
|
||||
|
||||
|
||||
|
||||
void cClientHandle::SendParticleEffect(const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmmount)
|
||||
void cClientHandle::SendParticleEffect(const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmount)
|
||||
{
|
||||
m_Protocol->SendParticleEffect(a_ParticleName, a_SrcX, a_SrcY, a_SrcZ, a_OffsetX, a_OffsetY, a_OffsetZ, a_ParticleData, a_ParticleAmmount);
|
||||
m_Protocol->SendParticleEffect(a_ParticleName, a_SrcX, a_SrcY, a_SrcZ, a_OffsetX, a_OffsetY, a_OffsetZ, a_ParticleData, a_ParticleAmount);
|
||||
}
|
||||
|
||||
|
||||
|
@ -154,7 +154,7 @@ public:
|
||||
void SendPaintingSpawn (const cPainting & a_Painting);
|
||||
void SendPickupSpawn (const cPickup & a_Pickup);
|
||||
void SendEntityAnimation (const cEntity & a_Entity, char a_Animation); // tolua_export
|
||||
void SendParticleEffect (const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmmount);
|
||||
void SendParticleEffect (const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmount);
|
||||
void SendPlayerAbilities (void);
|
||||
void SendPlayerListItem (const cPlayer & a_Player, char a_Action);
|
||||
void SendPlayerMaxSpeed (void); ///< Informs the client of the maximum player speed (1.6.1+)
|
||||
|
@ -93,7 +93,7 @@ public:
|
||||
virtual void SendPickupSpawn (const cPickup & a_Pickup) = 0;
|
||||
virtual void SendPlayerAbilities (void) = 0;
|
||||
virtual void SendEntityAnimation (const cEntity & a_Entity, char a_Animation) = 0;
|
||||
virtual void SendParticleEffect (const AString & a_SoundName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmmount) = 0;
|
||||
virtual void SendParticleEffect (const AString & a_SoundName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmount) = 0;
|
||||
virtual void SendPlayerListItem (const cPlayer & a_Player, char a_Action) = 0;
|
||||
virtual void SendPlayerMaxSpeed (void) = 0; ///< Informs the client of the maximum player speed (1.6.1+)
|
||||
virtual void SendPlayerMoveLook (void) = 0;
|
||||
|
@ -701,7 +701,7 @@ void cProtocol125::SendEntityAnimation(const cEntity & a_Entity, char a_Animatio
|
||||
|
||||
|
||||
|
||||
void cProtocol125::SendParticleEffect(const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmmount)
|
||||
void cProtocol125::SendParticleEffect(const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmount)
|
||||
{
|
||||
// Not supported by this protocol version
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ public:
|
||||
virtual void SendMapColumn (int a_ID, int a_X, int a_Y, const Byte * a_Colors, unsigned int a_Length) override;
|
||||
virtual void SendMapDecorators (int a_ID, const cMapDecoratorList & a_Decorators) override;
|
||||
virtual void SendMapInfo (int a_ID, unsigned int a_Scale) override;
|
||||
virtual void SendParticleEffect (const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmmount) override;
|
||||
virtual void SendParticleEffect (const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmount) override;
|
||||
virtual void SendPaintingSpawn (const cPainting & a_Painting) override;
|
||||
virtual void SendPickupSpawn (const cPickup & a_Pickup) override;
|
||||
virtual void SendPlayerAbilities (void) override {} // This protocol doesn't support such message
|
||||
|
@ -80,7 +80,7 @@ void cProtocol150::SendWindowOpen(const cWindow & a_Window)
|
||||
|
||||
|
||||
|
||||
void cProtocol150::SendParticleEffect(const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmmount)
|
||||
void cProtocol150::SendParticleEffect(const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmount)
|
||||
{
|
||||
cCSLock Lock(m_CSPacket);
|
||||
WriteByte(PACKET_PARTICLE_EFFECT);
|
||||
@ -92,7 +92,7 @@ void cProtocol150::SendParticleEffect(const AString & a_ParticleName, float a_Sr
|
||||
WriteFloat(a_OffsetY);
|
||||
WriteFloat(a_OffsetZ);
|
||||
WriteFloat(a_ParticleData);
|
||||
WriteInt(a_ParticleAmmount);
|
||||
WriteInt(a_ParticleAmount);
|
||||
Flush();
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ public:
|
||||
cProtocol150(cClientHandle * a_Client);
|
||||
|
||||
virtual void SendWindowOpen (const cWindow & a_Window) override;
|
||||
virtual void SendParticleEffect (const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmmount) override;
|
||||
virtual void SendParticleEffect (const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmount) override;
|
||||
virtual void SendScoreboardObjective (const AString & a_Name, const AString & a_DisplayName, Byte a_Mode) override;
|
||||
virtual void SendScoreUpdate (const AString & a_Objective, const AString & a_Player, cObjective::Score a_Score, Byte a_Mode) override;
|
||||
virtual void SendDisplayObjective (const AString & a_Objective, cScoreboard::eDisplaySlot a_Display) override;
|
||||
|
@ -847,7 +847,7 @@ void cProtocol172::SendEntityAnimation(const cEntity & a_Entity, char a_Animatio
|
||||
|
||||
|
||||
|
||||
void cProtocol172::SendParticleEffect(const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmmount)
|
||||
void cProtocol172::SendParticleEffect(const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmount)
|
||||
{
|
||||
ASSERT(m_State == 3); // In game mode?
|
||||
|
||||
@ -860,7 +860,7 @@ void cProtocol172::SendParticleEffect(const AString & a_ParticleName, float a_Sr
|
||||
Pkt.WriteFloat(a_OffsetY);
|
||||
Pkt.WriteFloat(a_OffsetZ);
|
||||
Pkt.WriteFloat(a_ParticleData);
|
||||
Pkt.WriteInt(a_ParticleAmmount);
|
||||
Pkt.WriteInt(a_ParticleAmount);
|
||||
}
|
||||
|
||||
|
||||
|
@ -98,7 +98,7 @@ public:
|
||||
virtual void SendMapDecorators (int a_ID, const cMapDecoratorList & a_Decorators) override;
|
||||
virtual void SendMapInfo (int a_ID, unsigned int a_Scale) override;
|
||||
virtual void SendPaintingSpawn (const cPainting & a_Painting) override;
|
||||
virtual void SendParticleEffect (const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmmount) override;
|
||||
virtual void SendParticleEffect (const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmount) override;
|
||||
virtual void SendPickupSpawn (const cPickup & a_Pickup) override;
|
||||
virtual void SendPlayerAbilities (void) override;
|
||||
virtual void SendPlayerListItem (const cPlayer & a_Player, char a_Action) override;
|
||||
|
@ -779,7 +779,7 @@ void cProtocol180::SendPickupSpawn(const cPickup & a_Pickup)
|
||||
{
|
||||
ASSERT(m_State == 3); // In game mode?
|
||||
|
||||
/*{
|
||||
{
|
||||
cPacketizer Pkt(*this, 0x0e); // Spawn Object packet
|
||||
Pkt.WriteVarInt(a_Pickup.GetUniqueID());
|
||||
Pkt.WriteByte(2); // Type = Pickup
|
||||
@ -797,7 +797,7 @@ void cProtocol180::SendPickupSpawn(const cPickup & a_Pickup)
|
||||
Pkt.WriteByte((0x05 << 5) | 10); // Slot type + index 10
|
||||
Pkt.WriteItem(a_Pickup.GetItem());
|
||||
Pkt.WriteByte(0x7f); // End of metadata
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -846,12 +846,14 @@ void cProtocol180::SendEntityAnimation(const cEntity & a_Entity, char a_Animatio
|
||||
|
||||
|
||||
|
||||
void cProtocol180::SendParticleEffect(const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmmount)
|
||||
void cProtocol180::SendParticleEffect(const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmount)
|
||||
{
|
||||
ASSERT(m_State == 3); // In game mode?
|
||||
|
||||
/*cPacketizer Pkt(*this, 0x2A);
|
||||
Pkt.WriteString(a_ParticleName);
|
||||
int ParticleID = GetParticleID(a_ParticleName);
|
||||
|
||||
cPacketizer Pkt(*this, 0x2A);
|
||||
Pkt.WriteInt(ParticleID);
|
||||
Pkt.WriteBool(false);
|
||||
Pkt.WriteFloat(a_SrcX);
|
||||
Pkt.WriteFloat(a_SrcY);
|
||||
Pkt.WriteFloat(a_SrcZ);
|
||||
@ -859,7 +861,7 @@ void cProtocol180::SendParticleEffect(const AString & a_ParticleName, float a_Sr
|
||||
Pkt.WriteFloat(a_OffsetY);
|
||||
Pkt.WriteFloat(a_OffsetZ);
|
||||
Pkt.WriteFloat(a_ParticleData);
|
||||
Pkt.WriteInt(a_ParticleAmmount);*/
|
||||
Pkt.WriteInt(a_ParticleAmount);
|
||||
}
|
||||
|
||||
|
||||
@ -1230,7 +1232,7 @@ void cProtocol180::SendSpawnObject(const cEntity & a_Entity, char a_ObjectType,
|
||||
{
|
||||
ASSERT(m_State == 3); // In game mode?
|
||||
|
||||
/*cPacketizer Pkt(*this, 0xe); // Spawn Object packet
|
||||
cPacketizer Pkt(*this, 0xe); // Spawn Object packet
|
||||
Pkt.WriteVarInt(a_Entity.GetUniqueID());
|
||||
Pkt.WriteByte(a_ObjectType);
|
||||
Pkt.WriteFPInt(a_Entity.GetPosX());
|
||||
@ -1244,7 +1246,7 @@ void cProtocol180::SendSpawnObject(const cEntity & a_Entity, char a_ObjectType,
|
||||
Pkt.WriteShort((short)(a_Entity.GetSpeedX() * 400));
|
||||
Pkt.WriteShort((short)(a_Entity.GetSpeedY() * 400));
|
||||
Pkt.WriteShort((short)(a_Entity.GetSpeedZ() * 400));
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1570,6 +1572,71 @@ bool cProtocol180::CompressPacket(const AString & a_Packet, AString & a_Compress
|
||||
|
||||
|
||||
|
||||
int cProtocol180::GetParticleID(const AString & a_ParticleName)
|
||||
{
|
||||
static bool IsInitialized = false;
|
||||
static std::map<AString, int> ParticleMap;
|
||||
if (!IsInitialized)
|
||||
{
|
||||
// Initialize the ParticleMap:
|
||||
ParticleMap["explode"] = 0;
|
||||
ParticleMap["largeexplode"] = 1;
|
||||
ParticleMap["hugeexplosion"] = 2;
|
||||
ParticleMap["fireworksspark"] = 3;
|
||||
ParticleMap["bubble"] = 4;
|
||||
ParticleMap["splash"] = 5;
|
||||
ParticleMap["wake"] = 6;
|
||||
ParticleMap["suspended"] = 7;
|
||||
ParticleMap["depthsuspend"] = 8;
|
||||
ParticleMap["crit"] = 9;
|
||||
ParticleMap["magiccrit"] = 10;
|
||||
ParticleMap["smoke"] = 11;
|
||||
ParticleMap["largesmoke"] = 12;
|
||||
ParticleMap["spell"] = 13;
|
||||
ParticleMap["instantspell"] = 14;
|
||||
ParticleMap["mobspell"] = 15;
|
||||
ParticleMap["mobspellambient"] = 16;
|
||||
ParticleMap["witchmagic"] = 17;
|
||||
ParticleMap["dripwater"] = 18;
|
||||
ParticleMap["driplava"] = 19;
|
||||
ParticleMap["angryvillager"] = 20;
|
||||
ParticleMap["happyVillager"] = 21;
|
||||
ParticleMap["townaura"] = 22;
|
||||
ParticleMap["note"] = 23;
|
||||
ParticleMap["portal"] = 24;
|
||||
ParticleMap["enchantmenttable"] = 25;
|
||||
ParticleMap["flame"] = 26;
|
||||
ParticleMap["lava"] = 27;
|
||||
ParticleMap["footstep"] = 28;
|
||||
ParticleMap["cloud"] = 29;
|
||||
ParticleMap["reddust"] = 30;
|
||||
ParticleMap["snowballpoof"] = 31;
|
||||
ParticleMap["snowshovel"] = 32;
|
||||
ParticleMap["slime"] = 33;
|
||||
ParticleMap["heart"] = 34;
|
||||
ParticleMap["barrier"] = 35;
|
||||
ParticleMap["iconcrack"] = 36;
|
||||
ParticleMap["blockcrack"] = 37;
|
||||
ParticleMap["blockdust"] = 38;
|
||||
ParticleMap["droplet"] = 39;
|
||||
ParticleMap["take"] = 40;
|
||||
ParticleMap["mobappearance"] = 41;
|
||||
}
|
||||
|
||||
AString ParticleName = StrToLower(a_ParticleName);
|
||||
if (ParticleMap.find(ParticleName) == ParticleMap.end())
|
||||
{
|
||||
LOGWARNING("Unknown particle: %s", a_ParticleName.c_str());
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ParticleMap[ParticleName];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void cProtocol180::AddReceivedData(const char * a_Data, size_t a_Size)
|
||||
{
|
||||
// Write the incoming data into the comm log file:
|
||||
@ -2685,13 +2752,20 @@ void cProtocol180::cPacketizer::WriteUUID(const AString & a_UUID)
|
||||
{
|
||||
AString UUID_1 = a_UUID.substr(0, a_UUID.length() / 2);
|
||||
AString UUID_2 = a_UUID.substr(a_UUID.length() / 2);
|
||||
|
||||
UInt64 Value_1, Value_2;
|
||||
|
||||
Int64 Value_1, Value_2;
|
||||
sscanf(UUID_1.c_str(), "%llx", &Value_1);
|
||||
sscanf(UUID_2.c_str(), "%llx", &Value_2);
|
||||
|
||||
WriteInt64((Int64)Value_1);
|
||||
WriteInt64((Int64)Value_2);
|
||||
AString SValue_1, SValue_2;
|
||||
Printf(SValue_1, "%lld", Value_1);
|
||||
Printf(SValue_2, "%lld", Value_2);
|
||||
|
||||
StringToInteger<Int64>(SValue_1.c_str(), Value_1);
|
||||
StringToInteger<Int64>(SValue_2.c_str(), Value_2);
|
||||
|
||||
WriteInt64(Value_1);
|
||||
WriteInt64(Value_2);
|
||||
}
|
||||
|
||||
|
||||
|
@ -96,7 +96,7 @@ public:
|
||||
virtual void SendPickupSpawn (const cPickup & a_Pickup) override;
|
||||
virtual void SendPlayerAbilities (void) override;
|
||||
virtual void SendEntityAnimation (const cEntity & a_Entity, char a_Animation) override;
|
||||
virtual void SendParticleEffect (const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmmount) override;
|
||||
virtual void SendParticleEffect (const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmount) override;
|
||||
virtual void SendPlayerListItem (const cPlayer & a_Player, char a_Action) override;
|
||||
virtual void SendPlayerMaxSpeed (void) override;
|
||||
virtual void SendPlayerMoveLook (void) override;
|
||||
@ -138,6 +138,9 @@ public:
|
||||
If compression fails, the function returns false. */
|
||||
static bool CompressPacket(const AString & a_Packet, AString & a_Compressed);
|
||||
|
||||
/** The 1.8 protocol use a particle id instead of a string. This function converts the name to the id. If the name is incorrect, it returns 0. */
|
||||
static int GetParticleID(const AString & a_ParticleName);
|
||||
|
||||
protected:
|
||||
|
||||
/** Composes individual packets in the protocol's m_OutPacketBuffer; sends them upon being destructed */
|
||||
|
@ -441,10 +441,10 @@ void cProtocolRecognizer::SendMapInfo(int a_ID, unsigned int a_Scale)
|
||||
|
||||
|
||||
|
||||
void cProtocolRecognizer::SendParticleEffect(const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmmount)
|
||||
void cProtocolRecognizer::SendParticleEffect(const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmount)
|
||||
{
|
||||
ASSERT(m_Protocol != NULL);
|
||||
m_Protocol->SendParticleEffect(a_ParticleName, a_SrcX, a_SrcY, a_SrcZ, a_OffsetX, a_OffsetY, a_OffsetZ, a_ParticleData, a_ParticleAmmount);
|
||||
m_Protocol->SendParticleEffect(a_ParticleName, a_SrcX, a_SrcY, a_SrcZ, a_OffsetX, a_OffsetY, a_OffsetZ, a_ParticleData, a_ParticleAmount);
|
||||
}
|
||||
|
||||
|
||||
|
@ -96,7 +96,7 @@ public:
|
||||
virtual void SendMapColumn (int a_ID, int a_X, int a_Y, const Byte * a_Colors, unsigned int a_Length) override;
|
||||
virtual void SendMapDecorators (int a_ID, const cMapDecoratorList & a_Decorators) override;
|
||||
virtual void SendMapInfo (int a_ID, unsigned int a_Scale) override;
|
||||
virtual void SendParticleEffect (const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmmount) override;
|
||||
virtual void SendParticleEffect (const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmount) override;
|
||||
virtual void SendPaintingSpawn (const cPainting & a_Painting) override;
|
||||
virtual void SendPickupSpawn (const cPickup & a_Pickup) override;
|
||||
virtual void SendPlayerAbilities (void) override;
|
||||
|
@ -2138,9 +2138,9 @@ void cWorld::BroadcastEntityAnimation(const cEntity & a_Entity, char a_Animation
|
||||
|
||||
|
||||
|
||||
void cWorld::BroadcastParticleEffect(const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmmount, cClientHandle * a_Exclude)
|
||||
void cWorld::BroadcastParticleEffect(const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmount, cClientHandle * a_Exclude)
|
||||
{
|
||||
m_ChunkMap->BroadcastParticleEffect(a_ParticleName, a_SrcX, a_SrcY, a_SrcZ, a_OffsetX, a_OffsetY, a_OffsetZ, a_ParticleData, a_ParticleAmmount, a_Exclude);
|
||||
m_ChunkMap->BroadcastParticleEffect(a_ParticleName, a_SrcX, a_SrcY, a_SrcZ, a_OffsetX, a_OffsetY, a_OffsetZ, a_ParticleData, a_ParticleAmount, a_Exclude);
|
||||
}
|
||||
|
||||
|
||||
|
@ -236,7 +236,7 @@ public:
|
||||
void BroadcastEntityStatus (const cEntity & a_Entity, char a_Status, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastEntityVelocity (const cEntity & a_Entity, const cClientHandle * a_Exclude = NULL);
|
||||
virtual void BroadcastEntityAnimation(const cEntity & a_Entity, char a_Animation, const cClientHandle * a_Exclude = NULL) override; // tolua_export
|
||||
void BroadcastParticleEffect (const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmmount, cClientHandle * a_Exclude = NULL); // tolua_export
|
||||
void BroadcastParticleEffect (const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmount, cClientHandle * a_Exclude = NULL); // tolua_export
|
||||
void BroadcastPlayerListItem (const cPlayer & a_Player, char a_Action, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastRemoveEntityEffect (const cEntity & a_Entity, int a_EffectID, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastScoreboardObjective (const AString & a_Name, const AString & a_DisplayName, Byte a_Mode);
|
||||
|
Loading…
Reference in New Issue
Block a user