mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-26 22:40:50 +00:00
Merge pull request #278 from DanielGibson/remember-addressbook
Don't forget entries of Multiplayer "Address Book"
This commit is contained in:
commit
f0240af308
5 changed files with 16 additions and 7 deletions
|
@ -366,7 +366,7 @@ NET_AdrToString(netadr_t a)
|
|||
}
|
||||
|
||||
qboolean
|
||||
NET_StringToSockaddr(char *s, struct sockaddr_storage *sadr)
|
||||
NET_StringToSockaddr(const char *s, struct sockaddr_storage *sadr)
|
||||
{
|
||||
char copy[128];
|
||||
char *addrs, *space;
|
||||
|
@ -440,7 +440,7 @@ NET_StringToSockaddr(char *s, struct sockaddr_storage *sadr)
|
|||
}
|
||||
|
||||
qboolean
|
||||
NET_StringToAdr(char *s, netadr_t *a)
|
||||
NET_StringToAdr(const char *s, netadr_t *a)
|
||||
{
|
||||
struct sockaddr_storage sadr;
|
||||
|
||||
|
|
|
@ -385,7 +385,7 @@ NET_AdrToString(netadr_t a)
|
|||
* 192.246.40.70:28000
|
||||
*/
|
||||
qboolean
|
||||
NET_StringToSockaddr(char *s, struct sockaddr_storage *sadr)
|
||||
NET_StringToSockaddr(const char *s, struct sockaddr_storage *sadr)
|
||||
{
|
||||
char copy[128];
|
||||
char *addrs, *space;
|
||||
|
@ -465,7 +465,7 @@ NET_StringToSockaddr(char *s, struct sockaddr_storage *sadr)
|
|||
* 192.246.40.70:28000
|
||||
*/
|
||||
qboolean
|
||||
NET_StringToAdr(char *s, netadr_t *a)
|
||||
NET_StringToAdr(const char *s, netadr_t *a)
|
||||
{
|
||||
struct sockaddr_storage sadr;
|
||||
|
||||
|
|
|
@ -494,7 +494,7 @@ CL_PingServers_f(void)
|
|||
int i;
|
||||
netadr_t adr;
|
||||
char name[32];
|
||||
char *adrstring;
|
||||
const char *adrstring;
|
||||
cvar_t *noudp;
|
||||
cvar_t *noipx;
|
||||
|
||||
|
@ -530,7 +530,7 @@ CL_PingServers_f(void)
|
|||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
Com_sprintf(name, sizeof(name), "adr%i", i);
|
||||
adrstring = (char *)Cvar_VariableString(name);
|
||||
adrstring = Cvar_VariableString(name);
|
||||
|
||||
if (!adrstring || !adrstring[0])
|
||||
{
|
||||
|
|
|
@ -4380,6 +4380,15 @@ M_Init(void)
|
|||
Cmd_AddCommand("menu_options", M_Menu_Options_f);
|
||||
Cmd_AddCommand("menu_keys", M_Menu_Keys_f);
|
||||
Cmd_AddCommand("menu_quit", M_Menu_Quit_f);
|
||||
|
||||
/* initialize the server address book cvars (adr0, adr1, ...)
|
||||
* so the entries are not lost if you don't open the address book */
|
||||
for (int index = 0; index < NUM_ADDRESSBOOK_ENTRIES; index++)
|
||||
{
|
||||
char buffer[20];
|
||||
Com_sprintf(buffer, sizeof(buffer), "adr%d", index);
|
||||
Cvar_Get(buffer, "", CVAR_ARCHIVE);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -531,7 +531,7 @@ qboolean NET_CompareAdr(netadr_t a, netadr_t b);
|
|||
qboolean NET_CompareBaseAdr(netadr_t a, netadr_t b);
|
||||
qboolean NET_IsLocalAddress(netadr_t adr);
|
||||
char *NET_AdrToString(netadr_t a);
|
||||
qboolean NET_StringToAdr(char *s, netadr_t *a);
|
||||
qboolean NET_StringToAdr(const char *s, netadr_t *a);
|
||||
void NET_Sleep(int msec);
|
||||
|
||||
/*=================================================================== */
|
||||
|
|
Loading…
Reference in a new issue