示例#1
0
        public static void OnLogin(GameClient client, GameMessage messages)
        {
            GameChangeSceneMessage outmessage1 = new GameChangeSceneMessage();

            outmessage1.NewSceneId = 2;
            outmessage1.Field1     = 0;
            client.SendMessage(outmessage1, true);

            ToonListMessage outmessage2 = new ToonListMessage();

            outmessage2.ToonList = new ToonData[5];

            VisualEquipment ve = new VisualEquipment();

            ve.Equipment = new VisualItem[8];
            for (int i = 0; i < ve.Equipment.Length; i++)
            {
                ve.Equipment[i]        = new VisualItem();
                ve.Equipment[i].snoId  = 0;
                ve.Equipment[i].SlotID = 0;
                ve.Equipment[i].Field2 = 0;
                ve.Equipment[i].Field3 = 0;
            }
            //ve.Equipment = GetCurrentVisualEquipment();
            for (int i = 0; i < 5; i++)
            {
                outmessage2.ToonList[i] = new ToonData();
                outmessage2.ToonList[i].EquipmentList = ve;
                outmessage2.ToonList[i].PlayerIndex   = 0;
                outmessage2.ToonList[i].SNO           = 10;
                outmessage2.ToonList[i].Level         = 50;
                outmessage2.ToonList[i].ToonName      = "machivo" + i.ToString();
            }
            client.SendMessage(outmessage2, true);
        }
示例#2
0
 public override void Parse(GameBitBuffer buffer)
 {
     Field0 = buffer.ReadInt(32);
     Field1 = new VisualEquipment();
     Field1.Parse(buffer);
 }
 public override void Parse(GameBitBuffer buffer)
 {
     ActorID       = buffer.ReadUInt(32);
     EquipmentList = new VisualEquipment();
     EquipmentList.Parse(buffer);
 }
 public void Parse(GameBitBuffer buffer)
 {
     Field0 = new RequiredMessageHeader();
     Field0.Parse(buffer);
     Field1 = buffer.ReadInt(32);
     Field2 = new VisualEquipment();
     Field2.Parse(buffer);
 }
示例#5
0
 public override void Parse(GameBitBuffer buffer)
 {
     Field0 = buffer.ReadInt(32);
     Field1 = new VisualEquipment();
     Field1.Parse(buffer);
 }
示例#6
0
        public override void Execute(Google.ProtocolBuffers.IRpcController controller, ExecuteRequest request, Action <ExecuteResponse> done)
        {
            var response = ExecuteResponse.CreateBuilder();

            foreach (var op in request.OperationsList)
            {
                var result = OperationResult.CreateBuilder();
                result.SetTableId(op.TableId);

                var data = Cell.CreateBuilder();
                data.SetColumnId(op.ColumnId);
                data.SetRowId(op.RowId);

                result.SetErrorCode(1);

                if (request.QueryName == "GetGameAccountSettings")
                {
                    result.SetErrorCode(4);
                }
                else if (request.QueryName == "GetHeroDigests")
                {
                    var hero_digest = D3.Hero.Digest.CreateBuilder();
                    hero_digest.SetVersion(891);
                    hero_digest.SetHeroId(D3.OnlineService.EntityId.CreateBuilder().SetIdHigh(216174302532224051).SetIdLow(2345959482769161802));
                    hero_digest.SetHeroName("poop");
                    hero_digest.SetGbidClass(-930376119);
                    hero_digest.SetLevel(1);
                    hero_digest.SetPlayerFlags(0);
                    var eq = VisualEquipment.CreateBuilder();
                    for (int i = 0; i < 8; i++)
                    {
                        eq.AddVisualItem(VisualItem.CreateBuilder().SetEffectLevel(0));
                    }
                    hero_digest.SetVisualEquipment(eq);
                    //hero_digest.SetQuestHistory(QuestHistoryEntry
                    hero_digest.SetLastPlayedAct(0);
                    hero_digest.SetHighestUnlockedAct(0);
                    hero_digest.SetLastPlayedQuest(-1);
                    hero_digest.SetLastPlayedQuestStep(-1);
                    hero_digest.SetLastPlayedDifficulty(0);
                    hero_digest.SetTimePlayed(0);
                    hero_digest.SetHighestUnlockedDifficulty(0);
                    data.SetData(hero_digest.Build().ToByteString());
                }
                else if (request.QueryName == "LoadAccountDigest")
                {
                    var account_digest = D3.Account.Digest.CreateBuilder();
                    account_digest.SetVersion(1);

                    // no last played hero
                    var last_played = D3.OnlineService.EntityId.CreateBuilder();
                    last_played.SetIdHigh(216174302532224051);
                    last_played.SetIdLow(2345959482769161802);
                    account_digest.SetLastPlayedHeroId(last_played);

                    // default banner
                    var banner = D3.Account.BannerConfiguration.CreateBuilder();
                    banner.SetBannerIndex(0).SetSigilMain(0).SetSigilAccent(0).SetPatternColorIndex(0).SetBackgroundColorIndex(0).SetSigilColorIndex(0)
                    .SetPlacementIndex(0).SetPattern(0).SetUseSigilVariant(false);
                    account_digest.SetBannerConfiguration(banner);

                    // default flags
                    account_digest.SetFlags((uint)D3.Account.Digest.Types.Flags.HARDCORE_HERO_UNLOCKED);

                    data.SetData(account_digest.Build().ToByteString());
                }
                else if (request.QueryName == "GetToonSettings")
                {
                    //response.SetErrorCode(4);
                }
                else
                {
                    throw new ArgumentException("Invalid query name: " + request.QueryName);
                }

                result.AddData(data);

                response.AddResults(result);
            }


            done(response.Build());
        }