Esempio n. 1
0
def check_acls(permission, user, position=None):
	"""Return bool whether user may currently <permission> at <position:defaults to user's position>"""
	if hasattr(user, 'acl_force') and user.acl_force:
		return True
	if position is None:
		position = user.position
	for zone in zones.get_zones_at_point(user.dimension, position):
		if 'confirmed' in zone and zone['confirmed']:
			if permission not in get_acls(zone,user):
				return False
	return True
Esempio n. 2
0
def zoneconfirm(message, user, name):
	if name not in zones.get_zones():
		tell(user, "Zone does not exist.")
		return
	zones.get_zones()[name]['confirmed'] = True
	tell(user, "Success")


WOOL_ID = 35 # Wool
IN_ZONE = 5 # green
OTHER_ZONE = 4 # yellow
CONFLICT = 14 # red

def wool_point(zone, user, (x,y,z)):
	block_metadata = None
	zones_here = zones.get_zones_at_point(user.dimension, (x,y,z))
	if zones_here == [zone]:
		block_metadata = IN_ZONE
	elif zone in zones_here:
		block_metadata = CONFLICT
	elif zones_here:
		block_metadata = OTHER_ZONE
	if block_metadata is not None:
		packet = Packet('Block change', x=x, y=y, z=z, id=WOOL_ID, metadata=block_metadata)
		send_packet(packet, user, False)


@ops_only
def zonewool(message, user, name):
	user.morewool = name
	try: