当前位置: 首页>>代码示例>>C++>>正文


C++ NET_Init函数代码示例

本文整理汇总了C++中NET_Init函数的典型用法代码示例。如果您正苦于以下问题:C++ NET_Init函数的具体用法?C++ NET_Init怎么用?C++ NET_Init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了NET_Init函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main ( int argc, char* argv[] )
#endif // IPHONE
{
  // int 	oldtime, newtime; // bk001204 - unused
  int   len, i;
  char  *cmdline;
  char	*cdpath, *sep;
  void Sys_SetDefaultCDPath(const char *path);

  // go back to real user for config loads
  saved_euid = geteuid();
  seteuid(getuid());

  Sys_ParseArgs( argc, argv );  // bk010104 - added this for support

  // Can't use CopyString() or Z_Free() yet:
  cdpath = strdup(argv[0]);
  if ((sep = Q_strrchr(cdpath, '/')))
    *sep = '\0';
  Sys_SetDefaultCDPath(cdpath);
  free(cdpath);

  // merge the command line, this is kinda silly
  for (len = 1, i = 1; i < argc; i++)
    len += strlen(argv[i]) + 1;
  cmdline = malloc(len);
  *cmdline = 0;
  for (i = 1; i < argc; i++)
  {
    if (i > 1)
      strcat(cmdline, " ");
    strcat(cmdline, argv[i]);
  }

  // bk000306 - clear queues
  memset( &eventQue[0], 0, MAX_QUED_EVENTS*sizeof(sysEvent_t) ); 
  memset( &sys_packetReceived[0], 0, MAX_MSGLEN*sizeof(qbyte) );

  Com_Init(cmdline);
  NET_Init();

  Sys_ConsoleInputInit();

  fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | FNDELAY);
	
#ifdef DEDICATED
	// init here for dedicated, as we don't have GLimp_Init
	InitSig();
#endif

#ifndef IPHONE
  while (1)
  {
#ifdef __linux__
    Sys_ConfigureFPU();
#endif
    Com_Frame ();
  }
#endif // !IPHONE
}
开发者ID:alexander-pick,项目名称:Quake3-HD--iPAD-,代码行数:60,代码来源:unix_main.c

示例2: TEST_Init

void TEST_Init (void)
{
	Com_SetExceptionCallback(Test_InitError);

	com_aliasSysPool = Mem_CreatePool("Common: Alias system");
	com_cmdSysPool = Mem_CreatePool("Common: Command system");
	com_cmodelSysPool = Mem_CreatePool("Common: Collision model");
	com_cvarSysPool = Mem_CreatePool("Common: Cvar system");
	com_fileSysPool = Mem_CreatePool("Common: File system");
	com_genericPool = Mem_CreatePool("Generic");

	Mem_Init();
	Cbuf_Init();
	Cmd_Init();
	Cvar_Init();
	FS_InitFilesystem(qtrue);
	FS_AddGameDirectory("./unittest", qfalse);
	Swap_Init();
	SV_Init();
	NET_Init();

	FS_ExecAutoexec();

	OBJZERO(csi);

	Com_SetExceptionCallback(Test_RunError);

	http_timeout = Cvar_Get("noname", "", 0, NULL);
	http_proxy = Cvar_Get("noname", "", 0, NULL);
}
开发者ID:kevlund,项目名称:ufoai,代码行数:30,代码来源:test_shared.c

示例3: main

int main(void)
{
	delay_init();	    	
	NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); 
	uart_init(115200);	 //串口初始化为115200
	Uart2_Init(115200);
	OLED_Init();
	LED_Init();
	OLED_Clear(); 	
	KEY_Init();//IO初始化
	TIM3_Int_Init(499,7199);//10Khz的计数频率,计数到500为50ms  
	NET_Init();
	ConnectToDevice();
	delay_ms(300);
	LED2 = 0;
	delay_ms(100);
	LED2 = 1;
	EEPROM_Init();
	// ReadLedStatusFromFlash();
	StartToUploadFlag = 1;
	while(1) 
	{		
		MainMenuIntoSubMenu();
		SwitchDetect();
	}
}
开发者ID:codywon,项目名称:stm32_for_smarthome,代码行数:26,代码来源:main.c

示例4: TEST_Init

