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