Skip to content

Commit

Permalink
formattings
Browse files Browse the repository at this point in the history
  • Loading branch information
IR4T4 committed Oct 14, 2012
1 parent 2f2c477 commit 78eb702
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 85 deletions.
40 changes: 9 additions & 31 deletions src/server/server.h
Expand Up @@ -127,7 +127,6 @@ typedef struct
int num_tags;
} server_t;


typedef struct
{
int areabytes;
Expand Down Expand Up @@ -237,7 +236,6 @@ typedef struct client_s

//=============================================================================


// MAX_CHALLENGES is made large to prevent a denial
// of service attack that could cycle all of them
// out before legitimate users connected
Expand Down Expand Up @@ -279,7 +277,6 @@ typedef struct tempBan_s
int endtime;
} tempBan_t;


#define MAX_MASTERS 8 // max recipients for heartbeat packets
#define MAX_TEMPBAN_ADDRESSES MAX_CLIENTS

Expand Down Expand Up @@ -312,14 +309,12 @@ typedef struct
int serverLoad;
} serverStatic_t;


//=============================================================================

extern serverStatic_t svs; // persistant server info across maps
extern server_t sv; // cleared each map
extern vm_t *gvm; // game virtual machine


#define MAX_MASTER_SERVERS 5

extern cvar_t *sv_fps;
Expand Down Expand Up @@ -382,9 +377,8 @@ extern cvar_t *sv_protect;

//===========================================================

//
// sv_main.c
//

void SV_FinalCommand(char *cmd, qboolean disconnect); // ydnar: added disconnect flag so map changes can use this function as well
void QDECL SV_SendServerCommand(client_t *cl, const char *fmt, ...) __attribute__ ((format(printf, 2, 3)));

Expand All @@ -397,10 +391,8 @@ void SV_MasterShutdown(void);

void SV_MasterGameCompleteStatus(void); // NERVE - SMF


//
// sv_init.c
//

void SV_SetConfigstringNoUpdate(int index, const char *val);
void SV_SetConfigstring(int index, const char *val);
void SV_UpdateConfigStrings(void);
Expand All @@ -412,10 +404,8 @@ void SV_GetUserinfo(int index, char *buffer, int bufferSize);
void SV_ChangeMaxClients(void);
void SV_SpawnServer(char *server, qboolean killBots);


//
// sv_client.c
//

void SV_GetChallenge(netadr_t from);

void SV_DirectConnect(netadr_t from);
Expand All @@ -433,17 +423,15 @@ void SV_ClientThink(client_t *cl, usercmd_t *cmd);

void SV_WriteDownloadToClient(client_t *cl, msg_t *msg);

//
// sv_ccmds.c
//

void SV_Heartbeat_f(void);

qboolean SV_TempBanIsBanned(netadr_t address);
void SV_TempBanNetAddress(netadr_t address, int length);

//
// sv_snapshot.c
//

void SV_AddServerCommand(client_t *client, const char *cmd);
void SV_UpdateServerCommandsToClient(client_t *client, msg_t *msg);
void SV_WriteFrameToClient(client_t *client, msg_t *msg);
Expand All @@ -453,9 +441,8 @@ void SV_SendClientSnapshot(client_t *client);
void SV_CheckClientUserinfoTimer(void);
void SV_SendClientIdle(client_t *client);

//
// sv_game.c
//

int SV_NumForGentity(sharedEntity_t *ent);

sharedEntity_t *SV_GentityNum(int num);
Expand All @@ -472,9 +459,8 @@ int SV_LoadTag(const char *mod_name);

void SV_GameBinaryMessageReceived(int cno, const char *buf, int buflen, int commandTime);

//
// sv_bot.c
//

int SV_BotAllocateClient(int clientNum);
void SV_BotFreeClient(int clientNum);

Expand All @@ -484,9 +470,8 @@ int BotImport_DebugPolygonCreate(int color, int numPoints, vec3_t *points);
void BotImport_DebugPolygonDelete(int id);

//============================================================
//

// high level object sorting to reduce interaction tests
//

void SV_ClearWorld(void);
// called after the world model has been loaded, before linking any entities
Expand All @@ -502,13 +487,10 @@ void SV_LinkEntity(sharedEntity_t *ent);
// sets ent->leafnums[] for pvs determination even if the entity
// is not solid


clipHandle_t SV_ClipHandleForEntity(const sharedEntity_t *ent);


void SV_SectorList_f(void);


int SV_AreaEntities(const vec3_t mins, const vec3_t maxs, int *entityList, int maxcount);
// fills in a table of entity numbers with entities that have bounding boxes
// that intersect the given area. It is possible for a non-axial bmodel
Expand All @@ -517,11 +499,9 @@ int SV_AreaEntities(const vec3_t mins, const vec3_t maxs, int *entityList, int m
// returns the number of pointers filled in
// The world entity is never returned in this list.


int SV_PointContents(const vec3_t p, int passEntityNum);
// returns the CONTENTS_* value from the world and all entities at the given point.


void SV_Trace(trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask, int capsule);
// mins and maxs are relative

Expand All @@ -533,13 +513,11 @@ void SV_Trace(trace_t *results, const vec3_t start, const vec3_t mins, const vec

// passEntityNum is explicitly excluded from clipping checks (normally ENTITYNUM_NONE)


void SV_ClipToEntity(trace_t *trace, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int entityNum, int contentmask, int capsule);
// clip to a specific entity

//
// sv_net_chan.c
//

void SV_Netchan_Transmit(client_t *client, msg_t *msg);
void SV_Netchan_TransmitNextFragment(client_t *client);
qboolean SV_Netchan_Process(client_t *client, msg_t *msg);
Expand Down
5 changes: 0 additions & 5 deletions src/server/sv_bot.c
Expand Up @@ -238,7 +238,6 @@ void BotImport_EntityTrace(bsp_trace_t *bsptrace, vec3_t start, vec3_t mins, vec
bsptrace->contents = 0;
}


/*
==================
BotImport_PointContents
Expand Down Expand Up @@ -502,7 +501,6 @@ void BotImport_DebugLineShow(int line, vec3_t start, vec3_t end, int color)
BotImport_DebugPolygonShow(line, color, 4, points);
}


/*
==================
SV_BotClientCommand
Expand Down Expand Up @@ -574,10 +572,7 @@ void SV_BotInitBotLib(void)
botlib_export = (botlib_export_t *)GetBotLibAPI(BOTLIB_API_VERSION, &botlib_import);
}


//
// * * * BOT AI CODE IS BELOW THIS POINT * * *
//

/*
==================
Expand Down
14 changes: 7 additions & 7 deletions src/server/sv_client.c
Expand Up @@ -259,10 +259,10 @@ void SV_DirectConnect(netadr_t from)

// this doesn't work because it nukes the players userinfo

// // disconnect the client from the game first so any flags the
// // player might have are dropped
// VM_Call( gvm, GAME_CLIENT_DISCONNECT, newcl - svs.clients );
//
// disconnect the client from the game first so any flags the
// player might have are dropped
//VM_Call( gvm, GAME_CLIENT_DISCONNECT, newcl - svs.clients );

goto gotnewcl;
}
}
Expand Down Expand Up @@ -1968,7 +1968,7 @@ void SV_ExecuteClientMessage(client_t *cl, msg_t *msg)

SV_ParseBinaryMessage(cl, msg);

// if ( msg->readcount != msg->cursize ) {
// Com_Printf( "WARNING: Junk at end of packet for client %i\n", cl - svs.clients );
// }
// if ( msg->readcount != msg->cursize ) {
// Com_Printf( "WARNING: Junk at end of packet for client %i\n", cl - svs.clients );
// }
}
13 changes: 0 additions & 13 deletions src/server/sv_game.c
Expand Up @@ -115,7 +115,6 @@ void SV_GameSendServerCommand(int clientNum, const char *text)
}
}


/*
===============
SV_GameDropClient
Expand All @@ -136,7 +135,6 @@ void SV_GameDropClient(int clientNum, const char *reason, int length)
}
}


/*
=================
SV_SetBrushModel
Expand Down Expand Up @@ -173,8 +171,6 @@ void SV_SetBrushModel(sharedEntity_t *ent, const char *name)
SV_LinkEntity(ent); // FIXME: remove
}



/*
=================
SV_inPVS
Expand Down Expand Up @@ -208,7 +204,6 @@ qboolean SV_inPVS(const vec3_t p1, const vec3_t p2)
return qtrue;
}


/*
=================
SV_inPVSIgnorePortals
Expand Down Expand Up @@ -237,7 +232,6 @@ qboolean SV_inPVSIgnorePortals(const vec3_t p1, const vec3_t p2)
return qtrue;
}


/*
========================
SV_AdjustAreaPortalState
Expand All @@ -255,7 +249,6 @@ void SV_AdjustAreaPortalState(sharedEntity_t *ent, qboolean open)
CM_AdjustAreaPortalState(svEnt->areanum, svEnt->areanum2, open);
}


/*
==================
SV_GameAreaEntities
Expand All @@ -278,7 +271,6 @@ qboolean SV_EntityContact(const vec3_t mins, const vec3_t maxs, const sharedEnti
return trace.startsolid;
}


/*
===============
SV_GetServerinfo
Expand Down Expand Up @@ -311,7 +303,6 @@ void SV_LocateGameData(sharedEntity_t *gEnts, int numGEntities, int sizeofGEntit
sv.gameClientSize = sizeofGameClient;
}


/*
===============
SV_GetUsercmd
Expand Down Expand Up @@ -692,8 +683,6 @@ static void SV_InitGameVM(qboolean restart)
VM_Call(gvm, GAME_INIT, svs.time, Com_Milliseconds(), restart);
}



/*
===================
SV_RestartGameProgs
Expand Down Expand Up @@ -723,7 +712,6 @@ void SV_RestartGameProgs(void)
#endif
}


/*
===============
SV_InitGameProgs
Expand All @@ -750,7 +738,6 @@ void SV_InitGameProgs(void)
#endif
}


/*
====================
SV_GameCommand
Expand Down
8 changes: 4 additions & 4 deletions src/server/sv_main.c
Expand Up @@ -231,7 +231,6 @@ void QDECL SV_SendServerCommand(client_t *cl, const char *fmt, ...)
}
}


/*
==============================================================================
Expand Down Expand Up @@ -442,7 +441,6 @@ void SV_MasterShutdown(void)
// it will be removed from the list
}


/*
==============================================================================
Expand All @@ -451,7 +449,6 @@ CONNECTIONLESS COMMANDS
==============================================================================
*/


typedef struct leakyBucket_s leakyBucket_t;
struct leakyBucket_s
{
Expand Down Expand Up @@ -1007,7 +1004,6 @@ static void SVC_RemoteCommand(netadr_t from, msg_t *msg)
Q_strcat(remaining, sizeof(remaining), cmd_aux);

Cmd_ExecuteString(remaining);

}

Com_EndRedirect();
Expand Down Expand Up @@ -1174,6 +1170,10 @@ static void SV_CalcPings(void)
if (cl->gentity->r.svFlags & SVF_BOT)
{
cl->ping = 0;

// let the game dll know about the ping - we are using mod based bots
ps = SV_GameClientNum(i);
ps->ping = cl->ping;
continue;
}

Expand Down

0 comments on commit 78eb702

Please sign in to comment.