shooter
shooter copied to clipboard
Syncing the map with the server by FTP
I swapped network work and map loading so that the game would first try to request a map from the server, and then only draw it.
The FTP server is configured separately, for example using vsftpd. The server should be configured so that anonymous users are directed to a directory that has a folder "current_map", in this folder there should be a file of the current map
Гляну ревест, как буду у компьютера. Идея хорошая, но использовать сишные указатели я бы не стал. Посмотрим, что с этим можно сделать :)
Я всё не мог понять о каком указателе речь... Для такого же есть передача по ссылке.
client->requestMap(clientIp, current_map);
//...
void ShooterClient::requestMap(std::string clientIp, std::string ¤t_map)
//...
current_map = map_path;
//...
void requestMap(std::string clientIp, std::string ¤t_map);