Wednesday, October 31, 2012

i50

i49 to i50

New Features

[CHAM-17] Enabled getting of player id from player name to lua.

Usage is id = player.get_player_id_by_name("somename"). Returns null if not found.

[CHAM-16] Added lua_db function escape that makes a string mysql safe (beta).

When forming a database query in lua, using input that comes from a user you should use the new escape function to ensure that you do not open yourself up to SQL injection attacks. Typical useage looks like this

lua_db:query( string.format(
"SELECT * FROM BLAH WHERE key=%s",
lua_db:escape("This will be safe'; TRUNCATE TABLE BLAH;")
) )

[CHAM-15] Added lua to_json and from_json functions (beta).

Functions have been added to assist with working with JSON in lua.

Converting a lua table to JSON is easy.

local s
s = to_json( { a=1 } )
-- now s = '{"a":1}'
s = to_json( { "hello", "bye" } )
-- now s = '["hello","bye"]'

This handles tables, strings, numbers, explicit null values, true and false. However there are a few issues to be aware of.

  • Since lua does not differentiate between arrays and dictionaries you should not try to convert mixed dictionaries.
  • An empty table converts to {} rather than []
  • lua dictionaries support arbitrary keys. However if you convert a table with keys that are not strings you may get an error or invalid JSON.
  • setting a value to null in a table removes that entry from the table, so the following may not do what you expect.
local v = {bar=1}
v.foo = null
s = to_json(v)
-- s = '{"bar":1}' rather than '{"bar":1,"foo":null}'

Converting from JSON is easy too.

local v
v = from_json( '{"a":1}' )
-- now v = { a=1 }
v = from_json( '[1,2]' )
-- now v = {1,2}

Some of the caveats from above still apply:

  • from_json( '{"a":null}' ) will produce an empty object.

[CHAM-14] Added basic network calls functionality to lua (beta).

It is now possible to make network calls to other services from within lua. However as this is done in an asynchronous manner there are a few limitations. Starting the request is done with the lue_network:request function. This requires the url, the callback to call, and some optional extra user data to pass to the callback.

Handling the response must be done in a callback function which gets passed a data object containing:

  • data.url The request url
  • data.user_data Some extra data passed to the request
  • data.response_code The http request response code - typically 200 for success, 40x for error
  • data.response The response body

The code to make calls looks like this:

function nw_callback( data )
print( data.url )
print( data.user_data[0] )
print( data.response_code )
print( data.response )
end

--Invoking the network call
lua_network:request(
"http://api.roar.io/mafp/info/ping/",
nw_callback,
{"some user data","yep"}
)

A limitation of the current method is that it only supports GET operations, not POST or other methods.

Bug Fixes

No bug fixes in this release

i49

i48 to i49

New Features

No new user-facing features this release.

Bug Fixes

Fixed bug where player data could get lost on publish.

i48

i47 to i48

New Features

[???] Added new get_current_timestring lua function

This function returns a string representation of the time in YYYY-MM-DD HH:MM:SS format This format has the advantage that ordering by time is the same as ordering the strings lexicographically.

Example usage is:

local timestr = get_current_timestring()
if timestr < "2013-01-01 00:00:00" then 
  print("Its still 2012")
end

Bug Fixes

No bug fixes in this release.

i47

i46 to i47

New Features

[CHAM-5] Added support to getting json formatted results from scripts/run and scripts/run_auth

The scripts/run and scritps/run_auth functions can now return JSON rather than XML. To make this happen just add format=json to the POST arguments.

Bug Fixes

[CHAM-4] Fixed google friends failing due to stricter json requirements