void TEST_Init (void)
{
	try {
		com_aliasSysPool  = Mem_CreatePool("Common: Alias system");
		com_cmdSysPool    = Mem_CreatePool("Common: Command system");
		com_cmodelSysPool = Mem_CreatePool("Common: Collision model");
		com_cvarSysPool   = Mem_CreatePool("Common: Cvar system");
		com_fileSysPool   = Mem_CreatePool("Common: File system");
		com_genericPool   = Mem_CreatePool("Generic");

		Mem_Init();
		Cbuf_Init();
		Cmd_Init();
		Cvar_Init();
		FS_InitFilesystem(true);
		FS_AddGameDirectory("./unittest", false);
		FS_AddHomeAsGameDirectory("unittest", true);
		Swap_Init();
		SV_Init();
		NET_Init();

		FS_ExecAutoexec();

		OBJZERO(csi);
	} catch (comDrop_t const&) {
		Sys_Error("Error during initialization");
	}

	http_timeout = Cvar_Get("noname");
	http_proxy = Cvar_Get("noname");
	hwclass = Cvar_Get("hwclass", "5");
}
开发者ID:chagara,项目名称:ufoai,代码行数:32,代码来源:test_shared.cpp

示例5: Host_Init

/*
====================
Host_Init
====================
*/
void Host_Init (quakeparms_t *parms)
{

	if (standard_quake)
		minimum_memory = MINIMUM_MEMORY;
	else
		minimum_memory = MINIMUM_MEMORY_LEVELPAK;

	if (COM_CheckParm ("-minmemory"))
		parms->memsize = minimum_memory;

	host_parms = *parms;

	if (parms->memsize < minimum_memory)
		Sys_Error ("Only %4.1f megs of memory available, can't execute game", parms->memsize / (float)0x100000);

	com_argc = parms->argc;
	com_argv = parms->argv;

	// JPG 3.00 - moved this here
#ifdef _WIN32
	srand(time(NULL) ^ _getpid());
#else
	srand(time(NULL) ^ getpid());
#endif

	Memory_Init (parms->membase, parms->memsize);
	Cbuf_Init ();
	Cmd_Init ();
	Cvar_Init ();
	COM_Init (parms->basedir);
	Host_InitLocal ();
	W_LoadWadFile ("gfx.wad");
	Con_Init ();
	PR_Init ();
	Mod_Init ();
	Security_Init ();	// JPG 3.20 - cheat free
	NET_Init ();
	SV_Init ();
	IPLog_Init ();	// JPG 1.05 - ip address logging
	BANLog_Init ();

	Con_Printf ("Exe: "__TIME__" "__DATE__"\n");
	Con_Printf ("%4.1f megabyte heap\n",parms->memsize/ (1024*1024.0));

	R_InitTextures ();		// needed even for dedicated servers

	Cbuf_InsertText ("exec autoexec.cfg;exec server.cfg;stuffcmds;startdemos\n");

	Hunk_AllocName (0, "-HOST_HUNKLEVEL-");
	host_hunklevel = Hunk_LowMark ();

	host_initialized = true;

	Sys_Printf ("========Quake Initialized========\n");
}
开发者ID:odnarb,项目名称:manquake,代码行数:61,代码来源:host.c

示例6: qtv_net_init

static void
qtv_net_init (void)
{
	qtv_port = Cvar_Get ("qtv_port", va ("%d", PORT_QTV), 0, 0,
						 "udp port to use");
	sv_timeout = Cvar_Get ("sv_timeout", "60", 0, 0, "server timeout");
	NET_Init (qtv_port->int_val);
	Connection_Init ();
	net_realtime = &realtime;
	Netchan_Init ();
}
开发者ID:EIREXE,项目名称:Quakeforge-gcw0,代码行数:11,代码来源:qtv.c

示例7: main

int main( int argc, char* argv[] ) {
	// int  oldtime, newtime; // bk001204 - unused
	int len, i;
	char  *cmdline;
	void Sys_SetDefaultCDPath( const char *path );

	// go back to real user for config loads
	saved_euid = geteuid();
	seteuid( getuid() );

	Sys_ParseArgs( argc, argv ); // bk010104 - added this for support

	// TTimo: no CD path
	Sys_SetDefaultCDPath( "" );

	// merge the command line, this is kinda silly
	for ( len = 1, i = 1; i < argc; i++ )
		len += strlen( argv[i] ) + 1;
	cmdline = malloc( len );
	*cmdline = 0;
	for ( i = 1; i < argc; i++ )
	{
		if ( i > 1 ) {
			strcat( cmdline, " " );
		}
		strcat( cmdline, argv[i] );
	}

	// bk000306 - clear queues
	memset( &eventQue[0], 0, MAX_QUED_EVENTS * sizeof( sysEvent_t ) );
	memset( &sys_packetReceived[0], 0, MAX_MSGLEN * sizeof( byte ) );

	Com_Init( cmdline );
	NET_Init();

	Sys_ConsoleInputInit();

	fcntl( 0, F_SETFL, fcntl( 0, F_GETFL, 0 ) | FNDELAY );

#ifdef DEDICATED
	// init here for dedicated, as we don't have GLimp_Init
	InitSig();
#endif

	while ( 1 )
	{
#ifdef __linux__
		Sys_ConfigureFPU();
#endif
		Com_Frame();
	}
}
开发者ID:chegestar,项目名称:omni-bot,代码行数:52,代码来源:unix_main.c

