Libki / libki-server

Libki Server
Other
55 stars 28 forks source link

Take a ticket and queue up system? #71

Open admiralzeech opened 5 years ago

admiralzeech commented 5 years ago

Is your feature request related to a problem? Please describe. Hi, I would dearly love to use Libki in my library, partially because I am a coder and thus might be able to tweak some small things if necessary. Rather than waiting for years for a vendor to fix or add something.

Currently we have a room of short session internet PCs. We need customers to have anonymous access, they can have unlimited sessions in a day, but also to have some way of enforcing a queue, so someone can't just park on a seat and repeatedly login whilst other people are waiting.

Describe the solution you'd like Have a terminal where the patron can press a button and receive a ticket. The ticket will have a procedurally generated login name (ie. ticket number) and random password. (I can probably script this up if there's an API to access, or command line I can call.)

Have a digital signage (eg. displaying a webpage) that shows which PCs are available, and which ticket is the next in the queue. (possibly also displays the entire queue in order as well.) (Again, I could probably write this if the data is available.)

The ticket holder can then choose any of the PCs that are free, to login. No other tickets are able to login until they do.

When the patron logs off, the PC reboots and becomes available for the next person in the queue.

Describe alternatives you've considered I've used Netloan, Envisionware PCRes and Pharos so far. Nothing quite does what we want, although I've heard Pharos has a queuing system (minus the ticket generation part.)

Currently we're on Envisionware, which can generate a ticket with a set session time at a set PC. The problem is, if someone logs out early, it's not very clear that the next person can log in (and they might have wandered off to have a coffee until their appointed time) and in the meantime the PC is sitting idle making other patrons angry that they can't use it. Envisionware also isn't able to give people the choice of which PC to use, in this context.

Additional context How difficult would it be to adapt Libki to this scenario? Is there any interest in the current dev team to implement? My programming days are a decade or two behind me, but I knew C/C++ fairly well, I've dabbled in Lua, Python and a bit of Java. No experience with web stuff sadly. These days I do most of my coding in Autohotkey and windows batch files though. If it will sweeten the deal, I'd like to contribute where I can to make it happen. I don't think I would have time to really learn the existing code, though, which I why I mention the ticket dispenser and digital signage as things I can do, above.

kylemhall commented 5 years ago

I think you may be able to accomplish this. There is an API for generating guest logins. You can set the minutes each login has for the day. The only thing not possible is to enforce a specific order for tickets to log in with. If the honor system works well enough then Libki should work for you without any additional development. What do you think?

kylemhall commented 5 years ago

I should note, the guest accounts created are like 'guest1', 'guest2', and so own. It's quite obvious what order they were created in.

admiralzeech commented 5 years ago

Ah, our patrons have no honor. Not enforcing the queue would be rather dangerous. Is it hard to modify the server code to enforce a queue? Although I don't know perl...

Where is the logic for the server? I tried browsing the repository a bit but couldn't find anything that seemed like it. Is it because the server is stateless or something?

admiralzeech commented 5 years ago

Hi, I have been eagerly awaiting a reply (taking into account xmas holidays etc...)

Is this something we can explore in the next two-three months? If you're not interested / have no time / it's very difficult that's perfectly fine. Just please let me know, so I can un-eagerly myself and explore other options.

kylemhall commented 5 years ago

I'm afraid I don't have enough free time to development something this involved gratis. If you are interested in sponsoring a development just send me an email and I'll see what I can do!

admiralzeech commented 5 years ago

Yes, that's understandable. I was just asking to see if it's something simple or something within my own skills. As a final question, is it possible to tell me the file(s) in the server code where the logic of who can login or not is controlled? Just so I have starting point of looking around. Thanks for your replies.

kylemhall commented 5 years ago

Sure! Take a look here: https://github.com/Libki/libki-server/blob/master/lib/Libki/Controller/API/Client/v1_0.pm#L141

Right now most of the logic is in the Client API controller, but it may move in the future with refactoring for an improved client API.