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: 82
Joined: Mon Jul 11, 2016 9:38 pm
Location: United States
Contact:

error: ‘bz_changeTeam’ was not declared in this scope

Post by The Noah »

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've been working on a real-time stats site called BZList, please check it out! It is still in active development, so some features are missing and watch out for bugs.

GitHub · Website · Get in touch · Stalk Me
User avatar
Zehra
Private First Class
Private First Class
Posts: 915
Joined: Sun Oct 18, 2015 3:36 pm
Location: Within the BZFS API and Beyond it
Contact:

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

Post by Zehra »

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
Those who are critical of me, I'll likely be the same of them. ~Zehra
The decisions we make are the ones we look forward too and the ones we regret. ~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

See where I've last been active at Strayers.
Visit BZList.net for a modern HTML5 server stats site.

Click here to view the 101 Leaderboard & Score Summaries Last updated 2021-01-12 (YYYY-MM-DD)
Latest 101 thread
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

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

Post by JeffM »

That third party api only works on Linux and will be disabled in a future release
ImageJeffM
User avatar
blast
General
General
Posts: 4931
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 »

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: 82
Joined: Mon Jul 11, 2016 9:38 pm
Location: United States
Contact:

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

Post by The Noah »

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've been working on a real-time stats site called BZList, please check it out! It is still in active development, so some features are missing and watch out for bugs.

GitHub · Website · Get in touch · Stalk Me
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

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

Post by JeffM »

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.
ImageJeffM
User avatar
The Noah
Private First Class
Private First Class
Posts: 82
Joined: Mon Jul 11, 2016 9:38 pm
Location: United States
Contact:

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

Post by The Noah »

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've been working on a real-time stats site called BZList, please check it out! It is still in active development, so some features are missing and watch out for bugs.

GitHub · Website · Get in touch · Stalk Me
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

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

Post by JeffM »

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 :)
ImageJeffM
Post Reply