Пример #1
0
        public void Logon(IClient client, Packet packetIn)
        {
            Logger.Trace("RPC:Authentication:Logon()");
            var response = bnet.protocol.authentication.LogonResponse.CreateBuilder()
                           .SetAccount(EntityId.CreateBuilder().SetHigh(0x100000000000000).SetLow(0))
                           .SetGameAccount(EntityId.CreateBuilder().SetHigh(0x200006200004433).SetLow(0))
                           .Build();

            var packet = new Packet(
                new Header(0xfe, 0x0, packetIn.Header.RequestID, (uint)response.SerializedSize),
                response.ToByteArray());

            client.Send(packet);
        }
Пример #2
0
        public override void CreateToon(Google.ProtocolBuffers.IRpcController controller, CreateToonRequest request, Action <CreateToonResponse> done)
        {
            foreach (var attr in request.AttributeList)
            {
                if (attr.Name == "HeroCreateParams")
                {
                    var create_params = D3.OnlineService.HeroCreateParams.ParseFrom(attr.Value.MessageValue);
                }
            }

            var response = CreateToonResponse.CreateBuilder();
            var toon     = EntityId.CreateBuilder();

            toon.SetHigh(0x300016200004433);
            toon.SetLow(2);
            response.SetToon(toon);
            done(response.Build());
        }
Пример #3
0
        public override void FindGame(IRpcController controller, FindGameRequest request, Action <FindGameResponse> done)
        {
            FindGameResponse.Builder findGameResponse = FindGameResponse.CreateBuilder();
            findGameResponse.SetRequestId(12526585062881647236);

            done(findGameResponse.Build());

            client.ListenerId = request.ObjectId;

            GameFoundNotification.Builder gameFoundNotification = GameFoundNotification.CreateBuilder();

            GameHandle.Builder gameHandle = GameHandle.CreateBuilder();
            gameHandle.SetFactoryId(request.FactoryId);
            gameHandle.SetGameId(EntityId.CreateBuilder().SetHigh(433661094641971304).SetLow(11017467167309309688).Build());

            ConnectInfo.Builder connectInfo = ConnectInfo.CreateBuilder();
            connectInfo.SetToonId(new EntityId.Builder
            {
                High = HighId.Toon,
                Low  = 2
            }.Build());
            connectInfo.SetHost("127.0.0.1");
            connectInfo.SetPort(6665);
            connectInfo.SetToken(ByteString.CopyFrom(new byte[] { 0x07, 0x34, 0x02, 0x60, 0x91, 0x93, 0x76, 0x46, 0x28, 0x84 }));
            connectInfo.AddAttribute(Attribute
                                     .CreateBuilder()
                                     .SetName("SGameId")
                                     .SetValue(Variant
                                               .CreateBuilder()
                                               .SetIntValue(2014314530)
                                               .Build())
                                     .Build());

            gameFoundNotification.SetRequestId(12526585062881647236);
            gameFoundNotification.SetGameHandle(gameHandle.Build());
            gameFoundNotification.AddConnectInfo(connectInfo.Build());

            GameFactorySubscriber.CreateStub(client).NotifyGameFound(controller, gameFoundNotification.Build(), r => { });
        }