Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » [Plug-in] SSGM2.02 Ping Plugin  () 1 Vote
Re: [Plug-in] SSGM2.02 Ping Plugin [message #439601 is a reply to message #381102] Tue, 16 November 2010 05:30 Go to previous message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma:
General (3 Stars)
That Get_Part_Names function can be exploited, if a player's name has a substring of another player's name then Get_Part_Name will always fail for the substring. IE:

jnz joins the game
jnzkiller joins the game

Get_Part_Names("jnz"); //returns 0

Also note that it would be worth changing stricmp and stristr to strcmp and strstr, I am not sure but I think 2 players can join with the same name but in diffrent case. ("jnz", "JNZ"). If this is not the case then just ignore me.

A fix would be:

GameObject *Get_Part_Name(const char *name1)
{
	GenericSLNode *x = BaseGameObjList->HeadNode;
	int count = 0;
	GameObject *current = 0;
	while (x)
	{
		GameObject *o = As_ScriptableGameObj((GameObject *)x->NodeData);
		if (o && Commands->Is_A_Star(o) && As_SoldierGameObj(o)){
			const char *name = Get_Player_Name(o);
			if(stricmp(name, name1) != 0)
			{
				delete []name;
				return o;
			}
			if (stristr(name,name1))
			{
				current = o;
				count++;
			}
			delete[] name;
		}
		x = x->NodeNext;
	}
	if ((count == 1) && (current) && (Commands->Get_ID(current)))
	{
		return current;
	}
	else
	{
		return 0;
	}
}
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [skin] Skittles Stealth Effect
Next Topic: [Skins] Duke 3D doors
Goto Forum:
  


Current Time: Fri Feb 14 12:38:01 MST 2025

Total time taken to generate the page: 0.01150 seconds