setTeamInfo

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

Moderator: NADEO

setTeamInfo

Postby MuNgLo » 08 Aug 2012, 01:23

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);
   }
MuNgLo
 
Posts: 259
Joined: 12 Jul 2012, 03:37

Re: setTeamInfo

Postby The_Big_Boo » 08 Aug 2012, 09:07

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...
Image
User avatar
The_Big_Boo
 
Posts: 674
Joined: 15 Jun 2010, 15:46

Re: setTeamInfo

Postby MuNgLo » 08 Aug 2012, 09:55

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.
MuNgLo
 
Posts: 259
Joined: 12 Jul 2012, 03:37

Re: setTeamInfo

Postby The_Big_Boo » 08 Aug 2012, 10:47

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.
Image
User avatar
The_Big_Boo
 
Posts: 674
Joined: 15 Jun 2010, 15:46

Re: setTeamInfo

Postby MuNgLo » 08 Aug 2012, 11:24

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?
MuNgLo
 
Posts: 259
Joined: 12 Jul 2012, 03:37

Re: setTeamInfo

Postby kremsy » 11 Jan 2013, 20:43

I have a question to it, in the new API Methods list stands:

SetTeamInfo(string, double, string, string, double, string, string, double, string);

What are the first three Parameters here, I saw in previous post 6 Arguments, and here are 9 Paramters.

And also im thinking why is no GetTeamInfo Method in the software?
Last edited by kremsy on 11 Jan 2013, 21:12, edited 1 time in total.
Lukas, Developer of MPAseco more information: http://MPAseco.org

If you are interested in ordering a Shootmania Server check out http://www.mania-server.net

For Trackmania Server you can check out: http://www.tm2-server.net
kremsy
 
Posts: 676
Joined: 21 Jul 2011, 09:51

Re: setTeamInfo

Postby The_Big_Boo » 11 Jan 2013, 21:11

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)
Image
User avatar
The_Big_Boo
 
Posts: 674
Joined: 15 Jun 2010, 15:46

Re: setTeamInfo

Postby kremsy » 11 Jan 2013, 21:30

The_Big_Boo wrote: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)


Okay thank you, hope this Method will be made like all the others which are not working atm...
Lukas, Developer of MPAseco more information: http://MPAseco.org

If you are interested in ordering a Shootmania Server check out http://www.mania-server.net

For Trackmania Server you can check out: http://www.tm2-server.net
kremsy
 
Posts: 676
Joined: 21 Jul 2011, 09:51


Return to Dedicated Server Tools

Who is online

Users browsing this forum: No registered users and 0 guests