From 7157ebc061b496d84c685070107045e8440a6ef0 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sat, 25 Aug 2012 21:46:18 +0000 Subject: cWorld doesn't use cPackets. git-svn-id: http://mc-server.googlecode.com/svn/trunk@789 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cClientHandle.cpp | 58 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) (limited to 'source/cClientHandle.cpp') diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp index a0ec88f80..206ad9acd 100644 --- a/source/cClientHandle.cpp +++ b/source/cClientHandle.cpp @@ -74,6 +74,7 @@ #include "packets/cPacket_Respawn.h" #include "packets/cPacket_SpawnMob.h" #include "packets/cPacket_TeleportEntity.h" +#include "packets/cPacket_Thunderbolt.h" #include "packets/cPacket_TimeUpdate.h" #include "packets/cPacket_UpdateHealth.h" #include "packets/cPacket_UpdateSign.h" @@ -1969,6 +1970,63 @@ void cClientHandle::SendUnloadChunk(int a_ChunkX, int a_ChunkZ) +void cClientHandle::SendWeather(eWeather a_Weather) +{ + switch( a_Weather ) + { + case eWeather_Sunny: + { + cPacket_NewInvalidState WeatherPacket; + WeatherPacket.m_Reason = 2; // stop rain + Send(WeatherPacket); + break; + } + + case eWeather_Rain: + { + cPacket_NewInvalidState WeatherPacket; + WeatherPacket.m_Reason = 1; // begin rain + Send(WeatherPacket); + break; + } + + case eWeather_ThunderStorm: + { + cPacket_NewInvalidState WeatherPacket; + WeatherPacket.m_Reason = 1; // begin rain + Send(WeatherPacket); + break; + } + } +} + + + + + +void cClientHandle::SendTimeUpdate(Int64 a_WorldTime) +{ + cPacket_TimeUpdate tu; + tu.m_Time = a_WorldTime; + Send(tu); +} + + + + + +void cClientHandle::SendThunderbolt(int a_BlockX, int a_BlockY, int a_BlockZ) +{ + cPacket_Thunderbolt ThunderboltPacket; + ThunderboltPacket.m_xLBPos = a_BlockX; + ThunderboltPacket.m_yLBPos = a_BlockY; + ThunderboltPacket.m_zLBPos = a_BlockZ; +} + + + + + void cClientHandle::CheckIfWorldDownloaded(void) { if (m_State != csDownloadingWorld) -- cgit v1.2.3