#include "connection.h"
#include "environment.h"
#include "irrlichttypes_extrabloated.h"
-#include "jmutex.h"
+#include "jthread/jmutex.h"
#include <ostream>
+#include <map>
#include <set>
#include <vector>
#include "clientobject.h"
#include "gamedef.h"
#include "inventorymanager.h"
-#include "filesys.h"
#include "filecache.h"
#include "localplayer.h"
#include "server.h"
};
};
+/*
+ Packet counter
+*/
+
+class PacketCounter
+{
+public:
+ PacketCounter()
+ {
+ }
+
+ void add(u16 command)
+ {
+ std::map<u16, u16>::iterator n = m_packets.find(command);
+ if(n == m_packets.end())
+ {
+ m_packets[command] = 1;
+ }
+ else
+ {
+ n->second++;
+ }
+ }
+
+ void clear()
+ {
+ for(std::map<u16, u16>::iterator
+ i = m_packets.begin();
+ i != m_packets.end(); ++i)
+ {
+ i->second = 0;
+ }
+ }
+
+ void print(std::ostream &o)
+ {
+ for(std::map<u16, u16>::iterator
+ i = m_packets.begin();
+ i != m_packets.end(); ++i)
+ {
+ o<<"cmd "<<i->first
+ <<" count "<<i->second
+ <<std::endl;
+ }
+ }
+
+private:
+ // command, count
+ std::map<u16, u16> m_packets;
+};
+
class Client : public con::PeerHandler, public InventoryManager, public IGameDef
{
public:
void sendChangePassword(const std::wstring oldpassword,
const std::wstring newpassword);
void sendDamage(u8 damage);
+ void sendBreath(u16 breath);
void sendRespawn();
ClientEnvironment& getEnv()
void Receive();
void sendPlayerPos();
- // This sends the player's current name etc to the server
- void sendPlayerInfo();
// Send the item number 'item' as player item to the server
void sendPlayerItem(u16 item);
u32 m_media_received_count;
bool m_itemdef_received;
bool m_nodedef_received;
- friend class FarMesh;
// time_of_day speed approximation for old protocol
bool m_time_of_day_set;