Wasteland

created by Jeremy Skogen

 

 

Setting Up Wasteland

- This Section was taken from Brian Johnsons page with permission.

Configuring Your Machine

Install Microsoft Visual Studio 2005 Professional

  1. As a member of the University of Delaware community, you can obtain a free academic version of Microsoft Visual Studio 2005 Professional. To do this, go to www.cis.udel.edu and click the MSDNAA subscription link near the bottom of the page.
     
  2. You should be directed to the MSDN Academic Alliance Software Center page.  From here, click the Login button.  You can log in using your University of Delaware EECIS account (same account you use to login to porsche.cis.udel.edu).  Everyone in CISC-474 should already have an EECIS account.
     
  3. After successfully logging in, click the blue button at the top of the page that says Software.  You will want to download the following products: You can find them by using the Search dialog box, or you can select them from the drop-down list box that contains all the available software titles. Follow the instructions on the web site to complete the download.
     
  4. Once you have completed the download, you should have two .ISO files named "en_vs_2005_pro_cd1.iso" and "en_vs_2005_pro_cd1.iso".  The next step is to make 2 CD-R discs from these .ISO files.  If you're not sure how to do this, you can read these instructions.
     
  5. Next, insert CD1 into your CD-ROM drive and begin installing the software.  Follow the on-screen instructions to complete the installation.

Install Web Application Project Updates

  1. By default, Visual Studio 2005 does not support web application projects. To enable web application projects, download and install the Visual Studio 2005 Web Application Projects upgrade. See this Microsoft knowledge base article for more information.
     
  2. Next, download and install the Visual Studio 2005 Web Applications Project Model.

Opening Wasteland

Open the wasteland.zip file and extract the wasteland directory someplace. Start visual studio and select File, Open Web Site. Select the wasteland directory and continue.

After doing that, go to the view menu, and select "Solution Explorer".



Important Files

There are a few main pages that I will briefly explain.

- Default.aspx

This is the login page that the user will start at.  If they have a login and password it will forward them to the Main.aspx page.  If they dont they are given the option to create a new account.  They are taken to the account creater wizard provided by aspx.  Once the account is created the character is created at the CharGen.aspx page.

 

- CharGen.aspx

This page will walk the user through creating thier wasteland account.  They pick a name, sex, and class.  The classes currently provided are scientist, handyman, and soldier.  The submit button must be pressed to enter the information into the database.  Once submitted, continue will take them to the main page.

 

- Main.aspx

This is where the game is played.  On the top-middle the users statistics are displayed.  These statistics are loaded from the wasteland database.  On the left the users inventory is displayed, selecting an item will display that items information below.  The center of the screen is an ascii map with buttons that move the character up, down, left, and right.  The page is controlled by the underlying C# code in the Main.aspx.cs file.

 

- Main.aspx.cs

This is the C# code that controls the Main.aspx page.  The functions are run when events are triggered such as a form loading, an item in a list being selected, or a button pressed.  The labels and buttons can be used as objects in this code.  Objects are created in the aspx page in the following format;

<asp:Label ID="LabelUserName" runat="server" Text="Label"></asp:Label>

The ID is what is used as a variable name in the C#. 

 

For database access I used the following code.

SqlConnection thisConnection = new SqlConnection(

            @"Server=big-blue\sqlexpress;Integrated Security=True;" +

            "Database=wastelandDB");

 

        thisConnection.Open();

        SqlCommand thisCommand = thisConnection.CreateCommand();

 

        thisCommand.CommandText = "SELECT * FROM Char WHERE UserID = '" + User.Identity.Name + "'";

        SqlDataReader result = thisCommand.ExecuteReader();

 

This would only work for one command though.  Each aditional command had to do this process again. Important to note is that the Server==big-blue is my personal computers name. You will need to change this to your local machines name if you use the local database.

 

Database

The database is provided in the DB folder.  The WastelandDB contains all the tables and information for the program.  In order to get it to work you must add the database by right clicking on the wasteland project in the top right. Select add an existing file and open the wastelandDB.mdf file.

 

Future Additions

Since this was a large project there are many places that could be expanded.

- The interface is not customizeable and the user may want to change its appearance.

- There is a crude administrator page that could be expanded to allow remote monitering of users and activities.

- The account creation could be modified to include the character creation as well.

- The ability to open a session and make multiple querys would save much time if implemented.

- There is no way for multiple users to interact at this time, a feature allowing users to see who else is on would be valuable.