当前位置: 首页>>代码示例>>C#>>正文


C# GSPacketIn.Compress方法代码示例

本文整理汇总了C#中Game.Base.Packets.GSPacketIn.Compress方法的典型用法代码示例。如果您正苦于以下问题:C# GSPacketIn.Compress方法的具体用法?C# GSPacketIn.Compress怎么用?C# GSPacketIn.Compress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Game.Base.Packets.GSPacketIn的用法示例。


在下文中一共展示了GSPacketIn.Compress方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SendAuctionRefresh

 public GSPacketIn SendAuctionRefresh(AuctionInfo info, int auctionID, bool isExist, ItemInfo item)
 {
     GSPacketIn pkg = new GSPacketIn((byte)ePackageType.AUCTION_REFRESH);
     pkg.WriteInt(auctionID);
     pkg.WriteBoolean(isExist);
     if (isExist)
     {
         pkg.WriteInt(info.AuctioneerID);
         pkg.WriteString(info.AuctioneerName);
         pkg.WriteDateTime(info.BeginDate);
         pkg.WriteInt(info.BuyerID);
         pkg.WriteString(info.BuyerName);
         pkg.WriteInt(info.ItemID);
         pkg.WriteInt(info.Mouthful);
         pkg.WriteInt(info.PayType);
         pkg.WriteInt(info.Price);
         pkg.WriteInt(info.Rise);
         pkg.WriteInt(info.ValidDate);
         pkg.WriteBoolean(item != null);
         if (item != null)
         {
             pkg.WriteInt(item.Count);
             pkg.WriteInt(item.TemplateID);
             pkg.WriteInt(item.AttackCompose);
             pkg.WriteInt(item.DefendCompose);
             pkg.WriteInt(item.AgilityCompose);
             pkg.WriteInt(item.LuckCompose);
             pkg.WriteInt(item.StrengthenLevel);
             pkg.WriteBoolean(item.IsBinds);
             pkg.WriteBoolean(item.IsJudge);
             pkg.WriteDateTime(item.BeginDate);
             pkg.WriteInt(item.ValidDate);
             pkg.WriteString(item.Color);
             pkg.WriteString(item.Skin);
             pkg.WriteBoolean(item.IsUsed);
         }
     }
     pkg.Compress();
     SendTCP(pkg);
     return pkg;
 }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:41,代码来源:AbstractPacketLib.cs

