Tag Archives: web development

More MyFirstChatroom Design

So, I’m continuing to work on the basic design of MyFirstChatroom. After discussing it with my brother, I’ve decided that the model_Chatroom class will model the entire database. So, it will have an array of 201 entries, and when that list fills up it will delete the last one and push the newest one in.

Database:
id
timestamp
chatentry

I’ll make the chatentry a TEXT type. That’ll give it a max size of 65,535, way more than enough for any chatting. I’ll have to make sure to limit the input to nothing beyond that, though.

Okay, the table has been placed on the database. If I need to change it, I can modify it later.

*work work work*

It occurs to me that a timestamp must be unique, since it’s accurate down to the clockspeed of the cpu and thus each call to the timestamp function is at a different time, so I can use it as the primary key of my db after all. That’ll save me the trouble of recycling 200 ids and simplify everything, so I’ll do that. *does that*

*work work*

For the most part I’m just copying the structure of most of my PHP programs. I’ve got a nice, commented block of code for accessing databases that I use. Not much to say about it. Making the model_Chatroom class work.

I’ve finished the Retrieve() function, which gets the list of chat entries from the database. Now I’m doing the Create() function, which creates a new entry, and deletes the oldest if there are already 200.

Alright I think that’s enough for now. The next thing I need to do is write the code that determines if there are over 200, and finds the oldest to delete it. I might have to figure out a different way of sorting the chat entries in order to rank them in age. Timestamp is probably different between MySQL and PHP.

Tagged , , , , , ,

Designing MyFirstChatroom

So to start with I’m making a chatroom. I’m calling the project MyFirstChatroom since it kind of is, and it’s simple.

There’ll be an AJAX/JQuery View, a PHP Script Controller and Model covering a MySQL Database. For this version of the chatroom I’ll be recording a log of the last, let’s say two hundred things said on the chatroom. When I convert it to a MUCK I’ll probably just fill the user’s view with whatever is posted in their vicinity instead, so that they can carry it with them room to room.

I’ve hit my first problem with the design. I’ll be keeping a database of previous paragraphs up to two hundred. But, as they pass that and are deleted, the id of the stored paragraphs will keep going up, eventually running out. So, I’ll have to set it up to recycle ids after it gets to two hundred.

Hmm… If I’m going to be saving chat lines, that’ll be seperate from the chatroom itself, and eventually the users. So, I’ll have to make a model for chat paragraphs as well.

The way I’m thinking about it now, I’m pretty sure I’m violating database rules. Maybe 1st Normal Form…

I talked about it with my brother some, and he thinks I should be good to just make the model an array of entries representing the one table. So I’ll give that a go.

Tagged , , , , , ,

WebMUCK

Well Ludum Dare didn’t go so well, I spent the whole weekend trying to get my tools to work. Hopefully I’ll be better prepared next time.

I’m starting a new project today, something I should be able to put proudly into my portfolio. I’m going to make a Web based MUCK. MUCK stands for Multi User Chat Kingdom. They’ve been around since the internet stone age and haven’t changed much since then. In form, they’re like a series of linked, themed chatrooms representing a virtual space. Unfortunately they’re so old that you have to connect to them with a dedicated client, and interact with people using arcane text commands.

I’ve decided to make a web based MUCK system. Linked chatrooms should be simple enough to do quickly and complex enough to show my skills, I hope.

To begin with, I’ll make a simple chatroom. Then I’ll add in the account system, and finally set up connections. I can build other MUCK features on top of that; they usually have programmable objects in MUCKs that say or do things when you interact with them. Though, I might just expose the client interface, so that people can make chatbots to do that with whatever they’re familiar with. But one step at a time.

My first chatroom will be done MVC Style. The Model and Controller will be PHP classes while the view will be done with JQuery and AJAX.

I’ll post more on here when I hit a stumbling block but for now I’m just setting up the basics.

Tagged , , , , , , ,

Lochiel Kiwanis Community Centre Website

In October and November of 2011 I created a website for the Lochiel Kiwanis Community Centre in Sarnia, Ontario, Canada. It’s my first attempt at making a professional quality website. Interstingly, I wasn’t brought on as a web developer but as a gardener. I had the skills and they had the need, so they put me to work building them a website.

The finished site is hosted at http://www.lkccsarnia.com/

Tagged , ,