NULL, // #621
NULL, // #622
NULL, // #623
-VM_getextresponse, // #624 string getextresponse(void)
+VM_CL_getextresponse, // #624 string getextresponse(void)
NULL, // #625
};
VM_M_getserverlistnumber, // #621 float gethostcachenumber(float fld, float hostnr)
VM_M_getserverlistindexforkey,// #622 float gethostcacheindexforkey(string key)
VM_M_addwantedserverlistkey, // #623 void addwantedhostcachekey(string key)
-VM_getextresponse, // #624 string getextresponse(void)
+VM_CL_getextresponse, // #624 string getextresponse(void)
VM_netaddress_resolve, // #625 string netaddress_resolve(string, float)
VM_M_getgamedirinfo, // #626 string getgamedirinfo(float n, float prop)
NULL
int net_extresponse_count = 0;
int net_extresponse_last = 0;
+char sv_net_extresponse[NET_EXTRESPONSE_MAX][1400];
+int sv_net_extresponse_count = 0;
+int sv_net_extresponse_last = 0;
+
// ServerList interface
serverlist_mask_t serverlist_andmasks[SERVERLIST_ANDMASKCOUNT];
serverlist_mask_t serverlist_ormasks[SERVERLIST_ORMASKCOUNT];
}
if (!strncmp(string, "extResponse ", 12))
{
- ++net_extresponse_count;
- if(net_extresponse_count > NET_EXTRESPONSE_MAX)
- net_extresponse_count = NET_EXTRESPONSE_MAX;
- net_extresponse_last = (net_extresponse_last + 1) % NET_EXTRESPONSE_MAX;
- dpsnprintf(net_extresponse[net_extresponse_last], sizeof(net_extresponse[net_extresponse_last]), "'%s' %s", addressstring2, string + 12);
+ ++sv_net_extresponse_count;
+ if(sv_net_extresponse_count > NET_EXTRESPONSE_MAX)
+ sv_net_extresponse_count = NET_EXTRESPONSE_MAX;
+ sv_net_extresponse_last = (net_extresponse_last + 1) % NET_EXTRESPONSE_MAX;
+ dpsnprintf(sv_net_extresponse[sv_net_extresponse_last], sizeof(sv_net_extresponse[net_extresponse_last]), "'%s' %s", addressstring2, string + 12);
return true;
}
if (!strncmp(string, "ping", 4))
extern int net_extresponse_count;
extern int net_extresponse_last;
+extern char sv_net_extresponse[NET_EXTRESPONSE_MAX][1400];
+extern int sv_net_extresponse_count;
+extern int sv_net_extresponse_last;
+
extern double masterquerytime;
extern int masterquerycount;
extern int masterreplycount;
}
//string(void) getextresponse = #624; // returns the next extResponse packet that was sent to this client
-void VM_getextresponse (void)
+void VM_CL_getextresponse (void)
{
VM_SAFEPARMCOUNT(0,VM_argv);
}
}
+void VM_SV_getextresponse (void)
+{
+ VM_SAFEPARMCOUNT(0,VM_argv);
+
+ if (sv_net_extresponse_count <= 0)
+ PRVM_G_INT(OFS_RETURN) = OFS_NULL;
+ else
+ {
+ int first;
+ --sv_net_extresponse_count;
+ first = (sv_net_extresponse_last + NET_EXTRESPONSE_MAX - sv_net_extresponse_count) % NET_EXTRESPONSE_MAX;
+ PRVM_G_INT(OFS_RETURN) = PRVM_SetEngineString(sv_net_extresponse[first]);
+ }
+}
+
/*
=========
VM_M_callfunction
void VM_buf_cvarlist(void);
void VM_cvar_description(void);
-void VM_getextresponse (void);
+void VM_CL_getextresponse (void);
+void VM_SV_getextresponse (void);
void VM_isfunction(void);
void VM_callfunction(void);
NULL, // #621
NULL, // #622
NULL, // #623
-VM_getextresponse, // #624 string getextresponse(void)
+VM_SV_getextresponse, // #624 string getextresponse(void)
NULL, // #625
};