]> icculus.org git repositories - divverent/darkplaces.git/blob - mvm_cmds.c
Added "pl" to the list of available keys to the CSQC function getplayerkey. "pl...
[divverent/darkplaces.git] / mvm_cmds.c
1 #include "prvm_cmds.h"
2
3 //============================================================================
4 // Menu
5
6 char *vm_m_extensions =
7 "BX_WAL_SUPPORT "
8 "DP_CINEMATIC_DPV "
9 "DP_MENU_EXTRESPONSEPACKET "
10 "DP_QC_ASINACOSATANATAN2TAN "
11 "DP_QC_STRFTIME "
12 "DP_QC_STRING_CASE_FUNCTIONS "
13 "DP_QC_STRINGCOLORFUNCTIONS "
14 "DP_QC_TOKENIZEBYSEPARATOR "
15 "DP_QC_UNLIMITEDTEMPSTRINGS "
16 "DP_QC_CMD "
17 ;
18
19 /*
20 =========
21 VM_M_setmousetarget
22
23 setmousetarget(float target)
24 =========
25 */
26 void VM_M_setmousetarget(void)
27 {
28         VM_SAFEPARMCOUNT(1, VM_M_setmousetarget);
29
30         switch((int)PRVM_G_FLOAT(OFS_PARM0))
31         {
32         case 1:
33                 in_client_mouse = false;
34                 break;
35         case 2:
36                 in_client_mouse = true;
37                 break;
38         default:
39                 PRVM_ERROR("VM_M_setmousetarget: wrong destination %f !",PRVM_G_FLOAT(OFS_PARM0));
40         }
41 }
42
43 /*
44 =========
45 VM_M_getmousetarget
46
47 float   getmousetarget
48 =========
49 */
50 void VM_M_getmousetarget(void)
51 {
52         VM_SAFEPARMCOUNT(0,VM_M_getmousetarget);
53
54         if(in_client_mouse)
55                 PRVM_G_FLOAT(OFS_RETURN) = 2;
56         else
57                 PRVM_G_FLOAT(OFS_RETURN) = 1;
58 }
59
60
61
62 /*
63 =========
64 VM_M_setkeydest
65
66 setkeydest(float dest)
67 =========
68 */
69 void VM_M_setkeydest(void)
70 {
71         VM_SAFEPARMCOUNT(1,VM_M_setkeydest);
72
73         switch((int)PRVM_G_FLOAT(OFS_PARM0))
74         {
75         case 0:
76                 // key_game
77                 key_dest = key_game;
78                 break;
79         case 2:
80                 // key_menu
81                 key_dest = key_menu;
82                 break;
83         case 1:
84                 // key_message
85                 // key_dest = key_message
86                 // break;
87         default:
88                 PRVM_ERROR("VM_M_setkeydest: wrong destination %f !", PRVM_G_FLOAT(OFS_PARM0));
89         }
90 }
91
92 /*
93 =========
94 VM_M_getkeydest
95
96 float   getkeydest
97 =========
98 */
99 void VM_M_getkeydest(void)
100 {
101         VM_SAFEPARMCOUNT(0,VM_M_getkeydest);
102
103         // key_game = 0, key_message = 1, key_menu = 2, unknown = 3
104         switch(key_dest)
105         {
106         case key_game:
107                 PRVM_G_FLOAT(OFS_RETURN) = 0;
108                 break;
109         case key_menu:
110                 PRVM_G_FLOAT(OFS_RETURN) = 2;
111                 break;
112         case key_message:
113                 // not supported
114                 // PRVM_G_FLOAT(OFS_RETURN) = 1;
115                 // break;
116         default:
117                 PRVM_G_FLOAT(OFS_RETURN) = 3;
118         }
119 }
120
121 /*
122 =========
123 VM_M_callfunction
124
125         callfunction(...,string function_name)
126 Extension: pass
127 =========
128 */
129 mfunction_t *PRVM_ED_FindFunction (const char *name);
130 void VM_M_callfunction(void)
131 {
132         mfunction_t *func;
133         const char *s;
134
135         VM_SAFEPARMCOUNTRANGE(1, 8, VM_M_callfunction);
136
137         s = PRVM_G_STRING(OFS_PARM0+(prog->argc - 1)*3);
138
139         VM_CheckEmptyString(s);
140
141         func = PRVM_ED_FindFunction(s);
142
143         if(!func)
144                 PRVM_ERROR("VM_M_callfunciton: function %s not found !", s);
145         else if (func->first_statement < 0)
146         {
147                 // negative statements are built in functions
148                 int builtinnumber = -func->first_statement;
149                 prog->xfunction->builtinsprofile++;
150                 if (builtinnumber < prog->numbuiltins && prog->builtins[builtinnumber])
151                         prog->builtins[builtinnumber]();
152                 else
153                         PRVM_ERROR("No such builtin #%i in %s", builtinnumber, PRVM_NAME);
154         }
155         else if(func - prog->functions > 0)
156         {
157                 prog->argc--;
158                 PRVM_ExecuteProgram(func - prog->functions,"");
159                 prog->argc++;
160         }
161 }
162
163 /*
164 =========
165 VM_M_isfunction
166
167 float   isfunction(string function_name)
168 =========
169 */
170 mfunction_t *PRVM_ED_FindFunction (const char *name);
171 void VM_M_isfunction(void)
172 {
173         mfunction_t *func;
174         const char *s;
175
176         VM_SAFEPARMCOUNT(1, VM_M_isfunction);
177
178         s = PRVM_G_STRING(OFS_PARM0);
179
180         VM_CheckEmptyString(s);
181
182         func = PRVM_ED_FindFunction(s);
183
184         if(!func)
185                 PRVM_G_FLOAT(OFS_RETURN) = false;
186         else
187                 PRVM_G_FLOAT(OFS_RETURN) = true;
188 }
189
190 /*
191 =========
192 VM_M_getresolution
193
194 vector  getresolution(float number)
195 =========
196 */
197 extern unsigned short video_resolutions[][2];
198 void VM_M_getresolution(void)
199 {
200         int nr;
201         VM_SAFEPARMCOUNT(1, VM_getresolution);
202
203         nr = (int)PRVM_G_FLOAT(OFS_PARM0);
204
205
206         PRVM_G_VECTOR(OFS_RETURN)[0] = video_resolutions[nr][0];
207         PRVM_G_VECTOR(OFS_RETURN)[1] = video_resolutions[nr][1];
208         PRVM_G_VECTOR(OFS_RETURN)[2] = 0;
209 }
210
211 /*
212 =========
213 VM_M_findkeysforcommand
214
215 string  findkeysforcommand(string command)
216
217 the returned string is an altstring
218 =========
219 */
220 #define NUMKEYS 5 // TODO: merge the constant in keys.c with this one somewhen
221
222 void M_FindKeysForCommand(const char *command, int *keys);
223 void VM_M_findkeysforcommand(void)
224 {
225         const char *cmd;
226         char ret[VM_STRINGTEMP_LENGTH];
227         int keys[NUMKEYS];
228         int i;
229
230         VM_SAFEPARMCOUNT(1, VM_M_findkeysforcommand);
231
232         cmd = PRVM_G_STRING(OFS_PARM0);
233
234         VM_CheckEmptyString(cmd);
235
236         M_FindKeysForCommand(cmd, keys);
237
238         ret[0] = 0;
239         for(i = 0; i < NUMKEYS; i++)
240                 strlcat(ret, va(" \'%i\'", keys[i]), sizeof(ret));
241
242         PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(ret);
243 }
244
245 /*
246 =========
247 VM_M_getserverliststat
248
249 float   getserverliststat(float type)
250 =========
251 */
252 /*
253         type:
254 0       serverlist_viewcount
255 1   serverlist_totalcount
256 2       masterquerycount
257 3       masterreplycount
258 4       serverquerycount
259 5       serverreplycount
260 6       sortfield
261 7       sortdescending
262 */
263 void VM_M_getserverliststat( void )
264 {
265         int type;
266         VM_SAFEPARMCOUNT ( 1, VM_M_getserverliststat );
267
268         PRVM_G_FLOAT( OFS_RETURN ) = 0;
269
270         type = (int)PRVM_G_FLOAT( OFS_PARM0 );
271         switch(type)
272         {
273         case 0:
274                 PRVM_G_FLOAT ( OFS_RETURN ) = serverlist_viewcount;
275                 return;
276         case 1:
277                 PRVM_G_FLOAT ( OFS_RETURN ) = serverlist_cachecount;
278         case 2:
279                 PRVM_G_FLOAT ( OFS_RETURN ) = masterquerycount;
280                 return;
281         case 3:
282                 PRVM_G_FLOAT ( OFS_RETURN ) = masterreplycount;
283                 return;
284         case 4:
285                 PRVM_G_FLOAT ( OFS_RETURN ) = serverquerycount;
286                 return;
287         case 5:
288                 PRVM_G_FLOAT ( OFS_RETURN ) = serverreplycount;
289                 return;
290         case 6:
291                 PRVM_G_FLOAT ( OFS_RETURN ) = serverlist_sortbyfield;
292                 return;
293         case 7:
294                 PRVM_G_FLOAT ( OFS_RETURN ) = serverlist_sortdescending;
295                 return;
296         default:
297                 VM_Warning( "VM_M_getserverliststat: bad type %i!\n", type );
298         }
299 }
300
301 /*
302 ========================
303 VM_M_resetserverlistmasks
304
305 resetserverlistmasks()
306 ========================
307 */
308 void VM_M_resetserverlistmasks( void )
309 {
310         VM_SAFEPARMCOUNT(0, VM_M_resetserverlistmasks);
311         ServerList_ResetMasks();
312 }
313
314
315 /*
316 ========================
317 VM_M_setserverlistmaskstring
318
319 setserverlistmaskstring(float mask, float fld, string str, float op)
320 0-511           and
321 512 - 1024      or
322 ========================
323 */
324 void VM_M_setserverlistmaskstring( void )
325 {
326         const char *str;
327         int masknr;
328         serverlist_mask_t *mask;
329         int field;
330
331         VM_SAFEPARMCOUNT( 4, VM_M_setserverlistmaskstring );
332         str = PRVM_G_STRING( OFS_PARM2 );
333
334         masknr = (int)PRVM_G_FLOAT( OFS_PARM0 );
335         if( masknr >= 0 && masknr <= SERVERLIST_ANDMASKCOUNT )
336                 mask = &serverlist_andmasks[masknr];
337         else if( masknr >= 512 && masknr - 512 <= SERVERLIST_ORMASKCOUNT )
338                 mask = &serverlist_ormasks[masknr - 512 ];
339         else
340         {
341                 VM_Warning( "VM_M_setserverlistmaskstring: invalid mask number %i\n", masknr );
342                 return;
343         }
344
345         field = (int) PRVM_G_FLOAT( OFS_PARM1 );
346
347         switch( field ) {
348                 case SLIF_CNAME:
349                         strlcpy( mask->info.cname, PRVM_G_STRING( OFS_PARM2 ), sizeof(mask->info.cname) );
350                         break;
351                 case SLIF_NAME:
352                         strlcpy( mask->info.name, PRVM_G_STRING( OFS_PARM2 ), sizeof(mask->info.name)  );
353                         break;
354                 case SLIF_MAP:
355                         strlcpy( mask->info.map, PRVM_G_STRING( OFS_PARM2 ), sizeof(mask->info.map)  );
356                         break;
357                 case SLIF_MOD:
358                         strlcpy( mask->info.mod, PRVM_G_STRING( OFS_PARM2 ), sizeof(mask->info.mod)  );
359                         break;
360                 case SLIF_GAME:
361                         strlcpy( mask->info.game, PRVM_G_STRING( OFS_PARM2 ), sizeof(mask->info.game)  );
362                         break;
363                 default:
364                         VM_Warning( "VM_M_setserverlistmaskstring: Bad field number %i passed!\n", field );
365                         return;
366         }
367
368         mask->active = true;
369         mask->tests[field] = (serverlist_maskop_t)((int)PRVM_G_FLOAT( OFS_PARM3 ));
370 }
371
372 /*
373 ========================
374 VM_M_setserverlistmasknumber
375
376 setserverlistmasknumber(float mask, float fld, float num, float op)
377
378 0-511           and
379 512 - 1024      or
380 ========================
381 */
382 void VM_M_setserverlistmasknumber( void )
383 {
384         int number;
385         serverlist_mask_t *mask;
386         int     masknr;
387         int field;
388         VM_SAFEPARMCOUNT( 4, VM_M_setserverlistmasknumber );
389
390         masknr = (int)PRVM_G_FLOAT( OFS_PARM0 );
391         if( masknr >= 0 && masknr <= SERVERLIST_ANDMASKCOUNT )
392                 mask = &serverlist_andmasks[masknr];
393         else if( masknr >= 512 && masknr - 512 <= SERVERLIST_ORMASKCOUNT )
394                 mask = &serverlist_ormasks[masknr - 512 ];
395         else
396         {
397                 VM_Warning( "VM_M_setserverlistmasknumber: invalid mask number %i\n", masknr );
398                 return;
399         }
400
401         number = (int)PRVM_G_FLOAT( OFS_PARM2 );
402         field = (int) PRVM_G_FLOAT( OFS_PARM1 );
403
404         switch( field ) {
405                 case SLIF_MAXPLAYERS:
406                         mask->info.maxplayers = number;
407                         break;
408                 case SLIF_NUMPLAYERS:
409                         mask->info.numplayers = number;
410                         break;
411                 case SLIF_NUMBOTS:
412                         mask->info.numbots = number;
413                         break;
414                 case SLIF_NUMHUMANS:
415                         mask->info.numhumans = number;
416                         break;
417                 case SLIF_PING:
418                         mask->info.ping = number;
419                         break;
420                 case SLIF_PROTOCOL:
421                         mask->info.protocol = number;
422                         break;
423                 default:
424                         VM_Warning( "VM_M_setserverlistmasknumber: Bad field number %i passed!\n", field );
425                         return;
426         }
427
428         mask->active = true;
429         mask->tests[field] = (serverlist_maskop_t)((int)PRVM_G_FLOAT( OFS_PARM3 ));
430 }
431
432
433 /*
434 ========================
435 VM_M_resortserverlist
436
437 resortserverlist
438 ========================
439 */
440 void VM_M_resortserverlist( void )
441 {
442         VM_SAFEPARMCOUNT(0, VM_M_resortserverlist);
443         ServerList_RebuildViewList();
444 }
445
446 /*
447 =========
448 VM_M_getserverliststring
449
450 string  getserverliststring(float field, float hostnr)
451 =========
452 */
453 void VM_M_getserverliststring(void)
454 {
455         serverlist_entry_t *cache;
456         int hostnr;
457
458         VM_SAFEPARMCOUNT(2, VM_M_getserverliststring);
459
460         PRVM_G_INT(OFS_RETURN) = OFS_NULL;
461
462         hostnr = (int)PRVM_G_FLOAT(OFS_PARM1);
463
464         if(hostnr < 0 || hostnr >= serverlist_viewcount)
465         {
466                 Con_Print("VM_M_getserverliststring: bad hostnr passed!\n");
467                 return;
468         }
469         cache = serverlist_viewlist[hostnr];
470         switch( (int) PRVM_G_FLOAT(OFS_PARM0) ) {
471                 case SLIF_CNAME:
472                         PRVM_G_INT( OFS_RETURN ) = PRVM_SetEngineString( cache->info.cname );
473                         break;
474                 case SLIF_NAME:
475                         PRVM_G_INT( OFS_RETURN ) = PRVM_SetEngineString( cache->info.name );
476                         break;
477                 case SLIF_GAME:
478                         PRVM_G_INT( OFS_RETURN ) = PRVM_SetEngineString( cache->info.game );
479                         break;
480                 case SLIF_MOD:
481                         PRVM_G_INT( OFS_RETURN ) = PRVM_SetEngineString( cache->info.mod );
482                         break;
483                 case SLIF_MAP:
484                         PRVM_G_INT( OFS_RETURN ) = PRVM_SetEngineString( cache->info.map );
485                         break;
486                 // TODO remove this again
487                 case 1024:
488                         PRVM_G_INT( OFS_RETURN ) = PRVM_SetEngineString( cache->line1 );
489                         break;
490                 case 1025:
491                         PRVM_G_INT( OFS_RETURN ) = PRVM_SetEngineString( cache->line2 );
492                         break;
493                 default:
494                         Con_Print("VM_M_getserverliststring: bad field number passed!\n");
495         }
496 }
497
498 /*
499 =========
500 VM_M_getserverlistnumber
501
502 float   getserverlistnumber(float field, float hostnr)
503 =========
504 */
505 void VM_M_getserverlistnumber(void)
506 {
507         serverlist_entry_t *cache;
508         int hostnr;
509
510         VM_SAFEPARMCOUNT(2, VM_M_getserverliststring);
511
512         PRVM_G_INT(OFS_RETURN) = OFS_NULL;
513
514         hostnr = (int)PRVM_G_FLOAT(OFS_PARM1);
515
516         if(hostnr < 0 || hostnr >= serverlist_viewcount)
517         {
518                 Con_Print("VM_M_getserverliststring: bad hostnr passed!\n");
519                 return;
520         }
521         cache = serverlist_viewlist[hostnr];
522         switch( (int) PRVM_G_FLOAT(OFS_PARM0) ) {
523                 case SLIF_MAXPLAYERS:
524                         PRVM_G_FLOAT( OFS_RETURN ) = cache->info.maxplayers;
525                         break;
526                 case SLIF_NUMPLAYERS:
527                         PRVM_G_FLOAT( OFS_RETURN ) = cache->info.numplayers;
528                         break;
529                 case SLIF_NUMBOTS:
530                         PRVM_G_FLOAT( OFS_RETURN ) = cache->info.numbots;
531                         break;
532                 case SLIF_NUMHUMANS:
533                         PRVM_G_FLOAT( OFS_RETURN ) = cache->info.numhumans;
534                         break;
535                 case SLIF_PING:
536                         PRVM_G_FLOAT( OFS_RETURN ) = cache->info.ping;
537                         break;
538                 case SLIF_PROTOCOL:
539                         PRVM_G_FLOAT( OFS_RETURN ) = cache->info.protocol;
540                         break;
541                 default:
542                         Con_Print("VM_M_getserverlistnumber: bad field number passed!\n");
543         }
544 }
545
546 /*
547 ========================
548 VM_M_setserverlistsort
549
550 setserverlistsort(float field, float descending)
551 ========================
552 */
553 void VM_M_setserverlistsort( void )
554 {
555         VM_SAFEPARMCOUNT( 2, VM_M_setserverlistsort );
556
557         serverlist_sortbyfield = (serverlist_infofield_t)((int)PRVM_G_FLOAT( OFS_PARM0 ));
558         serverlist_sortdescending = (qboolean) PRVM_G_FLOAT( OFS_PARM1 );
559 }
560
561 /*
562 ========================
563 VM_M_refreshserverlist
564
565 refreshserverlist()
566 ========================
567 */
568 void VM_M_refreshserverlist( void )
569 {
570         VM_SAFEPARMCOUNT( 0, VM_M_refreshserverlist );
571         ServerList_QueryList(true, false);
572 }
573
574 /*
575 ========================
576 VM_M_getserverlistindexforkey
577
578 float getserverlistindexforkey(string key)
579 ========================
580 */
581 void VM_M_getserverlistindexforkey( void )
582 {
583         const char *key;
584         VM_SAFEPARMCOUNT( 1, VM_M_getserverlistindexforkey );
585
586         key = PRVM_G_STRING( OFS_PARM0 );
587         VM_CheckEmptyString( key );
588
589         if( !strcmp( key, "cname" ) )
590                 PRVM_G_FLOAT( OFS_RETURN ) = SLIF_CNAME;
591         else if( !strcmp( key, "ping" ) )
592                 PRVM_G_FLOAT( OFS_RETURN ) = SLIF_PING;
593         else if( !strcmp( key, "game" ) )
594                 PRVM_G_FLOAT( OFS_RETURN ) = SLIF_GAME;
595         else if( !strcmp( key, "mod" ) )
596                 PRVM_G_FLOAT( OFS_RETURN ) = SLIF_MOD;
597         else if( !strcmp( key, "map" ) )
598                 PRVM_G_FLOAT( OFS_RETURN ) = SLIF_MAP;
599         else if( !strcmp( key, "name" ) )
600                 PRVM_G_FLOAT( OFS_RETURN ) = SLIF_NAME;
601         else if( !strcmp( key, "maxplayers" ) )
602                 PRVM_G_FLOAT( OFS_RETURN ) = SLIF_MAXPLAYERS;
603         else if( !strcmp( key, "numplayers" ) )
604                 PRVM_G_FLOAT( OFS_RETURN ) = SLIF_NUMPLAYERS;
605         else if( !strcmp( key, "numbots" ) )
606                 PRVM_G_FLOAT( OFS_RETURN ) = SLIF_NUMBOTS;
607         else if( !strcmp( key, "numhumans" ) )
608                 PRVM_G_FLOAT( OFS_RETURN ) = SLIF_NUMHUMANS;
609         else if( !strcmp( key, "protocol" ) )
610                 PRVM_G_FLOAT( OFS_RETURN ) = SLIF_PROTOCOL;
611         else
612                 PRVM_G_FLOAT( OFS_RETURN ) = -1;
613 }
614
615 /*
616 ========================
617 VM_M_addwantedserverlistkey
618
619 addwantedserverlistkey(string key)
620 ========================
621 */
622 void VM_M_addwantedserverlistkey( void )
623 {
624         VM_SAFEPARMCOUNT( 1, VM_M_addwantedserverlistkey );
625 }
626
627 /*
628 ===============================================================================
629 MESSAGE WRITING
630
631 used only for client and menu
632 server uses VM_SV_...
633
634 Write*(* data, float type, float to)
635
636 ===============================================================================
637 */
638
639 #define MSG_BROADCAST   0               // unreliable to all
640 #define MSG_ONE                 1               // reliable to one (msg_entity)
641 #define MSG_ALL                 2               // reliable to all
642 #define MSG_INIT                3               // write to the init string
643
644 sizebuf_t *VM_M_WriteDest (void)
645 {
646         int             dest;
647         int             destclient;
648
649         if(!sv.active)
650                 PRVM_ERROR("VM_M_WriteDest: game is not server (%s)", PRVM_NAME);
651
652         dest = (int)PRVM_G_FLOAT(OFS_PARM1);
653         switch (dest)
654         {
655         case MSG_BROADCAST:
656                 return &sv.datagram;
657
658         case MSG_ONE:
659                 destclient = (int) PRVM_G_FLOAT(OFS_PARM2);
660                 if (destclient < 0 || destclient >= svs.maxclients || !svs.clients[destclient].active || !svs.clients[destclient].netconnection)
661                         PRVM_ERROR("VM_clientcommand: %s: invalid client !", PRVM_NAME);
662
663                 return &svs.clients[destclient].netconnection->message;
664
665         case MSG_ALL:
666                 return &sv.reliable_datagram;
667
668         case MSG_INIT:
669                 return &sv.signon;
670
671         default:
672                 PRVM_ERROR ("WriteDest: bad destination");
673                 break;
674         }
675
676         return NULL;
677 }
678
679 void VM_M_WriteByte (void)
680 {
681         VM_SAFEPARMCOUNT(1, VM_M_WriteByte);
682         MSG_WriteByte (VM_M_WriteDest(), (int)PRVM_G_FLOAT(OFS_PARM0));
683 }
684
685 void VM_M_WriteChar (void)
686 {
687         VM_SAFEPARMCOUNT(1, VM_M_WriteChar);
688         MSG_WriteChar (VM_M_WriteDest(), (int)PRVM_G_FLOAT(OFS_PARM0));
689 }
690
691 void VM_M_WriteShort (void)
692 {
693         VM_SAFEPARMCOUNT(1, VM_M_WriteShort);
694         MSG_WriteShort (VM_M_WriteDest(), (int)PRVM_G_FLOAT(OFS_PARM0));
695 }
696
697 void VM_M_WriteLong (void)
698 {
699         VM_SAFEPARMCOUNT(1, VM_M_WriteLong);
700         MSG_WriteLong (VM_M_WriteDest(), (int)PRVM_G_FLOAT(OFS_PARM0));
701 }
702
703 void VM_M_WriteAngle (void)
704 {
705         VM_SAFEPARMCOUNT(1, VM_M_WriteAngle);
706         MSG_WriteAngle (VM_M_WriteDest(), PRVM_G_FLOAT(OFS_PARM0), sv.protocol);
707 }
708
709 void VM_M_WriteCoord (void)
710 {
711         VM_SAFEPARMCOUNT(1, VM_M_WriteCoord);
712         MSG_WriteCoord (VM_M_WriteDest(), PRVM_G_FLOAT(OFS_PARM0), sv.protocol);
713 }
714
715 void VM_M_WriteString (void)
716 {
717         VM_SAFEPARMCOUNT(1, VM_M_WriteString);
718         MSG_WriteString (VM_M_WriteDest(), PRVM_G_STRING(OFS_PARM0));
719 }
720
721 void VM_M_WriteEntity (void)
722 {
723         VM_SAFEPARMCOUNT(1, VM_M_WriteEntity);
724         MSG_WriteShort (VM_M_WriteDest(), PRVM_G_EDICTNUM(OFS_PARM0));
725 }
726
727 //string(void) getextresponse = #624; // returns the next extResponse packet that was sent to this client
728 void VM_M_getextresponse (void)
729 {
730         VM_SAFEPARMCOUNT(0,VM_argv);
731
732         if (net_extresponse_count <= 0)
733                 PRVM_G_INT(OFS_RETURN) = OFS_NULL;
734         else
735         {
736                 int first;
737                 --net_extresponse_count;
738                 first = (net_extresponse_last + NET_EXTRESPONSE_MAX - net_extresponse_count) % NET_EXTRESPONSE_MAX;
739                 PRVM_G_INT(OFS_RETURN) = PRVM_SetEngineString(net_extresponse[first]);
740         }
741 }
742
743 /*
744 =================
745 VM_M_copyentity
746
747 copies data from one entity to another
748
749 copyentity(entity src, entity dst)
750 =================
751 */
752 static void VM_M_copyentity (void)
753 {
754         prvm_edict_t *in, *out;
755         VM_SAFEPARMCOUNT(2,VM_M_copyentity);
756         in = PRVM_G_EDICT(OFS_PARM0);
757         out = PRVM_G_EDICT(OFS_PARM1);
758         memcpy(out->fields.vp, in->fields.vp, prog->progs->entityfields * 4);
759 }
760
761 prvm_builtin_t vm_m_builtins[] = {
762 NULL,                                           //   #0 NULL function (not callable)
763 VM_checkextension,                      //   #1
764 VM_error,                                       //   #2
765 VM_objerror,                            //   #3
766 VM_print,                                       //   #4
767 VM_bprint,                                      //   #5
768 VM_sprint,                                      //   #6
769 VM_centerprint,                         //   #7
770 VM_normalize,                           //   #8
771 VM_vlen,                                        //   #9
772 VM_vectoyaw,                            //  #10
773 VM_vectoangles,                         //  #11
774 VM_random,                                      //  #12
775 VM_localcmd,                            //  #13
776 VM_cvar,                                        //  #14
777 VM_cvar_set,                            //  #15
778 VM_dprint,                                      //  #16
779 VM_ftos,                                        //  #17
780 VM_fabs,                                        //  #18
781 VM_vtos,                                        //  #19
782 VM_etos,                                        //  #20
783 VM_stof,                                        //  #21
784 VM_spawn,                                       //  #22
785 VM_remove,                                      //  #23
786 VM_find,                                        //  #24
787 VM_findfloat,                           //  #25
788 VM_findchain,                           //  #26
789 VM_findchainfloat,                      //  #27
790 VM_precache_file,                       //  #28
791 VM_precache_sound,                      //  #29
792 VM_coredump,                            //  #30
793 VM_traceon,                                     //  #31
794 VM_traceoff,                            //  #32
795 VM_eprint,                                      //  #33
796 VM_rint,                                        //  #34
797 VM_floor,                                       //  #35
798 VM_ceil,                                        //  #36
799 VM_nextent,                                     //  #37
800 VM_sin,                                         //  #38
801 VM_cos,                                         //  #39
802 VM_sqrt,                                        //  #40
803 VM_randomvec,                           //  #41
804 VM_registercvar,                        //  #42
805 VM_min,                                         //  #43
806 VM_max,                                         //  #44
807 VM_bound,                                       //  #45
808 VM_pow,                                         //  #46
809 VM_M_copyentity,                        //  #47
810 VM_fopen,                                       //  #48
811 VM_fclose,                                      //  #49
812 VM_fgets,                                       //  #50
813 VM_fputs,                                       //  #51
814 VM_strlen,                                      //  #52
815 VM_strcat,                                      //  #53
816 VM_substring,                           //  #54
817 VM_stov,                                        //  #55
818 VM_strzone,                                     //  #56
819 VM_strunzone,                           //  #57
820 VM_tokenize,                            //  #58
821 VM_argv,                                        //  #59
822 VM_isserver,                            //  #60
823 VM_clientcount,                         //  #61
824 VM_clientstate,                         //  #62
825 VM_clcommand,                           //  #63
826 VM_changelevel,                         //  #64
827 VM_localsound,                          //  #65
828 VM_getmousepos,                         //  #66
829 VM_gettime,                                     //  #67
830 VM_loadfromdata,                        //  #68
831 VM_loadfromfile,                        //  #69
832 VM_modulo,                                      //  #70
833 VM_cvar_string,                         //  #71
834 VM_crash,                                       //  #72
835 VM_stackdump,                           //  #73
836 VM_search_begin,                        //  #74
837 VM_search_end,                          //  #75
838 VM_search_getsize,                      //  #76
839 VM_search_getfilename,          //  #77
840 VM_chr,                                         //  #78
841 VM_itof,                                        //  #79
842 VM_ftoe,                                        //  #80
843 VM_itof,                                        //  #81 isString
844 VM_altstr_count,                        //  #82
845 VM_altstr_prepare,                      //  #83
846 VM_altstr_get,                          //  #84
847 VM_altstr_set,                          //  #85
848 VM_altstr_ins,                          //  #86
849 VM_findflags,                           //  #87
850 VM_findchainflags,                      //  #88
851 VM_cvar_defstring,                      //  #89
852 NULL,                                           //  #90
853 NULL,                                           //  #91
854 NULL,                                           //  #92
855 NULL,                                           //  #93
856 NULL,                                           //  #94
857 NULL,                                           //  #95
858 NULL,                                           //  #96
859 NULL,                                           //  #97
860 NULL,                                           //  #98
861 NULL,                                           //  #99
862 NULL,                                           // #100
863 NULL,                                           // #101
864 NULL,                                           // #102
865 NULL,                                           // #103
866 NULL,                                           // #104
867 NULL,                                           // #105
868 NULL,                                           // #106
869 NULL,                                           // #107
870 NULL,                                           // #108
871 NULL,                                           // #109
872 NULL,                                           // #110
873 NULL,                                           // #111
874 NULL,                                           // #112
875 NULL,                                           // #113
876 NULL,                                           // #114
877 NULL,                                           // #115
878 NULL,                                           // #116
879 NULL,                                           // #117
880 NULL,                                           // #118
881 NULL,                                           // #119
882 NULL,                                           // #120
883 NULL,                                           // #121
884 NULL,                                           // #122
885 NULL,                                           // #123
886 NULL,                                           // #124
887 NULL,                                           // #125
888 NULL,                                           // #126
889 NULL,                                           // #127
890 NULL,                                           // #128
891 NULL,                                           // #129
892 NULL,                                           // #130
893 NULL,                                           // #131
894 NULL,                                           // #132
895 NULL,                                           // #133
896 NULL,                                           // #134
897 NULL,                                           // #135
898 NULL,                                           // #136
899 NULL,                                           // #137
900 NULL,                                           // #138
901 NULL,                                           // #139
902 NULL,                                           // #140
903 NULL,                                           // #141
904 NULL,                                           // #142
905 NULL,                                           // #143
906 NULL,                                           // #144
907 NULL,                                           // #145
908 NULL,                                           // #146
909 NULL,                                           // #147
910 NULL,                                           // #148
911 NULL,                                           // #149
912 NULL,                                           // #150
913 NULL,                                           // #151
914 NULL,                                           // #152
915 NULL,                                           // #153
916 NULL,                                           // #154
917 NULL,                                           // #155
918 NULL,                                           // #156
919 NULL,                                           // #157
920 NULL,                                           // #158
921 NULL,                                           // #159
922 NULL,                                           // #160
923 NULL,                                           // #161
924 NULL,                                           // #162
925 NULL,                                           // #163
926 NULL,                                           // #164
927 NULL,                                           // #165
928 NULL,                                           // #166
929 NULL,                                           // #167
930 NULL,                                           // #168
931 NULL,                                           // #169
932 NULL,                                           // #170
933 NULL,                                           // #171
934 NULL,                                           // #172
935 NULL,                                           // #173
936 NULL,                                           // #174
937 NULL,                                           // #175
938 NULL,                                           // #176
939 NULL,                                           // #177
940 NULL,                                           // #178
941 NULL,                                           // #179
942 NULL,                                           // #180
943 NULL,                                           // #181
944 NULL,                                           // #182
945 NULL,                                           // #183
946 NULL,                                           // #184
947 NULL,                                           // #185
948 NULL,                                           // #186
949 NULL,                                           // #187
950 NULL,                                           // #188
951 NULL,                                           // #189
952 NULL,                                           // #190
953 NULL,                                           // #191
954 NULL,                                           // #192
955 NULL,                                           // #193
956 NULL,                                           // #194
957 NULL,                                           // #195
958 NULL,                                           // #196
959 NULL,                                           // #197
960 NULL,                                           // #198
961 NULL,                                           // #199
962 NULL,                                           // #200
963 NULL,                                           // #201
964 NULL,                                           // #202
965 NULL,                                           // #203
966 NULL,                                           // #204
967 NULL,                                           // #205
968 NULL,                                           // #206
969 NULL,                                           // #207
970 NULL,                                           // #208
971 NULL,                                           // #209
972 NULL,                                           // #210
973 NULL,                                           // #211
974 NULL,                                           // #212
975 NULL,                                           // #213
976 NULL,                                           // #214
977 NULL,                                           // #215
978 NULL,                                           // #216
979 NULL,                                           // #217
980 NULL,                                           // #218
981 NULL,                                           // #219
982 NULL,                                           // #220
983 NULL,                                           // #221
984 NULL,                                           // #222
985 NULL,                                           // #223
986 NULL,                                           // #224
987 NULL,                                           // #225
988 NULL,                                           // #226
989 NULL,                                           // #227
990 NULL,                                           // #228
991 NULL,                                           // #229
992 NULL,                                           // #230
993 NULL,                                           // #231
994 NULL,                                           // #232
995 NULL,                                           // #233
996 NULL,                                           // #234
997 NULL,                                           // #235
998 NULL,                                           // #236
999 NULL,                                           // #237
1000 NULL,                                           // #238
1001 NULL,                                           // #239
1002 NULL,                                           // #240
1003 NULL,                                           // #241
1004 NULL,                                           // #242
1005 NULL,                                           // #243
1006 NULL,                                           // #244
1007 NULL,                                           // #245
1008 NULL,                                           // #246
1009 NULL,                                           // #247
1010 NULL,                                           // #248
1011 NULL,                                           // #249
1012 NULL,                                           // #250
1013 NULL,                                           // #251
1014 NULL,                                           // #252
1015 NULL,                                           // #253
1016 NULL,                                           // #254
1017 NULL,                                           // #255
1018 NULL,                                           // #256
1019 NULL,                                           // #257
1020 NULL,                                           // #258
1021 NULL,                                           // #259
1022 NULL,                                           // #260
1023 NULL,                                           // #261
1024 NULL,                                           // #262
1025 NULL,                                           // #263
1026 NULL,                                           // #264
1027 NULL,                                           // #265
1028 NULL,                                           // #266
1029 NULL,                                           // #267
1030 NULL,                                           // #268
1031 NULL,                                           // #269
1032 NULL,                                           // #270
1033 NULL,                                           // #271
1034 NULL,                                           // #272
1035 NULL,                                           // #273
1036 NULL,                                           // #274
1037 NULL,                                           // #275
1038 NULL,                                           // #276
1039 NULL,                                           // #277
1040 NULL,                                           // #278
1041 NULL,                                           // #279
1042 NULL,                                           // #280
1043 NULL,                                           // #281
1044 NULL,                                           // #282
1045 NULL,                                           // #283
1046 NULL,                                           // #284
1047 NULL,                                           // #285
1048 NULL,                                           // #286
1049 NULL,                                           // #287
1050 NULL,                                           // #288
1051 NULL,                                           // #289
1052 NULL,                                           // #290
1053 NULL,                                           // #291
1054 NULL,                                           // #292
1055 NULL,                                           // #293
1056 NULL,                                           // #294
1057 NULL,                                           // #295
1058 NULL,                                           // #296
1059 NULL,                                           // #297
1060 NULL,                                           // #298
1061 NULL,                                           // #299
1062 NULL,                                           // #300
1063 NULL,                                           // #301
1064 NULL,                                           // #302
1065 NULL,                                           // #303
1066 NULL,                                           // #304
1067 NULL,                                           // #305
1068 NULL,                                           // #306
1069 NULL,                                           // #307
1070 NULL,                                           // #308
1071 NULL,                                           // #309
1072 NULL,                                           // #310
1073 NULL,                                           // #311
1074 NULL,                                           // #312
1075 NULL,                                           // #313
1076 NULL,                                           // #314
1077 NULL,                                           // #315
1078 NULL,                                           // #316
1079 NULL,                                           // #317
1080 NULL,                                           // #318
1081 NULL,                                           // #319
1082 NULL,                                           // #320
1083 NULL,                                           // #321
1084 NULL,                                           // #322
1085 NULL,                                           // #323
1086 NULL,                                           // #324
1087 NULL,                                           // #325
1088 NULL,                                           // #326
1089 NULL,                                           // #327
1090 NULL,                                           // #328
1091 NULL,                                           // #329
1092 NULL,                                           // #330
1093 NULL,                                           // #331
1094 NULL,                                           // #332
1095 NULL,                                           // #333
1096 NULL,                                           // #334
1097 NULL,                                           // #335
1098 NULL,                                           // #336
1099 NULL,                                           // #337
1100 NULL,                                           // #338
1101 NULL,                                           // #339
1102 NULL,                                           // #340
1103 NULL,                                           // #341
1104 NULL,                                           // #342
1105 NULL,                                           // #343
1106 NULL,                                           // #344
1107 NULL,                                           // #345
1108 NULL,                                           // #346
1109 NULL,                                           // #347
1110 NULL,                                           // #348
1111 NULL,                                           // #349
1112 NULL,                                           // #350
1113 NULL,                                           // #351
1114 NULL,                                           // #352
1115 NULL,                                           // #353
1116 NULL,                                           // #354
1117 NULL,                                           // #355
1118 NULL,                                           // #356
1119 NULL,                                           // #357
1120 NULL,                                           // #358
1121 NULL,                                           // #359
1122 NULL,                                           // #360
1123 NULL,                                           // #361
1124 NULL,                                           // #362
1125 NULL,                                           // #363
1126 NULL,                                           // #364
1127 NULL,                                           // #365
1128 NULL,                                           // #366
1129 NULL,                                           // #367
1130 NULL,                                           // #368
1131 NULL,                                           // #369
1132 NULL,                                           // #370
1133 NULL,                                           // #371
1134 NULL,                                           // #372
1135 NULL,                                           // #373
1136 NULL,                                           // #374
1137 NULL,                                           // #375
1138 NULL,                                           // #376
1139 NULL,                                           // #377
1140 NULL,                                           // #378
1141 NULL,                                           // #379
1142 NULL,                                           // #380
1143 NULL,                                           // #381
1144 NULL,                                           // #382
1145 NULL,                                           // #383
1146 NULL,                                           // #384
1147 NULL,                                           // #385
1148 NULL,                                           // #386
1149 NULL,                                           // #387
1150 NULL,                                           // #388
1151 NULL,                                           // #389
1152 NULL,                                           // #390
1153 NULL,                                           // #391
1154 NULL,                                           // #392
1155 NULL,                                           // #393
1156 NULL,                                           // #394
1157 NULL,                                           // #395
1158 NULL,                                           // #396
1159 NULL,                                           // #397
1160 NULL,                                           // #398
1161 NULL,                                           // #399
1162 NULL,                                           // #400
1163 VM_M_WriteByte,                         // #401
1164 VM_M_WriteChar,                         // #402
1165 VM_M_WriteShort,                        // #403
1166 VM_M_WriteLong,                         // #404
1167 VM_M_WriteAngle,                        // #405
1168 VM_M_WriteCoord,                        // #406
1169 VM_M_WriteString,                       // #407
1170 VM_M_WriteEntity,                       // #408
1171 NULL,                                           // #409
1172 NULL,                                           // #410
1173 NULL,                                           // #411
1174 NULL,                                           // #412
1175 NULL,                                           // #413
1176 NULL,                                           // #414
1177 NULL,                                           // #415
1178 NULL,                                           // #416
1179 NULL,                                           // #417
1180 NULL,                                           // #418
1181 NULL,                                           // #419
1182 NULL,                                           // #420
1183 NULL,                                           // #421
1184 NULL,                                           // #422
1185 NULL,                                           // #423
1186 NULL,                                           // #424
1187 NULL,                                           // #425
1188 NULL,                                           // #426
1189 NULL,                                           // #427
1190 NULL,                                           // #428
1191 NULL,                                           // #429
1192 NULL,                                           // #430
1193 NULL,                                           // #431
1194 NULL,                                           // #432
1195 NULL,                                           // #433
1196 NULL,                                           // #434
1197 NULL,                                           // #435
1198 NULL,                                           // #436
1199 NULL,                                           // #437
1200 NULL,                                           // #438
1201 NULL,                                           // #439
1202 NULL,                                           // #440
1203 NULL,                                           // #441
1204 NULL,                                           // #442
1205 NULL,                                           // #443
1206 NULL,                                           // #444
1207 NULL,                                           // #445
1208 NULL,                                           // #446
1209 NULL,                                           // #447
1210 NULL,                                           // #448
1211 NULL,                                           // #449
1212 NULL,                                           // #450
1213 VM_iscachedpic,                         // #451 draw functions...
1214 VM_precache_pic,                        // #452
1215 VM_freepic,                                     // #453
1216 VM_drawcharacter,                       // #454
1217 VM_drawstring,                          // #455
1218 VM_drawpic,                                     // #456
1219 VM_drawfill,                            // #457
1220 VM_drawsetcliparea,                     // #458
1221 VM_drawresetcliparea,           // #459
1222 VM_getimagesize,                        // #460
1223 VM_cin_open,                            // #461
1224 VM_cin_close,                           // #462
1225 VM_cin_setstate,                        // #463
1226 VM_cin_getstate,                        // #464
1227 VM_cin_restart,                         // #465
1228 VM_drawline,                            // #466
1229 NULL,                                           // #467
1230 NULL,                                           // #468
1231 NULL,                                           // #469
1232 NULL,                                           // #470
1233 VM_asin,                                        // #471 float(float s) VM_asin (DP_QC_ASINACOSATANATAN2TAN)
1234 VM_acos,                                        // #472 float(float c) VM_acos (DP_QC_ASINACOSATANATAN2TAN)
1235 VM_atan,                                        // #473 float(float t) VM_atan (DP_QC_ASINACOSATANATAN2TAN)
1236 VM_atan2,                                       // #474 float(float c, float s) VM_atan2 (DP_QC_ASINACOSATANATAN2TAN)
1237 VM_tan,                                         // #475 float(float a) VM_tan (DP_QC_ASINACOSATANATAN2TAN)
1238 VM_strlennocol,                         // #476 float(string s) : DRESK - String Length (not counting color codes) (DP_QC_STRINGCOLORFUNCTIONS)
1239 VM_strdecolorize,                       // #477 string(string s) : DRESK - Decolorized String (DP_QC_STRINGCOLORFUNCTIONS)
1240 VM_strftime,                            // #478 string(float uselocaltime, string format, ...) (DP_QC_STRFTIME)
1241 VM_tokenizebyseparator,         // #479 float(string s) tokenizebyseparator (DP_QC_TOKENIZEBYSEPARATOR)
1242 VM_strtolower,                          // #480 string(string s) VM_strtolower : DRESK - Return string as lowercase
1243 VM_strtoupper,                          // #481 string(string s) VM_strtoupper : DRESK - Return string as uppercase
1244 NULL,                                           // #482
1245 NULL,                                           // #483
1246 NULL,                                           // #484
1247 NULL,                                           // #485
1248 NULL,                                           // #486
1249 NULL,                                           // #487
1250 NULL,                                           // #488
1251 NULL,                                           // #489
1252 NULL,                                           // #490
1253 NULL,                                           // #491
1254 NULL,                                           // #492
1255 NULL,                                           // #493
1256 NULL,                                           // #494
1257 NULL,                                           // #495
1258 NULL,                                           // #496
1259 NULL,                                           // #497
1260 NULL,                                           // #498
1261 NULL,                                           // #499
1262 NULL,                                           // #500
1263 NULL,                                           // #501
1264 NULL,                                           // #502
1265 NULL,                                           // #503
1266 NULL,                                           // #504
1267 NULL,                                           // #505
1268 NULL,                                           // #506
1269 NULL,                                           // #507
1270 NULL,                                           // #508
1271 NULL,                                           // #509
1272 NULL,                                           // #510
1273 NULL,                                           // #511
1274 NULL,                                           // #512
1275 NULL,                                           // #513
1276 NULL,                                           // #514
1277 NULL,                                           // #515
1278 NULL,                                           // #516
1279 NULL,                                           // #517
1280 NULL,                                           // #518
1281 NULL,                                           // #519
1282 NULL,                                           // #520
1283 NULL,                                           // #521
1284 NULL,                                           // #522
1285 NULL,                                           // #523
1286 NULL,                                           // #524
1287 NULL,                                           // #525
1288 NULL,                                           // #526
1289 NULL,                                           // #527
1290 NULL,                                           // #528
1291 NULL,                                           // #529
1292 NULL,                                           // #530
1293 NULL,                                           // #531
1294 NULL,                                           // #532
1295 NULL,                                           // #533
1296 NULL,                                           // #534
1297 NULL,                                           // #535
1298 NULL,                                           // #536
1299 NULL,                                           // #537
1300 NULL,                                           // #538
1301 NULL,                                           // #539
1302 NULL,                                           // #540
1303 NULL,                                           // #541
1304 NULL,                                           // #542
1305 NULL,                                           // #543
1306 NULL,                                           // #544
1307 NULL,                                           // #545
1308 NULL,                                           // #546
1309 NULL,                                           // #547
1310 NULL,                                           // #548
1311 NULL,                                           // #549
1312 NULL,                                           // #550
1313 NULL,                                           // #551
1314 NULL,                                           // #552
1315 NULL,                                           // #553
1316 NULL,                                           // #554
1317 NULL,                                           // #555
1318 NULL,                                           // #556
1319 NULL,                                           // #557
1320 NULL,                                           // #558
1321 NULL,                                           // #559
1322 NULL,                                           // #560
1323 NULL,                                           // #561
1324 NULL,                                           // #562
1325 NULL,                                           // #563
1326 NULL,                                           // #564
1327 NULL,                                           // #565
1328 NULL,                                           // #566
1329 NULL,                                           // #567
1330 NULL,                                           // #568
1331 NULL,                                           // #569
1332 NULL,                                           // #570
1333 NULL,                                           // #571
1334 NULL,                                           // #572
1335 NULL,                                           // #573
1336 NULL,                                           // #574
1337 NULL,                                           // #575
1338 NULL,                                           // #576
1339 NULL,                                           // #577
1340 NULL,                                           // #578
1341 NULL,                                           // #579
1342 NULL,                                           // #580
1343 NULL,                                           // #581
1344 NULL,                                           // #582
1345 NULL,                                           // #583
1346 NULL,                                           // #584
1347 NULL,                                           // #585
1348 NULL,                                           // #586
1349 NULL,                                           // #587
1350 NULL,                                           // #588
1351 NULL,                                           // #589
1352 NULL,                                           // #590
1353 NULL,                                           // #591
1354 NULL,                                           // #592
1355 NULL,                                           // #593
1356 NULL,                                           // #594
1357 NULL,                                           // #595
1358 NULL,                                           // #596
1359 NULL,                                           // #597
1360 NULL,                                           // #598
1361 NULL,                                           // #599
1362 NULL,                                           // #600
1363 VM_M_setkeydest,                        // #601 menu functions...
1364 VM_M_getkeydest,                        // #602
1365 VM_M_setmousetarget,            // #603
1366 VM_M_getmousetarget,            // #604
1367 VM_M_callfunction,                      // #605
1368 VM_writetofile,                         // #606
1369 VM_M_isfunction,                        // #607
1370 VM_M_getresolution,                     // #608
1371 VM_keynumtostring,                      // #609
1372 VM_M_findkeysforcommand,        // #610
1373 VM_M_getserverliststat,         // #611
1374 VM_M_getserverliststring,       // #612
1375 VM_parseentitydata,                     // #613
1376 VM_stringtokeynum,                      // #614
1377 VM_M_resetserverlistmasks,      // #615
1378 VM_M_setserverlistmaskstring,// #616
1379 VM_M_setserverlistmasknumber,// #617
1380 VM_M_resortserverlist,          // #618
1381 VM_M_setserverlistsort,         // #619
1382 VM_M_refreshserverlist,         // #620
1383 VM_M_getserverlistnumber,       // #621
1384 VM_M_getserverlistindexforkey,// #622
1385 VM_M_addwantedserverlistkey,// #623
1386 VM_M_getextresponse                     // #624
1387 };
1388
1389 const int vm_m_numbuiltins = sizeof(vm_m_builtins) / sizeof(prvm_builtin_t);
1390
1391 void VM_M_Cmd_Init(void)
1392 {
1393         VM_Cmd_Init();
1394 }
1395
1396 void VM_M_Cmd_Reset(void)
1397 {
1398         //VM_Cmd_Init();
1399         VM_Cmd_Reset();
1400 }