Newer
Older
/*
Minetest-c55
Copyright (C) 2010 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*
(c) 2010 Perttu Ahola <celeron55@gmail.com>
*/
#include "server.h"
#include "utility.h"
#include <iostream>
#include "clientserver.h"
#include "map.h"
#include "jmutexautolock.h"
#include "main.h"
#include "constants.h"
#include "voxel.h"
#define BLOCK_EMERGE_FLAG_FROMDISK (1<<0)
void * ServerThread::Thread()
{
ThreadStarted();
DSTACK(__FUNCTION_NAME);
BEGIN_DEBUG_EXCEPTION_HANDLER
while(getRun())
{
try{
m_server->AsyncRunStep();
//dout_server<<"Running m_server->Receive()"<<std::endl;
m_server->Receive();
}
catch(con::NoIncomingDataException &e)
{
}
catch(con::PeerNotFoundException &e)
{
dout_server<<"Server: PeerNotFoundException"<<std::endl;
}
END_DEBUG_EXCEPTION_HANDLER
return NULL;
}
void * EmergeThread::Thread()
{
ThreadStarted();
DSTACK(__FUNCTION_NAME);
bool debug=false;
BEGIN_DEBUG_EXCEPTION_HANDLER
/*
Get block info from queue, emerge them and send them
to clients.
After queue is empty, exit.
*/
while(getRun())
{
QueuedBlockEmerge *qptr = m_server->m_emerge_queue.pop();
if(qptr == NULL)
break;
SharedPtr<QueuedBlockEmerge> q(qptr);
v3s16 &p = q->pos;
//derr_server<<"EmergeThread::Thread(): running"<<std::endl;
//TimeTaker timer("block emerge");
/*
Try to emerge it from somewhere.
If it is only wanted as optional, only loading from disk
will be allowed.
*/
/*
Check if any peer wants it as non-optional. In that case it
will be generated.
Also decrement the emerge queue count in clients.
*/
bool optional = true;
{
core::map<u16, u8>::Iterator i;
for(i=q->peer_ids.getIterator(); i.atEnd()==false; i++)
{
//u16 peer_id = i.getNode()->getKey();
// Check flags
u8 flags = i.getNode()->getValue();
if((flags & BLOCK_EMERGE_FLAG_FROMDISK) == false)
optional = false;
}
}
/*dstream<<"EmergeThread: p="
<<"("<<p.X<<","<<p.Y<<","<<p.Z<<") "
<<"optional="<<optional<<std::endl;*/
ServerMap &map = ((ServerMap&)m_server->m_env.getMap());
core::map<v3s16, MapBlock*> changed_blocks;
core::map<v3s16, MapBlock*> lighting_invalidated_blocks;
MapBlock *block = NULL;
bool got_block = true;
core::map<v3s16, MapBlock*> modified_blocks;
{//envlock
//TimeTaker envlockwaittimer("block emerge envlock wait time");
// 0-50ms
//envlockwaittimer.stop();
//TimeTaker timer("block emerge (while env locked)");
try{
bool only_from_disk = false;
if(optional)
only_from_disk = true;
// First check if the block already exists
if(only_from_disk)
{
block = map.getBlockNoCreate(p);
}
if(block == NULL)
{
block = map.emergeBlock(
p,
only_from_disk,
changed_blocks,
lighting_invalidated_blocks);
/*
EXPERIMENTAL: Create a few other blocks too
*/
map.emergeBlock(
p + v3s16(0,1,0),
only_from_disk,
changed_blocks,
lighting_invalidated_blocks);
map.emergeBlock(
p + v3s16(0,-1,0),
only_from_disk,
changed_blocks,
lighting_invalidated_blocks);
}
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
// If it is a dummy, block was not found on disk
if(block->isDummy())
{
//dstream<<"EmergeThread: Got a dummy block"<<std::endl;
got_block = false;
}
}
catch(InvalidPositionException &e)
{
// Block not found.
// This happens when position is over limit.
got_block = false;
}
if(got_block)
{
if(debug && changed_blocks.size() > 0)
{
dout_server<<DTIME<<"Got changed_blocks: ";
for(core::map<v3s16, MapBlock*>::Iterator i = changed_blocks.getIterator();
i.atEnd() == false; i++)
{
MapBlock *block = i.getNode()->getValue();
v3s16 p = block->getPos();
dout_server<<"("<<p.X<<","<<p.Y<<","<<p.Z<<") ";
}
dout_server<<std::endl;
}
/*
Update water pressure
*/
m_server->UpdateBlockWaterPressure(block, modified_blocks);
for(core::map<v3s16, MapBlock*>::Iterator i = changed_blocks.getIterator();
i.atEnd() == false; i++)
{
MapBlock *block = i.getNode()->getValue();
m_server->UpdateBlockWaterPressure(block, modified_blocks);
//v3s16 p = i.getNode()->getKey();
//m_server->UpdateBlockWaterPressure(p, modified_blocks);
}
/*
Collect a list of blocks that have been modified in
addition to the fetched one.
*/
for(core::map<v3s16, MapBlock*>::Iterator i = changed_blocks.getIterator();
i.atEnd() == false; i++)
{
MapBlock *block = i.getNode()->getValue();
modified_blocks.insert(block->getPos(), block);
}
/*dstream<<"lighting "<<lighting_invalidated_blocks.size()
<<" blocks"<<std::endl;*/
//TimeTaker timer("** updateLighting", g_device);
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
// Update lighting without locking the environment mutex,
// add modified blocks to changed blocks
map.updateLighting(lighting_invalidated_blocks, modified_blocks);
}
// If we got no block, there should be no invalidated blocks
else
{
assert(lighting_invalidated_blocks.size() == 0);
}
}//envlock
/*
Set sent status of modified blocks on clients
*/
// NOTE: Server's clients are also behind the connection mutex
JMutexAutoLock lock(m_server->m_con_mutex);
/*
Add the originally fetched block to the modified list
*/
if(got_block)
{
modified_blocks.insert(p, block);
}
/*
Set the modified blocks unsent for all the clients
*/
for(core::map<u16, RemoteClient*>::Iterator
i = m_server->m_clients.getIterator();
i.atEnd() == false; i++)
{
RemoteClient *client = i.getNode()->getValue();
if(modified_blocks.size() > 0)
{
// Remove block from sent history
client->SetBlocksNotSent(modified_blocks);
}
}
}
END_DEBUG_EXCEPTION_HANDLER
void RemoteClient::GetNextBlocks(Server *server, float dtime,
core::array<PrioritySortedBlockTransfer> &dest)
{
DSTACK(__FUNCTION_NAME);
// Increment timers
{
JMutexAutoLock lock(m_blocks_sent_mutex);
m_nearest_unsent_reset_timer += dtime;
}
// Won't send anything if already sending
{
JMutexAutoLock lock(m_blocks_sending_mutex);
if(m_blocks_sending.size() >= g_settings.getU16
("max_simultaneous_block_sends_per_client"))
{
//dstream<<"Not sending any blocks, Queue full."<<std::endl;
return;
}
}
bool haxmode = g_settings.getBool("haxmode");
Player *player = server->m_env.getPlayer(peer_id);
assert(player != NULL);
v3f playerpos = player->getPosition();
v3f playerspeed = player->getSpeed();
v3s16 center_nodepos = floatToInt(playerpos);
v3s16 center = getNodeBlockPos(center_nodepos);
// Camera position and direction
v3f camera_pos =
playerpos + v3f(0, BS+BS/2, 0);
v3f camera_dir = v3f(0,0,1);
camera_dir.rotateYZBy(player->getPitch());
camera_dir.rotateXZBy(player->getYaw());
/*
Get the starting value of the block finder radius.
*/
s16 last_nearest_unsent_d;
s16 d_start;
{
JMutexAutoLock lock(m_blocks_sent_mutex);
if(m_last_center != center)
{
m_nearest_unsent_d = 0;
m_last_center = center;
}
/*dstream<<"m_nearest_unsent_reset_timer="
<<m_nearest_unsent_reset_timer<<std::endl;*/
if(m_nearest_unsent_reset_timer > 5.0)
//dstream<<"Resetting m_nearest_unsent_d"<<std::endl;
}
last_nearest_unsent_d = m_nearest_unsent_d;
d_start = m_nearest_unsent_d;
}
u16 maximum_simultaneous_block_sends_setting = g_settings.getU16
("max_simultaneous_block_sends_per_client");
u16 maximum_simultaneous_block_sends =
maximum_simultaneous_block_sends_setting;
/*
Check the time from last addNode/removeNode.
Decrease send rate if player is building stuff.
*/
{
SharedPtr<JMutexAutoLock> lock(m_time_from_building.getLock());
m_time_from_building.m_value += dtime;
/*if(m_time_from_building.m_value
< FULL_BLOCK_SEND_ENABLE_MIN_TIME_FROM_BUILDING)*/
if(m_time_from_building.m_value < g_settings.getFloat(
"full_block_send_enable_min_time_from_building"))
{
maximum_simultaneous_block_sends
= LIMITED_MAX_SIMULTANEOUS_BLOCK_SENDS;
}
}
u32 num_blocks_selected;
{
JMutexAutoLock lock(m_blocks_sending_mutex);
num_blocks_selected = m_blocks_sending.size();
}
/*
next time d will be continued from the d from which the nearest
unsent block was found this time.
This is because not necessarily any of the blocks found this
time are actually sent.
*/
s32 new_nearest_unsent_d = -1;
// Serialization version used
//u8 ser_version = serialization_version;
//bool has_incomplete_blocks = false;
s16 d_max = g_settings.getS16("max_block_send_distance");
s16 d_max_gen = g_settings.getS16("max_block_generate_distance");
//dstream<<"Starting from "<<d_start<<std::endl;
for(s16 d = d_start; d <= d_max; d++)
{
//dstream<<"RemoteClient::SendBlocks(): d="<<d<<std::endl;
//if(has_incomplete_blocks == false)
{
JMutexAutoLock lock(m_blocks_sent_mutex);
/*
If m_nearest_unsent_d was changed by the EmergeThread
(it can change it to 0 through SetBlockNotSent),
update our d to it.
Else update m_nearest_unsent_d
*/
if(m_nearest_unsent_d != last_nearest_unsent_d)
{
d = m_nearest_unsent_d;
last_nearest_unsent_d = m_nearest_unsent_d;
}
}
/*
Get the border/face dot coordinates of a "d-radiused"
box
*/
core::list<v3s16> list;
getFacePositions(list, d);
core::list<v3s16>::Iterator li;
for(li=list.begin(); li!=list.end(); li++)
{
v3s16 p = *li + center;
/*
Send throttling
- Don't allow too many simultaneous transfers
- EXCEPT when the blocks are very close
Also, don't send blocks that are already flying.
*/
u16 maximum_simultaneous_block_sends_now =
maximum_simultaneous_block_sends;
if(d <= BLOCK_SEND_DISABLE_LIMITS_MAX_D)
{
maximum_simultaneous_block_sends_now =
maximum_simultaneous_block_sends_setting;
}
{
JMutexAutoLock lock(m_blocks_sending_mutex);
// Limit is dynamically lowered when building
>= maximum_simultaneous_block_sends_now)
{
/*dstream<<"Not sending more blocks. Queue full. "
<<m_blocks_sending.size()
<<std::endl;*/
}
if(m_blocks_sending.find(p) != NULL)
continue;
}
/*
Do not go over-limit
*/
if(p.X < -MAP_GENERATION_LIMIT / MAP_BLOCKSIZE
|| p.X > MAP_GENERATION_LIMIT / MAP_BLOCKSIZE
|| p.Y < -MAP_GENERATION_LIMIT / MAP_BLOCKSIZE
|| p.Y > MAP_GENERATION_LIMIT / MAP_BLOCKSIZE
|| p.Z < -MAP_GENERATION_LIMIT / MAP_BLOCKSIZE
|| p.Z > MAP_GENERATION_LIMIT / MAP_BLOCKSIZE)
continue;
bool generate = d <= d_max_gen;
{
// Don't generate above player
if(p.Y > center.Y)
generate = false;
}
else
{
// Limit the generating area vertically to 2/3
if(abs(p.Y - center.Y) > d_max_gen - d_max_gen / 3)
generate = false;
}
/*
Don't draw if not in sight
*/
if(isBlockInSight(p, camera_pos, camera_dir, 10000*BS) == false)
{
continue;
}
/*
Don't send already sent blocks
*/
{
JMutexAutoLock lock(m_blocks_sent_mutex);
if(m_blocks_sent.find(p) != NULL)
continue;
}
{
/*
Ignore block if it is not at ground surface
but don't ignore water surface blocks
*/
v2s16 p2d(p.X*MAP_BLOCKSIZE + MAP_BLOCKSIZE/2,
p.Z*MAP_BLOCKSIZE + MAP_BLOCKSIZE/2);
f32 y = server->m_env.getMap().getGroundHeight(p2d);
// The sector might not exist yet, thus no heightmap
if(y > GROUNDHEIGHT_VALID_MINVALUE)
{
f32 by = p.Y*MAP_BLOCKSIZE + MAP_BLOCKSIZE/2;
if(fabs(by - y) > MAP_BLOCKSIZE + MAP_BLOCKSIZE/3
&& fabs(by - WATER_LEVEL) >= MAP_BLOCKSIZE)
continue;
}
}
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
/*
Check if map has this block
*/
MapBlock *block = NULL;
try
{
block = server->m_env.getMap().getBlockNoCreate(p);
}
catch(InvalidPositionException &e)
{
}
bool surely_not_found_on_disk = false;
if(block != NULL)
{
/*if(block->isIncomplete())
{
has_incomplete_blocks = true;
continue;
}*/
if(block->isDummy())
{
surely_not_found_on_disk = true;
}
}
/*
If block has been marked to not exist on disk (dummy)
and generating new ones is not wanted, skip block.
*/
if(generate == false && surely_not_found_on_disk == true)
{
// get next one.
continue;
}
/*
Record the lowest d from which a a block has been
found being not sent and possibly to exist
*/
if(new_nearest_unsent_d == -1 || d < new_nearest_unsent_d)
{
new_nearest_unsent_d = d;
}
/*
Add inexistent block to emerge queue.
*/
if(block == NULL || surely_not_found_on_disk)
{
/*SharedPtr<JMutexAutoLock> lock
(m_num_blocks_in_emerge_queue.getLock());*/
//TODO: Get value from somewhere
// Allow only one block in emerge queue
if(server->m_emerge_queue.peerItemCount(peer_id) < 1)
{
// Add it to the emerge queue and trigger the thread
u8 flags = 0;
if(generate == false)
flags |= BLOCK_EMERGE_FLAG_FROMDISK;
server->m_emerge_queue.addBlock(peer_id, p, flags);
server->m_emergethread.trigger();
}
// get next one.
continue;
}
/*
Add block to queue
*/
PrioritySortedBlockTransfer q((float)d, p, peer_id);
dest.push_back(q);
if(new_nearest_unsent_d != -1)
{
JMutexAutoLock lock(m_blocks_sent_mutex);
m_nearest_unsent_d = new_nearest_unsent_d;
}
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
void RemoteClient::SendObjectData(
Server *server,
float dtime,
core::map<v3s16, bool> &stepped_blocks
)
{
DSTACK(__FUNCTION_NAME);
// Can't send anything without knowing version
if(serialization_version == SER_FMT_VER_INVALID)
{
dstream<<"RemoteClient::SendObjectData(): Not sending, no version."
<<std::endl;
return;
}
/*
Send a TOCLIENT_OBJECTDATA packet.
Sent as unreliable.
u16 command
u16 number of player positions
for each player:
v3s32 position*100
v3s32 speed*100
s32 pitch*100
s32 yaw*100
u16 count of blocks
for each block:
block objects
*/
std::ostringstream os(std::ios_base::binary);
u8 buf[12];
// Write command
writeU16(buf, TOCLIENT_OBJECTDATA);
os.write((char*)buf, 2);
/*
Get and write player data
*/
// Get connected players
core::list<Player*> players = server->m_env.getPlayers(true);
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
// Write player count
u16 playercount = players.size();
writeU16(buf, playercount);
os.write((char*)buf, 2);
core::list<Player*>::Iterator i;
for(i = players.begin();
i != players.end(); i++)
{
Player *player = *i;
v3f pf = player->getPosition();
v3f sf = player->getSpeed();
v3s32 position_i(pf.X*100, pf.Y*100, pf.Z*100);
v3s32 speed_i (sf.X*100, sf.Y*100, sf.Z*100);
s32 pitch_i (player->getPitch() * 100);
s32 yaw_i (player->getYaw() * 100);
writeU16(buf, player->peer_id);
os.write((char*)buf, 2);
writeV3S32(buf, position_i);
os.write((char*)buf, 12);
writeV3S32(buf, speed_i);
os.write((char*)buf, 12);
writeS32(buf, pitch_i);
os.write((char*)buf, 4);
writeS32(buf, yaw_i);
os.write((char*)buf, 4);
}
/*
Get and write object data
*/
/*
Get nearby blocks.
For making players to be able to build to their nearby
environment (building is not possible on blocks that are not
in memory):
- Set blocks changed
- Add blocks to emerge queue if they are not found
SUGGESTION: These could be ignored from the backside of the player
*/
Player *player = server->m_env.getPlayer(peer_id);
assert(player);
v3f playerpos = player->getPosition();
v3f playerspeed = player->getSpeed();
v3s16 center_nodepos = floatToInt(playerpos);
v3s16 center = getNodeBlockPos(center_nodepos);
s16 d_max = g_settings.getS16("active_object_range");
// Number of blocks whose objects were written to bos
u16 blockcount = 0;
std::ostringstream bos(std::ios_base::binary);
for(s16 d = 0; d <= d_max; d++)
{
core::list<v3s16> list;
getFacePositions(list, d);
core::list<v3s16>::Iterator li;
for(li=list.begin(); li!=list.end(); li++)
{
v3s16 p = *li + center;
/*
Ignore blocks that haven't been sent to the client
*/
{
JMutexAutoLock sentlock(m_blocks_sent_mutex);
if(m_blocks_sent.find(p) == NULL)
continue;
}
// Try stepping block and add it to a send queue
try
{
// Get block
MapBlock *block = server->m_env.getMap().getBlockNoCreate(p);
/*
Step block if not in stepped_blocks and add to stepped_blocks.
*/
block->stepObjects(dtime, true, server->getDayNightRatio());
stepped_blocks.insert(p, true);
block->setChangedFlag();
}
// Skip block if there are no objects
if(block->getObjectCount() == 0)
continue;
/*
Write objects
*/
// Write blockpos
writeV3S16(buf, p);
bos.write((char*)buf, 6);
// Write objects
block->serializeObjects(bos, serialization_version);
blockcount++;
/*
Stop collecting objects if data is already too big
*/
// Sum of player and object data sizes
s32 sum = (s32)os.tellp() + 2 + (s32)bos.tellp();
// break out if data too big
if(sum > MAX_OBJECTDATA_SIZE)
} //try
catch(InvalidPositionException &e)
{
// Not in memory
// Add it to the emerge queue and trigger the thread.
// Fetch the block only if it is on disk.
// Grab and increment counter
m_num_blocks_in_emerge_queue.m_value++;*/
u8 flags = BLOCK_EMERGE_FLAG_FROMDISK;
server->m_emerge_queue.addBlock(0, p, flags);
server->m_emergethread.trigger();
}
}
}
// Write block count
writeU16(buf, blockcount);
os.write((char*)buf, 2);
// Write block objects
os<<bos.str();
//dstream<<"Server: Sending object data to "<<peer_id<<std::endl;
// Make data buffer
std::string s = os.str();
SharedBuffer<u8> data((u8*)s.c_str(), s.size());
// Send as unreliable
server->m_con.Send(peer_id, 0, data, false);
}
void RemoteClient::GotBlock(v3s16 p)
{
JMutexAutoLock lock(m_blocks_sending_mutex);
JMutexAutoLock lock2(m_blocks_sent_mutex);
if(m_blocks_sending.find(p) != NULL)
m_blocks_sending.remove(p);
else
{
/*dstream<<"RemoteClient::GotBlock(): Didn't find in"
" m_blocks_sending"<<std::endl;*/
m_excess_gotblocks++;
}
m_blocks_sent.insert(p, true);
}
void RemoteClient::SentBlock(v3s16 p)
{
JMutexAutoLock lock(m_blocks_sending_mutex);
/*if(m_blocks_sending.size() > 15)
{
dstream<<"RemoteClient::SentBlock(): "
<<"m_blocks_sending.size()="
<<m_blocks_sending.size()<<std::endl;
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
if(m_blocks_sending.find(p) == NULL)
m_blocks_sending.insert(p, 0.0);
else
dstream<<"RemoteClient::SentBlock(): Sent block"
" already in m_blocks_sending"<<std::endl;
}
void RemoteClient::SetBlockNotSent(v3s16 p)
{
JMutexAutoLock sendinglock(m_blocks_sending_mutex);
JMutexAutoLock sentlock(m_blocks_sent_mutex);
m_nearest_unsent_d = 0;
if(m_blocks_sending.find(p) != NULL)
m_blocks_sending.remove(p);
if(m_blocks_sent.find(p) != NULL)
m_blocks_sent.remove(p);
}
void RemoteClient::SetBlocksNotSent(core::map<v3s16, MapBlock*> &blocks)
{
JMutexAutoLock sendinglock(m_blocks_sending_mutex);
JMutexAutoLock sentlock(m_blocks_sent_mutex);
m_nearest_unsent_d = 0;
for(core::map<v3s16, MapBlock*>::Iterator
i = blocks.getIterator();
i.atEnd()==false; i++)
{
v3s16 p = i.getNode()->getKey();
if(m_blocks_sending.find(p) != NULL)
m_blocks_sending.remove(p);
if(m_blocks_sent.find(p) != NULL)
m_blocks_sent.remove(p);
}
}
/*
PlayerInfo
*/
PlayerInfo::PlayerInfo()
{
name[0] = 0;
}
void PlayerInfo::PrintLine(std::ostream *s)
{
(*s)<<id<<": ";
(*s)<<"\""<<name<<"\" ("
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
<<position.X<<","<<position.Y
<<","<<position.Z<<") ";
address.print(s);
(*s)<<" avg_rtt="<<avg_rtt;
(*s)<<std::endl;
}
u32 PIChecksum(core::list<PlayerInfo> &l)
{
core::list<PlayerInfo>::Iterator i;
u32 checksum = 1;
u32 a = 10;
for(i=l.begin(); i!=l.end(); i++)
{
checksum += a * (i->id+1);
checksum ^= 0x435aafcd;
a *= 10;
}
return checksum;
}
/*
Server
*/
Server::Server(
std::string mapsavedir,
HMParams hm_params,
m_env(new ServerMap(mapsavedir, hm_params, map_params), dout_server),
m_con(PROTOCOL_ID, 512, CONNECTION_TIMEOUT, this),
m_thread(this),
m_time_of_day(9000),
m_time_of_day_send_timer(0),
m_uptime(0)
//m_flowwater_timer = 0.0;
m_liquid_transform_timer = 0.0;
m_print_info_timer = 0.0;
m_objectdata_timer = 0.0;
m_emergethread_trigger_timer = 0.0;
m_savemap_timer = 0.0;
m_env_mutex.Init();
m_con_mutex.Init();
m_step_dtime_mutex.Init();
m_step_dtime = 0.0;
}
Server::~Server()
{
// Stop threads
stop();
JMutexAutoLock clientslock(m_con_mutex);
for(core::map<u16, RemoteClient*>::Iterator
i = m_clients.getIterator();
i.atEnd() == false; i++)