日韩精品一区二区三区高清_久久国产热这里只有精品8_天天做爽夜夜做爽_一本岛在免费一二三区

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

代做CS3357A、代寫Python設計編程

時間:2023-12-09  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯


CS3357A COMPUTER NETWORKING

Assignment #4: Building a multi-player server-client snake game.

Assignment Purpose

The goal of this assignment is to extend the functionality of the previously developed Snake

game to support three additional features:

** The server should handle multiple clients/snakes simultaneously. Each client will have its

own snake, enabling a multiplayer environment where multiple snakes share the field.

Each client will receive a game state that includes the position of all snakes to display

them. You can decide colors. Check the “Communication Protocol and Game State”

section for instruction on implementing the multi-player feature.

2- While playing, Clients can send a public message to the server to be broadcasted to all

clients. Check the chatting section for instruction on implementing the public messaging

part.

3- Both the server and the clients encrypt their messages using RSA encryption algorithm.

In the RSA algorithm, each party generates a key pair (public key, private key), where the

private key is kept as a secret at the sender and is used to encrypt the sender messages,

and the public key is publicly shared with the receiver and is used to decrypt the

messages at the receiver side. Check the Encryption section for instruction on

implementing messages and control inputs encryption.

The image below shows the game window that should be displayed on the client side in this

assignment.

 

Figure 1 A screenshot showing the graphical interface of the snake game on the client side, containing three snakes and 4 snacks.

The screenshot also shows the terminal of one of the three connected clients with messages exchanged between clients.

The server is responsible for:

1. Accepting multiple client connections.

2. Managing the game's logic for all connected clients.

3. Broadcasting the game state to all clients.

4. Receiving and parsing each client's input commands.

5. Applying the received game controls to update the game state.

6. Receive public messages from clients and broadcast them to all clients.

7. Encrypting outgoing public messages.

8. Decrypting incoming controls inputs and public messages.

The snake client is responsible for:

1. Connecting to the server.

2. Sending control inputs to the server.

3. Receive and parse the game state.

4. Displaying the game interface with all the snakes based on the received game state.

5. Send public messages to the server.

6. Receive the public messages broadcasted by the server and display them on the terminal.

7. Encrypts outgoing control inputs and public messages before sending them to the server.

8. Decrypts incoming public messages received from the server.

Assignment Description

Modify the snake_server.py and snake_client.py files of assignment 3 to support handling multiple players,

RSA-based secure communication, and public messaging between clients. Each client will be assigned a

snake where he will be able to control it by sending encrypted control inputs to the server. On the other

hand, the server managesthe game logic including recording snakes and snacks positions; applying control

inputs; and returning the game state.

In the previous assignment (assignment #3), you were given the server side code which is separated into two

files: snake.py and snake_server.py, and you had to implement the client side code. These files will be used

as the starting code for this assignment.

In this assignment, no new files are given, but you are required to use and modify the server/client

code files of the previous assignments to support the new functionalities.

As this assignment builds on previous ones, the following diagrams illustrate the connection between

assignment 2, assignment 3, and assignment 4:

Figure 2 In the chatting application of assignment 2, the server can handle concurrent client connections. A connected client can

send a public message to the server to be broadcasted to all clients. No encryption is used.

Figure 3 In the single-player snake game of assignment 3, the server can accept a connection from a single client. Each cycle, the

client will send a control input, for example “get”, and the server will reply with the game state. Finally, the client uses the game

state to draw the game display. No encryption is applied; the server and client send data as plain text.

Figure 4 In assignment 4, you are required to implement a multi-player snake game. There are few differences between this

version of the game and the version implemented in the previous assignment. First, the server can accept concurrent client

connections. Once a client connects to the server, the server deploys a new snake and assigns it to that user. Second, in addition

to control inputs, clients can send public messages. Third, control inputs and public messages (sent by both the server and

clients) are encrypted using RSA encryption algorithm.

Snake game

The snake game that we will implement in this assignment is similar to the one implemented in the previous

assignment with additional features.

The rules of the game are implemented in the snake.py file which is used by the server script

(snake_server.py).

Game controls

In assignment 3, we implemented seven game controls sent by the client to enable him to control

the snake. Since we are using the code scripts of the previous assignment as a starting code for

this assignment, these seven game controls are still used in this assignment. However, feel free to

change the format of the control messages. For example, instead of sending the get command as

“get”, you can send “control:get” instead. This way the server knows this is a control input and

not a public message that should be broadcasted to all clients.

Chatting

Players will be able to send a message to all other players by sending a message to the server and the server

will broadcast the message to all players. Therefore, in each cycle, the server can receive a control input or a

message from each client. The two conditions apply:

1. A player can only send a public message to all players, he cannotsend a private message to a

particular player. For example, if three players are connected, A, B, and C. Player A can send a

public message to the server and the server will broadcast this message to A, B, and C. Player A

can’t send a private message to player B or C.

2. Instead of having the user type in the message it wants to send to the server, each player should

have a set of predefined messages each associated with a hotkey. When the user presses a hotkey,

the corresponding message should be sent to the server to be broadcasted to all other players. Each

player choosesits unique set of messages. For example, player A can have the following set of

messages: [“Congratulations!”, “It works!”, “Ready?”] assigned to the following keys: [‘z’, ‘x’, ‘c’].

When user A pressesthe key ‘x’, the message “It works!” should be sent to the server. The server

will then broadcast the message to users B and C. Upon receiving player A’s message from the

server, users B and C will display the received message on their terminal. You are required to

implement a client that has a set of three predefined messages each assigned a key.

Encryption

RSA Encryption Workflow

Consider a client k that wants to securely communicate with a server using RSA algorithm. First,

client k must generate its own RSA key pair: (client_k_public_key, client_k_private_key). When

client k connects to the server, it will send its public key to the server. After that, whenever Client

k wants to send a message to the server, it will encrypt the message using its own private key,

and send the encrypted message to the server, the server will then use client_k_public_key to

decrypt the received encrypted message. Similarly, the server will construct its own RSA key

pair: (server_public_key, server_private_key). The server will share its public key with every

client that connects to it. After that, if the server wants to send an encrypted message to client k,

it will encrypt the message using its own private key. Client k will then be able to decrypt the

received message using the server’s public key.

What to encrypt

In this assignment, the server exchanges various types of data with clients. Each cycle, the client

must send a control message and possibly a public message to be broadcasted to all clients. On

the other hand, the server sends the game state and the public messages that it received from any

client to broadcast to other clients. Therefore, the client can send two types of data: control

inputs and public messages, and the server can send two types of data: the game state and public

messages. You are required to encrypt all the exchanged data between the server and client

except the game state which can be sent without encryption. We don’t encrypt the game state

because encryption becomes more expensive (takes a lot of time) as the length of the text to be

encrypted grows.

Communication protocol and game state

In the previous assignment, the exact form of the game state was provided which contains the coordinates of

the snakes and the coordinates of the snacks separated by a “|” character. As this assignment introduces

more features that require adjusting both the server and client scripts, the communication protocol provided

for the previous assignment will not work. For example, in the previous assignment, the server and the client

exchange the control inputs and the game state each cycle. In this assignment, clients can send a public

message to the server to be relayed to the other clients. Therefore, the communication protocol should be

redesigned such that under the new communication protocol, the client can send both types of data (i.e.

control inputs and public messages), and the server can differentiate between both types.

Redesign the game communication protocol. This includes re-formatting of the control inputs and the

game state; and modifying the sequence and contents of exchanged data. Feel free to make any changes in

the client and server scripts of the previous assignment to add the new functionalities (multi-client

connection, public chatting between clients, and message encryption).

Deliverables

Submit four files:

1. snake_server.py: Snake game server-side code which can handle multiple client connections and

public messaging.

2. Snake.py: Helper file for snake_server.py. It contains the functions to handle the game logic.

3. Screenshot.png: Screenshot of the game display showing at least three players (snakes) in the field.

The screenshot should also show the terminal of one of the clients with exchanged messages printed

on the terminal (similar to figure 1).

4. snake_client.py: Snake game client side

Use the snake.py, snake_server.py, and snake_client.py files from the previous assignment as starting

code. Modify these files as you want to implement the features of this assignment.

Rubric

This assignment is out of 50. Marks are distributed as follows:

1. Server can handle multiple client connections concurrently. 5 marks

2. Server manages the game's logic for all clients(the game runs as intended). 10 marks

3. Server receives messages from clients and broadcasts them to all clients. 5 marks

4. Server broadcasts the game state to all clients. 5 marks

5. Server encrypts the public messages it broadcasts to clients. 5 marks

6. Client displays the game with all snakes based on the received game state. 5 marks

7. Client sends movement commands to the server. 5 marks

8. Client sends a message to the server when the user presses the assigned hotkey. 5 marks

9. Client encrypts the control inputs and public messages it sends to the server. 5 marks

Late submission

Late assignments will be accepted for up to two days after the due date, with weekends

counting as a single day; the late penalty is 20% of the available marks per day. Lateness is

based on the time the assignment is submitted.

Extensions will be granted only by your course instructor. If you have serious medical or

compassionate grounds for an extension, you must take supporting documentation to the

Academic Counselling unit of your faculty, who will contact the instructor.

請加QQ:99515681 或郵箱:99515681@qq.com   WX:codehelp

 

掃一掃在手機打開當前頁
  • 上一篇:ACS133編程代寫、代做MATLAB程序語言
  • 下一篇:CP1404程序代做、代寫Java,c++編程設計
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業/產品研發/客戶要求/設計優化
    有限元分析 CAE仿真分析服務-企業/產品研發
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 trae 豆包網頁版入口 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    日韩精品一区二区三区高清_久久国产热这里只有精品8_天天做爽夜夜做爽_一本岛在免费一二三区

      <em id="rw4ev"></em>

        <tr id="rw4ev"></tr>

        <nav id="rw4ev"></nav>
        <strike id="rw4ev"><pre id="rw4ev"></pre></strike>
        国自产拍偷拍福利精品免费一| 久久琪琪电影院| 欧美日韩综合视频网址| 国产精品igao视频网网址不卡日韩| 一区二区三区在线观看视频| 亚洲女性裸体视频| 亚洲一区二区免费视频| 久久久精品国产免费观看同学| 国产在线欧美日韩| 国产一级精品aaaaa看| 亚洲精品免费观看| 国产精品丝袜白浆摸在线| 欧美日韩性视频在线| 亚洲毛片av| 欧美日韩免费观看一区二区三区| 亚洲国产精品一区二区第四页av| 在线观看精品一区| 亚洲夜间福利| 亚洲性视频网站| 欧美11—12娇小xxxx| 欧美午夜精品久久久久久人妖| 蜜月aⅴ免费一区二区三区| 国产精品亚洲第一区在线暖暖韩国| 国产亚洲va综合人人澡精品| 欧美精品一区在线播放| 狠狠干成人综合网| 免费观看在线综合| 久久久久久久综合狠狠综合| 一区二区三区在线免费视频| 亚洲女女女同性video| 欧美日韩精品欧美日韩精品一| 欧美高清一区二区| 国产乱码精品一区二区三区av| 亚洲性线免费观看视频成熟| 久久精品夜色噜噜亚洲a∨| 欧美日韩性生活视频| 西瓜成人精品人成网站| 国产欧美一区二区三区视频| 在线色欧美三级视频| 久久成人精品电影| 亚洲少妇一区| 久久av在线| 欧美激情第8页| 欧美精品尤物在线| 日韩亚洲欧美综合| 欧美自拍偷拍午夜视频| 一区二区三区精密机械公司| 另类图片综合电影| 亚洲精品在线免费观看视频| 亚洲精品乱码视频| 亚洲视频一二三| 你懂的国产精品永久在线| 国产亚洲人成网站在线观看| 伊人男人综合视频网| 黄色小说综合网站| 亚洲免费观看高清完整版在线观看| 欧美在线免费观看亚洲| 99视频一区二区| 亚洲一区二区三区乱码aⅴ| 久久久久久亚洲精品不卡4k岛国| 国产精品成人av性教育| 亚洲一区二区视频在线观看| 久久久人成影片一区二区三区观看| 国产日本欧美一区二区三区| 欧美欧美午夜aⅴ在线观看| 国产精品久久久久久久久借妻| 亚洲欧美影院| 狠狠久久亚洲欧美专区| 国产精品天美传媒入口| 国产日韩欧美在线一区| 国产亚洲精品资源在线26u| 欧美三级视频| 国产精品日韩在线一区| 国产欧美一区二区白浆黑人| 久久久久久91香蕉国产| 欧美日韩一区二区在线观看| 欧美精品麻豆| 亚洲精品偷拍| 欧美高清一区二区| 美女任你摸久久| 欧美一区二区视频免费观看| 国产亚洲欧美日韩日本| 欧美日韩黄色大片| 欧美精品播放| 久久综合给合久久狠狠狠97色69| 国内自拍视频一区二区三区| 欧美激情综合亚洲一二区| 久久国产综合精品| 亚洲国产视频直播| 在线视频日韩精品| 欧美日韩午夜在线视频| 国产女人aaa级久久久级| 亚洲电影视频在线| 在线免费一区三区| 日韩视频国产视频| 久热精品视频| 一本久道综合久久精品| 欧美成人r级一区二区三区| 久久九九精品99国产精品| 亚洲视频免费在线| 亚洲欧美一区在线| 黄色成人在线网址| 欧美日韩亚洲综合一区| 久久国产婷婷国产香蕉| 国内一区二区三区在线视频| 亚洲图片在线| 一个人看的www久久| 亚洲日本视频| 日韩一级黄色av| 噜噜噜躁狠狠躁狠狠精品视频| 欧美激情综合亚洲一二区| 欧美一区永久视频免费观看| 亚洲日本在线视频观看| 亚洲中午字幕| 亚洲国产一区在线| 午夜免费电影一区在线观看| 欧美午夜精品久久久久久久| 香蕉久久精品日日躁夜夜躁| 麻豆成人小视频| 国产精品海角社区在线观看| 美日韩丰满少妇在线观看| 国产精品一区亚洲| 国产精品老牛| 午夜精品一区二区三区在线播放| 国产精品自拍一区| 香蕉免费一区二区三区在线观看| 亚洲乱码国产乱码精品精天堂| 激情久久久久久久久久久久久久久久| 国产精品日韩二区| 狠狠爱综合网| 欧美日韩日日夜夜| 国产精品日本精品| 国内精品久久久久久久影视蜜臀| 欧美成人国产va精品日本一级| 欧美日韩一级黄| 先锋a资源在线看亚洲| 亚洲欧美日韩网| 免费短视频成人日韩| 国产精品高潮视频| 亚洲国产精品ⅴa在线观看| 国产一区白浆| 午夜综合激情| 久久精品国产99精品国产亚洲性色| 亚洲欧美日韩综合| 国产精品视频网| 欧美夫妇交换俱乐部在线观看| 蜜桃精品一区二区三区| 欧美精品乱人伦久久久久久| 亚洲免费在线观看| 国产精品视频福利| 国产一区二区三区久久久久久久久| 精品88久久久久88久久久| 国产一区二区三区在线观看网站| 亚洲图片在区色| 久久噜噜噜精品国产亚洲综合| 一本久久综合亚洲鲁鲁| 久久都是精品| 精品9999| 亚洲国产91精品在线观看| 国内成人自拍视频| 亚洲精品美女在线观看| 久久精品99国产精品| 亚洲亚洲精品三区日韩精品在线视频| 麻豆av福利av久久av|