Ejemplo n.º 1
0
        //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);
            }
        }
Ejemplo n.º 2
0
        //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);
            }
        }