Ze-Rax / TrackmaniaFlagRush

FlagRush is the new community made, teambased gamemode for Trackmania2020, providing a completely new way to play your favourite racing game with direct player interaction. In FlagRush, two teams fight for a flag and try to bring it to the base of the opposing team to score a point while preventing the other team to do the same.
MIT License
15 stars 1 forks source link

[Bug] MatchStart MapData seems empty? #215

Closed w1lla closed 1 year ago

w1lla commented 1 year ago
DEBUG    [debug_][pyplanet.core.gbx.remote] GBX: Received callback: ManiaPlanet.PlayerManialinkPageAnswer: (0, 'q2-lckjXSxai11x2CgX5ew', 'admin_toolbar__bar_button_restart', [])
DEBUG    [debug_][peewee.async] ('SELECT `t1`.`id`, `t1`.`namespace`, `t1`.`name`, `t1`.`description`, `t1`.`min_level` FROM `permission` AS t1 WHERE ((`t1`.`namespace` = %s) AND (`t1`.`name` = %s))', (['admin', 'restart'],), {})
DEBUG    [debug_][pyplanet.core.gbx.remote] GBX: Received callback: ManiaPlanet.PlayerChat: (0, 'q2-lckjXSxai11x2CgX5ew', '$z$s$fff»» $ff0Admin $fffW1llaSmurf$z$s$ff0 has restarted the map.', False)
DEBUG    [debug_][pyplanet.core.gbx.remote] GBX: Received response to handler 2147483693, method: None
DEBUG    [debug_][pyplanet.core.gbx.remote] GBX: Received scripted callback: Maniaplanet.StartServer_Start: {'restarted': True, 'mode': {'updated': False, 'name': 'FlagRush'}, 'time': 777230}
DEBUG    [debug_][pyplanet.core.gbx.remote] GBX: Received scripted callback: Maniaplanet.StartServer_End: {'restarted': True, 'mode': {'updated': False, 'name': 'FlagRush'}, 'time': 777230}
DEBUG    [debug_][pyplanet.core.gbx.remote] GBX: Received scripted callback: Maniaplanet.StartMatch_Start: {'count': 1, 'time': 777230}
DEBUG    [debug_][pyplanet.core.gbx.remote] GBX: Received scripted callback: FlagRush.Flow.MatchStart: {'Time': 777230, 'Map': {'Name': '', 'Uid': '', 'AuthorLogin': '', 'AuthorName': ''}, 'Valid': True, 'TeamScores': [0, 0], 'PlayerScores': [{'Player': {'Login': 'q2-lckjXSxai11x2CgX5ew', 'Name': 'q2-lckjXSxai11x2CgX5ew', 'TeamNum': 1, 'Position': [0, 0, 0]}, 'Points': 0, 'FlagsScored': 0, 'FlagsStolen': 0, 'Assists': 0}]}
DEBUG    [debug_][pyplanet.core.gbx.remote] GBX: Received scripted callback: Maniaplanet.StartMatch_End: {'count': 1, 'time': 777230}
DEBUG    [debug_][pyplanet.core.gbx.remote] GBX: Received scripted callback: Maniaplanet.LoadingMap_Start: {'restarted': True, 'time': 777230}
{'Time': 777230, 'Map': {'Name': '', 'Uid': '', 'AuthorLogin': '', 'AuthorName': ''}, 'Valid': True, 'TeamScores': [0, 0], 'PlayerScores': [{'Player': {'Login': 'q2-lckjXSxai11x2CgX5ew', 'Name': 'q2-lckjXSxai11x2CgX5ew', 'TeamNum': 1, 'Position': [0, 0, 0]}, 'Points': 0, 'FlagsScored': 0, 'FlagsStolen': 0, 'Assists': 0}]}
<pyplanet.core.events.callback.Callback object at 0x000001EF35AD6910>
DEBUG    [debug_][pyplanet.core.gbx.remote] GBX: Received response to handler 2147483694, method: None
DEBUG    [debug_][pyplanet.core.gbx.remote] GBX: Received scripted callback: Maniaplanet.LoadingMap_End: {'restarted': True, 'time': 777250, 'map': {'uid': 'aRr6GFpE5U6bLIU2jXvmBuhSfOc', 'name': '$s$44f「$fffFlagRush$f44」$z Purple Rain', 'filename': 'FlagRush\\flagrush-purple-rain_(51480).Map.Gbx', 'author': 'pTuyJG9STcCN_11BiU3t0Q', 'authornickname': '', 'environment': 'Stadium', 'mood': '48x48Day', 'bronzetime': -1, 'silvertime': -1, 'goldtime': -1, 'authortime': -1, 'copperprice': 3324, 'laprace': False, 'nblaps': 3, 'maptype': 'FlagRushArena', 'mapstyle': 'FlagRushArena'}}
DEBUG    [debug_][pyplanet.core.gbx.remote] GBX: Received scripted callback: Maniaplanet.StartMap_Start: {'count': 1, 'restarted': True, 'time': 777250, 'map': {'uid': 'aRr6GFpE5U6bLIU2jXvmBuhSfOc', 'name': '$s$44f「$fffFlagRush$f44」$z Purple Rain', 'filename': 'FlagRush\\flagrush-purple-rain_(51480).Map.Gbx', 'author': 'pTuyJG9STcCN_11BiU3t0Q', 'authornickname': '', 'environment': 'Stadium', 'mood': '48x48Day', 'bronzetime': -1, 'silvertime': -1, 'goldtime': -1, 'authortime': -1, 'copperprice': 3324, 'laprace': False, 'nblaps': 3, 'maptype': 'FlagRushArena', 'mapstyle': 'FlagRushArena'}}
DEBUG    [debug_][pyplanet.core.gbx.remote] GBX: Received scripted callback: FlagRush.Flow.MapStart: {'Time': 777250, 'Map': {'Name': '$s$44f「$fffFlagRush$f44」$z Purple Rain', 'Uid': 'aRr6GFpE5U6bLIU2jXvmBuhSfOc', 'AuthorLogin': 'pTuyJG9STcCN_11BiU3t0Q', 'AuthorName': ''}, 'Valid': True, 'TeamScores': [0, 0], 'PlayerScores': [{'Player': {'Login': 'q2-lckjXSxai11x2CgX5ew', 'Name': 'W1llaSmurf', 'TeamNum': 0, 'Position': [0, 0, 0]}, 'Points': 0, 'FlagsScored': 0, 'FlagsStolen': 0, 'Assists': 0}]}

