That’s fine. But…what is it, exactly? This, my friends, is the culmination of several hours of trial and error, of attempting different technologies in a bid to create what you see before you: An automated message posted to a chat window.
This is what I was going on about in the previous post about Golden Layout and SignalR. Although what you see here looks like a typical chat layout, behind the scenes it’s a bit chaotic, and I have to go through and clean things up a bit.
From Many to One
The single hub means that all cross-hub communication that I would have had to have done is no longer necessary because everything is in one file. The problem with this is that with just one hub, the entire application is going to be calling in, and that’s going to result in a lot of shippers and handlers defined in this one file.
Basement Level Processing
To combat potential bloat, I’m going to re-silo on the back end of the SR hub. Whereas before I was going to have one hub per silo, I will now have one business logic silo per major activity. For example, if chat needs to have any kind of business logic applied (say, if we need to determine if you are a special-case account and need a different color to your text), the data will first be passed to main hub, then to the chat logic silo, handled, and returned to the main hub to be sent back to the client. Chat’s kind of a bad example since it’s not complex, but there will be other processes which will need some heavy lifting.
It’s All About The Data, Marty
Way down deep, then, we’ll have the data access layer. This will only be accessible through these individual business logic silos.
I am using Entity Framework for right now because it’s easy to set up without having to touch the database, but I know it has some pretty severe quirks that can frustrate those who don’t work with it regularly (read: me). Rather than create databases everywhere, I set up a SQL Server(less) instance on Azure. I have character and room tables defined with the bare-bones fields that I need and have seeded them with some initial testing data.
What’s All This Mumbo Jumbo, Then?
The screenshot is really the result of bringing this all together.
- OnConnect (ideally, but there are issues here), the app is pulling the “Scopique” character from the database. Later, this will actually happen well before we load the GL display, so we’ll have the character data on file, or will have enough identifiers to be able to pull it up from the data-basement.
And this is all it does. Technically, I can send messages using the text box, and other members (browsers) who are similarly logged into the “lobby” room will see them, but I don’t yet have a way to select which “character” you’re logged in as.