r8267 - trunk/darkplaces

divverent at icculus.org divverent at icculus.org
Sat Apr 26 05:49:21 EDT 2008


Author: divverent
Date: 2008-04-26 05:49:21 -0400 (Sat, 26 Apr 2008)
New Revision: 8267

Modified:
   trunk/darkplaces/common.h
   trunk/darkplaces/filematch.c
   trunk/darkplaces/netconn.c
Log is attached.
Extend rcon_restricted_commands to contain more complex patterns:

- Wildcards are supported. A * matches EXACTLY one arg. ? never matches
  whitespace. * wildcards match AT LEAST one character.
- Multi-word patterns are supported - they then match EXACTLY the command.
- Single-word non-wildcard patterns still match if the first word of the command matches.

Currently, there is no way to enforce that a command is used ONLY without any args.
Also, wildcard expressions currently NEVER match a command with quotes, as quotes
could subvert the argument restrictions.

Examples:

  foo * bar * *
  - matches: foo XXX bar XXX XXX
  - does not match: foo bar XXX XXX, foo XXX bar XXX XXX XXX, foo XXX bar XXX

  foo
  - matches: foo, foo XXX, foo XXX XXX
  - does not match: foobar

  foo bar
  - matches: foo bar
  - does not match: foo bar baz

  foo*bar
  - matches: foo42bar, foo1bar
  - does not match: foobar, foo bar


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 20080426.094921.diff
URL: <http://icculus.org/pipermail/twilight-commits/attachments/20080426/b2b71403/attachment.diff>


More information about the twilight-commits mailing list