public override void Connect(IRpcController controller, ConnectRequest request, Action <ConnectResponse> done) { var response = ConnectResponse.CreateBuilder() .SetServerId(ProcessId.CreateBuilder().SetLabel(0xDEADBABE).SetEpoch(DateTime.Now.ToUnixTime())) .SetClientId(ProcessId.CreateBuilder().SetLabel(0xDEADBEEF).SetEpoch(DateTime.Now.ToUnixTime())) .Build(); done(response); }
public override void Connect(Google.ProtocolBuffers.IRpcController controller, ConnectRequest request, Action <ConnectResponse> done) { Logger.Trace("Connect()"); var builder = ConnectResponse.CreateBuilder() .SetServerId(ProcessId.CreateBuilder().SetLabel(0xAAAA).SetEpoch(DateTime.Now.ToUnixTime())) .SetClientId(ProcessId.CreateBuilder().SetLabel(0xBBBB).SetEpoch(DateTime.Now.ToUnixTime())); done(builder.Build()); }
public override void Connect(IRpcController controller, ConnectRequest request, Action <ConnectResponse> done) { var response = ConnectResponse.CreateBuilder(); var server_id = ProcessId.CreateBuilder(); var client_id = ProcessId.CreateBuilder(); var epoch = (uint)(DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0)).TotalSeconds; server_id.SetLabel(0).SetEpoch(epoch); response.SetServerId(server_id); done(response.Build()); }
public void Connect(IClient client, Packet packetIn) { Logger.Trace("RPC:Connect()"); var response = bnet.protocol.connection.ConnectResponse.CreateBuilder() .SetServerId(ProcessId.CreateBuilder().SetLabel(0xAAAA).SetEpoch(DateTime.Now.ToUnixTime())) .SetClientId(ProcessId.CreateBuilder().SetLabel(0xBBBB).SetEpoch(DateTime.Now.ToUnixTime())) .Build(); var packet = new Packet( new Header(0xfe, 0x0, packetIn.Header.RequestID, (uint)response.SerializedSize), response.ToByteArray()); client.Send(packet); }