COMP30023作业代做、Image Tagger作业代写、代做C/C++语言作业、C/C++编程设计作业代写
Project Basic Functionalities. In this project, you are asked to write a program to implement(by socket programming in C) the aforementioned game server supporting two players fromtwo different browsers over HTTP. The program should allow users to configure both the server IPaddress and the port number. Specifically, you need to implement the following basic functionalitiesof the server, where the html source files of all the pages will be provided. The Welcome Page. The server should be able to accept persistent TCP connections from theplayers and return a Welcome Page (as shown in Figure 1) upon the establishment of theconnection. Specifically, the page consists of:– a title, i.e., Image Tagger Game,– a welcome image,– a welcome phrase,– a textbox for players to enter their name, and– a button with text “submit”, by pressing which the name entered in the textbox will besent to the server by the http POST method;1When a player name is submitted, the server should be able to record the name and return theMain Menu Page (see Figure 2).Figure 1: welcome.htmlFigure 2: start.html The Main Menu Page. The Main Menu Page (as shown in Figure 2) has two buttons right below2the image: (i) the “Start” button, and (ii) the “Quit” button.– When the “Start” button is clicked, an HTTP GET request is sent to the server. Uponreceiving the request, the server returns the Game Playing Page (see Figure 3).– When the “Quit” button is clicked, the current player quits the game and a POST requestis sent to the server. Upon receiving this POST request, the server returns the GameOver Page (i.e., Figure 7) to the current player, and to the other player when he/shesubmits their next keyword.The Game Playing Page. The Game Playing Page (as shown in Figure 3) contains a keywordtextbox which is for players to type keywords as their attempts. When the button “Guess” isclicked, the keyword in the textbox is sent to the server (by a POST request). The server shouldthen perform the following actions:Step 1. Check whether the other player is ready to play. If so, go to Step 2; otherwise, return theKeyword Discarded Page (i.e., Figure 4) to the current player indicating that the otherplayer is not ready yet and the keyword just inputed is discarded.Step 2. Check whether or not the submitted keyword has ever been submitted by the other player.If so, the server returns the Game Completed Page to the current player and to the otherplayer when he/she submits the next guess. Otherwise, the server returns the KeywordAccepted Page (i.e., Figure 5) to the current player and the game continues.Figure 3: first_turn.html The Keyword Discarded Page. In the Keyword Discarded Page (as shown in Figure 4), whenthe “Guess” button is clicked, the server performs exactly the same actions as what it does inthe Game Playing Page.3 The Keyword Accepted Page. In the Keyword Accepted Page (as shown in Figure 5), whenthe “Guess” button is clicked, the server performs the same actions as what it does in the GamePlaying Page, except that the server does not need to check whether the other player is readyor not. The Game Completed Page. For the Game Completed Page, the server performs the sameactions as what it does in the Main Menu Page. The Game Over Page. This page shows “Game Over!”. The server closes the TCP connection.Advanced Functionalities. In order to implement the following advanced functionalities, youwill need to “generate” the html files dynamically rather than simply using the static html filesprovided. More specifically, you will need to insert or change some contents in the html files suchthat it can show information dynamically according to what information the server has received. Advanced Functionality 1: Showing the Inputed Keyword List. In the Keyword Accepted Page,the page should show the list of keywords that have been successfully submitted by the playerso far. Advanced Functionality 2: Identifying Players by Cookie. When a player connects to the serverfor the first time, the server should be able to create a cookie for the player. Afterward, when aplayer tries to connect to the server for the second time with a cookie, the server should be ableto identify the player by cookie and return directly the Main Menu Page showing the player’sname (therefore, you will need an html file that can change dynamically) without asking theplayer to submit his/her name in the Welcome Page.Specific Requirements. Below are some specific requirements for the project: The game server must be implemented by socket programming in C. Programs in otherlanguages will not be accepted and will result in zero mark. The server must use HTTP protocol to communicate with the client browsers. A makefile must be provided along with your code for compilation, and the compiled executablebinary must be named as image_tagger. The image_tagger program must accept two parameters: (i) a specified server IP address,and (ii) a specified port number. When the program is started, it must print out the information of the IP address and theport number of the server, as shown in Figure 8.Hints. In this project, you can assume that everything in the test environment is friendly, namely,there are no adversaries aiming to break down your program, neither unexpected connection drops.In addition, below are some key knowledge that you may need to know to complete the project: communicating with a client over a persistent TCP connection by socket programming in C; sending an html file to the client browser;4Figure 4: discarded.htmlFigure 5: accepted.html5Figure 6: endgame.htmlFigure 7: gameover.html$ image_tagger <server_ip> <port_number>image_tagger server is now running at IP: <server_ip> on port <port_number>Figure 8: Example execution instance. Note: $ is the CLI prompt; <server_ip> and <port_number>are input parameters. parsing an http message received from a client browser such that the server can extract thehttp method (whether it is a GET or a POST) and the contents in the message; supporting two connections with two client browsers simultaneously, namely, multiplexing &demultiplexing (some useful materials and good examples can be found here1).An important note: You will have a try on some of the above techniques in the labs in Week 5 andWeek 6. You may not want to miss them.Marking Scheme. This project worths 15% of the subject. The marking scheme is as follows:1http://www.beej.us/guide/bgnet/html/multi/advanced.html6Marks Task1 Configurable IP addresses and port numbers1 HTTP over Persistent TCP Connections1 Response to the player’s name submission2 Response to the clicking the “Start” button1 Response to the clicking the “Quit” button3 Response to the clicking the “Guess” button2 Displaying the keyword list1 Identifying player by cookie1 The use of Gitlab for version control1 Code Quality1 Build Quality (e.g., providing a makefile)Questions. Any questions or doubts should be raised in the LMS Discussion Forum — Project 1.Do not share implementation-specific source code on the discussion forum.Submitting Your Source Code. The due date is at 11:59pm on 29 April (Monday) 2019.You must submit, to both GitLab and LMS, your source code (with a makefile) in a .zip filewith a filename in the the format of <your_username>_comp30023_2019_project-1, e.g., junhaog_comp30023_2019_project-1.Any failure to follow the filename format will result in a2-mark deduction. Any missing submission from either Gitlab or LMS or both will be considereda submission failure.Late Submissions. There will be heavy penalties on late submissions. Any late submission willbe deduced 20% from the total marks in the first day, and an extra 1-mark deduction appliesto each day passing the deadline.Zero Tolerance for Cheating. While you are allowed to discuss the project with your classmatesand search online to learn some related techniques to complete the project , you are required toimplement the program by your own. This means that every single line of the code must be writtenby yourself. All submissions will be checked for plagiarism. Any confirmed case will receivea 0 mark for the project outright, and be reported to the school for disciplinary actions.7因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:
微信:codinghelp