// File: /workspace/github_c_makefile_star2_O0/schroeder-lvb[P]sissm/src/pitacnomic.c
// Function: pitacnomicChatCB
int pitacnomicChatCB( char *strIn )
{
    int errCode = 0, i;
    char *typeObj, clientID[256], chatText[256];
    char *w, *v;

    logPrintf( LOG_LEVEL_INFO, "pitacnomic", "Client chat ::%s::", strIn );

    // check if this is a valid chat line 
    //
    if ( 0 == (errCode = rosterParsePlayerChat( strIn, 256, clientID, chatText ))) {
        if (( 2 == strlen( chatText ))) {
            chatText[2] = 0;

            // check if the command issuer is 'dead' -- if so, consult list of prohibited 
            // codes that can only be issued by players that are alive.
            // Exemption-1 is when SISSM is hot-restarted (but not the game server) -- in this condition
            // SISSM thinks everybody is 'dead' so, override this condition, forcing everyone is 'alive'
            // until start of the next round.
            // Exemption-2 is if the players has "deadcmdr" privilege attribute (admins/moderators) then
            // s/he may be dead, but will may issue the stack/breach/blow commands.
            //
            if ((0 == apiIsPlayerAliveByGUID( clientID )) 
                  && !apiIsHotRestart() 
                  && !apiAuthIsAttribute( clientID, "deadcmdr" )) {  // if the issuer is "dead"

                 // check if this 2-letter-code is in the "live player only" list
                 // 
                 if ( NULL != strcasestr( pitacnomicConfig.livePlayersOnly, chatText ) ) {
                     // if so, invalidate the entered text (ignored by this plugin
                     //
                     chatText[0] = ' ';  chatText[1] = ' ';
                 }
            }

            // Resume regular processing of two-letter-code.  Do a table lookup
            // and send translated string to the player chat
            //
            for (i = 0; i<PITACNOMIC_MAXSHORTS; i++) {
                if ( 0 == strncmp( pitacnomicConfig.shorts[i], chatText, 2 )) {
                    // match is found on the table.  Parse for phrase to be
                    // sent to the game.
                    //
                    if (NULL != (w = getWord( pitacnomicConfig.shorts[i], 1, "\007" ) )) {
                        typeObj = rosterGetObjectiveType();
                        if ( NULL != strcasestr( typeObj, "capturable"  ) ) {
                            ;
                        }
                        if ( NULL != strcasestr( typeObj, "weaponcache" ) ) {
                            if (NULL != (v = getWord( pitacnomicConfig.shorts[i], 2, "\007" ) )) {
                                w = v;
                             }
                        }
                        apiSaySys( w );
                    }
                    break;
                }
            }       
        }
    }

    return errCode;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rcx
movl $0x2, %edi
leaq 0x15df0(%rip), %rsi     # 0x247f6
leaq 0x15df4(%rip), %rdx     # 0x24801
movb $0x0, %al
callq 0x21bf0
movq -0x8(%rbp), %rdi
leaq -0x120(%rbp), %rdx
leaq -0x220(%rbp), %rcx
movl $0x100, %esi            # imm = 0x100
callq 0x1ae70
movl %eax, %ecx
movl %ecx, -0xc(%rbp)
xorl %eax, %eax
cmpl %ecx, %eax
jne 0xebf8
leaq -0x220(%rbp), %rdi
callq 0x8110
movq %rax, %rcx
movl $0x2, %eax
cmpq %rcx, %rax
jne 0xebf6
movb $0x0, -0x21e(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x15c10
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0xeacd
callq 0x19090
cmpl $0x0, %eax
jne 0xeacd
leaq -0x120(%rbp), %rdi
leaq 0x15d85(%rip), %rsi     # 0x24814
callq 0x185c0
cmpl $0x0, %eax
jne 0xeacd
leaq -0x220(%rbp), %rsi
leaq 0x575c9(%rip), %rdi     # 0x66070
addq $0x19004, %rdi          # imm = 0x19004
callq 0x8340
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
je 0xeacb
movb $0x20, -0x220(%rbp)
movb $0x20, -0x21f(%rbp)
jmp 0xeacd
movl $0x0, -0x10(%rbp)
cmpl $0x64, -0x10(%rbp)
jge 0xebf4
movslq -0x10(%rbp), %rax
leaq 0x57587(%rip), %rdi     # 0x66070
addq $0x4, %rdi
shlq $0xa, %rax
addq %rax, %rdi
leaq -0x220(%rbp), %rsi
movl $0x2, %edx
callq 0x8060
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0xebe4
movslq -0x10(%rbp), %rax
leaq 0x57554(%rip), %rdi     # 0x66070
addq $0x4, %rdi
shlq $0xa, %rax
addq %rax, %rdi
movl $0x1, %esi
leaq 0x14bdd(%rip), %rdx     # 0x23710
callq 0x122d0
movq %rax, %rcx
movq %rcx, -0x228(%rbp)
xorl %eax, %eax
cmpq %rcx, %rax
je 0xebe2
callq 0x193d0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x15385(%rip), %rsi     # 0x23ee6
callq 0x8340
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
je 0xeb72
jmp 0xeb72
movq -0x18(%rbp), %rdi
leaq 0x1535d(%rip), %rsi     # 0x23eda
callq 0x8340
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
je 0xebd4
movslq -0x10(%rbp), %rax
leaq 0x574d9(%rip), %rdi     # 0x66070
addq $0x4, %rdi
shlq $0xa, %rax
addq %rax, %rdi
movl $0x2, %esi
leaq 0x14b62(%rip), %rdx     # 0x23710
callq 0x122d0
movq %rax, %rcx
movq %rcx, -0x230(%rbp)
xorl %eax, %eax
cmpq %rcx, %rax
je 0xebd2
movq -0x230(%rbp), %rax
movq %rax, -0x228(%rbp)
jmp 0xebd4
movq -0x228(%rbp), %rdi
movb $0x0, %al
callq 0x17af0
jmp 0xebf4
jmp 0xebe6
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xead4
jmp 0xebf6
jmp 0xebf8
movl -0xc(%rbp), %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopw %cs:(%rax,%rax)