@@ -1270,10 +1270,10 @@ void Server::setInventoryModified(const InventoryLocation &loc, bool playerSend)
1270
1270
1271
1271
void Server::SetBlocksNotSent (std::map<v3s16, MapBlock *>& block)
1272
1272
{
1273
- std::vector<u16 > clients = m_clients.getClientIDs ();
1273
+ std::vector<session_t > clients = m_clients.getClientIDs ();
1274
1274
m_clients.lock ();
1275
1275
// Set the modified blocks unsent for all the clients
1276
- for (const u16 client_id : clients) {
1276
+ for (const session_t client_id : clients) {
1277
1277
if (RemoteClient *client = m_clients.lockedGetClientNoEx (client_id))
1278
1278
client->SetBlocksNotSent (block);
1279
1279
}
@@ -1584,9 +1584,9 @@ void Server::SendSpawnParticle(session_t peer_id, u16 protocol_version,
1584
1584
g_settings->getS16 (" max_block_send_distance" ) * MAP_BLOCKSIZE * BS;
1585
1585
1586
1586
if (peer_id == PEER_ID_INEXISTENT) {
1587
- std::vector<u16 > clients = m_clients.getClientIDs ();
1587
+ std::vector<session_t > clients = m_clients.getClientIDs ();
1588
1588
1589
- for (const u16 client_id : clients) {
1589
+ for (const session_t client_id : clients) {
1590
1590
RemotePlayer *player = m_env->getPlayer (client_id);
1591
1591
if (!player)
1592
1592
continue ;
@@ -1633,8 +1633,8 @@ void Server::SendAddParticleSpawner(session_t peer_id, u16 protocol_version,
1633
1633
{
1634
1634
if (peer_id == PEER_ID_INEXISTENT) {
1635
1635
// This sucks and should be replaced:
1636
- std::vector<u16 > clients = m_clients.getClientIDs ();
1637
- for (const u16 client_id : clients) {
1636
+ std::vector<session_t > clients = m_clients.getClientIDs ();
1637
+ for (const session_t client_id : clients) {
1638
1638
RemotePlayer *player = m_env->getPlayer (client_id);
1639
1639
if (!player)
1640
1640
continue ;
@@ -1941,7 +1941,7 @@ s32 Server::playSound(const SimpleSoundSpec &spec,
1941
1941
return -1 ;
1942
1942
1943
1943
// Filter destination clients
1944
- std::vector<u16 > dst_clients;
1944
+ std::vector<session_t > dst_clients;
1945
1945
if (!params.to_player .empty ()) {
1946
1946
RemotePlayer *player = m_env->getPlayer (params.to_player .c_str ());
1947
1947
if (!player){
@@ -1956,9 +1956,9 @@ s32 Server::playSound(const SimpleSoundSpec &spec,
1956
1956
}
1957
1957
dst_clients.push_back (player->peer_id );
1958
1958
} else {
1959
- std::vector<u16 > clients = m_clients.getClientIDs ();
1959
+ std::vector<session_t > clients = m_clients.getClientIDs ();
1960
1960
1961
- for (const u16 client_id : clients) {
1961
+ for (const session_t client_id : clients) {
1962
1962
RemotePlayer *player = m_env->getPlayer (client_id);
1963
1963
if (!player)
1964
1964
continue ;
@@ -2016,7 +2016,7 @@ void Server::stopSound(s32 handle)
2016
2016
NetworkPacket pkt (TOCLIENT_STOP_SOUND, 4 );
2017
2017
pkt << handle;
2018
2018
2019
- for (std::unordered_set<u16 >::const_iterator si = psound.clients .begin ();
2019
+ for (std::unordered_set<session_t >::const_iterator si = psound.clients .begin ();
2020
2020
si != psound.clients .end (); ++si) {
2021
2021
// Send as reliable
2022
2022
m_clients.send (*si, 0 , &pkt, true );
@@ -2080,8 +2080,8 @@ void Server::sendRemoveNode(v3s16 p, u16 ignore_id,
2080
2080
NetworkPacket pkt (TOCLIENT_REMOVENODE, 6 );
2081
2081
pkt << p;
2082
2082
2083
- std::vector<u16 > clients = m_clients.getClientIDs ();
2084
- for (u16 client_id : clients) {
2083
+ std::vector<session_t > clients = m_clients.getClientIDs ();
2084
+ for (session_t client_id : clients) {
2085
2085
if (far_players) {
2086
2086
// Get player
2087
2087
if (RemotePlayer *player = m_env->getPlayer (client_id)) {
@@ -2110,8 +2110,8 @@ void Server::sendAddNode(v3s16 p, MapNode n, u16 ignore_id,
2110
2110
float maxd = far_d_nodes*BS;
2111
2111
v3f p_f = intToFloat (p, BS);
2112
2112
2113
- std::vector<u16 > clients = m_clients.getClientIDs ();
2114
- for (const u16 client_id : clients) {
2113
+ std::vector<session_t > clients = m_clients.getClientIDs ();
2114
+ for (const session_t client_id : clients) {
2115
2115
if (far_players) {
2116
2116
// Get player
2117
2117
if (RemotePlayer *player = m_env->getPlayer (client_id)) {
@@ -2145,9 +2145,9 @@ void Server::sendAddNode(v3s16 p, MapNode n, u16 ignore_id,
2145
2145
2146
2146
void Server::setBlockNotSent (v3s16 p)
2147
2147
{
2148
- std::vector<u16 > clients = m_clients.getClientIDs ();
2148
+ std::vector<session_t > clients = m_clients.getClientIDs ();
2149
2149
m_clients.lock ();
2150
- for (const u16 i : clients) {
2150
+ for (const session_t i : clients) {
2151
2151
RemoteClient *client = m_clients.lockedGetClientNoEx (i);
2152
2152
client->SetBlockNotSent (p);
2153
2153
}
@@ -2189,10 +2189,10 @@ void Server::SendBlocks(float dtime)
2189
2189
{
2190
2190
ScopeProfiler sp2 (g_profiler, " Server: selecting blocks for sending" );
2191
2191
2192
- std::vector<u16 > clients = m_clients.getClientIDs ();
2192
+ std::vector<session_t > clients = m_clients.getClientIDs ();
2193
2193
2194
2194
m_clients.lock ();
2195
- for (const u16 client_id : clients) {
2195
+ for (const session_t client_id : clients) {
2196
2196
RemoteClient *client = m_clients.lockedGetClientNoEx (client_id, CS_Active);
2197
2197
2198
2198
if (!client)
@@ -2675,9 +2675,9 @@ void Server::DeleteClient(session_t peer_id, ClientDeletionReason reason)
2675
2675
{
2676
2676
if (player && reason != CDR_DENY) {
2677
2677
std::ostringstream os (std::ios_base::binary);
2678
- std::vector<u16 > clients = m_clients.getClientIDs ();
2678
+ std::vector<session_t > clients = m_clients.getClientIDs ();
2679
2679
2680
- for (const u16 client_id : clients) {
2680
+ for (const session_t client_id : clients) {
2681
2681
// Get player
2682
2682
RemotePlayer *player = m_env->getPlayer (client_id);
2683
2683
if (!player)
@@ -2812,7 +2812,7 @@ std::wstring Server::handleChat(const std::string &name, const std::wstring &wna
2812
2812
*/
2813
2813
actionstream << " CHAT: " << wide_to_narrow (unescape_enriched (line)) << std::endl;
2814
2814
2815
- std::vector<u16 > clients = m_clients.getClientIDs ();
2815
+ std::vector<session_t > clients = m_clients.getClientIDs ();
2816
2816
2817
2817
/*
2818
2818
Send the message back to the inital sender
@@ -2886,8 +2886,8 @@ std::wstring Server::getStatusString()
2886
2886
// Information about clients
2887
2887
bool first = true ;
2888
2888
os<<L" , clients={" ;
2889
- std::vector<u16 > clients = m_clients.getClientIDs ();
2890
- for (u16 client_id : clients) {
2889
+ std::vector<session_t > clients = m_clients.getClientIDs ();
2890
+ for (session_t client_id : clients) {
2891
2891
// Get player
2892
2892
RemotePlayer *player = m_env->getPlayer (client_id);
2893
2893
// Get name of player
@@ -2927,8 +2927,8 @@ bool Server::checkPriv(const std::string &name, const std::string &priv)
2927
2927
void Server::reportPrivsModified (const std::string &name)
2928
2928
{
2929
2929
if (name.empty ()) {
2930
- std::vector<u16 > clients = m_clients.getClientIDs ();
2931
- for (const u16 client_id : clients) {
2930
+ std::vector<session_t > clients = m_clients.getClientIDs ();
2931
+ for (const session_t client_id : clients) {
2932
2932
RemotePlayer *player = m_env->getPlayer (client_id);
2933
2933
reportPrivsModified (player->getName ());
2934
2934
}
@@ -3622,7 +3622,7 @@ ModChannel* Server::getModChannel(const std::string &channel)
3622
3622
}
3623
3623
3624
3624
void Server::broadcastModChannelMessage (const std::string &channel,
3625
- const std::string &message, u16 from_peer)
3625
+ const std::string &message, session_t from_peer)
3626
3626
{
3627
3627
const std::vector<u16> &peers = m_modchannel_mgr->getChannelPeers (channel);
3628
3628
if (peers.empty ())
0 commit comments