Chris Harrison Stacey Kuznetsov Mariya Lysenkova Jennifer Refat Gabriel Sinkin.

Slides:



Advertisements
Similar presentations
Computer Net Lab/Praktikum Datenverarbeitung 2 1 Overview Sockets Sockets in C Sockets in Delphi.
Advertisements

CCNA – Network Fundamentals
Voice Instant Messenger Andrew Miller CS 491B Fall 2006 Professor Sun.
Real-Time Authentication Using Digital Signature Schema Marissa Hollingsworth BOISECRYPT ‘09.
A CHAT CLIENT-SERVER MODULE IN JAVA BY MAHTAB M HUSSAIN MAYANK MOHAN ISE 582 FALL 2003 PROJECT.
1 Java Networking – Part I CS , Spring 2008/9.
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
Security and Digital Recording System Students: Gadi Marcu, Tomer Alon Number:D1123 Supervisor: Erez Zilber Semester:Spring 2004 Mid Semester Presentation.
Inter Process Communication:  It is an essential aspect of process management. By allowing processes to communicate with each other: 1.We can synchronize.
File Transfer: FTP and TFTP
Client Server Model The client machine (or the client process) makes the request for some resource or service, and the server machine (the server process)
A Chat Server DBI – Representation and Management of Data on the Internet.
ISP – 9 th Recitation Socket programming – Client side.
Chris Harrison Stacey Kuznetsov Mariya Lysenkova Jennifer Refat Gabriel Sinkin.
Security and Digital Recording System Students: Gadi Marcu, Tomer Alon Number:D1123 Supervisor: Erez Zilber Semester:Spring 2004 Final Presentation.
VSP Video Station Protocol Presented by : Mittelman Dana Ben-Hamo Revital Ariel Tal Instructor : Sela Guy Presented by : Mittelman Dana Ben-Hamo Revital.
The Watson Game Client Group November 30, Client Integration and Testing Richard Pantoliano, Jr.
Chapter 30 Electronic Mail Representation & Transfer
Introduction 1 Lecture 7 Application Layer (FTP, ) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science & Engineering.
Chapter 26 Client Server Interaction Communication across a computer network requires a pair of application programs to cooperate. One application on one.
Applying Real-time Simulation to Real-time Collaboration Bart Miller.
Introduction 1-1 Chapter 2 FTP & Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 IC322 Fall.
Server Design Discuss Design issues for Servers Review Server Creation in Linux.
By: Joel Rodriguez.  International student from Mexico  Delicias, Chihuahua Mexico  Spanish  Sports and Music.
SMTP, POP3, IMAP.
1 Application Layer Lecture 5 Imran Ahmed University of Management & Technology.
Agenda  Terminal Handling in Unix File Descriptors Opening/Assigning & Closing Sockets Types of Sockets – Internal(Local) vs. Network(Internet) Programming.
Assignment 3 A Client/Server Application: Chatroom.
DEMIGUISE STORAGE An Anonymous File Storage System VIJAY KUMAR RAVI PRAGATHI SEGIREDDY COMP 512.
Chapter 17 Networking Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William Stallings.
IT 424 Networks2 IT 424 Networks2 Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross Chapter 2: Application.
1 Chapter Client-Server Interaction. 2 Functionality  Transport layer and layers below  Basic communication  Reliability  Application layer.
PA3: Router Junxian (Jim) Huang EECS 489 W11 /
Institute of Computer and Communication Network Engineering OFC/NFOEC, 6-10 March 2011, Los Angeles, CA Lessons Learned From Implementing a Path Computation.
CS3516 A15 Help Session 1 CS3516 — TCP/IP Socket Programming Presented by Oleksandr Narykov
Sauna Network Protocol. Create User $SAU,CU,[UserName],[Password],[Firstname],[ Lastname],[ ],[Phone]
Jozef Goetz, Application Layer PART VI Jozef Goetz, Position of application layer The application layer enables the user, whether human.
Server Sockets: A server socket listens on a given port Many different clients may be connecting to that port Ideally, you would like a separate file descriptor.
CS162B: IPv4 Socketing Jacob T. Chan. Socketing in the Real World  Most computer games are multiplayer in nature or have multiplayer components  DotA,
 TCP (Transport Control Protocol) is a connection-oriented protocol that provides a reliable flow of data between two computers.  TCP/IP Stack Application.
