public int UGCRead(SteamTypes.UGCHandle handle, byte[] data, uint offset, UGCReadAction action)
        {
            CheckIfUsable();

            using (NativeBuffer buffer = new NativeBuffer(data))
            {
                int bytesRead = NativeMethods.Cloud_UGCRead(handle.AsUInt64, buffer.UnmanagedMemory,
                                                            buffer.UnmanagedSize, offset, (int)action);
                buffer.ReadFromUnmanagedMemory(bytesRead);
                return(bytesRead);
            }
        }
 public int GetNextOutgoingPacket(byte[] data, out uint netAdr, out ushort port)
 {
     //CheckIfUsable();
     netAdr = 0;
     port   = 0;
     using (NativeBuffer packetBuffer = new NativeBuffer(data))
     {
         int result = NativeMethods.GameServer_GetNextOutgoingPacket(packetBuffer.UnmanagedMemory, packetBuffer.UnmanagedSize, ref netAdr, ref port);
         packetBuffer.ReadFromUnmanagedMemory(result);
         return(result);
     }
 }
예제 #3
0
        public bool RetrieveDataFromSocket(NetSocketHandle socket, byte[] dest, out uint msgSize)
        {
            CheckIfUsable();
            msgSize = 0;
            using (NativeBuffer bufferKey = new NativeBuffer(dest))
            {
                bool result = NativeMethods.Networking_RetrieveDataFromSocket(socket.AsUInt32,
                                                                              bufferKey.UnmanagedMemory, (uint)bufferKey.UnmanagedSize, ref msgSize);
                bufferKey.ReadFromUnmanagedMemory((int)msgSize);

                return(result);
            }
        }
예제 #4
0
 public int GetGlobalStatHistory(string name, out double[] data, int historyDays)
 {
     CheckIfUsable();
     byte[] byteData = new byte[historyDays * sizeof(double)];
     using (NativeBuffer buffer = new NativeBuffer(byteData))
     {
         int result = NativeMethods.Stats_GetGlobalStatHistoryDouble(name, buffer.UnmanagedMemory,
                                                                     (uint)historyDays);
         buffer.ReadFromUnmanagedMemory(result);
         data = NativeBuffer.ToDouble(byteData);
         return(result);
     }
 }
예제 #5
0
        public bool ReadP2PPacket(byte[] dest, out uint msgSize, out SteamID steamIDRemote, int channel = 0)
        {
            CheckIfUsable();
            msgSize = 0;

            using (NativeBuffer bufferKey = new NativeBuffer(dest))
            {
                ulong rawCreator  = 0;
                bool  returnvalue = NativeMethods.Networking_ReadP2PPacket(bufferKey.UnmanagedMemory,
                                                                           (uint)bufferKey.UnmanagedSize, ref msgSize, ref rawCreator, channel);
                steamIDRemote = new SteamID(rawCreator);
                bufferKey.ReadFromUnmanagedMemory((int)msgSize);
                return(returnvalue);
            }
        }
        public int GetLobbyChatEntry(SteamID steamIDLobby, int chatID, out SteamID steamIDUser, byte[] data, out ChatEntryType chatEntryType)
        {
            CheckIfUsable();
            ulong rawCreator    = 0;
            int   chatEntryTemp = 0;

            using (NativeBuffer buffer = new NativeBuffer(data))
            {
                int result = NativeMethods.MatchMaking_GetLobbyChatEntry(steamIDLobby.AsUInt64, chatID, ref rawCreator, buffer.UnmanagedMemory, buffer.UnmanagedSize, ref chatEntryTemp);
                buffer.ReadFromUnmanagedMemory(result);

                steamIDUser   = new SteamID(rawCreator);
                chatEntryType = (ChatEntryType)chatEntryTemp;
                return(result);
            }
        }