This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
gameservicewarden/src/GameServiceWarden.API/Communicable/Responses/ResponseHeader.cs
Harrison Deng dfc54fdc00 Implemented IPC system with minimal testing.
Large naming refactoring.

Added some more tests.
2021-04-08 21:36:08 -05:00

14 lines
427 B
C#

using System;
namespace GameServiceWarden.API.Communicable.Responses
{
public static class ResponseHeader
{
public static byte[] Encode(CommunicableType type, uint length) {
byte[] res = new byte[sizeof(uint) + sizeof(uint)];
BitConverter.GetBytes((uint)type).CopyTo(res, 0);
BitConverter.GetBytes(length).CopyTo(res, sizeof(uint));
return res;
}
}
}