void bz_setMaxWaitTime ( float time ) function

Questions, comments, and news on the server side plug-ins and it's API
Post Reply
User avatar
LouMan
Chief Sgt. of Cartography
Chief Sgt. of Cartography
Posts: 338
Joined: Mon Jan 31, 2005 3:05 am
Location: Michigan, USA

void bz_setMaxWaitTime ( float time ) function

Post by LouMan »

Does anyone know why I get compile errors when I try to use the function:

void bz_setMaxWaitTime ( float time );

used in the following way:

bz_setMaxWaitTime ( 0.5 );

?

The compile errors I get are as follows:

error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2365: 'bz_setMaxWaitTime' : redefinition; previous definition was 'function'
c:\Source\bzflag\include\bzfsAPI.h(1000) : see declaration of 'bz_setMaxWaitTime'
warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data
User avatar
joevano
General
General
Posts: 1863
Joined: Sat Jun 18, 2005 1:08 pm
Location: South Bend, Indiana, USA

Post by joevano »

Hmmm... can't wait to see what your up to now :D
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

you sir have found a bug :)

seems we can't use the word "time" for the parameter in that function, it's a reserved type name.

get the latest code from cvs, it changes the name and fixes it.
ImageJeffM
User avatar
LouMan
Chief Sgt. of Cartography
Chief Sgt. of Cartography
Posts: 338
Joined: Mon Jan 31, 2005 3:05 am
Location: Michigan, USA

Post by LouMan »

Thanks so much! I think I was also using it in the wrong context as well - I moved the function into my event code and it seems to work ok now. (see plugin releases - wwzones)

BTW - I used your (JeffM) code for flagStay as a base for the new plugin - I hope that it's ok. I gave credit where I could.

Again, thanks :)
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

the bug was the fact that the word "time" is defined as a type in windows. you should be able to call that function from anywhere.

int 2.0.x I just fixed that one function, in 2.1.x I changed every instance of the word time in the API to be something else, so we should not have the problem again.

I'm glad the code was of some use to you, I'm always happy to see people extend thing I do.
ImageJeffM
Post Reply