Title: ASP Shopping Cart
Description: This example demonstrates a crude fictitious shopping cart including an intranet(or administrative backend).
If you are having any trouble with this script please ask, I had to change a few things (like file names if you notice my site and email addresses for obvious reasons) and haven't had a chance to test it since I made the changes. If you cannot make a DSN I believe I have code to rememdy that, just ask as well as it is not my code (I'm not going to post something thats not mine). You can go to the contact page (:-P) with any questions or find the email address in this zip file (it occurs once, not too hard to find). Have fun and happy programming
How to set up Internet Information Service (IIS)
These instructions are written for Windows 2000 Professional.
There is an issue with the implementation of the web server shipped with Windows 2000 Professional and Windows XP Professional. This is not a problem with Windows 2000 Server or 2003 Server. The issue is that there is a limit on the number of connections the server accepts. This is set to 10 connections. A single user who loads the web site may in fact use up 2 or 3 connections at a time. With the default settings, these connections are persistent, which means that you reach the 10 connection limit very quickly.
There is a knowledge base article on Microsofts web site which sort of explains the problem. Search for article 262635 or goto http://support.microsoft.com/default.aspx?scid=kb;EN-US;262635
Make Sure you Can See Admin Tools menu
Most of the next instructions rely on you being able to get at the Administrative Tools menu. Again, this is hidden by default. Right click in the start menu, and choose Properties. Go to the Advanced tab, and tick the box Display Administrative Tools. Press OK.
Use Performance Monitor to see the problem
One way to view the connections is to use Performance Monitor (Start Menu: Programs: Administrative Tools) , and add (Press the + button) the Web Services counter of Current Connections. You also need to change the scale from 100 to 10 (so its easier to see). Itll look something like this when set up right
You can use this to keep track of this problem during busy periods or testing. You can see above the spike to three connections. This was made by a single web request to load a results screen. Note also that the connection values drop back to zero almost straight away? This is not the default behaviour. By default these are kept alive for a lot longer.
Introduction
Hi, my name is Carl Harvey, I am a French guy programming in English uh So for now, please apology my very bad English grammar and word syntax, which belong after all to a French thinking. J
In document I will show you how I will built a multiplayer Web based game developed with an Embedded Visual Basic Scripting Object more known as ASP which is the server application whos running vbscripts. I will also use a tiny line of code in Java as the use of a refresh function.
The Game
The game that I choose to develop is a game that I have developed since a while, to be more precise, in 1996 I have created a Visual Basic chess game that was and still playable over the internet or a local network area, and I decided to port this game in a vbscript environment, therefore I choose Active Server Page to do the job. As far my knowledge can handle it, I start the job :) .
The chess game on its own is a very easy game to play but can also be very complex when played deeply. To understand this tutorial you will need to know the following :
Programming knowledge
Chess rules and game play
Visual Basic scripting syntax
Active Server Page ( the basic of)
The game will only be playable between two human.
Feasibility
I will now try to demonstrate why this is a feasible application.
The ASP structure is very flexible and can easily be adapted to manage the game play of many kind of game such as board games, card games, letters games and more. The fact that these games do not require a large amount of image processing but mostly math functions, Visual Basic scripting is kind enough to support such application.
To play the game in multiplayer mode, the use of ADO Addictive Dildo Object J joke ActiveX Data Object is to be use. The ADO is the most efficient database manager on the internet and is very fast access based. A database is required to keep track of all active an non active games such as game actions and game players information.
I will not utilize a peer to peer constant connection since it require much more programming and object resources. The communication between clients will be centralized in the game database, each party will query the database on a regular basis e.g 10 second, and locate its game, actions and status, and will modify the database to update their actions.
Since I am planning to utilize high quality images for the board, it is not recommended even not appropriate to have the automatic database query on the main chess board page because the query will require an automatic page refresh and the game images will flicker and even disappear for the time of refreshing the page for each query. I then decided to split the main game page in two vertical part ( html framed page ), a little invisible frame at the top of the frameset, and the bigger frame for the chess board. The little invisible frame will be the timer page ( automatic refresh ) and will query the database for game changes. If there is game changes in the database, then the chessboard page will be reloaded in its frame and will display latest game state.
So the biggest issue was the refresh page, in order to use high quality image and have a constant visual GUID I will design the chess page as a framed html page.
Pages :
chessgame.asp
The index page is the main page and is a framed page with 2 rows and 1 column. The first frame at the top is not visible and is utilized to store the timer page, and the other frame is use to store the main game page (chessboard.asp).
timer.asp
The page that will automatically refresh its self by an HTML META tag in order to check for changes in the game database. If a change is detected then the other frame which store the main chess board page will be reloaded and then update the view to the latest game state.
chessboard.asp
This page is the chess game layout template and utilize some basic functions call and its content is mostly HTML. This is the page that will get all the game parameters.
chess.inc
This is the main functions page, its content is vbscripting. This page is utilized to store all the functions required to run the game play.
viewgames.asp
This page is a regular page which call a function to show all the active games
creategame.asp
This page is used to create chess games.
Coding
To code this game I will utilize my knowledge on the chess game. Since I already have developed a chess game in the past, I am more comfortable with the coding.
First I need to think array since I am not planning to use any class in our development. The logical thinking is also the core of the chess game, for example, I will utilize the same algorithm to validate moves between black and white since the move pattern is applicable for both colors, in other words, they are the same its just the color which change. The only thing we must take care of is the color of each pieces during the process of a move or selection. For any kind of board game, you need to draw graphs that will help you understand the logic within the game. To help me develop the chess game I have created a graph that represent each piece in its environment.
Figure 2
This graph tell you how each piece can move on the board, the X is the piece emplacement and the filled square are the possible moves. For the Queen, Rook and Bishop, I will create a shared algorithm since they are using the same. But for the other piece, I will hardcode the possible moves because they dont have many possibilities and there is no need to loose time figuring out a super dynamic function for those.
0 comments:
Post a Comment