Exemplo n.º 1
0
        public void FillInterfaces(BaseSteamworks steamworks, int hpipe, int huser)
        {
            var clientPtr = api.SteamInternal_CreateInterface("SteamClient017");

            if (clientPtr == IntPtr.Zero)
            {
                throw new System.Exception("Steam Server: Couldn't load SteamClient017");
            }

            client = new SteamNative.SteamClient(steamworks, clientPtr);

            user            = client.GetISteamUser(huser, hpipe, SteamNative.Defines.STEAMUSER_INTERFACE_VERSION);
            utils           = client.GetISteamUtils(hpipe, SteamNative.Defines.STEAMUTILS_INTERFACE_VERSION);
            networking      = client.GetISteamNetworking(huser, hpipe, SteamNative.Defines.STEAMNETWORKING_INTERFACE_VERSION);
            gameServerStats = client.GetISteamGameServerStats(huser, hpipe, SteamNative.Defines.STEAMGAMESERVERSTATS_INTERFACE_VERSION);
            http            = client.GetISteamHTTP(huser, hpipe, SteamNative.Defines.STEAMHTTP_INTERFACE_VERSION);
            inventory       = client.GetISteamInventory(huser, hpipe, SteamNative.Defines.STEAMINVENTORY_INTERFACE_VERSION);
            ugc             = client.GetISteamUGC(huser, hpipe, SteamNative.Defines.STEAMUGC_INTERFACE_VERSION);
            apps            = client.GetISteamApps(huser, hpipe, SteamNative.Defines.STEAMAPPS_INTERFACE_VERSION);
            gameServer      = client.GetISteamGameServer(huser, hpipe, SteamNative.Defines.STEAMGAMESERVER_INTERFACE_VERSION);
            friends         = client.GetISteamFriends(huser, hpipe, SteamNative.Defines.STEAMFRIENDS_INTERFACE_VERSION);
            servers         = client.GetISteamMatchmakingServers(huser, hpipe, SteamNative.Defines.STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION);
            userstats       = client.GetISteamUserStats(huser, hpipe, SteamNative.Defines.STEAMUSERSTATS_INTERFACE_VERSION);
            screenshots     = client.GetISteamScreenshots(huser, hpipe, SteamNative.Defines.STEAMSCREENSHOTS_INTERFACE_VERSION);
            remoteStorage   = client.GetISteamRemoteStorage(huser, hpipe, SteamNative.Defines.STEAMREMOTESTORAGE_INTERFACE_VERSION);
            matchmaking     = client.GetISteamMatchmaking(huser, hpipe, SteamNative.Defines.STEAMMATCHMAKING_INTERFACE_VERSION);
        }
