Chat about online mobile games (1)

Source: Internet
Author: User

(1) HTTP-based mobile online games
Because all MIDP specifications stipulate that HTTP must be supported. According to industry insiders, China Telecom will only support HTTP in the future, therefore, many mobile online games are built on HTTP. But because of the integrity of HTTP protocol encapsulation, it brings benefits and disadvantages.

First, let's look at the advantages of http:
1: The servelt container will automatically manage the thread pool. In our program, you do not have to manage the thread on your own. Of course, the thread I am talking about is a thread generated by the client to connect to the server.
2: HTTP is secure. Session is used to manage each session, saving the headache of client impersonating.
3: almost all mobile phones supporting Java support the HTTP protocol.
Of course, there are other advantages. I can't come here one by one. Let's try it myself ......

The second is the disadvantages of the HTTP protocol:
1: the connectivity of the HTTP protocol is a headache for everyone. Someone once mentioned how to modify the HTTP protocol. I don't know if it succeeded? Of course, this is beyond the scope of our discussion.
2: It is the problem of network traffic, which is also a headache for everyone. If it is not a monthly subscription, this is indeed a large expense for users.

Next I will explain the architecture of the client and server of the famous mobile online game "fruite-Machine:

Phone --------------- → servlet ------------------ → Web Browser

The figure above shows the overall architecture of the "fruit machine.
"Fruit machine" was once popular in various video game halls and appeared as a gambling machine. This game is easy to design, but it is quite playable. It is a classic game comparable to "Tetris.

The Web browser layer behind the architecture is used to manage users' web interfaces and operate databases to manage users.

Because Users enter "username" and password "on their mobile phones during login, security is a big problem.
In the design document in fruite-machine, this problem is solved:
1. Use end-to-end encrypted connections to replace HTTP
2: Send username and password to servlet through a secure wireless gateway over HTTP.
3: Send the username and password in the same firewall as the servlet.

To solve the problem of user spoofing, a user may download the MIDlet client and modify the source code, which may send fake packets to the servlet end, in the fruit machine, some data that may be modified by the user is generated on the servlet end and then transmitted to the MIDlet, so that the user cannot modify the data. For example, the MIDlet does not generate a result that rotates immediately, but is generated by the server.

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.