You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.5 KiB

1 month ago
/*
Sog
2016 by zouwei
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace SogClient
{
/// <summary>
/// 底层控制类型,65500开始
/// </summary>
public enum SpecialMessageType
{
/// <summary>
/// Server->Server 大消息
/// </summary>
BigMessageStart = 32752,
/// <summary>
/// Server->Server 大消息
/// </summary>
BigMessageTrans = 32753,
// //udp客户端连接消息
// UdpClientConnect = 32755,
// //断开
// UdpClientClose = 32756,
/// <summary>
/// 公钥
/// </summary>
PublicKey = 32760,
/// <summary>
/// 加密钥匙,tea
/// </summary>
SessionKey = 32761,
}
/// <summary>
/// 打包后的消息头是变长的,有可能是4(主要和客户端使用) 有可能是4+8+4=16(主要服务器使用)
/// </summary>
public struct MessageHeader
{
public int Length; // 长度
public int Type; // 类型
public uint ServerID; // 自定义ID,服务器ID,seq(client->server)
public long ObjectID; // 自定义ID,和逻辑有关,一般是玩家ID,sessionID,GlobalID等
}
public struct MessageData
{
//消息头信息
public MessageHeader Header;
// 打包后的数据
public byte[] Data;
public static MessageData EmptyMessage = new MessageData();
}
}