Вы находитесь на странице: 1из 4

Chat Server Design and Impementation

On Future Kindergarten Project



Erik Pratama
Sekolah Teknik Elektro dan Informatika
Institut Teknologi Bandung
Bandung, Indonesia
rik_pratama@yahoo.co.id


AbstractFuture Kindergarten project is one way to make
learning more fun in kindergarten. Children can learn what they
want. Children learn through the medium of games that are
designed according to the syllabus in real kindergarten. This system
consists of several part: tracking and identification, game content
and story telling also web report. Chat server is used for data
exchange in these parts.
Chat server application developed differently for every client.
Each client has a particular specialization even every client have a
primary function to send and receive messages from the server. A
chat application running in console application or integrated in-
game by adapting the application console. Chat server is created
with the programming language C #. Chat server utilizing data
communications facilities TCP / IP via Net Socket. Chat server is
considered more effective as a medium of communication
compared to direct communication with the database.
Keywords : future kindergarten, chat server, data
communication, c#, digital learning media

I. INTRODUCTION
Future Kindergarten expected to restore the identity of TK
in its function as a most beautiful garden. Future kindergarten
media features exciting and fun for the kids. Learners can
interact with the features available in the future kindergarten.
By using gesture interaction, instructional media in the future
kindergarten students is not easy to make saturated in
performing activities
With an attractive media and fun learning experience,
children are expected to be more attracted to the media and
explanations rather than shifted his gaze to another thereby
reducing the burden on teachers to lead children to focus more.
Features of the future kindergarten made as attractive as
possible so that the children do not feel like learning
Future Kindergarten has a separate sub-systems. Content on
Future Kindergarten game consists of several separate themes
and games. Sub-systems that are not less important is the sub
system and story telling content tracking and identification of
sub-systems. The entire sub-system needs to communicate with
each other. Database system alone is not enough to handle the
data communication between sub-system. Chat server is the
perfect solution as a medium for data communication between
sub-systems.

II. DESIGNING CHAT SERVER
A. System Design for Future Kindergarten
Future Kindergarten systems consisting of sub-system
tracking, interactive content, web reports and chat server.
Tracking subsystem is a subsystem that serves to make the
process of students' identity and position. Tracking subsystem
reads input from a kinect image and depth data. Identity
recognition is used in the detection and evaluation of scoring if
there are students who do not go to class.

Fig1. Architecture Diagram for Future Kindergarten




Fig2. Architecture Diagram for Chat Server

With the recognition obtained the identity of the user
identity that is being played all over the classroom walls.
Subsystem content contains interactive content, photo users
who are interacting or playing games. After receiving input
identity recognition, scoring obtained in games will be input in
the evaluation of the results in the web report. Content may
include multiplayer games, illustrations when storytelling.

Sub-system chat serves as a means of communication
between different sub-systems in the future kindergarten
system. Chat server will receive position data and the identity
of the child tracking sub-system and send it to the other sub-
systems. Chat server also serves to transmit notifications and
game score results from sub interactive content to the database
server.

B. System Specification
Output tracking system is a .txt files which contains the
coordinates of each child. The identity of a child can be seen
from the location coordinates required by sub-systems that
require the child's identity. Sub-systems that require identity
was required to make a notification to make keadaan.txt file
containing machine status, 0 if it does not require identity and 1
if it requires identity, and the number of children who must be
identified. Sub identification system will respond by making
identifikasi.txt files in the folder that contains the machine
requesting the identity of the child in order according to the
number of children required.
Sub-system which requested the identity of the child is the
game content. Game will ask for the identity of the child to the
sub-system identification via chat server when there are players
who are ready to use the software. Game players will wait for
the response of the sub-system identity of identity through the
chat server. Sub identification system receives messages from
the sub-system of the game and create a file notice and wait for
a response in the form of the identity file is then read and sent
back to the requesting subsystem. Sub system game will also
send the results of the game every time the game level is
finished to be stored in the database. This database storage
requests will be responded by storing the data into database.
Applications are to be made need to meet the following
standards in order to deal with the problem in future
kindergarten
Chat application can be combined with object games on
game content.
Chat application can create a file. Txt.
Chat application can read a file. Txt
Chat application can save data into the database.
Chat application can read data from the database.
Chat application can be run on a LAN network.
This chat application server consists of a server application
that serves to broadcast a message to all clients and client
applications that functions to send data from the sub-systems
that require data on other sub-systems. Each chat client also has
a specific function when receiving messages according to the
needs of each sub-system.

Fig 3. Use Case Diagram

C. Designing
Chat server design includes four parts: the application
server, client chat app on game content, chat client application
on a sub system of tracking and chat client application on the
web server database. User Interface is developed is a console
because the system will instantly communicate. Display a
graphical user interface is not necessary because a bunch of
people not directly involved sib these systems when
performing data communications. Applications on game
content integrated to the game object the game content is
concerned. The programming language used is C #.
Chat applications created using Net functions. Socket for
communication on the LAN connection via TCP / IP.
Application server is set to work on a particular port and listens
for requests from the network connections. Application server
acts as a streaming server that listen to the whole client,
received a message from each client and is broadcasting a
message to all clients.
Streaming server for TCP / IP is made by first making a
TcpListener object to listen for connections on port selected.
TcpListener tcpListener = new TcpListener(65000);

Once the system is made TcpListener object to listen the
network
tcpListener.Start( );

Application server waiting for requests from client.

Socket socketForClient = tcpListener.AcceptSocket( );

Messages can be sent when the socket has been connected.
Messages can be sent by first making class NetworStream
make StreamWriter object. A message will automatically be
sent to all clients on the network when the message written on
the StreamWriter.

