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


C# GSPacketIn.Write方法代码示例

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


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

示例1: SendRSALogin

 public void SendRSALogin(RSACryptoServiceProvider rsa, string key)
 {
     GSPacketIn pkg = new GSPacketIn((byte)eFightPackageType.LOGIN);
     pkg.Write(rsa.Encrypt(Encoding.UTF8.GetBytes(key), false));
     SendTCP(pkg);
 }
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:6,代码来源:FightServerConnector.cs

示例2: SendGameWindPic

 internal void SendGameWindPic(byte windId, byte[] windpic)
 {
     GSPacketIn pkg = new GSPacketIn((byte)ePackageType.GAME_CMD);
     pkg.WriteByte((byte)eTankCmdType.WIND_PIC);
     pkg.WriteByte(windId);
     pkg.Write(windpic);
     SendToAll(pkg);
 }
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:8,代码来源:BaseGame.cs

示例3: SendListenIPPort

        /// <summary>
        /// 发送监听端口和IP
        /// </summary>
        /// <param name="ip"></param>
        /// <param name="port"></param>
        public void SendListenIPPort(IPAddress ip, int port)
        {
            GSPacketIn pkg = new GSPacketIn((byte)eChatServerPacket.IP_PORT);
            pkg.Write(ip.GetAddressBytes());
            pkg.WriteInt(port);

            SendTCP(pkg);
        }
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:13,代码来源:LoginServerConnector.cs

示例4: SendRSAKey

 /// <summary>
 /// 发送RSA密钥
 /// </summary>
 /// <param name="m"></param>
 /// <param name="e"></param>
 public void SendRSAKey(byte[] m, byte[] e)
 {
     GSPacketIn pkg = new GSPacketIn((byte)eFightPackageType.RSAKey);
     pkg.Write(m);
     pkg.Write(e);
     SendTCP(pkg);
 }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:12,代码来源:ServerClient.cs

示例5: SendCheckCode

        public void SendCheckCode()
        {
            if (m_gameClient.Player == null || m_gameClient.Player.PlayerCharacter.CheckCount < GameProperties.CHECK_MAX_FAILED_COUNT)
                return;

            if (m_gameClient.Player.PlayerCharacter.CheckError == 0)
            {
                m_gameClient.Player.PlayerCharacter.CheckCount += 10000;
            }

            GSPacketIn pkg = new GSPacketIn((byte)ePackageType.CHECK_CODE, m_gameClient.Player.PlayerCharacter.ID, 10240);
            // pkg.WriteBoolean(true);
            if (m_gameClient.Player.PlayerCharacter.CheckError < 1)
            {
                pkg.WriteByte(0);
            }
            else
            {
                pkg.WriteByte(2);
            }
            pkg.WriteBoolean(true);
            m_gameClient.Player.PlayerCharacter.CheckCode = CheckCode.GenerateCheckCode();
            pkg.Write(CheckCode.CreateImage(m_gameClient.Player.PlayerCharacter.CheckCode));

            //string[] codes = CheckCode.GenerateCheckCode(4);
            //int index = ThreadSafeRandom.NextStatic(codes.Length);
            //m_gameClient.Player.PlayerCharacter.CheckIndex = index + 1;
            //for (int i = 0; i < codes.Length; i++)
            //{
            //    pkg.WriteString(codes[i]);
            //}

            //pkg.Write(CheckCode.CreateCheckCodeImage(codes[index]));
            SendTCP(pkg);
        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:35,代码来源:AbstractPacketLib.cs


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