// File: /workspace/github_c_makefile_star2_O2/schroeder-lvb[P]sissm/src/pigateway.c
// Function: pigatewayClientSynthAddCB
int pigatewayClientSynthAddCB( char *strIn )
{
    static char playerName[256], playerGUID[256], playerIP[256];
    int alreadyKicked = 0;
    int kickReason, firstAdminSlot;

    rosterParsePlayerSynthConn( strIn, 256, playerName, playerGUID, playerIP );
    logPrintf( LOG_LEVEL_INFO, "pigateway", "Synthetic ADD Callback Name ::%s:: IP ::%s:: GUID ::%s::", 
        playerName, playerIP, playerGUID );

    // copy to local, first admin slot from sissm.cfg
    //
    firstAdminSlot = pigatewayConfig.firstAdminSlotNo;
  
    // server lockout via picladmin "lock off|on|perm|clan" command
    // if "locked" then make all slots "admin" or via the allowin exemption
    //
    if ( 0L != p2pGetL( "pigateway.p2p.lockOut", 0L ))   // default is 0L = unlock
        firstAdminSlot = 1;

    if (apiPlayersGetCount() >= firstAdminSlot ) {         // check if these are admin-only slots

        if ( _allowInExemption( playerName ) ) {
            logPrintf( LOG_LEVEL_CRITICAL, "pigateway", "Special full server join granted by admin ::%s::%s::%s::", 
                    playerName, playerGUID, playerIP );
        }
        // else if ( !_isPriority( playerGUID, playerName ) && (pigatewayConfig.adminPortDisable == 0) ) {     // check if this is an admin
        else if ( !_isPriority( playerGUID, playerName ) ) {     // check if this is an admin

            // this block of code kicks incoming players
            //
            if ( (apiTimeGet() - timeRestarted) > PIGATEWAY_RESTART_LOCKOUT_SEC ) {  // check if we are restarting
                // apiKickOrBan( 0, playerGUID, "Server_full, under maintenance, or hosting a private session." );

                if ( 0L == p2pGetL( "pigateway.p2p.lockOut", 0L ) ) {
                    apiKickOrBan( 0, playerGUID, pigatewayConfig.adminPortKickMsgFull );    // server full
                    apiSay ( "Player %s kicked Server Full", playerName );
                }
                else {
                    apiKickOrBan( 0, playerGUID, pigatewayConfig.adminPortKickMsgLock );    // special events !lock
                    apiSay ( "Player %s kicked Server Reserved", playerName );
                }

                logPrintf( LOG_LEVEL_CRITICAL, "pigateway", "Full Server Kick ::%s::%s::%s::", 
                    playerName, playerGUID, playerIP );
                alreadyKicked = 1;
            }
            else {
                logPrintf( LOG_LEVEL_INFO, "pigateway", 
                    "Exempt Full Server Kick due to Restart ::%s::%s::%s::", playerName, playerGUID, playerIP );
            }
        }
    }

    // process badname auto-kicking
    //
    if ( (0 == alreadyKicked) && (pigatewayConfig.enableBadNameFilter) ) {
        if ( 0 != (kickReason = _isBadName( playerName, playerGUID )) ) {
            apiKickOrBan( 0, playerGUID, "" );
            if ( kickReason == 1 ) {
                apiSay ( "Player %s auto-kicked by server", playerName );
                logPrintf( LOG_LEVEL_INFO, "pigateway", "Bad Name Auto-kick ::%s::%s::%s::", 
                    playerName, playerGUID, playerIP );
            }
            else {
                logPrintf( LOG_LEVEL_INFO, "pigateway", "Suspended User Auto-kick ::%s::%s::%s::", 
                    playerName, playerGUID, playerIP );
            }
            alreadyKicked = 1;
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x226eb9(%rip), %rbx    # 0x23f8a0
leaq 0x226fb2(%rip), %r14    # 0x23f9a0
leaq 0x2270ab(%rip), %r15    # 0x23faa0
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdx
movq %r14, %rcx
movq %r15, %r8
callq 0x1430a
leaq 0x6991(%rip), %rsi      # 0x1f3a0
leaq 0x62e8(%rip), %rdx      # 0x1ecfe
pushq $0x2
popq %rdi
movq %rbx, %rcx
movq %r15, %r8
movq %r14, %r9
xorl %eax, %eax
callq 0x1920b
movl 0x225e45(%rip), %ebx    # 0x23e874
leaq 0x1d48(%rip), %rdi      # 0x1a77e
xorl %esi, %esi
callq 0x17172
testq %rax, %rax
pushq $0x1
popq %rbp
cmovnel %ebp, %ebx
callq 0x12ab4
cmpl %ebx, %eax
jl 0x18c69
leaq 0x2417(%rip), %rdi      # 0x1ae71
xorl %esi, %esi
callq 0x17172
movq %rax, %r14
leaq 0x23e9(%rip), %rdi      # 0x1ae54
leaq 0x1c97(%rip), %rsi      # 0x1a709
callq 0x171c7
movq %rax, %rbx
callq 0x10b6a
subq %r14, %rax
movl 0x226e00(%rip), %ecx    # 0x23f888
cmpq %rcx, %rax
jae 0x18ad6
cmpb $0x2a, (%rbx)
jne 0x18a98
cmpb $0x0, 0x1(%rbx)
je 0x18aac
leaq 0x226e01(%rip), %rdi    # 0x23f8a0
movq %rbx, %rsi
callq 0x8360
testq %rax, %rax
je 0x18ad6
leaq 0x68ed(%rip), %rsi      # 0x1f3a0
leaq 0x6ab0(%rip), %rdx      # 0x1f56a
leaq 0x226ddf(%rip), %rcx    # 0x23f8a0
leaq 0x226ed8(%rip), %r8     # 0x23f9a0
leaq 0x226fd1(%rip), %r9     # 0x23faa0
xorl %edi, %edi
jmp 0x18c62
leaq 0x226ec3(%rip), %rdi    # 0x23f9a0
leaq 0x6dfe(%rip), %rsi      # 0x1f8e2
callq 0x12e42
movl %eax, %ebx
leaq 0x68ae(%rip), %rsi      # 0x1f3a0
leaq 0x6df1(%rip), %rdx      # 0x1f8ea
pushq $0x2
popq %rdi
movl %eax, %ecx
xorl %eax, %eax
callq 0x1920b
leaq 0x1c72(%rip), %rdi      # 0x1a77e
xorl %esi, %esi
callq 0x17172
cmpq $0x3, %rax
jne 0x18b55
leaq 0x226e80(%rip), %rdi    # 0x23f9a0
callq 0x13442
testl %eax, %eax
je 0x18b2d
movl %eax, %ebx
jmp 0x18b55
leaq 0x226d6c(%rip), %rdi    # 0x23f8a0
callq 0x13442
movl %eax, %ebx
leaq 0x685e(%rip), %rsi      # 0x1f3a0
leaq 0x6dc0(%rip), %rdx      # 0x1f909
pushq $0x2
popq %rdi
movl %eax, %ecx
xorl %eax, %eax
callq 0x1920b
leaq 0x226e44(%rip), %rdi    # 0x23f9a0
callq 0x12ed9
leaq 0x6dbd(%rip), %rdi      # 0x1f925
movq %rax, %rsi
callq 0x8220
testl %eax, %eax
jne 0x18b8e
leaq 0x6825(%rip), %rsi      # 0x1f3a0
leaq 0x6da8(%rip), %rdx      # 0x1f92a
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x1920b
movl %ebp, %ebx
leaq 0x226d0b(%rip), %rdi    # 0x23f8a0
leaq 0x4c7c(%rip), %rsi      # 0x1d818
callq 0x83c0
testl %ebx, %ebx
je 0x18bae
testq %rax, %rax
je 0x18c69
callq 0x10b6a
subq 0x226fe6(%rip), %rax    # 0x23fba0
cmpq $0x3d, %rax
jb 0x18c3c
leaq 0x1bb7(%rip), %rdi      # 0x1a77e
xorl %esi, %esi
callq 0x17172
testq %rax, %rax
leaq 0x2260a0(%rip), %rax    # 0x23ec78
leaq 0x225c99(%rip), %rdx    # 0x23e878
cmoveq %rax, %rdx
leaq 0x69b9(%rip), %rax      # 0x1f5a3
leaq 0x69cf(%rip), %rbx      # 0x1f5c0
cmoveq %rax, %rbx
leaq 0x226da4(%rip), %r14    # 0x23f9a0
xorl %edi, %edi
movq %r14, %rsi
callq 0x128e1
leaq 0x226c93(%rip), %r15    # 0x23f8a0
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x125a8
leaq 0x677f(%rip), %rsi      # 0x1f3a0
leaq 0x69b9(%rip), %rdx      # 0x1f5e1
leaq 0x226e71(%rip), %r9     # 0x23faa0
xorl %edi, %edi
movq %r15, %rcx
movq %r14, %r8
jmp 0x18d22
leaq 0x675d(%rip), %rsi      # 0x1f3a0
leaq 0x69b7(%rip), %rdx      # 0x1f601
leaq 0x226c4f(%rip), %rcx    # 0x23f8a0
leaq 0x226d48(%rip), %r8     # 0x23f9a0
leaq 0x226e41(%rip), %r9     # 0x23faa0
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x1920b
cmpl $0x0, 0x226410(%rip)    # 0x23f080
je 0x18d29
leaq 0x226c23(%rip), %rdi    # 0x23f8a0
xorl %esi, %esi
callq 0x107c8
testl %eax, %eax
je 0x18cd5
leaq 0x226d11(%rip), %rbx    # 0x23f9a0
leaq 0x1a73(%rip), %rdx      # 0x1a709
xorl %edi, %edi
movq %rbx, %rsi
callq 0x128e1
leaq 0x6990(%rip), %rdi      # 0x1f637
leaq 0x226bf2(%rip), %r14    # 0x23f8a0
movq %r14, %rsi
xorl %eax, %eax
callq 0x125a8
leaq 0x66e1(%rip), %rsi      # 0x1f3a0
leaq 0x6991(%rip), %rdx      # 0x1f657
leaq 0x226dd3(%rip), %r9     # 0x23faa0
pushq $0x2
popq %rdi
movq %r14, %rcx
jmp 0x18d1f
leaq 0x226cc4(%rip), %rdi    # 0x23f9a0
pushq $0x1
popq %rsi
callq 0x107c8
testl %eax, %eax
je 0x18d29
leaq 0x226cb1(%rip), %rbx    # 0x23f9a0
leaq 0x1a13(%rip), %rdx      # 0x1a709
xorl %edi, %edi
movq %rbx, %rsi
callq 0x128e1
leaq 0x6699(%rip), %rsi      # 0x1f3a0
leaq 0x696b(%rip), %rdx      # 0x1f679
leaq 0x226b8b(%rip), %rcx    # 0x23f8a0
leaq 0x226d84(%rip), %r9     # 0x23faa0
pushq $0x2
popq %rdi
movq %rbx, %r8
xorl %eax, %eax
callq 0x1920b
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq