StarCraft php proxy mode-PHP development

Source: Internet
Author: User
If Starcraft is a multiplayer mode, it will encounter a problem: how to reduce network latency and burden. To ensure data consistency, we should continuously transmit the changed data of each player to the host on which the map is opened for storage. Once any player's client reads the data, you must request data from the host. If Starcraft is a multiplayer mode, it will encounter a problem: how to reduce network latency and burden.


To ensure data consistency, we should continuously transmit the changed data of each player to the host on which the map is opened for storage. Once any player's client reads the data, you must request data from the host.


Although most of the data is interactive, even if a player's population is the same, if an enemy's troops have killed a player's troops, the number of his population is immediately affected.


However, the crystal mines and gas mines are different. Apart from the players' own construction operations and farmer collection, other players cannot influence this data.


Therefore, we want to put a data storage on the client. When a player changes or reads his/her resources, it first operates the local data and then notifies the host.


Proxy mode example:


For convenience, assuming that the client has obtained the php code on the host through remote inclusion or other methods, its code is as follows:

 

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.