Chapter 4: Interprocess Communication‏ Pages
The Socket Interface Chapter 21. Application Program Interface (API) Interface used between application programs and TCP/IP protocols Interface used between.
The Socket Interface Chapter 22. Introduction This chapter reviews one example of an Application Program Interface (API) which is the interface between.
Network Programming Eddie Aronovich mail:
1 Client-Server Interaction. 2 Functionality Transport layer and layers below –Basic communication –Reliability Application layer –Abstractions Files.
Socket Programming Introduction. Socket Definition A network socket is one endpoint in a two-way communication flow between two programs running over.
Client/Server Socket Programming Project
The Client-Server Model And the Socket API. Client-Server (1) The datagram service does not require cooperation between the peer applications but such.
Warlords Patrick Levoshko SE 558 – Multiplayer Game Design.
Internet Applications (Cont’d) Basic Internet Applications – World Wide Web (WWW) Browser Architecture Static Documents Dynamic Documents Active Documents.
DOTSNBOXES. Overview Dots and Boxes is played originally with the use of paper, pen and 2 players. The Game board is a matrix of points and vary in size.
UNIX Sockets Outline UNIX sockets CS 640.
COMP 431 Internet Services & Protocols
Netprog: Client/Server Issues1 Issues in Client/Server Programming Refs: Chapter 27.
1 Kyung Hee University Chapter 11 User Datagram Protocol.
A Local Area Network Chat Client ITTC LAN CHAT John Vincent Cecogo Jerikho Daguno Ardee Santos Elaine Mendoza Anjomar Pat Del Mindo Philip John Sales Philip.
Multi player client sever Snake Game Technology : JAVA (swing for user interface and Socket for passing coordinates of snakes, food item and score)
Chapter 11 User Datagram Protocol
Assignment 3 A Client/Server Application: Chatroom
Chapter 3 Internet Applications and Network Programming
Topic 5: Communication and the Internet
Implementation CAN Communication Engine
Chapter 14 User Datagram Protocol (UDP)
UNIX Sockets Outline Homework #1 posted by end of day
Starting TCP Connection – A High Level View
Issues in Client/Server Programming
TA: Donghyun (David) Kim
PART 5 Transport Layer.
Chapter 7 Network Applications
Presentation transcript:

Chris Harrison Stacey Kuznetsov Mariya Lysenkova Jennifer Refat Gabriel Sinkin

System Architecture Server and Client exchange messages, player commands, game data Server Database - contains comprehensive network and game related data for all players Client Database - only stores data last sent by the server and only contains a subset of game data (items needed for graphics)

Server Architecture

Network Communication –BSD Sockets –One socket per client, two-way data flow –TCP (not UDP) Server broadcasts commands once (no streaming data) Data less time-sensitive than other applications –TCP Header: 20 bytes. Movement Command: ~25 bytes. ~50 bytes per command Clients generate a command every ~2 seconds 1000 concurrent clients ~25Kbps upstream data Naïve Broadcasting: 25Mbps! (intelligent broadcasting based on locality)

Server Architecture Handle many concurrent clients –Posix Threads –Main Accept thread Waits for new client connection Spawns new client handler thread –Thread for each client Receives command string Adds command to command queue Sleeps –Broadcast (responder) thread Continuously processing commands unless queue is empty Selectively broadcasts to relevant clients –Movement, chat, combat to local area –Private chat, trade, to single player –Taps into player-data-storage class (updating and getting information)

