Tutorial Reddwarf

Páginas: 56 (13955 palabras) Publicado: 24 de enero de 2013
Application Tutorial


Copyright © 2007, 2010, Oracle and/or its affiliates. All rights reserved.

Copyright © 2010, The RedDwarf Contributors. All rights reserved.

This material is distributed under the GNU General Public License Version 2. You may review the terms of the license at http://www.gnu.org/licenses/gpl-2.0.html.

To obtain a copy of the original source code for thisdocument, go to
https://sgs-server.dev.java.net/svn/sgs-server/trunk/sgs-tutorial-server-doc
and extract a copy of the file ServerAppTutorial.odt.


Introduction v

Coding Sun Game Server Applications 1
Goals and Philosophy 1
Approach to Execution 1
Tasks and Managers 1
Task Ordering 2
Task Lifetime 2
Managed Objects and Managed References 3
Accessing ManagedObjects through Managed References 3
Designing Your Managed Objects 4
The Player Managed Object 5
The AppListener 6
Locating the Server API Classes 9
System Classes and Interfaces 9
Task Manager Classes and Interfaces 10
Data Manager Classes and Interfaces 10
Channel Manager Classes and Interfaces 11

Lesson One: Hello World! 12
Coding HelloWorld12
HelloWorld 12
Running HelloWorld 13
Rerunning HelloWorld 14

Lesson Two: Hello Logger! 15
Coding HelloLogger 15
HelloLogger 15
The Logging Properties File 16

Lesson 3: Tasks, Managers, and Hello Timer! 17
Tasks 17
Managers 17
Coding HelloTimer 18
HelloTimer 18

Lesson 4: Hello Persistence! 21
Coding HelloPersistence 21HelloPersistence 21
Coding HelloPersistence2 23
HelloPersistence2 23
TrivialTimedTask 24
Coding HelloPersistence3 25
HelloPersistence3 26

Lesson 5: Hello User! 29
Knowing When a User Logs In 29
HelloUser 29
Direct Communication 30
HelloUser2 30
HelloUserSessionListener 31
HelloEchoSessionListener 32
Running the Examples 34

Lesson 6:Hello Channels! 35
Coding HelloChannels 35
HelloChannels 35
HelloChannelsSessionListener 37
HelloChannelsChannelListener 38
Running HelloChannels 39

Conclusion 41
Best Practices 41
Things Not Covered in This Tutorial 43

Appendix A: SwordWorld Example Code 45
Sword World 45
SwordWorldObject 47
SwordWorldRoom 49
SwordWorldPlayer 53Introduction

Welcome to the RedDwarf Server (RDS) application tutorial. This document is designed to teach you everything you need to know to start writing game servers that run on top of the RedDwarf Server. We call such programs RedDwarf applications, and you will see that term used in this and other RedDwarf documents.

The RedDwarf Server is the latest generation of cutting edge servertechnology following on from where the Sun Labs team reached with the Sun Game Server (SGS) and then Project Darkstar (PDS).

This tutorial begins with an overview of how to code an RedDwarf application, then steps through the development of a very simple application.

It does not attempt to address the design issues of how to design a good client/server architecture for an online game, sincethis is very game-specific and well beyond the scope of what can be covered here. There are many good books and articles on the subject already available.




Coding RedDwarf Server Applications

This chapter presents the fundamental concepts of how to code game server applications in the RedDwarf Server (RDS) environment. Understanding these concepts is the first step on the path to buildingmassively scalable, reliable, fault-tolerant, and persistent network games.

Goals and Philosophy

In order to understand the RedDwarf Server (RDS) coding model, it is useful to understand the system's goals. The fundamental goals are as follows:
● Make server-side game code reliable, scalable, persistent, and fault-tolerant in a manner that is transparent to the game developer.
●...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Tutoriales
  • tutorial
  • Tutorial
  • Tutorial
  • tutorial
  • tutorial
  • Tutorial
  • Tutorial

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS