Raised This Month: $51 Target: $400
 12% 

Getting message details


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 01-18-2005 , 22:22   Getting message details
Reply With Quote #1

Is it possible to loop through like numbers 1-100 to try to find valid message IDs, then to see what the names of the messages are as well as how many arguments each takes? (yes I know I'm probably dreaming)

Anyone know?
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Manip
Senior Member
Join Date: Jan 2004
Old 01-18-2005 , 22:32  
Reply With Quote #2

Yes and No.

You _can_ look though message indexes and retrieve the 'text' name of them. However if you try and get an index that doesn't exist (out of range) the server crashes.
Manip is offline
Send a message via AIM to Manip
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 02-01-2005 , 16:38  
Reply With Quote #3

What function lets me loop through them?
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
theqizmo
Member
Join Date: Oct 2004
Old 02-01-2005 , 22:16  
Reply With Quote #4

Code:
bf_write* VFUNC myUserMessageBegin(IVEngineServer *pEngine, IRecipientFilter *filter, int msg_type)
{
	LOG("myUserMessageBegin([%x] [0x%X] [%d])", pEngine, filter, msg_type); 
	bf_write *pTemp = engine_UserMessageBegin(pEngine, filter, msg_type);
	
	if (INTERFACES_(pUserMessages))
	{
		char *szName = NULL;
		
		szName = INTERFACES_(pUserMessages)->GetUserMessageName(msg_type);
		
		LOG("[%d] = [%s]", msg_type, (szName) ? szName : "NULL");
	}
	else
	{
		LOG("0x%x of pUserMessages", INTERFACES_(pUserMessages));
	}
	return pTemp;
}

//CUserMessages *pUserMessages;
This is the code I use when messages are sent. Or basically: char *CUserMessages::GetUserMessageName(int msg_type);

Only problem is, you don't have direct access to usermessages, so you have to use something like Lance's sigscanner, or maybe even GetProcAddress, to derive the address from the server.dll.
theqizmo is offline
Send a message via ICQ to theqizmo Send a message via AIM to theqizmo Send a message via MSN to theqizmo
XAD
Senior Member
Join Date: Mar 2004
Location: Sweden
Old 02-02-2005 , 04:49  
Reply With Quote #5

** edit **

Quote:
Originally Posted by Manip
My code kicks all of your code's asses:
Ouch, reading you post Manip I realized I responded on thegizmo's post and not the original... my code was about displaying the usermessages sent and the arguments...

Me, I use the "built" in:
Code:
UserMessageBegin( filter, "VGUIMenu" )
So I don't need to know the number...

/X
XAD is offline
Manip
Senior Member
Join Date: Jan 2004
Old 02-02-2005 , 05:58  
Reply With Quote #6

My code kicks all of your code's asses:

Code:
short CCoreNatives::UserMessageIndex(const char *messageName)
{
	char name[128] = ""; int sizereturn = 0; bool boolrtn = false;
	// TODO: Find out how to get total number of user messages on a server DLL
	// HACK: If the total number of user messages < 22 it will crash the mod(!)  
	for(int x=1; x<22; x++)
	{
		boolrtn =  m_GameDLL->GetUserMessageInfo(x, name, 128, sizereturn);  
		if(name && strcmp(messageName, name) == 0) 
			return x; 	
	}
	return -1; 
}
Manip is offline
Send a message via AIM to Manip
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 02-02-2005 , 08:20  
Reply With Quote #7

Quote:
Originally Posted by XAD
Me, I use the "built" in:
Code:
UserMessageBegin( filter, "VGUIMenu" )
So I don't need to know the number...

/X
How are you using the built-in?

engine->UserMessageBegin( (IRecipientFilter *)&f, "HintText" );

The second argument is supposed to be an int


Also Manip I don't know how to use that code, how did you instantiate m_GameDLL
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 02-02-2005 , 08:23  
Reply With Quote #8

He probably evil h4x and gets the function pointer directly into the gamedll!!!!! BAN!
__________________
hello, i am pm
PM is offline
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 02-02-2005 , 11:15  
Reply With Quote #9

Maybe some could just print a list of them with their numbers
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Fruchtzwerg
Member
Join Date: Dec 2004
Old 02-02-2005 , 12:34  
Reply With Quote #10

Quote:
Originally Posted by Geesu
Maybe some could just print a list of them with their numbers
Very bad idea, because it could change in the future.
__________________
Fruchtzwerg is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:47.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode