本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}