mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 07:11:41 +00:00
Code style, people. Love it or leave it!
This commit is contained in:
parent
16eac174e6
commit
5fb8aa07f3
26 changed files with 400 additions and 414 deletions
|
@ -188,7 +188,7 @@ Cam_Lock (int playernum)
|
|||
|
||||
snprintf (st, sizeof (st), "ptrack %i", playernum);
|
||||
if (cls.demoplayback2) {
|
||||
memcpy(cl.stats, cl.players[playernum].stats, sizeof (cl.stats));
|
||||
memcpy (cl.stats, cl.players[playernum].stats, sizeof (cl.stats));
|
||||
}
|
||||
|
||||
if (!cls.demoplayback) {
|
||||
|
@ -350,7 +350,7 @@ InitFlyby (player_state_t * self, player_state_t * player, int checkvis)
|
|||
}
|
||||
// ack, can't find him
|
||||
if (max >= 1000) {
|
||||
// Cam_Unlock();
|
||||
// Cam_Unlock ();
|
||||
return false;
|
||||
}
|
||||
locked = true;
|
||||
|
@ -623,7 +623,7 @@ Cam_FinishMove (usercmd_t *cmd)
|
|||
}
|
||||
oldbuttons |= BUTTON_JUMP; // don't jump again until released
|
||||
}
|
||||
// Con_Printf("Selecting track target...\n");
|
||||
// Con_Printf ("Selecting track target...\n");
|
||||
|
||||
if (locked && autocam)
|
||||
end = (spec_track + 1) % MAX_CLIENTS;
|
||||
|
|
|
@ -406,8 +406,8 @@ CL_GetMessage (void)
|
|||
return false;
|
||||
|
||||
if (net_packetlog->int_val)
|
||||
Log_Incoming_Packet(net_message->message->data,
|
||||
net_message->message->cursize, 1);
|
||||
Log_Incoming_Packet (net_message->message->data,
|
||||
net_message->message->cursize, 1);
|
||||
|
||||
CL_WriteDemoMessage (net_message->message);
|
||||
|
||||
|
@ -965,7 +965,7 @@ CL_FinishTimeDemo (void)
|
|||
Con_Printf ("%i frames %5.2f seconds %5.2f fps\n", frames, time,
|
||||
frames / time);
|
||||
|
||||
CL_TimeFrames_DumpLog();
|
||||
CL_TimeFrames_DumpLog ();
|
||||
cl_timeframes_isactive = 0;
|
||||
|
||||
timedemo_count--;
|
||||
|
@ -1050,7 +1050,7 @@ void
|
|||
CL_TimeFrames_Reset (void)
|
||||
{
|
||||
cl_timeframes_index = 0;
|
||||
free(cl_timeframes_array);
|
||||
free (cl_timeframes_array);
|
||||
cl_timeframes_array = NULL;
|
||||
}
|
||||
|
||||
|
@ -1060,7 +1060,7 @@ CL_TimeFrames_AddTimestamp (void)
|
|||
if (cl_timeframes_isactive) {
|
||||
if (!(cl_timeframes_index % CL_TIMEFRAMES_ARRAYBLOCK))
|
||||
cl_timeframes_array = realloc
|
||||
(cl_timeframes_array, sizeof(cl_timeframes_array[0]) *
|
||||
(cl_timeframes_array, sizeof (cl_timeframes_array[0]) *
|
||||
((cl_timeframes_index / CL_TIMEFRAMES_ARRAYBLOCK) + 1) *
|
||||
CL_TIMEFRAMES_ARRAYBLOCK);
|
||||
if (cl_timeframes_array == NULL)
|
||||
|
|
|
@ -519,7 +519,7 @@ CL_LinkPacketEntities (void)
|
|||
(*ent)->angles[1] = anglemod (100 * cl.time);
|
||||
(*ent)->angles[2] = 0;
|
||||
} else {
|
||||
VectorCopy(s1->angles, (*ent)->angles);
|
||||
VectorCopy (s1->angles, (*ent)->angles);
|
||||
}
|
||||
|
||||
// add automatic particle trails
|
||||
|
@ -682,10 +682,10 @@ CL_ParsePlayerinfo (void)
|
|||
cls.findtrack = false;
|
||||
}
|
||||
|
||||
memcpy(state, prevstate, sizeof(player_state_t));
|
||||
memcpy (state, prevstate, sizeof (player_state_t));
|
||||
|
||||
flags = MSG_ReadShort (net_message);
|
||||
state->flags = TranslateFlags(flags);
|
||||
state->flags = TranslateFlags (flags);
|
||||
state->messagenum = cl.parsecount;
|
||||
state->command.msec = 0;
|
||||
state->frame = MSG_ReadByte (net_message);
|
||||
|
@ -1076,7 +1076,7 @@ CL_SetUpPlayerPrediction (qboolean dopred)
|
|||
CL_SetSolid
|
||||
|
||||
Builds all the pmove physents for the current frame
|
||||
Note that CL_SetUpPlayerPrediction() must be called first!
|
||||
Note that CL_SetUpPlayerPrediction () must be called first!
|
||||
pmove must be setup with world and solid entity hulls before calling
|
||||
(via CL_PredictMove)
|
||||
*/
|
||||
|
|
|
@ -580,7 +580,7 @@ CL_FullServerinfo_f (void)
|
|||
return;
|
||||
}
|
||||
|
||||
Con_DPrintf ("Cmd_Argv(1): '%s'\n", Cmd_Argv (1));
|
||||
Con_DPrintf ("Cmd_Argv (1): '%s'\n", Cmd_Argv (1));
|
||||
Info_Destroy (cl.serverinfo);
|
||||
cl.serverinfo = Info_ParseString (Cmd_Argv (1), MAX_SERVERINFO_STRING, 0);
|
||||
Con_DPrintf ("cl.serverinfo: '%s'\n", Info_MakeString (cl.serverinfo, 0));
|
||||
|
@ -936,9 +936,9 @@ CL_ConnectionlessPacket (void)
|
|||
// print command from somewhere
|
||||
if (c == A2C_PRINT) {
|
||||
s = MSG_ReadString (net_message);
|
||||
if (SL_CheckStatus(NET_AdrToString (net_from), s))
|
||||
if (SL_CheckStatus (NET_AdrToString (net_from), s))
|
||||
{
|
||||
Con_Printf("status response\n");
|
||||
Con_Printf ("status response\n");
|
||||
return;
|
||||
} else if (!cls.demoplayback
|
||||
&& (cl_paranoid->int_val
|
||||
|
@ -987,10 +987,10 @@ CL_ConnectionlessPacket (void)
|
|||
|
||||
if (c == M2C_MASTER_REPLY)
|
||||
{
|
||||
Con_Printf("Master Server Reply\n");
|
||||
Con_Printf ("Master Server Reply\n");
|
||||
clcp_temp = MSG_ReadByte (net_message);
|
||||
s = MSG_ReadString (net_message);
|
||||
MSL_ParseServerList(s);
|
||||
MSL_ParseServerList (s);
|
||||
return;
|
||||
}
|
||||
if (c == svc_disconnect) {
|
||||
|
@ -1013,8 +1013,8 @@ CL_ReadPackets (void)
|
|||
continue;
|
||||
|
||||
if (cls.demoplayback && net_packetlog->int_val)
|
||||
Log_Incoming_Packet(net_message->message->data,
|
||||
net_message->message->cursize, 0);
|
||||
Log_Incoming_Packet (net_message->message->data,
|
||||
net_message->message->cursize, 0);
|
||||
|
||||
// remote command packet
|
||||
if (*(int *) net_message->message->data == -1) {
|
||||
|
@ -1752,7 +1752,7 @@ Host_Init (void)
|
|||
Key_Init (cl_cbuf);
|
||||
Mod_Init ();
|
||||
|
||||
CL_Demo_Init();
|
||||
CL_Demo_Init ();
|
||||
|
||||
Con_Printf ("%4.1f megabyte heap.\n", cl_mem_size->value);
|
||||
|
||||
|
|
|
@ -488,7 +488,7 @@ CL_ParseDownload (void)
|
|||
}
|
||||
// open the file if not opened yet
|
||||
if (!cls.download) {
|
||||
dstring_t *name = dstring_newstr();
|
||||
dstring_t *name = dstring_newstr ();
|
||||
const char *fname, *path;
|
||||
|
||||
if (strncmp (cls.downloadtempname, "skins/", 6) == 0) {
|
||||
|
@ -769,7 +769,7 @@ CL_ParseSoundlist (void)
|
|||
int numsounds, n;
|
||||
|
||||
// precache sounds
|
||||
// memset (cl.sound_precache, 0, sizeof(cl.sound_precache));
|
||||
// memset (cl.sound_precache, 0, sizeof (cl.sound_precache));
|
||||
|
||||
numsounds = MSG_ReadByte (net_message);
|
||||
|
||||
|
@ -1123,7 +1123,7 @@ CL_SetStat (int stat, int value)
|
|||
break;
|
||||
case STAT_HEALTH:
|
||||
if (cl_player_health_e->func)
|
||||
GIB_Event_Callback (cl_player_health_e, 1, va("%i", value));
|
||||
GIB_Event_Callback (cl_player_health_e, 1, va ("%i", value));
|
||||
if (value <= 0)
|
||||
Team_Dead ();
|
||||
break;
|
||||
|
@ -1164,7 +1164,9 @@ CL_MuzzleFlash (void)
|
|||
dl->color[2] = 0.05;
|
||||
}
|
||||
|
||||
#define SHOWNET(x) if (cl_shownet->int_val == 2) Con_Printf ("%3i:%s\n", net_message->readcount-1, x);
|
||||
#define SHOWNET(x) \
|
||||
if (cl_shownet->int_val == 2) \
|
||||
Con_Printf ("%3i:%s\n", net_message->readcount-1, x);
|
||||
|
||||
int received_framecount;
|
||||
|
||||
|
@ -1247,7 +1249,7 @@ CL_ParseServerMessage (void)
|
|||
S_LocalSound ("misc/talk.wav");
|
||||
if (cl_chat_e->func)
|
||||
GIB_Event_Callback (cl_chat_e, 1, s);
|
||||
Team_ParseChat(s);
|
||||
Team_ParseChat (s);
|
||||
}
|
||||
Con_Printf ("%s", s);
|
||||
Con_SetOrMask (0);
|
||||
|
@ -1271,7 +1273,7 @@ CL_ParseServerMessage (void)
|
|||
} else {
|
||||
Con_DPrintf ("partial stufftext: %s\n", s);
|
||||
if (!stuffbuf)
|
||||
stuffbuf = dstring_newstr();
|
||||
stuffbuf = dstring_newstr ();
|
||||
dstring_appendstr (stuffbuf, s);
|
||||
}
|
||||
break;
|
||||
|
@ -1422,7 +1424,7 @@ CL_ParseServerMessage (void)
|
|||
break;
|
||||
|
||||
case svc_finale:
|
||||
Con_Printf("svc_finale\n");
|
||||
Con_Printf ("svc_finale\n");
|
||||
cl.intermission = 2;
|
||||
cl.completed_time = realtime;
|
||||
vid.recalc_refdef = true; // go to full screen
|
||||
|
|
|
@ -184,8 +184,8 @@ CL_PredictMove (void)
|
|||
if (to->senttime == from->senttime)
|
||||
f = 0;
|
||||
else
|
||||
f = bound(0, (cl.time - from->senttime) /
|
||||
(to->senttime - from->senttime), 1);
|
||||
f = bound (0, (cl.time - from->senttime) /
|
||||
(to->senttime - from->senttime), 1);
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
if (fabs (from->playerstate[cl.playernum].origin[i] -
|
||||
|
|
|
@ -238,13 +238,13 @@ CL_NewTranslation (int slot, skin_t *skin)
|
|||
Skin_Find (player);
|
||||
memcpy (skin, player->skin, sizeof (*skin));
|
||||
skin->texture = skin_textures + slot; // FIXME
|
||||
skin->data.texels = Skin_Cache(player->skin);
|
||||
skin->data.texels = Skin_Cache (player->skin);
|
||||
// FIXME: breaks cache ownership
|
||||
Skin_Do_Translation (player->skin, slot, skin);
|
||||
} else {
|
||||
memcpy (skin, player->skin, sizeof (*skin));
|
||||
skin->texture = skin_textures + slot; // FIXME
|
||||
skin->data.texels = Skin_Cache(player->skin);
|
||||
skin->data.texels = Skin_Cache (player->skin);
|
||||
// FIXME: breaks cache ownership
|
||||
}
|
||||
}
|
||||
|
|
|
@ -139,7 +139,7 @@ SL_Add (server_entry_t *start, const char *ip, const char *desc)
|
|||
}
|
||||
|
||||
for (p = start; p->next; p = p->next) //Get to end of list
|
||||
if (strcmp(ip,p->server) == 0) //don't add duplicate
|
||||
if (strcmp (ip, p->server) == 0) //don't add duplicate
|
||||
return (start);
|
||||
|
||||
p->next = calloc (1, sizeof (server_entry_t));
|
||||
|
@ -230,23 +230,21 @@ static int
|
|||
SL_CheckFilter (server_entry_t *sl_filteritem)
|
||||
{
|
||||
if (!sl_filter->int_val)
|
||||
return(1);
|
||||
return (1);
|
||||
if (!sl_filteritem->status)
|
||||
return(0);
|
||||
if (strlen(sl_game->string))
|
||||
{
|
||||
if (strcasecmp(Info_ValueForKey (sl_filteritem->status, "*gamedir"),
|
||||
sl_game->string) != 0)
|
||||
return(0);
|
||||
return (0);
|
||||
if (strlen (sl_game->string)) {
|
||||
if (strcasecmp (Info_ValueForKey (sl_filteritem->status, "*gamedir"),
|
||||
sl_game->string) != 0)
|
||||
return (0);
|
||||
}
|
||||
if (sl_ping->int_val)
|
||||
{
|
||||
if (sl_ping->int_val) {
|
||||
if (!sl_filteritem->pongback)
|
||||
return(0);
|
||||
if (((int)(sl_filteritem->pongback * 1000)) >= sl_ping->int_val)
|
||||
return(0);
|
||||
return (0);
|
||||
if (((int) (sl_filteritem->pongback * 1000)) >= sl_ping->int_val)
|
||||
return (0);
|
||||
}
|
||||
return(1);
|
||||
return (1);
|
||||
}
|
||||
|
||||
static server_entry_t *
|
||||
|
@ -256,7 +254,7 @@ SL_Get_By_Num (server_entry_t *start, int n)
|
|||
|
||||
for (i = 0; i <= n; i++)
|
||||
{
|
||||
if(!start)
|
||||
if (!start)
|
||||
break;
|
||||
if (!SL_CheckFilter (start))
|
||||
i--;
|
||||
|
@ -380,25 +378,21 @@ SL_SortEntry (server_entry_t *start)
|
|||
if (!start || !sl_sortby)
|
||||
return;
|
||||
|
||||
for (q = start->next; q; q = q->next)
|
||||
{
|
||||
if (sl_sortby->int_val)
|
||||
{
|
||||
for (q = start->next; q; q = q->next) {
|
||||
if (sl_sortby->int_val) {
|
||||
if ((q->pongback) && (start->pongback) && (start->pongback >
|
||||
q->pongback))
|
||||
{
|
||||
SL_Swap(start,q);
|
||||
q->pongback)) {
|
||||
SL_Swap (start, q);
|
||||
q = start;
|
||||
}
|
||||
} else {
|
||||
i = 0;
|
||||
|
||||
while ((start->desc[i] != '\0') && (q->desc[i] != '\0') &&
|
||||
(toupper(start->desc[i]) == toupper(q->desc[i])))
|
||||
(toupper (start->desc[i]) == toupper (q->desc[i])))
|
||||
i++;
|
||||
if (toupper(start->desc[i]) > toupper(q->desc[i]))
|
||||
{
|
||||
SL_Swap(start,q);
|
||||
if (toupper (start->desc[i]) > toupper (q->desc[i])) {
|
||||
SL_Swap (start, q);
|
||||
q = start;
|
||||
}
|
||||
}
|
||||
|
@ -422,15 +416,14 @@ SL_Con_List (server_entry_t *sldata)
|
|||
{
|
||||
int serv;
|
||||
server_entry_t *cp;
|
||||
|
||||
SL_Sort(sl_sortby);
|
||||
|
||||
for(serv = 0; serv < SL_Len (sldata); serv++)
|
||||
{
|
||||
|
||||
SL_Sort (sl_sortby);
|
||||
|
||||
for (serv = 0; serv < SL_Len (sldata); serv++) {
|
||||
cp = SL_Get_By_Num (sldata, serv);
|
||||
if (!cp)
|
||||
break;
|
||||
Con_Printf("%i) %s\n",(serv + 1),cp->desc);
|
||||
Con_Printf ("%i) %s\n", (serv + 1), cp->desc);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -439,7 +432,7 @@ SL_Connect (server_entry_t *sldata, int slitemno)
|
|||
{
|
||||
CL_Disconnect ();
|
||||
strncpy (cls.servername, SL_Get_By_Num (sldata, (slitemno - 1))->server,
|
||||
sizeof (cls.servername) - 0);
|
||||
sizeof (cls.servername) - 0);
|
||||
CL_BeginServerConnect ();
|
||||
}
|
||||
|
||||
|
@ -470,37 +463,36 @@ SL_Con_Details (server_entry_t *sldata, int slitemno)
|
|||
cp = SL_Get_By_Num (sldata, (slitemno - 1));
|
||||
if (!cp)
|
||||
return;
|
||||
Con_Printf("Server: %s\n", cp->server);
|
||||
Con_Printf("Ping: ");
|
||||
Con_Printf ("Server: %s\n", cp->server);
|
||||
Con_Printf ("Ping: ");
|
||||
if (cp->pongback)
|
||||
Con_Printf("%i\n", (int)(cp->pongback * 1000));
|
||||
Con_Printf ("%i\n", (int) (cp->pongback * 1000));
|
||||
else
|
||||
Con_Printf("N/A\n");
|
||||
if (cp->status)
|
||||
{
|
||||
Con_Printf ("N/A\n");
|
||||
if (cp->status) {
|
||||
char *s;
|
||||
|
||||
Con_Printf("Name: %s\n", cp->desc);
|
||||
Con_Printf("Game: %s\n", Info_ValueForKey (cp->status, "*gamedir"));
|
||||
Con_Printf("Map: %s\n", Info_ValueForKey (cp->status, "map"));
|
||||
Con_Printf ("Name: %s\n", cp->desc);
|
||||
Con_Printf ("Game: %s\n", Info_ValueForKey (cp->status, "*gamedir"));
|
||||
Con_Printf ("Map: %s\n", Info_ValueForKey (cp->status, "map"));
|
||||
|
||||
s = Info_MakeString (cp->status, 0);
|
||||
for (i = 0; i < strlen (s); i++)
|
||||
if (s[i] == '\n')
|
||||
playercount++;
|
||||
Con_Printf("Players: %i/%s\n", playercount,
|
||||
Info_ValueForKey(cp->status, "maxclients"));
|
||||
Con_Printf ("Players: %i/%s\n", playercount,
|
||||
Info_ValueForKey (cp->status, "maxclients"));
|
||||
} else
|
||||
Con_Printf("No Details Available\n");
|
||||
Con_Printf ("No Details Available\n");
|
||||
}
|
||||
|
||||
static void
|
||||
SL_MasterUpdate(void)
|
||||
SL_MasterUpdate (void)
|
||||
{
|
||||
char data[] = "c\n\0";
|
||||
netadr_t addy;
|
||||
|
||||
SL_Del_All(slist);
|
||||
SL_Del_All (slist);
|
||||
slist = NULL;
|
||||
NET_StringToAdr ("194.251.249.32:27000", &addy);
|
||||
Netchan_SendPacket (3, data, addy);
|
||||
|
@ -523,8 +515,7 @@ SL_MasterUpdate(void)
|
|||
static int
|
||||
SL_Switch (void)
|
||||
{
|
||||
if (!which_slist)
|
||||
{
|
||||
if (!which_slist) {
|
||||
fav_slist = slist;
|
||||
slist = all_slist;
|
||||
which_slist = 1;
|
||||
|
@ -543,77 +534,65 @@ SL_Command (void)
|
|||
int sltemp = 0;
|
||||
|
||||
if (Cmd_Argc () == 1)
|
||||
SL_Con_List(slist);
|
||||
else if (strcasecmp(Cmd_Argv(1),"switch") == 0)
|
||||
{
|
||||
SL_Con_List (slist);
|
||||
else if (strcasecmp (Cmd_Argv (1), "switch") == 0) {
|
||||
if (SL_Switch ())
|
||||
Con_Printf("Switched to Server List from Masters\n");
|
||||
Con_Printf ("Switched to Server List from Masters\n");
|
||||
else
|
||||
Con_Printf("Switched to Favorite Server List\n");
|
||||
}
|
||||
else if (strcasecmp(Cmd_Argv(1),"refresh") == 0)
|
||||
{
|
||||
Con_Printf ("Switched to Favorite Server List\n");
|
||||
} else if (strcasecmp (Cmd_Argv (1), "refresh") == 0) {
|
||||
if (Cmd_Argc () == 2)
|
||||
SL_Update(slist);
|
||||
SL_Update (slist);
|
||||
else
|
||||
Con_Printf("Syntax: slist refresh\n");
|
||||
}
|
||||
else if (strcasecmp(Cmd_Argv(1),"update") == 0)
|
||||
{
|
||||
if (Cmd_Argc () == 2)
|
||||
{
|
||||
if(!which_slist)
|
||||
Con_Printf("ERROR: This of for updating the servers from a "
|
||||
"list of masters\n");
|
||||
Con_Printf ("Syntax: slist refresh\n");
|
||||
} else if (strcasecmp (Cmd_Argv (1),"update") == 0) {
|
||||
if (Cmd_Argc () == 2) {
|
||||
if (!which_slist)
|
||||
Con_Printf ("ERROR: This of for updating the servers from a "
|
||||
"list of masters\n");
|
||||
else
|
||||
SL_MasterUpdate();
|
||||
}
|
||||
else
|
||||
Con_Printf("Syntax: slist update\n");
|
||||
}
|
||||
else if (strcasecmp(Cmd_Argv(1),"connect") == 0)
|
||||
{
|
||||
if (Cmd_Argc () == 3)
|
||||
{
|
||||
sltemp = atoi(Cmd_Argv(2));
|
||||
if(sltemp && (sltemp <= SL_Len (slist)))
|
||||
SL_Connect(slist,sltemp);
|
||||
SL_MasterUpdate ();
|
||||
} else
|
||||
Con_Printf ("Syntax: slist update\n");
|
||||
} else if (strcasecmp (Cmd_Argv (1), "connect") == 0) {
|
||||
if (Cmd_Argc () == 3) {
|
||||
sltemp = atoi (Cmd_Argv (2));
|
||||
if (sltemp && (sltemp <= SL_Len (slist)))
|
||||
SL_Connect (slist, sltemp);
|
||||
else
|
||||
Con_Printf("Error: Invalid Server Number -> %s\n",Cmd_Argv(2));
|
||||
}
|
||||
else if ((Cmd_Argc () == 2) && slist_last_details)
|
||||
SL_Connect(slist,slist_last_details);
|
||||
Con_Printf ("Error: Invalid Server Number -> %s\n",
|
||||
Cmd_Argv (2));
|
||||
} else if ((Cmd_Argc () == 2) && slist_last_details)
|
||||
SL_Connect (slist, slist_last_details);
|
||||
else
|
||||
Con_Printf("Syntax: slist connect #\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
sltemp = atoi(Cmd_Argv(1));
|
||||
if((Cmd_Argc () == 2) && sltemp && (sltemp <= SL_Len (slist)))
|
||||
SL_Con_Details(slist,sltemp);
|
||||
Con_Printf ("Syntax: slist connect #\n");
|
||||
} else {
|
||||
sltemp = atoi (Cmd_Argv (1));
|
||||
if ((Cmd_Argc () == 2) && sltemp && (sltemp <= SL_Len (slist)))
|
||||
SL_Con_Details (slist, sltemp);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MSL_ParseServerList(const char *msl_data)
|
||||
MSL_ParseServerList (const char *msl_data)
|
||||
{
|
||||
int msl_ptr;
|
||||
|
||||
for (msl_ptr = 0; msl_ptr < strlen(msl_data); msl_ptr = msl_ptr + 6)
|
||||
{
|
||||
slist = SL_Add(slist, va("%i.%i.%i.%i:%i",
|
||||
(byte)msl_data[msl_ptr],
|
||||
(byte)msl_data[msl_ptr+1],
|
||||
(byte)msl_data[msl_ptr+2],
|
||||
(byte)msl_data[msl_ptr+3],
|
||||
((byte)msl_data[msl_ptr+4]<<8)|(byte)msl_data[msl_ptr+5]), NULL);
|
||||
for (msl_ptr = 0; msl_ptr < strlen (msl_data); msl_ptr = msl_ptr + 6) {
|
||||
slist = SL_Add (slist, va ("%i.%i.%i.%i:%i",
|
||||
(byte) msl_data[msl_ptr],
|
||||
(byte) msl_data[msl_ptr+1],
|
||||
(byte) msl_data[msl_ptr+2],
|
||||
(byte) msl_data[msl_ptr+3],
|
||||
((byte) msl_data[msl_ptr + 4] << 8)
|
||||
| (byte) msl_data[msl_ptr + 5]), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static server_entry_t *
|
||||
SL_LoadF (QFile *f, server_entry_t *start)
|
||||
{
|
||||
//This could get messy
|
||||
// This could get messy
|
||||
char line[256]; /* Long lines get truncated. */
|
||||
char *addr, *st;
|
||||
int len, i;
|
||||
|
@ -669,8 +648,8 @@ SL_Init (void)
|
|||
fav_slist = slist;
|
||||
all_slist = NULL;
|
||||
which_slist = 0;
|
||||
Cmd_AddCommand("slist",SL_Command,"console commands to access server "
|
||||
"list\n");
|
||||
Cmd_AddCommand ("slist", SL_Command, "console commands to access server "
|
||||
"list\n");
|
||||
sl_sortby = Cvar_Get ("sl_sortby", "0", CVAR_ARCHIVE, SL_Sort, "0 = sort "
|
||||
"by name, 1 = sort by ping");
|
||||
sl_filter = Cvar_Get ("sl_filter", "0", CVAR_NONE, NULL, "enable server "
|
||||
|
@ -688,14 +667,13 @@ SL_CheckStatus (const char *cs_from, const char *cs_data)
|
|||
server_entry_t *temp;
|
||||
|
||||
for (temp = slist; temp; temp = temp->next)
|
||||
if (temp->waitstatus)
|
||||
{
|
||||
if (strcmp (cs_from, temp->server) == 0)
|
||||
{
|
||||
if (temp->waitstatus) {
|
||||
if (strcmp (cs_from, temp->server) == 0) {
|
||||
int i;
|
||||
char *data = strdup (cs_data);
|
||||
|
||||
strcpy (data, cs_data);
|
||||
for (i = 0; i < strlen(data); i++)
|
||||
for (i = 0; i < strlen (data); i++)
|
||||
if (data[i] == '\n') {
|
||||
data[i] = '\\';
|
||||
break;
|
||||
|
@ -706,11 +684,11 @@ SL_CheckStatus (const char *cs_from, const char *cs_data)
|
|||
temp->waitstatus = 0;
|
||||
tmp_desc = Info_ValueForKey (temp->status, "hostname");
|
||||
if (tmp_desc[0] != '\0') {
|
||||
temp->desc = realloc(temp->desc, strlen(tmp_desc) + 1);
|
||||
strcpy(temp->desc, tmp_desc);
|
||||
temp->desc = realloc (temp->desc, strlen (tmp_desc) + 1);
|
||||
strcpy (temp->desc, tmp_desc);
|
||||
} else {
|
||||
temp->desc = realloc(temp->desc, strlen(data) + 1);
|
||||
strcpy(temp->desc, data);
|
||||
temp->desc = realloc (temp->desc, strlen (data) + 1);
|
||||
strcpy (temp->desc, data);
|
||||
}
|
||||
free (data);
|
||||
return (1);
|
||||
|
@ -728,7 +706,7 @@ SL_CheckPing (const char *cp_from)
|
|||
if (temp->pingsent && !temp->pongback) {
|
||||
if (strcmp (cp_from, temp->server)) {
|
||||
temp->pongback = Sys_DoubleTime ();
|
||||
timepassed(temp->pingsent, &temp->pongback);
|
||||
timepassed (temp->pingsent, &temp->pongback);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -281,7 +281,7 @@ CL_ParseBeam (model_t *m)
|
|||
b->entity = ent;
|
||||
b->model = m;
|
||||
b->endtime = cl.time + 0.2;
|
||||
b->seed = rand();
|
||||
b->seed = rand ();
|
||||
VectorCopy (end, b->end);
|
||||
if (b->entity != cl.viewentity) {
|
||||
// this will be done in CL_UpdateBeams
|
||||
|
@ -427,7 +427,7 @@ CL_ParseTEnt (void)
|
|||
dl->radius = 350;
|
||||
dl->die = cl.time + 0.5;
|
||||
dl->decay = 300;
|
||||
colorStart = (colorStart + (rand() % colorLength)) * 3;
|
||||
colorStart = (colorStart + (rand () % colorLength)) * 3;
|
||||
dl->color[0] = vid.palette[colorStart] * (1.0 / 255.0);
|
||||
dl->color[1] = vid.palette[colorStart + 1] * (1.0 / 255.0);
|
||||
dl->color[2] = vid.palette[colorStart + 2] * (1.0 / 255.0);
|
||||
|
|
|
@ -470,7 +470,7 @@ V_PrepBlend (void)
|
|||
if (!vid.cshift_changed && !vid.recalc_refdef)
|
||||
return;
|
||||
|
||||
V_CalcBlend();
|
||||
V_CalcBlend ();
|
||||
}
|
||||
|
||||
/* VIEW RENDERING */
|
||||
|
|
|
@ -152,7 +152,7 @@ CF_BuildQuota (void)
|
|||
|
||||
cf_cursize = 0;
|
||||
|
||||
while ((i = readdir(dir))) {
|
||||
while ((i = readdir (dir))) {
|
||||
cf_cursize += CF_GetFileSize (va ("%s/%s", path->str, i->d_name));
|
||||
}
|
||||
closedir (dir);
|
||||
|
@ -166,7 +166,7 @@ CF_BuildQuota (void)
|
|||
void
|
||||
CF_Init (void)
|
||||
{
|
||||
CF_BuildQuota();
|
||||
CF_BuildQuota ();
|
||||
crudefile_quota = Cvar_Get ("crudefile_quota", "-1", CVAR_ROM, NULL,
|
||||
"Maximum space available to the Crude File "
|
||||
"system, -1 to totally disable file writing");
|
||||
|
@ -187,7 +187,7 @@ CF_CloseAllFiles ()
|
|||
if (cf_filep[i].file) {
|
||||
Con_DPrintf ("Warning: closing Crude File %d left over from last "
|
||||
"map\n", i);
|
||||
CF_Close(i);
|
||||
CF_Close (i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -211,11 +211,11 @@ CF_Open (const char *path, const char *mode)
|
|||
}
|
||||
|
||||
// check for paths with ..
|
||||
if (strequal(path, "..")
|
||||
|| !strncmp(path, "../", 3)
|
||||
|| strstr(path, "/../")
|
||||
|| (strlen(path) >= 3
|
||||
&& strequal(path + strlen(path) - 3, "/.."))) {
|
||||
if (strequal (path, "..")
|
||||
|| !strncmp (path, "../", 3)
|
||||
|| strstr (path, "/../")
|
||||
|| (strlen (path) >= 3
|
||||
&& strequal (path + strlen (path) - 3, "/.."))) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -230,12 +230,12 @@ CF_Open (const char *path, const char *mode)
|
|||
dsprintf (fullpath, "%s/%s/%s/%s", fs_userpath->string,
|
||||
qfs_gamedir->dir.def, CF_DIR, path);
|
||||
|
||||
j = fullpath->str + strlen(fullpath->str) - strlen (path);
|
||||
j = fullpath->str + strlen (fullpath->str) - strlen (path);
|
||||
for (i = 0; path[i]; i++, j++) // strcpy, but force lowercase
|
||||
*j = tolower(path[i]);
|
||||
*j = tolower (path[i]);
|
||||
*j = '\0';
|
||||
|
||||
if (CF_AlreadyOpen(fullpath->str, mode[0])) {
|
||||
if (CF_AlreadyOpen (fullpath->str, mode[0])) {
|
||||
dstring_delete (fullpath);
|
||||
return -1;
|
||||
}
|
||||
|
@ -249,7 +249,7 @@ CF_Open (const char *path, const char *mode)
|
|||
if (file) {
|
||||
if (cf_openfiles >= cf_filepcount) {
|
||||
cf_filepcount++;
|
||||
cf_filep = realloc(cf_filep, sizeof(cf_file_t) * cf_filepcount);
|
||||
cf_filep = realloc (cf_filep, sizeof (cf_file_t) * cf_filepcount);
|
||||
if (!cf_filep) {
|
||||
Sys_Error ("CF_Open: memory allocation error!");
|
||||
}
|
||||
|
@ -285,21 +285,21 @@ CF_Close (int desc)
|
|||
{
|
||||
char *path;
|
||||
|
||||
if (!CF_ValidDesc(desc))
|
||||
if (!CF_ValidDesc (desc))
|
||||
return;
|
||||
|
||||
if (cf_filep[desc].mode == 'w' && !cf_filep[desc].writtento)
|
||||
unlink(cf_filep[desc].path);
|
||||
unlink (cf_filep[desc].path);
|
||||
|
||||
path = cf_filep[desc].path;
|
||||
|
||||
Qclose (cf_filep[desc].file);
|
||||
cf_filep[desc].file = 0;
|
||||
free(cf_filep[desc].buf);
|
||||
free (cf_filep[desc].buf);
|
||||
cf_openfiles--;
|
||||
|
||||
cf_cursize -= CF_GetFileSize (path);
|
||||
free(path);
|
||||
free (path);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -313,7 +313,7 @@ CF_Read (int desc)
|
|||
{
|
||||
int len = 0;
|
||||
|
||||
if (!CF_ValidDesc(desc) || cf_filep[desc].mode != 'r') {
|
||||
if (!CF_ValidDesc (desc) || cf_filep[desc].mode != 'r') {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
@ -328,7 +328,7 @@ CF_Read (int desc)
|
|||
cf_filep[desc].buf = t;
|
||||
cf_filep[desc].size += CF_BUFFERSIZE;
|
||||
}
|
||||
foo = Qgetc(cf_filep[desc].file);
|
||||
foo = Qgetc (cf_filep[desc].file);
|
||||
if (foo == EOF)
|
||||
foo = 0;
|
||||
cf_filep[desc].buf[len] = (char) foo;
|
||||
|
@ -351,17 +351,17 @@ CF_Write (int desc, const char *buf) // should be const char *, but Qwrite isn't
|
|||
{
|
||||
int len;
|
||||
|
||||
if (!CF_ValidDesc(desc) || cf_filep[desc].mode != 'w' || cf_cursize >=
|
||||
if (!CF_ValidDesc (desc) || cf_filep[desc].mode != 'w' || cf_cursize >=
|
||||
cf_maxsize) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
len = strlen(buf) + 1;
|
||||
len = strlen (buf) + 1;
|
||||
if (len > cf_maxsize - cf_cursize) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
len = Qwrite(cf_filep[desc].file, buf, len);
|
||||
len = Qwrite (cf_filep[desc].file, buf, len);
|
||||
if (len < 0)
|
||||
len = 0;
|
||||
|
||||
|
@ -380,7 +380,7 @@ CF_Write (int desc, const char *buf) // should be const char *, but Qwrite isn't
|
|||
int
|
||||
CF_EOF (int desc)
|
||||
{
|
||||
if (!CF_ValidDesc(desc)) {
|
||||
if (!CF_ValidDesc (desc)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -390,11 +390,11 @@ CF_EOF (int desc)
|
|||
/*
|
||||
CF_Quota
|
||||
|
||||
cfquota returns the number of characters left in the quota, or
|
||||
<= 0 if it's met or (somehow) exceeded.
|
||||
returns the number of characters left in the quota, or <= 0 if it's met or
|
||||
(somehow) exceeded.
|
||||
*/
|
||||
int
|
||||
CF_Quota()
|
||||
CF_Quota ()
|
||||
{
|
||||
return cf_maxsize - cf_cursize;
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ locs_find (const vec3_t target)
|
|||
{
|
||||
int i;
|
||||
|
||||
i = locs_nearest(target);
|
||||
i = locs_nearest (target);
|
||||
if (i == -1)
|
||||
return NULL;
|
||||
return locations[i];
|
||||
|
@ -139,7 +139,7 @@ locs_load (const char *filename)
|
|||
vec3_t loc;
|
||||
QFile *file;
|
||||
|
||||
snprintf(tmp,sizeof(tmp), "maps/%s",filename);
|
||||
snprintf (tmp, sizeof (tmp), "maps/%s", filename);
|
||||
templength = _QFS_FOpenFile (tmp, &file, foundname, 1);
|
||||
if (!file) {
|
||||
Con_Printf ("Couldn't load %s\n", tmp);
|
||||
|
@ -156,7 +156,7 @@ locs_load (const char *filename)
|
|||
if (t2 == t1)
|
||||
continue;
|
||||
loc[2] = strtol (t2, &t1, 0) * (1.0 / 8);
|
||||
if ((t1 == t2) || (strlen(t1) < 2))
|
||||
if ((t1 == t2) || (strlen (t1) < 2))
|
||||
continue;
|
||||
t1++;
|
||||
t2 = strrchr (t1, '\n');
|
||||
|
@ -199,31 +199,29 @@ locs_save (const char *filename, qboolean gz)
|
|||
QFile *locfd;
|
||||
|
||||
if (gz) {
|
||||
if (strncmp(filename + strlen(filename) - 3,".gz",3) != 0)
|
||||
snprintf (locfile, sizeof (locfile), "%s.gz",filename);
|
||||
if (strncmp (filename + strlen (filename) - 3,".gz", 3) != 0)
|
||||
snprintf (locfile, sizeof (locfile), "%s.gz", filename);
|
||||
else
|
||||
strcpy(locfile,filename);
|
||||
locfd = Qopen (locfile,"z9w+");
|
||||
strcpy (locfile, filename);
|
||||
locfd = Qopen (locfile, "z9w+");
|
||||
} else
|
||||
locfd = Qopen (filename,"w+");
|
||||
locfd = Qopen (filename, "w+");
|
||||
if (locfd == 0) {
|
||||
Con_Printf("ERROR: Unable to open %s\n",filename);
|
||||
Con_Printf ("ERROR: Unable to open %s\n", filename);
|
||||
return;
|
||||
}
|
||||
for (i=0; i < locations_count; i++)
|
||||
Qprintf(locfd,"%.0f %.0f %.0f %s\n",
|
||||
locations[i]->loc[0] * 8,
|
||||
locations[i]->loc[1] * 8,
|
||||
locations[i]->loc[2] * 8,
|
||||
locations[i]->name);
|
||||
for (i = 0; i < locations_count; i++)
|
||||
Qprintf (locfd,"%.0f %.0f %.0f %s\n", locations[i]->loc[0] * 8,
|
||||
locations[i]->loc[1] * 8, locations[i]->loc[2] * 8,
|
||||
locations[i]->name);
|
||||
Qclose (locfd);
|
||||
}
|
||||
|
||||
void
|
||||
locs_mark (const vec3_t loc, const char *desc)
|
||||
{
|
||||
locs_add (loc,desc);
|
||||
Con_Printf ("Marked current location: %s\n",desc);
|
||||
locs_add (loc, desc);
|
||||
Con_Printf ("Marked current location: %s\n", desc);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -240,7 +238,7 @@ locs_edit (const vec3_t loc, const char *desc)
|
|||
if (locations_count) {
|
||||
i = locs_nearest (loc);
|
||||
if (!desc) {
|
||||
VectorCopy (loc,locations[i]->loc);
|
||||
VectorCopy (loc, locations[i]->loc);
|
||||
Con_Printf ("Moving location marker for %s\n",
|
||||
locations[i]->name);
|
||||
} else {
|
||||
|
@ -277,10 +275,10 @@ map_to_loc (const char *mapname, char *filename)
|
|||
{
|
||||
char *t1;
|
||||
|
||||
strcpy(filename, mapname);
|
||||
t1 = strrchr(filename,'.');
|
||||
strcpy (filename, mapname);
|
||||
t1 = strrchr (filename, '.');
|
||||
if (!t1)
|
||||
Sys_Error ("Can't find .!");
|
||||
t1++;
|
||||
strcpy(t1,"loc");
|
||||
strcpy (t1, "loc");
|
||||
}
|
||||
|
|
|
@ -304,8 +304,8 @@ QW_SendHearts (int sock, msghdr_t *msghdr, server_t *servers, int serverlen)
|
|||
p[1] = ((unsigned char *) &servers[i].addr.sin_addr.s_addr)[1];
|
||||
p[2] = ((unsigned char *) &servers[i].addr.sin_addr.s_addr)[2];
|
||||
p[3] = ((unsigned char *) &servers[i].addr.sin_addr.s_addr)[3];
|
||||
p[4] = (unsigned char) (ntohs(servers[i].addr.sin_port) >> 8);
|
||||
p[5] = (unsigned char) (ntohs(servers[i].addr.sin_port) & 0xFF);
|
||||
p[4] = (unsigned char) (ntohs (servers[i].addr.sin_port) >> 8);
|
||||
p[5] = (unsigned char) (ntohs (servers[i].addr.sin_port) & 0xFF);
|
||||
++cpos;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -298,7 +298,7 @@ Log_Outgoing_Packet (const char *p, int len, int has_sequence)
|
|||
}
|
||||
|
||||
static void
|
||||
Log_Delta(int bits)
|
||||
Log_Delta (int bits)
|
||||
{
|
||||
entity_state_t to;
|
||||
int i;
|
||||
|
@ -354,21 +354,21 @@ Log_Delta(int bits)
|
|||
|
||||
// Ender (QSG - Begin)
|
||||
if (bits & U_ALPHA)
|
||||
Net_LogPrintf(" Alpha: %d", MSG_ReadByte (&packet));
|
||||
Net_LogPrintf (" Alpha: %d", MSG_ReadByte (&packet));
|
||||
if (bits & U_SCALE)
|
||||
Net_LogPrintf(" Scale: %d", MSG_ReadByte (&packet));
|
||||
Net_LogPrintf (" Scale: %d", MSG_ReadByte (&packet));
|
||||
if (bits & U_EFFECTS2)
|
||||
Net_LogPrintf(" U_EFFECTS2: %d", (to.effects & 0xFF) |
|
||||
(MSG_ReadByte (&packet) << 8));
|
||||
Net_LogPrintf (" U_EFFECTS2: %d", (to.effects & 0xFF) |
|
||||
(MSG_ReadByte (&packet) << 8));
|
||||
if (bits & U_GLOWSIZE)
|
||||
Net_LogPrintf(" GlowSize: %d", MSG_ReadByte (&packet));
|
||||
Net_LogPrintf (" GlowSize: %d", MSG_ReadByte (&packet));
|
||||
if (bits & U_GLOWCOLOR)
|
||||
Net_LogPrintf(" ColorGlow: %d", MSG_ReadByte (&packet));
|
||||
Net_LogPrintf (" ColorGlow: %d", MSG_ReadByte (&packet));
|
||||
if (bits & U_COLORMOD)
|
||||
Net_LogPrintf(" Colormod: %d", MSG_ReadByte (&packet));
|
||||
Net_LogPrintf (" Colormod: %d", MSG_ReadByte (&packet));
|
||||
if (bits & U_FRAME2)
|
||||
Net_LogPrintf(" Uframe2: %d", ((to.frame & 0xFF) |
|
||||
(MSG_ReadByte (&packet) << 8)));
|
||||
Net_LogPrintf (" Uframe2: %d", ((to.frame & 0xFF) |
|
||||
(MSG_ReadByte (&packet) << 8)));
|
||||
// Ender (QSG - End)
|
||||
|
||||
return;
|
||||
|
@ -767,14 +767,14 @@ Parse_Server_Packet (int has_sequence)
|
|||
break;
|
||||
case svc_packetentities:
|
||||
while (1) {
|
||||
mask1 = (unsigned short) MSG_ReadShort(&packet);
|
||||
mask1 = (unsigned short) MSG_ReadShort (&packet);
|
||||
if (packet.badread) {
|
||||
Net_LogPrintf ("Badread\n");
|
||||
return;
|
||||
}
|
||||
if (!mask1) break;
|
||||
if (mask1 & U_REMOVE) Net_LogPrintf("UREMOVE ");
|
||||
Log_Delta(mask1);
|
||||
if (mask1 & U_REMOVE) Net_LogPrintf ("UREMOVE ");
|
||||
Log_Delta (mask1);
|
||||
}
|
||||
break;
|
||||
case svc_deltapacketentities:
|
||||
|
|
|
@ -926,12 +926,12 @@ Sbar_LogFrags (void)
|
|||
char num[512];
|
||||
char conv[512];
|
||||
char conv2[512];
|
||||
char *cp = NULL;
|
||||
char *cp = NULL;
|
||||
QFile *file = NULL;
|
||||
int minutes, fph, total, f, i, k, l, p, d;
|
||||
int minutes, fph, total, d, f, i, k, l, p;
|
||||
player_info_t *s = NULL;
|
||||
const char *t = NULL;
|
||||
time_t tt = time(NULL);
|
||||
const char *t = NULL;
|
||||
time_t tt = time (NULL);
|
||||
char e_path[MAX_OSPATH];
|
||||
|
||||
if (!cl_fraglog->int_val)
|
||||
|
@ -1004,19 +1004,19 @@ Sbar_LogFrags (void)
|
|||
d++)
|
||||
conv2[d] = sys_char_map[(unsigned int) *cp];
|
||||
|
||||
snprintf(num, sizeof (num), "%-3i%% %-3i %-4i %-3i "
|
||||
"%-4s %s", s->pl, fph, minutes, f, (char *) &conv2,
|
||||
(char *) &conv);
|
||||
snprintf (num, sizeof (num), "%-3i%% %-3i %-4i %-3i "
|
||||
"%-4s %s", s->pl, fph, minutes, f, (char *) &conv2,
|
||||
(char *) &conv);
|
||||
} else {
|
||||
snprintf(num, sizeof (num), "%-3i%% %-3i %-4i %-3i %s",
|
||||
s->pl, fph, minutes, f, (char *) &conv);
|
||||
snprintf (num, sizeof (num), "%-3i%% %-3i %-4i %-3i %s",
|
||||
s->pl, fph, minutes, f, (char *) &conv);
|
||||
}
|
||||
}
|
||||
Qwrite(file, num, strlen(num));
|
||||
Qwrite(file, "\n\n", 1);
|
||||
Qwrite (file, num, strlen (num));
|
||||
Qwrite (file, "\n\n", 1);
|
||||
}
|
||||
|
||||
Qclose(file);
|
||||
Qclose (file);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -219,7 +219,7 @@ SV_Fraglogfile_f (void)
|
|||
/*
|
||||
SV_SetPlayer
|
||||
|
||||
Sets host_client and sv_player to the player with idnum Cmd_Argv(1)
|
||||
Sets host_client and sv_player to the player with idnum Cmd_Argv (1)
|
||||
*/
|
||||
static qboolean
|
||||
SV_SetPlayer (void)
|
||||
|
@ -434,7 +434,7 @@ SV_Kick_f (void)
|
|||
SV_Printf ("usage: kick <name/userid>\n");
|
||||
return;
|
||||
}
|
||||
if (!(cl = SV_Match_User (Cmd_Argv(1))))
|
||||
if (!(cl = SV_Match_User (Cmd_Argv (1))))
|
||||
return;
|
||||
|
||||
SV_BroadcastPrintf (PRINT_HIGH, "%s was kicked\n", cl->name);
|
||||
|
@ -560,31 +560,30 @@ SV_Cuff_f (void)
|
|||
client_t *cl = 0;
|
||||
char text[1024];
|
||||
|
||||
if (Cmd_Argc() != 2 && Cmd_Argc() != 3) {
|
||||
if (Cmd_Argc () != 2 && Cmd_Argc () != 3) {
|
||||
SV_Printf ("usage: cuff <name/userid/ALL> [minutes]\n"
|
||||
" (default = 0.5, 0 = cancel cuff).\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (strequal (Cmd_Argv(1), "ALL")) {
|
||||
if (strequal (Cmd_Argv (1), "ALL")) {
|
||||
all = true;
|
||||
} else {
|
||||
cl = SV_Match_User (Cmd_Argv(1));
|
||||
cl = SV_Match_User (Cmd_Argv (1));
|
||||
}
|
||||
if (!all && !cl)
|
||||
return;
|
||||
if (Cmd_Argc() == 3) {
|
||||
mins = atof(Cmd_Argv(2));
|
||||
if (Cmd_Argc () == 3) {
|
||||
mins = atof (Cmd_Argv (2));
|
||||
if (mins < 0.0 || mins > MAXPENALTY)
|
||||
mins = MAXPENALTY;
|
||||
}
|
||||
if (cl) {
|
||||
cl->cuff_time = realtime + mins*60.0;
|
||||
cl->cuff_time = realtime + mins * 60.0;
|
||||
if (mins) {
|
||||
sprintf(text,
|
||||
"You are cuffed for %.1f minutes\n\n"
|
||||
"reconnecting won't help...\n", mins);
|
||||
ClientReliableWrite_Begin(cl,svc_centerprint, 2+strlen(text));
|
||||
sprintf (text, "You are cuffed for %.1f minutes\n\n"
|
||||
"reconnecting won't help...\n", mins);
|
||||
ClientReliableWrite_Begin (cl, svc_centerprint, 2 + strlen (text));
|
||||
ClientReliableWrite_String (cl, text);
|
||||
}
|
||||
}
|
||||
|
@ -592,13 +591,13 @@ SV_Cuff_f (void)
|
|||
for (i = 0, cl = svs.clients; i < MAX_CLIENTS; i++, cl++) {
|
||||
if (cl->state < cs_zombie)
|
||||
continue;
|
||||
cl->cuff_time = realtime + mins*60.0;
|
||||
cl->cuff_time = realtime + mins * 60.0;
|
||||
done = true;
|
||||
if (mins) {
|
||||
sprintf(text,
|
||||
"You are cuffed for %.1f minutes\n\n"
|
||||
"reconnecting won't help...\n", mins);
|
||||
ClientReliableWrite_Begin(cl,svc_centerprint, 2+strlen(text));
|
||||
sprintf (text, "You are cuffed for %.1f minutes\n\n"
|
||||
"reconnecting won't help...\n", mins);
|
||||
ClientReliableWrite_Begin (cl, svc_centerprint,
|
||||
2 + strlen (text));
|
||||
ClientReliableWrite_String (cl, text);
|
||||
}
|
||||
}
|
||||
|
@ -623,30 +622,30 @@ SV_Mute_f (void)
|
|||
client_t *cl = 0;
|
||||
char text[1024];
|
||||
|
||||
if (Cmd_Argc() != 2 && Cmd_Argc() != 3) {
|
||||
if (Cmd_Argc () != 2 && Cmd_Argc () != 3) {
|
||||
SV_Printf ("usage: mute <name/userid/ALL> [minutes]\n"
|
||||
" (default = 0.5, 0 = cancel mute).\n");
|
||||
return;
|
||||
}
|
||||
if (strequal(Cmd_Argv(1),"ALL")) {
|
||||
if (strequal (Cmd_Argv (1),"ALL")) {
|
||||
all = true;
|
||||
} else {
|
||||
cl = SV_Match_User (Cmd_Argv(1));
|
||||
cl = SV_Match_User (Cmd_Argv (1));
|
||||
}
|
||||
if (!all && !cl)
|
||||
return;
|
||||
if (Cmd_Argc() == 3) {
|
||||
mins = atof(Cmd_Argv(2));
|
||||
if (Cmd_Argc () == 3) {
|
||||
mins = atof (Cmd_Argv (2));
|
||||
if (mins < 0.0 || mins > MAXPENALTY)
|
||||
mins = MAXPENALTY;
|
||||
}
|
||||
if (cl) {
|
||||
cl->lockedtill = realtime + mins*60.0;
|
||||
cl->lockedtill = realtime + mins * 60.0;
|
||||
done = true;
|
||||
if (mins) {
|
||||
sprintf(text, "You are muted for %.1f minutes\n\n"
|
||||
"reconnecting won't help...\n", mins);
|
||||
ClientReliableWrite_Begin(cl,svc_centerprint, 2+strlen(text));
|
||||
sprintf (text, "You are muted for %.1f minutes\n\n"
|
||||
"reconnecting won't help...\n", mins);
|
||||
ClientReliableWrite_Begin (cl, svc_centerprint, 2 + strlen (text));
|
||||
ClientReliableWrite_String (cl, text);
|
||||
}
|
||||
}
|
||||
|
@ -654,12 +653,13 @@ SV_Mute_f (void)
|
|||
for (i = 0, cl = svs.clients; i < MAX_CLIENTS; i++, cl++) {
|
||||
if (cl->state < cs_zombie)
|
||||
continue;
|
||||
cl->lockedtill = realtime + mins*60.0;
|
||||
cl->lockedtill = realtime + mins * 60.0;
|
||||
done = true;
|
||||
if (mins) {
|
||||
sprintf(text, "You are muted for %.1f minutes\n\n"
|
||||
"reconnecting won't help...\n", mins);
|
||||
ClientReliableWrite_Begin(cl,svc_centerprint, 2+strlen(text));
|
||||
sprintf (text, "You are muted for %.1f minutes\n\n"
|
||||
"reconnecting won't help...\n", mins);
|
||||
ClientReliableWrite_Begin (cl, svc_centerprint,
|
||||
2 + strlen (text));
|
||||
ClientReliableWrite_String (cl, text);
|
||||
}
|
||||
}
|
||||
|
@ -686,10 +686,10 @@ SV_Tell (const char *prefix)
|
|||
SV_Printf ("usage: tell <name/userid> <text...>\n");
|
||||
return;
|
||||
}
|
||||
if (!(cl = SV_Match_User (Cmd_Argv(1))))
|
||||
if (!(cl = SV_Match_User (Cmd_Argv (1))))
|
||||
return;
|
||||
|
||||
p = Hunk_TempAlloc (strlen(Cmd_Args (2)) + 1);
|
||||
p = Hunk_TempAlloc (strlen (Cmd_Args (2)) + 1);
|
||||
strcpy (p, Cmd_Args (2));
|
||||
if (*p == '"') {
|
||||
p++;
|
||||
|
@ -714,36 +714,36 @@ SV_Ban_f (void)
|
|||
double mins = 30.0;
|
||||
client_t *cl;
|
||||
|
||||
if (Cmd_Argc() != 2 && Cmd_Argc() != 3) {
|
||||
if (Cmd_Argc () != 2 && Cmd_Argc () != 3) {
|
||||
SV_Printf ("usage: ban <name/userid> [minutes]\n"
|
||||
" (default = 30, 0 = permanent).\n");
|
||||
return;
|
||||
}
|
||||
if (!(cl = SV_Match_User(Cmd_Argv(1))))
|
||||
if (!(cl = SV_Match_User (Cmd_Argv (1))))
|
||||
return;
|
||||
if (Cmd_Argc() == 3) {
|
||||
mins = atof(Cmd_Argv(2));
|
||||
if (mins<0.0 || mins > 1000000.0) // bout 2 yrs
|
||||
if (Cmd_Argc () == 3) {
|
||||
mins = atof (Cmd_Argv (2));
|
||||
if (mins < 0.0 || mins > 1000000.0) // bout 2 yrs
|
||||
mins = 0.0;
|
||||
}
|
||||
SV_BroadcastPrintf (PRINT_HIGH, "Admin Banned user %s %s\n",
|
||||
cl->name, mins ? va("for %.1f minutes", mins)
|
||||
cl->name, mins ? va ("for %.1f minutes", mins)
|
||||
: "permanently");
|
||||
SV_DropClient (cl);
|
||||
Cmd_ExecuteString (va ("addip %s %f",
|
||||
NET_BaseAdrToString(cl->netchan.remote_address),
|
||||
NET_BaseAdrToString (cl->netchan.remote_address),
|
||||
mins), src_command);
|
||||
}
|
||||
|
||||
static void
|
||||
SV_Match_f (void)
|
||||
{
|
||||
if (Cmd_Argc() != 2) {
|
||||
if (Cmd_Argc () != 2) {
|
||||
SV_Printf ("usage: match <name/userid>\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!SV_Match_User (Cmd_Argv(1)))
|
||||
if (!SV_Match_User (Cmd_Argv (1)))
|
||||
SV_Printf ("No unique uid/name matched\n");
|
||||
}
|
||||
|
||||
|
@ -759,7 +759,7 @@ SV_ConSay (const char *prefix)
|
|||
if (Cmd_Argc () < 2)
|
||||
return;
|
||||
|
||||
p = Hunk_TempAlloc (strlen(Cmd_Args (1)) + 1);
|
||||
p = Hunk_TempAlloc (strlen (Cmd_Args (1)) + 1);
|
||||
strcpy (p, Cmd_Args (1));
|
||||
if (*p == '"') {
|
||||
p++;
|
||||
|
@ -801,15 +801,15 @@ static void
|
|||
SV_ConSay_f (void)
|
||||
{
|
||||
if (rcon_from_user)
|
||||
SV_ConSay("Admin");
|
||||
SV_ConSay ("Admin");
|
||||
else
|
||||
SV_ConSay("Console");
|
||||
SV_ConSay ("Console");
|
||||
}
|
||||
|
||||
static void
|
||||
SV_ConSay_Info_f (void)
|
||||
{
|
||||
SV_ConSay("Info");
|
||||
SV_ConSay ("Info");
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -56,12 +56,10 @@ demo_t demo;
|
|||
|
||||
#define MIN_DEMO_MEMORY 0x100000
|
||||
#define USACACHE (sv_demoUseCache->int_val && svs.demomemsize)
|
||||
#define DWRITE(a,b,d) dwrite((QFile *)d,a,b)
|
||||
#define DWRITE(a,b,d) dwrite((QFile *) d, a, b)
|
||||
#define MAXSIZE (demobuffer->end < demobuffer->last ? \
|
||||
demobuffer->start - demobuffer->end : \
|
||||
demobuffer->maxsize - demobuffer->end)
|
||||
|
||||
|
||||
demobuffer->start - demobuffer->end : \
|
||||
demobuffer->maxsize - demobuffer->end)
|
||||
|
||||
static int demo_max_size;
|
||||
static int demo_size;
|
||||
|
@ -717,7 +715,7 @@ SV_WriteSetDemoMessage (void)
|
|||
int len;
|
||||
byte c;
|
||||
|
||||
// Con_Printf("write: %ld bytes, %4.4f\n", msg->cursize, realtime);
|
||||
// Con_Printf ("write: %ld bytes, %4.4f\n", msg->cursize, realtime);
|
||||
|
||||
if (!sv.demorecording)
|
||||
return;
|
||||
|
@ -1217,13 +1215,14 @@ SV_EasyRecord_f (void)
|
|||
Dem_PlayerName (1), Dem_PlayerName (2), sv.name);
|
||||
} else {
|
||||
// FFA
|
||||
dsprintf (name, "ffa_%s(%d)", sv.name, i);
|
||||
dsprintf (name, "ffa_%s (%d)", sv.name, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure the filename doesn't contain illegal characters
|
||||
dsprintf (name2, "%s/%s/%s/%s%s%s", fs_userpath->string, qfs_gamedir->dir.def, sv_demoDir->string,
|
||||
dsprintf (name2, "%s/%s/%s/%s%s%s", fs_userpath->string,
|
||||
qfs_gamedir->dir.def, sv_demoDir->string,
|
||||
sv_demoPrefix->string, SV_CleanName (name->str),
|
||||
sv_demoSuffix->string);
|
||||
QFS_CreatePath (name2->str);
|
||||
|
|
|
@ -372,7 +372,7 @@ SV_EmitPacketEntities (client_t *client, packet_entities_t *to, sizebuf_t *msg)
|
|||
client->netchan.incoming_sequence & UPDATE_MASK,
|
||||
client->delta_sequence & UPDATE_MASK);
|
||||
if (!client->edict)
|
||||
Sys_Printf("demo\n");
|
||||
Sys_Printf ("demo\n");
|
||||
}
|
||||
ent = EDICT_NUM (&sv_pr_state, newnum);
|
||||
// SV_Printf ("baseline %i\n", newnum);
|
||||
|
|
|
@ -71,12 +71,12 @@ SV_GIB_Client_GetList_f (void)
|
|||
client_t *cl;
|
||||
int i;
|
||||
|
||||
if (GIB_Argc() != 1)
|
||||
GIB_USAGE("");
|
||||
else if (GIB_CanReturn())
|
||||
if (GIB_Argc () != 1)
|
||||
GIB_USAGE ("");
|
||||
else if (GIB_CanReturn ())
|
||||
for (i = 0, cl = svs.clients; i < MAX_CLIENTS; i++, cl++)
|
||||
if (cl->state >= cs_connected)
|
||||
dsprintf (GIB_Return(0), "%i", cl->userid);
|
||||
dsprintf (GIB_Return (0), "%i", cl->userid);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -84,14 +84,16 @@ SV_GIB_Client_GetKeys_f (void)
|
|||
{
|
||||
client_t *cl;
|
||||
|
||||
if (GIB_Argc() != 2)
|
||||
GIB_USAGE("");
|
||||
else if (!(cl = SV_GIB_GetClient (atoi(GIB_Argv(1)))))
|
||||
GIB_Error ("uid", "No user with id '%s' was found on the server.", GIB_Argv(1));
|
||||
if (GIB_Argc () != 2)
|
||||
GIB_USAGE ("");
|
||||
else if (!(cl = SV_GIB_GetClient (atoi (GIB_Argv (1)))))
|
||||
GIB_Error ("uid", "No user with id '%s' was found on the server.",
|
||||
GIB_Argv (1));
|
||||
else if (GIB_CanReturn ()) {
|
||||
info_key_t **key, **keys = (info_key_t **) Hash_GetList (cl->userinfo->tab);
|
||||
info_key_t **key, **keys =
|
||||
(info_key_t **) Hash_GetList (cl->userinfo->tab);
|
||||
for (key = keys; *key; key++)
|
||||
dstring_appendstr (GIB_Return(0), (*key)->key);
|
||||
dstring_appendstr (GIB_Return (0), (*key)->key);
|
||||
free (keys);
|
||||
}
|
||||
}
|
||||
|
@ -102,11 +104,12 @@ SV_GIB_Client_GetInfo_f (void)
|
|||
client_t *cl;
|
||||
const char *str;
|
||||
|
||||
if (GIB_Argc() != 3)
|
||||
GIB_USAGE("");
|
||||
else if (!(cl = SV_GIB_GetClient (atoi(GIB_Argv(1)))))
|
||||
GIB_Error ("uid", "No user with id '%s' was found on the server.", GIB_Argv(1));
|
||||
else if ((str = Info_ValueForKey (cl->userinfo, GIB_Argv(2))))
|
||||
if (GIB_Argc () != 3)
|
||||
GIB_USAGE ("");
|
||||
else if (!(cl = SV_GIB_GetClient (atoi (GIB_Argv (1)))))
|
||||
GIB_Error ("uid", "No user with id '%s' was found on the server.",
|
||||
GIB_Argv (1));
|
||||
else if ((str = Info_ValueForKey (cl->userinfo, GIB_Argv (2))))
|
||||
GIB_Return (str);
|
||||
}
|
||||
|
||||
|
@ -115,25 +118,27 @@ SV_GIB_Client_Print_f (void)
|
|||
{
|
||||
client_t *cl;
|
||||
|
||||
if (GIB_Argc() != 3)
|
||||
GIB_USAGE("uid message");
|
||||
else if (!(cl = SV_GIB_GetClient (atoi(GIB_Argv(1)))))
|
||||
GIB_Error ("uid", "No user with id '%s' was found on the server.", GIB_Argv(1));
|
||||
if (GIB_Argc () != 3)
|
||||
GIB_USAGE ("uid message");
|
||||
else if (!(cl = SV_GIB_GetClient (atoi (GIB_Argv (1)))))
|
||||
GIB_Error ("uid", "No user with id '%s' was found on the server.",
|
||||
GIB_Argv (1));
|
||||
else
|
||||
SV_ClientPrintf (0, cl, GIB_Argv(0)[13] ? PRINT_CHAT : PRINT_HIGH, "%s", GIB_Argv(2));
|
||||
SV_ClientPrintf (0, cl, GIB_Argv (0)[13] ? PRINT_CHAT : PRINT_HIGH,
|
||||
"%s", GIB_Argv (2));
|
||||
}
|
||||
|
||||
static void
|
||||
SV_GIB_Client_Print_All_f (void)
|
||||
{
|
||||
client_t *cl;
|
||||
int i, level = GIB_Argv(0)[16] ? PRINT_CHAT : PRINT_HIGH;
|
||||
int i, level = GIB_Argv (0)[16] ? PRINT_CHAT : PRINT_HIGH;
|
||||
|
||||
if (GIB_Argc() != 2)
|
||||
GIB_USAGE("message");
|
||||
if (GIB_Argc () != 2)
|
||||
GIB_USAGE ("message");
|
||||
else for (i = 0, cl = svs.clients; i < MAX_CLIENTS; i++, cl++)
|
||||
if (cl->state >= cs_connected)
|
||||
SV_ClientPrintf (0, cl, level, "%s", GIB_Argv(1));
|
||||
if (cl->state >= cs_connected)
|
||||
SV_ClientPrintf (0, cl, level, "%s", GIB_Argv (1));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -297,7 +297,7 @@ SV_CheckModel (const char *mdl)
|
|||
Change the server to a new map, taking all connected
|
||||
clients along with it.
|
||||
|
||||
This is only called from the SV_Map_f() function.
|
||||
This is only called from the SV_Map_f () function.
|
||||
*/
|
||||
void
|
||||
SV_SpawnServer (const char *server)
|
||||
|
|
|
@ -260,7 +260,7 @@ SV_Shutdown (void)
|
|||
sv_fraglogfile = NULL;
|
||||
}
|
||||
if (sv.demorecording)
|
||||
SV_Stop_f();
|
||||
SV_Stop_f ();
|
||||
|
||||
NET_Shutdown ();
|
||||
Con_Shutdown ();
|
||||
|
@ -386,7 +386,8 @@ SV_DropClient (client_t *drop)
|
|||
|
||||
// Trigger GIB event
|
||||
if (sv_client_disconnect_e->func)
|
||||
GIB_Event_Callback (sv_client_disconnect_e, 1, va("%u", drop->userid));
|
||||
GIB_Event_Callback (sv_client_disconnect_e, 1,
|
||||
va ("%u", drop->userid));
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -432,7 +433,7 @@ SV_FullClientUpdate (client_t *client, sizebuf_t *buf)
|
|||
|
||||
i = client - svs.clients;
|
||||
|
||||
// SV_Printf("SV_FullClientUpdate: Updated frags for client %d\n", i);
|
||||
// SV_Printf ("SV_FullClientUpdate: Updated frags for client %d\n", i);
|
||||
|
||||
MSG_WriteByte (buf, svc_updatefrags);
|
||||
MSG_WriteByte (buf, i);
|
||||
|
@ -648,9 +649,9 @@ SVC_Log (void)
|
|||
Con_DPrintf ("sending log %i to %s\n", svs.logsequence - 1,
|
||||
NET_AdrToString (net_from));
|
||||
|
||||
// snprintf (data, sizeof (data), "stdlog %i\n", svs.logsequence-1);
|
||||
// strncat (data, (char *)svs.log_buf[((svs.logsequence-1)&1)],
|
||||
// sizeof(data) - strlen (data));
|
||||
// snprintf (data, sizeof (data), "stdlog %i\n", svs.logsequence - 1);
|
||||
// strncat (data, (char *) svs.log_buf[((svs.logsequence - 1) & 1)],
|
||||
// sizeof (data) - strlen (data));
|
||||
snprintf (data, sizeof (data), "stdlog %i\n%s",
|
||||
svs.logsequence - 1,
|
||||
(char *) svs.log_buf[((svs.logsequence - 1) & 1)]);
|
||||
|
@ -925,7 +926,7 @@ SVC_DirectConnect (void)
|
|||
for (i = 0; i < 10; i++)
|
||||
newcl->whensaid[i] = 0.0;
|
||||
newcl->whensaidhead = 0;
|
||||
newcl->lockedtill = SV_RestorePenaltyFilter(newcl, ft_mute);
|
||||
newcl->lockedtill = SV_RestorePenaltyFilter (newcl, ft_mute);
|
||||
|
||||
// call the progs to get default spawn parms for the new client
|
||||
PR_ExecuteProgram (&sv_pr_state, sv_funcs.SetNewParms);
|
||||
|
@ -945,7 +946,7 @@ SVC_DirectConnect (void)
|
|||
newcl->msec_cheating = 0;
|
||||
newcl->last_check = -1;
|
||||
|
||||
newcl->cuff_time = SV_RestorePenaltyFilter(newcl, ft_cuff);
|
||||
newcl->cuff_time = SV_RestorePenaltyFilter (newcl, ft_cuff);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -969,7 +970,7 @@ Name_of_sender (void)
|
|||
for (i=0, cl=svs.clients ; i<MAX_CLIENTS ; i++,cl++) {
|
||||
if (cl->state < cs_zombie)
|
||||
continue;
|
||||
if (!NET_CompareBaseAdr(net_from, cl->netchan.remote_address))
|
||||
if (!NET_CompareBaseAdr (net_from, cl->netchan.remote_address))
|
||||
continue;
|
||||
if (cl->netchan.remote_address.port != net_from.port)
|
||||
continue;
|
||||
|
@ -1000,27 +1001,27 @@ SVC_RemoteCommand (void)
|
|||
do_cmd = true;
|
||||
} else if (Rcon_Validate (admin_password)) {
|
||||
admin_cmd = true;
|
||||
if (strcmp(Cmd_Argv(2), "say") == 0
|
||||
|| strcmp(Cmd_Argv(2), "kick") == 0
|
||||
|| strcmp(Cmd_Argv(2), "ban") == 0
|
||||
|| strcmp(Cmd_Argv(2), "mute") == 0
|
||||
|| strcmp(Cmd_Argv(2), "cuff") == 0
|
||||
|| strcmp(Cmd_Argv(2), "exec") == 0
|
||||
|| strcmp(Cmd_Argv(2), "addip") == 0
|
||||
|| strcmp(Cmd_Argv(2), "listip") == 0
|
||||
|| strcmp(Cmd_Argv(2), "writeip") == 0
|
||||
|| strcmp(Cmd_Argv(2), "removeip") == 0)
|
||||
if (strcmp (Cmd_Argv (2), "say") == 0
|
||||
|| strcmp (Cmd_Argv (2), "kick") == 0
|
||||
|| strcmp (Cmd_Argv (2), "ban") == 0
|
||||
|| strcmp (Cmd_Argv (2), "mute") == 0
|
||||
|| strcmp (Cmd_Argv (2), "cuff") == 0
|
||||
|| strcmp (Cmd_Argv (2), "exec") == 0
|
||||
|| strcmp (Cmd_Argv (2), "addip") == 0
|
||||
|| strcmp (Cmd_Argv (2), "listip") == 0
|
||||
|| strcmp (Cmd_Argv (2), "writeip") == 0
|
||||
|| strcmp (Cmd_Argv (2), "removeip") == 0)
|
||||
do_cmd = true;
|
||||
}
|
||||
if ((name = Name_of_sender())) { // log issuer
|
||||
if ((name = Name_of_sender ())) { // log issuer
|
||||
if (do_cmd && admin_cmd) {
|
||||
SV_BroadcastPrintf (PRINT_HIGH, "Admin %s issued %s command:\n",
|
||||
name, Cmd_Argv(2));
|
||||
name, Cmd_Argv (2));
|
||||
} else if (admin_cmd) {
|
||||
SV_Printf ("Admin %s issued %s command:\n", name, Cmd_Argv(2));
|
||||
SV_Printf ("Admin %s issued %s command:\n", name, Cmd_Argv (2));
|
||||
} else {
|
||||
SV_Printf("User %s %s rcon command:\n", name,
|
||||
do_cmd? "issued":"attempted");
|
||||
SV_Printf ("User %s %s rcon command:\n", name,
|
||||
do_cmd ? "issued" : "attempted");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1041,7 +1042,7 @@ SVC_RemoteCommand (void)
|
|||
|
||||
SV_BeginRedirect (RD_PACKET);
|
||||
if (admin_cmd) {
|
||||
SV_Printf("Command not valid with admin password.\n");
|
||||
SV_Printf ("Command not valid with admin password.\n");
|
||||
} else {
|
||||
SV_Printf ("Bad rcon_password.\n");
|
||||
}
|
||||
|
@ -1752,8 +1753,8 @@ SV_ReadPackets (void)
|
|||
good = false;
|
||||
while (NET_GetPacket ()) {
|
||||
if (net_packetlog->int_val)
|
||||
Log_Incoming_Packet(net_message->message->data,
|
||||
net_message->message->cursize, 1);
|
||||
Log_Incoming_Packet (net_message->message->data,
|
||||
net_message->message->cursize, 1);
|
||||
if (SV_FilterIP (net_from.ip, &until)) {
|
||||
SV_SendBan (until); // tell them we aren't listening...
|
||||
continue;
|
||||
|
@ -1804,7 +1805,7 @@ SV_ReadPackets (void)
|
|||
|
||||
// packet is not from a known client
|
||||
// SV_Printf ("%s:sequenced packet without connection\n",
|
||||
// NET_AdrToString(net_from));
|
||||
// NET_AdrToString (net_from));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2368,8 +2369,8 @@ SV_ExtractFromUserinfo (client_t *cl)
|
|||
"different name.\n", A2C_PRINT);
|
||||
SV_ClientPrintf (1, cl, PRINT_HIGH, "Please choose a "
|
||||
"different name.\n");
|
||||
SV_Printf("Client %d kicked for having a invalid name\n",
|
||||
cl->userid);
|
||||
SV_Printf ("Client %d kicked for having a invalid name\n",
|
||||
cl->userid);
|
||||
cl->drop = true;
|
||||
return;
|
||||
}
|
||||
|
@ -2435,7 +2436,7 @@ SV_InitNet (void)
|
|||
|
||||
Netchan_Init ();
|
||||
|
||||
Net_Log_Init(sv.sound_precache);
|
||||
Net_Log_Init (sv.sound_precache);
|
||||
|
||||
svs.last_heartbeat = -99999; // send immediately
|
||||
sv_net_initialized = 1;
|
||||
|
|
|
@ -65,7 +65,7 @@ static __attribute__ ((unused)) const char rcsid[] =
|
|||
This is a TERMINAL error, which will kill off the entire server.
|
||||
Dumps self.
|
||||
|
||||
error(value)
|
||||
error (value)
|
||||
*/
|
||||
void
|
||||
PF_error (progs_t *pr)
|
||||
|
@ -88,7 +88,7 @@ PF_error (progs_t *pr)
|
|||
Dumps out self, then an error message. The program is aborted and self is
|
||||
removed, but the level can continue.
|
||||
|
||||
objerror(value)
|
||||
objerror (value)
|
||||
*/
|
||||
void
|
||||
PF_objerror (progs_t *pr)
|
||||
|
@ -110,7 +110,7 @@ PF_objerror (progs_t *pr)
|
|||
PF_makevectors
|
||||
|
||||
Writes new values for v_forward, v_up, and v_right based on angles
|
||||
makevectors(vector)
|
||||
makevectors (vector)
|
||||
*/
|
||||
void
|
||||
PF_makevectors (progs_t *pr)
|
||||
|
@ -207,12 +207,12 @@ PF_setmodel (progs_t *pr)
|
|||
|
||||
broadcast print to everyone on server
|
||||
|
||||
bprint(value)
|
||||
bprint (value)
|
||||
*/
|
||||
void
|
||||
PF_bprint (progs_t *pr)
|
||||
{
|
||||
const char *s;
|
||||
const char *s;
|
||||
int level;
|
||||
|
||||
level = P_FLOAT (pr, 0);
|
||||
|
@ -226,12 +226,12 @@ PF_bprint (progs_t *pr)
|
|||
|
||||
single print to a specific client
|
||||
|
||||
sprint(clientent, value)
|
||||
sprint (clientent, value)
|
||||
*/
|
||||
void
|
||||
PF_sprint (progs_t *pr)
|
||||
{
|
||||
const char *s;
|
||||
const char *s;
|
||||
client_t *client;
|
||||
int entnum, level;
|
||||
|
||||
|
@ -258,12 +258,12 @@ PF_sprint (progs_t *pr)
|
|||
|
||||
single print to a specific client
|
||||
|
||||
centerprint(clientent, value)
|
||||
centerprint (clientent, value)
|
||||
*/
|
||||
void
|
||||
PF_centerprint (progs_t *pr)
|
||||
{
|
||||
const char *s;
|
||||
const char *s;
|
||||
client_t *cl;
|
||||
int entnum;
|
||||
|
||||
|
@ -590,7 +590,7 @@ PF_stuffcmd (progs_t *pr)
|
|||
ClientReliableWrite_Begin (cl, svc_stufftext, 2 + p - buf);
|
||||
ClientReliableWrite_String (cl, buf);
|
||||
if (sv.demorecording) {
|
||||
DemoWrite_Begin (dem_single, cl - svs.clients, 2 + strlen(buf));
|
||||
DemoWrite_Begin (dem_single, cl - svs.clients, 2 + strlen (buf));
|
||||
MSG_WriteByte (&demo.dbuf->sz, svc_stufftext);
|
||||
MSG_WriteString (&demo.dbuf->sz, buf);
|
||||
}
|
||||
|
@ -756,7 +756,7 @@ PF_precache_model (progs_t *pr)
|
|||
/*
|
||||
PF_walkmove
|
||||
|
||||
float(float yaw, float dist) walkmove
|
||||
float (float yaw, float dist) walkmove
|
||||
*/
|
||||
void
|
||||
PF_walkmove (progs_t *pr)
|
||||
|
@ -796,7 +796,7 @@ PF_walkmove (progs_t *pr)
|
|||
/*
|
||||
PF_droptofloor
|
||||
|
||||
void() droptofloor
|
||||
void () droptofloor
|
||||
*/
|
||||
void
|
||||
PF_droptofloor (progs_t *pr)
|
||||
|
@ -827,7 +827,7 @@ PF_droptofloor (progs_t *pr)
|
|||
/*
|
||||
PF_lightstyle
|
||||
|
||||
void(float style, string value) lightstyle
|
||||
void (float style, string value) lightstyle
|
||||
*/
|
||||
void
|
||||
PF_lightstyle (progs_t *pr)
|
||||
|
@ -890,7 +890,7 @@ cvar_t *sv_aim;
|
|||
PF_aim
|
||||
|
||||
Pick a vector for the player to shoot along
|
||||
vector aim(entity, missilespeed)
|
||||
vector aim (entity, missilespeed)
|
||||
*/
|
||||
void
|
||||
PF_aim (progs_t *pr)
|
||||
|
@ -1020,7 +1020,7 @@ PF_changeyaw (progs_t *pr)
|
|||
#define MSG_ONE 1 // reliable to one (msg_entity)
|
||||
#define MSG_ALL 2 // reliable to all
|
||||
#define MSG_INIT 3 // write to the init string
|
||||
#define MSG_MULTICAST 4 // for multicast()
|
||||
#define MSG_MULTICAST 4 // for multicast ()
|
||||
|
||||
static sizebuf_t *
|
||||
WriteDest (progs_t *pr)
|
||||
|
@ -1386,7 +1386,7 @@ PF_logfrag (progs_t *pr)
|
|||
/*
|
||||
PF_infokey
|
||||
|
||||
string(entity e, string key) infokey
|
||||
string (entity e, string key) infokey
|
||||
*/
|
||||
void
|
||||
PF_infokey (progs_t *pr)
|
||||
|
@ -1433,7 +1433,7 @@ PF_infokey (progs_t *pr)
|
|||
/*
|
||||
PF_multicast
|
||||
|
||||
void(vector where, float set) multicast
|
||||
void (vector where, float set) multicast
|
||||
*/
|
||||
void
|
||||
PF_multicast (progs_t *pr)
|
||||
|
@ -1450,7 +1450,7 @@ PF_multicast (progs_t *pr)
|
|||
/*
|
||||
PF_cfopen
|
||||
|
||||
float(string path, string mode) cfopen
|
||||
float (string path, string mode) cfopen
|
||||
*/
|
||||
static void
|
||||
PF_cfopen (progs_t *pr)
|
||||
|
@ -1478,7 +1478,7 @@ PF_cfclose (progs_t *pr)
|
|||
static void
|
||||
PF_cfread (progs_t *pr)
|
||||
{
|
||||
RETURN_STRING (pr, CF_Read((int) P_FLOAT (pr, 0)));
|
||||
RETURN_STRING (pr, CF_Read ((int) P_FLOAT (pr, 0)));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1489,7 +1489,7 @@ PF_cfread (progs_t *pr)
|
|||
static void
|
||||
PF_cfwrite (progs_t *pr)
|
||||
{
|
||||
R_FLOAT (pr) = CF_Write((int) P_FLOAT (pr, 0), P_STRING (pr, 1));
|
||||
R_FLOAT (pr) = CF_Write ((int) P_FLOAT (pr, 0), P_STRING (pr, 1));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1511,7 +1511,7 @@ PF_cfeof (progs_t *pr)
|
|||
static void
|
||||
PF_cfquota (progs_t *pr)
|
||||
{
|
||||
R_FLOAT (pr) = CF_Quota();
|
||||
R_FLOAT (pr) = CF_Quota ();
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1731,7 +1731,7 @@ PF_Fixme (progs_t *pr)
|
|||
static void
|
||||
PF_Checkextension (progs_t *pr)
|
||||
{
|
||||
R_FLOAT(pr) = 0; //FIXME make this function actually useful :P
|
||||
R_FLOAT (pr) = 0; // FIXME: make this function actually useful :P
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1782,7 +1782,7 @@ PF_SV_FreeClient (progs_t *pr)
|
|||
cl->state = cs_free;
|
||||
|
||||
//if (sv_client_disconnect_e->func)
|
||||
// GIB_Event_Callback (sv_client_disconnect_e, 2, va("%u", cl->userid),
|
||||
// GIB_Event_Callback (sv_client_disconnect_e, 2, va ("%u", cl->userid),
|
||||
// "server");
|
||||
}
|
||||
|
||||
|
@ -1845,7 +1845,7 @@ SV_PR_Cmds_Init ()
|
|||
|
||||
PR_AddBuiltin (&sv_pr_state, "makevectors", PF_makevectors, 1); // void (entity e) makevectors
|
||||
PR_AddBuiltin (&sv_pr_state, "setorigin", PF_setorigin, 2); // void (entity e, vector o) setorigin
|
||||
PR_AddBuiltin (&sv_pr_state, "setmodel", PF_setmodel, 3); // void(entity e, string m) setmodel
|
||||
PR_AddBuiltin (&sv_pr_state, "setmodel", PF_setmodel, 3); // void (entity e, string m) setmodel
|
||||
PR_AddBuiltin (&sv_pr_state, "setsize", PF_setsize, 4); // void (entity e, vector min, vector max) setsize
|
||||
PR_AddBuiltin (&sv_pr_state, "fixme", PF_Fixme, 5); // void (entity e, vector min, vector max) setabssize
|
||||
PR_AddBuiltin (&sv_pr_state, "sound", PF_sound, 8); // void (entity e, float chan, string samp) sound
|
||||
|
@ -1873,13 +1873,13 @@ SV_PR_Cmds_Init ()
|
|||
PR_AddBuiltin (&sv_pr_state, "WriteBytes", PF_WriteBytes, -1); // void (float to, ...) WriteBytes
|
||||
PR_AddBuiltin (&sv_pr_state, "writechar", PF_WriteChar, 53); // void (float to, float f) WriteChar
|
||||
PR_AddBuiltin (&sv_pr_state, "writeshort", PF_WriteShort, 54); // void (float to, float f) WriteShort
|
||||
PR_AddBuiltin (&sv_pr_state, "writelong", PF_WriteLong, 55); // void(float to, float f) WriteLong
|
||||
PR_AddBuiltin (&sv_pr_state, "writecoord", PF_WriteCoord, 56); // void(float to, float f) WriteCoord
|
||||
PR_AddBuiltin (&sv_pr_state, "writeangle", PF_WriteAngle, 57); // void(float to, float f) WriteAngle
|
||||
PR_AddBuiltin (&sv_pr_state, "WriteCoordV", PF_WriteCoordV, -1); // void(float to, vector v) WriteCoordV
|
||||
PR_AddBuiltin (&sv_pr_state, "WriteAngleV", PF_WriteAngleV, -1); // void(float to, vector v) WriteAngleV
|
||||
PR_AddBuiltin (&sv_pr_state, "writestring", PF_WriteString, 58); // void(float to, string s) WriteString
|
||||
PR_AddBuiltin (&sv_pr_state, "writeentity", PF_WriteEntity, 59); // void(float to, entity s) WriteEntity
|
||||
PR_AddBuiltin (&sv_pr_state, "writelong", PF_WriteLong, 55); // void (float to, float f) WriteLong
|
||||
PR_AddBuiltin (&sv_pr_state, "writecoord", PF_WriteCoord, 56); // void (float to, float f) WriteCoord
|
||||
PR_AddBuiltin (&sv_pr_state, "writeangle", PF_WriteAngle, 57); // void (float to, float f) WriteAngle
|
||||
PR_AddBuiltin (&sv_pr_state, "WriteCoordV", PF_WriteCoordV, -1); // void (float to, vector v) WriteCoordV
|
||||
PR_AddBuiltin (&sv_pr_state, "WriteAngleV", PF_WriteAngleV, -1); // void (float to, vector v) WriteAngleV
|
||||
PR_AddBuiltin (&sv_pr_state, "writestring", PF_WriteString, 58); // void (float to, string s) WriteString
|
||||
PR_AddBuiltin (&sv_pr_state, "writeentity", PF_WriteEntity, 59); // void (float to, entity s) WriteEntity
|
||||
PR_AddBuiltin (&sv_pr_state, "movetogoal", SV_MoveToGoal, 67); // void (float step) movetogoal
|
||||
PR_AddBuiltin (&sv_pr_state, "precache_file", PF_precache_file, 68); // string (string s) precache_file
|
||||
PR_AddBuiltin (&sv_pr_state, "makestatic", PF_makestatic, 69); // void (entity e) makestatic
|
||||
|
|
|
@ -416,11 +416,11 @@ SV_Multicast (const vec3_t origin, int to)
|
|||
|
||||
if (sv.demorecording) {
|
||||
if (reliable) {
|
||||
//DemoWrite_Begin(dem_multiple, cls, sv.multicast.cursize);
|
||||
DemoWrite_Begin(dem_all, 0, sv.multicast.cursize);
|
||||
// DemoWrite_Begin (dem_multiple, cls, sv.multicast.cursize);
|
||||
DemoWrite_Begin (dem_all, 0, sv.multicast.cursize);
|
||||
SZ_Write (&demo.dbuf->sz, sv.multicast.data, sv.multicast.cursize);
|
||||
} else
|
||||
SZ_Write(&demo.datagram, sv.multicast.data, sv.multicast.cursize);
|
||||
SZ_Write (&demo.datagram, sv.multicast.data, sv.multicast.cursize);
|
||||
}
|
||||
|
||||
SZ_Clear (&sv.multicast);
|
||||
|
@ -571,8 +571,8 @@ SV_WriteClientdataToMessage (client_t *client, sizebuf_t *msg)
|
|||
|
||||
// add this to server demo
|
||||
if (sv.demorecording && msg->cursize) {
|
||||
DemoWrite_Begin(dem_single, clnum, msg->cursize);
|
||||
SZ_Write(&demo.dbuf->sz, msg->data, msg->cursize);
|
||||
DemoWrite_Begin (dem_single, clnum, msg->cursize);
|
||||
SZ_Write (&demo.dbuf->sz, msg->data, msg->cursize);
|
||||
}
|
||||
|
||||
// a fixangle might get lost in a dropped packet. Oh well.
|
||||
|
@ -727,7 +727,7 @@ SV_UpdateToReliableMessages (void)
|
|||
}
|
||||
|
||||
if (sv.demorecording) {
|
||||
DemoWrite_Begin(dem_all, 0, 4);
|
||||
DemoWrite_Begin (dem_all, 0, 4);
|
||||
MSG_WriteByte (&demo.dbuf->sz, svc_updatefrags);
|
||||
MSG_WriteByte (&demo.dbuf->sz, i);
|
||||
MSG_WriteShort (&demo.dbuf->sz,
|
||||
|
@ -786,7 +786,7 @@ SV_UpdateToReliableMessages (void)
|
|||
sv.reliable_datagram.cursize);
|
||||
}
|
||||
if (sv.demorecording)
|
||||
SZ_Write(&demo.datagram, sv.datagram.data, sv.datagram.cursize); // FIXME: ???
|
||||
SZ_Write (&demo.datagram, sv.datagram.data, sv.datagram.cursize); // FIXME: ???
|
||||
|
||||
SZ_Clear (&sv.reliable_datagram);
|
||||
SZ_Clear (&sv.datagram);
|
||||
|
@ -884,7 +884,7 @@ SV_SendClientMessages (void)
|
|||
}
|
||||
|
||||
void
|
||||
SV_SendDemoMessage(void)
|
||||
SV_SendDemoMessage (void)
|
||||
{
|
||||
int i, j, cls = 0;
|
||||
client_t *c;
|
||||
|
@ -909,12 +909,11 @@ SV_SendDemoMessage(void)
|
|||
else
|
||||
min_fps = sv_demofps->value;
|
||||
|
||||
min_fps = max(4, min_fps);
|
||||
min_fps = max (4, min_fps);
|
||||
if (sv.time - demo.time < 1.0 / min_fps)
|
||||
return;
|
||||
|
||||
for (i=0, c = svs.clients ; i<MAX_CLIENTS ; i++, c++)
|
||||
{
|
||||
for (i = 0, c = svs.clients ; i<MAX_CLIENTS ; i++, c++) {
|
||||
if (c->state != cs_spawned)
|
||||
continue; // datagrams only go to spawned
|
||||
|
||||
|
@ -927,12 +926,12 @@ SV_SendDemoMessage(void)
|
|||
}
|
||||
|
||||
msg.data = buf;
|
||||
msg.maxsize = sizeof(buf);
|
||||
msg.maxsize = sizeof (buf);
|
||||
msg.cursize = 0;
|
||||
msg.allowoverflow = true;
|
||||
msg.overflowed = false;
|
||||
|
||||
for (i=0, c = svs.clients; i < MAX_CLIENTS; i++, c++) {
|
||||
for (i = 0, c = svs.clients; i < MAX_CLIENTS; i++, c++) {
|
||||
if (c->state != cs_spawned)
|
||||
continue; // datagrams only go to spawned
|
||||
|
||||
|
@ -941,19 +940,19 @@ SV_SendDemoMessage(void)
|
|||
|
||||
get_stats (c->edict, 0, stats);
|
||||
|
||||
for (j=0 ; j<MAX_CL_STATS ; j++)
|
||||
for (j = 0 ; j < MAX_CL_STATS ; j++)
|
||||
if (stats[j] != demo.stats[i][j]) {
|
||||
demo.stats[i][j] = stats[j];
|
||||
if (stats[j] >=0 && stats[j] <= 255) {
|
||||
DemoWrite_Begin(dem_stats, i, 3);
|
||||
MSG_WriteByte(&demo.dbuf->sz, svc_updatestat);
|
||||
MSG_WriteByte(&demo.dbuf->sz, j);
|
||||
MSG_WriteByte(&demo.dbuf->sz, stats[j]);
|
||||
DemoWrite_Begin (dem_stats, i, 3);
|
||||
MSG_WriteByte (&demo.dbuf->sz, svc_updatestat);
|
||||
MSG_WriteByte (&demo.dbuf->sz, j);
|
||||
MSG_WriteByte (&demo.dbuf->sz, stats[j]);
|
||||
} else {
|
||||
DemoWrite_Begin(dem_stats, i, 6);
|
||||
MSG_WriteByte(&demo.dbuf->sz, svc_updatestatlong);
|
||||
MSG_WriteByte(&demo.dbuf->sz, j);
|
||||
MSG_WriteLong(&demo.dbuf->sz, stats[j]);
|
||||
DemoWrite_Begin (dem_stats, i, 6);
|
||||
MSG_WriteByte (&demo.dbuf->sz, svc_updatestatlong);
|
||||
MSG_WriteByte (&demo.dbuf->sz, j);
|
||||
MSG_WriteLong (&demo.dbuf->sz, stats[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -965,30 +964,31 @@ SV_SendDemoMessage(void)
|
|||
if (!demo.recorder.delta_sequence)
|
||||
demo.recorder.delta_sequence = -1;
|
||||
SV_WriteEntitiesToClient (&demo.recorder, &msg, true);
|
||||
DemoWrite_Begin(dem_all, 0, msg.cursize);
|
||||
DemoWrite_Begin (dem_all, 0, msg.cursize);
|
||||
SZ_Write (&demo.dbuf->sz, msg.data, msg.cursize);
|
||||
// copy the accumulated multicast datagram
|
||||
// for this client out to the message
|
||||
if (demo.datagram.cursize) {
|
||||
DemoWrite_Begin(dem_all, 0, demo.datagram.cursize);
|
||||
DemoWrite_Begin (dem_all, 0, demo.datagram.cursize);
|
||||
SZ_Write (&demo.dbuf->sz, demo.datagram.data, demo.datagram.cursize);
|
||||
SZ_Clear (&demo.datagram);
|
||||
}
|
||||
|
||||
demo.recorder.delta_sequence = demo.recorder.netchan.incoming_sequence&255;
|
||||
demo.recorder.delta_sequence =
|
||||
demo.recorder.netchan.incoming_sequence & 255;
|
||||
demo.recorder.netchan.incoming_sequence++;
|
||||
demo.frames[demo.parsecount&DEMO_FRAMES_MASK].time = demo.time = sv.time;
|
||||
demo.frames[demo.parsecount & DEMO_FRAMES_MASK].time = demo.time = sv.time;
|
||||
|
||||
// that's a backup of 3sec in 20fps, should be enough
|
||||
if (demo.parsecount - demo.lastwritten > 60) {
|
||||
SV_DemoWritePackets(1);
|
||||
SV_DemoWritePackets (1);
|
||||
}
|
||||
|
||||
demo.parsecount++;
|
||||
DemoSetMsgBuf(demo.dbuf,
|
||||
&demo.frames[demo.parsecount&DEMO_FRAMES_MASK].buf);
|
||||
DemoSetMsgBuf (demo.dbuf,
|
||||
&demo.frames[demo.parsecount & DEMO_FRAMES_MASK].buf);
|
||||
|
||||
if (sv_demoMaxSize->int_val && demo.size > sv_demoMaxSize->int_val*1024)
|
||||
if (sv_demoMaxSize->int_val && demo.size > sv_demoMaxSize->int_val * 1024)
|
||||
SV_Stop (1);
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ info_t **svs_info = &svs.info;
|
|||
|
||||
#ifdef __alpha__
|
||||
static inline unsigned long
|
||||
rdfpcr(void)
|
||||
rdfpcr (void)
|
||||
{
|
||||
unsigned long tmp, ret;
|
||||
|
||||
|
@ -89,7 +89,7 @@ rdfpcr(void)
|
|||
}
|
||||
|
||||
static inline void
|
||||
wrfpcr(unsigned long val)
|
||||
wrfpcr (unsigned long val)
|
||||
{
|
||||
unsigned long tmp;
|
||||
|
||||
|
|
|
@ -171,7 +171,8 @@ SV_New_f (ucmd_t *cmd)
|
|||
|
||||
// Trigger GIB connection event
|
||||
if (sv_client_connect_e->func)
|
||||
GIB_Event_Callback (sv_client_connect_e, 1, va("%u", host_client->userid));
|
||||
GIB_Event_Callback (sv_client_connect_e, 1, va ("%u",
|
||||
host_client->userid));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -294,7 +295,7 @@ SV_PreSpawn_f (ucmd_t *cmd)
|
|||
// should be three numbers following containing checksums
|
||||
check = atoi (Cmd_Argv (3));
|
||||
|
||||
// Con_DPrintf("Client check = %d\n", check);
|
||||
// Con_DPrintf ("Client check = %d\n", check);
|
||||
|
||||
if (sv_mapcheck->int_val && check != sv.worldmodel->checksum &&
|
||||
check != sv.worldmodel->checksum2) {
|
||||
|
@ -317,7 +318,7 @@ SV_PreSpawn_f (ucmd_t *cmd)
|
|||
else
|
||||
command = va ("cmd prespawn %i %i\n", svs.spawncount, buf + 1);
|
||||
|
||||
size = sv.signon_buffer_size[buf] + 1 + strlen(command) + 1;
|
||||
size = sv.signon_buffer_size[buf] + 1 + strlen (command) + 1;
|
||||
|
||||
ClientReliableCheckBlock (host_client, size);
|
||||
if (host_client->num_backbuf)
|
||||
|
@ -546,7 +547,8 @@ SV_Begin_f (ucmd_t *cmd)
|
|||
|
||||
// Trigger GIB events
|
||||
if (sv_client_spawn_e->func)
|
||||
GIB_Event_Callback (sv_client_spawn_e, 1, va("%u", host_client->userid));
|
||||
GIB_Event_Callback (sv_client_spawn_e, 1, va ("%u",
|
||||
host_client->userid));
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
@ -801,7 +803,7 @@ SV_Say (qboolean team)
|
|||
host_client->whensaid[host_client->whensaidhead] = realtime;
|
||||
}
|
||||
|
||||
p = Hunk_TempAlloc (strlen(Cmd_Args (1)) + 1);
|
||||
p = Hunk_TempAlloc (strlen (Cmd_Args (1)) + 1);
|
||||
strcpy (p, Cmd_Args (1));
|
||||
|
||||
if (*p == '"') {
|
||||
|
@ -824,7 +826,8 @@ SV_Say (qboolean team)
|
|||
}
|
||||
|
||||
if (sv_chat_e->func)
|
||||
GIB_Event_Callback (sv_chat_e, 2, va("%i", host_client->userid), p, type);
|
||||
GIB_Event_Callback (sv_chat_e, 2, va ("%i", host_client->userid), p,
|
||||
type);
|
||||
|
||||
strncat (text, p, sizeof (text) - strlen (text));
|
||||
strncat (text, "\n", sizeof (text) - strlen (text));
|
||||
|
|
|
@ -352,52 +352,52 @@ locs_loc (void)
|
|||
mapname = malloc (sizeof (cl.worldmodel->name));
|
||||
if (!mapname)
|
||||
Sys_Error ("Can't duplicate mapname!");
|
||||
map_to_loc (cl.worldmodel->name,mapname);
|
||||
map_to_loc (cl.worldmodel->name, mapname);
|
||||
snprintf (locfile, sizeof (locfile), "%s/%s/%s", fs_userpath->string,
|
||||
qfs_gamedir->dir.def, mapname);
|
||||
free(mapname);
|
||||
free (mapname);
|
||||
|
||||
if (strcasecmp (Cmd_Argv(1),"save") == 0) {
|
||||
if (strcasecmp (Cmd_Argv (1), "save") == 0) {
|
||||
if (Cmd_Argc () == 2) {
|
||||
locs_save (locfile, false);
|
||||
} else
|
||||
Con_Printf ("loc save :saves locs from memory into a .loc file\n");
|
||||
}
|
||||
|
||||
if (strcasecmp (Cmd_Argv(1),"zsave") == 0) {
|
||||
if (strcasecmp (Cmd_Argv (1), "zsave") == 0) {
|
||||
if (Cmd_Argc () == 2) {
|
||||
locs_save (locfile, true);
|
||||
} else
|
||||
Con_Printf ("loc save :saves locs from memory into a .loc file\n");
|
||||
}
|
||||
|
||||
if (strcasecmp (Cmd_Argv(1),"add") == 0) {
|
||||
if (strcasecmp (Cmd_Argv (1), "add") == 0) {
|
||||
if (Cmd_Argc () >= 3)
|
||||
locs_mark (cl.simorg,desc);
|
||||
locs_mark (cl.simorg, desc);
|
||||
else
|
||||
Con_Printf ("loc add <description> :marks the current location "
|
||||
"with the description and records the information "
|
||||
"into a loc file.\n");
|
||||
}
|
||||
|
||||
if (strcasecmp (Cmd_Argv(1),"rename") == 0) {
|
||||
if (strcasecmp (Cmd_Argv (1), "rename") == 0) {
|
||||
if (Cmd_Argc () >= 3)
|
||||
locs_edit (cl.simorg,desc);
|
||||
locs_edit (cl.simorg, desc);
|
||||
else
|
||||
Con_Printf ("loc rename <description> :changes the description of "
|
||||
"the nearest location marker\n");
|
||||
}
|
||||
|
||||
if (strcasecmp (Cmd_Argv(1),"delete") == 0) {
|
||||
if (strcasecmp (Cmd_Argv (1),"delete") == 0) {
|
||||
if (Cmd_Argc () == 2)
|
||||
locs_del (cl.simorg);
|
||||
else
|
||||
Con_Printf ("loc delete :removes nearest location marker\n");
|
||||
}
|
||||
|
||||
if (strcasecmp (Cmd_Argv(1),"move") == 0) {
|
||||
if (strcasecmp (Cmd_Argv (1),"move") == 0) {
|
||||
if (Cmd_Argc () == 2)
|
||||
locs_edit (cl.simorg,NULL);
|
||||
locs_edit (cl.simorg, NULL);
|
||||
else
|
||||
Con_Printf ("loc move :moves the nearest location marker to your "
|
||||
"current location\n");
|
||||
|
@ -409,7 +409,7 @@ Locs_Loc_Get (void)
|
|||
{
|
||||
location_t *location;
|
||||
|
||||
if (GIB_Argc() != 1)
|
||||
if (GIB_Argc () != 1)
|
||||
GIB_USAGE ("");
|
||||
else {
|
||||
location = locs_find (cl.simorg);
|
||||
|
@ -436,7 +436,7 @@ Team_F_Skins (char *args)
|
|||
{
|
||||
int totalfb, l;
|
||||
|
||||
while(isspace((byte) *args))
|
||||
while (isspace ((byte) *args))
|
||||
args++;
|
||||
for (l = 0; args[l] && !isspace ((byte) args[l]); l++);
|
||||
|
||||
|
@ -469,8 +469,8 @@ Team_ParseChat (const char *string)
|
|||
if (!cl_freply->value)
|
||||
return;
|
||||
|
||||
s = strchr(string, ':');
|
||||
if (!(s = strchr(string, ':')))
|
||||
s = strchr (string, ':');
|
||||
if (!(s = strchr (string, ':')))
|
||||
return;
|
||||
s++;
|
||||
while (isspace ((byte) *s))
|
||||
|
|
Loading…
Reference in a new issue