Apparently there is a bug in LoadingMapEnd/Start and in FlagRush it is always empty: So i can not retrieve any data for Maps on MatchStart if i am only testing it by myself (I do it so i can find all callbacks and from there i will develop further)) So i need to do 2x times a thing to catch both things when it could only be needed once:

MatchStart / FlagRush.Flow.MapStart apparently give both the same data but in different ways? a bit confusing

Ze-Rax commented 1 year ago

Apparently there is a bug in LoadingMapEnd/Start and in FlagRush it is always empty

FlagRush does not send anything during the loading process, as the technical side of loading a map is irrelevant for the FlagRush gamemode logic. I don't see what's wrong with the loading-events. Could you explain?

So i can not retrieve any data for Maps on MatchStart

There actual is no map loaded during match start. So there not being map data is technically correct. Though I can see it being confusing that there is still empty map data being sent. (That is due to us using a common event structure for all flow events and structs not being nullable in Maniascript.) I will take a look at if I can make changes to the structure. Keep in mind that the officially released version right now does not contain any FlagRush specific XmlRpc functionalities and the current development version is the first version to implement it.

So i need to do 2x times a thing to catch both things when it could only be needed once

What are you trying to catch specifically there? The Map during match start? As mentioned above, there is no map loaded during map start, the earliest there is a map is LoadingMap_End.

The general progression looks as follows (Maniaplanet. prefixed events are Nadeo events; FragRush. prefixed events are ours):

  1. // Server start, ...
  2. Maniaplanet.StartMatch_Start
  3. Maniaplanet.StartMatch_End
  4. Maniaplanet.LoadMap_Start // Gamemode does NOT know the map yet
  5. Maniaplanet.LoadMap_End // Map is now available and sent in event
  6. Maniaplanet.StartMap_Start // Also sends some map data
  7. FlagRush.Flow.MapStart // Again some minimal map data (probably redundant due to events above)
  8. Maniaplanet.StartMap_End
  9. // Round & Turn events
  10. Maniaplanet.EndMap_Start
  11. FlagRush.Flow.MapEnd
  12. Maniaplanet.EndMap_End
  13. Maniaplanet.UnloadingMap_Start // Send map data about map to be unloaded
  14. Maniaplanet.UnloadingMap_End // Map is not available anymore but match is still running
  15. // Loop Steps 4 - 14 depending on match end conditions (matches that take multiple maps)
  16. Maniaplanet.EndMatch_Start // No map since it was unloaded between 13 & 14
  17. FlagRush.Flow.MatchEnd
  18. Maniaplanet,EndMatch_End
  19. // Goto Step 2 depending on server conditions (FlagRush will never shut down the server though)
  20. // Server End, ...

[FlagRush.Flow.]MatchStart / FlagRush.Flow.MapStart apparently give both the same data but in different ways? a bit confusing

Same structure, as mentioned above, yes. I'm gonna revisit it and change the strucure a bit and let you know before I merge changes.