]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove playerdemo feature (it is incomplete, unmaintained and unstable)
authorMario <mario@smbclan.net>
Sat, 9 Jun 2018 16:52:12 +0000 (02:52 +1000)
committerMario <mario@smbclan.net>
Sat, 9 Jun 2018 16:52:12 +0000 (02:52 +1000)
commands.cfg
qcsrc/common/state.qc
qcsrc/ecs/systems/sv_physics.qc
qcsrc/server/_mod.inc
qcsrc/server/_mod.qh
qcsrc/server/client.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/mutators/gamemode.qh
qcsrc/server/playerdemo.qc [deleted file]
qcsrc/server/playerdemo.qh [deleted file]

index 79366e4b703af1967b2ef20e8a1299536d4d9974..e36e41e227850696970cec56ba62121f43a2c09b 100644 (file)
@@ -212,7 +212,6 @@ alias lockteams            "qc_cmd_sv     lockteams            ${* ?}" // Disabl
 alias make_mapinfo         "qc_cmd_sv     make_mapinfo         ${* ?}" // Automatically rebuild mapinfo files
 alias moveplayer           "qc_cmd_sv     moveplayer           ${* ?}" // Change the team/status of a player
 alias nospectators         "qc_cmd_sv     nospectators         ${* ?}" // Automatically remove spectators from a match
-alias playerdemo           "qc_cmd_sv     playerdemo           ${* ?}" // Control the ability to save demos of players
 alias printstats           "qc_cmd_sv     printstats           ${* ?}" // Dump eventlog player stats and other score information
 alias radarmap             "qc_cmd_sv     radarmap             ${* ?}" // Generate a radar image of the map
 alias reducematchtime      "qc_cmd_sv     reducematchtime      ${* ?}" // Decrease the timelimit value incrementally
index ea936185b95ee2b1227a58be5664a7e2ecfda30c..37813ef716c0bd5f393bc45a1f2fad39036e7b0b 100644 (file)
@@ -31,7 +31,6 @@ void PlayerScore_Attach(entity this);
 void ClientData_Attach(entity this);
 void accuracy_init(entity this);
 void entcs_attach(entity this);
-void playerdemo_init(entity this);
 void anticheat_init(entity this);
 void W_HitPlotOpen(entity this);
 void bot_clientconnect(entity this);
@@ -51,7 +50,6 @@ void ClientState_attach(entity this)
        ClientData_Attach(this);
        accuracy_init(this);
        entcs_attach(this);
-       playerdemo_init(this);
        anticheat_init(this);
        W_HitPlotOpen(this);
 
@@ -61,7 +59,6 @@ void ClientState_attach(entity this)
 void bot_clientdisconnect(entity this);
 void W_HitPlotClose(entity this);
 void anticheat_report_to_eventlog(entity this);
-void playerdemo_shutdown(entity this);
 void entcs_detach(entity this);
 void accuracy_free(entity this);
 void ClientData_Detach(entity this);
@@ -81,6 +78,5 @@ void ClientState_detach(entity this)
     bot_clientdisconnect(this);
 
     anticheat_report_to_eventlog(this);
-    playerdemo_shutdown(this);
     entcs_detach(this);
 }
index c3594c0136cfff9cfca75c0573cbfd1349ed2d8e..45128393baee77d55b07b436b735291ae9c08e0c 100644 (file)
@@ -34,7 +34,6 @@ void sys_phys_monitor(entity this, float dt)
 void sys_phys_ai(entity this)
 {
        if (!IS_BOT_CLIENT(this)) { return; }
-       if (playerdemo_read(this)) { return; }
        bot_think(this);
 }
 
index ca0dec4bb3c251c33bbf565c2e48e5d7ff5c71cd..9f6a2a76b4c8ebc4ce482315d95a77fec8870290 100644 (file)
@@ -17,7 +17,6 @@
 #include <server/matrix.qc>
 #include <server/miscfunctions.qc>
 #include <server/player.qc>
-#include <server/playerdemo.qc>
 #include <server/portals.qc>
 #include <server/race.qc>
 #include <server/resources.qc>
index c87bb2a03274f89768541e222ee8934732630648..527ec0dfbe4fd1c32d7779df82fb844a79dd63ac 100644 (file)
@@ -17,7 +17,6 @@
 #include <server/matrix.qh>
 #include <server/miscfunctions.qh>
 #include <server/player.qh>
-#include <server/playerdemo.qh>
 #include <server/portals.qh>
 #include <server/race.qh>
 #include <server/resources.qh>
index b8cd3cdab6ed0cfcb2230b7b054d1030af5f5110..8443efb90497b0f98c8036f721256cc1b38209f6 100644 (file)
@@ -10,7 +10,6 @@
 #include "miscfunctions.qh"
 #include "portals.qh"
 #include "teamplay.qh"
-#include "playerdemo.qh"
 #include "spawnpoints.qh"
 #include "resources.qh"
 #include "g_damage.qh"
@@ -2771,8 +2770,6 @@ void PlayerPostThink (entity this)
                WaypointSprite_UpdateHealth(this.waypointsprite_attachedforcarrier, '1 0 0' * v);
     }
 
-       playerdemo_write(this);
-
        CSQCMODEL_AUTOUPDATE(this);
 }
 
index 6de4507b1708ef54516d9d5db859bdb960a37457..97af2d49460986ce79b2e30ae761da78c75b8e9e 100644 (file)
@@ -15,7 +15,6 @@
 #include "../player.qh"
 #include "../g_world.qh"
 #include "../ipban.qh"
-#include "../playerdemo.qh"
 #include "../teamplay.qh"
 
 #include "../bot/api.qh"
@@ -1172,86 +1171,6 @@ void GameCommand_nospectators(float request)
        }
 }
 
-void GameCommand_playerdemo(float request, float argc)
-{
-       switch (request)
-       {
-               case CMD_REQUEST_COMMAND:
-               {
-                       if (argv(2) && argv(3))
-                       {
-                               entity client;
-                               float i, n, accepted;
-
-                               switch (argv(1))
-                               {
-                                       case "read":
-                                       {
-                                               client = GetIndexedEntity(argc, 2);
-                                               accepted = VerifyClientEntity(client, false, true);
-
-                                               if (accepted <= 0)
-                                               {
-                                                       LOG_INFO("playerdemo: read: ", GetClientErrorString(accepted, argv(2)), ".");
-                                                       return;
-                                               }
-
-                                               playerdemo_open_read(client, argv(next_token));
-                                               return;
-                                       }
-
-                                       case "write":
-                                       {
-                                               client = GetIndexedEntity(argc, 2);
-                                               accepted = VerifyClientEntity(client, false, false);
-
-                                               if (accepted <= 0)
-                                               {
-                                                       LOG_INFO("playerdemo: write: ", GetClientErrorString(accepted, argv(2)), ".");
-                                                       return;
-                                               }
-
-                                               playerdemo_open_write(client, argv(next_token));
-                                               return;
-                                       }
-
-                                       case "auto_read_and_write":
-                                       {
-                                               n = GetFilteredNumber(argv(3));
-                                               cvar_set("bot_number", ftos(n));
-
-                                               localcmd("wait; wait; wait\n");
-                                               for (i = 0; i < n; ++i)
-                                                       localcmd("sv_cmd playerdemo read ", ftos(i + 2), " ", argv(2), ftos(i + 1), "\n");
-                                               localcmd("sv_cmd playerdemo write 1 ", ftos(n + 1), "\n");
-                                               return;
-                                       }
-
-                                       case "auto_read":
-                                       {
-                                               n = GetFilteredNumber(argv(3));
-                                               cvar_set("bot_number", ftos(n));
-
-                                               localcmd("wait; wait; wait\n");
-                                               for (i = 0; i < n; ++i)
-                                                       localcmd("sv_cmd playerdemo read ", ftos(i + 2), " ", argv(2), ftos(i + 1), "\n");
-                                               return;
-                                       }
-                               }
-                       }
-               }
-
-               default:
-                       LOG_INFO("Incorrect parameters for ^2playerdemo^7");
-               case CMD_REQUEST_USAGE:
-               {
-                       LOG_INFO("Usage:^3 sv_cmd playerdemo command (entitynumber filename | entitynumber botnumber)");
-                       LOG_INFO("  Full list of commands here: \"read, write, auto_read_and_write, auto_read.\"");
-                       return;
-               }
-       }
-}
-
 void GameCommand_printstats(float request)
 {
        switch (request)
@@ -1732,7 +1651,6 @@ SERVER_COMMAND(lockteams, "Disable the ability for players to switch or enter te
 SERVER_COMMAND(make_mapinfo, "Automatically rebuild mapinfo files") { GameCommand_make_mapinfo(request); }
 SERVER_COMMAND(moveplayer, "Change the team/status of a player") { GameCommand_moveplayer(request, arguments); }
 SERVER_COMMAND(nospectators, "Automatically remove spectators from a match") { GameCommand_nospectators(request); }
-SERVER_COMMAND(playerdemo, "Control the ability to save demos of players") { GameCommand_playerdemo(request, arguments); }
 SERVER_COMMAND(printstats, "Dump eventlog player stats and other score information") { GameCommand_printstats(request); }
 SERVER_COMMAND(radarmap, "Generate a radar image of the map") { GameCommand_radarmap(request, arguments); }
 SERVER_COMMAND(reducematchtime, "Decrease the timelimit value incrementally") { GameCommand_reducematchtime(request); }
index 270667a5d5619da5e8f848f6a2520102ac5d8387..b2c595f94a98e1d6d9405ccd81401cc21850366b 100644 (file)
@@ -69,7 +69,6 @@
 #include <server/mapvoting.qh>
 #include <server/ipban.qh>
 #include <server/antilag.qh>
-#include <server/playerdemo.qh>
 #include <server/item_key.qh>
 #include <server/pathlib/pathlib.qh>
 #include <common/vehicles/all.qh>
diff --git a/qcsrc/server/playerdemo.qc b/qcsrc/server/playerdemo.qc
deleted file mode 100644 (file)
index 411d826..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-#include "playerdemo.qh"
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-    #include "defs.qh"
-    #include "playerdemo.qh"
-       #include <common/state.qh>
-#endif
-
-.float playerdemo_fh;
-.float playerdemo_mode;
-.float playerdemo_starttime;
-.float playerdemo_time;
-const float PLAYERDEMO_MODE_OFF = 0;
-const float PLAYERDEMO_MODE_READING = 1;
-const float PLAYERDEMO_MODE_WRITING = 2;
-void playerdemo_init(entity this)
-{
-       this.playerdemo_mode = PLAYERDEMO_MODE_OFF;
-}
-void playerdemo_shutdown(entity this)
-{
-       if(this.playerdemo_mode != PLAYERDEMO_MODE_OFF)
-       {
-               LOG_INFO("playerdemo: ", this.netname, " closed");
-               fclose(this.playerdemo_fh);
-       }
-       this.playerdemo_mode = 0;
-}
-void playerdemo_open_read(entity this, string f)
-{
-       playerdemo_shutdown(this);
-       this.playerdemo_mode = PLAYERDEMO_MODE_READING;
-       this.playerdemo_fh = fopen(f, FILE_READ);
-       this.playerdemo_starttime = time - 1;
-       this.playerdemo_time = stof(fgets(this.playerdemo_fh));
-       this.playerdemo_time += this.playerdemo_starttime;
-       set_movetype(this, MOVETYPE_NONE);
-       LOG_INFO("playerdemo: ", this.netname, " reading from ", f);
-}
-void playerdemo_open_write(entity this, string f)
-{
-       playerdemo_shutdown(this);
-       this.playerdemo_mode = PLAYERDEMO_MODE_WRITING;
-       this.playerdemo_fh = fopen(f, FILE_WRITE);
-       this.playerdemo_starttime = time - 1;
-       LOG_INFO("playerdemo: ", this.netname, " writing to ", f);
-       LOG_INFO("WARNING: playerdemo file format is incomplete and not stable yet. DO NOT RELY ON IT!");
-}
-#define PLAYERDEMO_FIELD(ent,func,t,f) func##t(ent,f,#f);
-#define PLAYERDEMO_FIELDS(ent,func) \
-       PLAYERDEMO_FIELD(ent,func,originvector,origin) \
-       PLAYERDEMO_FIELD(ent,func,vector,angles) \
-       PLAYERDEMO_FIELD(ent,func,sizevector,mins) \
-       PLAYERDEMO_FIELD(ent,func,sizevector,maxs) \
-       PLAYERDEMO_FIELD(ent,func,vector,v_angle) \
-       PLAYERDEMO_FIELD(ent,func,modelstring,model) \
-       PLAYERDEMO_FIELD(ent,func,string,playermodel) \
-       PLAYERDEMO_FIELD(ent,func,float,skin) \
-       PLAYERDEMO_FIELD(ent,func,string,playerskin) \
-       PLAYERDEMO_FIELD(ent,func,float,frame) \
-       PLAYERDEMO_FIELD(ent,func,float,effects) \
-       /* PLAYERDEMO_FIELD(ent,func,float,switchweapon) */ \
-       PLAYERDEMO_FIELD(CS(ent),func,float,button0) /* TODO: PHYS_INPUT_BUTTON_ATCK */ \
-       PLAYERDEMO_FIELD(CS(ent),func,float,button3) /* TODO: PHYS_INPUT_BUTTON_ATCK2 */ \
-       PLAYERDEMO_FIELD(CS(ent),func,float,button5) /* TODO: PHYS_INPUT_BUTTON_CROUCH */ \
-       PLAYERDEMO_FIELD(CS(ent),func,float,button6) /* TODO: PHYS_INPUT_BUTTON_HOOK */ \
-       PLAYERDEMO_FIELD(CS(ent),func,float,buttonuse) /* TODO: PHYS_INPUT_BUTTON_USE */ \
-       PLAYERDEMO_FIELD(ent,func,float,flags) \
-       // end of list
-
-void playerdemo_write_originvector(entity this, .vector f, string name)
-{
-       fputs(this.playerdemo_fh, strcat(vtos(this.(f)), "\n"));
-}
-void playerdemo_write_sizevector(entity this, .vector f, string name)
-{
-       fputs(this.playerdemo_fh, strcat(vtos(this.(f)), "\n"));
-}
-void playerdemo_write_vector(entity this, .vector f, string name)
-{
-       fputs(this.playerdemo_fh, strcat(vtos(this.(f)), "\n"));
-}
-void playerdemo_write_string(entity this, .string f, string name)
-{
-       fputs(this.playerdemo_fh, strcat(this.(f), "\n"));
-}
-void playerdemo_write_modelstring(entity this, .string f, string name)
-{
-       fputs(this.playerdemo_fh, strcat(this.(f), "\n"));
-}
-void playerdemo_write_float(entity this, .float f, string name)
-{
-       fputs(this.playerdemo_fh, strcat(ftos(this.(f)), "\n"));
-}
-void playerdemo_write(entity this)
-{
-       if(this.playerdemo_mode != PLAYERDEMO_MODE_WRITING)
-               return;
-       fputs(this.playerdemo_fh, strcat(ftos(time - this.playerdemo_starttime), "\n"));
-       PLAYERDEMO_FIELDS(this, playerdemo_write_)
-}
-void playerdemo_read_originvector(entity this, .vector f, string name)
-{
-       setorigin(this, stov(fgets(this.playerdemo_fh)));
-}
-void playerdemo_read_sizevector(entity this, .vector f, string name)
-{
-       this.(f) = stov(fgets(this.playerdemo_fh));
-       setsize(this, this.mins, this.maxs);
-}
-void playerdemo_read_vector(entity this, .vector f, string name)
-{
-       this.(f) = stov(fgets(this.playerdemo_fh));
-}
-void playerdemo_read_string(entity this, .string f, string name)
-{
-       string s = fgets(this.playerdemo_fh);
-       if (s != this.(f))
-       {
-               /*
-               if(this.f)
-                       strunzone(this.f);
-               */
-               this.(f) = strzone(s);
-       }
-}
-void playerdemo_read_modelstring(entity this, .string f, string name)
-{
-       string s = fgets(this.playerdemo_fh);
-       if (s != this.(f))
-               _setmodel(this, s);
-}
-void playerdemo_read_float(entity this, .float f, string name)
-{
-       this.(f) = stof(fgets(this.playerdemo_fh));
-}
-float playerdemo_read(entity this)
-{
-       if(this.playerdemo_mode != PLAYERDEMO_MODE_READING)
-               return 0;
-       if(this.playerdemo_time < 0)
-               return 1;
-       float t;
-       t = time;
-       while(time >= this.playerdemo_time)
-       {
-               PLAYERDEMO_FIELDS(this, playerdemo_read_)
-               {
-                       time = this.playerdemo_time;
-                       PlayerPreThink(this);
-                       // not running physics though... this is just so we can run weapon stuff
-                       PlayerPostThink(this);
-               }
-               this.playerdemo_time = stof(fgets(this.playerdemo_fh));
-               if(this.playerdemo_time == 0)
-               {
-                       this.playerdemo_time = -1;
-                       return 1;
-               }
-               this.playerdemo_time += this.playerdemo_starttime;
-       }
-       this.velocity = '0 0 0';
-       CS(this).movement = '0 0 0';
-       this.dmg_take = 0; // so screen doesn't stay blurry
-       this.dmg_save = 0;
-       this.dmg_inflictor = NULL;
-       time = t;
-       return 1;
-}
diff --git a/qcsrc/server/playerdemo.qh b/qcsrc/server/playerdemo.qh
deleted file mode 100644 (file)
index c2da2bc..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#pragma once
-
-void playerdemo_init(entity this);
-void playerdemo_shutdown(entity this);
-void playerdemo_write(entity this);
-float playerdemo_read(entity this);
-
-void playerdemo_open_read(entity this, string f);
-void playerdemo_open_write(entity this, string f);