perezpaya / lolfire-source

This is the lolfire.com code. Have fun helping in the development :)
MIT License
23 stars 6 forks source link

Change Main server #4

Closed doctorrapido closed 11 years ago

doctorrapido commented 11 years ago

Hey Your script works with Na and euw very well . But I wanna change base region to Brazil. How can I do that ? is it so hard to do or easy ? I can wait if you are busy. I try to do change something but failed

"BR", "prod.br.lol.riotgames.com", "https://lq.br.lol.riotgames.com/");

Thanks to you

perezpaya commented 11 years ago

I don't know why it's not working, should work adding a new attribute in https://github.com/alexperezpaya/lolfire-source/blob/master/lolrmtp/lol-client.js#L28 & https://github.com/alexperezpaya/lolfire-source/blob/master/lolrmtp/lol-client.js#L34 will try to investigate it

doctorrapido commented 11 years ago

I tried TR server too but it is not working too or I miss something again :) (EUW- NA Working good)

doctorrapido commented 11 years ago

that is the output

Credentials: {"rate":20,"token":"QLgXbYnn4yOl8VsaoKBM7bwgIQdHJUvwLEm1k8UuLpjw6b7xQMAB2nHZlTtdgBtn0UOeZt+FUc4tTvwu-gNNTA==","reason":"login_rate","status":"LOGIN","delay":5000,"inGameCredentials":{"inGame":false,"summonerId":null,"serverIp":null,"serverPort":null,"encryptionKey":null,"handshakeToken":null},"user":"lolrehber21"} Logging in.. Credentials: {"rate":20,"token":"U8HvFL7qZlR6ssr7LZSvYiFtYlINDOaD2wOpyHj72Ry4HuhJuf8YMnHZlTtdgBtn0UOeZt+FUc6xSdBYHwKqwA==","reason":"login_rate","status":"LOGIN","delay":5000,"inGameCredentials":{"inGame":false,"summonerId":null,"serverIp":null,"serverPort":null,"encryptionKey":null,"handshakeToken":null},"user":"lolrehber21"} Logging in.. Credentials: {"rate":20,"token":"u5xGWPDSEmO+VXGFxO6sfRGngHKYRxjauuL7i28jiepC-QVJE7-mj3HZlTtdgBtn0UOeZt+FUc6Zi490X20u7Q==","reason":"login_rate","status":"LOGIN","delay":5000,"inGameCredentials":{"inGame":false,"summonerId":null,"serverIp":null,"serverPort":null,"encryptionKey":null,"handshakeToken":null},"user":"lolrehber21"} Logging in.. Credentials: {"rate":20,"token":"jpXW3ey4d-UHYEJb7GbPNDfs6CaKGQued7my96Z2uOSKfebBxWHURXHZlTtdgBtn0UOeZt+FUc7pUoBsfAfw+A==","reason":"login_rate","status":"LOGIN","delay":5000,"inGameCredentials":{"inGame":false,"summonerId":null,"serverIp":null,"serverPort":null,"encryptionKey":null,"handshakeToken":null},"user":"lolrehber21"} Logging in.. Credentials: {"rate":20,"token":"ZEl3JpI9t0ZbhYnIYecoK0fQTNyHQe+A7X7bScvzdVPIuiTBkxs6XXHZlTtdgBtn0UOeZt+FUc5n-WFDsh2fpQ==","reason":"login_rate","status":"LOGIN","delay":5000,"inGameCredentials":{"inGame":false,"summonerId":null,"serverIp":null,"serverPort":null,"encryptionKey":null,"handshakeToken":null},"user":"lolrehber21"} Logging in.. Credentials: {"rate":20,"token":"PQ69aEZEznOY9KMlojqCWYQbYtSV1XLUKS4lMOg+vlnPLIfWPV6kuHHZlTtdgBtn0UOeZt+FUc6ibQRRwanycA==","reason":"login_rate","status":"LOGIN","delay":5000,"inGameCredentials":{"inGame":false,"summonerId":null,"serverIp":null,"serverPort":null,"encryptionKey":null,"handshakeToken":null},"user":"lolrehber21"} Logging in.. Credentials: {"rate":20,"token":"gZCs5xMIPvaJasiyVVMOCIr-Z9p48Ys9aKIBFF4Wy28OZ5ciyLOfUnHZlTtdgBtn0UOeZt+FUc5tK5YUCw6WTA==","reason":"login_rate","status":"LOGIN","delay":5000,"inGameCredentials":{"inGame":false,"summonerId":null,"serverIp":null,"serverPort":null,"encryptionKey":null,"handshakeToken":null},"user":"lolrehber21"} Logging in.. Credentials: {"rate":20,"token":"jkxMDmqQDgzlfaDGw+C57fo-EIIR6rMlcsWrBTe649eEPsdtfozB4nHZlTtdgBtn0UOeZt+FUc7F+qaGtghpOA==","reason":"login_rate","status":"LOGIN","delay":5000,"inGameCredentials":{"inGame":false,"summonerId":null,"serverIp":null,"serverPort":null,"encryptionKey":null,"handshakeToken":null},"user":"lolrehber21"} Logging in.. Credentials: {"rate":20,"token":"5lu8jB0v9xkHi3hRFHj-0DcQMXEXwBkNSujO8x8SmF2ch4cYSAtnYXHZlTtdgBtn0UOeZt+FUc6zjpc8Se20wA==","reason":"login_rate","status":"LOGIN","delay":5000,"inGameCredentials":{"inGame":false,"summonerId":null,"serverIp":null,"serverPort":null,"encryptionKey":null,"handshakeToken":null},"user":"lolrehber21"} Logging in.. Credentials: {"rate":20,"token":"ff6RzkC51TQ1XrrdDiwo9iC-5dqZGr+iEQvIWlnbNHwS9UNGseWwWXHZlTtdgBtn0UOeZt+FUc5GlAfCzG4NsA==","reason":"login_rate","status":"LOGIN","delay":5000,"inGameCredentials":{"inGame":false,"summonerId":null,"serverIp":null,"serverPort":null,"encryptionKey":null,"handshakeToken":null},"user":"lolrehber21"} Logging in.. Credentials: {"rate":20,"token":"ZiJaCHjP881JpxZXFRMoYFhcTmLK3tkUAIfEYL8kTtycHjsom8E38HHZlTtdgBtn0UOeZt+FUc4Pi3AYgtxfoA==","reason":"login_rate","status":"LOGIN","delay":5000,"inGameCredentials":{"inGame":false,"summonerId":null,"serverIp":null,"serverPort":null,"encryptionKey":null,"handshakeToken":null},"user":"lolrehber21"} Logging in.. Credentials: {"rate":20,"token":"IXuHAgbnji6OtqK0KhE2S57b-RYrw3c9XuHJumiCWCnfIOrqlKb2dHHZlTtdgBtn0UOeZt+FUc5Ny1i+WY23Mg==","reason":"login_rate","status":"LOGIN","delay":5000,"inGameCredentials":{"inGame":false,"summonerId":null,"serverIp":null,"serverPort":null,"encryptionKey":null,"handshakeToken":null},"user":"lolrehber21"} Logging in.. Credentials: {"rate":20,"token":"JsQnHtOFt9lfFGQ0dClAFhEkLiutidATX2Brkog79Zb6wjV6Q4RCjHHZlTtdgBtn0UOeZt+FUc7yQ4QTD-dd3A==","reason":"login_rate","status":"LOGIN","delay":5000,"inGameCredentials":{"inGame":false,"summonerId":null,"serverIp":null,"serverPort":null,"encryptionKey":null,"handshakeToken":null},"user":"lolrehber21"} Logging in.. Credentials: {"rate":20,"token":"sQ52UvP1nnUma0sYiu0jLhtwI9xZYyXZcbskk7p1MUyIL25bT-jainHZlTtdgBtn0UOeZt+FUc7-LQN1h8FxRQ==","reason":"login_rate","status":"LOGIN","delay":5000,"inGameCredentials":{"inGame":false,"summonerId":null,"serverIp":null,"serverPort":null,"encryptionKey":null,"handshakeToken":null},"user":"lolrehber21"} Logging in.. Credentials: {"rate":20,"token":"hx8FsrHWpg2t2rwvg2YEF-GVcDdWkapo1gfeAFC-VYTwrsoDQC4tu3HZlTtdgBtn0UOeZt+FUc7fI2OwcS0hhQ==","reason":"login_rate","status":"LOGIN","delay":5000,"inGameCredentials":{"inGame":false,"summonerId":null,"serverIp":null,"serverPort":null,"encryptionKey":null,"handshakeToken":null},"user":"lolrehber21"} Logging in.. Credentials: {"rate":20,"token":"5pMwBlxSJStr55OEPKWGtlI2-SjvA8lLgA+kq4aIAyybcHhE-TwqmXHZlTtdgBtn0UOeZt+FUc4MZgOZzyKWOQ==","reason":"login_rate","status":"LOGIN","delay":5000,"inGameCredentials":{"inGame":false,"summonerId":null,"serverIp":null,"serverPort":null,"encryptionKey":null,"handshakeToken":null},"user":"lolrehber21"} Logging in.. Credentials: {"rate":20,"token":"+0cTgFb8ah2n-WYqHA7wqjTsaHtOUIFs-695JvCR-5GwuMH792fUMXHZlTtdgBtn0UOeZt+FUc4+1HaV-HjUyQ==","reason":"login_rate","status":"LOGIN","delay":5000,"inGameCredentials":{"inGame":false,"summonerId":null,"serverIp":null,"serverPort":null,"encryptionKey":null,"handshakeToken":null},"user":"lolrehber21"} Logging in.. Credentials: {"rate":20,"token":"ncxXzR1e8bcDlTbjeRwIKcjDQYZ8FyZxsJa+WWNoDz4YGG3hDLHPgXHZlTtdgBtn0UOeZt+FUc4w2Et6PblUeQ==","reason":"login_rate","status":"LOGIN","delay":5000,"inGameCredentials":{"inGame":false,"summonerId":null,"serverIp":null,"serverPort":null,"encryptionKey":null,"handshakeToken":null},"user":"lolrehber21"}