Exemplo n.º 2
0
        internal bool InitClient(BaseSteamworks steamworks)
        {
            isServer = false;

            api = new SteamNative.SteamApi(steamworks, (IntPtr)1);

            if (!api.SteamAPI_Init())
            {
                return(false);
            }

            hUser = api.SteamAPI_GetHSteamUser();
            hPipe = api.SteamAPI_GetHSteamPipe();
            if (hPipe == 0)
            {
                return(false);
            }

            FillInterfaces(steamworks, hUser, hPipe);

            if (!user.IsValid)
            {
                return(false);
            }

            // Ensure that the user has logged into Steam. This will always return true if the game is launched
            // from Steam, but if Steam is at the login prompt when you run your game it will return false.
            if (!user.BLoggedOn())
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 3
0
        internal bool InitServer(BaseSteamworks steamworks, uint IpAddress /*uint32*/, ushort usPort /*uint16*/, ushort GamePort /*uint16*/, ushort QueryPort /*uint16*/, int eServerMode /*int*/, string pchVersionString /*const char **/)
        {
            isServer = true;

            api = new SteamNative.SteamApi(steamworks, ( IntPtr)1);

            if (!api.SteamInternal_GameServer_Init(IpAddress, usPort, GamePort, QueryPort, eServerMode, pchVersionString))
            {
                return(false);
            }

            hUser = api.SteamGameServer_GetHSteamUser();
            hPipe = api.SteamGameServer_GetHSteamPipe();
            if (hPipe == 0)
            {
                return(false);
            }

            FillInterfaces(steamworks, hPipe, hUser);

            if (!gameServer.IsValid)
            {
                gameServer = null;
                throw new System.Exception("Steam Server: Couldn't load SteamGameServer012");
            }

            return(true);
        }
Exemplo n.º 4
0
        internal bool InitClient(BaseSteamworks steamworks, out string state)
        {
            if (Steamworks.Server.Instance != null)
            {
                throw new System.Exception("Steam client should be initialized before steam server - or there's big trouble.");
            }

            isServer = false;

            api = new SteamNative.SteamApi();

            if (!api.SteamAPI_Init())
            {
                Console.Error.WriteLine("InitClient: SteamAPI_Init returned false");
                state = "InitClient: SteamAPI_Init returned false";
                return(false);
            }

            var hUser = api.SteamAPI_GetHSteamUser();
            var hPipe = api.SteamAPI_GetHSteamPipe();

            if (hPipe == 0)
            {
                Console.Error.WriteLine("InitClient: hPipe == 0");
                state = "InitClient: hPipe == 0";
                return(false);
            }

            FillInterfaces(steamworks, hUser, hPipe);

            if (!user.IsValid)
            {
                Console.Error.WriteLine("InitClient: ISteamUser is null");
                state = "InitClient: ISteamUser is null";
                return(false);
            }

            // Ensure that the user has logged into Steam. This will always return true if the game is launched
            // from Steam, but if Steam is at the login prompt when you run your game it will return false.
            if (!user.BLoggedOn())
            {
                Console.Error.WriteLine("InitClient: Not Logged On");
                state = "InitClient: Not Logged On";
                return(false);
            }

            state = "Loaded";
            return(true);
        }
Exemplo n.º 5
0
        internal bool InitClient(BaseSteamworks steamworks)
        {
            isServer = false;

            api = new SteamNative.SteamApi();

            if (!api.SteamAPI_Init())
            {
                Console.Error.WriteLine("InitClient: SteamAPI_Init returned false");
                return(false);
            }

            hUser = api.SteamAPI_GetHSteamUser();
            hPipe = api.SteamAPI_GetHSteamPipe();
            if (hPipe == 0)
            {
                Console.Error.WriteLine("InitClient: hPipe == 0");
                return(false);
            }

            FillInterfaces(steamworks, hUser, hPipe);

            if (!user.IsValid)
            {
                Console.Error.WriteLine("InitClient: ISteamUser is null");
                return(false);
            }

            // Ensure that the user has logged into Steam. This will always return true if the game is launched
            // from Steam, but if Steam is at the login prompt when you run your game it will return false.
            if (!user.BLoggedOn())
            {
                Console.Error.WriteLine("InitClient: Not Logged On");
                return(false);
            }

            return(true);
        }
Exemplo n.º 6
0
        internal bool InitClient(BaseSteamworks steamworks)
        {
            if (Steamworks.Server.Instance != null)
            {
                throw new System.Exception("Steam client should be initialized before steam server - or there's big trouble.");
            }

            isServer = false;

            api = new SteamNative.SteamApi();

            if (!api.SteamAPI_Init())
            {
                Console.Error.WriteLine("InitClient: SteamAPI_Init returned false");
                return(false);
            }

            var hUser = api.SteamAPI_GetHSteamUser();
            var hPipe = api.SteamAPI_GetHSteamPipe();

            if (hPipe == 0)
            {
                Console.Error.WriteLine("InitClient: hPipe == 0");
                return(false);
            }

            FillInterfaces(steamworks, hUser, hPipe);

            if (!user.IsValid)
            {
                Console.Error.WriteLine("InitClient: ISteamUser is null");
                return(false);
            }

            return(true);
        }
Exemplo n.º 7
0
 // Token: 0x060002E1 RID: 737 RVA: 0x000048BB File Offset: 0x00002ABB
 static Networking smethod_2(BaseSteamworks baseSteamworks_0)
 {
     return(baseSteamworks_0.Networking);
 }
Exemplo n.º 8
0
 internal CallbackHandle(Facepunch.Steamworks.BaseSteamworks steamworks)
 {
     Steamworks = steamworks;
 }