Cambridge Pub Poker - rebuild
A total rewrite of the Tournament Manager
I’ve not used the Cambridge Pub Poker system for a couple of years - since the start of lockdown really - but it’s seems worth resurecting
More app-like than my usual projects
Lots of Local Storage and JavaScript
I first set-up Cambridge Pub Poker years ago, probably in 2011 going buy the date the domain was registered. My local at the time was The White Horse in Oakington. Pub Poker was a new thing, partly due to the changes in the law that allowed small stakes poker in licensed premises for the first time, and partly due to the rise in popularity of Texas Hold’em online.
Barry, the landlord, had one of the pub poker outfits in for a trial - I can’t remember the name. There was a good turnout and a lot of interest, but Barry and Greene King had an issue and the pub closed for some weeks. Half a dozen or so of those who had taken to the game started a weekly tournament in the Black Bull in the neighbouring village. It was an instant regular thing.
Naturally, yours truly was quickly into setting up a league, checking the legals and so on. The processes involved with managing a simple, small poker tournament offered a clear structure and set of rules that could be used to create an online poker tournament management system. The first most helpful function offered by an online system was recording who played, what position they finished in, the points won, and other info which made it easy to produce a full league table.
Adding a blinds timer was not essential, but if you have a system for recording players details, and need to log the position they finish, and so on, then why not? Bad broadband - that’s potentially why not. Everything required to fulfil the brief was standard fayre for me. Easy Peasy. Except my commercial projects were mainly designed to work online, and the couple of pubs where the system was being used had unreliable or non existent connections.
I like a challenge
Having the system I was proud of fail on a big screen in front of an audience spurned me on to develop something that could cope with being offline. Client side ‘local storage’ was a thing, but a relatively new thing. The W3C specifications were still in flux and various client side data storage options were being bandied about. It worked for me though, and other Mac users.
Designing and developing a system to work mainly client-side is quite different from the client request / server response model. Any PHP or similar server side functions I’d usually use needed a JavaScript equivalent.
I’ll resist digging deeper into the technicals and skip to the end of the story. I developed a system that ran in a browser, completely offline, save for an initial, optional refresh of some data, and the ‘Save Result To Server’ function which does what it says. And the really clever bit is that it could stop time - a blind could be paused and restarted multiple times and survive the closing and reopening of the browser.