示例8: Action_ConfigureMultiplayer

void Action_ConfigureMultiplayer(void* tag)
{
	int i;
	
	MENU_Set(MENU_MULTIPLAYER);
	engine.mode = DE_MODE_MULTIPLAYER;
	NET_Init();
	PL_ResetPlayersScore();
	
	for(i=0 ; i < MAX_NUM_PLAYERS ; i++)
		players[i].respawnCounter = numPlayerRespawn[DIFFICULTY_NORMAL];
	
	engine.difficultyLevel = DIFFICULTY_NORMAL;
}
开发者ID:shanfl,项目名称:Shmup,代码行数:14,代码来源:menu.c

示例9: main

int main ( int argc, char* argv[] )
{
  // int 	oldtime, newtime; // bk001204 - unused
	int		len, i;
	char	*cmdline;
	void Sys_SetDefaultCDPath(const char *path);

	// go back to real user for config loads
	saved_euid = geteuid();
	seteuid(getuid());

	Sys_ParseArgs( argc, argv ); 	// bk010104 - added this for support

	Sys_SetDefaultCDPath(argv[0]);

	// merge the command line, this is kinda silly
	for (len = 1, i = 1; i < argc; i++)
		len += strlen(argv[i]) + 1;
	cmdline = (char *)malloc(len);
	*cmdline = 0;
	for (i = 1; i < argc; i++) {
		if (i > 1)
			strcat(cmdline, " ");
		strcat(cmdline, argv[i]);
	}

	// bk000306 - clear queues
	memset( &eventQue[0], 0, MAX_QUED_EVENTS*sizeof(sysEvent_t) ); 
	memset( &sys_packetReceived[0], 0, MAX_MSGLEN*sizeof(byte) );

	Com_Init(cmdline);
	NET_Init();

	fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | FNDELAY);

	nostdout = Cvar_Get("nostdout", "0", 0);
	if (!nostdout->value) {
		fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | FNDELAY);
	}

    while (1) {
#ifdef __linux__
      Sys_ConfigureFPU();
#endif
        Com_Frame ();
    }
}
开发者ID:Boothand,项目名称:jk2mp,代码行数:47,代码来源:unix_main.cpp

示例10: main

int main (int argc, char **argv)
{
	int 	oldtime, newtime;
	int		len, i;
	char	*cmdline;
	void SetProgramPath(char *path);

	// go back to real user for config loads
	saved_euid = geteuid();
	seteuid(getuid());

	SetProgramPath(argv[0]);

	// merge the command line, this is kinda silly
	for (len = 1, i = 1; i < argc; i++)
		len += strlen(argv[i]) + 1;
	cmdline = (char *)malloc(len);
	*cmdline = 0;
	for (i = 1; i < argc; i++) {
		if (i > 1)
			strcat(cmdline, " ");
		strcat(cmdline, argv[i]);
	}
	Com_Init(cmdline);
#if 0
	NET_Init();
#endif

	fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | FNDELAY);

	nostdout = Cvar_Get("nostdout", "0", 0);
	if (!nostdout->value) {
		fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | FNDELAY);
//		printf ("Linux Quake -- Version %0.3f\n", LINUX_VERSION);
	}

    while (1)
    {
		// set low precision every frame, because some system calls
		// reset it arbitrarily
#if 0
		Sys_LowFPPrecision ();    
#endif

        Com_Frame ();
    }
}
开发者ID:Hasimir,项目名称:jedi-academy-1,代码行数:47,代码来源:unix_main.cpp

示例11: SV_InitNet

