예제 #1
0
        public static void Init()
        {
            collectThread = new Thread(PacketCollectionThread);
            collectThread.Start();

            RPCSerializer.Init();

            CustomRPC.DocAllRPCAttributes();
        }
예제 #2
0
        public static CustomPacket ParseCustomPacket(byte[] data)
        {
            ulong packetID = BitConverter.ToUInt64(data, 0);
            bool  ignoreID = BitConverter.ToUInt16(data, 8) == 0 ? false : true;

            int stringSize = 0;

            for (; stringSize + 8 < data.Length && data[stringSize + 10] != 0; stringSize++)
            {
            }

            string RPCName = Encoding.ASCII.GetString(data, 10, stringSize);

            byte[] clippedData = new byte[data.Length - 11 - stringSize];

            for (int i = 0; i < clippedData.Length; i++)
            {
                clippedData[i] = data[i + 9 + stringSize];
            }

            return(new CustomPacket(packetID, RPCName, ignoreID, RPCSerializer.GetCompleteDeserializedData(clippedData)));
        }
예제 #3
0
 /// <summary>
 /// ONLY FOR DEBUG USE, DO NOT, I REPEAT, DO NOT USE THIS FOR ANYTHING OTHER THAN TESTING PACKET SENDING LOCALLY!!!!!
 /// </summary>
 /// <param name="rpcName"></param>
 /// <param name="args"></param>
 public static void SendRPCToSelf(string rpcName, params object[] args)
 {
     SendPacketToPlayer(SteamUser.GetSteamID(), rpcName, RPCSerializer.GetCompleteSerializedData(args));
 }
예제 #4
0
 public static void SendRPCToPlayersInGame(string rpcName, params object[] args)
 {
     SendPacketToPlayersInGame(rpcName, RPCSerializer.GetCompleteSerializedData(args));
 }
예제 #5
0
 public static void SendRPCToPlayersInGame(string rpcName, bool isTCP = false, bool ignoreID = false, params object[] args)
 {
     SendPacketToPlayersInGame(rpcName, RPCSerializer.GetCompleteSerializedData(args), isTCP, ignoreID);
 }