📄 init.c.bak
字号:
#endif#ifdef _LOOP_ANNOUNCE print("循环公告路径: %s\n",getLoopAnnouncePath()); print("循环时间间隔: %d分钟\n",getLoopAnnounceTime());#endif#ifdef _SKILLUPPOINT_CF print("每级升级点数: %d\n",getSkup());#endif#ifdef _RIDELEVEL print("骑宠等级相差: %d级\n",getRideLevel());#endif#ifdef _REVLEVEL print("还原上限等级: %s级\n",getRevLevel()); #endif#ifdef _TRANS_LEVEL_CF print("一般等级上限: %d级\n",getYBLevel()); print("最高等级上限: %d级\n",getMaxLevel()); #endif#ifdef _FIX_CHARLOOPS print("恶魔时间倍数: %d倍\n",getCharloops()); #endif#ifdef _PLAYER_ANNOUNCE if(getPAnnounce()==-1) print("喇叭消耗点数: 关闭使用\n"); else print("喇叭消耗点数: %d点\n",getPAnnounce()); #endif#ifdef _PLAYER_MOVE if(getPMove()==-1) print("顺移消耗点数: 关闭使用\n"); else print("顺移消耗点数: %d点\n",getPMove()); #endif#ifdef _BATTLE_GOLD print("战斗获得金钱: %d%\n",getBattleGold()); #endif#ifdef _ANGEL_TIME print("精灵召唤时间: (%d人/在线人数)分\n",getAngelPlayerTime()); print("精灵召唤人数: %d人\n",getAngelPlayerMun()); #endif#ifdef _RIDEMODE_20 print("2.0 骑宠模式: %d\n",getRideMode()); #endif#ifdef _FM_POINT_PK print("庄园互抢模式: %s\n",getFmPointPK()); #endif } { //andy_add 2003/05/05 check GameServer Name char *GameServerName; GameServerName = getGameserverID(); if( GameServerName == NULL || strlen( GameServerName) <= 0 ) return FALSE; print("\n游戏服务器ID: %s\n", GameServerName ); } print("开始初始化\n" ); //#define DEBUG1( arg... ) if( getDebuglevel()>1 ){##arg} print( "建立内存空间..." ); GOTORETURNFALSEIFFALSE(configmem( getMemoryunit(), getMemoryunitnum() ) ); GOTORETURNFALSEIFFALSE(memInit()); print( "完成\n" ); print( "始终化连接空间..." ); if( !initConnect(getFdnum()) ) goto MEMEND; print( "完成\n" ); while( 1 ){ print( "尝试绑定本地端口 %d... " , getPortnumber()); bindedfd = bindlocalhost( getPortnumber() ); if( bindedfd == -1 ) sleep( 10 ); else break; } print( "完成\n" ); print( "建立对象..." ); if( !initObjectArray( getObjnum()) ) goto CLOSEBIND; print( "完成\n" ); print( "建立人物..." ); if(!CHAR_initCharArray( getFdnum(), getPetcharnum(),getOtherscharnum()) ) goto CLOSEBIND; print( "完成\n" ); print( "建立物品..."); if(!ITEM_readItemConfFile( getItemfile()) ) goto CLOSEBIND; if(!ITEM_initExistItemsArray( getItemnum() ) ) goto CLOSEBIND; print( "完成\n" ); print( "建立战斗..." ); if(!BATTLE_initBattleArray( getBattlenum() ) ) goto CLOSEBIND; print( "完成\n" ); print( "建立功能模块..." ); if( !initFunctionTable() ) goto CLOSEBIND; print( "完成\n" ); print( "初始化邮件..." ); if( !PETMAIL_initOffmsgBuffer( getAddressbookoffmsgnum() )) goto CLOSEBIND; print( "完成\n" ); print( "读取不可战斗文件..." ); if( !CHAR_initInvinciblePlace( getInvfile() ) ) goto CLOSEBIND; print( "完成\n" ); print( "读取显示位置文件..." ); if( !CHAR_initAppearPosition( getAppearfile() ) ) goto CLOSEBIND; print( "完成\n" ); print( "读取头衔名称文件..." ); if( !TITLE_initTitleName( getTitleNamefile() ) ) goto CLOSEBIND; print( "完成\n" ); print( "读取头衔配置文件..." ); if( !TITLE_initTitleConfig( getTitleConfigfile() ) ) goto CLOSEBIND; print( "完成\n" ); print( "读取遇敌坐标文件..." ); if( !ENCOUNT_initEncount( getEncountfile() ) ) goto CLOSEBIND; print( "完成\n" ); print( "读取宠物基本文件..." ); if( !ENEMYTEMP_initEnemy( getEnemyBasefile() ) ) goto CLOSEBIND; print( "完成\n" ); print( "读取创建宠物文件..." ); if( !ENEMY_initEnemy( getEnemyfile() ) ) goto CLOSEBIND; print( "完成\n" ); print( "读取遇敌组群文件..." ); if( !GROUP_initGroup( getGroupfile() ) ) goto CLOSEBIND; print( "完成\n" ); print( "读取魔法文件..." ); if( !MAGIC_initMagic( getMagicfile() ) ) goto CLOSEBIND; print( "完成\n" ); #ifdef _ATTACK_MAGIC print( "读取魔法攻击文件..." ); if( !ATTMAGIC_initMagic( getAttMagicfileName() ) )// if( !ATTMAGIC_initMagic( getMagicfile() ) ) goto CLOSEBIND; print( "魔法攻击文件 -->%s..." , getAttMagicfileName()); print( "完成\n" ); #endif print( "读取宠物技能文件..." ); if( !PETSKILL_initPetskill( getPetskillfile() ) ) goto CLOSEBIND; print( "完成\n" ); /* 失奶 丞及笺 毛 戈 */ print( "读取物品成份文件..." ); if( !ITEM_initItemAtom( getItematomfile()) ) goto CLOSEBIND; print("完成\n" ); print( "初始化料理合成物品..." ); if( !ITEM_initItemIngCache() ) goto CLOSEBIND; print("完成\n" ); print( "初始料理合成随机设定..." ); if( !ITEM_initRandTable() ) goto CLOSEBIND; print("完成\n" ); print( "读取遇敌配置文件..." ); if( !CHAR_initEffectSetting( getEffectfile() ) ) goto CLOSEBIND; print( "完成\n" ); print( "读取猜迷问题文件..." ); if( !QUIZ_initQuiz( getQuizfile() ) ) goto CLOSEBIND; print( "完成\n" );#ifdef _GMRELOAD print( "读取GM配置文件..." ); if ( !LoadGMSet( getGMSetfile() ) ) goto CLOSEBIND; print( "完成\n" );#endif#ifdef _USER_EXP_CF print( "读取经验配置文件..." ); if ( !LoadEXP( getEXPfile() ) ) goto CLOSEBIND; print("最高等级: %d...",getMaxLevel()); print("一般等级: %d...",getYBLevel()); print( "完成\n" );#endif#ifdef _LOOP_ANNOUNCE print("读取循环公告文件..."); if(!loadLoopAnnounce()) print("...失败\n"); else print("完成\n");#endif#ifdef _RIDE_CF print( "读取自定义骑宠文件..." ); if(!CHAR_Ride_CF_init()) print("...失败\n"); print("完成\n");#endif#ifdef _FM_LEADER_RIDE print( "读取庄园族长专用骑宠文件..." ); if(!CHAR_FmLeaderRide_init()) print("...失败\n"); print("完成\n");#endif#ifdef _NEED_ITEM_ENEMY print( "读取融合宠配置文件..." ); if(!need_item_eneny_init()) print("...失败\n"); print("完成\n");#endif print( "建立地图..." ); if( !MAP_initReadMap( getMaptilefile() , getMapdir() )) goto CLOSEBIND; print( "完成\n" ); print( "读取NPC文件..." ); if( !NPC_readNPCSettingFiles( getNpcdir(), getNpctemplatenum(), getNpccreatenum() ) ) goto CLOSEBIND; print( "完成\n" ); print( "初始化 NPC 服务器... " ); if( lssproto_InitServer( lsrpcClientWriteFunc, LSGENWORKINGBUFFER ) < 0 ) goto CLOSEBIND; print( "完成\n" ); print( "尝试连接账号服务器... " ); acfd = connectHost( getAccountservername(), getAccountserverport()); if(acfd == -1) goto CLOSEBIND;/* { int errorcode; int errorcodelen; int qs; errorcodelen = sizeof(errorcode); qs = getsockopt( acfd, SOL_SOCKET, SO_RCVBUF , &errorcode, &errorcodelen); //andy_log print("\n\n GETSOCKOPT SO_RCVBUF: [ %d, %d, %d] \n", qs, errorcode, errorcodelen); }*/ print( "完成\n" ); initConnectOne( acfd, NULL , 0 ); if( !CONNECT_acfdInitRB( acfd)) goto CLOSEAC; if( !CONNECT_acfdInitWB( acfd)) goto CLOSEAC; CONNECT_setCtype( acfd, AC ); print( "初始化 NPC 客户端 ... " ); /* rpc(client)及赓渝祭 */ if( saacproto_InitClient( lsrpcClientWriteFunc,LSGENWORKINGBUFFER, acfd) < 0 ) goto CLOSEAC; print( "完成\n" ); print( "向账号服务器发送登陆请求... " ); /* 夫弘奶件邰菲毛请允 */ {#ifdef _VIP_ALL saacproto_ACServerLogin_send(acfd, getGameservername(), getAccountserverpasswd(), getCheckVip()*2);#else char buff[50]; sprintf(buff,"longzoro-%s-%d",getAccountserverpasswd(),123); saacproto_ACServerLogin_send(acfd, getGameservername(), buff);#endif } print( "完成\n" ); if( isExistFile( getLsgenlogfilename() ) ){ lssproto_SetServerLogFiles( getLsgenlogfilename(), getLsgenlogfilename() ); saacproto_SetClientLogFiles( getLsgenlogfilename(), getLsgenlogfilename() ); } print( "初始化已完成\n" ); print( "开始记始日志\n" ); { char logconffile[512]; snprintf( logconffile, sizeof( logconffile), "%s/%s" , getLogdir(), getLogconffile() ); if( !initLog( logconffile ) ) goto CLOSEAC; }#ifdef _ITEM_QUITPARTY print( "读取队伍解散物品消失文件..." ); //读取档案 f = fopen( getitemquitparty(), "r" ); if( f != NULL ){ while( fgets( line, sizeof( line ), f ) ){ if( line[0] == '#' )continue; if( line[0] == '\n' )continue; chomp( line ); itemquitparty_num++; } if( fseek( f, 0, SEEK_SET ) == -1 ){ print( "物品录找错误\n" ); fclose(f); goto CLOSEAC; } //配记忆体 Disappear_Item = allocateMemory( sizeof(struct tagDisappearItem) * itemquitparty_num ); if( Disappear_Item == NULL ){ print( "无法分配内存 %d\n", sizeof(struct tagDisappearItem) * itemquitparty_num ); fclose( f ); goto CLOSEAC; } i = 0; //将道具编号存入 Disappear_Item.string while( fgets( line, sizeof( line ), f ) ){ if( line[0] == '#' )continue; if( line[0] == '\n' )continue; chomp( line ); sprintf( Disappear_Item[i].string,"%s",line ); print("\n道具编号:%s", Disappear_Item[i].string ); i++; } fclose(f); }#endif DEBUG_ADJUSTTIME = 0; print( "\n" ); return TRUE;CLOSEAC: close( acfd );CLOSEBIND: close( bindedfd ); endConnect();MEMEND: memEnd();RETURNFALSE: return FALSE;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -