Originally Posted by
habitat666
Hey all.
Wondering if anyone has a good/easy/reliable way to detect if a player is in a match and not just the lobby. Been looking around, but I'm afraid I am just not using the best search terms.
Anyway, this can be C++ and/or C#.
Thanks!
Apologies if this is the wrong forum. I thought it'd fit here.
Code:
typedef struct {
gameState_t gameState; // gamestate from server
glconfig_t glconfig; // rendering configuration
float screenXScale; // derived from glconfig
float screenYScale;
float screenXBias;
int serverCommandSequence; // reliable command stream counter
int processedSnapshotNum;// the number of snapshots cgame has requested
qboolean localServer; // detected on startup by checking sv_running
// parsed from serverinfo
gametype_t gametype;
int dmflags;
int teamflags;
int fraglimit;
int capturelimit;
int timelimit;
int maxclients;
char mapname[MAX_QPATH];
char redTeam[MAX_QPATH];
char blueTeam[MAX_QPATH];
int voteTime;
int voteYes;
int voteNo;
qboolean voteModified; // beep whenever changed
char voteString[MAX_STRING_TOKENS];
int teamVoteTime[2];
int teamVoteYes[2];
int teamVoteNo[2];
qboolean teamVoteModified[2]; // beep whenever changed
char teamVoteString[2][MAX_STRING_TOKENS];
int levelStartTime;
int scores1, scores2; // from configstrings
int redflag, blueflag; // flag status from configstrings
int flagStatus;
qboolean newHud;
//
// locally derived information from gamestate
//
qhandle_t gameModels[MAX_MODELS];
sfxHandle_t gameSounds[MAX_SOUNDS];
int numInlineModels;
qhandle_t inlineDrawModel[MAX_MODELS];
vec3_t inlineModelMidpoints[MAX_MODELS];
clientInfo_t clientinfo[MAX_CLIENTS];
// teamchat width is *3 because of embedded color codes
char teamChatMsgs[TEAMCHAT_HEIGHT][TEAMCHAT_WIDTH*3+1];
int teamChatMsgTimes[TEAMCHAT_HEIGHT];
int teamChatPos;
int teamLastChatPos;
int cursorX;
int cursorY;
qboolean eventHandling;
qboolean mouseCaptured;
qboolean sizingHud;
void *capturedItem;
qhandle_t activeCursor;
// orders
int currentOrder;
qboolean orderPending;
int orderTime;
int currentVoiceClient;
int acceptOrderTime;
int acceptTask;
int acceptLeader;
char acceptVoice[MAX_NAME_LENGTH];
// media
cgMedia_t media;
} cgs_t;
this class is from the quake3 engine sdk, its still there in cod ghosts