ULX

Author Topic: Problem with groups: bug or my fault ?  (Read 4059 times)

0 Members and 1 Guest are viewing this topic.

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Problem with groups: bug or my fault ?
« on: August 30, 2007, 07:01:55 PM »
Hi, sorry if this isn't the good place to ask it, we use ulx svn r44,

But we have just noticed that our additional groups (others than superadmin, admin, user) didn't work anymore. I don't know if this is a bug or a problem from me, but as a test  I've switched back to 3.11 and it obviously re-worked.

Anyone have experienced this problem ?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Problem with groups: bug or my fault ?
« Reply #1 on: August 30, 2007, 07:16:41 PM »
Only thing I can think of off top of my head is that SVN no longer requires Out { } in the txt files.
Other than that, I don't know why it wouldn't work in svn.

Post your groups.txt? (Don't worry about editing out SteamIDs. They really aren't all that secret)
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Problem with groups: bug or my fault ?
« Reply #2 on: August 30, 2007, 09:14:51 PM »
I had this problem too.. It seemed like the SVN broke the origional user.txt file. If you delete it and re-add everyone, it will work fine.

However.. while we're talking about it.. If I try to edit the user.txt or the new groups.txt file in data/ULib when I save it it looses all formatting and wont read on the server.. any ideas?

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Problem with groups: bug or my fault ?
« Reply #3 on: August 30, 2007, 09:59:57 PM »
You're probably using tabs when it will only do spaces. Dumb I know, but garry won't let strings be split with patterns. We should probably just implement our own splitter again :P
Experiencing God's grace one day at a time.

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Re: Problem with groups: bug or my fault ?
« Reply #4 on: August 31, 2007, 05:36:15 AM »
Well, the groups.txt looks like that:
Code: [Select]
"Out"
{
"admin"
{
"deny"
{
"1" "ulx cexec"
"2" "ulx cexecall"
"3" "ulx rcon"
"4" "ulx toolallow"
"5" "ulx adduser"
"6" "ulx userallow"
"7" "ulx luarun"
}
}

"operator"
{
"allow"
{
"1" "ulx mute"
"2" "ulx kick"
"3" "ulx slap"                               
                "4" "ulx votekick"
"5" "ulx teleport"
"6" "ulx gimp"
"7" "ulx goto"
"8" "ulx jail"
"9" "ulx cloak"
"10" "ulx god"
"11" "ulx uncloak"
"12" "ulx unjail"
"13" "ulx unmute"
"14" "ulx ungimp"
}       
}

"respected"
{
"allow"
{
"1" "ulx votekick"
        "2"             "ulx goto"
"3"             "ulx teleport"
}
}

"user"
{
"allow"
{
"1" "ulx votekick"
}
}

"minge"
{
"deny"
{
"1" "ulx votekick"
}
}

}

