TimZaman / dotaservice

DotaService is a service to play Dota 2 through gRPC
Other
114 stars 19 forks source link

Capture end-of-game signal #43

Closed TimZaman closed 5 years ago

TimZaman commented 5 years ago

When the game ends, the server ticks stop abruptly. There is no worldstate being sent out any more. That means we need to capture this end-game signal (through a simple timeout?) and then process how the game ended, and who won, probably through the logs. Here is a typcal entry:

01/17/2019 - 07:55:01: Script function 'Think' on bot npc_dota_hero_nevermore took 22.171ms
01/17/2019 - 07:55:02: [Server] Client tried to execute invalid order (20). Unit is dead.
01/17/2019 - 07:55:02: Building: npc_dota_badguys_fort destroyed at 182.889038.
01/17/2019 - 07:55:02: [SpawnGroup] SynchronouslySpawnGroup for group 'CL:  [18: dota | world_layer_dire_destruction | <none>]' took 1ms
01/17/2019 - 07:55:02: S:Gamerules: entering state 'DOTA_GAMERULES_STATE_POST_GAME'
01/17/2019 - 07:55:02: CDOTAUserMsg_PlayerMMR check: lobbyType=-1, GameEndReason=0
01/17/2019 - 07:55:02: CDOTAGCServerSystem::MatchSignOut gathering sign out stats. Duration in minutes = 3.048706
01/17/2019 - 07:55:02:    Player 0 Account 0 TotalGold = 1068.000000 TotalXP = 1433.000000 nGoldPerMinute = 350 nXPPerMinute = 470
01/17/2019 - 07:55:02:    Player 0 Account 0 TotalGold = 278.000000 TotalXP = 0.000000 nGoldPerMinute = 91 nXPPerMinute = 0
01/17/2019 - 07:55:02:    Player 0 Account 0 TotalGold = 278.000000 TotalXP = 0.000000 nGoldPerMinute = 91 nXPPerMinute = 0
01/17/2019 - 07:55:02:    Player 0 Account 0 TotalGold = 278.000000 TotalXP = 0.000000 nGoldPerMinute = 91 nXPPerMinute = 0
01/17/2019 - 07:55:02:    Player 0 Account 0 TotalGold = 278.000000 TotalXP = 0.000000 nGoldPerMinute = 91 nXPPerMinute = 0
01/17/2019 - 07:55:02:    Player 0 Account 0 TotalGold = 388.000000 TotalXP = 1200.000000 nGoldPerMinute = 127 nXPPerMinute = 393
01/17/2019 - 07:55:02:    Player 0 Account 0 TotalGold = 278.000000 TotalXP = 0.000000 nGoldPerMinute = 91 nXPPerMinute = 0
01/17/2019 - 07:55:02:    Player 0 Account 0 TotalGold = 278.000000 TotalXP = 0.000000 nGoldPerMinute = 91 nXPPerMinute = 0
01/17/2019 - 07:55:02:    Player 0 Account 0 TotalGold = 278.000000 TotalXP = 0.000000 nGoldPerMinute = 91 nXPPerMinute = 0
01/17/2019 - 07:55:02:    Player 0 Account 0 TotalGold = 278.000000 TotalXP = 0.000000 nGoldPerMinute = 91 nXPPerMinute = 0
01/17/2019 - 07:55:02: Match signout:  duration = 182 (182.922363) good guys win = 1
01/17/2019 - 07:55:02:   Match start date: Thu Jan 17 07:51:52 2019
01/17/2019 - 07:55:02:   Num players on teams:  Good: 5  Bad: 5
01/17/2019 - 07:55:02: Team 0 Player 0 m_unAccountID = 0  Items: 0, 0, 0, 0, 0, 0, 0, 0, 0
01/17/2019 - 07:55:02:   LastHit = 3  Deny = 0  ClaimedMiss = 11  ClaimedDeny = 0  Miss = 3
01/17/2019 - 07:55:02:   Level: 4 Gold: 1668  KDA: 2 / 0 / 0
01/17/2019 - 07:55:02:   Actual Player Damage: 290 Actual Building Damage: 0 Actual Healing: 0
01/17/2019 - 07:55:02:   Scaled Player Damage: 553 Scaled Building Damage: 0 Scaled Healing: 0
01/17/2019 - 07:55:02:   XP per min: 350  Gold per min: 470  Claimed Farm: 653  Support Gold 0
01/17/2019 - 07:55:02: Team 0 Player 1 m_unAccountID = 0  Items: 0, 0, 0, 0, 0, 0, 0, 0, 0
01/17/2019 - 07:55:02:   LastHit = 0  Deny = 0  ClaimedMiss = 0  ClaimedDeny = 0  Miss = 0
01/17/2019 - 07:55:02:   Level: 1 Gold: 878  KDA: 0 / 0 / 0
01/17/2019 - 07:55:02:   Actual Player Damage: 0 Actual Building Damage: 0 Actual Healing: 0
01/17/2019 - 07:55:02:   Scaled Player Damage: 0 Scaled Building Damage: 0 Scaled Healing: 0
01/17/2019 - 07:55:02:   XP per min: 91  Gold per min: 0  Claimed Farm: 0  Support Gold 0
01/17/2019 - 07:55:02: Team 0 Player 2 m_unAccountID = 0  Items: 0, 0, 0, 0, 0, 0, 0, 0, 0
01/17/2019 - 07:55:02:   LastHit = 0  Deny = 0  ClaimedMiss = 0  ClaimedDeny = 0  Miss = 0
01/17/2019 - 07:55:02:   Level: 1 Gold: 878  KDA: 0 / 0 / 0
01/17/2019 - 07:55:02:   Actual Player Damage: 0 Actual Building Damage: 0 Actual Healing: 0
01/17/2019 - 07:55:02:   Scaled Player Damage: 0 Scaled Building Damage: 0 Scaled Healing: 0
01/17/2019 - 07:55:02:   XP per min: 91  Gold per min: 0  Claimed Farm: 0  Support Gold 0
01/17/2019 - 07:55:02: Team 0 Player 3 m_unAccountID = 0  Items: 0, 0, 0, 0, 0, 0, 0, 0, 0
01/17/2019 - 07:55:02:   LastHit = 0  Deny = 0  ClaimedMiss = 0  ClaimedDeny = 0  Miss = 0
01/17/2019 - 07:55:02:   Level: 1 Gold: 878  KDA: 0 / 0 / 0
01/17/2019 - 07:55:02:   Actual Player Damage: 0 Actual Building Damage: 0 Actual Healing: 0
01/17/2019 - 07:55:02:   Scaled Player Damage: 0 Scaled Building Damage: 0 Scaled Healing: 0
01/17/2019 - 07:55:02:   XP per min: 91  Gold per min: 0  Claimed Farm: 0  Support Gold 0
01/17/2019 - 07:55:02: Team 0 Player 4 m_unAccountID = 0  Items: 0, 0, 0, 0, 0, 0, 0, 0, 0
01/17/2019 - 07:55:02:   LastHit = 0  Deny = 0  ClaimedMiss = 0  ClaimedDeny = 0  Miss = 0
01/17/2019 - 07:55:02:   Level: 1 Gold: 878  KDA: 0 / 0 / 0
01/17/2019 - 07:55:02:   Actual Player Damage: 0 Actual Building Damage: 0 Actual Healing: 0
01/17/2019 - 07:55:02:   Scaled Player Damage: 0 Scaled Building Damage: 0 Scaled Healing: 0
01/17/2019 - 07:55:02:   XP per min: 91  Gold per min: 0  Claimed Farm: 0  Support Gold 0
01/17/2019 - 07:55:02: Team 1 Player 0 m_unAccountID = 0  Items: 0, 0, 0, 0, 0, 0, 0, 0, 0
01/17/2019 - 07:55:02:   LastHit = 3  Deny = 0  ClaimedMiss = 8  ClaimedDeny = 0  Miss = 7
01/17/2019 - 07:55:02:   Level: 4 Gold: 841  KDA: 0 / 2 / 0
01/17/2019 - 07:55:02:   Actual Player Damage: 294 Actual Building Damage: 0 Actual Healing: 0
01/17/2019 - 07:55:02:   Scaled Player Damage: 577 Scaled Building Damage: 0 Scaled Healing: 0
01/17/2019 - 07:55:02:   XP per min: 127  Gold per min: 393  Claimed Farm: 759  Support Gold 0
01/17/2019 - 07:55:02: Team 1 Player 1 m_unAccountID = 0  Items: 0, 0, 0, 0, 0, 0, 0, 0, 0
01/17/2019 - 07:55:02:   LastHit = 0  Deny = 0  ClaimedMiss = 0  ClaimedDeny = 0  Miss = 0
01/17/2019 - 07:55:02:   Level: 1 Gold: 878  KDA: 0 / 0 / 0
01/17/2019 - 07:55:02:   Actual Player Damage: 0 Actual Building Damage: 0 Actual Healing: 0
01/17/2019 - 07:55:02:   Scaled Player Damage: 0 Scaled Building Damage: 0 Scaled Healing: 0
01/17/2019 - 07:55:02:   XP per min: 91  Gold per min: 0  Claimed Farm: 0  Support Gold 0
01/17/2019 - 07:55:02: Team 1 Player 2 m_unAccountID = 0  Items: 0, 0, 0, 0, 0, 0, 0, 0, 0
01/17/2019 - 07:55:02:   LastHit = 0  Deny = 0  ClaimedMiss = 0  ClaimedDeny = 0  Miss = 0
01/17/2019 - 07:55:02:   Level: 1 Gold: 878  KDA: 0 / 0 / 0
01/17/2019 - 07:55:02:   Actual Player Damage: 0 Actual Building Damage: 0 Actual Healing: 0
01/17/2019 - 07:55:02:   Scaled Player Damage: 0 Scaled Building Damage: 0 Scaled Healing: 0
01/17/2019 - 07:55:02:   XP per min: 91  Gold per min: 0  Claimed Farm: 0  Support Gold 0
01/17/2019 - 07:55:02: Team 1 Player 3 m_unAccountID = 0  Items: 0, 0, 0, 0, 0, 0, 0, 0, 0
01/17/2019 - 07:55:02:   LastHit = 0  Deny = 0  ClaimedMiss = 0  ClaimedDeny = 0  Miss = 0
01/17/2019 - 07:55:02:   Level: 1 Gold: 878  KDA: 0 / 0 / 0
01/17/2019 - 07:55:02:   Actual Player Damage: 0 Actual Building Damage: 0 Actual Healing: 0
01/17/2019 - 07:55:02:   Scaled Player Damage: 0 Scaled Building Damage: 0 Scaled Healing: 0
01/17/2019 - 07:55:02:   XP per min: 91  Gold per min: 0  Claimed Farm: 0  Support Gold 0
01/17/2019 - 07:55:02: Team 1 Player 4 m_unAccountID = 0  Items: 0, 0, 0, 0, 0, 0, 0, 0, 0
01/17/2019 - 07:55:02:   LastHit = 0  Deny = 0  ClaimedMiss = 0  ClaimedDeny = 0  Miss = 0
01/17/2019 - 07:55:02:   Level: 1 Gold: 878  KDA: 0 / 0 / 0
01/17/2019 - 07:55:02:   Actual Player Damage: 0 Actual Building Damage: 0 Actual Healing: 0
01/17/2019 - 07:55:02:   Scaled Player Damage: 0 Scaled Building Damage: 0 Scaled Healing: 0
01/17/2019 - 07:55:02:   XP per min: 91  Gold per min: 0  Claimed Farm: 0  Support Gold 0
01/17/2019 - 07:55:02: KILLEATER: Signing out with 0 adjustments
01/17/2019 - 07:55:02: KILLEATER: Message has 0 player blocks
01/17/2019 - 07:55:02: Not submitting stats. Both teams must have human players.
01/17/2019 - 07:55:02: match_id: 0
01/17/2019 - 07:55:02: region_id: 4294967295
01/17/2019 - 07:55:02: players {
01/17/2019 - 07:55:02:   account_id: 107576
01/17/2019 - 07:55:02:   ip: 2130706433
01/17/2019 - 07:55:02:   avg_ping_ms: 0
01/17/2019 - 07:55:02:   packet_loss: 0
01/17/2019 - 07:55:02:   ping_deviation: 0.28598091
01/17/2019 - 07:55:02:   full_resends: 0
01/17/2019 - 07:55:02: }
01/17/2019 - 07:55:02: cluster_id: 0
01/17/2019 - 07:55:02: 
COMBAT SUMMARY
01/17/2019 - 07:55:02: --- Shadow Fiend ---
01/17/2019 - 07:55:02:   Total Damage Done: 0
01/17/2019 - 07:55:02:     - ability damage -
01/17/2019 - 07:55:02:     other damage done: 0
01/17/2019 - 07:55:02: --- Sniper ---
01/17/2019 - 07:55:02:   Total Damage Done: 0
01/17/2019 - 07:55:02:     - ability damage -
01/17/2019 - 07:55:02:     other damage done: 0
01/17/2019 - 07:55:02: --- Sniper ---
01/17/2019 - 07:55:02:   Total Damage Done: 0
01/17/2019 - 07:55:02:     - ability damage -
01/17/2019 - 07:55:02:     other damage done: 0
01/17/2019 - 07:55:02: --- Sniper ---
01/17/2019 - 07:55:02:   Total Damage Done: 0
01/17/2019 - 07:55:02:     - ability damage -
01/17/2019 - 07:55:02:     other damage done: 0
01/17/2019 - 07:55:02: --- Sniper ---
01/17/2019 - 07:55:02:   Total Damage Done: 0
01/17/2019 - 07:55:02:     - ability damage -
01/17/2019 - 07:55:02:     other damage done: 0
01/17/2019 - 07:55:02: --- Shadow Fiend ---
01/17/2019 - 07:55:02:   Total Damage Done: 0
01/17/2019 - 07:55:02:     - ability damage -
01/17/2019 - 07:55:02:     other damage done: 0
01/17/2019 - 07:55:02: --- Sniper ---
01/17/2019 - 07:55:02:   Total Damage Done: 0
01/17/2019 - 07:55:02:     - ability damage -
01/17/2019 - 07:55:02:     other damage done: 0
01/17/2019 - 07:55:02: --- Sniper ---
01/17/2019 - 07:55:02:   Total Damage Done: 0
01/17/2019 - 07:55:02:     - ability damage -
01/17/2019 - 07:55:02:     other damage done: 0
01/17/2019 - 07:55:02: --- Sniper ---
01/17/2019 - 07:55:02:   Total Damage Done: 0
01/17/2019 - 07:55:02:     - ability damage -
01/17/2019 - 07:55:02:     other damage done: 0
01/17/2019 - 07:55:02: --- Sniper ---
01/17/2019 - 07:55:02:   Total Damage Done: 0
01/17/2019 - 07:55:02:     - ability damage -
01/17/2019 - 07:55:02:     other damage done: 0
01/17/2019 - 07:55:02: 
01/17/2019 - 07:55:02: C:Gamerules: entering state 'DOTA_GAMERULES_STATE_POST_GAME'
01/17/2019 - 07:55:02: [Client] CDOTA_Hud_Main::EventGameRulesStateChanged DOTA_GAMERULES_STATE_POST_GAME
01/17/2019 - 07:55:02: [Client] CDOTA_Hud_Main::CreateGameEndScreen Creating GameEnd
01/17/2019 - 07:55:05: [HostStateManager] CHostStateMgr::QueueNewRequest( Quitting, 3 )
01/17/2019 - 07:55:05: [Client] CL:  Disconnecting from server: NETWORK_DISCONNECT_EXITING
01/17/2019 - 07:55:05: [NetSteamConn] Closing Steam Net Connection on socket 'client' to loopback:1, handle 10000 (1059 NETWORK_DISCONNECT_EXITING)
01/17/2019 - 07:55:05: [NetSteamConn] Disassociating NetChan       client                      [-1] (unknown) from Steam Net Connection handle 10000
01/17/2019 - 07:55:05: [NetSteamConn] Removing Steam Net Connection for loopback:1, handle 10000
01/17/2019 - 07:55:05: [HLTV Server] SourceTV shutting down
01/17/2019 - 07:55:05: [HLTV Server] CHLTVServer::Shutdown
01/17/2019 - 07:55:05: [HLTV Server] Completed SourceTV demo "replays/auto-20190117-0751-start-dotaservice.dem", recording time 289.9
01/17/2019 - 07:55:05: [Server] CNetworkGameServerBase::SetServerState (ss_active -> ss_dead)
01/17/2019 - 07:55:05: [stringtables] CNetworkStringTableContainer::RemoveAllTables:  removing 20 tables
01/17/2019 - 07:55:05: [Server] SV:  Server shutting down: 59
01/17/2019 - 07:55:05: [Server] CNetworkGameServerBase::SetServerState (ss_active -> ss_dead)
01/17/2019 - 07:55:05: [Server] SV:  Disconnect client 'Tim' from server(1): NETWORK_DISCONNECT_SHUTDOWN
01/17/2019 - 07:55:05: [NetSteamConn] Closing Steam Net Connection on socket 'server' to loopback:0, handle 20001 (1001 NETWORK_DISCONNECT_SHUTDOWN)
01/17/2019 - 07:55:05: [NetSteamConn] Disassociating NetChan          Tim                      [-1] (unknown) from Steam Net Connection handle 20001
01/17/2019 - 07:55:05: [NetSteamConn] Removing Steam Net Connection for loopback:0, handle 20001
01/17/2019 - 07:55:05: [Server] SV:  AsyncUnloadSpawnGroup( 18 ) -- no such group
01/17/2019 - 07:55:05: [Server] SV:  AsyncUnloadSpawnGroup( 16 ) -- no such group
01/17/2019 - 07:55:05: [Client] CL:  IGameSystem::LoopDeactivateAllSystems
01/17/2019 - 07:55:05: WriteSteamRemoteStorageFileAsync( "scripts/control_groups.txt" ) -> at 216.329
01/17/2019 - 07:55:05: [stringtables] CNetworkStringTableContainer::RemoveAllTables:  removing 20 tables
01/17/2019 - 07:55:05: [Server] SV:  IGameSystem::LoopDeactivateAllSystems
01/17/2019 - 07:55:05: [Host] HO:  IGameSystem::LoopDeactivateAllSystems
01/17/2019 - 07:55:05: [stringtables] CNetworkStringTableContainer::RemoveAllTables:  removing 20 tables
01/17/2019 - 07:55:06: **** Unable to localize '#GameUI_Language_Latam_Spanish' on panel 'latam'
01/17/2019 - 07:55:06: **** Unable to localize '#GameUI_Language_Vietnamese' on panel 'vietnamese'
01/17/2019 - 07:55:06: **** Unable to localize '#GameUI_Language_Latam_Spanish' on panel 'latam'
01/17/2019 - 07:55:06: **** Unable to localize '#GameUI_Language_Vietnamese' on panel 'vietnamese'
01/17/2019 - 07:55:06: [Client] CL:  CGameRulesGameSystem::GameShutdown uninstalled game rules
01/17/2019 - 07:55:06: [Client] CL:  CGameRules::CGameRules destructed
01/17/2019 - 07:55:06: WriteSteamRemoteStorageFileAsync( "voice_ban.dt" ) -> at 216.823
01/17/2019 - 07:55:06: [Server] SV:  CGameRulesGameSystem::GameShutdown uninstalled game rules
01/17/2019 - 07:55:06: [Server] SV:  CGameRules::CGameRules destructed
01/17/2019 - 07:55:06: [HostStateManager] Quitting
TimZaman commented 5 years ago

Probably we want to capture

01/17/2019 - 07:55:02: Match signout:  duration = 182 (182.922363) good guys win = 1
TimZaman commented 5 years ago

Fixed in 266a2e695c5b4a315ade4da4302f0564e2198244