Skip to content

Commit

Permalink
Saco el typedef uint id (al dope y con la implementacion de la thread
Browse files Browse the repository at this point in the history
safe list no hace falta)

Signed-off-by: Tomas Fabrizio Orsi <[email protected]>
  • Loading branch information
lima-limon-inc committed Oct 26, 2023
1 parent 8b36740 commit 587702c
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/server/cliente.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
// No soy FAN de esto, pero mepa que es la mejor manera de estructurar
// el codigo para protejer los recursos
// class Server;
// typedef uint id;

class Cliente : public Thread { //-- Notas Relacion Cliente - Jugador
// class Cliente {
Expand Down
2 changes: 1 addition & 1 deletion src/server/protocolo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void Protocolo::mostrarPartidas(std::vector<std::string> partidasDisponibles) {
//Como diria sisop "Your code here"

}
id Protocolo::obtenerPartidaDeseada() {
int Protocolo::obtenerPartidaDeseada() {
//Como diria sisop "Your code here"
//Tenemos que ponernos de acuerdo en que devolver cuando el cliente
//elige crear una partida nueva
Expand Down
3 changes: 1 addition & 2 deletions src/server/protocolo.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <vector>

//TODO Poner todos los types defs en un header file juntos
typedef uint id;

class Protocolo {
private:
Expand All @@ -18,7 +17,7 @@ class Protocolo {

void mostrarPartidas(std::vector<std::string> partidasDisponibles);

[[nodiscard]] id obtenerPartidaDeseada();
[[nodiscard]] int obtenerPartidaDeseada();

Protocolo(Socket&& socket);

Expand Down
3 changes: 1 addition & 2 deletions src/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ Server::Server(const char *puerto)

std::vector<RepresentacionPartida> Server::getRepresentacionPartidas() {
std::vector<RepresentacionPartida> ids;
id pos = 0;
for (id pos = 0 ; pos < this->partidas.size() ; pos ++) {
for (int pos = 0 ; pos < this->partidas.size() ; pos ++) {
// El dia que tengamos que enviar mas datos, simplemente
// es anadir mas valores al struct
RepresentacionPartida nuevaRepre;
Expand Down
4 changes: 1 addition & 3 deletions src/server/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
#include <vector>
#include "threadSafeList.h"

typedef uint id;

struct RepresentacionPartida {
id ID;
int ID;

operator std::string() const {
return std::to_string(this->ID);
Expand Down

0 comments on commit 587702c

Please sign in to comment.