//method thad downloads all images, for all players and saves as files private void DownloadPLayersAvatars(List <int> playersNumbers) { IMakaoGameHostService proxy = factory.CreateChannel(); foreach (int item in playersNumbers) { Stream responseStream = proxy.DownloadAvatarImage(item); EngineHostHandler.SaveAnImage(responseStream, item); } }
//internal method for sending user's current avatar to the host private static void SendAnImage(MemoryStream avatarMemoryStream, int playerNumber, IMakaoGameHostService proxy) { //uploading an avatar image bool streamSuccess = SendAvatarToHost(avatarMemoryStream, playerNumber, proxy); //if image succesfully saved in host, download it back and save if (streamSuccess) { Stream downloadedImage = proxy.DownloadAvatarImage(playerNumber); SaveAnImage(downloadedImage, playerNumber); } }