.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Cyborg Factory > HPB_bot
HPB_bot The trusty good ole mechs by botman HLDMTFCOpposing ForceDMCFront Line Force

Reply
 
Thread Tools
Bug in Template version 4
Old
  (#1)
koraX
Member
 
koraX's Avatar
 
Status: Offline
Posts: 145
Join Date: Jan 2004
Location: Slovak Republic
Default Bug in Template version 4 - 30-08-2004

first look here

1. bug

defined in dlls\h_export.cpp : (same as HPBT3)
Code:
#ifndef __linux__
#ifdef __BORLANDC__
extern "C" DLLEXPORT void EXPORT GiveFnptrsToDll(enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals)
#else
void       DLLEXPORT GiveFnptrsToDll(enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals )
#endif
#else
extern "C" DLLEXPORT GiveFnptrsToDll(enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals )
#endif
ERROR : Under linux, GiveFnptrsToDll will not be returning void (?will return int?). This differs from the SDKs definition. Also definition under Borland looks very strange.

I've read many posts in old botmans forum regarding missing void type ("h_export.cpp: ISO C++ forbids declaration of `GiveFnptrsToDll' with no type"). This can be IMHO simply fixed by adding void return type to declaration of GiveFnptrsToDll() where it is missing.


2. bug, more serious

Defined in dlls\h_export.cpp :
Code:
#ifdef __BORLANDC__
extern "C" DLLEXPORT int EXPORT Server_GetBlendingInterface
( int version, struct sv_blending_interface_s **ppinterface, 
struct engine_studio_api_s *pstudio, float (*rotationmatrix)[3][4], 
float (*bonetransform)[MAXSTUDIOBONES][3][4] )
#else
int DLLEXPORT Server_GetBlendingInterface
( int version, struct sv_blending_interface_s **ppinterface, 
struct engine_studio_api_s *pstudio, float (*rotationmatrix)[3][4], 
float (*bonetransform)[MAXSTUDIOBONES][3][4] )
#endif
{
   static SERVER_GETBLENDINGINTERFACE other_Server_GetBlendingInterface = NULL;
   static bool missing = FALSE;
   // if the blending interface has been formerly reported as missing, give up
   if (missing)
      return (FALSE);
   // do we NOT know if the blending interface is provided ? if so, look for its address
   if (other_Server_GetBlendingInterface == NULL)
      other_Server_GetBlendingInterface = (SERVER_GETBLENDINGINTERFACE) GetProcAddress (h_Library, "Server_GetBlendingInterface");
   // have we NOT found it ?
   if (!other_Server_GetBlendingInterface) {
      missing = TRUE; // then mark it as missing, no use to look for it again in the future
      return (FALSE); // and give up
   }
   // else call the function that provides the blending interface on request
   return ((other_Server_GetBlendingInterface) (version, ppinterface, pstudio, rotationmatrix, bonetransform));
}
***ERROR*** : This function is not exported under MSVC. DLLEXPORT macro is wrong and there is no declarator telling that this function should be exported. If this function will be exported by some miracle or .def file, it will crash whole Half-life for sure, because of wrong __stdcall calling convention. Calling convention for this function is __cdecl, which is default



.


kXBot
koraX's utils
- see my homepage for other projects (OpenGL CSG Editor, FAT16 Sim, NNetwork Sim, ...)
  
Reply With Quote
Re: Bug in Template version 4
Old
  (#2)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Bug in Template version 4 - 31-08-2004

Fixed

I was the guy responsible of adding Steam support and the blending interface stuff in botman's template. I'm the person to blame



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Bug in Template version 4
Old
  (#3)
koraX
Member
 
koraX's Avatar
 
Status: Offline
Posts: 145
Join Date: Jan 2004
Location: Slovak Republic
Default Re: Bug in Template version 4 - 03-09-2004

Quote:
Originally Posted by Pierre-Marie Baty
I'm the person to blame
I blame you again

you forgot to change functions declaration in bot.h :
Code:
typedef int (DLLEXPORT *SERVER_GETBLENDINGINTERFACE) ( ... );
Though Server_GetBlendingInterface is exported correctly, it loads Server_GetBlendingInterface from game dll and converts it to that wrong pointer. So it will probably crash.

correct is same as for linux :
Code:
typedef int (*SERVER_GETBLENDINGINTERFACE) ( ... );


kXBot
koraX's utils
- see my homepage for other projects (OpenGL CSG Editor, FAT16 Sim, NNetwork Sim, ...)

Last edited by koraX; 03-09-2004 at 22:30..
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com