Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
02791f7
Update development
suresttexas00 May 19, 2018
67e15ee
Merge pull request #18 from suresttexas00/experimental
suresttexas00 May 19, 2018
5fa2739
Merge branch 'master' of https://github.com/suresttexas00/minecraft-w…
suresttexas00 May 19, 2018
8598a38
refactor proxy as integrated with wrapper again:
suresttexas00 May 19, 2018
1171d43
Merge pull request #20 from suresttexas00/experimental
suresttexas00 May 19, 2018
32d7332
Implement the proxy host as a ProcessPoolExecutor multiprocessor
suresttexas00 May 19, 2018
d5665eb
Merge pull request #21 from suresttexas00/experimental
suresttexas00 May 19, 2018
0dd7a9c
Merge branch 'master' of https://github.com/suresttexas00/minecraft-w…
suresttexas00 May 25, 2018
013fabe
Version 1.0.16 bugfix patch
suresttexas00 May 25, 2018
1ed036c
Merge pull request #23 from suresttexas00/development
suresttexas00 May 25, 2018
1193cc2
Merge branch 'experimental' of https://github.com/suresttexas00/minec…
suresttexas00 May 25, 2018
f4a8ffa
Build 23 bugfixes
suresttexas00 May 25, 2018
39933da
Merge pull request #24 from suresttexas00/experimental
suresttexas00 May 25, 2018
0a05ac0
update version meta for master
suresttexas00 May 25, 2018
0fa5b1d
bump version to 1.0.17
suresttexas00 May 25, 2018
1f1f275
Merge pull request #25 from suresttexas00/experimental
suresttexas00 May 25, 2018
2f00160
Build 25
suresttexas00 May 26, 2018
94507a1
typo
suresttexas00 May 26, 2018
3b79d00
typo
suresttexas00 May 26, 2018
8c4fa11
more typos
suresttexas00 May 26, 2018
bf3ecad
Merge pull request #26 from suresttexas00/experimental
suresttexas00 May 26, 2018
f427404
build 25
suresttexas00 May 28, 2018
8819525
Merge pull request #27 from suresttexas00/experimental
suresttexas00 May 28, 2018
02ebca2
Build 27
suresttexas00 Jul 15, 2018
a66e372
PR to dev
suresttexas00 Jul 15, 2018
57be818
Merge pull request #28 from suresttexas00/experimental
suresttexas00 Jul 15, 2018
d2cdda7
bugfix in whitelist commands
suresttexas00 Aug 19, 2018
e9fe73f
Merge pull request #29 from suresttexas00/development
suresttexas00 Aug 19, 2018
2780188
Update master branch
suresttexas00 Aug 19, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
#Changelog#

