Skip to content

Commit

Permalink
This commit was generated by cvs2svn to compensate for changes in r39,
Browse files Browse the repository at this point in the history
which included commits to RCS files with non-trunk default branches.
  • Loading branch information
VVD committed Oct 18, 2004
1 parent 8c76740 commit f896b87
Show file tree
Hide file tree
Showing 11 changed files with 162 additions and 42 deletions.
7 changes: 7 additions & 0 deletions changes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
----
QWEX v0.170b Beta DEVELOP
[server]
- just minor changes:
all star keys from userinfo are visible to clients
active weapon of the chased player is visible on the spectators HUD

----
QWEX v0.169 Beta DEVELOP
[server]
Expand Down
2 changes: 1 addition & 1 deletion source/cl_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ static void CL_Record (void)
MSG_WriteByte (&buf, svc_updateuserinfo);
MSG_WriteByte (&buf, i);
MSG_WriteLong (&buf, player->userid);
MSG_WriteString (&buf, player->userinfoshort);
MSG_WriteString (&buf, player->userinfo);

if (buf.cursize > MAX_MSGLEN/2) {
CL_WriteRecordDemoMessage (&buf, seq++);
Expand Down
46 changes: 45 additions & 1 deletion source/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1770,7 +1770,51 @@ char *Info_ValueForKey (char *s, char *key)
return "";
s++;
}
}
}


char *Info_KeyNameForKeyNum (char *s, int key)
{
static char pkey[4][512]; // use two buffers so compares
// work without stomping on each other
static int keyindex;
char *o;

keyindex = (keyindex + 1) % 4;
if (*s == '\\')
s++;

// ?
if (key < 1)
return NULL;

while (1)
{
key--;

// get key name
o = pkey[keyindex];
while (*s != '\\')
{
if (!*s)
return "";
*o++ = *s++;
}
*o = 0;
s++;

// skip key value
while (*s != '\\' && *s) s++;

if (!key)
return pkey[keyindex];

if (!*s)
return NULL;
s++;
}
}


void Info_RemoveKey (char *s, char *key)
{
Expand Down
3 changes: 2 additions & 1 deletion source/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ void COM_LoadCacheFile (char *path, struct cache_user_s *cu);
void COM_CreatePath (char *path);
void COM_Gamedir (char *dir);

char *Info_ValueForKey (char *s, char *key);
char *Info_ValueForKey (char *s, char *key);
char *Info_KeyNameForKeyNum (char *s, int key);
void Info_RemoveKey (char *s, char *key);
void Info_RemovePrefixedKeys (char *start, char prefix);
void Info_SetValueForKey (char *s, char *key, char *value, int maxsize);
Expand Down
36 changes: 23 additions & 13 deletions source/net_wins.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// net_wins.c


#include "quakedef.h"
#include "winquake.h"

#include "winquake.h"

netadr_t net_local_adr;

netadr_t net_from;
Expand Down Expand Up @@ -146,7 +146,8 @@ qboolean NET_GetPacket (int net_socket)
{
int ret;
struct sockaddr_in from;
int fromlen;
int fromlen;
unsigned long _true = 1;

// Tonik -->
if (net_socket == net_clientsocket && loop_s2c_messageLength > 0)
Expand All @@ -173,7 +174,8 @@ qboolean NET_GetPacket (int net_socket)
}
// <-- Tonik

fromlen = sizeof(from);
fromlen = sizeof(from);
//ioctlsocket (net_socket, FIONBIO, &_true);
ret = recvfrom (net_socket, (char *)net_message_buffer, sizeof(net_message_buffer), 0, (struct sockaddr *)&from, &fromlen);
SockadrToNetadr (&from, &net_from);

Expand Down Expand Up @@ -206,8 +208,8 @@ qboolean NET_GetPacket (int net_socket)
return ret;
}

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

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

void NET_SendPacket (int net_socket, int length, void *data, netadr_t to)
{
int ret;
Expand Down Expand Up @@ -236,9 +238,9 @@ void NET_SendPacket (int net_socket, int length, void *data, netadr_t to)
return;
}
// <-- Tonik

NetadrToSockadr (&to, &addr);


//#ifdef SERVERONLY
ret = sendto (net_socket, data, length, 0, (struct sockaddr *)&addr, sizeof(addr) );
if (ret == -1)
{
Expand All @@ -254,7 +256,7 @@ void NET_SendPacket (int net_socket, int length, void *data, netadr_t to)
else
#endif
Con_Printf ("NET_SendPacket ERROR: %i\n", errno);
}
}
}

//=============================================================================
Expand Down Expand Up @@ -339,20 +341,28 @@ int NET_Init (int clientport, int serverport)

wVersionRequested = MAKEWORD(1, 1);

r = WSAStartup (MAKEWORD(1, 1), &winsockdata);
r = WSAStartup (MAKEWORD(2, 0), &winsockdata);
//r = WSAStartup (MAKEWORD(1, 1), &winsockdata);

if (r)
Sys_Error ("Winsock initialization failed.");

//
//
// open the single socket to be used for all communications
//
// net_socket = UDP_OpenSocket (port);
if (clientport)
net_clientsocket = UDP_OpenSocket (&clientport, true);

if (serverport)
net_serversocket = UDP_OpenSocket (&serverport, false);
net_serversocket = UDP_OpenSocket (&serverport, false);

