#6 Chat, improved communication

The last two weeks passed very quickly, but the project has moved with big steps to the end.

On these weeks, Alex merged the code on the main project and put it online to the wouso-next, where the real users could test my creation. On the start there were a couple of bugs on the contact-box, but they were solved.

Because of the long name of some users, we decided to create nick names for chat users. In the start I had make by default the user name to be his nick name, but this wasn’t enough, so I created a page where every user has the possibility to change their nick name and first name. For the moment there are just those two fields, but there is place for more.

Another thing made recently, is that I implemented some permissions which will change a chat-user to a super-chat-user. This means that, the user will have access to some new commands. For the moment three commands are available: /kick user, /ban user, /unban user. All of those commands have to be written on the global chat, and have the purpose to kick a user from the chat page for a period of time.

At this moment, I started to watch what has be finished and what I can change for a better use.

#5 Chat, improved communication

Lots of new features have appeared in last few weeks.

I’ve finished testing my implementation, and right now both types of testing are working (qunit tests for jQuery and ajax stuff and django tests for my view methods). About qunit testing implementation I can say that, after some research, I discovered a git repository about django and qunit[1]. This repository helped me to implement a tester application on the server in order to test my work.

In the last post I mentioned that I’ve made a way for my private-chat-boxes to appear on every page. But there was a little problem because those boxes were set to appear only in the moment when someone was writing to the user or when the user was starting a new communication. The problem was that when the user wanted to change the page all these boxes disappeared. The solution was the html5 and the storage session. I saved on sessionStorage the required variables and on page load I repopulated those boxes.

A new feature contains some spells for the chat. To be more precise there are three of them:

  • A spell that will stop you from accessing the chat page, which means that you will not be able to communicate on global chat, but you will be able to communicate with other players in private.
  • A spell that will stop you to communicate, in private and on global-chat.
  • A spell that will shuffle your words and their content.

After some observation from my mentor Alex about the mess from contact-box code, I cleaned that code and for the moment everything looks pretty well.

#4 Chat, improved communication

Hello, I know that it has passed more than you might have expected from the last post, but I wanted to work on more things during this period and now I can say more about my activity.

First of all I will begin with the contact-box implementation and its purpose. I thought that it is a better and faster way to access different option of the game from everywhere. So I started to implement a box that will be showed in different places, when the user tries to access some other player’s information. For example, instead of pushing a button that will take you to the user profile, you can stay for 1,5 seconds on a player, and afterwards its contact-box will appear.

For the moment, the contact-box contains: name, points, level and the avatar of the user that interests you,and three buttons that will take you to his profile or give you the possibility either to write him a message or to create a private chat with him.[1] The improvements are always welcome.

For the last button, the private-chat one, I had to improve some of the code, because my private-chat didn’t appear on every page. So I had to change it, and now you can communicate with other users from every page of the game.[2]

In the meantime, I discussed with my mentor Alex, and we decided that I must make some unittest for my present code. I’ve started with django code, with a little research and I’ve made some tests for the code. 

I tested the way that a message is reached at the server, to see if a message is duplicated or modified.  

Then I tested if the chat rooms are created well and if the right users are receiving theirs messages, meaning that a third person won’t receive that message.

After django tests I realized that some unittests for javascript are welcome as well. I’ve made some research on this domain, but I managed only to create a request message, with no response. I hope that soon I will manage to make those tests.

#3 Chat, improved communication

In the last week I have started to prepare for the mid term, just like I said in the application schedule. I have spoken with my mentor, and we have decided that my code should be refactoring.

I began with removing the reuses functions and then to create new functions for the duplicated code. I removed the show and hide buttons from global chat and I decided to put the chat in the page.

It was easy work and now everything looks pretty nice [1]. Meanwhile, I resolved all bugs and finished all features that I mention in the preview post.

The testing process continues to be local, but I have started to follow some tutorials in order to make a unit test.

I’m still in the schedule, and right now I am creating the contact box. I will come up with a new post at the end of this week and I will talk more in detail about it

#2 Chat, improved communication

I want to begin by saying that, since my last post, my project has moved in a
good direction.

So, in the last two weeks, I started to make a private chat for two users, and it’s
almost finished. It is not perfect, but I’m hoping that soon all bugs will be fixed
and everyone will be able to use it.

I started by looking for a good design for the private chat box, and I choose
a simple chat[1]. I should also mention that I was inspired by the Gmail and
Facebook chats.

