]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - mvm_cmds.c
add a "freeslots" field to the host cache
[xonotic/darkplaces.git] / mvm_cmds.c
index 1a9a84f3837ebfe1abdc3b3b603b3dc434ec8258..594fdedc7bff2a5afb23fb0c3d1bf3d19af67655 100644 (file)
@@ -9,10 +9,12 @@ char *vm_m_extensions =
 "DP_MENU_EXTRESPONSEPACKET "
 "DP_QC_ASINACOSATANATAN2TAN "
 "DP_QC_STRFTIME "
+"DP_QC_STRING_CASE_FUNCTIONS "
 "DP_QC_STRINGCOLORFUNCTIONS "
 "DP_QC_TOKENIZEBYSEPARATOR "
 "DP_QC_UNLIMITEDTEMPSTRINGS "
 "DP_QC_CMD "
+"DP_QC_STRREPLACE "
 ;
 
 /*
@@ -133,7 +135,7 @@ void VM_M_callfunction(void)
 
        VM_SAFEPARMCOUNTRANGE(1, 8, VM_M_callfunction);
 
-       s = PRVM_G_STRING(OFS_PARM0 + (prog->argc - 1));
+       s = PRVM_G_STRING(OFS_PARM0+(prog->argc - 1)*3);
 
        VM_CheckEmptyString(s);
 
@@ -407,12 +409,21 @@ void VM_M_setserverlistmasknumber( void )
                case SLIF_NUMPLAYERS:
                        mask->info.numplayers = number;
                        break;
+               case SLIF_NUMBOTS:
+                       mask->info.numbots = number;
+                       break;
+               case SLIF_NUMHUMANS:
+                       mask->info.numhumans = number;
+                       break;
                case SLIF_PING:
                        mask->info.ping = number;
                        break;
                case SLIF_PROTOCOL:
                        mask->info.protocol = number;
                        break;
+               case SLIF_FREESLOTS:
+                       mask->info.freeslots = number;
+                       break;
                default:
                        VM_Warning( "VM_M_setserverlistmasknumber: Bad field number %i passed!\n", field );
                        return;
@@ -519,6 +530,15 @@ void VM_M_getserverlistnumber(void)
                case SLIF_NUMPLAYERS:
                        PRVM_G_FLOAT( OFS_RETURN ) = cache->info.numplayers;
                        break;
+               case SLIF_NUMBOTS:
+                       PRVM_G_FLOAT( OFS_RETURN ) = cache->info.numbots;
+                       break;
+               case SLIF_NUMHUMANS:
+                       PRVM_G_FLOAT( OFS_RETURN ) = cache->info.numhumans;
+                       break;
+               case SLIF_FREESLOTS:
+                       PRVM_G_FLOAT( OFS_RETURN ) = cache->info.freeslots;
+                       break;
                case SLIF_PING:
                        PRVM_G_FLOAT( OFS_RETURN ) = cache->info.ping;
                        break;
@@ -589,6 +609,12 @@ void VM_M_getserverlistindexforkey( void )
                PRVM_G_FLOAT( OFS_RETURN ) = SLIF_MAXPLAYERS;
        else if( !strcmp( key, "numplayers" ) )
                PRVM_G_FLOAT( OFS_RETURN ) = SLIF_NUMPLAYERS;
+       else if( !strcmp( key, "numbots" ) )
+               PRVM_G_FLOAT( OFS_RETURN ) = SLIF_NUMBOTS;
+       else if( !strcmp( key, "numhumans" ) )
+               PRVM_G_FLOAT( OFS_RETURN ) = SLIF_NUMHUMANS;
+       else if( !strcmp( key, "freeslots" ) )
+               PRVM_G_FLOAT( OFS_RETURN ) = SLIF_FREESLOTS;
        else if( !strcmp( key, "protocol" ) )
                PRVM_G_FLOAT( OFS_RETURN ) = SLIF_PROTOCOL;
        else
@@ -1209,9 +1235,9 @@ VM_cin_setstate,                  // #463
 VM_cin_getstate,                       // #464
 VM_cin_restart,                        // #465
 VM_drawline,                           // #466
-NULL,                                          // #467
-NULL,                                          // #468
-NULL,                                          // #469
+VM_drawcolorcodedstring,       // #467
+VM_stringwidth,                                // #468
+VM_drawsubpic,                 // #469
 NULL,                                          // #470
 VM_asin,                                       // #471 float(float s) VM_asin (DP_QC_ASINACOSATANATAN2TAN)
 VM_acos,                                       // #472 float(float c) VM_acos (DP_QC_ASINACOSATANATAN2TAN)
@@ -1222,12 +1248,12 @@ VM_strlennocol,                         // #476 float(string s) : DRESK - String Length (not counting
 VM_strdecolorize,                      // #477 string(string s) : DRESK - Decolorized String (DP_QC_STRINGCOLORFUNCTIONS)
 VM_strftime,                           // #478 string(float uselocaltime, string format, ...) (DP_QC_STRFTIME)
 VM_tokenizebyseparator,                // #479 float(string s) tokenizebyseparator (DP_QC_TOKENIZEBYSEPARATOR)
-NULL,                                          // #480
-NULL,                                          // #481
+VM_strtolower,                         // #480 string(string s) VM_strtolower : DRESK - Return string as lowercase
+VM_strtoupper,                         // #481 string(string s) VM_strtoupper : DRESK - Return string as uppercase
 NULL,                                          // #482
 NULL,                                          // #483
-NULL,                                          // #484
-NULL,                                          // #485
+VM_strreplace,                         // #484 string(string search, string replace, string subject) strreplace (DP_QC_STRREPLACE)
+VM_strireplace,                                // #485 string(string search, string replace, string subject) strireplace (DP_QC_STRREPLACE)
 NULL,                                          // #486
 NULL,                                          // #487
 NULL,                                          // #488