Transcript
- 1. Proving correctness of a multiplayer game server Nirmalya Sengupta Freelance Software Technologist Nirmalya Sengupta
- 2. Background
-
- Dutch company, decided to enter Online Poker market
-
- Indian start-up given the job of development, deployment and support
-
- Scope: an entire betting game environment
-
- First version to be deployed in 12 months time
-
- 3. Application: a birds eye view Nirmalya Sengupta Player Portal Game Server Lobby Server Tournament Server Database RabbitMQ
- 4. Servers must be ...
-
- Robust
-
- Network ready
-
- Support for Statefulness
-
- Easy to interface with external systems
-
- Highly threaded
- RedDwarf (previously Darkstar)
-
- 5. Important aspects of Server
-
- Reactive to Events : Events give rise to other Events
-
- Actions on Events are taken by Tasks (piece of code)
-
- Tasks are scheduled (asynchronous), not executed immediately
-
- 6. Important aspects of Functionality
-
- Randomness : legal requirement
-
- Arbitrarily fired Timer s: necessity
-
- Network connection with player can drop anytime: game must continue
-
- Multiple simultaneous tables & tournaments
-
- Game History must be retained : legal requirement
-
- 7. Important aspects of Design
-
- Home-grown binary protocol between client and server
-
- Application waits for and reacts to Event s only
-
- Accurate detection of network connections availability
-
- Tasks handle Event s ( asynchronously )
-
- Database plays an adjunct role (post-facto)
-
- 8. Picture: player joins while game is continuing Nirmalya Sengupta
- 9. Picture: Player plays on two tables, leaves one Nirmalya Sengupta Real World (Player using client software) Virtual World (Player represented in server software) Network connection
- 10. How to test a software which..
-
- is distributed
-
- is completely asynchronous
-
- is asking testers to be good Poker players
-
- is affected by Timers (arbitrariness)
-
- Must withstand tens of thousands of simultaneous Players
-
- is expected to display minimum latency always
-
- 11. Steps taken to increase testability
-
- Gamerules and Business rules contained in a FSM
-
- Robot s written which could play Poker
-
- Binary protocol carried Roundtrip time data
-
- Facility to fire pre-configured Timers
-
- Specialized Sniffer tasks deployed
-
- Handcrafted cards were dealt to players
-
- Deployed Event pattern detection ( Esper )
-
- 12. Our observations
-
- Designer must consider phases of QA , Deployment and Support while designing structure and feature
-
- Asynchronous, Event-driven software offer different challenges and benefits
-
- QA team of programmers: considerable benefits
-
- Automation: functionality and performance
-
- 13. Questions? Nirmalya Sengupta