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