Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » current players in servername - c++
current players in servername - c++ [message #451368] Fri, 12 August 2011 11:56 Go to next message
SODPaddy is currently offline  SODPaddy
Messages: 233
Registered: August 2005
Location: Germany
Karma: 0
Recruit

hey,

someone knows how to show to current ingame players in the servername?

few years ago i saw it in the wol/xwis listing

looks like: ~ Server xyz AOW (xx/20) ~


Website: www.Area54.eu

Once 54, Always 54.
(\__/)
(O.o )
(___)
Visit us at www.Area54.eu

[Updated on: Sun, 14 August 2011 11:51]

Report message to a moderator

Re: current players in servername - c++ [message #451583 is a reply to message #451368] Sun, 14 August 2011 12:34 Go to previous messageGo to next message
SODPaddy is currently offline  SODPaddy
Messages: 233
Registered: August 2005
Location: Germany
Karma: 0
Recruit

example here

http://www.renegadeforums.com/index.php?t=getfile&id=469&private=0


Website: www.Area54.eu

Once 54, Always 54.
(\__/)
(O.o )
(___)
Visit us at www.Area54.eu
Re: current players in servername - c++ [message #451585 is a reply to message #451583] Sun, 14 August 2011 12:36 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3811
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
Do you mean you want the players to be listed in that empty box below?

Re: current players in servername - c++ [message #451587 is a reply to message #451368] Sun, 14 August 2011 12:51 Go to previous messageGo to next message
SODPaddy is currently offline  SODPaddy
Messages: 233
Registered: August 2005
Location: Germany
Karma: 0
Recruit

XWIS/WOL dont show the Gamespy players, so i want to show the players in the servername (bGametitle)

screenshot: xwis show 10/32 players but 32/32 connectet


Website: www.Area54.eu

Once 54, Always 54.
(\__/)
(O.o )
(___)
Visit us at www.Area54.eu

[Updated on: Sun, 14 August 2011 12:53]

Report message to a moderator

Re: current players in servername - c++ [message #451594 is a reply to message #451368] Sun, 14 August 2011 14:26 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma: 0
General (4 Stars)
I wrote something simple that runs inside a dedicated thread and every 5 seconds updates the player list like that. It grabs the actual name of the server and saves it, then appends (%d/%d) to it so it looks like:

SERVER_NAME (CURRENT_PLAYERS/MAX_PLAYERS)

as shown in the attached screenshot. With my GameSpy plugin you can set it so GameSpy broadcasts a custom game title for your server different from the one you set for WOL, so the player count doesn't show up in the title of your server on GSA.

Here's the code and how to use it if you want to have it as an SSGM plugin:

plugin.cpp includes:
void Plugin_Load() {
	CreateThread(NULL, NULL, Set_Player_Count_Game_Title, NULL, NULL, NULL);
}

DWORD WINAPI Set_Player_Count_Game_Title(LPVOID params)
{
	const char* ServerName = WideCharToChar(The_Game()->GameTitle.Peek_Buffer());
	char tmp[128];
	for (;;)
	{
		memset(tmp, 0x0, 128);		
		sprintf(tmp, "%s (%d/%d)", ServerName, The_Game()->CurrentPlayers, The_Game()->MaxPlayers);
		const wchar_t *Data = CharToWideChar(tmp);
		The_Game()->GameTitle = Data;
		delete []Data;
		Sleep(5000);
	}
	delete []ServerName;
	return 0;
}


And inside plugin.h include:

DWORD WINAPI Set_Player_Count_Game_Title(LPVOID params);
  • Attachment: Untitled.png
    (Size: 68.94KB, Downloaded 108 times)


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases

[Updated on: Sun, 14 August 2011 15:16]

Report message to a moderator

Re: current players in servername - c++ [message #451643 is a reply to message #451594] Sun, 14 August 2011 18:56 Go to previous messageGo to next message
ExEric3 is currently offline  ExEric3
Messages: 746
Registered: February 2005
Location: Slovakia
Karma: 0
Colonel
iRANian wrote on Sun, 14 August 2011 23:26

I wrote something simple that runs inside a dedicated thread and every 5 seconds updates the player list like that.
[/code]


Compiled and works perfect. Paddy try attached file.
  • Attachment: xwis.dll
    (Size: 105.50KB, Downloaded 73 times)
Re: current players in servername - c++ [message #452157 is a reply to message #451368] Sun, 21 August 2011 16:01 Go to previous message
SODPaddy is currently offline  SODPaddy
Messages: 233
Registered: August 2005
Location: Germany
Karma: 0
Recruit

thanks dude

Website: www.Area54.eu

Once 54, Always 54.
(\__/)
(O.o )
(___)
Visit us at www.Area54.eu
Previous Topic: How does the game get the player counts for servers on WOL?
Next Topic: GDI MRLS vehicle bones problem
Goto Forum:
  


Current Time: Mon Nov 25 13:58:48 MST 2024

Total time taken to generate the page: 0.01915 seconds