minigod / node-gbxremote Goto Github PK
View Code? Open in Web Editor NEWThis project forked from baalexander/node-xmlrpc
JavaScript port of GbxRemote to communicate with ManiaPlanet / TrackMania servers with Node.js.
License: MIT License
This project forked from baalexander/node-xmlrpc
JavaScript port of GbxRemote to communicate with ManiaPlanet / TrackMania servers with Node.js.
License: MIT License
ManiaPlanet Server does not support pipelining.
Ie: The server will close the connection (no errors) if a query is sent before the response for the previous query is received. Sending too many queries (too fast) will therefore not work.
Solution?
Stack up queries. Then on process.nextTick()
, do a system.multicall
, and empty the stack. If it's only one query in the stack, do a normal query (to minimize overhead).
EDIT:
That solution will only work if the response for the previous query is received. After this, you can still use the stack, but instead of doing the multicall and emptying of the stack on nextTick
, it has to be on data
. (all data loaded, or just something?)
EDIT 01.04.2013:
I think I was wrong about ManiaPlanet not supporting pipelining. However, stacking up queries, and sending them on next tick with system.multicall
would most likely improve performance.
@Gissues:{"order":50,"status":"backlog"}
Would be great to have some kind of multicall support. Currently it doesn't right?
Floats from scripted modes are converted to number, this will loose the decimal notation (with zero after it.).
Will be a problem when using ScriptModeSettings:
receiving from gbx:
{ S_AutoManageAFK: false,
S_AFKIdleTimeLimit: 90000,
S_UseScriptCallbacks: true,
S_NeutralEmblemUrl: '',
S_ScoresTableStylePath: '',
S_MatchmakingAPIUrl: 'https://matchmaking.maniaplanet.com/v8',
S_MatchmakingMode: 0,
S_MatchmakingRematchRatio: -1,
S_MatchmakingRematchNbMax: 2,
S_MatchmakingVoteForMap: false,
S_MatchmakingProgressive: false,
S_LobbyRoundPerMap: 60,
S_LobbyMatchmakerPerRound: 6,
S_LobbyMatchmakerWait: 2,
S_LobbyMatchmakerTime: 8,
S_LobbyInstagib: false,
S_LobbyDisplayMasters: true,
S_LobbyDisableUI: false,
S_MatchmakingErrorMessage: '�An error occured in the matchmaking API. If the problem persist please try to contact this server administrator.',
S_MatchmakingLogAPIError: false,
S_MatchmakingLogAPIDebug: false,
S_MatchmakingLogMiscDebug: false,
S_ProgressiveActivation_WaitingTime: 180000,
S_ProgressiveActivation_PlayersNbRatio: 1,
S_Mode: 0,
S_TimeLimit: 60,
S_TimePole: 15,
S_TimeCapture: 1.5,
S_WarmUpDuration: 90,
S_MapWin: 2,
S_TurnGap: 2,
S_TurnLimit: 15,
S_DeciderTurnLimit: 20,
S_QuickMode: false,
S_UseLegacyCallback: false,
S_WarnWhenSpectating: false,
S_UsePlayerClublinks: false,
S_ForceClublinkTeam1: '',
S_ForceClublinkTeam2: '',
S_DisplaySponsors: true,
S_RestartMatchOnTeamChange: false,
S_Practice: false,
S_PracticeRoundLimit: 3,
S_TurnWin: 9,
S_UseDraft: false,
S_DraftBanNb: 4,
S_DraftPickNb: 3,
S_NbPlayersPerTeamMax: 3,
S_NbPlayersPerTeamMin: 2,
S_DisplayRulesReminder: true }
Error when changing one value and query the SetModeScriptSettings:
XML-RPC fault: Wrong setting type for 'S_MatchmakingRematchRatio'
Error: XML-RPC fault: Wrong setting type for 'S_MatchmakingRematchRatio'
Type according to ManiaPlanet Docs:
http://doc.maniaplanet.com/dedicated-server/matchmaking.html#Dedicated-server-configuration
Hi,
I'm facing with what I will call an issue with your gbxremote's lib.
First of all, I'd like to say that I'm not familiar with promises. I understand the theory but never coded with it.
I have this code :
const gbx = require("gbxremote");
module.exports = {
setServerName: setServerName
};
/*
* - EXPORTED FUNCTION -
* Set the server's name to a server
* @param {string} host
* @param {integer} xmlrpc_port
* @param {string} admin_password
* @param {string} server_name
* @param {function} cb
* @returns {callback}
*/
function setServerName(host, xmlrpc_port, admin_password, server_name, cb) {
const client = gbx.createClient(xmlrpc_port, host);
client.on('connect', function () {
client.query('Authenticate', ['Admin', admin_password]).then(function (res) {
if (res === true) {
// Set the name of the server
client.query('SetServerName', server_name).then(function (res) {
if (typeof cb === 'undefined') {
return cb(null, true);
}
}).catch(function (err) {
if (typeof cb === 'undefined') {
return cb("Can't change the server name", true);
}
});
}
}).catch(function (err) {
if (typeof cb === 'undefined') {
return cb("Authent err: " + err, true);
}
});
}).on("error", function (err) {
if (typeof cb === 'undefined') {
return cb("Err: " + err, true);
}
});
}
When I execute it here is what I have :
Err: Error: getaddrinfo ENOTFOUND trackmania_1 trackmania_1:undefined ## --- console message display with my code
(node:2298) UnhandledPromiseRejectionWarning: undefined
(node:2298) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2298) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
My server is not launch. I wanted to test this case (it can be for another reason, like the "xmlrpc_allowremote" parameter set to 'false') and it is not what I expected.
Did I miss something in my code or is it really an issue ?
Thanks !
Seb
As the title says, gogo with promise pls
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.