aboutsummaryrefslogtreecommitdiff
path: root/src/database
ModeNameSize
-rw-r--r--CMakeLists.txt373logplain
-rw-r--r--database-dummy.cpp1574logplain
-rw-r--r--database-dummy.h1485logplain
-rw-r--r--database-files.cpp7603logplain
-rw-r--r--database-files.h2008logplain
-rw-r--r--database-leveldb.cpp5001logplain
-rw-r--r--database-leveldb.h1812logplain
-rw-r--r--database-postgresql.cpp21890logplain
-rw-r--r--database-postgresql.h4985logplain
-rw-r--r--database-redis.cpp6098logplain
-rw-r--r--database-redis.h1351logplain
-rw-r--r--database-sqlite3.cpp25517logplain
-rw-r--r--database-sqlite3.h6900logplain
-rw-r--r--database.cpp1736logplain
-rw-r--r--database.h2466logplain
class="hl opt">[index] local travsht = lzbdata.il_shunt local travspd = lzbdata.il_speed if travsht==nil then -- lzbdata has reset travspd = train.speed_restriction travsht = train.is_shunt or false end -- check for signal local asp, spos = il.db.get_ip_signal_asp(pts, cn) -- do ARS if needed local ars_enabled = not train.ars_disable -- Note on ars_disable: -- Theoretically, the ars_disable flag would need to behave like the speed restriction field: it should be -- stored in lzbdata and updated once the train drives over. However, for the sake of simplicity, it is simply -- a value in the train. In this case, this is sufficient because once a train triggers ARS for the first time, -- resetting the path does not matter to the set route and ARS doesn't need to be called again. if spos and ars_enabled then --atdebug(id,"IL Spos (ARS)",spos,asp) local sigd = il.db.get_sigd_for_signal(spos) if sigd then il.ars_check(sigd, train) end end --atdebug("trav: ",pos, cn, asp, spos, "travsht=", lzb.travsht) local lspd if asp then --atdebug(id,"IL Signal",spos, asp, lzbdata, "trainstate", train.speed_restriction, train.is_shunt) local nspd = 0 --interpreting aspect and determining speed to proceed if travsht then --shunt move if asp.shunt then nspd = SHUNT_SPEED_MAX elseif asp.proceed_as_main and asp.main ~= 0 then nspd = asp.main travsht = false end else --train move if asp.main ~= 0 then nspd = asp.main elseif asp.shunt then nspd = SHUNT_SPEED_MAX travsht = true end end -- nspd can now be: 1. !=0: new speed restriction, 2. =0: stop here or 3. nil: keep travspd if nspd then if nspd == -1 then travspd = nil else travspd = nspd end end --atdebug("ns,ts", nspd, travspd) lspd = travspd local udata = {signal_pos = spos} local callback = get_over_function(lspd, travsht) lzbdata.il_shunt = travsht lzbdata.il_speed = travspd --atdebug("new lzbdata",lzbdata) advtrains.lzb_add_checkpoint(train, index, lspd, callback, lzbdata, udata) end end) -- Set the ars_disable flag to the value passed -- Triggers a path invalidation if set to false function advtrains.interlocking.ars_set_disable(train, value) if value then train.ars_disable = true else train.ars_disable = nil minetest.after(0, advtrains.path_invalidate, train) end end