mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-01 06:01:38 +00:00
WebInterface reference implementation
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
function Register(name, wsi, api) {
|
||||
wsi.Register(name,
|
||||
function(request) {
|
||||
api.Call(name, request.params)
|
||||
.then(function(value) {
|
||||
wsi.Send(request, value);
|
||||
})
|
||||
.catch(function(reason) {
|
||||
wsi.SendError(request, reason);
|
||||
});
|
||||
}, true);
|
||||
}
|
||||
|
||||
var RegisterEQW = function(wsi, api) {
|
||||
Register('EQW::IsLocked', wsi, api);
|
||||
Register('EQW::Lock', wsi, api);
|
||||
Register('EQW::Unlock', wsi, api);
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
'Register': RegisterEQW
|
||||
}
|
||||
Reference in New Issue
Block a user