Get Current Online user of the channel under the Radar?
#23


1 hour ago, Andrein95 said:




/index.php?/profile/14423-nicolasg/&do=hovercard" data-mentionid="14423" href="/index.php?/profile/14423-nicolasg/" rel="">@nicolasg



In my opinion you did well, in SessionStateInfo we can not access directly ChannelInfo, only using cascade if with pointer and make a lot of exxternal inclusion (server select,server info ecc)


IMPLEMENT_MSG_UPDATE(OnlinePlayers) {
UpdateClient::OnlinePlayersInfo* pPack = reinterpret_cast<UpdateClient::OnlinePlayersInfo*>(istr->GetBuffer());
_pNetwork->PlayersCounter = (pPack->PlayersOnline);
}


Here instead we can access directly without make dirty this function.



To summarize:



The nice approach would not be to load players counter for the first time in some constructor of the radar using pChannelInfo and then on RadarUpdate Function to retrieve from pNetwork?




Yes, you could skip all check statements, and copy the value from iPlayerNum into PlayersCounter just once. It would be a cleaner code and you would consume less resources in each execution of the loop



Messages In This Thread
[No subject] - by Andrein95 - 05-06-2022, 10:24 AM
[No subject] - by Scura - 05-06-2022, 11:26 AM
[No subject] - by nicolasg - 06-29-2022, 01:50 AM
[No subject] - by nicolasg - 06-29-2022, 04:38 AM
[No subject] - by Andrein95 - 06-29-2022, 09:47 AM
[No subject] - by nicolasg - 06-29-2022, 12:30 PM
[No subject] - by Andrein95 - 06-30-2022, 07:09 AM
[No subject] - by Veni - 06-30-2022, 09:07 AM
[No subject] - by Andrein95 - 06-30-2022, 09:13 AM
[No subject] - by nicolasg - 06-30-2022, 12:02 PM
[No subject] - by OberonPh - 07-01-2022, 06:38 AM
[No subject] - by Andrein95 - 07-01-2022, 07:21 AM
[No subject] - by Andrein95 - 07-01-2022, 07:22 AM
[No subject] - by nicolasg - 07-01-2022, 12:18 PM
[No subject] - by nicolasg - 07-01-2022, 12:21 PM
[No subject] - by nicolasg - 07-01-2022, 12:35 PM
[No subject] - by OberonPh - 07-02-2022, 01:27 AM
[No subject] - by OberonPh - 07-02-2022, 01:28 AM
[No subject] - by OberonPh - 07-02-2022, 01:30 AM
[No subject] - by Andrein95 - 04-30-2023, 10:06 PM
[No subject] - by nicolasg - 04-30-2023, 10:18 PM
[No subject] - by Andrein95 - 04-30-2023, 10:30 PM
[No subject] - by nicolasg - 04-30-2023, 10:44 PM
[No subject] - by Andrein95 - 05-01-2023, 09:15 AM
[No subject] - by Andrein95 - 05-01-2023, 09:47 AM
[No subject] - by Andrein95 - 05-01-2023, 10:28 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)