ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Facebook Flash APIand Social Game Developmenthttp://fb.me/tempofeng
AgendaGameletOur ExperiencesTips & TricksFlashSocialFacebook / FlashQ & A
Gamelet: Our Experiences
Gamelet
Web Traffics
GameletPublished 17 Games15 Real-Time Synchronized Games2 Social Games11 Employees6 Engineers3 Arts
GameletBandwidth60M/MonthOnline Users8000 users (max)Aggregated MAU400K (down from 800k)
ServersWeb Serversapache -> tomcat2xDell PE R610 (1 Master-N Slave)2xI5520, 6GB, SAS HDsStatic Files Servers1xPCReal-time Socket ServersJava/Mina/ActiveMQ3xDell PE R6101xI5520, 6GB, SAS HDs
ServersDB ServersMySQL2xDell PE R710 (1Master, 1Standby)2xI5530, 32GB, SAS HDsCassandra2xDell PE R7102xI5530, 32GB, SAS HDs
Tip & Tricks - FlashDevelopment EnvironmentArt/Developers WorkflowPerformanceFighting CheatersLoadercrossdomain.xml
Development EnvironmentDevelopersFlash(Flex) BuilderFlex ComponentsSlowRam/CPU/SSDOpen Too Many ProjectsArtsIllustrator/Photoshop/Flash
Arts/Developers Workflow.asDesignersProgrammers
Versioning Graphics AssetsConfusing!SVNDevelopment Modecar.fla, airplane.flaProduction Modecar.fla, airplane.fla -> vehicle_v00.swf
PerformanceMonitoring FramerateDon¡¯tAlpha, ׃Ðι¤¾ßLarge BitmapParent/child MovieclipUsingSprite instead of Movieclip
PerformanceSlow MovieclipcacheAsBitmapRotate, Scale, ¡­AnimationSlicerhttp://blog.vandenoostende.com/2008/animationslicer/ProfilerMemory Leak
Fighting CheatersManipulating MemoryIntercepting PacketsAcceleratorsDouble LoginManipulating CodeBuilding a BotFake Accounts
Manipulating Memory
Manipulating MemoryCheat Enginehttp://www.cheatengine.org/Encode Critical DataHeap DataScores, Weapon, ¡­
Manipulating Memoryclass SecureInteger{int number;int checksum;	public void setNumber(int number)	{this.number = number;this.checksum = md5(number);	}	public intgetNumber()	{		if(verifyMd5(number, checksum))			return number;		else			throw new SecurityException();	}}
Intercepting PacketsAdd SignatureEncodeSSHproprietary PKI solution
´¡³¦³¦±ð±ô±ð°ù²¹³Ù´Ç°ù²õ±äËÙ¾«Áé³ó³Ù³Ù±è://³Ù·É.±¹°ù²ú°ù´Ç³Ù³ó±ð°ù²õ.³¦´Ç³¾/²õ±è±ð±ð»å±ð°ù/
AcceleratorsUse Server Time EverywhereDetectingCalculate the difference between client time & server timeNetwork latency will be hard to predict
Double LoginLogout Previous Logined UserFlash LocalConnectServer Notification
Manipulating CodeObfuscatorDynamically Download Encoded SWFLoader.loadBytes(bytes)
Building a BotMonitoringMonitoring All Service InterfacesAOP, AnnotationLimiting resource updateLimit by Time PeriodLimit by User Roles, LevelsGuests, Unregistered Users
Fake AccountsLimit Help from Friends
LoaderLoading Static FilesAlways Retry!
crossdomain.xmlcrossdomain.xmlAccess Remote FilesSecurity.allowDomain()SWFs from Other Domain to Access Meloader.loaderContext = new LoaderContext(true, ApplicationDomain.currentDomain)Access Remote Image Files without crossdomain.xml
Tips & Tricks ¨C Social GamesGame DesignViral ChannelsData Storage
Game DesignBeautiful!Gifting is the New PokeDon¡¯t Punish UsersRepresent Relations between Friends
Viral Channelsmonfriends
Data StorageRead:Write = 1:1MySQLTransactionalData Growing SlowlyCassandraKey/ValueData Growing Fast
Tips & Tricks ¨C Facebook / FlashFacebook API / Graph APIChinese InputInvite/Request without Page Reloaded
Facebook API & Graph APINo Plan of UpdatingRecommendCalling Javascript API from Flash ExternalInterfaceif (!ExternalInterface.available)
{
return;
}
ExternalInterface.call("lumixInviteFriends", invite, title, type, content, url, label, condensed, toUid(username));wmode = ¡®opaque¡¯
wmode = ¡®window¡¯
Chinese InputFlash 9/10Only wmode = ¡®window¡¯ Can Input ChineseWill Hide javascript WindowsFlash 10.1wmode = ¡®opaque¡¯ can input Chinese in IE/Firefox
Flash 9,10 + wmode = ¡®window¡¯Move or Hide the Flash
Invite/Request without Page Reloaded
Step 1: Dynamically Add an <iframe><iframe id='inviteFriendsIframe' name='inviteFriendsIframe' src=/slideshow/facebook-flash-api-and-social-game-development/5025454/& scrolling='no' frameborder='0' width='760' height='800'></iframe>Step 2: <fb:request-form> in <iframe><fb:serverFbml><fb:request-form action="closeFbmlIframe.do" invite=""  type="" ¡­>¡­</fb:request-form></fb:serverFbml>
Step 3: Close the <iframe> by Javascript<script type="text/javascript">$(document).ready(function(){window.parent.onFbmlIframeClosed();});</script>

More Related Content

Facebook flash api and social game development