94 lines
1.4 KiB
C#
94 lines
1.4 KiB
C#
![]() |
// ***********************************************************************
|
|||
|
// Assembly : Unity
|
|||
|
// Author : Kimch
|
|||
|
// Created :
|
|||
|
//
|
|||
|
// Last Modified By : Kimch
|
|||
|
// Last Modified On :
|
|||
|
// ***********************************************************************
|
|||
|
// <copyright file= "GamePacket" company=""></copyright>
|
|||
|
// <summary></summary>
|
|||
|
// ***********************************************************************
|
|||
|
namespace G
|
|||
|
{
|
|||
|
using F.Network;
|
|||
|
|
|||
|
public class GamePacket : IPacket
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
public const int ERROR_CODE_OK = 0;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
/// <param name="packet"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static bool HasError(GamePacket packet)
|
|||
|
{
|
|||
|
if (packet != null && packet.error == ERROR_CODE_OK)
|
|||
|
{
|
|||
|
return false;
|
|||
|
}
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 标识
|
|||
|
/// </summary>
|
|||
|
public int id
|
|||
|
{
|
|||
|
get;
|
|||
|
set;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 数据
|
|||
|
/// </summary>
|
|||
|
public object data
|
|||
|
{
|
|||
|
get;
|
|||
|
set;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 错误
|
|||
|
/// </summary>
|
|||
|
public int error
|
|||
|
{
|
|||
|
get;
|
|||
|
set;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
public string token
|
|||
|
{
|
|||
|
get;
|
|||
|
set;
|
|||
|
}
|
|||
|
|
|||
|
public object extra
|
|||
|
{
|
|||
|
get;
|
|||
|
set;
|
|||
|
}
|
|||
|
|
|||
|
public Callback2 callback
|
|||
|
{
|
|||
|
get;
|
|||
|
set;
|
|||
|
}
|
|||
|
|
|||
|
public static GamePacket Create(int id)
|
|||
|
{
|
|||
|
return new GamePacket
|
|||
|
{
|
|||
|
id = id
|
|||
|
};
|
|||
|
}
|
|||
|
}
|
|||
|
}
|