summaryrefslogtreecommitdiff
path: root/src/client.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2010-12-19 16:51:45 +0200
committerPerttu Ahola <celeron55@gmail.com>2010-12-19 16:51:45 +0200
commit0ca9423b8b2cf7bd1435fb09eba7a9f50d444864 (patch)
treeea49a7bae71b4e89f51797356fd0d34c35497e74 /src/client.h
parent240499dc2c766c9d022e6df71e770a116a2c95de (diff)
downloadminetest-0ca9423b8b2cf7bd1435fb09eba7a9f50d444864.tar.gz
minetest-0ca9423b8b2cf7bd1435fb09eba7a9f50d444864.tar.bz2
minetest-0ca9423b8b2cf7bd1435fb09eba7a9f50d444864.zip
day/night working client side
Diffstat (limited to 'src/client.h')
-rw-r--r--src/client.h40
1 files changed, 19 insertions, 21 deletions
diff --git a/src/client.h b/src/client.h
index 413a936c6..18aa619c6 100644
--- a/src/client.h
+++ b/src/client.h
@@ -36,35 +36,19 @@ public:
class Client;
-class ClientUpdateThread : public JThread
+class ClientUpdateThread : public SimpleThread
{
- bool run;
- JMutex run_mutex;
-
Client *m_client;
public:
- ClientUpdateThread(Client *client) : JThread(), run(true), m_client(client)
+ ClientUpdateThread(Client *client):
+ SimpleThread(),
+ m_client(client)
{
- run_mutex.Init();
}
void * Thread();
-
- bool getRun()
- {
- run_mutex.Lock();
- bool run_cached = run;
- run_mutex.Unlock();
- return run_cached;
- }
- void setRun(bool a_run)
- {
- run_mutex.Lock();
- run = a_run;
- run_mutex.Unlock();
- }
};
struct IncomingPacket
@@ -98,6 +82,7 @@ struct IncomingPacket
if(*m_refcount == 0){
if(m_data != NULL)
delete[] m_data;
+ delete m_refcount;
}
}
}
@@ -237,7 +222,10 @@ public:
// Prints a line or two of info
void printDebugInfo(std::ostream &os);
- float getDaylightRatio();
+ //s32 getDayNightIndex();
+ u32 getDayNightRatio();
+
+ //void updateSomeExpiredMeshes();
private:
@@ -252,6 +240,12 @@ private:
// This sends the player's current name etc to the server
void sendPlayerInfo();
+ float m_packetcounter_timer;
+ float m_delete_unused_sectors_timer;
+ float m_connection_reinit_timer;
+ float m_avg_rtt_timer;
+ float m_playerpos_send_timer;
+
ClientUpdateThread m_thread;
// NOTE: If connection and environment are both to be locked,
@@ -290,6 +284,10 @@ private:
// Access these only in main thread.
u32 m_time;
float m_time_counter;
+
+ // 0 <= m_daynight_i < DAYNIGHT_CACHE_COUNT
+ //s32 m_daynight_i;
+ //u32 m_daynight_ratio;
};
#endif