/*
====================
SV_InitNet
====================
*/
static void SV_InitNet (void)
{
	int	port;
	int	p;

	port = PORT_SERVER;
	p = COM_CheckParm ("-port");
	if (p && p < com_argc-1)
	{
		port = atoi(com_argv[p+1]);
		Con_Printf ("Port: %i\n", port);
	}
	NET_Init (port);

	Netchan_Init ();

	svs.last_heartbeat = -99999;	// send immediately
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:23,代码来源:sv_main.c

示例12: main

int main(int argc, char **argv)
{
    char cmdline[] = "+set sv_pure 0 +set vm_ui 0 +set vm_game 0 +set vm_cgame 0 +set fs_basepath ./app/native";
	cvar_t		*cv = NULL;
	char cmd_rundemo[100];
    Sys_SetDefaultCDPath("./app/native");

    //saved_euid = geteuid();

    // Clear the queues
    memset( &eventQue[0], 0, MAX_QUED_EVENTS*sizeof(sysEvent_t) );
    memset( &sys_packetReceived[0], 0, MAX_MSGLEN*sizeof(byte) );

    // Initialize game
    Com_Init(cmdline);
    NET_Init();

    // Start game with running demo
#if 0
    cv = Cvar_Get("rundemo", "0", 0);
    Cvar_Set("rundemo", "demo1.dm_68");
	if (strcmp(cv->string, "0")) {
        memset(cmd_rundemo, 0, sizeof(cmd_rundemo));
        sprintf(cmd_rundemo, "demo %s", cv->string, sizeof(cmd_rundemo));

        Cbuf_AddText(cmd_rundemo);

        Com_Printf(" -- starting execution --- ");

        Cbuf_Execute();
        Com_Printf(" -- execution done --- ");
	}
#endif

	while (1) {
#if 0
		Cvar_Set("nextdemo", "demo1.dm_68");
#endif
		Com_Frame( );
	}
}
开发者ID:LoudHoward,项目名称:Quake3,代码行数:41,代码来源:qnx_main.c

示例13: main

int main(int argc, char* argv[])
#endif
{
//	Z_SetFreeOSMem();

	// I'm going to kill someone. This should not be necessary. No, really.
	Direct3D_SetPushBufferSize(1024*1024, 128*1024);

	// get the initial time base
	Sys_Milliseconds();

	Win_Init();
	Com_Init( "" );

	//Start sound early.  The STL inside will allocate memory and we don't
	//want that memory in the middle of the zone.
	if ( !cls.soundRegistered ) {
		cls.soundRegistered = qtrue;
		S_BeginRegistration();
	}

	NET_Init();

	// main game loop
	while( 1 ) {
		IN_Frame();
		Com_Frame();

		// Do any XBL stuff
//		XBL_Tick();

		// Poll debug console for new commands
#ifndef FINAL_BUILD
		DebugConsoleHandleCommands();
#endif
	}

	return 0;
}
开发者ID:Hasimir,项目名称:jedi-academy-1,代码行数:39,代码来源:win_main_console.cpp

示例14: PrepareGame

void PrepareGame(void)
{

    // done before Com/Sys_Init since we need this for error output
    Sys_CreateConsole();

    // no abort/retry/fail errors
    //SetErrorMode( SEM_FAILCRITICALERRORS );

    // get the initial time base
    Sys_Milliseconds();

    Com_Init("");
    NET_Init();

    //_getcwd (cwd, sizeof(cwd));
    //Com_Printf("Working directory: %s\n", cwd);

    // hide the early console since we've reached the point where we
    // have a working graphics subsystems
    if ( !com_dedicated->integer && !com_viewlog->integer ) {
        Sys_ShowConsole( 0, qfalse );
    }
}
开发者ID:Jsoucek,项目名称:q3ce,代码行数:24,代码来源:q3ce_main.cpp

示例15: InitDevice

void InitDevice(void)
{
    IntDisableAll();
    WDT_INIT();
    Digitals_Init();  
    ItcInit();
    NVM_FlashInit();
    CRM_Init();  
    TMR_Init();
    ASM_Init();
    UART1_Init();
    UART2_Init();
    SPI_Init();
    MACA_Init(); 
    
///    DMAP_ResetStack(0);
  // WirelessHART Stack Initialisation
    NVM_ReadRecords(); // persistent data reading
    APP_Init();
    DLL_Init();   // reset the modem inside
    TL_Init();
    NET_Init();
    HART_DLL_Init(HART_ROLE_DECIDED);
  
  #if ( SHT1X_MODE != 0 )
    SHT1x_INIT();
  #endif
 
  #if ( (BOARD_TYPE == BOARD_TYPE_HART_DEV_KIT) )
    #if (!defined (IS_VN220))
      ADC_Extern_Init();
    #endif
  #endif
    
    IntEnableAll(); 
}    
开发者ID:irares,项目名称:WirelessHart-Field-Device,代码行数:36,代码来源:main.c


注:本文中的NET_Init函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。