国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

代做CS3357A、代寫Python設(shè)計(jì)編程

時(shí)間:2023-12-09  來源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)


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.

請(qǐng)加QQ:99515681 或郵箱:99515681@qq.com   WX:codehelp

 

掃一掃在手機(jī)打開當(dāng)前頁
  • 上一篇:ACS133編程代寫、代做MATLAB程序語言
  • 下一篇:CP1404程序代做、代寫Java,c++編程設(shè)計(jì)
  • 無相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路流場(chǎng)仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真技術(shù)服務(wù)
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲勞振動(dòng)
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)40個(gè)行業(yè)
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)4
    超全面的拼多多電商運(yùn)營(yíng)技巧,多多開團(tuán)助手,多多出評(píng)軟件徽y1698861
    超全面的拼多多電商運(yùn)營(yíng)技巧,多多開團(tuán)助手
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服務(wù)平臺(tái)
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內(nèi)
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗(yàn)證碼 寵物飼養(yǎng) 十大衛(wèi)浴品牌排行 suno 豆包網(wǎng)頁版入口 wps 目錄網(wǎng) 排行網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號(hào)-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    国产九九九九九| 国产精品88久久久久久妇女| 国产老熟妇精品观看| 日韩中文字幕在线免费观看| 亚洲福利av| 91免费视频国产| 宅男噜噜99国产精品观看免费| 精品免费一区二区三区蜜桃| 久久99影院| 天堂资源在线亚洲资源| 国产一二三四区在线观看| 国产精品久久久久77777| 欧美日韩亚洲在线| 日韩在线视频线视频免费网站| 亚洲一区二区三区精品视频| 国产日产欧美精品| 国产精品视频成人| 欧美在线观看日本一区| 日本在线高清视频一区| 精品麻豆av| 精品国产一区二区三区久久久久久 | 欧美综合激情| 8050国产精品久久久久久| 亚洲最大av网| 91久久国产婷婷一区二区| 亚洲欧美久久久久一区二区三区| 91精品国产综合久久久久久丝袜| 熟女少妇在线视频播放| 久久免费精品视频| 欧美主播一区二区三区美女 久久精品人 | 国产精品亚洲网站| 久久久久久com| 97人人模人人爽人人喊38tv| 亚洲国产精品久久久久久女王| 白嫩少妇丰满一区二区| 亚洲国产一区二区三区在线| 国产成人黄色av| 欧美在线性视频| 国产成人免费av| 国产中文字幕亚洲| 欧美精品福利视频| 国产精品1234| 人妻内射一区二区在线视频| 国产精品久久婷婷六月丁香| 国产精品亚洲二区在线观看| 日韩在线三级| 国产成人精品亚洲精品| 国产一级不卡视频| 亚洲在线视频一区二区| 久久免费视频网站| 日韩免费在线播放| 精品国产乱码一区二区三区四区| 91精品国产91久久久| 欧在线一二三四区| 久久的精品视频| 99精品国产高清在线观看| 日本精品视频在线| 欧美精品一区三区| 久久免费看毛片| 黄色av网址在线播放| 亚洲一区二区中文| 日韩视频免费观看| 成人免费视频a| 欧美亚洲一区在线| 亚洲伊人成综合成人网| 国产白丝袜美女久久久久| 精品少妇一区二区三区在线| 亚洲国产激情一区二区三区| 国产成人无码精品久久久性色| 国产日韩欧美在线播放| 性色av香蕉一区二区| 国产精品久久77777| 91精品国产91久久久久久吃药 | 久久伊人一区二区| 欧美 日韩 激情| 亚洲高清视频一区二区| 国产精品人人妻人人爽人人牛| 99久久久久国产精品免费| 欧美亚洲另类在线一区二区三区| 欧美精品福利在线| 国产精品美女久久久久av超清| 久久人人九九| 国产精品一区二区三区不卡 | 99久re热视频这里只有精品6| 人体精品一二三区| 亚洲一区二区三区免费看| 久久久精品久久久久| av免费网站观看| 好吊色欧美一区二区三区| 无码日韩人妻精品久久蜜桃| 美日韩精品免费视频| 国产成人精品一区二区| 91精品视频免费观看| 国产日韩在线精品av| 欧美又大粗又爽又黄大片视频| 亚洲五月六月| 欧美成在线视频| 国产精品日韩久久久久| 国产成人a亚洲精v品无码| 不卡视频一区二区三区| 国产乱码精品一区二区三区中文| 韩日精品中文字幕| 欧洲精品视频在线| 日韩欧美视频网站| 日本不卡高清视频一区| 亚洲国产欧美不卡在线观看| 欧美精品做受xxx性少妇| 久久九九亚洲综合| 久久久久亚洲精品成人网小说| 99视频在线| 国产精品自产拍在线观| 国产伦精品一区二区三区照片 | 国产日产欧美a一级在线| 黄色国产小视频| 欧美日产一区二区三区在线观看| 日本精品一区二区三区不卡无字幕 | 国产精品成人观看视频免费| 久久久精品一区二区| 色妞欧美日韩在线| 国产l精品国产亚洲区久久| 久久美女福利视频| 久久人人爽人人| 久久人人九九| 国产成人av影视| 久久久久久九九九九| 日韩亚洲精品电影| 久久久999国产精品| 国产精品视频成人| 国产精品久久久久久久小唯西川 | 久久精品国产2020观看福利| 精品国产一区二区三区久久狼黑人| 久久久久久久久综合| 日韩最新免费不卡| 国产精品三级在线| 成人444kkkk在线观看| 九九精品在线视频| 中文精品一区二区三区| 一区二区视频国产| 欧美激情精品久久久久久蜜臀| 美女黄色丝袜一区| 亚洲欧洲精品在线| 日本不卡高字幕在线2019| 欧美日韩第二页| 国产女大学生av| 久久久免费电影| 精品国产欧美成人夜夜嗨| 国产精品久久久久影院日本| 久久91精品国产| 午夜精品美女自拍福到在线| 任我爽在线视频精品一| 精品一区二区三区无码视频| 成人黄色一区二区| 久久久久免费看黄a片app| 国产精品日日做人人爱| 国产aⅴ精品一区二区三区黄| 亚洲精品日韩在线观看| 日韩精品一区二区免费| 国产一区二区视频免费在线观看| 高清国语自产拍免费一区二区三区| 91久色国产| 国产成人无码精品久久久性色| 精品国产福利| 日本精品久久久| 国产日韩二区| 久久男人资源站| 国产精品久久久久久久久影视| 永久免费看av| 欧美亚洲视频一区二区| 国产日本欧美一区二区三区 | 欧美极品少妇无套实战| 粉嫩av免费一区二区三区| 久久66热这里只有精品| 欧美精品在线看| 天天夜碰日日摸日日澡性色av| 欧美激情 国产精品| 高清一区二区三区视频| 久久精品国产v日韩v亚洲 | 久久精品在线免费视频| 国产精品福利网| 欧美一区二区三区免费视| 美女主播视频一区| 国产成人亚洲综合青青| 美女999久久久精品视频| 日韩亚洲在线视频| 成人免费在线小视频| 久久精视频免费在线久久完整在线看 | 国产成人黄色av| 插插插亚洲综合网| 日韩av第一页| 国产一区免费| 日韩在线视频观看正片免费网站| 中文字幕无码精品亚洲35| 女女同性女同一区二区三区按摩| 97精品一区二区视频在线观看 | 日韩亚洲在线观看| 亚洲成熟丰满熟妇高潮xxxxx| 美女亚洲精品| 日韩在线播放一区| 亚洲**2019国产| 国产精品综合不卡av|