Commit 67e8ecaf authored by 神楽坂玲奈's avatar 神楽坂玲奈

debug

parent 25e86e21
Pipeline #16355 passed with stages
in 24 seconds
......@@ -5,8 +5,6 @@ import { Server } from './Server';
import { Router } from './Router';
import { Change, Hello } from '../protocol';
import routers from '../import/data/Router.json';
const self: Hello = { id: parseInt(process.env.RAILGUN_ID), seq: 0, time: 0 };
const server = new Server();
......@@ -26,9 +24,8 @@ const socket = dgram
// from client
const message: Hello = JSON.parse(msg.toString());
assert(message.id);
console.log(message.id);
const peer = Router.all.find(p => p.id === message.id);
// assert(peer && rinfo.address === `10.200.${self.id}.${peer.id}` && rinfo.port === config.port);
assert(peer && rinfo.address === peer.linkAddress && rinfo.port === config.port);
peer.onMessage(message);
}
} catch (e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment