error: ‘bz_changeTeam’ was not declared in this scope

Questions, comments, and news on the server side plug-ins and it's API
Post Reply
User avatar
The Noah
Private First Class
Private First Class
Posts: 43
Joined: Mon Jul 11, 2016 9:38 pm
Location: src/bzflag
Contact:

error: ‘bz_changeTeam’ was not declared in this scope

Post by The Noah » Sun Oct 08, 2017 12:42 pm

I'm making a plug-in, and when an event is triggered i want to change the player's team. But when i try to compile it (i'm compiling correctly) it gives me the fallowing error:

Code: Select all

error: ‘bz_changeTeam’ was not declared in this scope
i don't know how to fix this. I've search Google and this forum, but found nothing.

Thanks,
The Noah
I host maps, just PM Me or Contact Me via My Website if you want yours hosted.

User avatar
Zehra
Private First Class
Private First Class
Posts: 419
Joined: Sun Oct 18, 2015 3:36 pm
Location: Arctic
Contact:

Re: error: ‘bz_changeTeam’ was not declared in this scope

Post by Zehra » Sun Oct 08, 2017 12:59 pm

The bz_changeTeam was a function meant for BZFlag 3.0, which was never released and never back-ported.

From Wiki:

Code: Select all

bz_changeTeam

void bz_changeTeam (int player, bz_eTeamType team)


Changes the team of a player. (v3.0)
Parameters:
player  -  The player who is affected by the team change.
team  -  The team to set the player to.
There is no way to officially change teams, but there is a way to change teams through a third party API written by Allejo called bzToolkit and it supports changing teams without rejoins.

From bzToolkit readme:
A third-party BZFlag plug-in API that consists of functions that do not exist in the official API. There are a lot of functions access BZFS headers directly, a practice that is discouraged, and there are some convenience functions as well.

-Zehra
There's this game I love and it's called Ducati. ~Zehra
Those who are critical of me, I'll likely be the same of them. ~Zehra
There's always something to remember and it's been a game I love. ~Zehra
The time spent is a time which can never be regained, so it's a time to enjoy. ~Zehra
The decisions we make are the ones we look forward too and the ones we regret. ~Zehra
The details and the skill of knowing and applying them is what excellence is made of. ~Zehra
The best player is the one who knows what to do and when and applies it successfully. ~Zehra
There's a difference between knowing my name and knowing me, one shows respect to my name and the other is to who I am. ~Zehra
My blog is available at zehrahblog.wordpress.com.
See when I've last been active at Strayers.

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5167
Joined: Fri Dec 13, 2002 4:11 am
Location: [Redacted]
Contact:

Re: error: ‘bz_changeTeam’ was not declared in this scope

Post by JeffM » Mon Oct 09, 2017 2:28 am

That third party api only works on Linux and will be disabled in a future release

User avatar
blast
General
General
Posts: 4663
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: error: ‘bz_changeTeam’ was not declared in this scope

Post by blast » Mon Oct 09, 2017 10:41 am

That "third-party API" isn't an API, it's internal bzfs functions and structures that can and will change without notice, breaking plugins that rely on it. BZFlag 2.4.x does not have a mechanism to change a player's team during the game, only cheap hacks.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

User avatar
The Noah
Private First Class
Private First Class
Posts: 43
Joined: Mon Jul 11, 2016 9:38 pm
Location: src/bzflag
Contact:

Re: error: ‘bz_changeTeam’ was not declared in this scope

Post by The Noah » Mon Oct 09, 2017 2:09 pm

Well, personally I think y'all should leave it. It makes things better, and adds more functions. Or you could just integrate it into the BZF API.

I don't mean to sound rude, but please leave it or add it into to BZF API, it will make me happy and I'm sure other people happy too.

Thanks,
The Noah
I host maps, just PM Me or Contact Me via My Website if you want yours hosted.

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5167
Joined: Fri Dec 13, 2002 4:11 am
Location: [Redacted]
Contact:

Re: error: ‘bz_changeTeam’ was not declared in this scope

Post by JeffM » Mon Oct 09, 2017 4:17 pm

They need to be added to the API, that is the only viable solution.

The reason to remove the lib is that it's calling internal BZFS functions. Because they are internal, they may be changed as bzflag is developed, and that would break this fake API lib. It is incredibly fragile and not a good way to present a public API. Also it does not work on windows.

A public API is the right way to present a public API.

User avatar
The Noah
Private First Class
Private First Class
Posts: 43
Joined: Mon Jul 11, 2016 9:38 pm
Location: src/bzflag
Contact:

Re: error: ‘bz_changeTeam’ was not declared in this scope

Post by The Noah » Mon Oct 09, 2017 5:33 pm

Yes, integrating it is PERFECT! So if you can, in the next release add it in. And to make existing plug-ins that use the 'API', at first have the functions called the same thing. e.g. 'bz_changeTeam' would still be 'bztk_changeTeam'.

The Noah
I host maps, just PM Me or Contact Me via My Website if you want yours hosted.

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5167
Joined: Fri Dec 13, 2002 4:11 am
Location: [Redacted]
Contact:

Re: error: ‘bz_changeTeam’ was not declared in this scope

Post by JeffM » Mon Oct 09, 2017 8:48 pm

If they get integrated they will be made consistant with the existing API style. Comparability with existing plug-ins that use the library will be broken. This is required by the very fact that they are NOT calling a real API, it is unavoidable. Plugins that use it now will need to at the very least be rebuilt, at worst require code modifications.

Binary compatibility with a fake API is not our concern, and is one of the main problems with it's very existence. That's what you get for trying to fake out the API :)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest