Bladeren bron

small bug with displaying the correct roles

Paul Klumpp 12 jaren geleden
bovenliggende
commit
3ed3245616
1 gewijzigde bestanden met toevoegingen van 12 en 13 verwijderingen
  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(", ")}")
 			                  }