Example #1
0
        public static void SendDataMessage(ulong steamId, long msgId, byte[] data)
        {
            string msgIdString = msgId.ToString( );

            byte[] newData = new byte[data.Length + msgIdString.Length + 1];
            newData[0] = (byte)msgIdString.Length;
            for (int r = 0; r < msgIdString.Length; r++)
            {
                newData[r + 1] = (byte)msgIdString[r];
            }

            Buffer.BlockCopy(data, 0, newData, msgIdString.Length + 1, data.Length);

            ServerNetworkManager.SendDataMessage(9000, newData, steamId);
        }
Example #2
0
        public static void SendDataMessage(ulong steamId, DataMessageType messageType, byte[] data)
        {
            //this may be unsafe, but whatever, my sanity requires the enum
            long msgId = (long)messageType;

            string msgIdString = msgId.ToString( );

            byte[] newData = new byte[data.Length + msgIdString.Length + 1];
            newData[0] = (byte)msgIdString.Length;
            for (int r = 0; r < msgIdString.Length; r++)
            {
                newData[r + 1] = (byte)msgIdString[r];
            }

            Buffer.BlockCopy(data, 0, newData, msgIdString.Length + 1, data.Length);

            ServerNetworkManager.SendDataMessage(9000, newData, steamId);
        }