The changes to JSON handling in the core libraries [i46 - #1186] caused calls to obtain google friends to fail. These calls are once again working correctly.

[CHAM-3] Login with google causing server slow down.

A missing index of a core table was causing searching for players by google id to be slow. This index has been added and things are once again fast.

Monday, August 20, 2012

i46

i45 to i46

New Features

[#1182] Several server to server communications now use SSL host checking.

This improves the security for integrations with 3rd party components, such as google G+ and facebook.

Numerous performance improvements in the core server

  • [#1185] Calls to facebook are now made by the web layer rather than the core server.
  • [#1186] Switched to using fastjson json library for all the server to web layer communications.
  • [#1187] Switched to more efficient memory allocator in server binary.
  • [#1188] Switched to single event threaded model, rather than one thread per request.

Bug Fixes

[#1167] Appstore entries with empty modifiers no-longer cause javascript errors in the editor.

i45

i44 to i45

New Features

[#????] Added admin scripts

These are callable using scripts/run_admin with the admin_token. They must be whitelisted using whitelist_admin. Note that these scripts do not receive an args.player argument, but do receive others arguments in the same manner as conventional scripts.

[#1172] Added ability for admin to create and login players

This is done though the admin/create_player and admin/login_player functions.

The create_player function requires a name and admin token. It does not set the players password, which must be set using a separate call.

The login_player function requires an admin token, and either a name or player id.

Bug Fixes

No bug fixes this release.

i44

i43 to i44

New Features

[#1155] Added basic urban airship integration

[#1172] Added experimental direct database access to lua scripting.

This is not available by default - contact us if you want access to it.

Usage looks like this:

function luadbtest(args)
  local it = lua_db:query("SELECT id, name FROM Junk")
  local retval = {}
  while not it:is_end() do
    table.insert( retval, { id=it:column_as_string(0), name=it:column_as_string(1) } )
    it:next()
  end
  return 0, retval
end

whitelist("luadbtest")

[#1173] Return player id on login or create

All create or login calls now return the player id.

[#1174] Added google/login_or_create

Since trying to log in or create a player invalidates a google oauth2 code, we have provided an alternative function that first tries to log a player in with the given code, or else creates a new player associated to the corresponding google user.

This call returns the "mode" set to "create" or "login" depending on which method occurred. It also returns the players id and auth token.

[#1175] Added google/token functions.

This call allows the client to get the current users google oauth2 token.

Bug Fixes

[#1176] Players google data is immediately stored.

Player data corresponding to their google account was only getting periodically synced to the database, this is now occurring immediately. One symptom was that in some situations players could not log in immediately after creating an account.

[#1177] Obtaining a users google id now works on tokens with a larger variety of scopes.

Originally we required the application to request the userinfo.profile scope, for the methods we used to obatin a players google id. Applications can now use the gplus.me scope now, and any scope that embeds the users id into the token info.

[#1178] Fixed some runtime warnings from some server code.

i43

i42 to i43

New Features

No new features this release

Bug Fixes

[#1166] Processing of large script objects was slow.

Script objects were getting copied more times than necessary, which was causing a significant slow-down when working with large script objects. The unneeded copies have been removed.

i42

i41 to i42

New Features

[#1165] Can now specify a prefix for the name in google wallet purchases.

A prefix that apears at the start of all google wallet purchases can now be specified in the pannel for controlling google wallet parameters. This can be useful for filtering the transaction log in google wallet if you have more than one application sharing the same wallet.

Bug Fixes

No bug fixes this release

i41

i40 to i41

New Features

No new features this release.

Bug Fixes

[#1157] Player data can now be removed from the leaderboard on player deletion.

Player data for deleted players was not getting removed from some leaderboards due to a permissions issue. The data should now be removed. Existing leaderboards have had this old data removed.

[#1156] Loging in via Facebook and Google is now more reliable.

There was an issue where the login details for a new player were not being made immediately available to the login system, meaning there could be a delay between player creation and next possible login.

The Facebook and Google information is now immediately made avaialble to the login system after create or bind.

Monday, May 14, 2012

i40

i38 to i39

New Features

[#1156] Added support for multiple google app ids

There are some cases where the same google application might be accessed using multiple different application ids. Roar was unable to accept tokens from these games due to only accepting a single application id.

Roar will now accept a space seperates list of application ids, and will accept tokens from any of these ids.

Bug Fixes

No bug fixes this iteration

i39

i38 to i39

New Features

No new features this iteration.

Bug Fixes

[#1151] Fixed logging bug that was generating excess log entries

These extra log entries were consuming large amounts of space on some servers and causing space issues.

[#1152] Empty publishes were failing

Empty publishes (those with no changes) were failing with odd messages about git. These empty publishes are now behaving correctly.

Tuesday, April 24, 2012

i38

i37 to i38

New Features

No new features this iteration.

Bug Fixes

[#1149] Correctly handle facebook friends without names

Sometimes facebook friends come back without a name node. These people really seem to have no associated name on their facebook page also. Roar was expecting a name field, and failing on such friends.

We now just return an empty string for the name if the name is missing.

i37

i36 to i37

New Features

No new features this iteration.

Bug Fixes

[#1142,#1143] Deleted players are now removed from leaderboards

Using the admin interface to delete a player was leaving their data in the leaderboards. This old data has been removed and deleting a player will now correctly remove that player from the leaderboards.

i36

i35 to i36

New Features

[#1040] Losing an item now generates a notification

When a player loses an item as either a cost to perform an action, or as part of a script, they recieve a notification. This notification looks like this:

<item_lose ikey='an_ikey' id='12312' />

Bug Fixes

[#1145] Fixed security issue htta was exposing facebook auth tokens.

A default created player using the facebook/create_oauth, was incorrectly fgetting their name set to the oauth tokens value. It is now getting set to a random string instead. Also players with names that apear to be oauth tokens have been renamed.

i35

i34 to i35

New Features

[#1138] Added tags to chrome web store entries

Chrome web store entries now have tags in the same style as shops. These can be used for client side filtering and sorting of the entries.

Bug Fixes

[#1140] Chrome web store entries now render correctly when having no modifiers.

When a entry was created with no modifiers, it would fail to render in the editor UI. Such entries now render correctly.

Monday, March 5, 2012

i34

i33 to i34

New Features

[#621] Added admin/increment_stat

This works just like admin/set_stat, except it increments or decrements the corresponding stat.

[#1081] Players notified when they gain an item

When a player recieves an item through any means they will get a notification in the server block that looks like this:

<item_add item_id="1478812237" item_ikey="item_ikey_1"/>

Bug Fixes

None

Wednesday, February 29, 2012

i33

i32 to i33

New Features

[#1111] Implemented google/friends call

Note that this requires the developer have access to the gplus games api, and the user to have granted the right permissions.

[#1114] Player create functions return an auth_token

This removes some of the duplication of the old create/login workflow, as once a player is created the application will have an auth_token ready to use.

Bug Fixes

[#1121] Facebook offerwall was not granting currency

No currency was getting awarded on completion of the offer, even though the offer seemed to succeed.

[#1120] gplus information was potentially uninitialised in some cases

No live example of tis kind of data corruption has been noted.

[#1112,#1113] Scripts (and some other calls) can no longer use old auth_tokens

Scripts and some other functions were using an internal cache for auth_tokens that was not getting refreshed at an appropriate time. The cache is now update any time a players auth_token may have changed.

Tuesday, February 21, 2012

i32

i31 to i32

New Features

[1090] Now supporrts google login functions using oauth2 tokens

These functions are google/create_user_token, google/bind_user_token and google/login_user_token. These functions accept an oauth2 token, which are often exposed by the google APIs. The functions are equivalent to the oauth2 code functions google/create_user, google/bind_user and google/login_user.

[1054] Google chrome web store support added

Roar now support integration with the google chrome web store. To use this:

  1. Obtain google checkout and webstore accounts.
  2. Configure the webstore account callback to be http://api.roar.io/GAME_NAME/chrome_web_store/callback/
  3. Enter the details in the roar configuration page.
  4. Add entries to the google web store from the roar UI.
  5. Client will call chrome_web_store/list/ to obtain the list of items that can be purchased. Each of these contains a jwt field, which will be passed to the google web store API for purchase.

More details can be found here http://support.roarengine.com/kb/building-blocks/google-chrome-webstore-integration. A full example with of the UI integration can be found at https://github.com/mikeando/roar_minimal

Bug Fixes

[1103] Deleted achievements were crashing the server

Tuesday, February 14, 2012

i31

i30 to i31

There are no user facing changes in this version

Monday, February 13, 2012

i30

i29 to i30

New Features

[#1031] Roar now supports the Facebook Offer Wall

To integrate the Facebook in-app currency offer wall into your application you must follow these steps:

  • From the Facebook configuration UI: et the currency that you wish to use; and set the Facebook credits callback to api.roar.io/gamename/admin/fb/ (using the correct game name and server for your game).

  • Serve a currency icon and a currency info file from one of your servers. The content of the info file should look like this:

<html>
<head prefix="og: http://ogp.me/ns#
fb: http://ogp.me/ns/fb#
fbpayment:http://ogp.me/ns/fb/fbpayment#">
<meta property="fb:app_id" content="[YOUR APP ID]" >
<meta property="og:type" content="fbpayment:currency" >
<meta property="og:url" content="[URL OF THIS FILE]" >
<meta property="og:title" content="[NAME OF YOUR CURRENCY]" >
<meta property="og:description" content="[DESCRIPTION OF THIS CURRENCY]" >
<meta property="og:image" content="[URL TO AN IMAGE]" >
<meta property="fbpayment:rate" content="[CONVERSION RATE OF FB INTO YOUR CURRENCY]" >
</head>
</html>
  • Display the offerwall from your app, like this: (this example uses jQuery)
$('#YOUR_BUTTON').click( function(){  var obj = {    method: 'pay',    action: 'earn_currency',    product: '[URL OF CURRENCY INFO PAGE]'  };  FB.ui(obj, function(data) { /* handle response */ } );});

Bug Fixes

[#1087,1086] Saving old games configuration no longer generates a warning/error

Some old games that had not been updated were generating an error or warning when saving their configuration. In most cases the configuration was getting saved correctly, so this was mostly a cosmetic issue.

[1084,1083] Improved Facebook credits handling

The Facebook credits handling code relied on some Facebook features that were soon to be deprecated. The handling code has been updated to behave in compliance with the latest Facebook API.

i29

i28 to i29

New Features

Bug Fixes

[#1080] Friends lists are saving correctly again.

Some previous versions (i25, i26) were not saving friends back to the database correctly. These versions had only been rolled out to a few users, so this will not affect most users.

i28

i27 to i28

New Features

[#1033] Added support for tracking XP in leaderboards

XP can now be tracked as a leaderboard by enabling the XP leaderboard from the main page of the Roar Engine configuration UI. XP leaderboards function the same way as leaderboards for other stats. The XP leaderboard has a hardcoded id of 5001.

[#1044] Listing the available leaderboards now returns the resource_id

While this is mostly for internal tools, some developers may find it useful for use from their game client.

Bug Fixes

[#1041] Configuration UI no longer generates a large number of event warnings

[#970] Fixed some potential server crashes when reading configuration files.

Monday, January 16, 2012

i27

i26 to i27

New Features

[#1037] Beta support for multiple stat leaderboards

Multiple-Stat leaderboards are a new feature that is being tested with select developers. These are leaderboards in which you can track two (or more) independent player stats on the same leaderboard.

For example a player might have three "characters", each with their own "strength" attribute. We could model this as three player stats str_1, str_2 and str_3. A leaderboard for the strongest character could not have been created using the old leaderboard system. However, adding str_1, str_2 and str_3 to a multi-stat leaderboard will allow the strongest characters to be tracked.

For now there is no publicly accessible UI for this. Please contact us if you need access to multi-stat leaderboards.

Bug Fixes

[#1023] Friends invite id is returned with friend notifications.

Friend invite notifications had stopped returning the invite id. This is now fixed and friend invite notifications now return the invite id again.

Tuesday, January 10, 2012

i25

i24 to i25

New Features

[#1017] Added Google authentication for players

The functions google/create_user google/login_user and google/bind_user have been added. They all accept a code value that must be obtained by the caller from Google. The usual way to obtain such a token is by forwarding the user to a location like:

https://accounts.google.com/o/oauth2/auth?
   response_type=code&
   redirect_uri=YOUR_REDIRECT_URL&
   client_id=YOUR_CLIENT_ID&
   scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.me&
   access_type=offline

This will return the code in the browser URL after the login and redirect.

You will need to configure the Google authentication on the settings page.

For your convenience (and to negate the need to obtain codes twice) the google/create_user call returns a roar auth_token, so you do not need to subsequently call google/login_user

[#1015] In lua p:notify("key",value") adds entries into the server block

Scripts can add to the player notifications returned in the server XML chunk.

This means scripts can now get information to players from Regen scripts and Script modifiers as well as allowing functions to be more modular.

Calls should look like this:

args.player:notify("some_key","1234;4321;abc")

Response will look like this

<server>
<script key="some_key" value="1234;4321;abc" />
</server>

Bug Fixes

[#232] Improved seeding and generation of random numbers from lua with math.random()

[#1009] Friends are now unlinked correctly on player deletion

i26

i25 to i26

New Features

[#1004] Playhaven integration available under 'Services'

Integration for the Playhaven (www.playhaven.com) real-time mobile game marketing platform has been added. It is available under the Services section of the game configuration UI.

Bug Fixes

[#917] Duplicate notifications should no longer occur

In certain situations players could receive the same notification multiple times. (This included script notifications, friend notifications and gift notifications). They should now correctly only receive one notification.

[#1026] Script requirements now save correctly

Script requirements were not saving correctly in the UI and were disapearing sporadically. They should now be saving correctly.