void CL_Init(void) { SZ_Alloc(&cls.message, 1024); CL_InitInput(); CL_InitTEnts(); // register our commands CVar::registerCVar(&cl_name); CVar::registerCVar(&cl_color); CVar::registerCVar(&cl_upspeed); CVar::registerCVar(&cl_forwardspeed); CVar::registerCVar(&cl_backspeed); CVar::registerCVar(&cl_sidespeed); CVar::registerCVar(&cl_movespeedkey); CVar::registerCVar(&cl_yawspeed); CVar::registerCVar(&cl_pitchspeed); CVar::registerCVar(&cl_anglespeedkey); CVar::registerCVar(&cl_shownet); CVar::registerCVar(&cl_nolerp); CVar::registerCVar(&lookspring); CVar::registerCVar(&lookstrafe); CVar::registerCVar(&sensitivity); CVar::registerCVar(&in_mlook); CVar::registerCVar(&m_pitch); CVar::registerCVar(&m_yaw); CVar::registerCVar(&m_forward); CVar::registerCVar(&m_side); Cmd::addCmd("entities", CL_PrintEntities_f); Cmd::addCmd("disconnect", CL_Disconnect_f); Cmd::addCmd("record", CL_Record_f); Cmd::addCmd("stop", CL_Stop_f); Cmd::addCmd("playdemo", CL_PlayDemo_f); Cmd::addCmd("timedemo", CL_TimeDemo_f); }
/* ================= CL_Init ================= */ void CL_Init(void) { SZ_Alloc(&cls.message, 1024); CL_InitInput(); CL_InitTEnts(); // // register our commands // Cvar_RegisterVariable(&cl_name); Cvar_RegisterVariable(&cl_color); Cvar_RegisterVariable(&cl_upspeed); Cvar_RegisterVariable(&cl_forwardspeed); Cvar_RegisterVariable(&cl_backspeed); Cvar_RegisterVariable(&cl_sidespeed); Cvar_RegisterVariable(&cl_movespeedkey); Cvar_RegisterVariable(&cl_yawspeed); Cvar_RegisterVariable(&cl_pitchspeed); Cvar_RegisterVariable(&cl_anglespeedkey); Cvar_RegisterVariable(&cl_shownet); Cvar_RegisterVariable(&cl_nolerp); Cvar_RegisterVariable(&lookspring); Cvar_RegisterVariable(&lookstrafe); Cvar_RegisterVariable(&sensitivity); Cvar_RegisterVariable(&m_pitch); Cvar_RegisterVariable(&m_yaw); Cvar_RegisterVariable(&m_forward); Cvar_RegisterVariable(&m_side); // Cvar_RegisterVariable (&cl_autofire); Cmd_AddCommand("entities", CL_PrintEntities_f); Cmd_AddCommand("disconnect", CL_Disconnect_f); Cmd_AddCommand("record", CL_Record_f); Cmd_AddCommand("stop", CL_Stop_f); Cmd_AddCommand("playdemo", CL_PlayDemo_f); Cmd_SetCompletion("playdemo", CL_Demo_Arg_f); Cmd_AddCommand("timedemo", CL_TimeDemo_f); Cmd_SetCompletion("timedemo", CL_Demo_Arg_f); Cmd_AddCommand("mcache", Mod_Print); }
/* <4d6b> ../engine/cmd.c:69 */ void Cbuf_Init(void) { SZ_Alloc("cmd_text", &cmd_text, MAX_CMD_BUFFER); }
/* ============ Cbuf_Init ============ */ void Cbuf_Init (void) { SZ_Alloc (&cmd_text, 8192); // space for commands and script files }
void NET_Init (void) { int i; int controlSocket; qsocket_t *s; if (COM_CheckParm("-playback")) { net_numdrivers = 1; net_drivers[0].Init = VCR_Init; } if (COM_CheckParm("-record")) recording = true; i = COM_CheckParm ("-port"); if (!i) i = COM_CheckParm ("-udpport"); if (!i) i = COM_CheckParm ("-ipxport"); if (i) { if (i < com_argc-1) DEFAULTnet_hostport = atoi (com_argv[i+1]); else Sys_Error ("NET_Init: you must specify a number after -port"); } net_hostport = DEFAULTnet_hostport; if (COM_CheckParm("-listen") || cls.state == ca_dedicated) listening = true; net_numsockets = svs.maxclientslimit; if (cls.state != ca_dedicated) net_numsockets++; SetNetTime(); for (i = 0; i < net_numsockets; i++) { s = (qsocket_t *)Hunk_AllocName(sizeof(qsocket_t), "qsocket"); s->next = net_freeSockets; net_freeSockets = s; s->disconnected = true; } // allocate space for network message buffer SZ_Alloc (&net_message, NET_MAXMESSAGE); Cvar_RegisterVariable (&net_messagetimeout); Cvar_RegisterVariable (&hostname); Cvar_RegisterVariable (&config_com_port); Cvar_RegisterVariable (&config_com_irq); Cvar_RegisterVariable (&config_com_baud); Cvar_RegisterVariable (&config_com_modem); Cvar_RegisterVariable (&config_modem_dialtype); Cvar_RegisterVariable (&config_modem_clear); Cvar_RegisterVariable (&config_modem_init); Cvar_RegisterVariable (&config_modem_hangup); #ifdef IDGODS Cvar_RegisterVariable (&idgods); #endif Cvar_RegisterVariable (&net_allowmultiple); Cmd_AddCommand ("slist", NET_Slist_f); Cmd_AddCommand ("listen", NET_Listen_f); Cmd_AddCommand ("maxplayers", MaxPlayers_f); Cmd_AddCommand ("port", NET_Port_f); // initialize all the drivers for (net_driverlevel=0 ; net_driverlevel<net_numdrivers ; net_driverlevel++) { controlSocket = net_drivers[net_driverlevel].Init(); if (controlSocket == -1) continue; net_drivers[net_driverlevel].initialized = true; net_drivers[net_driverlevel].controlSock = controlSocket; if (listening) net_drivers[net_driverlevel].Listen (true); } if (*my_ipx_address) Con_DPrintf("IPX address %s\n", my_ipx_address); if (*my_tcpip_address) Con_DPrintf("TCP/IP address %s\n", my_tcpip_address); }
void Network_Initialize(void) { int i; int controlSocket; qsocket_t *s; i = COM_CheckParm ("-port"); if (!i) i = COM_CheckParm ("-udpport"); if (!i) i = COM_CheckParm ("-ipxport"); if (i) { if (i < com_argc-1) DEFAULTnet_hostport = Q_atoi (com_argv[i+1]); else Sys_Error("You must specify a number after '-port'!"); } net_hostport = DEFAULTnet_hostport; if (COM_CheckParm("-listen") || cls.state == ca_dedicated) listening = TRUE; net_numsockets = svs.maxclientslimit; if (cls.state != ca_dedicated) net_numsockets++; SetNetTime(); for (i = 0; i < net_numsockets; i++) { s = (qsocket_t *)Hunk_AllocName(sizeof(qsocket_t), "qsocket"); s->next = net_freeSockets; net_freeSockets = s; s->disconnected = TRUE; } // allocate space for network message buffer SZ_Alloc (&net_message, NET_MAXMESSAGE); Cvar_RegisterVariable (&net_messagetimeout, NULL); Cvar_RegisterVariable (&hostname, NULL); Cvar_RegisterVariable (&config_com_port, NULL); Cvar_RegisterVariable (&config_com_irq, NULL); Cvar_RegisterVariable (&config_com_baud, NULL); Cvar_RegisterVariable (&config_com_modem, NULL); Cvar_RegisterVariable (&config_modem_dialtype, NULL); Cvar_RegisterVariable (&config_modem_clear, NULL); Cvar_RegisterVariable (&config_modem_init, NULL); Cvar_RegisterVariable (&config_modem_hangup, NULL); Cmd_AddCommand ("slist", NET_Slist_f); Cmd_AddCommand ("listen", NET_Listen_f); Cmd_AddCommand ("maxplayers", MaxPlayers_f); Cmd_AddCommand ("port", NET_Port_f); // initialize all the drivers for (net_driverlevel=0 ; net_driverlevel<net_numdrivers ; net_driverlevel++) { controlSocket = net_drivers[net_driverlevel].Init(); if (controlSocket == -1) continue; net_drivers[net_driverlevel].initialized = TRUE; net_drivers[net_driverlevel].controlSock = controlSocket; if (listening) net_drivers[net_driverlevel].Listen (TRUE); } if(*my_tcpip_address) Con_DPrintf("TCP/IP address %s\n", my_tcpip_address); }
/* * ==================== * NET_Init * ==================== */ void NET_Init(void) { int i, num_inited; int controlSocket; qsocket_t *s; i = COM_CheckParm("-port"); if (!i) i = COM_CheckParm("-udpport"); if (i) { if (i < com_argc - 1) DEFAULTnet_hostport = Q_atoi(com_argv[i + 1]); else Sys_Error("%s: you must specify a number after -port", __func__); } net_hostport = DEFAULTnet_hostport; if (COM_CheckParm("-listen") || cls.state == ca_dedicated) listening = true; net_numsockets = svs.maxclientslimit; if (cls.state != ca_dedicated) net_numsockets++; SetNetTime(); for (i = 0; i < net_numsockets; i++) { s = (qsocket_t *)Hunk_AllocName(sizeof(qsocket_t), "qsocket"); s->next = net_freeSockets; net_freeSockets = s; s->disconnected = true; } /* allocate space for network message buffer */ SZ_Alloc(&net_message, NET_MAXMESSAGE); Cvar_RegisterVariable(&net_messagetimeout); Cvar_RegisterVariable(&hostname); Cmd_AddCommand("slist", NET_Slist_f); Cmd_AddCommand("listen", NET_Listen_f); Cmd_AddCommand("maxplayers", MaxPlayers_f); Cmd_AddCommand("port", NET_Port_f); /* initialize all the drivers */ num_inited = 0; for (i = 0; i < net_numdrivers; i++) { net_driver = &net_drivers[i]; controlSocket = net_driver->Init(); if (controlSocket == -1) continue; num_inited++; net_driver->initialized = true; net_driver->controlSock = controlSocket; if (listening) net_driver->Listen(true); } if (num_inited == 0 && cls.state == ca_dedicated) Sys_Error("Network not available!"); if (*my_tcpip_address) Con_DPrintf("TCP/IP address %s\n", my_tcpip_address); }
void NET_Init (void) { int i; qsocket_t *s; i = COM_CheckParm ("-port"); if (!i) i = COM_CheckParm ("-udpport"); if (!i) i = COM_CheckParm ("-ipxport"); if (i) { if (i < com_argc-1) DEFAULTnet_hostport = Q_atoi (com_argv[i+1]); else Sys_Error ("NET_Init: you must specify a number after -port"); } net_hostport = DEFAULTnet_hostport; net_numsockets = svs.maxclientslimit; if (cls.state != ca_dedicated) net_numsockets++; if (COM_CheckParm("-listen") || cls.state == ca_dedicated) listening = true; SetNetTime(); for (i = 0; i < net_numsockets; i++) { s = (qsocket_t *)Hunk_AllocName(sizeof(qsocket_t), "qsocket"); s->next = net_freeSockets; net_freeSockets = s; s->disconnected = true; } // allocate space for network message buffer SZ_Alloc (&net_message, NET_MAXMESSAGE); Cvar_RegisterVariable (&net_messagetimeout); Cvar_RegisterVariable (&hostname); Cmd_AddCommand ("slist", NET_Slist_f); Cmd_AddCommand ("listen", NET_Listen_f); Cmd_AddCommand ("maxplayers", MaxPlayers_f); Cmd_AddCommand ("port", NET_Port_f); // initialize all the drivers for (i = net_driverlevel = 0; net_driverlevel < net_numdrivers; net_driverlevel++) { if (net_drivers[net_driverlevel].Init() == -1) continue; i++; net_drivers[net_driverlevel].initialized = true; if (listening) net_drivers[net_driverlevel].Listen (true); } /* Loop_Init() returns -1 for dedicated server case, * therefore the i == 0 check is correct */ if (i == 0 && cls.state == ca_dedicated ) { Sys_Error("Network not available!"); } if (*my_ipx_address) { Con_DPrintf("IPX address %s\n", my_ipx_address); } if (*my_tcpip_address) { Con_DPrintf("TCP/IP address %s\n", my_tcpip_address); } }