#if 0//ndef SERVERONLY
{
static DWORD id;
CreateThread( NULL, 0, NET_SendTo_, NULL, 0, &id);
}
#endif
//
// init the message buffer
//
Expand Down
12 changes: 11 additions & 1 deletion source/sv_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ void SVC_DirectConnect (void)
client_t temp;
edict_t *ent;
int edictnum;
char *s;
char *s, *key;
int clients, spectators, vips;
qboolean spectator;
int qport;
Expand Down Expand Up @@ -829,6 +829,16 @@ void SVC_DirectConnect (void)
{
s = Info_ValueForKey(newcl->userinfo, shortinfotbl[i]);
Info_SetValueForStarKey (newcl->userinfoshort, shortinfotbl[i], s, MAX_INFO_STRING);
}

// move star keys to infoshort
for (i= 1; (key = Info_KeyNameForKeyNum(newcl->userinfo, i)) != NULL; i++)
{
if (key[0] != '*')
continue;

s = Info_ValueForKey(newcl->userinfo, key);
Info_SetValueForStarKey (newcl->userinfoshort, key, s, MAX_INFO_STRING);
}

// JACK: Init the floodprot stuff.
Expand Down
2 changes: 1 addition & 1 deletion source/sv_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ void SV_UpdateClientStats (client_t *client)
stats[STAT_NAILS] = ent->v.ammo_nails;
stats[STAT_ROCKETS] = ent->v.ammo_rockets;
stats[STAT_CELLS] = ent->v.ammo_cells;
if (!client->spectator)
if (!client->spectator || client->spec_track > 0)
stats[STAT_ACTIVEWEAPON] = ent->v.weapon;
// stuff the sigil bits into the high bits of items for sbar
stats[STAT_ITEMS] = (int)ent->v.items | ((int)pr_global_struct->serverflags << 28);
Expand Down
20 changes: 16 additions & 4 deletions source/sv_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -1274,9 +1274,9 @@ char *shortinfotbl[] =
"skin",
"topcolor",
"bottomcolor",
"*client",
"*spectator",
"*VIP",
//"*client",
//"*spectator",
//"*VIP",
NULL
};

Expand Down Expand Up @@ -1342,7 +1342,19 @@ void SV_SetInfo_f (void)
MSG_WriteString (&sv.reliable_datagram, Cmd_Argv(1));
MSG_WriteString (&sv.reliable_datagram, new);
break;
}
}

// if start key send to others
if (Cmd_Argv(1)[0] == '*') {
char *new = Info_ValueForKey(host_client->userinfo, Cmd_Argv(1));
Info_SetValueForKey (host_client->userinfoshort, Cmd_Argv(1), new, MAX_INFO_STRING);

i = host_client - svs.clients;
MSG_WriteByte (&sv.reliable_datagram, svc_setinfo);
MSG_WriteByte (&sv.reliable_datagram, i);
MSG_WriteString (&sv.reliable_datagram, Cmd_Argv(1));
MSG_WriteString (&sv.reliable_datagram, new);
}
}

/*
Expand Down
6 changes: 4 additions & 2 deletions source/sys_win.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,11 @@ char *Sys_ConsoleInput (void)

return NULL;
}


void SleepUntilInput(int);
void Sys_Sleep (void)
{
{
SleepUntilInput(1);
}


Expand Down
4 changes: 2 additions & 2 deletions source/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#define GLQUAKE_VERSION 1.00
#define QW_VERSION 2.40
#define QWE_VERSION "0.169 Beta"
#define QWE_VERNUM 0.169
#define QWE_VERSION "0.170 Beta"
#define QWE_VERNUM 0.170
#define LINUX_VERSION 0.98

#define RELEASE_VERSION
Expand Down
66 changes: 50 additions & 16 deletions source/winquake.rc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,56 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_DIALOG2 DIALOGEX 50, 20, 279, 233
STYLE WS_MINIMIZEBOX | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Mvdsv - QW server"
CLASS "mvdsv"
FONT 9, "Arial"
BEGIN
EDITTEXT IDC_EDIT2,6,193,268,13,ES_AUTOHSCROLL | WS_GROUP
DEFPUSHBUTTON "OK",IDC_OK,265,215,9,10,NOT WS_VISIBLE
PUSHBUTTON "QUIT",IDC_QUIT,224,211,50,14,WS_GROUP
EDITTEXT IDC_EDIT1,6,5,268,181,ES_MULTILINE | ES_AUTOVSCROLL |
ES_READONLY | ES_WANTRETURN | NOT WS_BORDER | WS_VSCROLL |
NOT WS_TABSTOP,WS_EX_CLIENTEDGE
PUSHBUTTON "CLEAR",IDC_CLEAR,6,211,50,14
END

IDD_DIALOG1 DIALOGEX 0, 0, 167, 27
STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | WS_POPUP |
WS_VISIBLE
EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE
FONT 16, "Times New Roman", 0, 0, 0x1
BEGIN
CONTROL 117,IDC_STATIC,"Static",SS_BITMAP | SS_REALSIZEIMAGE,0,0,
167,28
END


/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//

#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_DIALOG2, DIALOG
BEGIN
LEFTMARGIN, 6
RIGHTMARGIN, 274
TOPMARGIN, 5
BOTTOMMARGIN, 225
END
END
#endif // APSTUDIO_INVOKED


#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
Expand Down Expand Up @@ -56,22 +106,6 @@ END
// remains consistent on all systems.
IDI_ICON2 ICON DISCARDABLE "qwcl2.ico"

/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_DIALOG1 DIALOGEX 0, 0, 167, 27
STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | WS_POPUP |
WS_VISIBLE
EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE
FONT 16, "Times New Roman"
BEGIN
CONTROL 117,IDC_STATIC,"Static",SS_BITMAP | SS_REALSIZEIMAGE,0,0,
167,28
END


/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
Expand Down

0 comments on commit f896b87

Please sign in to comment.