Andrew Godwin  committed 276d00d

More fixes

  • Participants
  • Parent commits de1e8cb

Comments (0)

Files changed (3)

File myne/plugins/

     def canBreakAdminBlocks(self):
         "Shortcut for checking permissions."
-        if
+        if hasattr(self.client, "world"):
             return (not or self.client.isOp()
             return False

File myne/

         # Check for IP bans
         ip = self.transport.getPeer().host
         if self.factory.isIpBanned(ip):
-            self.sendError("Your IP (%s) is banned from this server." % ip)
+            self.sendError("You are banned for: %s" % self.factory.ipBanReason(ip))
         self.log("Assigned ID %i" %, level=logging.DEBUG)
                 self.log("Connected, as '%s'" % self.username)
                 # Are they banned?
                 if self.factory.isBanned(self.username):
-                    self.sendError("You have been banned from this server.")
+                    self.sendError("You are banned for: %s" % self.factory.banReason(self.username))
                 # OK, see if there's anyone else with that username
                 if not self.factory.duplicate_logins and self.username.lower() in self.factory.usernames:
         "Starts the process of sending a level to the client."
         # Ask the World to flush the level and get a gzip handle back to us.
+        if hasattr(self, "world"):
     def sendLevelStart(self, (gzip_handle, zipped_size)):
         "Called when the world is flushed and the gzip is ready to read."

File myne/

                     if isinstance(source_client, World):
                         world = source_client
-                        world =
+                        try:
+                            world =
+                        except AttributeError:
+                            logging.log(logging.WARN, "Source client for message has no world. Ignoring.")
+                            continue
                     # Someone built/deleted a block
                     if task is TASK_BLOCKSET: