SimCity Social

SimCity Social is an online social-network game created by Playfish (a part of EA) launched in 2012. It's gameplay is very similar to CityVille and other city-building social networking games, and is built on the Playfish standard flash platform, using a custom RPC protocol similar to The Sims Social and Hotel City.

Game Preloader
The flash container that is loaded in the Facebook canvas iframe is in fact a pre-loader application, which contains the logic to download the actual game engine and other image and sound assets. URLs to the Resource Manifest and other parameters are passed in to the pre-loader as flashvars.

flashvar Parameters
The iframe URL is typically: https://simcity.game.playfish.com/g/fb/simcity/

Resource Manifest
The Resource Manifest is loaded by the game pre-loader, and is used for estalishing the url and size of various in-game resources, including the GameEngine which contains most game logic. The Resource manifest is a plain XML file in the format:     

RPC Packet Format
SimCity Social uses a binary RPC format similar to most other Playfish games. All messages are sent over a HTTP POST to the URL specified by the pf_url flashvar, typically http://simcity.game.playfish.com/g/rpc/simcity. Packets sent are usually batched up, containing many smaller packets of different types. Standalone packet bodies start with a NULL byte (00) followed by a 1-byte message type (or 0xFF for a batch) and then the session id, followed by the message-specific bytes. The Session ID and other strings are encoded in Length + Data format, where the length is encoded as a uintvar32 (see below).

Uintvar32 encoding
Decompiled ActionScript code: