Releases: forio/epicenter-js-libs
More cometd notifications
Features:
- The World Service now has a
load
method, similar to theRun
andData
services. - We now have a 'presence channel' to get online/offline notifications for multiplayer worlds. Usage:
var presenceChannel = cm.getPresenceChannel(worldObject);
presenceChannel.on('presence', function (evt, notification) {
console.log(notification); //Notification will be an object with { userId: StringID, online: Boolean }
});
This is currently implemented all client-side, and data will be correct to within 24 seconds. An upcoming epicenter update will make this happen much faster.
- You can now subscribe to Data API updates through the cometd channel. Usage:
var datachannel = cm.getDataChannel(collectionName);
datachannel.subscribe('', function (data, meta) {
//data is the actual content added, meta is of the form {path: nestedPathOfContentAdded, subType: 'new/update/delete', date: date}
date
}
You can only subscribe to top-level items (i.e. collections) currently, so the first parameter to subscribe
should always be blank.
Bugs:
- RunManager: Fixed a bug with invalid session-cookie-names with the Persistent Single Player strategy
Bug fixes
Bug Fixes:
- Strategy creation was broken in the last release due to an invalid cookie name. If you use 1.4.1 you'd have always gotten a new run.
- Login component now properly re-enables the login button on invalid logins
- Fixed issue in assignment component where UI broke if the user didn't have a last name
- Fix bug in
newRunForWorld
in the World Service
Misc. Bug fixes
Features:
- Added
load
to F.Service.World. This works like theload
on other services; use when you have a world id and want to construct a World Object with that - This release adds a
components
folder to the distribution. The only production-ready component is thelogin
component, but more components will be added later - components are meant to be "plug and play" applications using the libraries to solve common use-cases.
Bug Fixes:
- Fixed issue where
group
wasn't being sent as a scope to the Run Service by some strategies - World Service now takes in
account
andproject
from the url if not provided explicitly on instatiation - The
ChannelManager
has now been updated with better jsdocs
v1.4.0
Features:
- Added Member (F.service.Member) and State (F.service.State) services. This is mostly for internal use by other services, but use 'em if you need 'em.
WorldManager
now allows deleting/ resetting the run associated with the World- If you've been using the
AuthManager
onlocalhost
you might've noticed issues with cookies. There's no good way to handle cookies withlocalhost
so the recommened way to develop is to change your vhosts to point localhost tolocal.forio.com
and use that instead. If you do this, all requests will now automatically be routed toapi.forio.com
without having to specify it under theserver
tag. - Slightly better validation and error messages for the World service and the WorldManager.
Bug fixes:
- Sourcemaps should now work as they should, and are also bundled separately from source-files. Thanks to conversion from browserify2->browserify + uglify.
- The
AuthManager
was not passing an authorization header to the Member API. Epicenter tightened permissions, so this broke. If you've been having login issues this is the version to use. - The
game
REST Endpoint is now calledworld
. This change should not impact any simulations using the libraries, except that runs created with older games, will no longer show up through the libraries.
World API & Multiplayer support
A run is a collection of end user interactions with a project and its model -- including setting variables, making decisions, and calling operations. For building multiplayer games you typically want multiple end users to share the same set of interactions, and work within a common state. Epicenter allows you to create "worlds" to handle such cases.
The World API Adapter allows you to create, access, and manipulate multiplayer worlds within your Epicenter project. You can use this to add and remove end users from the world, and to create, access, and remove their runs. See http://forio.com/epicenter/docs/public/api_adapters/generated/world-api-adapter/ for additional background and documentation of methods and configuration options.
The World Manager provides an easy way to track and access the current world and run for particular end users. See http://forio.com/epicenter/docs/public/api_adapters/generated/world-manager/ for additional background and documentation of methods and configuration options.
Authentication
This release provides support for managing user authentication, especially for end users of authenticated Epicenter projects.
Authentication API Service
The Authentication API Service provides methods for logging in and logging out. On login, this service creates and returns a user access token. (User access tokens are required for each call to Epicenter.) Details available here: http://forio.com/epicenter/docs/public/api_adapters/generated/auth-api-service/
Authorization Manager
The Authorization Manager provides an easy way to manage user authentication (logging in and out) and authorization (keeping track of tokens, sessions, and groups) for projects. Details available here: http://forio.com/epicenter/docs/public/api_adapters/generated/auth-manager/
Login Component
In addition to the epicenter.js library itself, the Epicenter JS Libs project now includes reusable components. These HTML, CSS, and JS files are templates you can use to perform common actions. They can be copied directly to your Epicenter project, often without modification.
The Login Component provides a login form for team members and end users of your project. Includes a group selector for end users that are members of multiple groups.
Details are available in GitHub: https://github.com/forio/epicenter-js-libs/tree/master/src/components/ and also in the Epicenter documentation: http://forio.com/epicenter/docs/public/api_adapters/#components
Run Manager bug fixes
Bug fixes for the Run Manager
v1.1.0
Epicenter.js now includes the Run Manager and the Scenario Manager
Documentation & Tests pending. Will be upgraded from "pre-release" after that.
Transport options bug fix release
- Build process generates
epicenter.js
(un-minified concatenated file) in addition toepicenter.min.js
- Fixed bug where transport option for
complete
was not being passed through on Run API Service - You can now set default transport options for Run Service and over-ride on a per-call level. For e.g.,
var originalComplete = sinon.spy();
var complete = sinon.spy();
var rs = new RunService({account: 'forio', project: 'js-libs', transport: {complete: originalComplete}});
rs.create('model.jl', {complete: complete});
originalComplete.should.not.have.been.called;
complete.should.have.been.called;
Cookie changes
Changed the default token to epicenter.project.token
from epicenter.token
. This is to prevent conflicts for users who're logged into Epicenter through the manager. Use cases:
User logged into Epicenter, but not into project:
-
epicenter.token
is set by Manager and passed along to all the APIsUser logged into Epicenter, and also into project:
-
epicenter.project.token
is also sent as an Authorization header, which overridesepicenter.token
. In other words, project privileges override default epicenter privilegesUser not logged into Epicenter, but logged into project:
-
Authorization header is sent and respected