示例#1
0
void JGPGetCharList(LPSDHP_GETCHARLIST lpMsg,int aIndex)
{
	char cBUFFER[10000]={0};

	LPSDHP_CHARLISTCOUNT pCount = (LPSDHP_CHARLISTCOUNT)(cBUFFER);
	LPSDHP_CHARLIST pCL = (LPSDHP_CHARLIST)(cBUFFER + sizeof(SDHP_CHARLISTCOUNT));

	char szAccountID[MAX_IDSTRING+1];
	memcpy(szAccountID,lpMsg->Id,MAX_IDSTRING);
	szAccountID[MAX_IDSTRING] = 0;

	PMSG_ANS_SUMMONER_CREATE pMsg;
	PHeadSetB((LPBYTE)&pMsg,0x72,sizeof(pMsg));

	memcpy(pMsg.szAccount,szAccountID,MAX_IDSTRING);
	pMsg.Number = lpMsg->Number;
	pMsg.Result = GetSummonerCreate(&pMsg,szAccountID);

	DataSend(aIndex,(LPBYTE)&pMsg,sizeof(pMsg));

	pCount->Number = lpMsg->Number;
	lstrcpy(pCount->AccountId,szAccountID);

	pCount->Count = GetCharList(szAccountID,pCount,pCL);

	PHeadSetW((LPBYTE)pCount, 0x01, sizeof(SDHP_CHARLISTCOUNT) + sizeof(SDHP_CHARLIST) * pCount->Count);

	DataSend(aIndex,(LPBYTE)&cBUFFER,sizeof(SDHP_CHARLISTCOUNT) + sizeof(SDHP_CHARLIST) * pCount->Count);
}
//-----------------------------------------------------//
CONCEPT_FUNCTION_IMPL(_GDC_transparent_bg, 1)
    T_NUMBER(_GDC_transparent_bg, 0)
    RETURN_NUMBER(GDC_transparent_bg = (char)PARAM_INT(0));
END_IMPL
//-----------------------------------------------------//
CONCEPT_FUNCTION_IMPL(_pie_gif, 7)
    T_NUMBER(_pie_gif, 0)
    T_NUMBER(_pie_gif, 1)
    T_NUMBER(_pie_gif, 2)
    T_NUMBER(_pie_gif, 3)
    T_NUMBER(_pie_gif, 4)
    T_ARRAY(_pie_gif, 5)
    T_ARRAY(_pie_gif, 6)

    char **labels = GetCharList(PARAMETER(5), Invoke);
    float *data = GetFloatList(PARAMETER(6), Invoke);

    pie_gif((short)PARAM_INT(0),  // width
            (short)PARAM_INT(1),  // height
            (FILE *)PARAM_INT(2), // file *
            (GDCPIE_TYPE)PARAM_INT(3),
            PARAM_INT(4),         // num_points
            labels,
            data
            );

    delete[] labels;
    delete[] data;
    RETURN_NUMBER(0);
END_IMPL
    RETURN_NUMBER(SablotDestroyProcessor((SablotHandle)(long)PARAM(0)))
END_IMPL
//------------------------------------------------------------------------
CONCEPT_FUNCTION_IMPL(_SablotRunProcessor, 6)
    T_NUMBER(_SablotRunProcessor, 0)     // SablotHandle
    T_STRING(_SablotRunProcessor, 1)     // char*
    T_STRING(_SablotRunProcessor, 2)     // char*
    T_STRING(_SablotRunProcessor, 3)     // char*

    char *data4 = 0;
    char *data5 = 0;
    GET_CHECK_ARRAY(4, data4, "Parameter 4 should be an array");
    GET_CHECK_ARRAY(5, data5, "Parameter 5 should be an array");

    char **arr4 = GetCharList(PARAMETER(4));
    char **arr5 = GetCharList(PARAMETER(5));

// ... parameter 4 is by reference (char**)
//char* local_parameter_4;
// ... parameter 5 is by reference (char**)
//char* local_parameter_5;

    RETURN_NUMBER(SablotRunProcessor((SablotHandle)(long)PARAM(0), PARAM(1), PARAM(2), PARAM(3), (const char **)arr4, (const char **)arr5))

    if (arr4)
        delete[] arr4;
    if (arr5)
        delete[] arr5;
END_IMPL
//------------------------------------------------------------------------