loliserver commented 11 years ago

Same here, for LAN server

Edit:

the key is packets.js file

on this part:

ConnectPacket = (function(_super) { __extends(ConnectPacket, _super);

function ConnectPacket() {
  _ref = ConnectPacket.__super__.constructor.apply(this, arguments);
  return _ref;
}

ConnectPacket.prototype.appObject = function() {
  var object;
  object = {
    app: '',
    flashVer: 'WIN 10,1,85,3',
    swfUrl: 'app:/mod_ser.dat',
    tcUrl: 'rtmps://beta.lol.riotgames.com:2099',
    fpad: false,
    capabilities: 239,
    audioCodecs: 3191,
    videoCodecs: 252,
    videoFunction: 1,
    pageUrl: void 0,
    objectEncoding: 3
  };
  return object;
};

ConnectPacket.prototype.commandObject = function() {
  var object;
  object = new ASObject();
  object.name = 'flex.messaging.messages.CommandMessage';
  object.object = {
    operation: 5,
    correlationId: '',
    timestamp: 0,
    clientId: null,
    timeToLive: 0,
    messageId: '9DC6600E-8F54-604F-AB39-1515B4CBE8AA',
    destination: '',
    headers: {
      DSMessagingVersion: 1,
      DSId: 'my-rtmps'
    },
    body: {}
  };
  return object;
};

return ConnectPacket;

})(Packet);

