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