Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
MinoMino committed Jan 26, 2016
2 parents af8868a + 2bbac26 commit 20cce4a
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 8 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,29 @@ is being used for this one as well. Feel free to drop by.
Installation
============
These instructions are for Debian 7 or 8 (use the latter if you can choose). For Ubuntu,
it's pretty much the same except you add Ubuntu 15's package repository temporarily,
since it has Python 3.5 in it. You're on your own for the time being on other distros,
see the [wiki entry](https://github.com/MinoMino/minqlx/wiki/Ubuntu) for details.
You're on your own for the time being on other distros,
but feel free to add instructions to the [wiki](https://github.com/MinoMino/minqlx/wiki)
if you want to help out.

- Install Python 3.5. At the time of writing, in Debian 7 or 8 you can install it by adding the `sid` repository to apt. This can be done by adding the line `deb http://ftp.debian.org/debian sid main` to
`/etc/apt/sources.list`. We also use Redis and git for our standard plugins, so we install that as well:
`/etc/apt/sources.list`. You can now go ahead and install it with the following:

```
sudo apt-get update
sudo apt-get -y install python3.5 python3.5-dev
sudo apt-get -y install redis-server git
```

- You should remove `sid` by commenting out or removing the line you added to `sources.list`
earlier and then do `sudo apt-get update` again to make sure you don't install any unstable
packages unintentionally later.

- Now you should get Redis and Git, which will be used by minqlx's plugins:

```
sudo apt-get -y install redis-server git
```

- Download one of the tarballs in [releases](https://github.com/MinoMino/minqlx/releases) and extract
its contents into `steamcmd/steamapps/common/qlds`, or whatever other directory you might have put the
files of your server in.
Expand All @@ -46,7 +51,7 @@ the directory with all the server files (and where you extracted the above files

```
git clone https://github.com/MinoMino/minqlx-plugins.git
wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
wget https://bootstrap.pypa.io/get-pip.py
sudo python3.5 get-pip.py
rm get-pip.py
sudo apt-get -y install build-essential
Expand Down
4 changes: 2 additions & 2 deletions patterns.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
#define MASK_COM_PRINTF "XXXXXXX----XXXXXX----XXXX----XXXX----XXXX----"
#define PTRN_CMD_ADDCOMMAND "\x41\x55\x49\x89\xf5\x41\x54\x49\x89\xfc\x55\x53\x48\x83\xec\x00\x48\x8b\x1d\x00\x00\x00\x00\x48\x85\xdb\x75\x00\xeb\x00\x66\x90\x48\x8b\x1b\x48\x85\xdb\x74\x00\x48\x8b\x73\x00\x4c\x89\xe7"
#define MASK_CMD_ADDCOMMAND "XXXXXXXXXXXXXXX-XXX----XXXX-X-XXXXXXXXX-XXX-XXX"
#define PTRN_CMD_ARGS "\x8b\x05\x00\x00\x00\x00\xc6\x05\xa3\xc8\x43\x00\x00\x83\xf8\x00\x0f\x8e\x00\x00\x00\x00\x41\x54\x44\x8d\x60\x00\x83\xe8\x00\x55\x48\x8d\x68\x00\x53\x31\xdb\x66\x0f\x1f\x84\x00\x00\x00\x00\x00"
#define PTRN_CMD_ARGS "\x8b\x05\x00\x00\x00\x00\xc6\x05\x73\xc8\x43\x00\x00\x83\xf8\x00\x0f\x8e\x00\x00\x00\x00\x41\x54\x44\x8d\x60\x00\x83\xe8\x00\x55\x48\x8d\x68\x00\x53\x31\xdb\x66\x0f\x1f\x84\x00\x00\x00\x00\x00"
#define MASK_CMD_ARGS "XX----XXXXX-XXX-XX----XXXXX-XX-XXXX-XXXXXXX----X"
#define PTRN_CMD_ARGV "\x3b\x3d\x00\x00\x00\x00\xb8\x00\x00\x00\x00\x73\x00\x48\x63\xff\x48\x8b\x04\xfd\x00\x00\x00\x00\xf3\xc3"
#define MASK_CMD_ARGV "XX----X----X-XXXXXXX----XX"
#define PTRN_CMD_ARGC "\x8b\x05\x00\x00\x00\x00\xc3"
#define MASK_CMD_ARGC "XX----X"
#define PTRN_CMD_TOKENIZESTRING "\x48\x85\xff\x53\xc7\x05\x42\x2f\x44\x00\x00\x00\x00\x00\x48\x89\xfb\x0f\x84\x00\x00\x00\x00\x48\x89\xfe\xba\x00\x00\x00\x00\xbf\x00\x00\x00\x00\xe8\x00\x00\x00\x00\x8b\x0d\x00\x00\x00\x00"
#define PTRN_CMD_TOKENIZESTRING "\x48\x85\xff\x53\xc7\x05\x12\x2f\x44\x00\x00\x00\x00\x00\x48\x89\xfb\x0f\x84\x00\x00\x00\x00\x48\x89\xfe\xba\x00\x00\x00\x00\xbf\x00\x00\x00\x00\xe8\x00\x00\x00\x00\x8b\x0d\x00\x00\x00\x00"
#define MASK_CMD_TOKENIZESTRING "XXXXXXXXX----XXXXXX----XXXX----X----X----XX----"
#define PTRN_CBUF_EXECUTETEXT "\x83\xff\x00\x74\x00\x83\xff\x00\x74\x00\x85\xff\x74\x00\xbe\x00\x00\x00\x00\x31\xff\x31\xc0\xe9\x00\x00\x00\x00\x0f\x1f\x40\x00\x48\x85\xf6\x74\x00\x80\x3e\x00\x75\x00\xe9\x00\x00\x00\x00\x90"
#define MASK_CBUF_EXECUTETEXT "XX-X-XX-X-XXX-X----XXXXX----XXX-XXXX-XX-X-X----X"
Expand Down
5 changes: 5 additions & 0 deletions python/minqlx/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ def set_plugins_version(path):
setattr(minqlx, "__plugins_version__", "{}-{}".format(version, branch))

def set_map_subtitles():
# We save the actual values before setting them so that we can retrieve them in Game.
setattr(minqlx, "_map_title", minqlx.get_configstring(3))
setattr(minqlx, "_map_subtitle1", minqlx.get_configstring(678))
setattr(minqlx, "_map_subtitle2", minqlx.get_configstring(679))

cs = minqlx.get_configstring(678)
if cs:
cs += " - "
Expand Down
12 changes: 11 additions & 1 deletion python/minqlx/_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,17 @@ def map(self, value):
@property
def map_title(self):
"""The full name of the map. Ex.: ``Longest Yard``."""
return minqlx.get_configstring(3)
return minqlx._map_title

@property
def map_subtitle1(self):
"""The map's subtitle. Usually either empty or has the author's name."""
return minqlx._map_subtitle1

@property
def map_subtitle2(self):
"""The map's second subtitle. Usually either empty or has the author's name."""
return minqlx._map_subtitle2

@property
def red_score(self):
Expand Down
12 changes: 12 additions & 0 deletions python/minqlx/_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ def clan(self):
return minqlx.parse_variables(minqlx.get_configstring(529 + self._id))["cn"]
except KeyError:
return ""

@clan.setter
def clan(self, tag):
index = self.id + 529
cs = minqlx.parse_variables(minqlx.get_configstring(index), ordered=True)
cs["xcn"] = tag
cs["cn"] = tag
new_cs = "".join(["\\{}\\{}".format(key, cs[key]) for key in cs])
minqlx.set_configstring(index, new_cs)

@property
def name(self):
Expand Down Expand Up @@ -541,6 +550,9 @@ def score(self, value):
def channel(self):
return minqlx.TellChannel(self)

def center_print(self, msg):
minqlx.send_server_command(self.id, "cp \"{}\"".format(msg))

def tell(self, msg, **kwargs):
return minqlx.Plugin.tell(msg, self, **kwargs)

Expand Down
7 changes: 7 additions & 0 deletions python/minqlx/_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,13 @@ def teams(cls, player_list=None):

return res

@classmethod
def center_print(cls, msg, recipient=None):
if recipient:
recipient = cls.client_id(recipient)

minqlx.send_server_command(recipient, "cp \"{}\"".format(msg))

@classmethod
def tell(cls, msg, recipient, **kwargs):
"""Send a tell (private message) to someone.
Expand Down

0 comments on commit 20cce4a

Please sign in to comment.