Server-Specific Classes Main: Boots server, spawns broadcast thread and client threads. Broadcast thread: broadcasts relevant data (fetched off the queue) to clients. Spawned once. ClientHandler thread: listens for, receives and processes incoming commands. One ClientHandler thread is spawned for each Client. Database: Contains a large array of player data structures: index = unique PlayerID, which assigned when account is first created, A matrix of LinkedLists, which store player IDs mirror the in game regions. This is used to facilitate intelligent broadcasting of data.

Client Architecture

Client-Specific Classes Main: Boots client, fetches the positions of all players from Server and writes them to Client Database. GameEngine: processes incoming commands, updates ship positions, renders graphics. Graphics interface includes: renderSea(), renderLand(), renderShips(), renderWeather(), renderAccessories(), etc. CommandHandler: waits for commands from server. Received commands are pushed onto command queue CommandSender: Sends player commands to the server. Commands generated in- game are pushed onto an outgoing command queue. The commandSender thread is responsible for reading from this queue and sending commands to the server. Database: Like the Server database, contains large array of all players indexed by id number. Unlike the Server database, it contains not two but four coordinates: x_current, y_current, x_destination and y_destination, as well as ship velocities (the server does not care about this data, as it relates to graphics). This enables the game engine thread to animate the ship as it gradually moves from the current location to the destination

Protocol Plain text (abstracted) Simple and extensible Command Composition –Leading character determines command type –Server and client know command structure –“M ” –Movement; Player 45 moving from x=1356, y=2483 to x=1401, y=2237. To Server from Client: –Login, Logout, Movement, Chat, Private Chat, Trade Funds, Trade Items, Attack, Request Missions, Accept Mission, Mission Completed (Used to synchronize funds), Request Services/Items, Buy Service/Item, Create Group, Join Group, Leave Group. To Client from Server: –Movement (sent to all clients in the region), Chat (sent to all clients in the region), Private Chat (sent to DestinationPlayer only), Trade Funds (sent to DestinationPlayer only), Trade Items (sent to DestinationPlayer only), Attack (sent to all clients in the region), List Missions, List Services/Items, Join Group Response, Login Response

Player Movement Logistics Player Location: The world will (initially) be split up into 3 regions (rows). Having players split up this way will enable us to broadcast player actions only to those players who are in their vicinity, instead of broadcasting data to the entire world. Player Movement: setPosition(int id, int x, int y) function, which –Locates the player with the given id in the players' array –Changes his coordinates to the specified coordinates –Determine the Row(s) the player is in, and return a list of the sockets of all players that are in the same Row(s) so that the server can broadcast the changed location to all surrounding players, including the moving player himself Data Storage Logistics: When the system is idle or not running, game data will be stored in a file, in the following format: Player ID:::Player Name:::Player Password:::X Coord:::Y Coord

Player Movement Logistics Upon startup, the Data() constructor will do the following: Open data file Parse data file and create a Player Object for each player specified in the file Place each Player Object into the players array, indexing them by id number Determine the Row(s) each Player belongs in Copy pointer of each Player Object into the corresponding Row list(s) When the system shuts down, the Data destructor will: Iterate through the players' array and replace the old file Delete the players array and all lists Login: The server will call login(char *name, char * password) on a player's information when a player logs in. The login function will: Determine of the name and password are valid. Return -1 if information is invalid Return user id if login is valid

Player Movement Logistics Exit: When a player exits the game, the server will call Exit(int id), which will Remove the player from any Row lists that may point to him so that his socket is no longer returned when other players move Return -1 if exit status caused an error New Player: The newPlayer(char *name, char *password) function creates a new Player Object and generates an id for that player, the id being the next available index in the players array. Player Surroundings: When a player first logs in or is created, the server will call getLocalPlayers(int id). This function will return a list of GameData data structures with everything needed for the server to process commands. Essentially, these will be the players in the Row(s) of the player.

Life of a Command