DOC PREVIEW
Purdue ECE 462 - Multi-Player Game using Network

This preview shows page 1-2-3-4-5-38-39-40-41-42-43-76-77-78-79-80 out of 80 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 80 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 80 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 80 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 80 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 80 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 80 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 80 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 80 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 80 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 80 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 80 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 80 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 80 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 80 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 80 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 80 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 80 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Multi-Player Game using NetworkDemonstrationDesign Network GameGame ProtocolCommunication SequenceC++ Qt ImplementationClientServerImprovementsJava Remote Method InvocationRethink Function CallHow to Implement the Callee?Remote Method InvocationRMI ArchitectureCompute Engine ExampleDemonstrationSource CodeName MappingECE 462Object-Oriented Programmingjggusing C++ and JavaMulti-Player Game using NetworkYung-Hsiang Lul@ d [email protected] Multi-Player Game 1DemonstrationDemonstrationYHL Multi-Player Game 2YHL Multi-Player Game 3Design Network GameDesign Network Game• user interface• server lookup and connection• game protocol• data consistency• limit of numbers of clients• exit and error handlingYHL Multi-Player Game 4Game ProtocolGame Protocol• who can talk to whom? what to say? when?y• data types• data format• encryption• push or pull or both?YHL Multi-Player Game 5Communication SequenceCommunication SequenceYHL Multi-Player Game 6clientserverjoinjconnectedmaze sizemaze size w hmaze wallmaze wall **** ** ...lrequest playerYHL Multi-Player Game 7player ID location colorid x y r g bclientclientjoinclientserver.move player id x y..player position id x y r g bplayer position id x y r g bmove player id x yplayer position id x y r g bplayer position id x y r g bmove player id x ybyeremove player idYHL Multi-Player Game 8remove player idC++ Qt ImplementationC++ Qt ImplementationYHL Multi-Player Game 9ClientClientYHL Multi-Player Game 10YHL Multi-Player Game 11YHL Multi-Player Game 12YHL Multi-Player Game 13YHL Multi-Player Game 14YHL Multi-Player Game 15YHL Multi-Player Game 16YHL Multi-Player Game 17YHL Multi-Player Game 18YHL Multi-Player Game 19YHL Multi-Player Game 20YHL Multi-Player Game 21YHL Multi-Player Game 22YHL Multi-Player Game 23YHL Multi-Player Game 24YHL Multi-Player Game 25YHL Multi-Player Game 26YHL Multi-Player Game 27YHL Multi-Player Game 28YHL Multi-Player Game 29YHL Multi-Player Game 30YHL Multi-Player Game 31YHL Multi-Player Game 32YHL Multi-Player Game 33ServerServerYHL Multi-Player Game 34YHL Multi-Player Game 35YHL Multi-Player Game 36YHL Multi-Player Game 37YHL Multi-Player Game 38YHL Multi-Player Game 39YHL Multi-Player Game 40YHL Multi-Player Game 41YHL Multi-Player Game 42YHL Multi-Player Game 43YHL Multi-Player Game 44YHL Multi-Player Game 45YHL Multi-Player Game 46YHL Multi-Player Game 47YHL Multi-Player Game 48YHL Multi-Player Game 49YHL Multi-Player Game 50YHL Multi-Player Game 51ImprovementsImprovements•respond to keyboard and mousepy• place treasures and traps• detect collisions of player • assign different roles to the players• use images for players, add sound • load multiple layouts•handle multiple games allow players to register•handle multiple games, allow players to register• logging and debugging•prevent denial-of-service attacksYHL Multi-Player Game 52prevent denialofservice attacksECE 462Object-Oriented Programmingjggusing C++ and JavaJava Remote Method InvocationYung-Hsiang Lul@ d [email protected] Java RMI 1Rethink Function CallRethink Function CallCallerCalleeCaller...CalleeLongFloat computePi(int numDigits) pi = computePi(40);...gp(g){........}The caller does not care how computePi obtain the result.YHL Java RMI 2How to Implement the Callee?How to Implement the Callee?• compute PI LongFloat computePi(int numDigits) • use a lookup table• ask another machine to compute{connect to a serversend the request to the serverpsend the request to the serverwait for the responsereturn the result to the caller}}YHL Java RMI 3Remote Method InvocationRemote Method InvocationYHL Java RMI 4YHL Java RMI 5RMI ArchitectureRMI Architecture• client-server model• transmit objects to remote Java virtual machineRMI RegistryRMI Clientlook upRMI ServerRMI RegistryregistercallRMI ServerYHL Java RMI 6Compute Engine ExampleCompute Engine ExampleYHL Java RMI 7DemonstrationDemonstrationYHL Java RMI 8YHL Java RMI 9compile interface and create a jar fileYHL Java RMI 10build serverbuild serverYHL Java RMI 11build clientbuild clientYHL Java RMI 12start serverYHL Java RMI 13execute client and print resultYHL Java RMI 14YHL Java RMI 15Source CodeSource CodeYHL Java RMI 16Name MappingName MappingSun’s Tutorial This ExamplepackagecomputeRMIInterfacepackagecomputeRMIInterfacepackage client RMIClientpackageengineRMIServerpackageengineRMIServerinterface Compute EngineInterfaceit fTkTkItfinterfaceTaskTaskInterfaceclassComputeEngine implements ComputeServerEngine implements EngineInterfacepgclass ComputePi ClientMainclass Pi implements Task <BigDecimal>, ClientPIYHL Java RMI 17SerializableYHL Java RMI 18YHL Java RMI 19YHL Java RMI 20YHL Java RMI 21YHL Java RMI 22YHL Java RMI 23YHL Java RMI 24YHL Java RMI 25YHL Java RMI 26YHL Java RMI 27YHL Java RMI


View Full Document

Purdue ECE 462 - Multi-Player Game using Network

Download Multi-Player Game using Network
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Multi-Player Game using Network and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Multi-Player Game using Network 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?