<h4>1.0.19 rc 28</h4>
Bugfixes:
- Bugfix commands.py line 784 where player message is used with no argument.
- fix player to player teleport ValueError bug caused by trying to read coordinates
where only a player name was given ("[lukeeexd: Teleported lukeeexd to Nyaii]")
- Fix Chat.py plugin (all player's were sharing the same chat configuration).
- Fix Chat.py breaking on /reload.
- bugfix message from offline wrapper that is a hub in mcserver.py.
- changed deop to allow any vanilla level 4 OP to run it.
- Explicitly `close()` sockets that were shutdown.
- substitute 'localhost' for code occurences of '127.0.0.1'.
New Plugin:
- add Geode plugin that prints each player's IP and country code at login.

<h4>1.0.17-18 rc 22-23</h4>
-bugfix for non-proxy setups. See Dev changelogs (on development branch).

<h4>1.0.15 rc 20</h4>
Primary reasons for update:
- Regular update prior to further new Wrapper development
Expand Down
Binary file modified Wrapper.py
Binary file not shown.
41 changes: 40 additions & 1 deletion build/CHANGELOG.DEV.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,43 @@
Build 28, 1.0.19 RC 28
- Bugfix commands.py line 784 where player message is used with no argument.
- Update Master branch

Build 27
- increment version to 1.0.18 RC 27
- fix player to player teleport ValueError bug caused by trying to read coordinates
where only a player name was given ("[lukeeexd: Teleported lukeeexd to Nyaii]")
- create PR to development.

Build 26
- Fix Chat.py plugin (all player's were sharing the same chat configuration).
- Fix Chat.py breaking on /reload.
- bugfix message from offline wrapper that is a hub in mcserver.py.
- changed deop to allow any vanilla level 4 OP to run it.
- add Geode plugin that prints each player's IP and country code at login.

Build 25
- Explicitly `close()` sockets that were shutdown.
- substitute 'localhost' for code occurences of '127.0.0.1'.

Build 24
Version number bumps to match Master 1.0.17 RC 24

Build 23
- Bugfixes:
- at player logout (mcserver.py), server would attempt to run
proxy method removestaleclients(), even if proxy mode was not running.
- mcserver.py getplayer() not returning a player object in non-proxy mode.

Build 22
- Implement the proxy host as a ProcessPoolExecutor multiprocessor (only on Python3)

Build 21 (In-process Dev build) [1.0.16 RC 21]
- Refractor proxy and remove external "ServerVitals" class and integrate wrapper into proxy again.

Build 21 [1.0.16 RC 21] (Patch to Master)
- Bugfix - at player logout (mcserver.py), server would attempt to run
proxy method removestaleclients(), even if proxy mode was not running.

Starting with:
Build 21 [1.0.15 RC 20] - Development branch update
Build 20 [1.0.15 RC 20] - Development branch update
- includes first version of vanilla claims plugin.
2 changes: 1 addition & 1 deletion build/Wrapper.py.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d5eda047085fd61c6a705dbeb4ca6ec7
d5aca2e96299c3d95a332fdf0b119b75
2 changes: 1 addition & 1 deletion build/buildinfo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Do not edit this file to bump versions; it is built automatically

__version__ = [1, 0, 15, 'rc', 20]
__version__ = [1, 0, 19, 'rc', 28]
__branch__ = 'stable'
6 changes: 3 additions & 3 deletions build/version.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"__version__": [
1,
0,
15,
19,
"rc",
20
28
],
"build": 229,
"release_time": 1526743791.661702,
"release_time": 1534692383.768469,
"repotype": "stable"
}
2 changes: 1 addition & 1 deletion docs/Wrapper.py.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d5eda047085fd61c6a705dbeb4ca6ec7
d5aca2e96299c3d95a332fdf0b119b75
2 changes: 1 addition & 1 deletion documentation/player.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
..


- connect(self, ip="127.0.0.1", port=25600)
- connect(self, ip="localhost", port=25600)

Connect to another server. Upon calling, the client's current
server instance will be closed and a new server connection made
Expand Down
48 changes: 48 additions & 0 deletions stable-plugins/Geode.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# -*- coding: utf-8 -*-

# pip install --user pygeoip
try:
import pygeoip
except ImportError:
pygeoip = False
DEPENDENCIES = ["ImportError: could not import package pygeoip", ]

NAME = "Geode"
AUTHOR = "SurestTexas00"
ID = "com.suresttexas00.plugins.geode"
VERSION = (0, 1, 0)
SUMMARY = "Lookup player's country based on ip."
WEBSITE = ""
DESCRIPTION = """
Test plugin to lookup player's country using pygeoip.
"""


# noinspection PyPep8Naming,PyMethodMayBeStatic,PyUnusedLocal
# noinspection PyClassicStyleClass,PyAttributeOutsideInit
class Main:
def __init__(self, api, log):
self.api = api
self.minecraft = api.minecraft
self.log = log

def onEnable(self):
self.api.registerEvent("player.login", self.login)
self.data_storageobject = self.api.getStorage(
"geode", world=False, pickle=False
)
self.data = self.data_storageobject.Data
self.gi = pygeoip.GeoIP('/usr/share/GeoIP/GeoIP.dat',
flags=pygeoip.const.MMAP_CACHE)

def onDisable(self):
self.data_storageobject.close()

def login(self, payload):
playerObj = payload["player"]
print(playerObj.ipaddress)
x = self.gi.country_code_by_addr(playerObj.ipaddress)
self.log.info(
"%s logged on from an ip (%s) in country '%s'." % (
playerObj.username, playerObj.ipaddress, x)
)
39 changes: 20 additions & 19 deletions stable-plugins/chat.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# coding=utf-8

import copy
import sys

PY3 = sys.version_info[0] > 2
Expand All @@ -21,25 +22,25 @@
SECT = u'\xa7'


# noinspection PyPep8Naming,PyCompatibility
# noinspection PyPep8Naming,PyMethodMayBeStatic,PyUnusedLocal
# noinspection PyClassicStyleClass,PyAttributeOutsideInit
class Main:
def __init__(self, api, log):

self.api = api
self.log = log
self.ranks = {}
self.player_ranks = {}
self.default = {
"trans": False,
"isOp": False,
"rank": None,
"color": "f" # white
}

def onEnable(self):
self.api.registerEvent("player.chatbox", self.playerChatBox)
self.api.registerEvent("player.login", self.login)
self.api.registerEvent("player.logout", self.logout)

self.player_ranks = {}
self.default = {
"trans": False,
"isOp": False,
"rank": None,
"color": "f" # white
}
self.ranks = [ # from highest to lowest
# perm display rank display color
{"perm": "owner", "rank": "Owner", "color": "4"},
Expand All @@ -55,12 +56,11 @@ def onEnable(self):
def onDisable(self):
pass

def login(self, payload):
""" Obtain the player's rank when he logs in """
player = payload["player"]
uuid = player.uuid
if uuid not in self.player_ranks:
self.player_ranks[uuid] = self.default
def verify(self, player):
""" Obtain the player's rank """
if player.uuid not in self.player_ranks:
uuid = player.uuid
self.player_ranks[uuid] = copy.copy(self.default)
if player.isOp():
self.player_ranks[uuid]["isOp"] = True

Expand All @@ -85,8 +85,8 @@ def playerChatBox(self, payload):
""" We can modify the chat.

All the permissions legwork that could slow up the code
is already done just once at login.. we have to keep this
packet moving to prevent lag!
is done just once when player chat is first used..
we have to keep this packet moving to prevent lag!

{'translate': 'chat.type.text',
'with': [__[0]__{'clickEvent': {'action': 'suggest_command',
Expand All @@ -103,6 +103,7 @@ def playerChatBox(self, payload):

player = payload["player"]
data = payload["json"]
self.verify(player)

if "translate" in data: # special type of chat

Expand All @@ -124,7 +125,7 @@ def playerChatBox(self, payload):

# chatdisplayname[0]
insertionplayer = self.api.minecraft.getPlayer(insertionplayername) # noqa

self.verify(insertionplayer)
# permanently tag OP suffix
if self.player_ranks[insertionplayer.uuid]["isOp"]:
data["with"][0]["text"] = "%s §8[OP]§r" % chatdisplayname
Expand Down
Loading