bool SipccSdpAttributeList::Load(sdp_t* sdp, uint16_t level, SdpErrorHolder& errorHolder) { LoadSimpleStrings(sdp, level, errorHolder); LoadSimpleNumbers(sdp, level, errorHolder); LoadFlags(sdp, level); LoadDirection(sdp, level, errorHolder); if (AtSessionLevel()) { if (!LoadGroups(sdp, level, errorHolder)) { return false; } if (!LoadMsidSemantics(sdp, level, errorHolder)) { return false; } LoadIdentity(sdp, level); } else { sdp_media_e mtype = sdp_get_media_type(sdp, level); if (mtype == SDP_MEDIA_APPLICATION) { if (!LoadSctpmap(sdp, level, errorHolder)) { return false; } } else { if (!LoadRtpmap(sdp, level, errorHolder)) { return false; } } LoadCandidate(sdp, level); LoadFmtp(sdp, level); LoadMsids(sdp, level, errorHolder); LoadRtcpFb(sdp, level, errorHolder); LoadRtcp(sdp, level, errorHolder); LoadSsrc(sdp, level); if (!LoadImageattr(sdp, level, errorHolder)) { return false; } if (!LoadSimulcast(sdp, level, errorHolder)) { return false; } if (!LoadRid(sdp, level, errorHolder)) { return false; } } LoadIceAttributes(sdp, level); if (!LoadFingerprint(sdp, level, errorHolder)) { return false; } LoadSetup(sdp, level); LoadExtmap(sdp, level, errorHolder); return true; }
// // SetupInit - Initialize setup at system start // // Inputs: None. // // Outputs: None. // void SetupInit(void) { EEPROMInit(); // // If uninitialized, or if version mismatch (we're the newer version), initialize // with defaults // if( EEPROM.Version != EEPROM_CURR_VERSION ) { for( CurrSetup = 0; CurrSetup < MAX_SETUPS; CurrSetup++ ) memcpy_P(&EEPROM.Setups[CurrSetup],&SetupDefaults,sizeof(SetupDefaults)); EEPROM.Version = EEPROM_CURR_VERSION; EEPROMWrite(); } LoadSetup(0); }
/************************************************* Function: void SetupModule(SetUp *setinfo) Description: 设置模块 Calls: // 被本函数调用的函数清单 Called By: // 调用本函数的函数清单 Table Accessed: // 被访问的表(此项仅对于牵扯到数据库操作的程序) Table Updated: // 被修改的表(此项仅对于牵扯到数据库操作的程序) Input: // 输入参数说明,包括每个参数的作 // 用、取值说明及参数间关系。 Output: // 对输出参数的说明。 Return: // 函数返回值的说明 Others: *************************************************/ void SetupModule(SetUp *setinfo) { INTERFACE_COLOR_3; setinfo=LoadSetup(); Displaysetup(setinfo); printf("\n\nDo you want to set up?:[ ]\b\b"); if (YesOrNo()==YES) { printf("\ntime(1~5):"); setinfo->speaktime=Select(1,5); printf("\ndelay(s):"); setinfo->speakdelay=Select(1,10)*1000; printf("\nautospeak(y/n):[ ]\b\b"); setinfo->autospeak=YesOrNo(); printf("\nautoback(y/n):[ ]\b\b"); setinfo->autoback=YesOrNo(); printf("\nautoinsearch(y/n):[ ]\b\b"); setinfo->autoinsearch=YesOrNo(); //lack () system("cls"); Displaysetup(setinfo); printf("\nDo you want to save it?:[ ]\b\b"); if (YesOrNo()==YES) { SaveSetup(setinfo); return; } else { return; } } else { printf("\nPress any key to back..."); getche(); return; } }
bool NetHandler::Init() { m_ServerInitSendFlag = NF_NULL; // 加载 [Setup.ini], [LogSetup.ini], [SetupEx.ini]及 [ServerSetup.ini] 配置 if (!LoadSetup()) { return false; } InitNetEnv(); // 创建服务器端 if (!InitNetServer()) { return false; } // 连接到LogServer if (0 == m_serverSetup.useLogServer) { Log4c::Warn(ROOT_MODULE,FormatText("GAME_NET_SERVERINVALID", "LogServer")); } else { ConnectServer(NF_LOG_SERVER); } ConnectServer(NF_DB_SERVER); // 连接到DBServer ConnectServer(NF_LOGIN_SERVER); // 连接到LoginServer // 装载内存影射文件配置 LoadMapFileSetup(); CSMClient::GetSM()->InitOk(); return true; }
/************************************************* Function:主函数 Description: 调用各模块 Calls: // 被本函数调用的函数清单 Called By: // 调用本函数的函数清单 Input: // 输入参数说明,包括每个参数的作 // 用、取值说明及参数间关系。 Output: // 对输出参数的说明。 Return: // 函数返回值的说明 Others: *************************************************/ void main() { WorData *alphabet[26]={NULL}; int chioce=1; int loaded = NO; SetUp *setinfo=NULL; //参数要初始化 INTERFACE_COLOR_3; system("title MyPowerWord LinSoft"); system("mode con cols=90 lines=35"); if (Loading(alphabet) == NO) { printf("\nLoading Error 000"); return; } else { loaded = YES; } setinfo=LoadSetup(); if (setinfo->autoinsearch==YES) { system("cls"); printf("\nDo you want to set?(y/n):[ ]\b\b"); if (YesOrNo() == YES) { SetupModule(setinfo); } if (loaded == NO) { if (Loading(alphabet) == NO) { printf("\nLoading Error 001"); return; } } SearchMoulde(alphabet,setinfo); } else { while (1) //5.26 add { system("cls"); printf("\n\n\n1.Search\n2.Set up\n3.exit\n"); printf("Input you chioce:"); chioce=Select(1,3); switch(chioce) { case 1: { SearchMoulde(alphabet,setinfo); return; } case 2: { SetupModule(setinfo); break; } case 3:return; } } } //Destroy(alphabet); }
bool SetupCmd(char *Command) { // // MO - Mode command // if( StrEQ(Command,"MO") ) { ModeCmd(ParseToken()); return true; } // // LS - Save setup // if( StrEQ(Command,"LS") ) { char *SetupText = ParseToken(); int SetupNum = atoi(SetupText); if( !strlen(SetupText) ) SetupNum = CurrSetup; LoadSetup(SetupNum); StartMsg(); PrintStringP(PSTR("Loaded setup ")); PrintD(CurrSetup,0); // == %d return true; } // // PS - Print current setup // if( StrEQ(Command,"PS") ) { char *SetupText = ParseToken(); int SetupNum = atoi(SetupText); if( !strlen(SetupText) ) PrintSetup(-1 ,&TransducerSet); else PrintSetup(SetupNum,&EEPROM.Setups[SetupNum].Setup); return true; } // // SS - Save current setup // if( StrEQ(Command,"SS") ) { char *SetupText = ParseToken(); int SetupNum = atoi(SetupText); if( !strlen(SetupText) ) SetupNum = CurrSetup; SaveSetup(SetupNum); StartMsg(); PrintStringP(PSTR("Saved as setup ")); PrintD(CurrSetup,SetupNum); // == %d return true; } return false; }
void Aquarium::begin() { setDisplay(new DisplayMain); // start with main display LoadSetup(); }
BOOL CGame::Init() { // 创建日志保存目录 CreateDirectory("log", NULL); //#ifdef _RUNSTACKINFO_ // InitStackFileName(); //#endif srand((unsigned)time(NULL)); random(100); PutDebugString("Server start!!!"); // 装载资源 LoadServerResource(); if(!LoadSetup()) { return FALSE; } // 加载GameServer配置 if(!LoadGSSetup("GSSetup.ini")) { return FALSE; } // 初始化CMyAdoBase CMyAdoBase::Initialize(m_tgSetup.strSqlConType, m_tgSetup.strSqlServerIP, m_tgSetup.strDBName, m_tgSetup.strSqlUserName, m_tgSetup.strSqlPassWord); m_pRsBouns = new CRsBouns(); if(m_pRsBouns->LoadBounsDes(m_mapBounsDes) == S_OK ) { AddLogText("加载奖励资源表成功!"); } else { MessageBox(g_hWnd, "Load Bouns Failed!", "Message", MB_OK); return FALSE; } // 分配数据块 m_pDBAllocator = new CDataBlockAllocator(m_tgSetup.dwDataBlockNum, m_tgSetup.dwDataBlockSize); GetGame()->GetBounsDBManager()->InitOperThread(m_tgSetup.strSqlConType, m_tgSetup.strSqlServerIP, m_tgSetup.strDBName, m_tgSetup.strSqlUserName, m_tgSetup.strSqlPassWord); CMessage::Initial(m_pDBAllocator, m_tgSetup.dwFreeMsgNum); // 初始化服务器网络 CMySocket::MySocketInit(); // 装载内存影射文件配置 //LoadMapFileSetup(); // 创建服务器端 if( !InitNetServer() ) { MessageBox(g_hWnd, "Initial NetServer failed!", "Message", MB_OK); return FALSE; } // 开始监听 if( !StartAccept() ) { return FALSE; } //// 日志服务器 //if( m_tgSetup.lUseLogServer == 0 ) //{ // AddLogText("连接LogServer配置为不连接,日志服务将不能使用!"); //} //else //{ // if( !StartConnectLogServer() ) // { // AddLogText("Connect LogServer Failed!"); // CreateConnectLogThread(); // } // else // { // AddLogText("Connect LogServer Successfully!"); // } //} return TRUE; }