Alexandrite Posted October 23, 2023 Group: Members Topic Count: 21 Topics Per Day: 0.01 Content Count: 54 Reputation: 0 Joined: 02/19/14 Last Seen: September 10, 2024 Share Posted October 23, 2023 due to Ragexe Client now no longer show Player Online Count, and I don't know which server or client that i should fix If anyone know how to mod the client to show the Player Online Count after server name, I'm appreciate it. But if it have to do with the source, right now i'm at here src/char/char_logif.cpp around the line 777 I change from //memcpy(WFIFOP(login_fd,60), charserv_config.server_name, 20); Sql_Query(sql_handle, "SELECT count(`char_id`) FROM `char` WHERE `online`>0"); char result[50]; sprintf(result, "%s(%d)", charserv_config.server_name, sql_handle); memcpy(WFIFOP(login_fd,60), result, 20); But it won't work and I don't know how to make it happend , can anyone help me please? Quote Link to comment Share on other sites More sharing options...
0 Hergel Posted October 25, 2023 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 22 Reputation: 5 Joined: 02/22/22 Last Seen: Yesterday at 12:20 AM Share Posted October 25, 2023 (edited) On 10/23/2023 at 2:14 PM, Alexandrite said: due to Ragexe Client now no longer show Player Online Count, and I don't know which server or client that i should fix If anyone know how to mod the client to show the Player Online Count after server name, I'm appreciate it. But if it have to do with the source, right now i'm at here src/char/char_logif.cpp around the line 777 I change from //memcpy(WFIFOP(login_fd,60), charserv_config.server_name, 20); Sql_Query(sql_handle, "SELECT count(`char_id`) FROM `char` WHERE `online`>0"); char result[50]; sprintf(result, "%s(%d)", charserv_config.server_name, sql_handle); memcpy(WFIFOP(login_fd,60), result, 20); But it won't work and I don't know how to make it happend , can anyone help me please? I understand that displaying the current online status can be extremely helpful. However, it’s possible that you might be looking in the wrong place. Perhaps you could try the following suggestion: /src/login/loginclif.cpp method logclif_auth_ok find this : WFIFOW(fd,header+n*size+4) = ntows(htons(ch_server[i].port)); // [!] LE byte order here [!] memcpy(WFIFOP(fd,header+n*size+6), ch_server[i].name, 20); WFIFOW(fd,header+n*size+26) = login_get_usercount( ch_server[i].users ); replace for: WFIFOW(fd,header+n*size+4) = ntows(htons(ch_server[i].port)); // [!] LE byte order here [!] // Concatenate the server name with the online user count [Hergel] char buffer[20]; int users = ch_server[i].users; snprintf(buffer, 20, "%s (%d)", ch_server[i].name, users); memcpy(WFIFOP(fd, header+n*size+6), buffer, 20); WFIFOW(fd,header+n*size+26) = login_get_usercount( ch_server[i].users ); Edited October 25, 2023 by Hergel Quote Link to comment Share on other sites More sharing options...
0 Alexandrite Posted October 25, 2023 Group: Members Topic Count: 21 Topics Per Day: 0.01 Content Count: 54 Reputation: 0 Joined: 02/19/14 Last Seen: September 10, 2024 Author Share Posted October 25, 2023 (edited) 2 hours ago, Hergel said: I understand that displaying the current online status can be extremely helpful. However, it’s possible that you might be looking in the wrong place. Perhaps you could try the following suggestion: /src/login/loginclif.cpp method logclif_auth_ok find this : WFIFOW(fd,header+n*size+4) = ntows(htons(ch_server[i].port)); // [!] LE byte order here [!] memcpy(WFIFOP(fd,header+n*size+6), ch_server[i].name, 20); WFIFOW(fd,header+n*size+26) = login_get_usercount( ch_server[i].users ); replace for: WFIFOW(fd,header+n*size+4) = ntows(htons(ch_server[i].port)); // [!] LE byte order here [!] // Concatenate the server name with the online user count [Hergel] char buffer[20]; int users = ch_server[i].users; snprintf(buffer, 20, "%s (%d)", ch_server[i].name, users); memcpy(WFIFOP(fd, header+n*size+6), buffer, 20); WFIFOW(fd,header+n*size+26) = login_get_usercount( ch_server[i].users ); OMG! and I thought I already lost hope, Thank you so much for finding it and clarify to me, it help me so much ^ ^ It worked now, like a Magic! I'm so appreciated your support!!! Edited October 25, 2023 by Alexandrite Quote Link to comment Share on other sites More sharing options...
Question
Alexandrite
due to Ragexe Client now no longer show Player Online Count, and I don't know which server or client that i should fix
If anyone know how to mod the client to show the Player Online Count after server name, I'm appreciate it.
But if it have to do with the source, right now i'm at here
src/char/char_logif.cpp
around the line 777
I change from
//memcpy(WFIFOP(login_fd,60), charserv_config.server_name, 20);
Sql_Query(sql_handle, "SELECT count(`char_id`) FROM `char` WHERE `online`>0");
char result[50];
sprintf(result, "%s(%d)", charserv_config.server_name, sql_handle);
memcpy(WFIFOP(login_fd,60), result, 20);
But it won't work and I don't know how to make it happend , can anyone help me please?
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.