1 / 63

The Server Group

Johnny Loi Dimitri Syrow Him Seng Wong Greg Miles Adam Marczyk Kyle Lippincott Matt Dietz Shengsheng Liu. The Server Group. CS 495 Prof. Steflik Spring 2004. Protocol Handling. Johnny Loi CS 495 Senior Seminar Prof. Steflik. Available Protocols. TCP (Transmission Control Protocol)

hester
Download Presentation

The Server Group

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Johnny Loi Dimitri Syrow Him Seng Wong Greg Miles Adam Marczyk Kyle Lippincott Matt Dietz Shengsheng Liu The Server Group CS 495 Prof. Steflik Spring 2004

  2. Protocol Handling Johnny Loi CS 495 Senior Seminar Prof. Steflik

  3. Available Protocols • TCP (Transmission Control Protocol) • Reliable (Acknowledgements) • Virtual Circuit Connection • Full duplex connection • Data flow in stream of bytes • UDP (User Datagram Protocol) • Unreliable • Connectionless delivery • No ordering of incoming messages • No feedback to control information flow

  4. Protocol Chosen • TCP • Advantage • Reliability • TCP packets accepted almost everywhere • Full duplex communication • Persistent • Disadvantage • More overhead (higher bandwidth)

  5. Watson Game Protocol • Handshake • Initial connection: “OK” if successful • Login • “OK” if user name and password are correct • “WRGPWD” if password is incorrect • “NOUSR” if no such user exists

  6. End of arguments list Number to identify the command Command List of arguments for the command Watson Game Protocol • Data stream format CMD;CMD_ID;PARAM1=ARG1;…;PARAMk=ARGk\n • ; used as the delimiter • Both client/server talk in same format

  7. Watson Game Protocol • Common Commands • LOGIN cmd_id usr pwd • Ex. LOGIN;1;usr=bob;pwd=abc123\n • LOGOUT cmd_id • Ex. LOGOUT;2\n • CREATE cmd_id attr1 attr2 … attrk • Ex. CREATE;12;height=tall;group=student;year=sophomore\n • MOVE cmd_id x y z • Ex. MOVE;15;x=2;y=0;z=5\n

  8. Watson Game Protocol • Common Commands • GETCRS cmd_id course1 … coursek • Ex. GETCRS;14;crs=CS495\n • GETSCR cmd_id [score] • Ex. GETSCR;9;scr=5000\n //server sending back score • UPDTSCR cmd_id score • Ex. UPDTSCR;20;scr=1000\n //client sends to server

  9. Watson Game Protocol • Common Commands • GETSCHD cmd_id [semester] • GETSCHD;2;sem=spring04\n • SETSCHD cmd_id semester course1 … coursek • SETSCHD;5;sem=fall04;crs=CS210;crs=PE101\n • GETSACK cmd_id [item1 … itemk] • GETSACK;6\n

  10. Watson Game Protocol • Common Commands • UPDTSACK cmd_id item1 … itemk • UPDTSACK;7;item=books;item=money;item=id_card\n • GETSTAT cmd_id stat1 stat2 … statk • Ex. GETSTAT;19;bank=$200;gpa=3.5;health=75%\n • UPDTSTAT cmd_id stat1 … statk • Ex. UPDTSTAT;29;bank=$500;gpa=4.0;health=25%\n

  11. Watson Game Protocol • Common Commands • HOTSPOT cmd_id x y z • Ex. HOTSPOT;5;x=34;y=2;z=5\n • Expect a CHALL from the server if location x,y,z is a hotspot, else the server will send back the same command. • CHALL cmd_id quest [choice1 … choicek] | ans • Ex. CHALL;5;quest=What is y = x++ if x = 2?;a=4;b=3;c=2;d=1\n • cmd_id is the same as the cmd_id from the HOTSPOT command • Ex. CHALL;5;ans=2\n • cmd_id is the same as the question cmd_id • Server sends back “OK” if answer is correct otherwise “WRGANS”

  12. Watson Game Protocol • Common Commands • MEET cmd_id x y z [fac, npchar, stu] • MEET;5;x=6;y=0;z=35\n //client sends • MEET;5;x=6;y=0;z=37;fac=Prof. Steflik\n //server sends back • MSG cmd_id gd | er • LOGIN;5;bob;abc123\n //client sends • MSG;5;er=WRGPWD\n //server sends back error msg • MSG;5;gd=OK //server sends back good msg

  13. Server Command Handling • Receives stream from client • Tokenizes the received data • Looks at command • Sends arguments to appropriate command handler • Handler sends results back to client

  14. Threads Dimitri Syrow

  15. Database Client Server

  16. Statistics Database Threads Challenge Dispatching Scoring Login/Logout Character Creation Core

  17. Statistics Challenge Dispatch Scoring Threads Core Login/Logout Character Creation

  18. Statistics Challenge Dispatch Scoring Database Threads Core Login/Logout Character Creation

  19. The Watson Game:Character Creation CS 495b – Senior Seminar Him Seng Wong Prof. Steflik

  20. Characters • Role Playing Game - Diablo II • First Person Shooting - Counter-Strike • Simulation - The Sims

  21. Creating a Character • Steps to create a character • Choose a status • Pick a profession • Decide one’s attributes

  22. Status • Name: All characters should have a name. • Age: How old the character is in the game. • Gender: Is the character male or female? • Nationality: This is where the character is born. • Education: college standing. In this game, when creating a new character, its standing should be Freshman.

  23. Profession • In this game, players are only able to pick student as a profession. • Watson Student – representing players • Harpur Student – representing players • SOM Student – representing players • Decker Student – representing players

  24. Profession – non playing • Teaching Assistant – provide assistant when players face challenges • Faculty – help students when they face challenges. However, he/she also generates challenges. • Support Staff – these represent wizards in this game. They are very helpful in overcoming some random challenges, such as hard-drive crashes, PC gets infected by virus, and etc…

  25. Profession • The purpose of creating teaching assistant, faculty, and support staff is to enhance interaction, playability in the game.

  26. Attributes • Beauty: The physical attractiveness of a person. • Charisma: Indicates the attractiveness of a person. It does not tell how well looking a person is, but instead, it tells whether people like a person by his or her attitude. • The attributes are decided by either client or database group.

  27. Server group – character creation • Players create the characters through client interface. • Client sends all the characters’ information to the server. • Protocol handler sends list of arguments. • Character creation has to parse through the arguments to get the value. • Insert the value into the database.

  28. Login/Logout Tool Gregory Miles CS 495: Senior Seminar Prof. Steflik

  29. What we need • Server side verification • Not just authentication • Coordinating class • Calling method • Constructor • Authenticate Method

  30. What the class will do • Takes Login and password • Sends both to database of users • Database verification • No encryption necessary • If incorrect and user exists • If incorrect and user does not exist • If correct

  31. Constructor and global variables • Class variables login and password • Constructor simply assigns the log and pass variables coming in to the global login and password variables.

  32. Authenticate method • Contain a local variable of type int • Sends password to database • Database returns value • Determines what Authenticate() will return • Returns local variable to calling method for processing

  33. The Challenge Dispatcher Adam Marczyk CS 495 – Senior Seminar Prof. Steflik

  34. Challenge Dispatcher – Input • When players bump into an “invisible polygon” that signifies a challenge, it will be the client’s responsibility to send to the server coordinates of the polygon just contacted. • This information will pass through the protocol-handler module and to the thread handler, which will assign it to the appropriate thread for that currently logged-in character. • The character’s thread will contact the challenge dispatcher and pass in the coordinates of the challenge.

  35. Parsing Input • The challenge dispatcher will contact the database query object to look up information about the challenge based on its coordinates. • The database query object will return information such as: • The type of the challenge (true/false, MC) • The text of the challenge • The correct answer • Any preconditions for taking the challenge (i.e., some upper-level challenges may be off-limits to new players).

  36. Processing and Output • First consider whether the player has already completed the challenge. • Next, query the character’s thread for their level to determine if they’re eligible. • If not, return a message telling them so. • If they are, send the text of the challenge and the choices to the client. • Once we get an answer, inform them whether it was right or wrong; if correct, use the database write object to record their success.

  37. Open Questions • Should the player be informed of what the correct answer is if they get it wrong? • Should players be able to re-take a challenge they got wrong? • Should there be any penalty for getting a challenge wrong or reward for getting it right?

  38. Scoring Object Kyle Lippincott CS 495: Senior Seminar Prof. Steflik

  39. Score Types • User General (Life Experiences) • GPA • Enrolled Course Current Grade • Completed Course Grade

  40. User General • Attached to user, not individual classes • Not range bounded, positive and negative • Positive examples: • Honor Society • Good health/going to the gym • Negative examples: • Getting ill • Trouble with the law

  41. GPA • Pseudo-score (not stored separately) • Average of all completed courses’ grades multiplied by how many credits the course was • Read-Only

  42. Enrolled Current Score • Bounded 0-100 • ‘Additive’ scoring • Get/Set • Obtain current value (but not current maximum) • Add to current value • No negatives/ex-post-facto deductions

  43. Completed Course Grade • Internally bounded 0-100 • Complete a course, save that score • Externally represented on 0-4.0 gpa scale • Decimal value, 3 places after decimal • Multiply by course credits, divide by total credits, obtain GPA • Read-Only

  44. Object Diagram

  45. Database Object Matthew Dietz CS 495: Senior Seminar Prof. Steflik

  46. Server/Database • Database Object • Handles all types of queries: • SELECT, DELETE, INSERT, UPDATE • Creating a packaging system between database and server • Incorporate an efficient command system

  47. Database Channel

  48. QueryResult Class • Implements a HashTable and a Vector. • Results can be referenced by column names, and a list of column names can be returned for easy access. • Formats the data without the server needing to know how it was done.

More Related