LoginPacket = (function(_super) { __extends(LoginPacket, _super);

function LoginPacket() {
  LoginPacket.__super__.constructor.apply(this, arguments);
  console.log(this.options);
}

LoginPacket.prototype.generate = function(clientVersion) {
  var object;
  object = new ASObject();
  object.name = 'flex.messaging.messages.RemotingMessage';
  object.object = {
    operation: 'login',
    source: null,
    timestamp: 0,
    clientId: null,
    timeToLive: 0,
    messageId: uuid().toUpperCase(),
    destination: 'loginService',
    headers: this.generateHeaders(),
    body: [this.generateBody(clientVersion)]
  };
  object.encoding = 0;
  return object;
};

LoginPacket.prototype.generateHeaders = function() {
  var headers;
  headers = new ASObject();
  headers.name = '';
  headers.object = {
    DSId: this.options.dsid,
    DSRequestTimeout: 60,
    DSEndpoint: 'my-rtmps'
  };
  headers.encoding = 2;
  return headers;
};

LoginPacket.prototype.generateBody = function(clientVersion) {
  var body;
  if (clientVersion === null) {
    clientVersion = '3.9.13_07_01_27';
  }
  body = new ASObject();
  body.name = 'com.riotgames.platform.login.AuthenticationCredentials';
  body.object = {
    oldPassword: null,
    password: this.options.password,
    authToken: this.options.queueToken,
    locale: 'en_GB',
    partnerCredentials: null,
    ipAddress: '203.59.95.218',
    domain: 'lolclient.lol.riotgames.com',
    username: this.options.username,
    clientVersion: clientVersion,
    securityAnswer: null
  };
  body.encoding = 0;
  return body;
};

return LoginPacket;
doctorrapido commented 11 years ago

I am still trying to solve that but I couldnt

doctorrapido commented 11 years ago

I guess this is about SSL certificate issue . Can u check that when you available ? Thanks :)

loliserver commented 11 years ago

where can see that?

doctorrapido commented 11 years ago

This is output when I try to start example.js
working well with Na and euw .at TR server it is stucking after the connecting to ssl.

{ region: 'tr', username: 'lolrehber21', password: 'password', version: '3.12.13_10_08_16_20', debug: true, host: 'prod.tr.lol.riotgames.com', lqHost: 'lq.tr.lol.riotgames.com', port: 2099 } Logging in.. Checking Login Queue Credentials: {"rate":20,"token":"aKJuZBNWr7NnCSO3V0PkHc8OkUkLXNTaPa6L7bnOHUQs9OXVCLipgHHZlTtdgBtnE7A8doKQNsbx+FNscP4uzw==","reason":"login_rate","status":"LOGIN","delay":5000,"inGameCredentials":{"inGame":false,"summonerId":null,"serverIp":null,"serverPort":null,"encryptionKey":null,"handshakeToken":null},"user":"lolrehber21"} Login Queue Response { rate: 20, token: 'aKJuZBNWr7NnCSO3V0PkHc8OkUkLXNTaPa6L7bnOHUQs9OXVCLipgHHZlTtdgBtnE7A8doKQNsbx+FNscP4uzw==', reason: 'login_rate', status: 'LOGIN', delay: 5000, inGameCredentials: { inGame: false, summonerId: null, serverIp: null, serverPort: null, encryptionKey: null, handshakeToken: null }, user: 'lolrehber21' } Connecting to SSL

loliserver commented 11 years ago

any news?

doctorrapido commented 11 years ago

sadly no progress. waiting alex

perezpaya commented 11 years ago

Sorry guys, I can't work with this right now, I'm with a lot of exams. Studying not programming, I hope I can start working soon

Jyrno42 commented 11 years ago

I might have time to work on it in the evening. Gotta get my hands on the BR/TR client though. Will let you know if i make any progress.

Jyrno42 commented 11 years ago

Hmm imho should be fixed by changing

https://github.com/alexperezpaya/lolfire-source/blob/master/lolrmtp/lol-client.js#L141

from:

stream = tls.connect(this.options.port, this.options.host, function() {

to:

stream = tls.connect(this.options.port, this.options.host, {'rejectUnauthorized': false}, function() {

Another fix would be adding the correct certificate to trusted certificates for tls.

perezpaya commented 11 years ago

https://github.com/alexperezpaya/lolfire-source/commit/a65af0c3ac2aabd39519e0d96fdaca98edd03179 Can you try if now is working?

doctorrapido commented 11 years ago

I tested and Working good ! :)

perezpaya commented 11 years ago

Perfect :)