Пример #1
0
        public bool CanUserBuild(ManicDiggerServer.Server.Client client)
        {
            if (this.isGuestAllowed)
                return true;
            else if (this.isUserAllowed && !client.playername.StartsWith("~"))
                return true;
            else if (this.isBuilderAllowed && client.CanBuild)
                return true;
            else if (this.isAdminAllowed && client.IsAdmin)
                return true;
            else
            {
                foreach (String user in this.usersAllowed)
                {
                    if (client.playername == user)
                        return true;
                }
            }

            return false;
        }
Пример #2
0
 public bool CanUserBuild(ManicDiggerServer.Server.Client client, int x, int y)
 {
     bool canBuild = true;
     foreach (AreaConfig area in this.Areas)
     {
         if (area.IsInCoords(x, y))
         {
             if (!area.CanUserBuild(client))
             {
                 return false;
             }
         }
     }
     return canBuild;
 }