2019年11月7日 星期四

從前端看世界-要學那一套?

前端的世界裡有三大派(框架)

Angular 角度的 (google開發)
React 反應 (facebook開發)
Vue 視圖 (待在Angular 工作的大陸工程師:尤雨溪開發)


那一派比較好用?要學那一套?
從技術面很難做出決定,很難只從單一幾個項做出決擇。
那怎麼選呢?直接看你住那來做選擇,住及工作在歐美地區學Angular 或React ,反之學Vue。
跟著世界的情勢走。






2019年6月27日 星期四

facebook 即時遊戲 本機端測試


即時遊戲 本機端測試需要二個東西
1.透過 npm安裝 http-server 套件


npm install -g http-server

2.SSL



下載openSSL
https://slproweb.com/products/Win32OpenSSL.html

我的是win7所以下載檔案
Win64 OpenSSL v1.1.0k

安裝完會在C:\OpenSSL-Win64\bin
openssl.exe

接下來在




cd path/to/my/game/
openssl genrsa 2048 > key.pem
openssl req -x509 -days 1000 -new -key key.pem -out cert.pem

 Country Name (2 letter code) [AU]:TW                                                   //國碼臺灣是 TW
 State or Province Name (full name) [Some-State]:Taiwan R.O.C                           //國名臺灣填 Taiwan
 Locality Name (eg, city) []:Taipei                                                     //地名
 Organization Name (eg, company) [Internet Widgits Pty Ltd]:FreeBSD Personal Reserach   //組織單位名稱
 Organizational Unit Name (eg, section) []:FreeBSD Personal Reserach                    //部門名稱
 Common Name (eg, YOUR name) []:www.weithenn.org                                        //憑證的名稱 (通常為伺服器 FQDN)
 Email Address []:weithenn@weithenn.org                                                 //申請單位的聯絡信箱
 Please enter the following 'extra' attributes
 to be sent with your certificate request
 A challenge password []: 按 Enter 直接跳過                                             //申請書的密碼
 An optional company name []: 按 Enter 直接跳過                                         //憑證代辦公司的名稱

http-server --ssl -c-1 -p 8080 -a 127.0.0.1


https://www.facebook.com/embed/instantgames/YOUR_GAME_ID/player?game_url=https://localhost:8080/index.html


FBInstant.getLocale()
//zh_TW

getLocale
getPlatform
getSDKVersion
getSupportedAPIs
getEntryPointData
player.getID
player.getName
player.getPhoto
context.getID
context.getType
context.isSizeBetween
logEvent
onPause
inventory.unlockItemAsync
matchPlayerAsync
initializeAsync
setLoadingProgress
setSessionData
startGameAsync
player.flushDataAsync
player.getDataAsync
player.setDataAsync
player.subscribeBotAsync
player.getConnectedPlayersAsync
player.getSignedPlayerInfoAsync
context.switchAsync
context.chooseAsync
context.createAsync
context.getPlayersAsync
shareAsync
switchGameAsync
quit
getEntryPointAsync
getLeaderboardAsync
checkCanPlayerMatchAsync
context.isPublicAsync
player.canSubscribeBotAsync
player.getStatsAsync
player.setStatsAsync
player.incrementStatsAsync
postSessionScore
referrals.getCountAsync
updateAsync