Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
« Previous 1 … 6 7 8 9 10 … 18 Next »
Possible dependency bug
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
Possible dependency bug
02-07-2017, 04:07 PM,
#1
esitee Offline
you know
****
Posts: 60
Threads: 9
Joined: Dec 2014
Bug  Possible dependency bug
Hello everyone!

While working on my new mainframe, I've noticed a interesting (possible) bug with the dependency of 2 libs. I tried to include both of them via dependency directly in the server environement. Both libs basically included some tables with data. The strange part now was that I could use the contents of the first lib perfectly fine, but the second lib's tables weren't recognized at all (nil error). Both libs were located on the exact same path of my shared folder, with the same permissions set on them. Furthermore the paths and names were written perfectly fine, so everything was ok there.

Here's the example code I used at first:

--@dependency STEAM_0:1:68201847 lib/FirstLib.txt sv 
--@dependency STEAM_0:1:68201847 lib/SecondLib.txt sv

if SERVER then
print( TableFromFirstLib[1] ) --This would print entry one
print( TableFromSecondLib[1] ) --This would error the chip with the message that the table itself is nil
end

Anyhow, after Yuri thought it may be intentional, I tried a different version and it worked:


--@dependency STEAM_0:1:68201847 lib/FirstLib.txt sv 
--@dependency STEAM_0:1:68201847 lib/SecondLib.txt

if SERVER then
require( "lib/SecondLib.txt" )
print( TableFromFirstLib[1] )
print( TableFromSecondLib[1] ) --Now both printed out the correct String's with no error
end

I did check the sf-helper and the tutorial in case there would have been anything to clear this up, but there wasn't.

So is this a bug, was it intentional or did I just misunderstood how the whole dependency system works?

[Image: ldkcVkq.jpg]
Find
Reply
02-07-2017, 05:46 PM,
#2
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Possible dependency bug
I can't reproduce this. When I use two different files from the shared area that both declare globals with --@dependency, they are both run and both globals are available.

If you can reduce this to the test case you've given in your post and get it to still fail (I'm assuming that's not the code you were really using), that would be helpful.
Find
Reply
02-07-2017, 06:25 PM,
#3
esitee Offline
you know
****
Posts: 60
Threads: 9
Joined: Dec 2014
RE: Possible dependency bug
(02-07-2017, 05:46 PM)Person8880 Wrote: If you can reduce this to the test case you've given in your post and get it to still fail (I'm assuming that's not the code you were really using), that would be helpful.

I did reduce it to the test case before with the same result. I'll just leave the exact test code I used, when getting the error:

--@name Libtest
--@author Esitee
--@dependency STEAM_0:1:68201847 lib/Aschen-Lib.txt sv
--@dependency STEAM_0:1:68201847 lib/Permissions.txt sv

--[[
My permission lib is working fine and it will give out the access level perfectly, but the aschen-lib tables won't work.
]]

if SERVER then
print(Permissions[ents.owner()ConfusedteamID()]) --will print 5
print(L["universe"]) --chip errors saying L is nil, should give out a warp vector in chat
end

This throws the following error:
Code:
[SF - ERROR] SF:libtest.txt:10: attempt to index global 'L' (a nil value)

And here the used table excerpts of the libs. For the sake of simplicity, i'm only going to post one entry of the warp table:

Permission-Lib (functions and that stuff left out, but they work as well) :

Permissions = {} 
Permissions[ents.owner()ConfusedteamID()] = 5

Aschen-Lib:

L = {}  -- Warp Table
L["universe"] = Vector( 6793.40, -1623.81, -3709.46 )


As stated before, when I change things up, so that one file is later included with
Code:
require( "filepath" )
it works just normal..

[Image: ldkcVkq.jpg]
Find
Reply
02-07-2017, 06:55 PM,
#4
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Possible dependency bug
I found the problem, it should be fixed when the servers next restart.
Find
Reply
02-07-2017, 07:36 PM,
#5
esitee Offline
you know
****
Posts: 60
Threads: 9
Joined: Dec 2014
RE: Possible dependency bug
Thank you, Person!

[Image: ldkcVkq.jpg]
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
Forum Jump:


Users browsing this thread:
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.