Browse Source

small bug with displaying the correct roles

Paul Klumpp 11 years ago
parent
commit
3ed3245616
1 changed files with 12 additions and 13 deletions
  1. 12 13
      socket_central.rb

+ 12 - 13
socket_central.rb

@@ -81,18 +81,6 @@ def displaying(c, user)
 	
 end
 
-
-def write_user(user, input)
-	
-	if online_users.user(user)
-		sometime = "#{Time.now.utc.strftime("%Y-%m-%d %H:%M:%S %z")}"
-		line = "#{sometime}: #{input}"
-	
-		$display_queue[user].push(line)
-	end
-end
-
-
 def kill_conn(c, user, t_display)
 	sleep 0.5
 	# delete the key out off $display_queue
@@ -121,6 +109,17 @@ def online_users
 end
 
 
+def write_user(user, input)
+	
+	if online_users.user(user)
+		sometime = "#{Time.now.utc.strftime("%Y-%m-%d %H:%M:%S %z")}"
+		line = "#{sometime}: #{input}"
+		
+		$display_queue[user].push(line)
+	end
+end
+
+
 def write_role(role, input, *exempts)
 	
 	#find users with role
@@ -192,7 +191,7 @@ def inputting(user, input)
 			
 	  elsif cmd == "WHO"
 			online_users.each {|ouser|
-			                   write_user(user, "WHO_RE #{ouser} ROLES: #{$user_roles[user].join(", ")}")
+			                   write_user(user, "WHO_RE #{ouser} ROLES: #{$user_roles[ouser].join(", ")}")
 			                  }