558 lines
7.6 KiB
C#
558 lines
7.6 KiB
C#
#pragma warning disable CS8618
|
|
|
|
using ProtoBuf;
|
|
|
|
namespace ClientTester.Packet;
|
|
|
|
// ============================================================
|
|
// 공통 타입
|
|
// ============================================================
|
|
|
|
[ProtoContract]
|
|
public class Vector3
|
|
{
|
|
[ProtoMember(1)]
|
|
public float X
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(2)]
|
|
public float Y
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(3)]
|
|
public float Z
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
}
|
|
|
|
[ProtoContract]
|
|
public class PlayerInfo
|
|
{
|
|
[ProtoMember(1)]
|
|
public int PlayerId
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(2)]
|
|
public string Nickname
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(3)]
|
|
public int Level
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(4)]
|
|
public int Hp
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(5)]
|
|
public int MaxHp
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(6)]
|
|
public int Mp
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(7)]
|
|
public int MaxMp
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(8)]
|
|
public Vector3 Position
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(9)]
|
|
public float RotY
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
}
|
|
|
|
// ============================================================
|
|
// 인증
|
|
// ============================================================
|
|
|
|
// RECV_TOKEN
|
|
[ProtoContract]
|
|
public class RecvTokenPacket
|
|
{
|
|
[ProtoMember(1)]
|
|
public string Token
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
}
|
|
|
|
// LOAD_GAME 내 정보
|
|
[ProtoContract]
|
|
public class LoadGamePacket
|
|
{
|
|
[ProtoMember(1)]
|
|
public bool IsAccepted
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(2)]
|
|
public PlayerInfo Player
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(3)]
|
|
public int MaplId
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
}
|
|
|
|
// ============================================================
|
|
// 로비
|
|
// ============================================================
|
|
|
|
[ProtoContract]
|
|
public class ChannelInfo
|
|
{
|
|
[ProtoMember(1)]
|
|
public int ChannelId
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(2)]
|
|
public int ChannelUserConut
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(3)]
|
|
public int ChannelUserMax
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
}
|
|
|
|
[ProtoContract]
|
|
public class LoadChannelPacket
|
|
{
|
|
[ProtoMember(1)]
|
|
public List<ChannelInfo> Channels
|
|
{
|
|
get;
|
|
set;
|
|
} = new List<ChannelInfo>();
|
|
}
|
|
|
|
// INTO_CHANNEL 클라->서버: 입장할 채널 ID / 서버->클라: 채널 내 나 이외 플레이어 목록
|
|
[ProtoContract]
|
|
public class IntoChannelPacket
|
|
{
|
|
[ProtoMember(1)]
|
|
public int ChannelId
|
|
{
|
|
get;
|
|
set;
|
|
} // 클라->서버: 입장할 채널 ID
|
|
|
|
[ProtoMember(2)]
|
|
public List<PlayerInfo> Players
|
|
{
|
|
get;
|
|
set;
|
|
} = new List<PlayerInfo>(); // 서버->클라: 채널 내 플레이어 목록
|
|
}
|
|
|
|
// UPDATE_CHANNEL_USER 유저 접속/나감
|
|
[ProtoContract]
|
|
public class UpdateChannelUserPacket
|
|
{
|
|
[ProtoMember(1)]
|
|
public PlayerInfo Players
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(2)]
|
|
public bool IsAdd
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
}
|
|
|
|
// EXIT_CHANNEL 나가는 유저
|
|
[ProtoContract]
|
|
public class ExitChannelPacket
|
|
{
|
|
[ProtoMember(1)]
|
|
public int PlayerId
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
}
|
|
|
|
// ============================================================
|
|
// 플레이어
|
|
// ============================================================
|
|
|
|
public enum PlayerActionType
|
|
{
|
|
IDLE,
|
|
MOVE,
|
|
ATTACK,
|
|
SKILL,
|
|
DODGE,
|
|
DIE,
|
|
REVIVE
|
|
}
|
|
|
|
// TRANSFORM_PLAYER
|
|
[ProtoContract]
|
|
public class TransformPlayerPacket
|
|
{
|
|
[ProtoMember(1)]
|
|
public int PlayerId
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(2)]
|
|
public Vector3 Position
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(3)]
|
|
public float RotY
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
}
|
|
|
|
// ACTION_PLAYER
|
|
[ProtoContract]
|
|
public class ActionPlayerPacket
|
|
{
|
|
[ProtoMember(1)]
|
|
public int PlayerId
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(2)]
|
|
public PlayerActionType Action
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(3)]
|
|
public int SkillId
|
|
{
|
|
get;
|
|
set;
|
|
} // ATTACK, SKILL일 때
|
|
|
|
[ProtoMember(4)]
|
|
public int TargetId
|
|
{
|
|
get;
|
|
set;
|
|
} // 공격 대상
|
|
}
|
|
|
|
// STATE_PLAYER
|
|
[ProtoContract]
|
|
public class StatePlayerPacket
|
|
{
|
|
[ProtoMember(1)]
|
|
public int PlayerId
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(2)]
|
|
public int Hp
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(3)]
|
|
public int MaxHp
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(4)]
|
|
public int Mp
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(5)]
|
|
public int MaxMp
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
}
|
|
|
|
// ============================================================
|
|
// NPC
|
|
// ============================================================
|
|
|
|
public enum NpcActionType
|
|
{
|
|
IDLE,
|
|
MOVE,
|
|
ATTACK,
|
|
SKILL,
|
|
DIE
|
|
}
|
|
|
|
// TRANSFORM_NPC
|
|
[ProtoContract]
|
|
public class TransformNpcPacket
|
|
{
|
|
[ProtoMember(1)]
|
|
public int NpcId
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(2)]
|
|
public Vector3 Position
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(3)]
|
|
public float RotY
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
}
|
|
|
|
// ACTION_NPC
|
|
[ProtoContract]
|
|
public class ActionNpcPacket
|
|
{
|
|
[ProtoMember(1)]
|
|
public int NpcId
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(2)]
|
|
public NpcActionType Action
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(3)]
|
|
public int PatternId
|
|
{
|
|
get;
|
|
set;
|
|
} // 사용 패턴/스킬 번호
|
|
|
|
[ProtoMember(4)]
|
|
public int TargetId
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
}
|
|
|
|
// STATE_NPC
|
|
[ProtoContract]
|
|
public class StateNpcPacket
|
|
{
|
|
[ProtoMember(1)]
|
|
public int NpcId
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(2)]
|
|
public int Hp
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(3)]
|
|
public int MaxHp
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(4)]
|
|
public int Phase
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
}
|
|
|
|
// ============================================================
|
|
// 데미지
|
|
// ============================================================
|
|
|
|
// DAMAGE
|
|
[ProtoContract]
|
|
public class DamagePacket
|
|
{
|
|
[ProtoMember(1)]
|
|
public int AttackerId
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(2)]
|
|
public int TargetId
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(3)]
|
|
public int Amount
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(4)]
|
|
public bool IsCritical
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
}
|
|
|
|
// ============================================================
|
|
// 파티
|
|
// ============================================================
|
|
|
|
public enum PartyUpdateType
|
|
{
|
|
CREATE,
|
|
DELETE
|
|
}
|
|
|
|
public enum UserPartyUpdateType
|
|
{
|
|
JOIN,
|
|
LEAVE
|
|
}
|
|
|
|
// UPDATE_PARTY
|
|
[ProtoContract]
|
|
public class UpdatePartyPacket
|
|
{
|
|
[ProtoMember(1)]
|
|
public int PartyId
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(2)]
|
|
public PartyUpdateType Type
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(3)]
|
|
public int LeaderId
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
}
|
|
|
|
// UPDATE_USER_PARTY
|
|
[ProtoContract]
|
|
public class UpdateUserPartyPacket
|
|
{
|
|
[ProtoMember(1)]
|
|
public int PartyId
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(2)]
|
|
public int PlayerId
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[ProtoMember(3)]
|
|
public UserPartyUpdateType Type
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
}
|