Then, my second objective was to find a way, to create a name for the box,
were users will talk in private. It was essential because, through the name, users
will know if a message is for them or not. The name had to be unique and by
unique I mean that if ‘player x’ creates a chat with ‘player y’, that name must be
the same with case when ‘player y’ creates a chat with ‘player x’ and throws that
name a ‘player z’ will not receive their messages.

Then, I tested this step by creating a static box. After creating the name
functionality and sending my fist message, my server is creating a unique chat-
room with that name and the conversation can begin. This was easier than
expected to implement.[2]

After I saw that everything works well with a single box, I’ve copy the code for
that box, two more times and make it work for the case when I am receiving
messages from more players. Then a new problem appeared: the code started to
be messy, so I decided to generate boxes only when I need them. [3]

At this point features that are close of finishing, but still present some little bugs such as:

  • - shifting boxes on the right with one position, for all private box from the left of a box that is progress of closing.[4]
  • - make a button for “show log”, which has the purpose of giving old conversation of those users. [5]
  • - make blinking the header of chat-box, when user is receiving new messages [6].

All testing process was done by using two types of browsers and login with
different users, but I am hoping that in the shortest time will be up on the main server and prepared to be used and testing online.

#1 Chat, improved communication

Hello, my name is Iulian Stana and I am working on World of USO project, an education game [1]. My goal is to bring a better way of communication between players. This thing will be done, by creating some different types of chats: a global chat, a private chat and a multi user chat.

In my first 2 weeks of Rosedu summer of code, I have implemented the global chat.  It wasn’t an easy thing to do, but not the hardest one either.

I had started by forking the WoUSO repository [2] and installing it on my local station. For about 3 days I have looked on the existing code, and put on a paper what I have to done to make it work.

In the first state it was a simple Text Area, a Text Field and a button [3]. My first mission was to give a better look to the chat, by creating a list of online users and to order elements in a table. Then I have started to watch for a way of getting the online players and to put them on the field. Here I encountered my first problem: how to update the list when users log in. With a little help from Alex Eftimie, one of my mentors, I managed to solve this issue as well.

The next thing that I had to do was to get last 10 messages from the Chat history, and to put them on the Text Area when a user comes on the chat for the first time. Meanwhile I had created some emoticons for an easier interaction. [4]

For the final state I have resized the chat window to the entire page, and added some buttons, with the help of which the user can access from global chat some useful attributes of the game, like profile or write a message to a selected player.[5]

The technologies used until now are Python with Django, html, css and javascript. For the first 2 I used api and django tutorials[6] and for the last 3 of them used w3schools Tutorials[7].

 

#1 WoUSO – Facebook integration

Well, my name is Andrei Erghelegiu and this summer I would like to integrate WoUSO[1] with Facebook. The main idea of my project is to make a Facebook application from which you will see your WoUSO status and notifications. I would also want to implement some Achievements in the Facebook application, but for this I must talk to Alex Eftimie.

My first two weeks weren’t so productive because I’m new in Python, Django and Facebook API. It’s my first time when I’m working on an open-source project and the start is a little harder. I wrote some programs in Python to accommodate with it, and now I’m learning Django from their tutorial.

I’m trying to learn and then to start working effectively on the project, because I think that you must have some knowledge before you practice.

See you next time!

[1]https://projects.rosedu.org/projects/wouso

#1 – WoUSO Facebook Integration

Hello,

I`m Matei Oprea and i`ll integrate WoUSO with Facebook. We know that WoUSO is currently developed under Django [1]. I`ve been using Python only for a few exercices at a programming contest started by my mate Mihai Maruseac and i know that this is gonna be new to me and i hope i`ll handle it. My mentors will be Alex Eftimie and Mihnea-Dobrescu Balaur.

The main idea for my project is the following :

If the user has connected his WoUSO account with Facebook, then he`ll be able to share with his Facebook friends his stats from the game, the fact that he checked the correct answer at QoTD ( Question of The Day ) , his Challenge performance and his progress level on a Special Quest.

Well, i started with creating the app on Facebook ( named WoUSO ) and since i`m gonna be testing it localy, on my computer ( for the moment ) my input for Site URL was http://localhost:8000/fb ( fb is the folder where i want to store the application ).

Right now, i`m trying to make a simple django application to post from on facebook. I started with storing the FB_APP_ID and FB_APP_SECRET_KEY in settings.py. Including them in views.py I try to obtain a HttpResponse using render_to_response [2].

Bassicaly i know that this is not a very good practice ( storing FB_APP_ID and FB_APP_SECRET_KEY in each views.py ) and i`ll focus on implementing it better while working on it.

 

[1]-https://www.djangoproject.com/

[2] - https://docs.djangoproject.com/en/1.2/topics/http/shortcuts/