And users.txt:
Code: [Select]
"Out"
{

//SUPERADMINS

"KyzerSA"
{
"id" "STEAM_0:1:58722491"
"type" "steamid"
"groups"
{
"1" "superadmin"
"2" "immunity"
}
}

//ADMINS

"KyzerA"
{
"id" "STEAM_0:1:58722492"
"type" "steamid"
"groups"
{
"1" "admin"
"2" "immunity"
}
}

//MODERATORS

"KyzerMO"
{
"id" "STEAM_0:1:58722493"
"type" "steamid"
"groups"
{
"1" "operator"
}
}

//RESPECTED

"KyzerR"
{
"id" "STEAM_0:1:5872249"
"type" "steamid"
"groups"
{
"1" "respected"
}
}

//MINGES

"KyzerMI"
{
"id" "STEAM_0:1:58722495"
"type" "steamid"
"groups"
{
"1" "minge"
}
}

}
(I've tried all groups, here i was testing in the group "respected"


And also, uteam.txt:
Code: [Select]
"Out"
{
"teams"
{
"1"
{
"name" "[Super Admin]"
"group" "superadmin"
"armor" "999"
"hp" "999"
"model" "super"
"color"
{
"r" "64"
"g" "64"
"b" "64"
"a" "255"
}

"plytable"
{
"1" "SprintSpeed:2000"
"2" "WalkSpeed:800"
}
"weapons"
{
"1" "weapon_physgun"
"2" "gmod_tool"
"3" "gmod_camera"
"4" "weapon_physcannon"
"5" "weapon_crowbar"
"6" "weapon_pistol"
"7" "weapon_ar2"
"8" "weapon_tmp_ky"
"9" "weapon_357"
"10" "weapon_crossbow"
"11" "weapon_frag"
"12" "weapon_rpg"
}
}

"2"
{
"name" "[Admin]"
"group" "admin"
"armor" "500"
"hp" "500"
"model" "combine"
"color"
{
"r" "100"
"g" "100"
"b" "100"
"a" "255"
}
"plytable"
{
"1" "SprintSpeed:1000"
"2" "WalkSpeed:400"
}
"weapons"
{
"1" "weapon_physgun"
"2" "gmod_tool"
"3" "gmod_camera"
"4" "weapon_physcannon"
"5" "weapon_crowbar"
"6" "weapon_pistol"
"7" "weapon_ar2"
"8" "weapon_tmp"
"9" "weapon_357"
"10" "weapon_crossbow"
"11" "weapon_rpg"
}
}
"3"
{
"name" "[Moderator]"
"group" "operator"
"armor" "200"
"hp" "200"
"model" "police"
"color"
{
"r" "120"
"g" "120"
"b" "120"
"a" "255"
}
"plytable"
{
"1" "SprintSpeed:800"
"2" "WalkSpeed:300"
}
"weapons"
{
"1" "weapon_physgun"
"2" "gmod_tool"
"3" "gmod_camera"
"4" "weapon_physcannon"
"5" "weapon_crowbar"
"6" "weapon_pistol"
"7" "weapon_ar2"
"8" "weapon_tmp"
"9" "weapon_crossbow"
}
}

"4"
{
"name" "[Respected]"
"group" "respected"
"model" "alyx"
"color"
{
"r" "64"
"g" "64"
"b" "200"
"a" "255"
}
        "plytable"
{
"1" "SprintSpeed:800"
"2" "WalkSpeed:300"
}
"weapons"
{
"1" "weapon_physgun"
"2" "gmod_tool"
"3" "gmod_camera"
"4" "weapon_physcannon"
"5" "weapon_crowbar"
"6" "weapon_pistol"
"7" "weapon_ar2"
}
}

"5"
{
"name" "[Client]"
"group" "user"
"model" "kleiner"
"color"
{
"r" "100"
"g" "100"
"b" "200"
"a" "255"
}
"weapons"
{
"1" "weapon_physgun"
"2" "gmod_tool"
"3" "gmod_camera"
"4" "weapon_physcannon"
"5" "weapon_crowbar"
}
}

"6"
{
"name" "[Minge]"
"group" "minge"
"model" "male1"
"color"
{
"r" "120"
"g" "120"
"b" "200"
"a" "255"
}
"weapons"
{
"1" "weapon_physgun"
"2" "gmod_tool"
"3" "gmod_camera"
"4" "weapon_physcannon"
}
}
}

"gamemodes"
{
"1" "Sandbox"
"2" "SpaceBuild"
}
}


Oh, i forgot to say something, groups.txt and users.txt are located in "garrysmod/addons/ulib/data/ulib", when i run the server, it re-create groups.txt in "garrysmod/data/ulib", but differently:
Code: [Select]
"superadmin"

{

"allow"

{

"ulx cexecall"

"ulx rcon"

"ulx luarun"

"ulx ent"

"ulx cexec"

"ulx adduser"

"ulx userallow"

"ulx userdeny"

}

"deny"

{

}

}

"admin"

{

"allow"

{

"ulib_passtime"

"ulib_passtimeout"

"ulx slap"

"ulx whip"

"ulx slay"

"ulx sslay"

"ulx ignite"

"ulx freeze"

"ulx unfreeze"

"ulx god"

"ulx ungod"

"ulx noclip"

"ulx hp"

"ulx cloak"

"ulx uncloak"

"ulx blind"

"ulx unblind"

"ulx jail"

"ulx unjail"

"ulx bring"

"ulx goto"

"ulx send"

"ulx teleport"

"ulx ghost"

"ulx unghost"

"ulx ragdoll"

"ulx unragdoll"

"ulx vote"

"ulx gimp"

"ulx mute"

"ulx ungimp"

"ulx unmute"

"ulx maul"

"ulx gag"

"ulx ungag"

"ulx strip"

"ulx rslotsmode"

"ulx rslots"

"ulx rslotsvisible"

"reservedslots"

"ulx tooldeny"

"ulx toolallow"

"ulx tooldenyuser"

"ulx toolallowuser"

"ulx tsay"

"ulx csay"

"ulx exec"

"ulx map"

"ulx kick"

"ulx ban"

"ulx spectate"

"ulx adminmenu"

"ulx clientmenu"

"ulx mapsmenu"

"ulx votemap2"

"ulx votekick"

"ulx voteban"

"ulx mingekick"

"ulx welcomemessage"

"ulx showmotd"

"ulx chattime"

"ulx physgunplayer"

"ulx veto"

}

"deny"

{

}

}

"user"

{

"allow"

{

"ulx"

"ulx help"

"ulx report"

"ulx who"

"ulx psay"

"ulx asay"

"ulx thetime"

"ulx menu"

"ulx info"

"ulx_valueupdate"

"ulx votemap"

}

"deny"

{

}

}

"respected"

{

}

"none"

{

"allow"

{

"ulx addgimpsay"

"ulx reports_enabled"

"ulx reports_in_logs"

"ulx reports_interval"

"ulx reports_folder"

"ulx logecho"

"ulx logfile"

"ulx logevents"

"ulx logchat"

"ulx logspawns"

"ulx logspawnsecho"

"ulx logdir"

"ulx addadvert"

"ulx addcsayadvert"

"ulx addforceddownload"

"ulx votemapenabled"

"ulx votemapmintime"

"ulx votemapwaittime"

"ulx votemapsuccessratio"

"ulx votemapminvotes"

"ulx votemapvetotime"

"ulx votemapmapmode"

"ulx votemapaddmap"

}

"deny"

{

}

}

"operator"

{

}

"minge"

{

}

I've of course tried to move my users.txt and groups.txt into "garrysmod/data/ulib", nothing change

So..i don't know what's wrong here, should i remove all { and } (how is it possible :s), should i replace all tabs by a single space? And Zakap i'll try to re-add someone for test.

Sorry for long post :s

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Problem with groups: bug or my fault ?
« Reply #5 on: September 13, 2007, 06:15:38 PM »
Fixed in revision 65!

I can blame garry on this issue though... amazing how much a poorly coded string.Explode() function can slow you down. ;)
Experiencing God's grace one day at a time.

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Re: Problem with groups: bug or my fault ?
« Reply #6 on: September 13, 2007, 10:35:26 PM »
string.Explode is bugged ? i used it recently without problems :-X

I've found this one too, never tried it:
Code: [Select]
function explode ( seperator, str )
  local pos, arr = 0, {}
for st, sp in function() return string.find( str, seperator, pos, true ) end do -- for each divider found
table.insert( arr, string.sub( str, pos, st-1 ) ) -- Attach chars left of current divider
pos = sp + 1 -- Jump past current divider
end
table.insert( arr, string.sub( str, pos ) ) -- Attach chars right of last divider
return arr
end

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Problem with groups: bug or my fault ?
« Reply #7 on: September 13, 2007, 10:44:47 PM »
That's the one garry uses (from the lua users wiki). The problem is that it blocks patterns. You really, really, really need patterns for any sort of file I/O.
Experiencing God's grace one day at a time.