Wow I just had the most interesting crash... and I think it's related to this.
Apparently a cPlayer has a dangling pointer to a cClientHandle for some reason, but cPlayer::m_bDestroyed is false, and it's dangling which should never ever happen! O.o
According to the log, the cClientHandle that belongs to the player was deleted about 1,5 minutes before the crash!
Actually.. I don't know. O.o the player's name is 'Nickcejka' and he's in the cWorld::m_Players list twice
For completeness here's the callstack
And the log :S
Code:
[0d80|02:29:16] Client "68.42.90.82" connected!
[0d80|02:29:16] New ClientHandle created at 06D3D440
[1cf4|02:29:16] Deleting client "" at 06D3D440
[1cf4|02:29:16] ClientHandle at 06D3D440 deleted
[0d80|02:29:19] Client "68.42.90.82" connected!
[0d80|02:29:19] New ClientHandle created at 06D3D440
[161c|02:29:19] HANDSHAKE Nickcejka
[161c|02:29:19] User "Nickcejka" was sent a handshake
[161c|02:29:19] LOGIN Nickcejka
[180c|02:29:20] Got 200 OK :D
[180c|02:29:20] Got result: YES
[180c|02:29:20] Result was "YES", so player is authenticated!
[180c|02:29:20] Added Nickcejka to group Default
[180c|02:29:20] Player Nickcejka has permissions:
[180c|02:29:20] core.help
[180c|02:29:20] core.playerlist
[180c|02:29:20] core.pluginlist
[180c|02:29:20] core.spawn
[180c|02:29:20] Player "Nickcejka" is connecting for the first time, spawning at default world spawn {108.00, 45.60, -53.00}
[180c|02:29:20] Streaming chunks centered on [6, -4], view distance 9
[180c|02:29:20] cChunk: Entity #3 (cPlayer) at [6, 0, -4] spawning for player "Nickcejka"
[180c|02:29:20] cPlayer::GetSpawnPacket for "Nickcejka" at pos {108.00, 45.60, -53.00}
[1cf4|02:29:32] Spawning player "Nickcejka" at {108.00, 45.60, -53.00}
[1cf4|02:29:32] Cuboid: Player Join!
[1cf4|02:29:44] Saving all chunks...
[0d80|02:29:51] Client "68.42.90.82" connected!
[0d80|02:29:51] New ClientHandle created at 1761C248
[1cf4|02:29:51] Deleting client "" at 1761C248
[1cf4|02:29:51] ClientHandle at 1761C248 deleted
[0d80|02:29:53] Client "68.42.90.82" connected!
[0d80|02:29:53] New ClientHandle created at 1761C248
[161c|02:29:53] HANDSHAKE Nickcejka
[161c|02:29:53] User "Nickcejka" was sent a handshake
[161c|02:29:54] LOGIN Nickcejka
[180c|02:29:54] Got 200 OK :D
[180c|02:29:54] Got result: YES
[180c|02:29:54] Result was "YES", so player is authenticated!
[180c|02:29:54] Added Nickcejka to group Default
[180c|02:29:54] Player Nickcejka has permissions:
[180c|02:29:54] core.help
[180c|02:29:54] core.playerlist
[180c|02:29:54] core.pluginlist
[180c|02:29:54] core.spawn
[180c|02:29:54] Player "Nickcejka" is connecting for the first time, spawning at default world spawn {108.00, 45.60, -53.00}
[180c|02:29:54] Added Nickcejka to group Default
[180c|02:29:54] Player Nickcejka has permissions:
[180c|02:29:54] core.help
[180c|02:29:54] core.playerlist
[180c|02:29:54] core.pluginlist
[180c|02:29:54] core.spawn
[180c|02:29:54] Player "Nickcejka" is connecting for the first time, spawning at default world spawn {108.00, 45.60, -53.00}
[180c|02:29:54] Streaming chunks centered on [6, -4], view distance 9
[180c|02:29:54] cChunk: Entity #3 (cPlayer) at [6, 0, -4] spawning for player "Nickcejka"
[180c|02:29:54] cPlayer::GetSpawnPacket for "Nickcejka" at pos {108.00, 45.60, -53.00}
[180c|02:29:54] cChunk: Entity #4 (cPlayer) at [6, 0, -4] spawning for player "Nickcejka"
[180c|02:29:54] cPlayer::GetSpawnPacket for "Nickcejka" at pos {108.00, 45.60, -53.00}
[180c|02:29:54] cChunk: Entity #5 (cPlayer) at [6, 0, -4] spawning for player "Nickcejka"
[180c|02:29:54] cPlayer::GetSpawnPacket for "Nickcejka" at pos {108.00, 45.60, -53.00}
[1cf4|02:29:55] Spawning player "Nickcejka" at {108.00, 45.60, -53.00}
[1cf4|02:29:55] Cuboid: Player Join!
[1cf4|02:29:58] Spawning player "Nickcejka" at {108.00, 45.60, -53.00}
[1cf4|02:29:58] Cuboid: Player Join!
[1cf4|02:30:11] chunk [6, -4] destroying entity #3 for player "Nickcejka"
[1cf4|02:30:11] chunk [6, -4] destroying entity #4 for player "Nickcejka"
[1cf4|02:30:11] chunk [6, -4] destroying entity #5 for player "Nickcejka"
[1cf4|02:30:11] Deleting client "Nickcejka" at 06D3D440
[1cf4|02:30:11] ClientHandle at 06D3D440 deleted
[1cf4|02:30:11] Destroying entity #4
[1cf4|02:30:11] DESTROY WINDOW
[1cf4|02:30:11] DESTROY WINDOW
[1cf4|02:30:11] Deleting entity 4 at pos {108.00, -53.00} ~ [6, -3]; ptr 198880C8
[161c|02:31:11] OnBlockDig: 101 48 -53 Dir: 1 Stat: 0
[161c|02:31:12] OnBlockDig: 101 48 -53 Dir: 1 Stat: 2
[161c|02:31:12] OnBlockDig: 101 47 -53 Dir: 1 Stat: 0
[1cf4|02:31:13] Item was added to 36 ID:35 Count:1
[1cf4|02:31:13] Destroying entity #6
[1cf4|02:31:13] Deleting entity 6 at pos {101.28, -52.72} ~ [6, -3]; ptr 06DD9F58
[1cf4|02:31:15] Streaming chunks centered on [6, -3], view distance 9
[1cf4|02:31:19] Streaming chunks centered on [6, -4], view distance 9
[161c|02:31:20] Placing item of type: 35
[161c|02:31:32] OnBlockDig: 107 46 -52 Dir: 2 Stat: 0
[161c|02:31:33] OnBlockDig: 107 46 -52 Dir: 2 Stat: 0
[161c|02:31:47] 1. Stack size: 12
[161c|02:31:47] 2. Stack size: 13
[161c|02:31:47] 3. Stack size: 14
[161c|02:31:47] Calling bound function! :D
[161c|02:31:47] ok. Stack size: 12
[1cf4|02:31:49] Streaming chunks centered on [6, -5], view distance 9
So far I've found two (im)possible causes:
1. This must mean cClientHandle::~cClientHandle() didn't pass the (m_Player != NULL) check, but how is that possible?!
2. The cClientHandle is authenticated more than once because cClientHandle::Authenticate() creates the cPlayer entity, this could cause only one of the two cPlayers to be destroyed/deleted
#2 is the most likely cause, since you're looking up the cClientHandle on username for some reason :O