示例2: SendUserEquip

        public GSPacketIn SendUserEquip(PlayerInfo player, List<ItemInfo> items)
        {

            GSPacketIn pkg = new GSPacketIn((byte)ePackageType.ITEM_EQUIP, player.ID, 10240);

            pkg.WriteInt(player.ID);
            pkg.WriteInt(player.Agility);
            pkg.WriteInt(player.Attack);
            pkg.WriteString(player.Colors);
            pkg.WriteString(player.Skin);
            pkg.WriteInt(player.Defence);
            pkg.WriteInt(player.GP);
            pkg.WriteInt(player.Grade);
            pkg.WriteInt(player.Luck);
            pkg.WriteInt(player.Hide);
            pkg.WriteInt(player.Repute);
            pkg.WriteBoolean(player.Sex);
            pkg.WriteString(player.Style);
            pkg.WriteInt(player.Offer);
            pkg.WriteString(player.NickName);
            pkg.WriteBoolean(true);
            pkg.WriteInt(5);
            pkg.WriteInt(player.Win);
            pkg.WriteInt(player.Total);
            pkg.WriteInt(player.Escape);
            pkg.WriteInt(player.ConsortiaID);
            pkg.WriteString(player.ConsortiaName);
            pkg.WriteInt(player.RichesOffer);
            pkg.WriteInt(player.RichesRob);
            pkg.WriteBoolean(player.IsMarried);
            pkg.WriteInt(player.SpouseID);
            pkg.WriteString(player.SpouseName);
            pkg.WriteString(player.DutyName);
            pkg.WriteInt(player.Nimbus);
            pkg.WriteInt(player.FightPower);

            pkg.WriteInt(5);
            pkg.WriteInt(-1);
            pkg.WriteString("Master");
            pkg.WriteInt(5);
            pkg.WriteString("HoNorMaster");
            //AchievementPoint
            pkg.WriteInt(9999);
            pkg.WriteString("Honor");
            pkg.WriteDateTime(DateTime.Now.AddDays(-2));
            pkg.WriteInt(items.Count);
            foreach (ItemInfo info in items)
            {
                pkg.WriteByte((byte)info.BagType);
                pkg.WriteInt(info.UserID);
                pkg.WriteInt(info.ItemID);
                pkg.WriteInt(info.Count);
                pkg.WriteInt(info.Place);
                pkg.WriteInt(info.TemplateID);
                pkg.WriteInt(info.AttackCompose);
                pkg.WriteInt(info.DefendCompose);
                pkg.WriteInt(info.AgilityCompose);
                pkg.WriteInt(info.LuckCompose);
                pkg.WriteInt(info.StrengthenLevel);
                pkg.WriteBoolean(info.IsBinds);
                pkg.WriteBoolean(info.IsJudge);
                pkg.WriteDateTime(info.BeginDate);
                pkg.WriteInt(info.ValidDate);
                pkg.WriteString(info.Color);
                pkg.WriteString(info.Skin);
                pkg.WriteBoolean(info.IsUsed);
                pkg.WriteInt(info.Hole1);
                pkg.WriteInt(info.Hole2);
                pkg.WriteInt(info.Hole3);
                pkg.WriteInt(info.Hole4);
                pkg.WriteInt(info.Hole5);
                pkg.WriteInt(info.Hole6);
                pkg.WriteString(info.Template.Pic);
                pkg.WriteInt(info.Template.RefineryLevel);
                pkg.WriteDateTime(DateTime.Now);

                pkg.WriteByte(5);
                pkg.WriteInt(5);
                pkg.WriteByte(5);
                pkg.WriteInt(5);

                //item.Hole5Level = pkg.readByte();
                //item.Hole5Exp = pkg.readInt();
                //item.Hole6Level = pkg.readByte();
                //item.Hole6Exp = pkg.readInt();
            }
            pkg.Compress();
            SendTCP(pkg);
            return pkg;
        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:90,代码来源:AbstractPacketLib.cs

示例3: SendUserEquip

 public GSPacketIn SendUserEquip(PlayerInfo player, List<ItemInfo> items)
 {
     GSPacketIn pkg = new GSPacketIn((byte)ePackageType.ITEM_EQUIP, player.ID, 10240);
     pkg.WriteInt(player.ID);
     pkg.WriteString(player.NickName);
     pkg.WriteInt(player.Agility);
     pkg.WriteInt(player.Attack);
     pkg.WriteString(player.Colors);
     pkg.WriteString(player.Skin);
     pkg.WriteInt(player.Defence);
     pkg.WriteInt(player.GP);
     pkg.WriteInt(player.Grade);
     pkg.WriteInt(player.Luck);
     pkg.WriteInt(player.hp);//_loc_5.hp = _loc_2.readInt();
     pkg.WriteInt(player.Hide);
     pkg.WriteInt(player.Repute);
     pkg.WriteBoolean(player.Sex);
     pkg.WriteString(player.Style);
     pkg.WriteInt(player.Offer);
     pkg.WriteByte(player.typeVIP);
     pkg.WriteInt(player.VIPLevel);
     pkg.WriteInt(player.Win);
     pkg.WriteInt(player.Total);
     pkg.WriteInt(player.Escape);
     pkg.WriteInt(player.ConsortiaID);
     pkg.WriteString(player.ConsortiaName);
     pkg.WriteInt(0);//_loc_5.badgeID = _loc_2.readInt();
     pkg.WriteInt(player.RichesOffer);
     pkg.WriteInt(player.RichesRob);
     pkg.WriteBoolean(player.IsMarried);
     pkg.WriteInt(player.SpouseID);
     pkg.WriteString(player.SpouseName);
     pkg.WriteString(player.DutyName);
     pkg.WriteInt(player.Nimbus);
     pkg.WriteInt(player.FightPower);
     pkg.WriteInt(5);//apprenticeshipState = _loc_2.readInt();
     pkg.WriteInt(-1);//masterID = _loc_2.readInt();
     pkg.WriteString("Master");//setMasterOrApprentices(_loc_2.readUTF());
     pkg.WriteInt(0);//graduatesCount = _loc_2.readInt();
     pkg.WriteString("HoNorMaster");//honourOfMaster = _loc_2.readUTF();
     pkg.WriteInt(player.AchievementPoint);//
     pkg.WriteString("Tân Binh");//honor = _loc_2.readUTF();
     pkg.WriteDateTime(DateTime.Now.AddDays(-2));
     pkg.WriteInt(player.Offer);    //_loc_5.spdTexpExp = _loc_2.readInt();
     pkg.WriteInt(player.Offer);    //_loc_5.attTexpExp = _loc_2.readInt();
     pkg.WriteInt(player.Offer);    //_loc_5.defTexpExp = _loc_2.readInt();
     pkg.WriteInt(player.Offer);    //_loc_5.hpTexpExp = _loc_2.readInt();
     pkg.WriteInt(player.Offer);    //_loc_5.lukTexpExp = _loc_2.readInt();
     pkg.WriteBoolean(false);    //_loc_5.DailyLeagueFirst = _loc_2.readBoolean();
     pkg.WriteInt(player.Offer);    //_loc_5.DailyLeagueLastScore = _loc_2.readInt();
     pkg.WriteInt(items.Count);
     foreach (ItemInfo info in items)
     {
         pkg.WriteByte((byte)info.BagType);
         pkg.WriteInt(info.UserID);
         pkg.WriteInt(info.ItemID);
         pkg.WriteInt(info.Count);
         pkg.WriteInt(info.Place);
         pkg.WriteInt(info.TemplateID);
         pkg.WriteInt(info.AttackCompose);
         pkg.WriteInt(info.DefendCompose);
         pkg.WriteInt(info.AgilityCompose);
         pkg.WriteInt(info.LuckCompose);
         pkg.WriteInt(info.StrengthenLevel);
         pkg.WriteBoolean(info.IsBinds);
         pkg.WriteBoolean(info.IsJudge);
         pkg.WriteDateTime(info.BeginDate);
         pkg.WriteInt(info.ValidDate);
         pkg.WriteString(info.Color);
         pkg.WriteString(info.Skin);
         pkg.WriteBoolean(info.IsUsed);
         pkg.WriteInt(info.Hole1);
         pkg.WriteInt(info.Hole2);
         pkg.WriteInt(info.Hole3);
         pkg.WriteInt(info.Hole4);
         pkg.WriteInt(info.Hole5);
         pkg.WriteInt(info.Hole6);
         pkg.WriteString(info.Template.Pic);
         pkg.WriteInt(info.Template.RefineryLevel);
         pkg.WriteDateTime(DateTime.Now);
         pkg.WriteByte((byte)info.Hole5Level);
         pkg.WriteInt(info.Hole5Exp);
         pkg.WriteByte((byte)info.Hole6Level);
         pkg.WriteInt(info.Hole6Exp);
         if (info.IsGold)
         {
             pkg.WriteBoolean(info.IsGold);//_loc_8.isGold = _loc_2.readBoolean();
             pkg.WriteInt(365);//_loc_8.goldValidDate = _loc_2.readInt();
             pkg.WriteDateTime(DateTime.Now);//_loc_8.goldBeginTime = _loc_2.readDateString();
         }
         else { pkg.WriteBoolean(false); }
     }
     pkg.Compress();
     SendTCP(pkg);
     return pkg;
 }
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:96,代码来源:AbstractPacketLib.cs


注:本文中的Game.Base.Packets.GSPacketIn.Compress方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。