private void Create(HydraRequest request)
        {
            List <IHydraItem> items = HydraItemDeserializer.DeserializeAll(request.PostData);

            HydraResponse response = new HydraResponse(Connection, new HydraInt64(1));

            response.Send();
        }
        private void Update(HydraRequest request)
        {
            List <IHydraItem> items = HydraItemDeserializer.DeserializeAll(request.PostData);

            HydraInt64   profileId = items[0] as HydraInt64;
            HydraHashMap map       = items[1] as HydraHashMap;

            HydraResponse response = new HydraResponse(Connection, new HydraNone());

            response.Send();
        }
        private void Create(HydraRequest request)
        {
            List <IHydraItem> items = HydraItemDeserializer.DeserializeAll(request.PostData);

            HydraInt64   profileId   = items[0] as HydraInt64;
            HydraHashMap map         = items[1] as HydraHashMap;
            HydraBinary  imageBinary = items[2] as HydraBinary;

            Game game = Game.GetFromApiKey(request.ApiKey);

            string category = ((HydraUtf8String)map.Items["category"]).Value;

            if (category == "characters")
            {
                Character character = new Character(game, profileId, map, imageBinary);
                character.Save();

                Console.WriteLine("Saved new character. ID {0}", character.ID);

                HydraResponse response = new HydraResponse(Connection, new HydraInt64(character.ID));
                response.Send();
            }
            else if (category == "screenshots")
            {
                Screenshot screenshot = new Screenshot(game, profileId, map, imageBinary);
                screenshot.Save();

                Console.WriteLine("Saved new screenshot. ID {0}", screenshot.ID);

                HydraResponse response = new HydraResponse(Connection, new HydraInt64(screenshot.ID));
                response.Send();
            }
            else
            {
                throw new Exception("Unknown category? " + category);
            }
        }