]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/gamecommand.qc
Testcase for netlinked bug
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / gamecommand.qc
index b15e6988f4d9c0392673e2246ed68a5fca8d4096..a83be998a86e3835e5a95573c26c5a045f11075a 100644 (file)
@@ -590,6 +590,7 @@ void EffectIndexDump()
        db_put(d, "TR_NEHAHRASMOKE", "1"); print("effect TR_NEHAHRASMOKE is ", ftos(particleeffectnum("TR_NEHAHRASMOKE")), "\n");
        db_put(d, "TR_NEXUIZPLASMA", "1"); print("effect TR_NEXUIZPLASMA is ", ftos(particleeffectnum("TR_NEXUIZPLASMA")), "\n");
        db_put(d, "TR_GLOWTRAIL", "1"); print("effect TR_GLOWTRAIL is ", ftos(particleeffectnum("TR_GLOWTRAIL")), "\n");
+       db_put(d, "TR_SEEKER", "1"); print("effect TR_SEEKER is ", ftos(particleeffectnum("TR_SEEKER")), "\n");
        db_put(d, "SVC_PARTICLE", "1"); print("effect SVC_PARTICLE is ", ftos(particleeffectnum("SVC_PARTICLE")), "\n");
 
        fh = fopen("effectinfo.txt", FILE_READ);
@@ -664,7 +665,7 @@ void changematchtime(float delta, float mi, float ma)
                        return;
        }
 
-       cvar_set("timelimit", ftos(new));
+       cvar_set("timelimit", ftos(new / 60));
 }
 
 void GameCommand(string command)
@@ -679,7 +680,7 @@ void GameCommand(string command)
        if(argv(0) == "help" || argc == 0)
        {
                print("Usage: sv_cmd COMMAND..., where possible commands are:\n");
-               print("  adminmsg clientnumber \"message\"\n");
+               print("  adminmsg clientnumber \"message\" [infobartime]\n");
                print("  teamstatus\n");
                print("  printstats\n");
                print("  make_mapinfo\n");
@@ -760,24 +761,40 @@ void GameCommand(string command)
        }
 
        if(argv(0) == "adminmsg")
-       if(argc == 3)
+       if(argc >= 3 && argc <= 4)
        {
                entno = stof(argv(1));
 
-               if((entno < 1) | (entno > maxclients)) {
+               if((entno < 0) | (entno > maxclients)) {
                        print("Player ", argv(1), " doesn't exist\n");
                        return;
                }
 
-               client = edict_num(entno);
-
-               if(client.flags & FL_CLIENT)
+               n = 0;
+               for(i = (entno ? entno : 1); i <= (entno ? entno : maxclients); ++i)
                {
-                       centerprint_atprio(client, CENTERPRIO_ADMIN, strcat("^3", admin_name(), ":\n\n^7", argv(2)));
-                       sprint(client, strcat("\{1}\{13}^3", admin_name(), "^7: ", argv(2), "\n"));
-                       print("Message sent to ", client.netname, "\n");
+                       client = edict_num(i);
+                       if(client.flags & FL_CLIENT)
+                       {
+                               if(argc == 4)
+                               {
+                                       s = argv(2);
+                                       s = strreplace("\n", "", s);
+                                       s = strreplace("\\", "\\\\", s);
+                                       s = strreplace("$", "$$", s);
+                                       s = strreplace("\"", "\\\"", s);
+                                       stuffcmd(client, sprintf("\ninfobar %f \"%s\"\n", stof(argv(3)), s));
+                               }
+                               else
+                               {
+                                       centerprint_atprio(client, CENTERPRIO_ADMIN, strcat("^3", admin_name(), ":\n\n^7", argv(2)));
+                                       sprint(client, strcat("\{1}\{13}^3", admin_name(), "^7: ", argv(2), "\n"));
+                               }
+                               print("Message sent to ", client.netname, "\n");
+                               ++n;
+                       }
                }
-               else
+               if(!n)
                        print("Client not found\n");
 
                return;
@@ -823,7 +840,7 @@ void GameCommand(string command)
 
        if (argv(0) == "lockteams")
        {
-               if(teams_matter)
+               if(teamplay)
                {
                        lockteams = 1;
                        bprint("^1The teams are now locked.\n");
@@ -835,7 +852,7 @@ void GameCommand(string command)
 
        if (argv(0) == "unlockteams")
        {
-               if(teams_matter)
+               if(teamplay)
                {
                        lockteams = 0;
                        bprint("^1The teams are now unlocked.\n");
@@ -854,7 +871,7 @@ void GameCommand(string command)
                //      2 (10) no centerprint, admin message
                //      3 (11) no centerprint, no admin message
 
-               if(!teams_matter) {  // death match
+               if(!teamplay) {  // death match
                        print("Currently not playing a team game\n");
                        return;
                }