PHP Web Game Learning Xnova (ogame) Source code interpretation (i) _php instance

Source: Internet
Author: User
Tags php debugging tools php tutorial zend

First, the introduction

Xnova (Ogame) is one of the world's most popular war strategy web games, but also the most similar web games to emulate the object. You only need a Web browser, no need to download the client can do online games.

What kind of game is Xnova?

You are a cross Galaxy ruler, using different strategies to expand your strength. You will start your career on a planet of your own, where you build your economic and military base with existing resources. Through scientific research you gain access to new, advantageous technologies and new weapon systems. As the game progresses you will be migrating to multiple planets, with other players in the league, doing business with other players or waging war. No matter what you want to do, Xnova can make you do it!

Xnova is a very hot web game Ogame (Galactic Empire) of the same genre, the same theme of the game. Ogame is the subject of many of the three Chinese webgame plagiarism (BTW, I hate the Three Kingdoms).


statement: I learn to use the source code is open source projects, prohibited for commercial use, otherwise the consequences of conceit!

Original copyright belongs to Xnova development team!

Iron Captain version based on Xnova v0.8e modification!

This version has been discontinued and we do not provide any technical support!

This site to provide download is the system's improved version!

Site source Download Address: http://www.jb51.net/codes/180759.html

The process of our learning is in accordance with the sequence of program execution, before looking at the source code, first learned the basic PHP tutorial.

If you do not understand PHP, please first learn the PHP basic tutorial, or have the basis of C better!

It's best to install the PHP Debugging tools, and I'm using Zend studio 5,zend Debugger 5, which should be easy to use and can be found with Google's great God. Finally, a cup of hot tea will be ready to start.

Second, the entrance (index.php)

This file is the entrance to the game, only a few lines of code, function at a glance: first to determine whether the config.php file size is zero, if it is, redirect to the install/directory to perform the installation operation, otherwise redirect to the login.php display landing page. The source code is as follows:

if (filesize (' config.php ') = = 0) {
 header (' location:install/');
 Exit ();
}
Header (' location:login.php ');

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.