Script callbacks

Moderator: NADEO

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

Re: Script callbacks

Post by MuNgLo » 22 Apr 2013, 12:54

Elite callback EndTurn is always giving TurnWinnerClan => (int) -1.

I checked both S_Mode 0 and 1 to be sure. Also checked when this broke and last turn that had a declared winner was 2013 - 04/04 22:03. Which seems a bit weird since it doesn't correspond with any update I can remember. Unless you pushed a silent update of the script. :/

Anyways, please state if it is a bug or intended.

User avatar
Eole
Nadeo
Nadeo
Posts: 1259
Joined: 26 Apr 2011, 21:08

Re: Script callbacks

Post by Eole » 22 Apr 2013, 14:00

kremsy wrote:Also what I noticed is that the EndMap callback comes in Heroes very very late, sometimes just shortly before people starting loading the nextmap and Elite too :(.
Are you talking about the "LibXmlRpc_EndMap" callback or the special "EndMap" callback for Elite/Heroes?

I made some tests on my side and it was working as intended. "LibXmlRpc_EndMap" is sent between the EndRound and EndMap sequence (it uses the exact same code than the other modes). And "EndMap" should be sent right after. I made some tests and it seems to work on my end.
Are you doing your tests on a dedicated server or from an ingame local server? Could you check your log and give the versions of the scripts used by the mode?
MuNgLo wrote:For Elite the WeaponNum in OnArmorEmpty is always 0 it seems. Wich means I would have to track death_by_weapontype by resolving each hit. This is not as I thought you had "fixed" it back in febuary when I reported that attackers laserkills was bugged.

Plz push a fixed version or state if it indeed is intentional.
No it's not intentional, I fixed it again and triple checked that it's fully working. On the current version the OnArmorEmpty will always sent 0 on attacker elimination but works as intended on defender elimination.
MuNgLo wrote:Elite callback EndTurn is always giving TurnWinnerClan => (int) -1.

I checked both S_Mode 0 and 1 to be sure. Also checked when this broke and last turn that had a declared winner was 2013 - 04/04 22:03. Which seems a bit weird since it doesn't correspond with any update I can remember. Unless you pushed a silent update of the script. :/

Anyways, please state if it is a bug or intended.
Seems quite strange indeed. I'm not able to reproduce this behavior on my side. No changes were made on this part of the script and no update was pushed at this date. The problem persist since then even after a server restart? Something unusual happened on your server at this date? Could you give me the server settings you use?
What's the value of "WinType" in the EndTurn callback when it happens?
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!

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

Re: Script callbacks

Post by MuNgLo » 22 Apr 2013, 14:42

I made -1 resolve inte "undeclared" so it will still log stats. Checking the db now shows all wintypes has resolved into undeclared. Which it only does if winnerClan is -1.

I'll look into it more so I haven't borked it up somwhere and as I double check I will domp the current complete settings out from server. Since I use several config loading stuff that would be the most accurate way.

Oh and nice to hear the first one is fixed :D

--EDIT--

Ok so this is the dumped settings..

Code: Select all

[16:35:11] [ConfigLoader]: exposeSettings triggered. (getModeScriptSettings)
array(25) {
  ["S_Mode"]=>
  int(1)
  ["S_UseEliteB2"]=>
  bool(true)
  ["S_UseWeaponSelection"]=>
  bool(false)
  ["S_TurnLimit"]=>
  int(15)
  ["S_DeciderTurnLimit"]=>
  int(99)
  ["S_TurnWin"]=>
  int(9)
  ["S_UseScriptCallbacks"]=>
  bool(false)
  ["S_TimeLimit"]=>
  int(60)
  ["S_TimePole"]=>
  int(15)
  ["S_TimeCapture"]=>
  float(1.5)
  ["S_WarmUpDuration"]=>
  int(90)
  ["S_MapWin"]=>
  int(2)
  ["S_SubmatchWin"]=>
  int(3)
  ["S_TurnGap"]=>
  int(2)
  ["S_SleepMultiplier"]=>
  float(1)
  ["S_MatchmakingSleep"]=>
  int(0)
  ["S_UsePlayerClublinks"]=>
  bool(false)
  ["S_ForceClublinkTeam1"]=>
  string(0) ""
  ["S_ForceClublinkTeam2"]=>
  string(0) ""
  ["S_UseDraft"]=>
  bool(false)
  ["S_DraftBanNb"]=>
  int(3)
  ["S_DraftPickNb"]=>
  int(3)
  ["S_DisplayLaser"]=>
  bool(true)
  ["S_UseLobby"]=>
  bool(false)
  ["S_LobbyTimePerMap"]=>
  int(86400)
}
But it is still -1

Code: Select all

[saveTurn] error! -> TurnWinnerClan was -1
[saveTurn] Turn was saved

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

Re: Script callbacks

Post by MuNgLo » 22 Apr 2013, 15:46

You know what Eole nevermind the TurnWinnerClan issue. seems it is changed somwhere in my plugin. :/
Dunno why or where but no point u spending any time on it.

Found it . Fixed it . My bad :P

kremsy
Posts: 1723
Joined: 21 Jul 2011, 09:51

Re: Script callbacks

Post by kremsy » 22 Apr 2013, 19:33

Eole wrote:
kremsy wrote:Also what I noticed is that the EndMap callback comes in Heroes very very late, sometimes just shortly before people starting loading the nextmap and Elite too :(.
Are you talking about the "LibXmlRpc_EndMap" callback or the special "EndMap" callback for Elite/Heroes?

I made some tests on my side and it was working as intended. "LibXmlRpc_EndMap" is sent between the EndRound and EndMap sequence (it uses the exact same code than the other modes). And "EndMap" should be sent right after. I made some tests and it seems to work on my end.
Are you doing your tests on a dedicated server or from an ingame local server? Could you check your log and give the versions of the scripts used by the mode?
MuNgLo wrote:For Elite the WeaponNum in OnArmorEmpty is always 0 it seems. Wich means I would have to track death_by_weapontype by resolving each hit. This is not as I thought you had "fixed" it back in febuary when I reported that attackers laserkills was bugged.

Plz push a fixed version or state if it indeed is intentional.
No it's not intentional, I fixed it again and triple checked that it's fully working. On the current version the OnArmorEmpty will always sent 0 on attacker elimination but works as intended on defender elimination.
MuNgLo wrote:Elite callback EndTurn is always giving TurnWinnerClan => (int) -1.

I checked both S_Mode 0 and 1 to be sure. Also checked when this broke and last turn that had a declared winner was 2013 - 04/04 22:03. Which seems a bit weird since it doesn't correspond with any update I can remember. Unless you pushed a silent update of the script. :/

Anyways, please state if it is a bug or intended.
Seems quite strange indeed. I'm not able to reproduce this behavior on my side. No changes were made on this part of the script and no update was pushed at this date. The problem persist since then even after a server restart? Something unusual happened on your server at this date? Could you give me the server settings you use?
What's the value of "WinType" in the EndTurn callback when it happens?
I talk about the LibXml_EndMap callback (I ignore the normal EndMap now), it should come directly on the end of the last Round, which it doesn't at the moment. I tested all on dedicated servers not on lokal ones.

The strange thing when I set the S_MatchmakingSleep to 5 it is working, but anyway when this is a reason, it should be set as standard to 10 in all modes.

More I can't see exactly, but one thing is to say that there always must be 5-10 seconds between the LibXml_EndMap callback and the load of the next map please.
Lukas alias Kremsy, Developer of:
ManiaControl: http://www.maniacontrol.com
ParagonLeague: http://league.paragon-esports.com
MPAseco: http://mpaseco.org
ManiaViewer: http://www.maniaviewer.com

kremsy
Posts: 1723
Joined: 21 Jul 2011, 09:51

Re: Script callbacks

Post by kremsy » 23 Apr 2013, 13:37

What is also Important, I haven't checked it yet if the LibXml does it, but we also need a BeginMap callback when a Map get restarted, doesn't matter which one, but there is one needed.
Lukas alias Kremsy, Developer of:
ManiaControl: http://www.maniacontrol.com
ParagonLeague: http://league.paragon-esports.com
MPAseco: http://mpaseco.org
ManiaViewer: http://www.maniaviewer.com

User avatar
Eole
Nadeo
Nadeo
Posts: 1259
Joined: 26 Apr 2011, 21:08

Re: Script callbacks

Post by Eole » 24 Apr 2013, 10:02

@Kremsy:
What is your exact setup? Server version, server settings, api version, ... Your server uses the match making system?
I'm not able to reproduce your problem. The LibXmlRpc_EndMap callback is sent at the end of the map, just when the scoreboard appear on the screen.
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!

kremsy
Posts: 1723
Joined: 21 Jul 2011, 09:51

Re: Script callbacks

Post by kremsy » 24 Apr 2013, 14:58

Eole wrote:@Kremsy:
What is your exact setup? Server version, server settings, api version, ... Your server uses the match making system?
I'm not able to reproduce your problem. The LibXmlRpc_EndMap callback is sent at the end of the map, just when the scoreboard appear on the screen.
I will check it out more detailed (with the new update). I only can say that it came to late on Elite and Heroes and when I setted MatchMaking Sleep to 5-10secs it worked well.

Server version the test version 19-04 i think
the new api version

Your server uses the match making system?
nope
Lukas alias Kremsy, Developer of:
ManiaControl: http://www.maniacontrol.com
ParagonLeague: http://league.paragon-esports.com
MPAseco: http://mpaseco.org
ManiaViewer: http://www.maniaviewer.com

kremsy
Posts: 1723
Joined: 21 Jul 2011, 09:51

Re: Script callbacks

Post by kremsy » 24 Apr 2013, 17:20

Not tested it in normal play now, but one Problem is that when you are in the warmup phase and change to the next map, the endmap callback comes not right before the next map (no scoreobard appears), and this is a very common case, when I make MatchmakingSleep to 5 the scoreboard appears on the matchskip and all is fine.

I don't know what the MatchmakingSleep setting makes exactly, but with that it works.

And we don't use lobby mode or anything else.
Lukas alias Kremsy, Developer of:
ManiaControl: http://www.maniacontrol.com
ParagonLeague: http://league.paragon-esports.com
MPAseco: http://mpaseco.org
ManiaViewer: http://www.maniaviewer.com

User avatar
Eole
Nadeo
Nadeo
Posts: 1259
Joined: 26 Apr 2011, 21:08

Re: Script callbacks

Post by Eole » 25 Apr 2013, 11:24

In Elite/Heroes to speed up the process of "vote next map" the script skip directly to the next map if the vote passes. The scores of the map are ignored and the results are not displayed. So in this case the LibXmlRpc_EndMap callback will be sent at the same frame than the map unload. Unless you use the S_MatchmakingSleep setting to add a waiting time between these two steps (it was added specifically for the matchmaking in this goal).
S_MatchmakingSleep = 0: no waiting time.
S_MatchmakingSleep > 0: wait for x seconds.
S_MatchmakingSleep < 0: wait until this value is changed to something else.

I can probably add a default waiting time of 1 second or so with a message for the players, but not 5 to 10 seconds.
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!

Post Reply

Return to “Dedicated Server”

Who is online

Users browsing this forum: No registered users and 1 guest