Permalink
Browse files

updated gitignore, remved unused, added better user search

  • Loading branch information...
killme committed May 6, 2012
1 parent d680fd8 commit a94e58c6a55c8337a7bc17f5ce0a6ad994ce97ac
Showing with 47 additions and 8 deletions.
  1. +3 −0 .gitignore
  2. +44 −0 script/alphaserv/core/user.lua
  3. +0 −8 script/alphaserv/packages/authkey_L/auth.lua
View
@@ -8,3 +8,6 @@
/0
/1
.ignore
+bin/monitor
+bin/sauer_server
+lib/*
@@ -557,3 +557,47 @@ function _G.all_obj_user()
return list_obj(users)
end
+searchers = {
+ not_cn = function(list, arg)
+ for _, cn in pairs(arg) do
+ if list[cn] then
+ table.remove(list, cn)
+ end
+ end
+ end,
+
+ cn = function(list, arg)
+ local newlist = {}
+ for _, cn in pairs(arg) do
+ newlist[cn] = list[cn]
+ end
+
+ list = nil
+ list = newlist
+ end,
+
+ has_permission = function(list, arg)
+ for cn, player in pairs(list) do
+ if not player:has_permission(arg) then
+ list[cn] = nil
+ end
+ end
+ end
+}
+
+function _G.find_players(search, objects)
+ local users = table.copy(users)
+
+ for search, value in pairs(search) do
+ if not searchers[search] then
+ log_msg(LOG_ERROR, "Could not filter players, field \""..search.."\" not found as searcher")
+ else
+ if type(value) ~= "table" then
+ value = {value}
+ end
+
+ searchers[search](users, value)
+
+ end
+ end
+end
@@ -1,8 +0,0 @@
-
-module("auth", package.seeall)
-
-user_obj:mixid({
- auth = function(self, domain_id, callback)
-
- end
-})

0 comments on commit a94e58c

Please sign in to comment.