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


C# GSPacketIn.ClearContext方法代码示例

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


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

示例1: HandlePacket

 public int HandlePacket(GameClient client, GSPacketIn packet)
 {
     packet.ClearContext();
     packet.WriteDateTime(DateTime.Now);
     client.Out.SendTCP(packet);
     return 0;
 }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:7,代码来源:SyncSystemDateHandler.cs

示例2: HandlePacket

        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            
            //bool result = false;
            if (string.IsNullOrEmpty(client.Player.PlayerCharacter.CheckCode))
                return 1;

            //int check  = packet.ReadInt();

            string check = packet.ReadString();
            if (client.Player.PlayerCharacter.CheckCode.ToLower() == check.ToLower())
            {
                client.Player.PlayerCharacter.CheckCount = 0;

                //int rewardItemID = GameServer.Instance.Configuration.CheckRewardItem;
                //ItemTemplateInfo rewardItem = ItemMgr.GetSingleGoods(rewardItemID);
                //ItemInfo item = ItemInfo.CreateFromTemplate(rewardItem, 1, (int)Game.Server.Statics.ItemAddType.CheckCode);
                //if (item != null)
                //{
                //    item.IsBinds = true;
                //    if (client.Player.AddItem(item, Game.Server.Statics.ItemAddType.CheckCode) != -1)
                //    {
                //        client.Out.SendMessage(eMessageType.ChatERROR, LanguageMgr.GetTranslation("CheckCodeHandler.Msg1", item.Template.Name));
                //    }
                //    else
                //    {
                //        client.Out.SendMessage(eMessageType.ChatERROR, LanguageMgr.GetTranslation("CheckCodeHandler.Msg2"));
                //    }
                //}
                int GP = LevelMgr.GetGP(client.Player.PlayerCharacter.Grade);
                client.Player.AddGP(LevelMgr.IncreaseGP(client.Player.PlayerCharacter.Grade, client.Player.PlayerCharacter.GP));
               
                client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("CheckCodeHandler.Msg1", client.Player.PlayerCharacter.Grade * 12));
                //result = true;
                packet.ClearContext();
                packet.WriteByte(1);
                packet.WriteBoolean(false);
                client.Out.SendTCP(packet);
            }
           // else if (client.Player.PlayerCharacter.CheckError < 1 && client.Player.PlayerCharacter.CheckCount < 20000)
            else if (client.Player.PlayerCharacter.CheckError < 9)
            {
                client.Out.SendMessage(eMessageType.ChatERROR, LanguageMgr.GetTranslation("CheckCodeHandler.Msg3"));
                client.Player.PlayerCharacter.CheckError++;
                client.Out.SendCheckCode();
               
            }
            else
            {
                client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("CheckCodeHandler.Msg3"));
                client.Disconnect();
              
            }
          
         
            return 0;
        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:57,代码来源:CheckCodeHandler.cs

示例3: HandlePacket

 public int HandlePacket(GameClient client, GSPacketIn packet)
 {
     packet = packet.Clone();
     packet.ClearContext();
     int num = packet.ReadInt();
     int num2 = packet.ReadInt();
     int num3 = packet.ReadInt();
     int num4 = packet.ReadInt();
     int num5 = packet.ReadInt();
     int num6 = packet.ReadInt();
     int num7 = packet.ReadInt();
     client.Player.CurrentHotSpringRoom = new HotSpringRoom(new HotSpringRoomInfo(), new TankHotSpringLogicProcessor());
     client.Player.CurrentHotSpringRoom.ProcessData(client.Player, packet);
     return 0;
 }
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:15,代码来源:HotSpringCmdDataHandler.cs

示例4: HandleSysNotice

        private void HandleSysNotice(GSPacketIn pkg)
        {
            BaseGame game = GameMgr.FindGame(pkg.ClientID);
            if (game != null)
            {

                Player player = game.FindPlayer(pkg.Parameter1);
                GSPacketIn pkg1 = new GSPacketIn((byte)eFightPackageType.SYS_NOTICE);
                // int type = pkg.ReadInt();
                pkg1.WriteInt(3);
                pkg1.WriteString(LanguageMgr.GetTranslation("AbstractPacketLib.SendGamePlayerLeave.Msg6", player.PlayerDetail.PlayerCharacter.Grade * 12, 15));
                player.PlayerDetail.SendTCP(pkg1);
                pkg1.ClearContext();
                pkg1.WriteInt(3);
                pkg1.WriteString(LanguageMgr.GetTranslation("AbstractPacketLib.SendGamePlayerLeave.Msg7", player.PlayerDetail.PlayerCharacter.NickName, player.PlayerDetail.PlayerCharacter.Grade * 12, 15));
                game.SendToAll(pkg1, player.PlayerDetail);

            }

        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:20,代码来源:ServerClient.cs


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