决战私服 客户端下载 家族排行 发布决战 发布家族 玩家排行 开区一条龙 【耍决战私服网】唯一联系QQ:597584555
↓ 决战私服相关文章内容浏览 ↓
人物到游戏界面
编辑:看决战 来源:看决战 Www.kanjuezhan.Com
BOOL USER::SendCharInfo(TCHAR *strChar, TCHAR* pBuf, int& index)
{
SQLHSTMT hstmt = NULL;
SQLRETURN retcode;
BOOL bFind = FALSE;
TCHAR szSQL[1024]; ::ZeroMemory(szSQL, sizeof(szSQL));

_sntprintf(szSQL, sizeof(szSQL), TEXT("{call SEND_CHAR_DATA (\%s\)}"), strChar );
SQLCHAR strCharID[CHAR_NAME_LENGTH + 1], strFace[10];
SQLINTEGER strCharInd = SQL_NTS;

SQLSMALLINT sSTR, sCON, sDEX, sVOL, sWIS, sGender;
SQLINTEGER sInd;

SDWORD dSkin, dHair;

SQLSMALLINT sLevel;
SQLCHAR byClass;

SQLSMALLINT sHP, sPP, sSP;

// alisia
SQLSMALLINT sLZ;

SQLCHAR strSkill[_SKILL_DB], strItem[_ITEM_DB];

::ZeroMemory(strCharID, sizeof(strCharID));
::ZeroMemory(strFace, sizeof(strFace));
::ZeroMemory(strSkill, sizeof(strSkill));
::ZeroMemory(strItem, sizeof(strItem));

sSTR = sCON = sDEX = sVOL = sWIS = sGender = 0;
dSkin = dHair = 0;

byClass = 0;
sLevel = 1;
// alisia
sLZ = -1;

int db_index = 0;
CDatabase* pDB = &g_db[m_iSidMod];
if( !pDB ) return FALSE;

retcode = SQLAllocHandle( (SQLSMALLINT)SQL_HANDLE_STMT, pDB->m_hdbc, &hstmt );
if ( retcode != SQL_SUCCESS )
{
// g_DB[m_iModSid].ReleaseDB(db_index);
return FALSE;
}

retcode = SQLExecDirect( hstmt, (unsigned char*)szSQL, 1024 );
if( retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO )
{
retcode = SQLFetch( hstmt );
if( retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO )
{
int i = 1;
SQLGetData( hstmt, i++, SQL_C_CHAR, strCharID, sizeof(strCharID), &strCharInd);
SQLGetData( hstmt, i++, SQL_C_SSHORT, &sSTR, sizeof(sSTR), &sInd);
SQLGetData( hstmt, i++, SQL_C_SSHORT, &sCON, sizeof(sCON), &sInd);
SQLGetData( hstmt, i++, SQL_C_SSHORT, &sDEX, sizeof(sDEX), &sInd);
SQLGetData( hstmt, i++, SQL_C_SSHORT, &sVOL, sizeof(sVOL), &sInd);
SQLGetData( hstmt, i++, SQL_C_SSHORT, &sWIS, sizeof(sWIS), &sInd);
SQLGetData( hstmt, i++, SQL_C_ULONG, &dSkin, sizeof(dSkin), &sInd);
SQLGetData( hstmt, i++, SQL_C_ULONG, &dHair, sizeof(dHair), &sInd);
SQLGetData( hstmt, i++, SQL_C_SSHORT, &sGender, sizeof(sGender), &sInd);

SQLGetData( hstmt, i++, SQL_C_BINARY, strFace, sizeof(strFace), &sInd);

SQLGetData( hstmt, i++, SQL_C_TINYINT, &byClass, sizeof(byClass), &sInd);

SQLGetData( hstmt, i++, SQL_C_SSHORT, &sLevel, sizeof(sLevel), &sInd);

SQLGetData( hstmt, i++, SQL_C_SSHORT, &sHP, sizeof(sHP), &sInd);
SQLGetData( hstmt, i++, SQL_C_SSHORT, &sPP, sizeof(sPP), &sInd);
SQLGetData( hstmt, i++, SQL_C_SSHORT, &sSP, sizeof(sSP), &sInd);

SQLGetData( hstmt, i++, SQL_C_BINARY, strSkill, sizeof(strSkill), &sInd);
SQLGetData( hstmt, i++, SQL_C_BINARY, strItem, sizeof(strItem), &sInd);
// alisia
SQLGetData( hstmt, i++, SQL_C_SSHORT, &sLZ, sizeof(sLZ), &sInd);
}
else
{
DisplayErrorMsg(hstmt);
retcode = SQLFreeHandle((SQLSMALLINT)SQL_HANDLE_STMT, hstmt);
return FALSE;
}
}
else
{
DisplayErrorMsg(hstmt);
retcode = SQLFreeHandle((SQLSMALLINT)SQL_HANDLE_STMT, hstmt);

return FALSE;
}

retcode = SQLFreeHandle( (SQLSMALLINT)SQL_HANDLE_STMT, hstmt);

TCHAR strID[CHAR_NAME_LENGTH + 1];
_tcscpy(strID, (TCHAR*)strCharID);
short nSTR = sSTR; 
short nCON = sCON;
short nDEX = sDEX;
short nVOL = sVOL;
short nWIS = sWIS;

short sMaxHP = 0;
short sMaxPP = 0;
short sMaxSP = 0;

DWORD dwSkin = dSkin;
DWORD dwHair = dHair;

BYTE  cGender = (BYTE)sGender;

CBufferEx TempBuf;
TempBuf.AddString(strID);
TempBuf.Add(nSTR);
TempBuf.Add(nCON);
TempBuf.Add(nDEX);
TempBuf.Add(nVOL);
TempBuf.Add(nWIS);
TempBuf.Add(dwSkin);
TempBuf.Add(dwHair);
TempBuf.Add(cGender);
TempBuf.AddData((LPTSTR)strFace, 10);

TempBuf.Add(byClass);
TempBuf.Add(sLevel);
TempBuf.Add((short)sHP);
TempBuf.Add((short)sPP);
TempBuf.Add((short)sSP);

sMaxHP = g_sHPConst[byClass] * nCON + g_sHPLV[byClass] * (sLevel - 1) + g_sHPAdd[byClass];
sMaxPP = g_sPPConst[byClass] * nWIS + g_sPPLV[byClass] * (sLevel - 1) + g_sPPAdd[byClass];
sMaxSP = g_sSPConst[byClass] * nCON + g_sSPLV[byClass] * (sLevel - 1) + g_sSPAdd[byClass];

TempBuf.Add((short)sMaxHP);
TempBuf.Add((short)sMaxPP);
TempBuf.Add((short)sMaxSP);

// Parse Skill
CHAR szSkillBuf[3 * TOTAL_SKILL_NUM];
::ZeroMemory(szSkillBuf, sizeof(szSkillBuf));
if(!GetSkillNameLevel(byClass, (LPTSTR)strSkill, szSkillBuf)) return FALSE;

// Parse Item
TCHAR szItemBuf[2 * EQUIP_ITEM_NUM+8]; Pid, 10 = Totoal Equip Slot Count
::ZeroMemory(szItemBuf, sizeof(szItemBuf));
if(!GetEquipItemPid((LPTSTR)strItem, szItemBuf)) return FALSE;

TempBuf.AddData(szSkillBuf, 3 * TOTAL_SKILL_NUM);
TempBuf.AddData(szItemBuf, 2* EQUIP_ITEM_NUM+8);//

// Parse Item
TCHAR szItemBuf[2 * EQUIP_ITEM_NUM+2*4]; // 2 = Item Pid, 10 = Totoal Equip Slot Count
::ZeroMemory(szItemBuf, sizeof(szItemBuf));
if(!GetEquipItemPid((LPTSTR)strItem, szItemBuf))
return FALSE;

TempBuf.AddData(szSkillBuf, 3 * TOTAL_SKILL_NUM);
CHAR szSkillExBuf[3 * 5]={0x19,0x00,0x00,0x1a,0x00,0x00,0x1b,0x00,0x00,0x1c,0x00,0x00,0x18,0x00,0x00};
TempBuf.AddData(szSkillExBuf, 5*3);
TempBuf.AddData(szItemBuf, 2* EQUIP_ITEM_NUM+2*4);
// alisia - 某腐磐喊肺 嘿绢具 窍绰 辑滚啊 促甫 荐 乐栏骨肺 蝶肺蝶肺 焊辰促.
char strIPAddr[20];
strcpy( strIPAddr, pServer->m_szAddr );
TempBuf.AddString( strIPAddr );
TempBuf.Add( pServer->m_nPort ); // int
//

::CopyMemory(pBuf + index, TempBuf, TempBuf.GetLength());
index += TempBuf.GetLength();

return TRUE;
}
最新文章
推广礼包...
礼包...
选择...
经典语句-中英对照...
机械属性代码...
物品属性...
物品全部代码...
添加数据...
人物到游戏界面...
在线泡时间...
会员时间到期删除...
宠物击杀玩家给予标志...
宠物贩卖...
合成装备增加日志...
网站视频...
登录器自动练级...
脱机断线重连...
检测脚本窗口...
锁定怪物...
恭喜发财功能...
 
Copyright © 2008 -2017 决战私服网(www.shuajuezhan.com) All Rights Reserved.
本站所有游戏的版权归游戏主业所有,如无意侵犯您的权益,请联系我们,本站将会根据实际情况删除相关信息!
本站开区信息均来自互联网!游戏运营与本站无关! 苏ICP备13039161号