public void Send(byte flag, IMessage message) { ushort opcode = Game.Scene.GetComponent <OpcodeTypeComponent>().GetOpcode(message.GetType()); byte[] bytes = ProtobufHelper.ToBytes(message); session.Send(flag, opcode, bytes); }
public byte[] SerializeToByteArray(object obj) { return(ProtobufHelper.ToBytes(obj)); }