|
darope@0
|
1 |
<!-- vi: set ts=4 sw=4 : --> |
|
darope@0
|
2 |
<!-- vim: set tw=75 : --> |
|
darope@0
|
3 |
|
|
darope@0
|
4 |
<HTML> |
|
darope@0
|
5 |
<head> |
|
darope@0
|
6 |
<title>Metamod WDMisc Plugin</title> |
|
darope@0
|
7 |
</head> |
|
darope@0
|
8 |
<body> |
|
darope@0
|
9 |
|
|
darope@0
|
10 |
<h1>WDMisc plugin |
|
darope@0
|
11 |
</h1> |
|
darope@0
|
12 |
|
|
darope@0
|
13 |
<p> This is a simple plugin that I use as a testbed for various features |
|
darope@0
|
14 |
and other things I need to try from a plugin. |
|
darope@0
|
15 |
|
|
darope@0
|
16 |
<p> It currently provides two features: |
|
darope@0
|
17 |
|
|
darope@0
|
18 |
<ul> |
|
darope@0
|
19 |
|
|
darope@0
|
20 |
<p><li> a cvar "bounce" that, if set to 1, will exit the server at map |
|
darope@0
|
21 |
change. I use this when I need to shutdown or the server, and don't |
|
darope@0
|
22 |
want to kill it in the middle of a map, nor watch the server constantly |
|
darope@0
|
23 |
until the timelimit expires. |
|
darope@0
|
24 |
|
|
darope@0
|
25 |
<p><li> it prints a centersay to all the players whenever someone in |
|
darope@0
|
26 |
Counter-Strike plants the bomb. This was done basically as a |
|
darope@0
|
27 |
proof-of-concept for catching certain game-events that aren't otherwise |
|
darope@0
|
28 |
triggered by the HL API. It works only by examining every log message |
|
darope@0
|
29 |
that the server generates, and checking to see if it includes the string |
|
darope@0
|
30 |
indicating the particular event in question (in this case |
|
darope@0
|
31 |
"Planted_The_Bomb"). |
|
darope@0
|
32 |
|
|
darope@0
|
33 |
<p>Although this works, it is really a rather <i><b>poor</b></i> |
|
darope@0
|
34 |
solution to the problem, as it assumes a <i><b>lot</b></i> of |
|
darope@0
|
35 |
string-compares, which <i>can</i> seriously degrade the performance of |
|
darope@0
|
36 |
the server. I did try to take as many short-cuts as reasonable in the |
|
darope@0
|
37 |
code, to decrease the amount of string-comparing going on, which makes |
|
darope@0
|
38 |
the code a bit less readable than doing just a "strstr" on the log line. |
|
darope@0
|
39 |
|
|
darope@0
|
40 |
</ul> |
|
darope@0
|
41 |
|
|
darope@0
|
42 |
Other features to be added/removed in the future... |
|
darope@0
|
43 |
|
|
darope@0
|
44 |
<p> |
|
darope@0
|
45 |
<hr> |
|
darope@0
|
46 |
|
|
darope@0
|
47 |
</body> |
|
darope@0
|
48 |
</HTML> |