Encrypt TMX tilemaps? - cocos2d-iphone

I am using TMX tilemaps (Tiled) in an app I am creating.
I was curious if anyone else has encrypted or changed their tilemaps in a way that a 'malicious' user wouldn't know that the file is a TMX map.
I basically want my TMX to be hidden in a way that anyone opening up the application and inspecting its contents, couldn't open the TMX and change the map in a way that they know were secret items are or change it so that enemies aren't as strong etc... etc.. I gotta keep some secrets in my game :-)

Related

IUIAutomationStylesPattern implementing issue

I am trying to use uiautomation to get a color of an element of paint application.
I can easily access their size and state etc but i cant seem to find a way to get their background color? lets say i want to retrieve the color of the "new" button how do i do that?
https://msdn.microsoft.com/en-us/library/windows/desktop/hh437282%28v=vs.85%29.aspx
Here they did provide a property to retrieve the currentfillcolor property but it says that client application do not implement IUIAutomationStylesPattern interface. But then why did they provide it in the "UI Automation Client Programmers" section?
I have tried it but there is no IUIAutomationStylesPattern type available for me.
Can anyone help me in finding a way to make it work or if there's another way of approaching it?

Who sets the skin? Bungeecord or Spigot

I'm working on a nick plugin for my network. I managed to change the name of the player. Really... It changes everywhere on the spigot server. Eaven other plugins don't get the real name.
But now I stuck in changing the skin of the player and I have one main question... Who sets the skin? Bungeecord or Spigot. In fact that the Bungeecord server is an online server and all the gameservers are offline servers I think that maybe the bungeecord-server is able to change the skin of the player. And in that case... Does anyone have a working method? Because I tryed nearly everything I've found in google.
Thanks alot.
Minecraft 1.8 and higher
The skin comes from the Mojang servers, this skin is fetched by Bungeecord at the moment of when the player logins, and is then passed over the connection to Spigot.
Spigot is then responsible for the sending this players skin to the other players on the servers in the form of a GameProfile object. If we check what this GameProfile object contains, we will see that it contains a signature and a skin data, the signature is generated by Mojang at the moment of skin change ad is based on the skin, and the skin data contains the textures used for the skin and cape. If you want to change the skin, you should register a new Minecraft account with the skin you use (or hopefully find a existing account with the skin), and use his skin data and signatures.
Minecraft 1.7 and lower
In these minecraft versions, the skin is resolved using the player's name. A request is made to http://minecraft.net/skin/<username>.png. This will return a simple png file with the skin contents. If you try this method with people who changed their name in 1.8, it will fail, since this service doesn't recognise the 1.8 usernames.

Retrieve CImage Object from raw image data stored in database as blob data type

I am developing an application where in I am storing .png image to database(SQLite3 used), now as per my requirement, I want the image to be displayed with the ListCtrl Items, so what i need is to Create a CImage object from the blob data retrieved from the database. My Current approach is every-time I want to display the picture I have to write the file to Disk and then fetch it to the listCtrl item image, I want to get rid of this overhead process. All the experts out their need your help. Please point me to the right direction. I am using VS2010 and MFC for my application development, Database used SQLITE-3.
Thanks in advance.
Copy the PNG in a memory block (HGLOBAL).
Use CreateStreamOnHGlobal to get an IStream.
Than use CImage::Load to get it into the CImage object.
There is no need at all to use a disk file.

Saving user's data for my application

I was wondering what would be the correct method for saving all user data for an application I am working on. The application is in QT. The user inputs a lot of data into the application and the data will be different for every user. I want the ability for the user to save all the current data to a file that can be user by the loaded by the application again once the user wants to use it again or use it on another computer running the application.
What would be the correct and best way to do this? Do I need to use xml format? And then use the xmlreader for QT? Or do I just need to create my own file format and just use the stream to just read everything in. The data in the file will need to be labeled, because it will need to put the data in certain spots on the gui. And the user has the option to dynamically create boxes and tabs that hold certain information.
If you need any more information, please let me know.
A short example:
I am not only reading gui locations.
But the contents of those. For
instance. The user is able to create
tabs that contain edit text boxes. And
those tabs are associated with items
that are in a list. When the user
clicks on an item in the list the user
will be presented with a whole set of
new tabs. And each tab has some
editing forms. The file will need to
contain what is in the list, what tabs
the user has created under each item
in that list and the contents of each
tab associated with the tab of each
item in the list.
In essense, yes you'll be creating your own file format, but the actual content can just be XML in whatever scheme you need. Then you can use Qt's built-in XML processing capabilities to pull the heavy lifting of parsing the text (I personally prefer the DOM model, so I use QDomDocument as my base point), and you'll just need to worry about parsing things to and from the individual nodes.
The Qt framework has some great XML samples if I remember correctly that helped me get off the ground almost immediately. Hope they help!
Another great solution is to use internal database implementation (QSQL on top of sqlite). Compared to the xml solution, it might be more versatile (update when needed, can use external keys). Qt has some rgeat examples about using it aas well.
In terms of dependencies, XML solution will require you to use xml and xmlpatterns (if you want to validate stuff), whereas sqlite solution will require QSQL + sqlite plugin. I think that sqlite guarantees atomicity of writing , thus preventing corruption of data (think : the user is killing the app while it's saving).

Saving user's data for my application part 2

My first question was: should I use dom, sax, or sqlite to save the data the user is inputting into my application. The answer I am going with is to use DOM.
My second question is: How should I load the contents of the file into the application when the user decides to open the file? Should it go through the whole file and distribute all the data to the correct spots in the GUI once the user clicks "open" on the file? Or should it only open the stuff up as the user clicks on certain areas?
My third question is: How does qt handle knowing when things have changed? How would i know when the user has changed something and ask them to save the file?
If you do not understand, please let me know and I will try to explain again.
Example:
I am not only reading gui locations.
But the contents of those. For
instance. The user is able to create
tabs that contain edit text boxes. And
those tabs are associated with items
that are in a list. When the user
clicks on an item in the list the user
will be presented with a whole set of
new tabs. And each tab has some
editing forms. The file will need to
contain what is in the list, what tabs
the user has created under each item
in that list and the contents of each
tab associated with the tab of each
item in the list.
Sorry that I posted another question that is similar to my last, but the other question was answered and now I need a new post.
Question 2: This very much depends on how much data you're dealing with. It will be much easier to load everything in one step. If you are expecting complex documents, it might be better to do it incrementally, but I would strongly recommend starting with the simpler approach.
Question 3: Qt does not handle this, except in as far as widgets will fire signals when they are modified. You need to do it, using a model of some sort. You could just use the DOM document directly as the model, although it may help maintainability to abstract the save format. Each change the user makes would cause a change in the model. You will need to detect when e.g. the user edits some text, update your model appropriately and keep track of whether it has changed since the last save.
What do you want to achieve with your solution? If you want to simply set Configuration why not using a simple Ini file (QSettings Class).
I don't know your application, but you should be able to recognise changes (lets say, if the user changed a QLineEdit or hit a radioButton).
There would be also a "sync" method for QSettings, which "rereads" the file you are working with. Qt won't recognise changes itself, you have to do that on your own.