Release the gamehall 2.0 a test version source code.

Source: Internet
Author: User

Code download: http://files.cnblogs.com/Jax/GameHall-2.0-a.rar (including dB)

Codeplex I applied for: http://www.codeplex.com/GameHall (it's too late to put the source code up)

 

This version only implements the hall and does not include any games. Users can enter multiple halls at the same time, but they can only sit down and play games at the tables in one hall.

Currently, it is still developed based on winform. It only uses the. NET 3.5 LINQ technology to process data, and uses a lot of syntactic sugar in C #3.0.

Generic events and functional programming are used to completely eliminate the dependency on delegate.

TCP socket communication is used to abstract the communication layer and prepare for changing the communication mode in later versions.

When the handshake mode is used, the client is active and the server is passive. That is to say, response is available only when there is a request. For all the 38 self-defined agreements, see the protocol.txt file.

Interface-oriented programming is implemented on the selection of tables (four-person tables and two-person tables), so as to flexibly add three-person tables and five-person tables in the future. This is just a small attempt. In the future, the game will adopt this mechanism.

Attackers can precisely control illegal exits.

This project has great scalability. First, communication extensions can easily replace TCP connections, UDP connections, and HTTP connections. Second, it is easy to load new games, that is, plug-in technology, without modifying Hall programs.

Do not blame me for rarely capturing exceptions. I have some difficulties, especially the server processing needs to take into account the performance, not to add too much.

Two applets are included. One is the implementation of NAT hole-hitting Technology (developed for users who will use local area networks in the future), and the other is the simple chat room of the WPF + WCF version (reconstructed on a source code of Jacob's old brother, is the next step to upgrade the WCF test program ).

I have performed multiple rounds of phased tests on all the code. However, we still need to ask you to pick problems for me (especially testers ). Mainly on the client side.

 

Some interfaces are as follows:

Server: Just a Cui Program

Client:

1) the logon is successful. The game list is obtained from the server and bound to the Treeview on the left. Because no advertisers were contacted, they had to take beautiful photos.

2) enter the "Chess" Hall (two-person table), and the user list and chat information are displayed on the left.

3) enter the "card category" Hall (4-person table)

4) zoom in:

 

In other words, I wrote this open-source project to show the world all the new technologies of. net, rather than focusing on practicality and complicated business logic. Therefore, I did not predict the logic complexity of changing the original "only one hall can be entered" to "multiple halls can be entered at the same time. For this reason, I made an overnight effort to modify the data structure on the first day of the new year. This is one of my regrets. "Do not make the logic very complicated" will be my next purpose. However, I still care about security and performance.

In practice, I encountered a lot of problems that I didn't encounter when I was doing research at ordinary times. To solve these problems, I will publish these experiences to my blog to help future generations.

 

The most important thing is the development in the next half month. WPF, WCF, WF, and Silverlight are not available yet! The integration of WCF and WF is the key. WPF is mainly used to demonstrate the Data Binding Technology (this technology is much better than winform ). Silverlight is used for user registration.

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.