#!/usr/bin/env python23
# -*- coding: utf-8 -*-

"""
function sysenv_key_update use to update textTo's key/values
"""

def sysenv_key_update(SysEnv):
    SysEnv['SET'] = SysEnv['ARG0']
    SysEnv['WORLDID'] = SysEnv['ARG1']
    return SysEnv


TemplateDict = {

    "2ri":[
        {
            "logType" : ",IL,",
            "textFrom" : "{__running_number__},{__datetime__},{__log_category__},{__log_type__},{__quantity_change__},{__source__},{__to_target__},ID:{__item_id__},UID:{__item_uid__},Q:{__item_quality__},I:{__item_create_time__}:{__item_name__}:{__item_durability__}:{__item_second_name__}{__item_property__},{__true_or_false__},P:{__char_id__}:{__char_name__}:{__node__}:{__node_name__}:{__x__}:{__y__},LV:{__char_level__}",
            "textTo" : "/ri {__char_id__} ID:{__item_id__},UID:{__item_uid__},Q:{__item_quality__},I:{__item_create_time__}::{__item_durability__}:{__item_property__}"
        },
    ],

    "log2db":[
        {
            #594078,2013/08/12 23:50:00,IL,Use,-1,A:INV:[0][10],SYS,ID:11149,UID:400662984,Q:0,I:1376287935:鴕鳥比比斯:1::0:-1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:1:0:0,F,P:400010018:聖戰殿堂,Z:4:披月丘陵:546:361
            "logType" : ",IL,",
            "textFrom" : "{__running_number__},{__datetime__},{__log_category__},{__log_type__},{__quantity_change__},{__source__},{__to_target__},ID:{__item_id__},UID:{__item_uid__},Q:{__item_quality__},I:{__item_create_time__}:{__item_name__}:{__item_durability__}:{__item_second_name__}{__item_property__},{__true_or_false__},P:{__char_id__}:{__char_name__},Z:{__node__}:{__node_name__}:{__x__}:{__y__},LV:{__char_level__}",
            "textTo" : "INSERT INTO set{SET}_item_log (worldid,logtime,action,amount,action_target,item_id,item_uid,item_create_time,item_attr,player_id) VALUES ({WORLDID},'{__datetime__}','{__log_type__}',{__quantity_change__},'{__to_target__}',{__item_id__},{__item_uid__},{__item_create_time__},':{__item_id__},:,:{__item_quality__},I:{__item_create_time__}:{__item_name__}:{__item_durability__}:{__item_second_name__}{__item_property__}',{__char_id__});"
        },
        {
	# 27321,2016/01/25 18:26:11,GL,Login,0,SYS,A:-1,G:1334,,F,P:105000051:³Ф£°±,Z:1004:¯«¤ì¡]¥D½u¡^:245:156,LV:8

            "logType" : ",GL,",
            "textFrom" : "{__running_number__},{__datetime__},{__log_category__},{__log_type__},{__quantity_change__},{__source__},{__to_target__},G:{__gold__},,{__true_or_false__},P:{__char_id__}:{__char_name__},Z:{__node__}:{__node_name__}:{__x__}:{__y__},LV:{__char_level__}",
            "textTo" : "INSERT INTO trade_log (worldid,serid,logtime,action,gold,receiver_id,goldsum,player_id) VALUES ({WORLDID},{__running_number__},'{__datetime__}','{__log_type__}',{__quantity_change__},'{__to_target__}',{__gold__},{__char_id__});"
        },

        {
            "logType" : ",add,",
            "textFrom" : "{__running_number__},{__datetime__},{__log_type__},{__account_name__},{__account_id__},{__char_id__},{__ip_address__},{__char_name__}",
            "textTo" : "INSERT INTO character_log (worldid,serid,logtime,action,account_name,account_id,player_id,clientip,given_name,new_name) VALUES ({WORLDID},{__running_number__},'{__datetime__}','{__log_type__}','{__account_name__}',{__account_id__},{__char_id__},'{__ip_address__}','{__char_name__}','');"
        },
        {
            "logType" : ",remove,",
            "textFrom" : "{__running_number__},{__datetime__},{__log_type__},{__account_name__},{__account_id__},{__char_id__},{__ip_address__},{__char_name__}",
            "textTo" : "INSERT INTO character_log (worldid,serid,logtime,action,account_name,account_id,player_id,clientip,given_name,new_name) VALUES ({WORLDID},{__running_number__},'{__datetime__}','{__log_type__}','{__account_name__}',{__account_id__},{__char_id__},'{__ip_address__}','{__char_name__}','');"
        },
        {
            "logType" : ",PriceType:1,",
            "textFrom" : "{__running_number__},{__datetime__},\[AH-PTGold\] {__log_type__},ItemID:{__item_id__},UID:{__item_uid__},Dur:{__auction_dur__},Price:{__auction_price__},PriceType:1,SellerID:{__seller_id__},ByerID:{__buyer_id__},BuyerGold:{__buyer_gold__},BuyerAncientCoin:{__unknown_number_1__},LV:{__char_level__}",
            "textTo" : "INSERT INTO auction_log(log_time, action, item_id, uid, dur, price, seller_id, buyer_id, buyer_gold, set_id) VALUES('{__datetime__}', '{__log_type__}', {__item_id__}, {__item_uid__}, {__auction_dur__}, {__auction_price__}, {__seller_id__}, {__buyer_id__}, {__buyer_gold__}, {SET});"
        },
        {
            "logType" : ",PriceType:2,",
            "textFrom" : "{__running_number__},{__datetime__},\[AH-PTAncientCoin\] {__log_type__},ItemID:{__item_id__},UID:{__item_uid__},Dur:{__auction_dur__},Price:{__auction_price__},PriceType:2,SellerID:{__seller_id__},ByerID:{__buyer_id__},BuyerGold:{__buyer_gold__},BuyerAncientCoin:{__unknown_number_1__},LV:{__char_level__}",
            "textTo" : "INSERT INTO ancientcoin_auction_log(log_time, action, item_id, uid, dur, price, seller_id, buyer_id, buyer_gold, set_id) VALUES('{__datetime__}', '{__log_type__}', {__item_id__}, {__item_uid__}, {__auction_dur__}, {__auction_price__}, {__seller_id__}, {__buyer_id__}, {__unknown_number_1__}, {SET});"
        },
	{
            "logType" : ",ANCL,Get,ch",
            "textFrom" : "{__running_number__},{__datetime__},ANCL,Get,ch \[{__char_name__}\] get \[AncientCoin:{__gold__}\], \[AncientCoin:{__item_uid__}\] -> \[AncientCoin:{__node__}\]!,:{__char_id__}:{__title__}",
            #"textTo" : "{__datetime__},{__char_id__},{__gold__},{__item_uid__},{__node__}"
	    "textTo" : "INSERT INTO ancientcoin(serverid ,date, player_id, change, ago, after) VALUES ({WORLDID},'{__datetime__}',{__char_id__},{__gold__},{__item_uid__},{__node__});"
        },
{	
            "logType" : "LotteryResult",
            "textFrom" : "{__running_number__},{__datetime__},AL,{__item_name__},\-{__gold__},Player \[{__char_id__}\] sends \[{__lottery_coin_num1__}\] with coins type \[{__lottery_coin_type__}\] to {__item_name__} Gold:{__lottery_coin_num2__},F,P:{__char_id__}:{__char_name__},Z:{__node__}:{__node_name__}:{__x__}:{__y__},LV:{__char_level__}",
#402571,2014/12/23 14:04:21,AL,AlchemyB,-1,Player [135008088] sends [1] with coins type [14] to LotteryResult,Alchemy Gold:2,F,P:135008088:Landon,Z:1:©¬©ԫ°:230:188
#402571,2014/12/23 14:04:21,AL,AlchemyB,-1,Player [135008088] sends [1] with coins type [14] to LotteryResult,Alchemy Gold:2,F,P:135008088:Landon,Z:1:©¬©ԫ°:230:188
            "textTo" : "INSERT INTO lottery_coin_log (logtime,player_id,coin_num1,coin_num2,coin_type,set_id,wz_id) values ('{__datetime__}',{__char_id__},{__lottery_coin_num1__},{__lottery_coin_num2__},{__lottery_coin_type__},{SET},{WORLDID});"
        },
    ],

    "gmlog":[
        {
            "logType" : ",P:",
            "textFrom" : "{__running_number__},{__datetime__},\"{__gm_cmd__}\",P:{__char_id__}:{__char_name__},Z:{__node__}:{__node_name__}:{__x__}:{__y__} ",
            "textTo" : "INSERT INTO gm_cmd_log (worldid,serid,logtime,cmd,player_id) values ({WORLDID},{__running_number__},'{__datetime__}','{__gm_cmd__}'{__char_id__});"
        }
    ],

    "apexlog":[
        {
            "logType" : "",
            "textFrom" : "{__apex_datetime__}\t{__char_name__} : {__account_name__}\t{__char_id__}\t{__apex_second_datetime__}\t{__apex_no__}\t{__apex_no2__}[\t|\s]{__apex_note__}",
            "textTo" : "INSERT INTO apex_log (logtime,given_name,account_name,player_id,no,no2,note,set_id,wz_id) values ('{__apex_datetime__}','{__char_name__}','{__account_name__}',{__char_id__},{__apex_no__},{__apex_no2__},'{__apex_note__}',{SET},'{WORLDID}');"
        }
    ],

    "pwdlog":[
        {
            "logType" : ",Failed!,",
            "textFrom" : "{__running_number__},{__datetime__},{__log_type__},\[AID:{__account_id__}\] \[IP:{__ip_address__}\] \[P:{__secret__}\] {__pwd_state__}",
            "textTo" : "INSERT INTO two_pwd_log (set_id,worldid,logtime,account_id,clientip,secret,state) values ({SET},{WORLDID},'{__datetime__}','{__account_id__}','{__ip_address__}','{__secret__}','{__pwd_state__}');"
        }
    ],

    "ACoin":[
	{
            "logType" : ",ANCL,Get,ch",
            "textFrom" : "{__running_number__},{__datetime__},ANCL,Get,ch \[{__char_name__}\] get \[AncientCoin:{__gold__}\], \[AncientCoin:{__item_uid__}\] -> \[AncientCoin:{__node__}\]!,:{__char_id__}:{__title__}",
            #"textTo" : "{__datetime__},{__char_id__},{__gold__},{__item_uid__},{__node__}"
            "textTo" : "INSERT INTO ancientcoin(serverid ,date, player_id, change, ago, after) VALUES ({WORLDID},'{__datetime__}',{__char_id__},{__gold__},{__item_uid__},{__node__});"
        },
    ],

    "lottery_coin_log":[
        {
            "logType" : "LotteryResult",
            "textFrom" : "{__running_number__},{__datetime__},AL,{__item_name__},\-{__gold__},Player \[{__char_id__}\] sends \[{__lottery_coin_num1__}\] with coins type \[{__lottery_coin_type__}\] to {__item_name__} Gold:{__lottery_coin_num2__},F,P:{__char_id__}:{__char_name__},Z:{__node__}:{__node_name__}:{__x__}:{__y__},LV:{__char_level__}",
#402571,2014/12/23 14:04:21,AL,AlchemyB,-1,Player [135008088] sends [1] with coins type [14] to LotteryResult,Alchemy Gold:2,F,P:135008088:Landon,Z:1:©¬©ԫ°:230:188
#402571,2014/12/23 14:04:21,AL,AlchemyB,-1,Player [135008088] sends [1] with coins type [14] to LotteryResult,Alchemy Gold:2,F,P:135008088:Landon,Z:1:©¬©ԫ°:230:188
            "textTo" : "INSERT INTO lottery_coin_log (logtime,player_id,coin_num1,coin_num2,coin_type,set_id,wz_id) values ('{__datetime__}',{__char_id__},{__lottery_coin_num1__},{__lottery_coin_num2__},{__lottery_coin_type__},{SET},{WORLDID});"
        },
    ],

    "lottery_coin_log2":[
        {
           "logType" : "GainCoin",
           "textFrom" : "{__running_number__},{__datetime__},AL,AlchemyB,1,Player{__char_id__}gains{__lottery_coin_num1__}withcoinstype{__lottery_coin_type__}fromEC_GainCoin,AlchemyGold:{__lottery_coin_num2__},F,P:{__char_id__}:{__char_name__},Z:{__node__}:{__node_name__}:{__x__}:{__y__},LV:{__char_level__}",
#408224,2014/12/23 14:04:43,AL,AlchemyB,1,Player[135008088]gains[1]withcoinstype[14]fromEC_GainCoin,AlchemyGold:1,F,P:135008088:Landon,Z:1:©¬©ԫ°:230:188
           "textTo" : "INSERT INTO lottery_coin_log (logtime,player_id,given_name,play_level,coin_num1,coin_num2,coin_type,set_id,wz_id) values ('{__datetime__}',{__char_id__},'{__char_name__}',{__lottery_plv__},{__lottery_coin_num1__},{__lottery_coin_num2__},{__lottery_coin_type__},{SET},{WORLDID});"
        },
    ],


    "account_mail_cid":[
        {
           "logType" : "",
           "textFrom" : "{__running_number__},{__datetime__},\[AccountMail\]{__action_type__},CID:{__char_id__},ZID:{__mail_zid__},AID:{__mail_id__},RID:{__rid__},SID:{__sid__},SName:{__sender_name__},SendTime:{__send_time__},DueDate:{__due_date__},Title:{__title__},Open:{__mail_open__},Attach\[Item\], ItemID:0, ItemDurability:0, ItemUID:0",
           "textTo" : "INSERT INTO account_mail_log (log_time, action, type, mail_id, rid, sid, sname, send_time, due_date, mail_title, mopen, char_id, zid, set_id) values ('{__datetime__}','{__action_type__}','CID',{__mail_id__},{__rid__},{__sid__},'{__sender_name__}','{__send_time__}','{__due_date__}','{__title__}',{__mail_open__},'{__char_id__}','{__mail_zid__}',{SET});"
        },
    ],


    "account_mail_aid":[
        {
           "logType" : "",
           "textFrom" : "{__running_number__},{__datetime__},\[AccountMail\]Send,AID:{__mail_id__},RID:{__rid__},SID:{__sid__},SName:{__sender_name__},SendTime:{__send_time__},DueDate:{__due_date__},Title:{__title__},Open:{__mail_open__},{__mail_others__}",
	   "textTo" : "INSERT INTO account_mail_log (log_time, action, type, mail_id, rid, sid, sname, send_time, due_date, mail_title, mopen, char_id, zid, set_id, mail_others) values ('{__datetime__}','Send','AID',{__mail_id__},{__rid__},{__sid__},'{__sender_name__}','{__send_time__}','{__due_date__}','{__title__}',{__mail_open__},'X','X',{SET},'{__mail_others__}');"
        },
    ],


    "account_mail_cid_5":[
        {
           "logType" : "",
           "textFrom" : "{__running_number__},{__datetime__},\[AccountMail\]{__action_type__},CID:{__char_id__},ZID:{__mail_zid__},AID:{__mail_id__},RID:{__rid__},SID:{__sid__},SName:{__sender_name__},SendTime:{__send_time__},DueDate:{__due_date__},Title:{__title__},Open:{__mail_open__},ItemID:{__mail_item_id__}, ItemDurability:{__mail_item_dur__}, ItemUID:{__mail_item_uid__},ItemID:{__mail_item_id_2__}, ItemDurability:{__mail_item_dur_2__}, ItemUID:{__mail_item_uid_2__},ItemID:{__mail_item_id_3__}, ItemDurability:{__mail_item_dur_3__}, ItemUID:{__mail_item_uid_3__},ItemID:{__mail_item_id_4__}, ItemDurability:{__mail_item_dur_4__}, ItemUID:{__mail_item_uid_4__}, ItemID:{__mail_item_id_5__}, ItemDurability:{__mail_item_dur_5__}, ItemUID:{__mail_item_uid_5__}",
           "textTo" : "INSERT INTO account_mail_log (log_time, action, type, mail_id, rid, sid, sname, send_time, due_date, mail_title, item_id1, item_dur1, item_uid1, mopen, char_id, zid, set_id) values ('{__datetime__}','{__action_type__}','CID',{__mail_id__},{__rid__},{__sid__},'{__sender_name__}','{__send_time__}','{__due_date__}','{__title__}',{__mail_item_id__},{__mail_item_dur__},{__mail_item_uid__},{__mail_open__},'{__char_id__}','{__mail_zid__}',{SET},{__mail_item_id_2__},{__mail_item_dur_2__},{__mail_item_uid_2__},{__mail_item_id_3__},{__mail_item_dur_3__},{__mail_item_uid_3__},{__mail_item_id_4__},{__mail_item_dur_4__},{__mail_item_uid_4__},{__mail_item_id_5__},{__mail_item_dur_5__},{__mail_item_uid_5__});"
        },
    ],

    "account_mail_cid_4":[
        {
           "logType" : "",
           "textFrom" : "{__running_number__},{__datetime__},\[AccountMail\]{__action_type__},CID:{__char_id__},ZID:{__mail_zid__},AID:{__mail_id__},RID:{__rid__},SID:{__sid__},SName:{__sender_name__},SendTime:{__send_time__},DueDate:{__due_date__},Title:{__title__},Open:{__mail_open__},ItemID:{__mail_item_id__}, ItemDurability:{__mail_item_dur__}, ItemUID:{__mail_item_uid__},ItemID:{__mail_item_id_2__}, ItemDurability:{__mail_item_dur_2__}, ItemUID:{__mail_item_uid_2__},ItemID:{__mail_item_id_3__}, ItemDurability:{__mail_item_dur_3__}, ItemUID:{__mail_item_uid_3__},ItemID:{__mail_item_id_4__}, ItemDurability:{__mail_item_dur_4__}, ItemUID:{__mail_item_uid_4__}",
           "textTo" : "INSERT INTO account_mail_log (log_time, action, type, mail_id, rid, sid, sname, send_time, due_date, mail_title, item_id1, item_dur1, item_uid1, mopen, char_id, zid, set_id) values ('{__datetime__}','{__action_type__}','CID',{__mail_id__},{__rid__},{__sid__},'{__sender_name__}','{__send_time__}','{__due_date__}','{__title__}',{__mail_item_id__},{__mail_item_dur__},{__mail_item_uid__},{__mail_open__},'{__char_id__}','{__mail_zid__}',{SET},{__mail_item_id_2__},{__mail_item_dur_2__},{__mail_item_uid_2__},{__mail_item_id_3__},{__mail_item_dur_3__},{__mail_item_uid_3__},{__mail_item_id_4__},{__mail_item_dur_4__},{__mail_item_uid_4__});"
        },
    ],

    "account_mail_cid_3":[
        {
           "logType" : "",
           "textFrom" : "{__running_number__},{__datetime__},\[AccountMail\]{__action_type__},CID:{__char_id__},ZID:{__mail_zid__},AID:{__mail_id__},RID:{__rid__},SID:{__sid__},SName:{__sender_name__},SendTime:{__send_time__},DueDate:{__due_date__},Title:{__title__},Open:{__mail_open__},ItemID:{__mail_item_id__}, ItemDurability:{__mail_item_dur__}, ItemUID:{__mail_item_uid__},ItemID:{__mail_item_id_2__}, ItemDurability:{__mail_item_dur_2__}, ItemUID:{__mail_item_uid_2__},ItemID:{__mail_item_id_3__}, ItemDurability:{__mail_item_dur_3__}, ItemUID:{__mail_item_uid_3__}",
           "textTo" : "INSERT INTO account_mail_log (log_time, action, type, mail_id, rid, sid, sname, send_time, due_date, mail_title, item_id1, item_dur1, item_uid1, mopen, char_id, zid, set_id) values ('{__datetime__}','{__action_type__}','CID',{__mail_id__},{__rid__},{__sid__},'{__sender_name__}','{__send_time__}','{__due_date__}','{__title__}',{__mail_item_id__},{__mail_item_dur__},{__mail_item_uid__},{__mail_open__},'{__char_id__}','{__mail_zid__}',{SET},{__mail_item_id_2__},{__mail_item_dur_2__},{__mail_item_uid_2__},{__mail_item_id_3__},{__mail_item_dur_3__},{__mail_item_uid_3__});"
        },
    ],

    "account_mail_cid_2":[
        {
           "logType" : "",
           "textFrom" : "{__running_number__},{__datetime__},\[AccountMail\]{__action_type__},CID:{__char_id__},ZID:{__mail_zid__},AID:{__mail_id__},RID:{__rid__},SID:{__sid__},SName:{__sender_name__},SendTime:{__send_time__},DueDate:{__due_date__},Title:{__title__},Open:{__mail_open__},ItemID:{__mail_item_id__}, ItemDurability:{__mail_item_dur__}, ItemUID:{__mail_item_uid__},ItemID:{__mail_item_id_2__}, ItemDurability:{__mail_item_dur_2__}, ItemUID:{__mail_item_uid_2__}",
           "textTo" : "INSERT INTO account_mail_log (log_time, action, type, mail_id, rid, sid, sname, send_time, due_date, mail_title, item_id1, item_dur1, item_uid1, mopen, char_id, zid, set_id) values ('{__datetime__}','{__action_type__}','CID',{__mail_id__},{__rid__},{__sid__},'{__sender_name__}','{__send_time__}','{__due_date__}','{__title__}',{__mail_item_id__},{__mail_item_dur__},{__mail_item_uid__},{__mail_open__},'{__char_id__}','{__mail_zid__}',{SET},{__mail_item_id_2__},{__mail_item_dur_2__},{__mail_item_uid_2__});"
        },
    ],

    "account_mail_cid_1":[
        {
           "logType" : "",
           "textFrom" : "{__running_number__},{__datetime__},\[AccountMail\]{__action_type__},CID:{__char_id__},ZID:{__mail_zid__},AID:{__mail_id__},RID:{__rid__},SID:{__sid__},SName:{__sender_name__},SendTime:{__send_time__},DueDate:{__due_date__},Title:{__title__},Open:{__mail_open__},ItemID:{__mail_item_id__}, ItemDurability:{__mail_item_dur__}, ItemUID:{__mail_item_uid__}",
           "textTo" : "INSERT INTO account_mail_log (log_time, action, type, mail_id, rid, sid, sname, send_time, due_date, mail_title, item_id1, item_dur1, item_uid1, mopen, char_id, zid, set_id) values ('{__datetime__}','{__action_type__}','CID',{__mail_id__},{__rid__},{__sid__},'{__sender_name__}','{__send_time__}','{__due_date__}','{__title__}',{__mail_item_id__},{__mail_item_dur__},{__mail_item_uid__},{__mail_open__},'{__char_id__}','{__mail_zid__}',{SET});"
        },
    ],

    "account_mail_aid_6":[
        {
           "logType" : "",
           "textFrom" : "{__running_number__},{__datetime__},\[AccountMail\]Send,AID:{__mail_id__},RID:{__rid__},SID:{__sid__},SName:{__sender_name__},SendTime:{__send_time__},DueDate:{__due_date__},Title:{__title__},Open:{__mail_open__},ItemID:{__mail_item_id__}, ItemDurability:{__mail_item_dur__}, ItemUID:{__mail_item_uid__},ItemID:{__mail_item_id_2__}, ItemDurability:{__mail_item_dur_2__}, ItemUID:{__mail_item_uid_2__},ItemID:{__mail_item_id_3__}, ItemDurability:{__mail_item_dur_3__}, ItemUID:{__mail_item_uid_3__},ItemID:{__mail_item_id_4__}, ItemDurability:{__mail_item_dur_4__}, ItemUID:{__mail_item_uid_4__},ItemID:{__mail_item_id_5__}, ItemDurability:{__mail_item_dur_5__}, ItemUID:{__mail_item_uid_5__},ItemID:{__mail_item_id_6__}, ItemDurability:{__mail_item_dur_6__}, ItemUID:{__mail_item_uid_6__}",
	   "textTo" : "INSERT INTO account_mail_log (log_time, action, type, mail_id, rid, sid, sname, send_time, due_date, mail_title, item_id1, item_dur1, item_uid1, mopen, char_id, zid, set_id, item_id2, item_dur2, item_uid2, item_id3, item_dur3, item_uid3, item_id4, item_dur4, item_uid4, item_id5, item_dur5, item_uid5, item_id6, item_dur6, item_uid6) values ('{__datetime__}','Send','AID',{__mail_id__},{__rid__},{__sid__},'{__sender_name__}','{__send_time__}','{__due_date__}','{__title__}',{__mail_item_id__},{__mail_item_dur__},{__mail_item_uid__},{__mail_open__},'X','X',{SET},{__mail_item_id_2__},{__mail_item_dur_2__},{__mail_item_uid_2__},{__mail_item_id_3__},{__mail_item_dur_3__},{__mail_item_uid_3__},{__mail_item_id_4__},{__mail_item_dur_4__},{__mail_item_uid_4__},{__mail_item_id_5__},{__mail_item_dur_5__},{__mail_item_uid_5__},{__mail_item_id_6__},{__mail_item_dur_6__},{__mail_item_uid_6__});"
        },
    ],

    "account_mail_aid_5":[
        {
           "logType" : "",
           "textFrom" : "{__running_number__},{__datetime__},\[AccountMail\]Send,AID:{__mail_id__},RID:{__rid__},SID:{__sid__},SName:{__sender_name__},SendTime:{__send_time__},DueDate:{__due_date__},Title:{__title__},Open:{__mail_open__},ItemID:{__mail_item_id__}, ItemDurability:{__mail_item_dur__}, ItemUID:{__mail_item_uid__},ItemID:{__mail_item_id_2__}, ItemDurability:{__mail_item_dur_2__}, ItemUID:{__mail_item_uid_2__},ItemID:{__mail_item_id_3__}, ItemDurability:{__mail_item_dur_3__}, ItemUID:{__mail_item_uid_3__},ItemID:{__mail_item_id_4__}, ItemDurability:{__mail_item_dur_4__}, ItemUID:{__mail_item_uid_4__},ItemID:{__mail_item_id_5__}, ItemDurability:{__mail_item_dur_5__}, ItemUID:{__mail_item_uid_5__}",
	   "textTo" : "INSERT INTO account_mail_log (log_time, action, type, mail_id, rid, sid, sname, send_time, due_date, mail_title, item_id1, item_dur1, item_uid1, mopen, char_id, zid, set_id, item_id2, item_dur2, item_uid2, item_id3, item_dur3, item_uid3, item_id4, item_dur4, item_uid4, item_id5, item_dur5, item_uid5) values ('{__datetime__}','Send','AID',{__mail_id__},{__rid__},{__sid__},'{__sender_name__}','{__send_time__}','{__due_date__}','{__title__}',{__mail_item_id__},{__mail_item_dur__},{__mail_item_uid__},{__mail_open__},'X','X',{SET},{__mail_item_id_2__},{__mail_item_dur_2__},{__mail_item_uid_2__},{__mail_item_id_3__},{__mail_item_dur_3__},{__mail_item_uid_3__},{__mail_item_id_4__},{__mail_item_dur_4__},{__mail_item_uid_4__},{__mail_item_id_5__},{__mail_item_dur_5__},{__mail_item_uid_5__});"
        },
    ],

    "account_mail_aid_4":[
        {
           "logType" : "",
           "textFrom" : "{__running_number__},{__datetime__},\[AccountMail\]Send,AID:{__mail_id__},RID:{__rid__},SID:{__sid__},SName:{__sender_name__},SendTime:{__send_time__},DueDate:{__due_date__},Title:{__title__},Open:{__mail_open__},ItemID:{__mail_item_id__}, ItemDurability:{__mail_item_dur__}, ItemUID:{__mail_item_uid__},ItemID:{__mail_item_id_2__}, ItemDurability:{__mail_item_dur_2__}, ItemUID:{__mail_item_uid_2__},ItemID:{__mail_item_id_3__}, ItemDurability:{__mail_item_dur_3__}, ItemUID:{__mail_item_uid_3__},ItemID:{__mail_item_id_4__}, ItemDurability:{__mail_item_dur_4__}, ItemUID:{__mail_item_uid_4__}",
	   "textTo" : "INSERT INTO account_mail_log (log_time, action, type, mail_id, rid, sid, sname, send_time, due_date, mail_title, item_id1, item_dur1, item_uid1, mopen, char_id, zid, set_id, item_id2, item_dur2, item_uid2, item_id3, item_dur3, item_uid3, item_id4, item_dur4, item_uid4) values ('{__datetime__}','Send','AID',{__mail_id__},{__rid__},{__sid__},'{__sender_name__}','{__send_time__}','{__due_date__}','{__title__}',{__mail_item_id__},{__mail_item_dur__},{__mail_item_uid__},{__mail_open__},'X','X',{SET},{__mail_item_id_2__},{__mail_item_dur_2__},{__mail_item_uid_2__},{__mail_item_id_3__},{__mail_item_dur_3__},{__mail_item_uid_3__},{__mail_item_id_4__},{__mail_item_dur_4__},{__mail_item_uid_4__});"
        },
    ],

    "account_mail_aid_3":[
        {
           "logType" : "",
           "textFrom" : "{__running_number__},{__datetime__},\[AccountMail\]Send,AID:{__mail_id__},RID:{__rid__},SID:{__sid__},SName:{__sender_name__},SendTime:{__send_time__},DueDate:{__due_date__},Title:{__title__},Open:{__mail_open__},ItemID:{__mail_item_id__}, ItemDurability:{__mail_item_dur__}, ItemUID:{__mail_item_uid__},ItemID:{__mail_item_id_2__}, ItemDurability:{__mail_item_dur_2__}, ItemUID:{__mail_item_uid_2__},ItemID:{__mail_item_id_3__}, ItemDurability:{__mail_item_dur_3__}, ItemUID:{__mail_item_uid_3__}",
	   "textTo" : "INSERT INTO account_mail_log (log_time, action, type, mail_id, rid, sid, sname, send_time, due_date, mail_title, item_id1, item_dur1, item_uid1, mopen, char_id, zid, set_id, item_id2, item_dur2, item_uid2, item_id3, item_dur3, item_uid3) values ('{__datetime__}','Send','AID',{__mail_id__},{__rid__},{__sid__},'{__sender_name__}','{__send_time__}','{__due_date__}','{__title__}',{__mail_item_id__},{__mail_item_dur__},{__mail_item_uid__},{__mail_open__},'X','X',{SET},{__mail_item_id_2__},{__mail_item_dur_2__},{__mail_item_uid_2__},{__mail_item_id_3__},{__mail_item_dur_3__},{__mail_item_uid_3__});"
        },
    ],

    "account_mail_aid_2":[
        {
           "logType" : "",
           "textFrom" : "{__running_number__},{__datetime__},\[AccountMail\]Send,AID:{__mail_id__},RID:{__rid__},SID:{__sid__},SName:{__sender_name__},SendTime:{__send_time__},DueDate:{__due_date__},Title:{__title__},Open:{__mail_open__},ItemID:{__mail_item_id__}, ItemDurability:{__mail_item_dur__}, ItemUID:{__mail_item_uid__},ItemID:{__mail_item_id_2__}, ItemDurability:{__mail_item_dur_2__}, ItemUID:{__mail_item_uid_2__}",
	   "textTo" : "INSERT INTO account_mail_log (log_time, action, type, mail_id, rid, sid, sname, send_time, due_date, mail_title, item_id1, item_dur1, item_uid1, mopen, char_id, zid, set_id, item_id2, item_dur2, item_uid2) values ('{__datetime__}','Send','AID',{__mail_id__},{__rid__},{__sid__},'{__sender_name__}','{__send_time__}','{__due_date__}','{__title__}',{__mail_item_id__},{__mail_item_dur__},{__mail_item_uid__},{__mail_open__},'X','X',{SET},{__mail_item_id_2__},{__mail_item_dur_2__},{__mail_item_uid_2__});"
        },
    ],

    "account_mail_aid_1":[
	{
           "logType" : "",
           "textFrom" : "{__running_number__},{__datetime__},\[AccountMail\]Send,AID:{__mail_id__},RID:{__rid__},SID:{__sid__},SName:{__sender_name__},SendTime:{__send_time__},DueDate:{__due_date__},Title:{__title__},Open:{__mail_open__},ItemID:{__mail_item_id__}, ItemDurability:{__mail_item_dur__}, ItemUID:{__mail_item_uid__}",
	   "textTo" : "INSERT INTO account_mail_log (log_time, action, type, mail_id, rid, sid, sname, send_time, due_date, mail_title, item_id1, item_dur1, item_uid1, mopen, char_id, zid, set_id) values ('{__datetime__}','Send','AID',{__mail_id__},{__rid__},{__sid__},'{__sender_name__}','{__send_time__}','{__due_date__}','{__title__}',{__mail_item_id__},{__mail_item_dur__},{__mail_item_uid__},{__mail_open__},'X','X',{SET});"
        },
    ],


    "vip_level_up":[
	{
           "logType" : ",VIP Level_Up to",
           "textFrom" : "{__running_number__},{__datetime__},ch\[{__char_id__}:{__char_name__}:{__account_id__}\]p\[{__vip_level1__},{__vip_points__}\],VIP Level_Up to\[{__vip_level2__}\]",
	   "textTo" : "INSERT INTO vip_log (log_time, action, account_id, player_id, player_name, vip_lvl, vip_points, vip_up_lvl, set_id) values ('{__datetime__}', 'level_up', {__account_id__}, {__char_id__}, '{__char_name__}', {__vip_level1__}, {__vip_points__}, {__vip_level2__}, {SET});"
        },
    ],


    "maillog":[
        {
            "logType" : "",
            "textFrom" : "{__running_number__},{__datetime__},{__action_type__},ID:{__mail_id__},RID:{__rid__},SID:{__sid__},SName:{__sender_name__},SendTime:{__send_time__},DueDate:{__due_date__},Title:{__title__},G:{__mail_gold__},Open:{__mail_open__},Return:{__mail_return__},ItemID:{__mail_item_id__},ItemUID:{__mail_item_uid__},ItemDur:{__mail_item_dur__},ZID:{__mail_zid__}"
,
            "textTo" : "INSERT INTO mail_log (log_time, action, mail_id, rid, sid, sname, send_time, due_date, mail_title, gold, item_id, item_uid, item_dur, mopen, mreturn, zid, set_id) values ('{__datetime__}','{__action_type__}',{__mail_id__},{__rid__},{__sid__},'{__sender_name__}','{__send_time__}','{__due_date__}','{__title__}',{__mail_gold__},{__mail_item_id__},{__mail_item_uid__},{__mail_item_dur__},{__mail_open__},{__mail_return__},{__mail_zid__},{SET});"
        }
    ],

    "twolevel":[
        {
            "logType" : "shoptrade",
            "textFrom" : "log,{__minusdatetime__},{__appkey__},{__version__},{__action_type__},null,{__step_num_id__},{__serverid__},{__gamechannel__},{__account_name__},{__char_id__},{__char_level__},{__sp_type_id__},{__sp_item_id__},{__quantity__},{__detail__},{__bind_money__},{__money_count__},{__money_type__}",

            "textTo" : "INSERT INTO twolevel_log (log_time, app_id, app_version, action_type, step_num_id, server_id, game_channel, account_name, player_id, player_level, type_id, item_id, quantity, detail, bind_money, money_count, money_type, set_id) values ('{__minusdatetime__}',{__appkey__},'{__version__}','{__action_type__}','{__step_num_id__}','{__serverid__}','{__gamechannel__}','{__account_name__}',{__char_id__},{__char_level__},'{__sp_type_id__}','{__sp_item_id__}',{__quantity__},'{__detail__}',{__bind_money__},{__money_count__},{__money_type__},{SET});"
        },
        {
            "logType" : "money",
            "textFrom" : "log,{__minusdatetime__},{__appkey__},{__version__},{__action_type__},null,{__normalversion__},{__serverid__},{__gamechannel__},{__account_name__},{__char_id__},{__char_level__},{__cause_id__},{__quantity__},{__total__},{__type_id__},{__vip_level__},{__location__},{__action__}",

            "textTo" : "INSERT INTO twolevel_log (log_time, app_id, app_version, action_type, normal_version, server_id, game_channel, account_name, player_id, player_level, cause_id, quantity, total, type_id, vip_level, location, action, set_id) values ('{__minusdatetime__}',{__appkey__},'{__version__}','{__action_type__}','{__normalversion__}','{__serverid__}','{__gamechannel__}','{__account_name__}',{__char_id__},{__char_level__},{__cause_id__},{__quantity__},{__total__},{__type_id__},{__vip_level__},{__location__},{__action__},{SET});"
        },
        {
            "logType" : "item",
            "textFrom" : "log,{__minusdatetime__},{__appkey__},{__version__},{__action_type__},null,{__normalversion__},{__serverid__},{__gamechannel__},{__account_name__},{__char_id__},{__char_level__},{__type_id__},{__item_id__},{__cause_id__},{__quantity__},{__vip_level__},{__location__},{__action__}",

            "textTo" : "INSERT INTO twolevel_log (log_time, app_id, app_version, action_type, normal_version, server_id, game_channel, account_name, player_id, player_level, type_id, item_id, cause_id, quantity, vip_level, location, action, set_id) values ('{__minusdatetime__}',{__appkey__},'{__version__}','{__action_type__}','{__normalversion__}','{__serverid__}','{__gamechannel__}','{__account_name__}',{__char_id__},{__char_level__},{__type_id__},{__item_id__},{__cause_id__},{__quantity__},{__vip_level__},{__location__},{__action__},{SET});"
        },
        #{
        #    "logType" : "shoptrade",
            #"textFrom" : "log,{__minusdatetime__},{__appkey__},{__version__},{__action_type__},null,{__step_num_id__},{__serverid__},{__gamechannel__},{__account_name__},{__char_id__},{__char_level__},{__sp_type_id__},{__sp_item_id__},{__quantity__},\{{__detail__}\},{__bind_money__},{__money_count__},{__money_type__}"
        #    "textFrom" : "log,{__minusdatetime__},{__appkey__},{__version__},{__action_type__},null,{__step_num_id__},{__serverid__},{__gamechannel__},{__account_name__},{__char_id__},{__char_level__},{__sp_type_id__},{__sp_item_id__},{__quantity__},{__detail__},{__bind_money__},{__money_count__},{__money_type__}"
#,
        #    "textTo" : "INSERT INTO twolevel_log (log_time, app_id, app_version, action_type, step_num_id, server_id, game_channel, account_name, player_id, player_level, type_id, item_id, quantity, detail, bind_money, money_count, money_type, set_id) values ('{__minusdatetime__}',{__appkey__},'{__version__}','{__action_type__}','{__step_num_id__}','{__serverid__}','{__gamechannel__}','{__account_name__}',{__char_id__},{__char_level__},'{__sp_type_id__}','{__sp_item_id__}',{__quantity__},'{__detail__}',{__bind_money__},{__money_count__},{__money_type__},{SET});"
        #},
    ],

    "mskingdomwar":[
        {
            "logType" : "join",
            "textFrom" : "{__running_number__},{__datetime__},ch\[{__char_id__}:{__char_name__}:{__account_id__}\]\[{__kingdom_id__}\],\[LOG\]\[T{__total_join__}\]\[D{__total_defense__}\]\[O{__total_attack__}\] player join session = {__session__} node = {__node__} side = {__side__}"
,
            "textTo" : "INSERT INTO ms_kingdomwar_log (log_time, player_id, player_name, account_id, kingdom_id, total_join, total_defense, total_attack, session, node, side, set_id) values ('{__datetime__}', {__char_id__}, '{__char_name__}', {__account_id__}, {__kingdom_id__}, {__total_join__}, {__total_defense__}, {__total_attack__}, {__session__}, {__node__}, {__side__}, {SET});"
        },
    ],

    "ms_blew_date":[
        {
            # FF/AK/M11 MissionServer Blew Log ( Rank )
            # 905,2018/03/07 05:41:13,RankUpdate: Type=18 Group=5 Class=7,
            "logType" : "RankUpdate",
            "textFrom" : "{__running_number__},{__datetime__},{__log_type__}: Type={__ms_year__} Group={__ms_month__} Class={__ms_day__},",
            "textTo" : "INSERT INTO ms_blew_date_log(log_time, year, month, day, set_id) VALUES('{__datetime__}', '{__ms_year__}', '{__ms_month__}', '{__ms_day__}', {SET});"
        },
    ], 
}
