14 Commits

Author SHA1 Message Date
psrcek
347f6969bf Teleport the player twice to fix #50 2016-09-11 19:25:45 +02:00
psrcek
6e497a2662 Fix for bug, where you can use cg without logging in
https://redstoner.com/forums/threads/3653-chatgroup-bug
2016-08-04 13:13:56 +02:00
psrcek
94accc238a Delete plotter.py
We have https://github.com/RedstonerServer/Parcels now.
2016-08-03 23:48:15 +02:00
psrcek
2b803e8de8 Added psrcek to pythoners 2016-08-03 21:57:40 +02:00
Dico
f02fd2aae5 Merge pull request #48 from RedstonerServer/loginsecurity-patch-1
Patch buggy movement blocking when logging in
2016-06-25 08:25:38 +02:00
Dico
f6cb9ade9d Merge pull request #47 from psrcek/patch-2
Added max page number
2016-06-25 08:23:34 +02:00
Dico
fd368a8aac Patch buggy movement blocking when logging in
Added a separate event handler for PlayerMoveEvent which instead of cancelling the event, sets the new position to the old one.
This should fix the buggy, flashy screen you get when you move your cursor while not yet logged in.
2016-06-23 05:21:24 +02:00
psrcek
a2daa5c0b6 removed unnecesarry str calls 2016-06-22 15:48:20 +02:00
psrcek
5da7180bfd derp... integer division 2016-06-22 15:35:52 +02:00
psrcek
ae44dade80 fixed derp, should use math.ceil instead of +1 2016-06-22 15:21:28 +02:00
psrcek
5788cd0b3e Fixed page showing 1 page too little 2016-06-22 15:13:35 +02:00
Dico
bfcb22f650 Merge pull request #46 from psrcek/patch-1
Fix for bug, where you can shift click and toggle levers
2016-06-21 22:35:53 +02:00
psrcek
00e936532a Added max page number 2016-06-21 22:12:13 +02:00
psrcek
1602ad2185 Fix for bug, where you can shift click and toggle levers 2016-06-21 21:46:48 +02:00
7 changed files with 15 additions and 37 deletions

View File

@@ -102,8 +102,9 @@ def save_groups():
@hook.event("player.AsyncPlayerChatEvent", "normal")
def on_chat(event):
sender = event.getPlayer()
user = get_py_player(sender)
msge = event.getMessage()
if not event.isCancelled():
if (not user.logging_in) and (not event.isCancelled()):
sender_id = uid(sender)
key = get_key(sender_id)
keylen = len(key)

View File

@@ -173,8 +173,6 @@ def on_block_break(event):
def on_interact(event):
if (str(event.getAction()) == "RIGHT_CLICK_BLOCK") and not event.isCancelled():
sender = event.getPlayer()
if sender.isSneaking():
return
block = event.getClickedBlock()
pos_str = location_str(block)
data = inputs.get(pos_str)

View File

@@ -12,7 +12,7 @@ from player import get_py_player, py_players
wait_time = 30 #seconds
admin_perm = "utils.loginsecurity.admin"
min_pass_length = 8
blocked_events = ["block.BlockBreakEvent", "block.BlockPlaceEvent", "player.PlayerMoveEvent","player.AsyncPlayerChatEvent"]
blocked_events = ["block.BlockBreakEvent", "block.BlockPlaceEvent", "player.AsyncPlayerChatEvent"]
@@ -273,4 +273,10 @@ def pre_command_proccess(event):
args = event.getMessage().split(" ")
if not args[0].lower() == "/login":
msg(player.player, "&4You need to login before you do that!")
event.setCancelled(True)
event.setCancelled(True)
@hook.event("player.PlayerMoveEvent","normal")
def player_move(event):
user = get_py_player(event.getPlayer())
if user.logging_in:
event.setTo(event.getFrom())

View File

@@ -216,7 +216,8 @@ pythoners = (
"e452e012-2c82-456d-853b-3ac8e6b581f5", # Nemes
"ae795aa8-6327-408e-92ab-25c8a59f3ba1", # jomo
"d2693e91-93e1-4e3f-929f-f38e1ce8df03", # Pepich1851
"51f2ad3c-6cc8-40ea-aa2b-f25970316921" # Dico200
"51f2ad3c-6cc8-40ea-aa2b-f25970316921", # Dico200
"15ad0e60-8691-4e29-9de9-2d6b538bf56d" # psrcek
)
@simplecommand("pyeval",

View File

@@ -1,30 +0,0 @@
#!/usr/bin/python
"""
*Very basic* start of a custom plot-plugin like PlotMe
on hold because the PlotMe developer continued to develop PlotMe
"""
import sys
x_plot_size = 3
z_plot_size = 3
padding = 1
def base_coords(x, z):
pid = plot_id(x, z)
return [pid[0] * (x_plot_size + padding), pid[1] * (z_plot_size + padding)]
def bounds(x, z):
base = base_coords(x, z)
return [base, [base[0] + x_plot_size, base[1] + z_plot_size]]
def plot_id(x, z):
return [x // (x_plot_size + padding), z // (z_plot_size + padding)]
x = int(sys.argv[1])
z = int(sys.argv[2])
print "id: %s" % plot_id(x, z)
print "base: %s" % base_coords(x, z)
print "bounds: %s" % bounds(x, z)

View File

@@ -55,6 +55,7 @@ class Slave(object):
def update(self):
self.blocks -= 1
if self.blocks <= 0:
server.getPlayer(juuid(self.get_uuid())).teleport(server.getWorld(spawn_world).getSpawnLocation())
server.getPlayer(juuid(self.get_uuid())).teleport(server.getWorld(spawn_world).getSpawnLocation())
slaves.remove(self)
save_slaves()

View File

@@ -1,6 +1,7 @@
from time import time
from helpers import *
from random import randrange
import math
lols = open_json_file("lol", [])
timeout = 15
@@ -83,7 +84,7 @@ def on_lol_command(sender, command, label, args):
if offset > len(lols):
msg(sender, "&cNot a valid page (too high).")
return True
msg(sender, " &9&nLol list page %s" % str(arg1 + 1)) #"\t" symbol displays weirdly, hence the 4 spaces
msg(sender, " &9&nLol list page %s/%s" % (arg1 + 1, int(math.ceil(len(lols) / float(list_limit))))) #"\t" symbol displays weirdly, hence the 4 spaces
for i in range(offset, min(offset + list_limit, len(lols))):
msg(sender, "&a%s: &e%s" % (str(i).rjust(3), lols[i]))
msg(sender, "")