From 8fff3fb40fa44f3588fba99227d9198e9189f6e6 Mon Sep 17 00:00:00 2001 From: divverent Date: Fri, 17 Apr 2009 13:56:55 +0000 Subject: [PATCH] DP_QC_EXTRESPONSEPACKET - getextresponse() function now also in csqc and svqc (same builtin# 624 as in menu qc) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8932 d7cf8633-e32d-0410-b094-e92efae38249 --- clvm_cmds.c | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++++- mvm_cmds.c | 18 +--------- prvm_cmds.c | 16 +++++++++ prvm_cmds.h | 2 ++ svvm_cmds.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 207 insertions(+), 18 deletions(-) diff --git a/clvm_cmds.c b/clvm_cmds.c index 20646da1..a8028c33 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -3696,8 +3696,101 @@ NULL, // #527 NULL, // #528 NULL, // #529 NULL, // #530 -NULL, // #531 +NULL, // #531 NULL, // #532 +NULL, // #533 +NULL, // #534 +NULL, // #535 +NULL, // #536 +NULL, // #537 +NULL, // #538 +NULL, // #539 +NULL, // #540 +NULL, // #541 +NULL, // #542 +NULL, // #543 +NULL, // #544 +NULL, // #545 +NULL, // #546 +NULL, // #547 +NULL, // #548 +NULL, // #549 +NULL, // #550 +NULL, // #551 +NULL, // #552 +NULL, // #553 +NULL, // #554 +NULL, // #555 +NULL, // #556 +NULL, // #557 +NULL, // #558 +NULL, // #559 +NULL, // #560 +NULL, // #561 +NULL, // #562 +NULL, // #563 +NULL, // #564 +NULL, // #565 +NULL, // #566 +NULL, // #567 +NULL, // #568 +NULL, // #569 +NULL, // #570 +NULL, // #571 +NULL, // #572 +NULL, // #573 +NULL, // #574 +NULL, // #575 +NULL, // #576 +NULL, // #577 +NULL, // #578 +NULL, // #579 +NULL, // #580 +NULL, // #581 +NULL, // #582 +NULL, // #583 +NULL, // #584 +NULL, // #585 +NULL, // #586 +NULL, // #587 +NULL, // #588 +NULL, // #589 +NULL, // #590 +NULL, // #591 +NULL, // #592 +NULL, // #593 +NULL, // #594 +NULL, // #595 +NULL, // #596 +NULL, // #597 +NULL, // #598 +NULL, // #599 +NULL, // #600 +NULL, // #601 +NULL, // #602 +NULL, // #603 +NULL, // #604 +NULL, // #605 +NULL, // #606 +NULL, // #607 +NULL, // #608 +NULL, // #609 +NULL, // #610 +NULL, // #611 +NULL, // #612 +NULL, // #613 +NULL, // #614 +NULL, // #615 +NULL, // #616 +NULL, // #617 +NULL, // #618 +NULL, // #619 +NULL, // #620 +NULL, // #621 +NULL, // #622 +NULL, // #623 +VM_getextresponse, // #624 string getextresponse(void) +NULL, // #625 }; const int vm_cl_numbuiltins = sizeof(vm_cl_builtins) / sizeof(prvm_builtin_t); diff --git a/mvm_cmds.c b/mvm_cmds.c index 4e909a3b..7c1c97d0 100644 --- a/mvm_cmds.c +++ b/mvm_cmds.c @@ -747,22 +747,6 @@ void VM_M_WriteEntity (void) MSG_WriteShort (VM_M_WriteDest(), PRVM_G_EDICTNUM(OFS_PARM0)); } -//string(void) getextresponse = #624; // returns the next extResponse packet that was sent to this client -void VM_M_getextresponse (void) -{ - VM_SAFEPARMCOUNT(0,VM_argv); - - if (net_extresponse_count <= 0) - PRVM_G_INT(OFS_RETURN) = OFS_NULL; - else - { - int first; - --net_extresponse_count; - first = (net_extresponse_last + NET_EXTRESPONSE_MAX - net_extresponse_count) % NET_EXTRESPONSE_MAX; - PRVM_G_INT(OFS_RETURN) = PRVM_SetEngineString(net_extresponse[first]); - } -} - /* ================= VM_M_copyentity @@ -1446,7 +1430,7 @@ VM_M_refreshserverlist, // #620 void refreshhostcache(void) 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_M_getextresponse, // #624 string getextresponse(void) +VM_getextresponse, // #624 string getextresponse(void) VM_netaddress_resolve // #625 string netaddress_resolve(string, float) }; diff --git a/prvm_cmds.c b/prvm_cmds.c index c1be177c..267cee53 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -5236,3 +5236,19 @@ void VM_netaddress_resolve (void) else PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(""); } + +//string(void) getextresponse = #624; // returns the next extResponse packet that was sent to this client +void VM_getextresponse (void) +{ + VM_SAFEPARMCOUNT(0,VM_argv); + + if (net_extresponse_count <= 0) + PRVM_G_INT(OFS_RETURN) = OFS_NULL; + else + { + int first; + --net_extresponse_count; + first = (net_extresponse_last + NET_EXTRESPONSE_MAX - net_extresponse_count) % NET_EXTRESPONSE_MAX; + PRVM_G_INT(OFS_RETURN) = PRVM_SetEngineString(net_extresponse[first]); + } +} diff --git a/prvm_cmds.h b/prvm_cmds.h index b0ad650a..a7826eac 100644 --- a/prvm_cmds.h +++ b/prvm_cmds.h @@ -440,3 +440,5 @@ void VM_argv_end_index (void); void VM_buf_cvarlist(void); void VM_cvar_description(void); + +void VM_getextresponse (void); diff --git a/svvm_cmds.c b/svvm_cmds.c index bb689358..05979415 100644 --- a/svvm_cmds.c +++ b/svvm_cmds.c @@ -71,6 +71,7 @@ char *vm_sv_extensions = "DP_QC_EDICT_NUM " "DP_QC_ENTITYDATA " "DP_QC_ETOS " +"DP_QC_EXTRESPONSEPACKET " "DP_QC_FINDCHAIN " "DP_QC_FINDCHAIN_TOFIELD " "DP_QC_FINDCHAINFLAGS " @@ -3615,6 +3616,99 @@ NULL, // #529 NULL, // #530 VM_SV_setpause, // #531 void(float pause) setpause = #531; NULL, // #532 +NULL, // #533 +NULL, // #534 +NULL, // #535 +NULL, // #536 +NULL, // #537 +NULL, // #538 +NULL, // #539 +NULL, // #540 +NULL, // #541 +NULL, // #542 +NULL, // #543 +NULL, // #544 +NULL, // #545 +NULL, // #546 +NULL, // #547 +NULL, // #548 +NULL, // #549 +NULL, // #550 +NULL, // #551 +NULL, // #552 +NULL, // #553 +NULL, // #554 +NULL, // #555 +NULL, // #556 +NULL, // #557 +NULL, // #558 +NULL, // #559 +NULL, // #560 +NULL, // #561 +NULL, // #562 +NULL, // #563 +NULL, // #564 +NULL, // #565 +NULL, // #566 +NULL, // #567 +NULL, // #568 +NULL, // #569 +NULL, // #570 +NULL, // #571 +NULL, // #572 +NULL, // #573 +NULL, // #574 +NULL, // #575 +NULL, // #576 +NULL, // #577 +NULL, // #578 +NULL, // #579 +NULL, // #580 +NULL, // #581 +NULL, // #582 +NULL, // #583 +NULL, // #584 +NULL, // #585 +NULL, // #586 +NULL, // #587 +NULL, // #588 +NULL, // #589 +NULL, // #590 +NULL, // #591 +NULL, // #592 +NULL, // #593 +NULL, // #594 +NULL, // #595 +NULL, // #596 +NULL, // #597 +NULL, // #598 +NULL, // #599 +NULL, // #600 +NULL, // #601 +NULL, // #602 +NULL, // #603 +NULL, // #604 +NULL, // #605 +NULL, // #606 +NULL, // #607 +NULL, // #608 +NULL, // #609 +NULL, // #610 +NULL, // #611 +NULL, // #612 +NULL, // #613 +NULL, // #614 +NULL, // #615 +NULL, // #616 +NULL, // #617 +NULL, // #618 +NULL, // #619 +NULL, // #620 +NULL, // #621 +NULL, // #622 +NULL, // #623 +VM_getextresponse, // #624 string getextresponse(void) +NULL, // #625 }; const int vm_sv_numbuiltins = sizeof(vm_sv_builtins) / sizeof(prvm_builtin_t); -- 2.39.2