Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7770195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:20:58+00:00 2026-06-01T16:20:58+00:00

I’m trying to make a SteamRE bot which uses XNA, now, I just created

  • 0

I’m trying to make a SteamRE bot which uses XNA, now, I just created a new XNA project, and slapped the SteamRE example code on it, if I run it, it works fine, but the thing is, it doesn’t actually start up the XNA window, so it can’t look for keyboard handling, etc.

If I remove the while(true) loop it works, but it won’t connect.

Here is my code, if you guys could look at this and maybe help me out, it would be great.

namespace Steam
{
  public class Game1 : Microsoft.Xna.Framework.Game
  {
    GraphicsDeviceManager graphics;
    SpriteBatch spriteBatch;

    string userName = "username";
    string passWord = "password";

    SteamClient steamClient = new SteamClient(); // initialize our client
    SteamUser steamUser;
    SteamFriends steamFriends;

    public Game1()
    {
        graphics = new GraphicsDeviceManager(this);
        Content.RootDirectory = "Content";
    }

    protected override void Initialize()
    {
        base.Initialize();
    }

    protected override void LoadContent()
    {
        spriteBatch = new SpriteBatch(GraphicsDevice);

        steamUser = steamClient.GetHandler<SteamUser>(); // we'll use this later to logon
        steamFriends = steamClient.GetHandler<SteamFriends>();

    }

    protected override void UnloadContent()
    {
    }

    KeyboardState oldState = Keyboard.GetState();

    protected override void Update(GameTime gameTime)
    {
        if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
            this.Exit();

        ConnectSteam();

        base.Update(gameTime);
    }

    public void ConnectSteam() 
    {
        steamClient.Connect(); // connect to the steam network

        while (true)
        {
            CallbackMsg msg = steamClient.WaitForCallback(true); // block and wait until a callback is posted

            msg.Handle<SteamClient.ConnectCallback>(callback =>
            {
                // the Handle function will call this lambda method for this callback

                if (callback.Result != EResult.OK)
                {
                    Console.WriteLine("Failed. 1");
                }
                //break; // the connect result wasn't OK, so something failed

                // we've successfully connected to steam3, so lets logon with our details
                Console.WriteLine("Connected to Steam3.");
                steamUser.LogOn(new SteamUser.LogOnDetails
                {
                    Username = userName,
                    Password = passWord,
                });
                Console.WriteLine("Logged on.");
            });
            msg.Handle<SteamUser.LogOnCallback>(callback =>
            {
                if (callback.Result != EResult.OK)
                {
                    Console.WriteLine("Failed. 2");
                }

                // we've now logged onto Steam3
            });
        }
    }

    public void ConnectToFPP() 
    {
        KeyboardState newState = Keyboard.GetState();  // get the newest state

        // handle the input
        if (oldState.IsKeyUp(Keys.Space) && newState.IsKeyDown(Keys.Space))
        {
            steamFriends.JoinChat(110338190871147670);
        }

        oldState = newState;  // set the new state as the old state for next time
    }

    protected override void Draw(GameTime gameTime)
    {
        GraphicsDevice.Clear(Color.CornflowerBlue);

        base.Draw(gameTime);
    }
  }
  }

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T16:20:59+00:00Added an answer on June 1, 2026 at 4:20 pm

    The problem as far as I see it is that, unless you need to constantly connect, you need to break out of your ConnectSteam code whenever you have actually connected.

    Console.WriteLine("Logged on.");
    break;
    

    Or, you could have an isConnected variable (very pseudocod-ish):

    bool isConnected = false
    while(!isConnected)
    {
        isConnected = LogonCode;
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am trying to render a haml file in a javascript response like so:
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.