setTeamInfo

Discuss the Dedicated Server Tools developed by Nadeo Live such as ManiaLive, Trust Circles, Dedicated Manager, Competition Manager and Lobbies

Moderator: NADEO

MuNgLo
Posts: 316
Joined: 12 Jul 2012, 03:37

setTeamInfo

Post by MuNgLo »

I would like some more info about how to declare colour and country for setTeamInfo.

Can't find any info about the colourstuff and all I seem to get is greenish, pinkish or black. Also server ends up crashing client on connection. I guess that's cause the hud is broken.

I would love to know the default values of red and blue so I can pass them along.

Code: Select all

/**
	 * Set Team names and colors. Only available to Admin.
	 * @param string $teamName1
	 * @param float $teamColor1
	 * @param string $team1Country
	 * @param string $teamName2
	 * @param float $teamColor2
	 * @param string $team2Country
	 * @param bool $multicall
	 * @return bool
	 * @throws InvalidArgumentException
	 */
	function setTeamInfo($teamName1, $teamColor1, $team1Country, $teamName2, $teamColor2, $team2Country, $multicall = false)
	{
		if(!is_float($teamColor1))
		{
			throw new InvalidArgumentException('teamColor1 = '.print_r($teamColor1, true));
		}
		if(!is_float($teamColor2))
		{
			throw new InvalidArgumentException('teamColor2 = '.print_r($teamColor2, true));
		}
		if(!is_string($teamName1))
		{
			throw new InvalidArgumentException('teamName1 = '.print_r($teamName1, true));
		}
		if(!is_string($teamName2))
		{
			throw new InvalidArgumentException('teamName2 = '.print_r($teamName2, true));
		}
		return $this->execute(ucfirst(__FUNCTION__),
				array('unused', 0., 'World', $teamName1, $teamColor1, $team1Country, $teamName2, $teamColor2, $team2Country),
				$multicall);
	}
The_Big_Boo
Posts: 1041
Joined: 15 Jun 2010, 15:46

Re: setTeamInfo

Post by The_Big_Boo »

About the color, you have to give a normalized hue. Usually, hue is defined in degrees, like on this image
Image

As you need a value between 0 and 1, you just have to divide by 360 so by default, red is 0 and blue is 0.667.


About the zone, you have to give a ManiaPlanet zone path with the same format than it appears in your dedicated account location, eg. 'World|France', 'World|United States of America|Arizona' and so on...
OS: Win 7 Pro x64
RAM: 2x4GB Corsair @ 1600MHz
CPU: Intel i5 760 @ 3.6GHz
Mobo: Asus P7P55D-E
GPU: NVidia GTX 760 2GB
HDD: WD Black 1TB
Sound: VIA VT1828S (onboard)
Peripherals: Razer DeathAdder - Razer DeathStalker - Logitech F310
MuNgLo
Posts: 316
Joined: 12 Jul 2012, 03:37

Re: setTeamInfo

Post by MuNgLo »

Thx for the info. I'm gonna try it out. Hopefully it should all fall into place this time around so I don't get that clientcrash thingy. :/

--EDIT--

Yup. It all works now. :3

I did notice however that it couldn't present Ä. Isn't it utf-8 all the way or what?

--EDIT--

Actually the country bit is a bit irritating. It takes a mapend it seems before it updates. Or at the very least it doesn't update as soon as you change it.
The_Big_Boo
Posts: 1041
Joined: 15 Jun 2010, 15:46

Re: setTeamInfo

Post by The_Big_Boo »

It seems there is indeed an encoding problem, most probably in the game as usually ManiaLive and the dedicated handle strings well (eg. maps)
Edit: actually the bug was in the dedicated, should be fixed in next update. Thanks for the report :)

About the fact that country isn't updated before next map, it's usually the case with lots of options in the dedicated but as the color doesn't work well neither it may be a bug.

So I'll report these to concerned people.
OS: Win 7 Pro x64
RAM: 2x4GB Corsair @ 1600MHz
CPU: Intel i5 760 @ 3.6GHz
Mobo: Asus P7P55D-E
GPU: NVidia GTX 760 2GB
HDD: WD Black 1TB
Sound: VIA VT1828S (onboard)
Peripherals: Razer DeathAdder - Razer DeathStalker - Logitech F310
MuNgLo
Posts: 316
Joined: 12 Jul 2012, 03:37

Re: setTeamInfo

Post by MuNgLo »

Been trying it out a bit and seems to me that the code that sets up the hud and stuff like that needs a rework.
If you change country/teamname they will not update everywhere. Like the splash screen on matchstart uses the old names. I'm guessing the names that was when the hud was setup when the player connected.
Same on the rules-screen in spawn.

They do update to blank teamname and sets county icon to world if the team goes empty but will still have the old names when a player joins the team.

Oh and a restart of the map is not enough. But a reconnect is. I guess the old hud gets destroyed and it sets up a completely new one on connect.

If I have understod the workings of the server correctly it should mostly be the gamemode script that needs some work in the hud drawing department. Or am I barking up the wrong tree?
The_Big_Boo
Posts: 1041
Joined: 15 Jun 2010, 15:46

Re: setTeamInfo

Post by The_Big_Boo »

The 3 first arguments are for spectators (I think) thus not used (yet?) You can see in the first post that we're forcing dumb values in ManiaLive.

I sometimes ask again for the GetTeamInfo but it's not a priority (and I don't know why it hasn't been done while adding SetTeamInfo)
OS: Win 7 Pro x64
RAM: 2x4GB Corsair @ 1600MHz
CPU: Intel i5 760 @ 3.6GHz
Mobo: Asus P7P55D-E
GPU: NVidia GTX 760 2GB
HDD: WD Black 1TB
Sound: VIA VT1828S (onboard)
Peripherals: Razer DeathAdder - Razer DeathStalker - Logitech F310
User avatar
kadaz
Posts: 384
Joined: 10 Sep 2011, 23:34
Location: British Columbia
Contact:

Re: setTeamInfo

Post by kadaz »

I have a question,

Been trying to get these colors working, yet after three hours.. It does not make sense.

There is 3 spots for 3 different numbers that equate between 0.0 - 1.0.

Now how, by the example chart above, can the calculation give me the numbers to fit into ForceColor = <0.0, 0.0, 0.0>;

Meaning, in which order. I tried <0.6, 0.6, 0.7>; and its blue alright, with some purple in it..

Yet try to following the divide by 360 for other colors is void, completely other colors not close to the example.

Thanks for the help.

Nor did I find this any helpful..

http://forum.maniaplanet.com/viewtopic. ... or#p143691
US: Meltdown Combat Server: maniaplanet://#join=smrock@SMStorm 十 Offline
EU: Meltdown Combat Server: maniaplanet://#join=smpage@SMStorm 十 Offline
US: SMTRAK Startup Server: maniaplanet://#join=tmrock@SMStadium 十 Online
User avatar
Eole
Nadeo
Nadeo
Posts: 1265
Joined: 26 Apr 2011, 21:08

Re: setTeamInfo

Post by Eole »

The ForceColor attribute take a RGB vector (<Red, Green, Blue>) with value ranging from 0.0 to 1.0.
Red = <1., 0., 0.>
Green = <0., 1., 0.>
Blue = <0., 0., 1.>
Yellow = <1., 1., 0>
Dark red = <0.5, 0., 0.>
...
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!
Post Reply

Return to “Dedicated Server Tools”

Who is online

Users browsing this forum: No registered users and 1 guest