08.09.2019 Views

Progettazione e Sviluppo di un Multiplayer Online Game su Reti Peer-to-Peer

Alma Mater Studiorum Universit`a degli Studi di Bologna Facolta` di Scienze Matematiche, Fisiche e Naturali Corso di Laurea in Scienze di Internet Tesi di Laurea in Laboratorio di Programmazione Internet

Alma Mater Studiorum Universit`a degli Studi di Bologna
Facolta` di Scienze Matematiche, Fisiche e Naturali
Corso di Laurea in Scienze di Internet
Tesi di Laurea in Laboratorio di Programmazione Internet

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5.1. ANTI-CHEATING 109<br />

Figura 5.5: Player A crea <strong>un</strong> proprio Bullet all’interno dell’area consentita<br />

(Cerchio verde, calcola<strong>to</strong> tenendo con<strong>to</strong> degli effetti causati dal Lag); Player<br />

B invece crea il proprio Bullet esternamente, e ques<strong>to</strong> viene interpreta<strong>to</strong><br />

come possibile segno <strong>di</strong> Cheating.<br />

Evidentemente <strong>un</strong> asset<strong>to</strong> <strong>di</strong> ques<strong>to</strong> tipo, se non controlla<strong>to</strong>, si presta ad<br />

essere sogget<strong>to</strong> a problematiche <strong>di</strong> Cheating: infatti da <strong>un</strong>a parte il Player<br />

che ha genera<strong>to</strong> il Bullet può notificare collisioni in realtà non avvenute,<br />

mentre dall’altra il Player possessore <strong>di</strong> <strong>un</strong> Character realmente colpi<strong>to</strong> può<br />

non operare le dovute mo<strong>di</strong>fiche al proprio HP (Figura 5.5).<br />

Una soluzione al primo problema potrebbe essere quella <strong>di</strong> controllare,<br />

<strong>su</strong>lla ricezione del messaggio Collision, che il Bullet coinvol<strong>to</strong> nella pres<strong>un</strong>ta<br />

collisione, esista nel proprio Data Layer e che abbia <strong>un</strong>a posizione ed <strong>un</strong>a<br />

<strong>di</strong>rezione tale da giustificare <strong>un</strong>a collisione con il Character (Figura 5.5).<br />

Per quan<strong>to</strong> riguarda il secondo problema si può procedere nel seguente<br />

modo: quando <strong>un</strong> Bullet appartenente al Player A colpisce il Character appartenente<br />

al B, ci si aspetta che B decrementi il proprio HP e lo notifichi,<br />

au<strong>to</strong>maticamente, a tutti gli altri Player. Parallelamente però, il Player A<br />

può prevedere tale decremen<strong>to</strong> e mo<strong>di</strong>ficando <strong>di</strong> conseguenza il valore del<br />

componente HP relativo al Character colpi<strong>to</strong>, all’interno del proprio Data<br />

Layer. Se il valore <strong>di</strong> HP invia<strong>to</strong> da B ri<strong>su</strong>lterà maggiore, allora si può<br />

sospettare l’utilizzo <strong>di</strong> <strong>un</strong> Cheat. E lo si può eventualmente accertare, dal<br />

momen<strong>to</strong> che ad ogni incremen<strong>to</strong> del valore <strong>di</strong> HP deve corrispondere la<br />

<strong>di</strong>struzione <strong>di</strong> <strong>un</strong> HealthPack.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!