private void SendFileToClient(
Socket socketForClient )
{
// create a network stream and a stream writer
// on that network stream
NetworkStream networkStream =
new NetworkStream(socketForClient);
System.IO.StreamWriter streamWriter =
new System.IO.StreamWriter(networkStream);



Fig 4. Flow Chart for Chat Server

All clients have the same primary function, which receives
messages from the server and sends a message to the server.
Differences on each client lies perpetrated on the action after
receiving a message from the server. The entire client utilize
the functionality of TcpClient class. The connection to the
server when the client woke menginstansiasi TcpClient class to
determine the host server. Host is the server IP adrress of PCs
running server applications, can also be used localhost for
testing in a single PC.
TcpClient socketForServer;
socketForServer = new TcpClient("localHost", 65000);

TcpClient NetworkStream can be activated once instantiated.
StreamReader which will be used to read the message can be
made after the NetworkStream enabled.

NetworkStream networkStream =
socketForServer.GetStream( );
System.IO.StreamReader streamReader =
new System.IO.StreamReader(networkStream);


TcpClient NetworkStream can be activated once
instantiated. StreamReader which will be used to read the
message can be made after the NetworkStream enabled. Client
application to read the entire message from the server to.
Number equations consecutively. Equation numbers, within
do
{
outputString = streamReader.ReadLine( );

if( outputString != null )
{
Console.WriteLine(outputString);
//or do anything else
}
}
while( outputString != null );


Messages sent are standard ASCII text messages. Message
being sent will be processed by each client and treated in
accordance with the needs of each client. Messages sent are set
so that it can be used by any client. Arrangements are made so
that it can be used with the same message is:
Message consists of 5 words consisting of objectives,
types of transactions, followed by the message.
Messages that are less than 3 words must be followed
by a null amounted to 3 words.
Messages written in lower case.

Message settings aim to facilitate each client to perform
message filtering
III. IMPELEMENTATION
The Impelementation is consist of several part as descibe
A. Implementation on Server Aplication
In the chat application servers, Chat servers are
implemented in a console application. Applications built with
the C # programming language and the Visual Studio 2010
IDE. Ports used in chat server made static and can only be
changed by changing the script.
Application server consists of two classes. MainProgram
class consists of the main functions and functions of a
broadcast message. Class 2 functions which possess
HandleClient startClient and doChat.



Fig 5. Chat Server Aplication

B. Implementation on Client
Chat client integrated with the game on the game object in
Unity3D project. Script embedded chat client on its own object
game chat function handle or the GameObject player that will
send position data. Game object that has been integrated with
the chat client can interact with another object games as object
game in general. Game objects that have been inserted script
will act as a chat client. The game object can receive and send
messages when the game is run. This message will be accepted
by the server and sent to the entire client


Fig 6. Implementation on Game


Chat client on a sub system identification must have
additional functions to read and write txt file. Reference in this
chat client needs to be coupled with System.IO, write and read
txt file. The main function of reading and to send the same
message to the other sub-system implemented on
This application will also create a txt file if the PC has not been
contained by the file name in question. Application on the
identification of sub-systems executed a console application.
Chat client on a sub system database has additional
functions to connect the database and run the query. Chat client
can be run concurrently with the chat client identification. Each
client will filter messages based on the message sent and
treated differently. Script on the client sub-systems can also be
combined with a database script on a sub system identification
when using the same PC and database for identification.


C. Testing
Tests carried out in several stages. The first phase of sub-
systems partially tested on localhost. Each chat client running
in turns to see the response on the chat server. Every client is
given special identity distinct and send a different message.
Results will be visible in the server console. Server console
will display a sender's identity and the message sent client.
Message appears indicating that any client who has functioning
The second phase was similar to the first stage, but tested on
LAN network. Each chat client running on a separate PC with a
different IP Address. Connection can be seen from the message
that appears on the server console


test result on LAN

Full System tests conducted at TK Bunda Ganesha in two
classes The final stage of testing involves kindergarten student.
Tests carried out using 2 pieces display a simulation of 2
interactive wall.


Fig 7. System Testing at Kindergarten

REFERENCES
[1] Creighton R.H., Unity 3D Game Development by Example, Packt
Publishing, Birmingham , 2010.

[2] E.Solihatin dan Raharjo, Cooperative Learning, Bumi Aksara,
Bandung 2007

[3] Fatah Syukur, Teknologi Pendidikan, Rasail, Semarang, 2005.

[4] Goldstone W., Unity Game Development Essentials, Packt
Publishing, Birmingham , 2009.

[5] Kartini, Model Pembelajaran Atraktif di Taman Kanak-Kanak,
2007, http://tikkysuwantikno.wordpress.com/2007/12/27/model-
pembelajaran-atraktif-di-taman-kanak-kanak, 10 Mei 2013, 21.00
WIB.

[6] Kean S.,Hall J., and Perry P., Meet The Kinect : An Introduction to
Programming Natural User Interface, Technology In Action.

[7] Nana Sudjana dan Rivai, Media Pengajaran, Sinar Baru, Bandung,
2005

[8] Liberty J., Programming C#,OReilly, 2nd Edition, 2002

[9] ____, Cara Kerja Kinect, http://kangtanto.com/technology/cara-
kerja-kinect, 10 Mei 2013, 21.30 WIB.




Aplication IP Address Message
Chat Server 193.168.1.101 -
Sub Sistem Game 193.168.1.102 yes
Sub sistem Identifikasi 193.168.1.103 Yes
Sub Sistem Database 193.168.1.104 yes