PHP web game learning-Explanation of Xnova (ogame) source code (1)

Source: Internet
Author: User
This article mainly introduces the source code explanation of PHP Web Game Xnova (ogame). For more information, see

This article mainly introduces the source code explanation of PHP Web Game Xnova (ogame). For more information, see

I. Introduction

Xnova (ogame) is one of the world's most popular war strategy web games, and is also the object of most similar web games. You only need Web browsers to download online games that can be played by clients.

What kind of game is Xnova?

You are a cross-Galaxy ruler and use different strategies to expand your strength. You will start your business on a planet of your own, where you use existing resources to build your economic and military foundations. Through scientific research, you can obtain the entrance to new and advantageous technologies and new weapon systems. As the game goes on, you will migrate to multiple planets, unite with other players, and engage in business or war with other players. No matter what you want to do, Xnova can help you do it!

Xnova is a game of the same type and subject matter as the popular web game OGame (Galaxy Empire. OGame is the object of webgame plagiarism among many Chinese Three Kingdoms (BTW, I hate the Three Kingdoms ).


Disclaimer: the source code I learned to use is an open-source project. It cannot be used for commercial purposes. Otherwise, the consequences will be borne by me!

The original copyright belongs to the Xnova development team!

The iron long version is modified based on Xnova v0.8e!

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

This site provides the ultimate version of this system!

Source code:

The learning process is based on the program execution order. before reading the source code, we first learned the basic PHP tutorial.

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

It is best to install the PHP debugging tool. I am using Zend studio 5 and Zend Debugger 5. It is not difficult to use it, and these can be found by Google. Finally, prepare a cup of hot tea to start work.

2. Entry (index. php)

This file is the entry to the game, with only a few lines of code. The function is clear at a glance: First Judge config. php file size is zero; If yes, it will be redirected to the install/directory for installation; otherwise, it will be redirected to login. php shows the login 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.