~ywang

~ywang/misc

Last active 1 year, 9 months ago
View more

Recent activity

Re: [PATCH] [security] small security fixes in advtrains_luaautomation/ 10 days ago

From Y. Wang to ~gpcf/advtrains-devel

>   		if response == nil then
>   			return false
>   		else
> -			return response.trains
> +			return table.copy(response.trains or {})
>   		end

Would it make sense to check the response using `not response` instead 
of `response == nil`? That would avoid the `or {}` part in the modified 
line.

This is not introduced by the patch, but does it make any (significant) 
difference whether the track section ID is falsy (false or nil) or 
refers to a non-existent track section? Otherwise I don't see why the

Re: [PATCH 1/1] [LuaATC] Add get_fc() and set_fc() commands 16 days ago

From Y. Wang to ~gpcf/advtrains-devel

>> Would set_fc(fc_str, i, j) perhaps be useful? (I don't use FC myself)
> 
> I'm not sure what you mean here. A function to apply the FC to only the 
> i-th wagon in the trainparts instead? That could work. Not sure which 
> would be more useful in practice though...

I am thinking about making the behavior of set_fc depend on the first 
argument passed to it:

- If the first argument is a string, then the FC of the wagons from i to 
j are set to the string (if absent, i and j can be assumed to be the 
first and last indices, for consistency with Lua's library functions)
- If the first argument is a table, then the FC of the wagons are set 
like in your patch.

Re: [PATCH 1/1] [LuaATC] Add get_fc() and set_fc() commands 17 days ago

From Y. Wang to ~gpcf/advtrains-devel

> diff --git a/advtrains_luaautomation/atc_rail.lua b/advtrains_luaautomation/atc_rail.lua
> old mode 100644
> new mode 100755

I assume the mode change is an accident?

> index 5dde99c..aac11f0
> --- a/advtrains_luaautomation/atc_rail.lua
> +++ b/advtrains_luaautomation/atc_rail.lua
> @@ -91,6 +91,38 @@ function r.fire_event(pos, evtdata, appr_internal)
>   			if not train_id then return false end
>   			advtrains.train_step_fc(train)
>   		end,
> +		get_fc = function()

[PATCH] Report coordinates of wagons with unregistered prototypes 3 months ago

From Y. Wang to ~gpcf/advtrains-devel

Related issue: https://forum.minetest.net/viewtopic.php?p=414307#p414307

---
 advtrains/trainlogic.lua | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua
index a0fdaa1..288e224 100644
--- a/advtrains/trainlogic.lua
+++ b/advtrains/trainlogic.lua
@@ -1053,7 +1053,16 @@ function advtrains.update_trainpart_properties(train_id, invert_flipstate)
		if data then
			local wagon = advtrains.wagon_prototypes[data.type or data.entity_name]
			if not wagon then
[message trimmed]

Re: [PATCH] French update 4 months ago

From Y. Wang to ~gpcf/advtrains-devel

I have applied the patch. Thank you.

> +Perpendicular Diamond Crossing Track=Croisement  perpendiculaire
> +Diagonal Diamond Crossing Track=Croisement diagonal
> +90+Angle Diamond Crossing Track=Croisement perpendiculo-diagonal
> +Y-turnout=Embranchement en Y
> +3-way turnout=Embranchement triple

I would like to take this chance to point out a few things regarding
turnout/crossing items (this is _not_ specific to this patch, but mainly
for other people working on l10n who happen to come across this section
and find it confusing):

- The "90+angle diamond crossing track" is a type of crossing where one

Re: LZB Stopping trains at green signals after interlocking database wipes 6 months ago

From Y. Wang to ~gpcf/advtrains-discuss

> An image of the problem is linked below (ignore the
> terminology on the banners, the signal is green despite the train UI's delusions):
>
> https://i.imgur.com/Zk7r8qi.png

The signal on the image does not allow shunt operations.

Re: TCB : Break or Block ? 6 months ago

From Y. Wang to ~gpcf/advtrains-discuss

> Being currently writing an advtrains tutorial in french, I have a
> doubt about the actual meaning of the "TCB" acronym (and how to
> translate it).
>
> The most common full name I read in advtrains docs is "Track Circuit Break".

Yes, this is the device that marks the border of a track section.

Perhaps "track section border marker" would make more sense for l10n.

> But a search on internet for this acronym leads to, for example, :
>
> https://safety.networkrail.co.uk/jargon-buster/tcb/
>

Re: [Meta] Notabug.org mirror and bug tracker 6 months ago

From Y. Wang to ~gpcf/advtrains-discuss

> I have added gpcf, Montandalar and Maverick2797 to the Advtrains
> organization and to a team that has write access to the 3 mirror
> repositories. This should allow you to file, modify and label
> issues. I don't know the notabug accounts of others, especially ywang,
> so please kindly let me know so I can add you as well.

My username on Notabug is y5nw.

> As for the issue migration: please just migrate what you think is worth migrating.

I have mostly worked on certain features instead of fixing bugs, so I do
not think there is much (if anything) to migrate from Hempitera in terms
of things related to what I work on.

Re: Ghost train mitigation 7 months ago

From Y. Wang to ~gpcf/advtrains-discuss

> Ah, the savefiles were taken from my sever around a week before the data was
> lost.
>
> What has changed was (obviously) the positions of the trains on the server,
> meaning that there were trains on a different part of the map than where they
> were saved.
>
> Another thing that changed was a few junctions were added and bypassed aspects
> of the train network which were no good (like trains going underground to a
> junction to go back up again, which only existed because a now-derelict tunnel
> was at the same level, so i bypassed that with a viaduct and slope). I also
> interlocked an entire new tram system which was lost because of the
> interlocking data being lost.

Re: Ghost train mitigation 7 months ago

From Y. Wang to ~gpcf/advtrains-discuss

> After a serious interlocking data loss, a lot of routes on my
> server work absolutely fine, setup correctly, but are blocked by
> ghost trains.

- Are you using savefiles from the same backup?
- How much does the world differ from the data in the backup? (i.e. how
much have you changed since the backup was created?)

> I propose a simple fix: Whenever a train stops at a signal at
> danger, check if the occupied section is //really// occupied or
> it's just a ghost being annoying again.
>
> Also, the same check occurs whenever right-clicking a signal or
> a TCB.