Hot answers tagged php
4
There is one thing that bothered me about your question:
"..But the only programming language I know is Java."
So learn another one!
Anyway, Java as a client in the browser fails on many, many fronts.
For one, Java 7 (and most likely Java 8) doesn't even work in Chrome on Mac OS X because the Java people decided to stop supporting 32-bit, and Chrome ...
1
There are pros and cons of a long-running daemon vs cron.
"Cron" will run your job every 1 minute (maximum). This carries some overhead of starting a new process, loading data files etc.
However, starting a new process will avoid memory leaks (because when the old process exits, it releases any leaked resources).
So there is a performance / robustness ...
1
If you're smart with it, it won't be too resource intensive - but I definitely wouldn't try to run it every second (plus the shortest time interval for a cron is 1 minute). Because you mention actions occurring for a user when offline, a cron is probably your only option for that.
For online actions, I recommend not having that in a cron, that way you can ...
1
The cron-job way is definitely the easiest one and it's good enough for normal use cases.
If the changes the users makes affects the other users (for example, make a fire, which, if let unattended it would burn other player's houses in the meantime), then you can't use the first idea. Otherwise having some sort of "TODO" lists that get completed (finish the ...
Only top voted, non community-wiki answers of a minimum length are eligible