View Single Post
Re: Bogus Message Type, Server Crashes
Old
  (#9)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: Bogus Message Type, Server Crashes - 21-04-2004

"bogus message type (0)" errors are caused when you try to send a network message without registering it first. For example, if you had something like this...
Code:
pfnMessageBegin( MSG_ONE, gmsgTextMsg, NULL, pEntity );
Code:
pfnWriteByte( msg_dest );
pfnWriteString( msg_name );
pfnMessageEnd();

...you can get that error if you never registered 'gmsgTextMsg' using REG_USER_MSG.

You should have the code be something like this instead...
Code:
if (gmsgTextMsg == 0)
Code:
gmsgTextMsg = REG_USER_MSG( "TextMsg", -1 );

pfnMessageBegin( MSG_ONE, gmsgTextMsg, NULL, pEntity );
pfnWriteByte( msg_dest );
pfnWriteString( msg_name );
pfnMessageEnd();

It should be pretty simple to search your bot code for "MESSAGE_BEGIN" or "pfnMessageBegin" and find all the places where you're not checking the message ID for == 0.

EDIT: I have NO idea why it's putting the "Courier New" crap in there.

botman

Last edited by botman; 21-04-2004 at 01:23..
  
Reply With Quote