r101 - trunk/progsqc
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Tue Feb 19 21:57:20 EST 2008
Author: havoc
Date: 2008-02-19 21:57:20 -0500 (Tue, 19 Feb 2008)
New Revision: 101
Modified:
trunk/progsqc/server.qc
Log:
fix client command parser
Modified: trunk/progsqc/server.qc
===================================================================
--- trunk/progsqc/server.qc 2008-02-20 02:40:43 UTC (rev 100)
+++ trunk/progsqc/server.qc 2008-02-20 02:57:20 UTC (rev 101)
@@ -97,14 +97,16 @@
//cl_divspeed = 1 / cvar("cl_rollspeed");
// TODO: implement timelimit
-
+
bot_serverframe();
};
void SV_ParseClientCommand(string s)
{
+ local string c;
tokenize(s);
- if(argv(0) == "join")
+ c = argv(0);
+ if(c == "join")
{
bprint ("^4", self.netname, "^4 is playing now\n");
if (!self.spawned)
@@ -113,11 +115,31 @@
self.frags = 0;
PutClientInServer();
}
- }
- else if( argv(0) == "selectclass" )
+ }
+ else if( c == "selectclass" )
{
self.classnum = stof(argv(1));
if ((self.classnum > ACTORTYPE_TOTAL) || (self.classnum <= ACTORTYPE_INVALID))
self.classnum = 1;
}
+ // edit this to do what you want with the received commands
+ else if (c == "say") clientcommand(self, s);
+ else if (c == "say_team") clientcommand(self, s);
+ else if (c == "name") clientcommand(self, s);
+ else if (c == "color") clientcommand(self, s);
+ else if (c == "tell") clientcommand(self, s);
+ else if (c == "kill") clientcommand(self, s);
+ else if (c == "status") clientcommand(self, s);
+ else if (c == "pause") clientcommand(self, s);
+ else if (c == "kick") clientcommand(self, s);
+ else if (c == "ping") clientcommand(self, s);
+ else if (c == "ban") clientcommand(self, s);
+ else if (c == "pmodel") clientcommand(self, s);
+ else if (c == "god") clientcommand(self, s);
+ else if (c == "fly") clientcommand(self, s);
+ else if (c == "noclip") clientcommand(self, s);
+ else if (c == "notarget") clientcommand(self, s);
+ else if (c == "give") clientcommand(self, s);
+ // please keep this fallback incase new engine commands are added
+ else clientcommand(self, s);
}
\ No newline at end of file
More information about the zymotic-commits
mailing list