Docsity

SkyNet Architectural Document: Understanding the Server and Client Functionality, Exams of Software Engineering

Toggle sidebar
bg1
Inside SkyNet
Architectural Documentation on SkyNet
Clement Pang
May 11, 2005
Overview
This document serves as a guide to the inner workings of SkyNet. Focus will be put
mainly on how the SkyNet Server works as well as how the SkyNet Client talks to the
server. Knowledge of ADO.NET, SQL and COM+ is recommended for people trying to
understand the SkyNet Server as these technologies are used heavily in the system.
Main tasks of the SkyNet Server
• Provides persistent storage of the state of the world in SQL Database
• Transparently convert the relational data in the SQL Database to OO objects for
both clients and behaviors and vice versa
• Handles transactions in the system to make atomic changes to the whole grid
Main tasks of the SkyNet Client
• Provides a view of the world to the client
• Handles the sending of events and messages to the View
• Provides an A.I. Architecture for automating repetitive tasks in the system
The Database
In SkyNet, the database is a MSDE (Microsoft Data Engine 2000 Release A) powered
relational database with transactions support through MTS. MSDE is a stripped-down
version of Microsoft SQL Server Enterprise Edition with the only difference being a
reduced concurrent connections limit. This limit is usually not seen in the system as
each server has its own database engine and queries are generally less than the
maximum it can handle concurrently.
The database contains the following tables
• Entities
This table houses all the GUIDs of the entities as well as their parent entity. By
transversing this tree, one can trace the parent of any entity (which has a
parent GUID of null)
• Attributes
This table houses all the attributes of the entities as well as supplemental data
for the client to advise the view on what to display to the user. Example of such
data include whether an attribute is displayed to the user and the actual more
user-friendly description if so.
• Sending Behaviors
pf3
pf4

Partial preview of the text

Download SkyNet Architectural Document: Understanding the Server and Client Functionality and more Exams Software Engineering in PDF only on Docsity!

Inside SkyNet

Architectural Documentation on SkyNet

Clement Pang May 11, 2005

Overview

This document serves as a guide to the inner workings of SkyNet. Focus will be put mainly on how the SkyNet Server works as well as how the SkyNet Client talks to the server. Knowledge of ADO.NET, SQL and COM+ is recommended for people trying to understand the SkyNet Server as these technologies are used heavily in the system.

Main tasks of the SkyNet Server

  • Provides persistent storage of the state of the world in SQL Database
  • Transparently convert the relational data in the SQL Database to OO objects for both clients and behaviors and vice versa
  • Handles transactions in the system to make atomic changes to the whole grid

Main tasks of the SkyNet Client

  • Provides a view of the world to the client
  • Handles the sending of events and messages to the View
  • Provides an A.I. Architecture for automating repetitive tasks in the system

The Database

In SkyNet, the database is a MSDE (Microsoft Data Engine 2000 Release A) powered relational database with transactions support through MTS. MSDE is a stripped-down version of Microsoft SQL Server Enterprise Edition with the only difference being a reduced concurrent connections limit. This limit is usually not seen in the system as each server has its own database engine and queries are generally less than the maximum it can handle concurrently.

The database contains the following tables

  • Entities This table houses all the GUIDs of the entities as well as their parent entity. By transversing this tree, one can trace the parent of any entity (which has a parent GUID of null)
  • Attributes This table houses all the attributes of the entities as well as supplemental data for the client to advise the view on what to display to the user. Example of such data include whether an attribute is displayed to the user and the actual more user-friendly description if so.
  • Sending Behaviors

Behaviors are the fundamental means of interaction in SkyNet. Every entity can have an arbitrary number of behaviors attached to it and this table records all the necessary information both for the server and the client to execute them. Information such as whether this behavior needs a GUID or whether this behavior takes in an entity target GUID is stored so that both servers and clients can validate and asks the user for his intentions respectively. Note that behaviors are compiled into the system and what is specified here is nothing but a fully qualified namespace and class name to the actual behavior which is instantiated on-the-fly using Reflection.

  • Reacting Behaviors Reacting behaviors are fired when Sending Behaviors are executed around an entity. By putting a reacting behavior on a unit, the unit will respond to all Sending Behaviors that occur around it. It is up to the behavior to filter out the exact behavior that it wants to subscribe to.
  • Areas Areas store the actual location of the entity as a collection of boundary points. Due to the fact that polygonal intersection is computationally intensive, an AreaCache table is also present to cache all the points that are inside the boundary to speed up calculation.
  • ViewData View Data stores all the necessary information for the client to pass on to the View. This includes Media Package information (a string identifying the media package) and z-ordering (how “high” is the entity off the ground to enable correct rendering of certain terrain elements)

The database can be converted to a XML file as well as to a .NET dataset. The dataset (SkyNetModel.xsd inside ServerAssembly) is used extensively to store the state of the world in memory during behavior execution and when changes are needed to propagate across servers.

The SkyNet Server

The SkyNet Server is nothing but a COM+ Component hosted by Windows (dllhost.exe) written using .NET Enterprise Services. It can be treated as a simple object that lives on the server which activates when clients request that behaviors are to be executed.

The requirement for activation and deactivation for a COM+ Component means that the SkyNet Server is unable to store any state information about the world. The only means of it keeping information about the world is through the SQL database backend. This is an important piece of information to keep in mind when developing server-side components in COM+.

The default security of COM+ disables networked transactions. Therefore, after installing both the SkyNet Server and the SkyNet Client, a computer will not be able to join an existing grid hosted on another computer or vice versa. Please refer to the SkyNet Server Grid Configuration document for information on how to properly

receive the changes that occurred during that version change, again using the XML Dataset representation of the model.

Due to .NET Datasets not supporting the idea of a one-way merge, the incoming dataset is merged using a custom method that merges changed entities into the local model of the client in a unidirectional manner. Deleted entities are also sent from the server to the client and would be deleted from the local copy accordingly.