View Full Version: Handling Sms

DimensioneX Forum > Game Engine Development > Handling Sms



Title: Handling Sms


nogrip - February 10, 2006 10:35 AM (GMT)
Hey Cris and all!

Imagine a game where you have to login in every day to have the option to train your army/character whatever. But you go on vacations, and you have no way of doing it.

What I am thinking about is sending an SMS, in a basic known format, like NameOfGame User Pass TRAIN

I would like your opinion Cris, in how this can be made, or if it can be made. I was thinking in adding a small SMS receiver and parser, and then somehow be able to login the user and fire the event he asks. What do you think?

Cris - February 10, 2006 11:11 AM (GMT)
The idea to add an SMS-management module is good.

However SMS is another story, you basically need to build a program which:

- receives SMS
- parses it
- logs into DimensioneX as if it was you
- performs the commands specified by you.

Since DimensioneX communicates over the net with standard HTTP conversation it can be done and it is an interesting exercise.

The conversation with the client is fairly simple, also, the only problem you have is that output is HTML and it may be changed in future versions, so your program may need to be updated to understand what is the game engine reply to your actions.

It is even possible that - for a well defined set of operations - we can add simplified conversation schemes. For example, to retrieve the status of the game it is possible to define a custom view which is available even without logging in the game.

If you want to try, go on.

In the past I have myself tried entering Underoworld with my cellphone and it can be done. Right now I could see who is connected and what they are doing.

I think that this option would be even more interesting than interacting via SMS (of ocurse interaction with SMS is still an interesting exercise).

The problem is now that the output is tailored for PC browsers, and playing via a cell phone implies that the output should be simplified, requiring less bandwith. This would require to add code for reckognising browser type and selecting alternate views for output of the scene, properties, commands, etc.

Also this one would be an interesting path to take.

nogrip - February 10, 2006 11:59 AM (GMT)
I have a meeting on monday..well, they didnt asked for sms specifically, they want muti-channel interaction..wich can include both sms interaction or playing by cellphone..lets see what is decided..

for now i will test some code i downloaded simulating an sms server, and experiment a bit with it :)

Cris - August 23, 2006 03:24 PM (GMT)
dimx doesn't accept inputs from outside unless you are connected to a game.

The only exception to this is when you issue an admin command - you don't need to be logged on with that, in fact you will specify the command code (eg. reset) along with the admin password with a standard web form via http.

Now the good news is that recently I have added ability for dimx to accept from the admin console arbitrary commands, which can be even calls to existing events such as:

CODE
Call handleIncomingSms("parameter1","parameter2")


So what you asked for, can now be done.

nogrip - August 24, 2006 11:11 AM (GMT)
Hi Cris!

But by receiving an SMS is also possible to get the player ID in the database, log him/her in, and perform the sms action over him/her right? If so I don't see any real advantadge by using the admin console!

Can you explain your point better please?

Thank you

Paulo

Cris - August 24, 2006 02:22 PM (GMT)
problem is,
if the user exists, the logon sequence is made with 2 steps.

performing a login in just one communication step, I think this is not possible.
You would have to simulate the login step1, step2, call a custom command (this would be step3).

The solution I outlined is somehow risky (the admin pass is sent unencrypted through the web) but it's far more simple and clean to implement. It does this all with 1 step only and can be simulated with a basic HTML form.




nogrip - August 25, 2006 10:43 AM (GMT)
We modified the login now Cris, the initial menu now has login and password, so the login process is now made in one step. Also, we are going to encript the admin password, and have the key in a separate key server, with a secure connection. So I think, security won't be an issue anymore.

Not having to do with SMS's itself, but we also have a mysql database working, recording encripted attributes of the players.

So when we receive an SMS, our objective is to parse the SMS, login the player, and call an event written in the sms.dxw file, and save the new result in the database.

So basically we will do the following:
1 server with the dimx game itself + dimx engine
1 server with the database
1 server with the sms.dxw + dimx engine

The events in the sms.dxw will be simple enough with the objective of just manipulating attributes stored in the data base. We have a doubt however. By using

CODE
thisPlayer = world.addPlayer(user.getUserName(),myProfile,client,remoteAddr);


if thisPlayer is not null, means that the player is already loged in?
Also, if you see any problems in our aproach please tell us :) Thanks alot Cris!

Cris - September 8, 2006 02:58 PM (GMT)
Oh, this one confuses me a bit.

Here are my doubts right now:

1) What is sms.dxw for?

2) The question regarding

QUOTE
thisPlayer = world.addPlayer(user.getUserName(),myProfile,client,remoteAddr);


I don't get this, to me if thisPlayer <> null then everything should be okay, the player has been added. What else then?


I think your architecture is interesting, though. If you have a scheme or an article I would be happy to link to it or refer to it on the dimx site

nogrip - September 11, 2006 11:00 AM (GMT)
Hi Cris!

Actually, our sms idea is already working :)

In sms.dxw is where we code (in dmx language for simplicity and to avoid hard-coding directly on the engine) the events we want to fire when we receive a given sms.

With a given sms we extract the user from the database, we add him/her in the world (hence the question about world.addPlayer), and run the corresponding event in the sms.dxw file, modifying the database accordingly.

Imagine that we receive an SMS with the following text, from the phone number 1234

MONEY DarkSiege

We parse the sms, get the username by his unique phone number, and run the event money (in the sms.dxw) in the world "DarkSiege"

the event money would be something like this:
EVENT money
$AGENT.money = $AGENT.money + 100

We don't have a scheme n'or an article yet! But has the deadline for our work aproaches we count on doing so, and we can make an english version if you're interested :)




Hosted for free by InvisionFree