Simple Chat with Adobe AIR using GameClientSDK Communication API


This is a very simple chat application developed using the GameClientSDK.
There are 2 important components here:


<Communication:ServerCommunication id="client" GuestLogin="true" ExpansionID="TestExpansion" ConnectNow="true" />
and
<Rooms:Room id="room" ServerComm="{client}" RoomID="AnyRoomName" onRPC="this.textChat.text += event.RpcParameters.FetchParameterValue('userName') + ': ' + event.RpcParameters.FetchParameterValue('chatMessage') + '\n'"/>
We only write one actionscript function to handle the enter event of the textinput. Here we send the text to people in the room.
protected function OnEnter():void
{
var params:ParameterCollection = new ParameterCollection();
params.AddParameter("chatMessage",this.textInput.text);
params.AddParameter("userName", this.client.LoggedInUser.UserName);

this.room.MakeRoomRPC("anyfunction", params);

this.textInput.text = "";
}
You can view the source codes here.
You can test the application here.

Card Game Toolkit



We designed generic card and chip components for people who would like to develop card games. Combined with the GameClientSDK you could easily design multiplayer card games like Texas Hold'em Poker. These components can be used with Adobe Flex to speed up game development.

You can right click and see the source code of the application.

You can download the Card Game Toolkit here.

Hello World



This is a very basic "Hello World" application. Click right button to see the source codes.


For the full screen version click here.
To download the source codes click here.

As you can see it is very easy to communicate to the server with just 2 components. (ServerCommunication and Room)
<Communication:ServerCommunication id="client" onConnected="OnConnected(event)"
ExpansionID="TestExpansion" />

<Rooms:Room id="room" ServerComm="{client}" onRoomJoined="OnJoinedRoom(event)"
onRoomLeft="OnLeftRoom(event)" onRPC="OnRPC(event)" RoomID="HelloWorldTestRoom" />
Below you see the code where we handle some events raised by the room component.

import Lib.Communication.ParameterCollection;
import Lib.Communication.Events.RPCEvent;
import Lib.Communication.Events.RoomEvent;
import Lib.Communication.Rooms.Room;
import Lib.Communication.Events.CommunicationEvent;
import Lib.Communication.Events.ServerEvent;

protected function ApplicationComplete():void
{
this.client.Connect();
}

// Server event handlers
protected function OnConnected(event:ServerEvent):void
{
this.client.LoginUser("guest", null, null, null, null);
}

// Room event handlers
protected function OnJoinedRoom(event:RoomEvent):void
{
this.textPublic.text = event.UserName + " has joined.\n" + this.textPublic.text;
}

protected function OnLeftRoom(event:RoomEvent):void
{
this.textPublic.text = event.UserName + " has left.\n" + this.textPublic.text;
}

protected function OnRPC(event:RPCEvent):void
{
this.textPublic.text = event.RpcParameters.FetchParameterValue("userName") + " said \"Hello World\".\n" + this.textPublic.text;
}

// Button event handler
protected function btnClick():void
{
var params:ParameterCollection = new ParameterCollection();
params.AddParameter("userName", this.client.LoggedInUser.UserName);
this.room.MakeRoomRPC("HelloWorld", params);
}


Note that proper namespaces should be included in the flex application tag.
Example:

xmlns:Communication="Lib.Communication.*"
xmlns:Rooms="Lib.Communication.Rooms.*"

These will be automatically added when you start writing code and don't copy and paste it.

Realtime Messenger with Adobe Air



Real-time messenger is a Windows AIR application. It supports the basic messenger functionality.

  • 1 - Lists online people

  • 2 - Opens a new window when double clicked on people

  • 3 - Chat windows show "writing a message" status message when other party is typing a message







You can check out the source codes online or you can download the project here.

Download the installation file

Warning: You need the Adobe AIR framework to run the installation file.


Example Penguins



This application is our very first example. You can right click and see the source code of the application.


For the full screen version click here.
To download the source codes click here.

About us

Hi everybody,

We are a group of developers who like to develop real-time applications using Flex/Flash. As you probably know there are many communication servers to accomplish this. However after a couple of years we decided to develop our own communication server and started building our own communication library. And also we thought to make the library open source so everybody around the world could contribute.

Our main purpose on this project is to develop a Client SDK which should be enough to develop real-time apps without writing single line of server side code.

What about the server side?

The server side is not open source yet. It is developped in C#/.Net. We add new stuff to it when the need arises. However there are some features included in the current version:


  • Each developer has a seperated domain in the server

    The server contains programming domains which can be used to seperate the developers. This way people can use the same server for a variaety of applications and they won't even know that other applications are running on the same server. We call this expansions. Everytime a programmer applies to us to develop a real-time application we create an Expansion for him/her. The developer can start communicating to the server with the unique key assigned to him/her.

  • You can use your own users in your own DB

    The server can connect to a third party web site to fetch necessary login information. For instance if you already have a web site and users signed to it, you may develop a chat application using your own DB. You only create a web service or web page like "http://www.yoursite.com/loginCallback.php". We associate this url with your expansion in the server. Everytime a user is trying to connect we request that url from you and get the username and other vital information about that user. (this will be explained further)

  • Room structure

    Every expansion (meaning every application) in the server has the capability of opening an infinite number of rooms. You can use these rooms for many different purposes. You can develop chat applications, game applications, white board applications, office communication applications. Anything is possible.

  • RPC functionality

    The server has a basic RPC concept built into it. This means users inside the rooms can send messages either to a single person or everybody in the room. The server just relays the messages to clients. This way it is possible for you to develop applications without writing server side code.

  • The server is scalable

    Every time a server is too busy to handle the traffic we can add another server next to it. We have a load balancing system to assign users to servers.

Contact us




Kaz Baygan: kazb [at] baygan [dot] com
Baran Baygan: baran [at] baygan [dot] com