Facepunch / garrysmod-requests

Feature requests for Garry's Mod
84 stars 24 forks source link

Autorefresh for OS X and Linux #71

Open Bo98 opened 11 years ago

Bo98 commented 11 years ago

What was the reason on why not included before again? It would be very handy as it can be inconvenient having to constantly reload the map.

jh97uk commented 9 years ago

Any updates on this? It really sucks badly that there isnt any Lua refresh under Linux...

neico commented 9 years ago

Well on linux one could use iNotify for that, and on mac probably as well. There isn't really a technical reason why it wouldn't be possible...

jh97uk commented 9 years ago

Indeed. If no one is willing to fix this, it might be an idea to make a module for Gmod that uses iNotify to replace the missing Lua refresh. Itd be real nice to have it.

neico commented 9 years ago

To get this on track a bit:

Mac uses FSEvents(https://developer.apple.com/library/mac/documentation/Darwin/Reference/FSEvents_Ref/) Linux uses iNotify(https://lwn.net/Articles/604686/)

For Reference, windows uses FindFirstChangeNotification, FindNextChangeNotification, ReadDirectoryChanges(https://msdn.microsoft.com/en-us/library/aa365261%28VS.85%29.aspx?f=255&MSPPError=-2147217396)

With this it shouldn't be too hard anymore to make this possible soon, no?

PS: UE4 utilises those API's as mentioned above for it's hotreload feature, thought it might help if you know at least one "project" using them for a similar use case.

P4sca1 commented 9 years ago

This is requested since 2013? :o Could you please add this? Would be really great!

Djlavoy commented 9 years ago

Is there any #Hope that this will get fixed ?

ghost commented 9 years ago

Garry's to busy with Rust. And no one cares or has the time to fix it.

Djlavoy commented 9 years ago

‎Ya I see..

ghost commented 9 years ago

I wish it could be done. Since Linux is a lot cheaper then windows based servers, but honestly if it was possible it would have been done already.

Djlavoy commented 9 years ago

I guess I can just use INotify and trigger a script to do a map change, My problem is i use git to push my code to my dev server but still have to manually change the map to see my changes which blows i want to push and see my changes and I don't want to use Windows :)

It a cruel world

ghost commented 9 years ago

Yea, only thing I could recommend is to test it on your computer first. (If it's windows ;) and then apply it to your server. Works Good, only problem I find is that most of the time workshop Addons conflict with each other on single player.

Djlavoy commented 9 years ago

Ya, Seems like the only other way besides hacking up a inotify script to reload the map every push lol !

ghost commented 9 years ago

Actually there is one other way... But it would be very hard to implement. But has potential. A developer named, Acecool has been trying to find a workaround for awhile now but idk if he has thought If this.

gmod has this thing called lua_openscript and perhaps using inotify to trigger a gmod to run these commands on the server and then force the client to re-join is possible. This might seem counter intuitive, but it takes a lot less time to rejoin then to restart a map since it has to load all of the Addons and game mode files.

This is the only other way I would do it, and perhaps make it into a module.

Djlavoy commented 9 years ago

Isn't "lua_openscript" a client side only call tho ? and don't server side scripts get loaded into memory once after the map change/server restart ?

mcd1992 commented 9 years ago

This is an issue tracker, not a forum. Take your discussion elsewhere.

ghost commented 9 years ago

It's both, but it requires the command and the files to be hooked into some type of trigger and a "reload" on the client.

Djlavoy commented 9 years ago

ops sorry mcd1992 got carried away !

ghost commented 9 years ago

It's the biggest issue ever, I would assume people would want some type of way to resolve it. Sorry though

Bo98 commented 9 years ago

For anyone watching the issue:

It's now available on the Linux dev branch.

I don't know when OS X is coming but the code is ready for merging whenever. I will close this issue when that happens.

Djlavoy commented 9 years ago

OMG THANK YOU !!!!!

ghost commented 9 years ago

How does it work?

neico commented 9 years ago

How does what work?

The feature itself? How is one able to use the dev branch?

There's like a million things you could mean...

ghost commented 9 years ago

The lua autorefrsh?

mcd1992 commented 9 years ago

Garry's Mod uses Bootil, which has a library for detecting filesystem changes. So whenever a file/folder changes garrysmod re-sends the data to the clients. The issue that was preventing it from working on linux was the Bootil library was returning a full path to the changed files/folders instead of a relative path. Which is what Bootil does on windows.

https://github.com/garrynewman/bootil/pull/18

As for how to use it in gmod, you just edit the files while the server is running and it auto-sends the changes to connected clients.

Djlavoy commented 9 years ago

Just tested and it works ! cant wait for the merge !

ghost commented 9 years ago

So is it enabled by default? And has it merged yet?

Bo98 commented 9 years ago

It is working on Linux now but I have no idea when it is going to be merged on OS X. It's been a few months now.

Otoris commented 7 years ago

Any updates on this? I love coding on MacOS, this would be really useful.

rtm516 commented 6 years ago

Still cant get lua autorefresh to work on linux, has this been fixed or is it just me?