public override void Execute(Relay server, Client client, Session session, Message message) { if (session != null) { throw new Relay.UnexpectedSessionException(); } uint id = server.CreateSession(client); var newJSON = new JSONObject(); newJSON.Add("session", client.session.id); newJSON.Add("beat", client.session.GetLowestClock()); using (var stream = client.tcp.NewStream()) { var msg = new Message() { controller = (byte)KingdomsSharedCode.Networking.Controller.SESSION_INFO, body = newJSON.ToString() }; logger.Trace(">> " + msg); stream.Write(msg); } logger.Trace("Client " + client + " is now in session " + client.session); }