浏览代码

small bug with displaying the correct roles

Paul Klumpp 12 年之前
父节点
当前提交
3ed3245616
共有 1 个文件被更改,包括 12 次插入13 次删除
  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(", ")}")
 			                  }