// File: lotuskip[P]yuxtapa/server/players.cpp
// Function: store_known_players()
void store_known_players()
{
	// This function is called when the server shuts down. Now, it might be that
	// there were players connected at that time, and we need to stat their
	// playing times here!
	extern bool intermission;
	for(list<Player>::iterator pit = cur_players.begin();
		pit != cur_players.end(); ++pit)
	{
		if(pit->botpid != -1) // it's a bot
			known_players.erase(pit->stats_i);
		else
		{
			pit->stats_i->total_time += time(NULL) - pit->stats_i->last_seen;
			time(&(pit->stats_i->last_seen));
		
			if(pit->is_alive())
				pit->stats_i->time_played[pit->cl] += time(NULL) - pit->last_switched_cl;
			else if(pit->team == T_SPEC && !intermission)
				pit->stats_i->time_specced += time(NULL) - pit->last_switched_cl;
		}
	}

	// Now start actually storing the player statistics:
	write_player_stats();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
leaq 0x6db21(%rip), %rdi     # 0x90230
callq 0x1b360
movq %rax, -0x8(%rbp)
leaq 0x6db11(%rip), %rdi     # 0x90230
callq 0x189f0
movq %rax, -0x10(%rbp)
leaq -0x8(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x1b100
testb $0x1, %al
jne 0x2273e
jmp 0x22918
leaq -0x8(%rbp), %rdi
callq 0x1b050
cmpl $-0x1, 0x164(%rax)
je 0x22785
leaq -0x8(%rbp), %rdi
callq 0x1b050
movq %rax, %rsi
addq $0x80, %rsi
leaq -0x18(%rbp), %rdi
callq 0x24e10
movq -0x18(%rbp), %rsi
leaq 0x6daa1(%rip), %rdi     # 0x90218
callq 0x24dc0
movq %rax, -0x20(%rbp)
jmp 0x22908
xorl %eax, %eax
movl %eax, %edi
callq 0x54c0
movq %rax, -0x30(%rbp)
leaq -0x8(%rbp), %rdi
callq 0x1b050
movq %rax, %rdi
addq $0x80, %rdi
callq 0x1b390
movq %rax, %rcx
movq -0x30(%rbp), %rax
subq 0x128(%rcx), %rax
movq %rax, -0x28(%rbp)
leaq -0x8(%rbp), %rdi
callq 0x1b050
movq %rax, %rdi
addq $0x80, %rdi
callq 0x1b390
movq -0x28(%rbp), %rcx
addq 0xa0(%rax), %rcx
movq %rcx, 0xa0(%rax)
leaq -0x8(%rbp), %rdi
callq 0x1b050
movq %rax, %rdi
addq $0x80, %rdi
callq 0x1b390
movq %rax, %rdi
addq $0x128, %rdi            # imm = 0x128
callq 0x54c0
leaq -0x8(%rbp), %rdi
callq 0x1b050
movq %rax, %rdi
callq 0x21cd0
testb $0x1, %al
jne 0x22824
jmp 0x22894
xorl %eax, %eax
movl %eax, %edi
callq 0x54c0
movq %rax, -0x48(%rbp)
leaq -0x8(%rbp), %rdi
callq 0x1b050
movq %rax, %rcx
movq -0x48(%rbp), %rax
subq 0xb8(%rcx), %rax
movq %rax, -0x40(%rbp)
leaq -0x8(%rbp), %rdi
callq 0x1b050
movq %rax, %rdi
addq $0x80, %rdi
callq 0x1b390
movq %rax, -0x38(%rbp)
leaq -0x8(%rbp), %rdi
callq 0x1b050
movq -0x40(%rbp), %rdx
movq %rax, %rcx
movq -0x38(%rbp), %rax
movl 0xb0(%rcx), %ecx
addq 0xb0(%rax,%rcx,8), %rdx
movq %rdx, 0xb0(%rax,%rcx,8)
jmp 0x22906
leaq -0x8(%rbp), %rdi
callq 0x1b050
cmpl $0x2, 0xac(%rax)
jne 0x22904
leaq 0x6ac83(%rip), %rax     # 0x8d530
testb $0x1, (%rax)
jne 0x22904
xorl %eax, %eax
movl %eax, %edi
callq 0x54c0
movq %rax, -0x58(%rbp)
leaq -0x8(%rbp), %rdi
callq 0x1b050
movq %rax, %rcx
movq -0x58(%rbp), %rax
subq 0xb8(%rcx), %rax
movq %rax, -0x50(%rbp)
leaq -0x8(%rbp), %rdi
callq 0x1b050
movq %rax, %rdi
addq $0x80, %rdi
callq 0x1b390
movq -0x50(%rbp), %rcx
addq 0xa8(%rax), %rcx
movq %rcx, 0xa8(%rax)
jmp 0x22906
jmp 0x22908
jmp 0x2290a
leaq -0x8(%rbp), %rdi
callq 0x1b3c0
jmp 0x22718
callq 0x22930
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)