Mooege源码研究系列2
服务器最原始的任务就是解析出客户端发来的信息然后反馈给客户端信息
mooege中一个抽象类GameMessage,
首先该类有个静态方法
public static T Allocate<T>(Opcodes opcode) where T : GameMessage
public abstract void Parse(GameBitBuffer buffer);public abstract void Encode(GameBitBuffer buffer);
public override void Parse(GameBitBuffer buffer) { PlayerIndex = buffer.ReadInt(3); } public override void Encode(GameBitBuffer buffer) { buffer.WriteInt(3, PlayerIndex); }