//加载站点 void CServerListCenter::LoadGameStation(IDataBase * pIDataBase) { //执行命令 pIDataBase->ClearAllParameters(); pIDataBase->SetSPName(TEXT("GSP_GP_LoadStationInfo")); pIDataBase->ExecuteCommand(true); //读取信息 tagGameStation GameStationRead; memset(&GameStationRead,0,sizeof(GameStationRead)); while (pIDataBase->IsEndRecordset()==false) { //读取信息 pIDataBase->GetFieldValue(TEXT("SortID"),GameStationRead.wSortID); pIDataBase->GetFieldValue(TEXT("KindID"),GameStationRead.wKindID); pIDataBase->GetFieldValue(TEXT("JoinID"),GameStationRead.wJoinID); pIDataBase->GetFieldValue(TEXT("StationID"),GameStationRead.wStationID); pIDataBase->GetFieldValue(TEXT("StationName"),GameStationRead.szStationName,sizeof(GameStationRead.szStationName)); pIDataBase->MoveToNext(); //插入信息 InsertGameStation(&GameStationRead); } pIDataBase->CloseRecordset(); return; }
//加载站点 void CServerListCenter::LoadGameStation(CDataBaseAide & DataBaseAide) { //执行命令 DataBaseAide.ResetParameter(); DataBaseAide.ExecuteProcess(TEXT("GSP_LoadGameNodeItem"),true); //变量定义 tagGameStation GameStationRead; ZeroMemory(&GameStationRead,sizeof(GameStationRead)); //获取数据 IDataBase * pIDataBase=(IDataBase *)DataBaseAide.GetDataBase(IID_IDataBase,VER_IDataBase); //读取信息 while (pIDataBase->IsRecordsetEnd()==false) { //读取信息 GameStationRead.wSortID=DataBaseAide.GetValue_WORD(TEXT("SortID")); GameStationRead.wKindID=DataBaseAide.GetValue_WORD(TEXT("KindID")); GameStationRead.wJoinID=DataBaseAide.GetValue_WORD(TEXT("JoinID")); GameStationRead.wStationID=DataBaseAide.GetValue_WORD(TEXT("NodeID")); DataBaseAide.GetValue_String(TEXT("NodeName"),GameStationRead.szStationName,CountArray(GameStationRead.szStationName)); //插入信息 InsertGameStation(&GameStationRead); //移动记录 pIDataBase->MoveToNext(); } //关闭记录 pIDataBase->CloseRecordset(); return; }