Make dist checking directory-agnostic
[mudpy.git] / mudpy / misc.py
index 81b43ef..6d61085 100644 (file)
@@ -1,6 +1,6 @@
 """Miscellaneous functions for the mudpy engine."""
 
-# Copyright (c) 2004-2020 mudpy authors. Permission to use, copy,
+# Copyright (c) 2004-2021 mudpy authors. Permission to use, copy,
 # modify, and distribute this software is granted under terms
 # provided in the LICENSE file distributed with this software.
 
@@ -405,6 +405,11 @@ class Universe:
             element.update_location()
             element.clean_contents()
 
+        # warn when debug mode has been engaged
+        if self.debug_mode():
+            pending_loglines.append((
+                "WARNING: Unsafe debugging mode is enabled!", 6))
+
         # done loading, so disallow updating elements from read-only files
         self.loading = False
 
@@ -431,13 +436,13 @@ class Universe:
         host = self.contents["mudpy.network"].get("host")
         port = self.contents["mudpy.network"].get("port")
 
-        # if no host was specified, bind to all local addresses (preferring
+        # if no host was specified, bind to the loopback address (preferring
         # ipv6)
         if not host:
             if socket.has_ipv6:
-                host = "::"
+                host = "::1"
             else:
-                host = "0.0.0.0"
+                host = "127.0.0.1"
 
         # figure out if this is ipv4 or v6
         family = socket.getaddrinfo(host, port)[0][0]
@@ -1463,9 +1468,9 @@ def reload_data():
     old_loglines = universe.loglines[:]
     for element in list(universe.contents.values()):
         element.destroy()
-    universe.load()
+    pending_loglines = universe.load()
     new_loglines = universe.loglines[:]
-    universe.loglines = old_loglines + new_loglines
+    universe.loglines = old_loglines + new_loglines + pending_loglines
     for user in old_userlist:
         user.reload()
 
@@ -2118,8 +2123,6 @@ def setup():
     log("Running version: %s" % universe.versions.version, 1)
     log("Initial directory: %s" % universe.startdir, 1)
     log("Command line: %s" % " ".join(sys.argv), 1)
-    if universe.debug_mode():
-        log("WARNING: Unsafe debugging mode is enabled!", 6)
 
     # pass the initialized universe back
     return universe