From 62426ba5d36738584a241c5540337fe879b63556 Mon Sep 17 00:00:00 2001 From: Marco Cawthorne Date: Tue, 12 Sep 2023 15:03:41 -0700 Subject: [PATCH] point_servercommand: initial implementation of this Half-Life 2 entity --- src/gs-entbase/server.src | 1 + src/gs-entbase/server/point_servercommand.qc | 57 ++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 src/gs-entbase/server/point_servercommand.qc diff --git a/src/gs-entbase/server.src b/src/gs-entbase/server.src index e4e2d679..6389471f 100644 --- a/src/gs-entbase/server.src +++ b/src/gs-entbase/server.src @@ -59,6 +59,7 @@ server/player_loadsaved.qc server/prop_dynamic.qc server/prop_physics.qc server/point_camera.qc +server/point_servercommand.qc server/point_trigger.qc server/targ_speaker.qc server/target_cdaudio.qc diff --git a/src/gs-entbase/server/point_servercommand.qc b/src/gs-entbase/server/point_servercommand.qc new file mode 100644 index 00000000..e500e829 --- /dev/null +++ b/src/gs-entbase/server/point_servercommand.qc @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2023 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +/*!QUAKED point_servercommand (1 .5 0) (-8 -8 -8) (8 8 8) +# OVERVIEW +Issues console commands on server when triggered. + +# KEYS +- "targetname" : Name + +# INPUTS +- "Command" : Enters a command into the server console, input data being the command. + +# TRIVIA +This entity was introduced in Half-Life 2 (2004). +*/ +class +point_servercommand:NSPointTrigger +{ +public: + void point_servercommand(void); + + /* overrides */ + virtual void Input(entity,string,string); +}; + +void +point_servercommand::point_servercommand(void) +{ + +} + +void +point_servercommand::Input(entity eAct, string strInput, string strData) +{ + switch (strInput) { + case "Command": + localcmd(strData); + localcmd("\n"); + break; + default: + super::Input(eAct, strInput, strData); + } +} \ No newline at end of file