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 9180485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:04:02+00:00 2026-06-17T18:04:02+00:00

I’m completely burned out on this one, but why am I getting: client.cpp: In

  • 0

I’m completely burned out on this one, but why am I getting:

client.cpp: In member function 'void Client::netRead(int, int)':
client.cpp:158:57: error: no matching function for call to 'Client::nextGameUpdate(sf::Vector2i [0], int [0], sf::IpAddress [0], int&)'
client.cpp:158:57: note: candidate is:
client.cpp:85:6: note: void Client::nextGameUpdate(sf::Vector2i, int, sf::IpAddress, int)
client.cpp:85:6: note:   no known conversion for argument 1 from 'sf::Vector2i [0] {aka sf::Vector2<int> [0]}' to 'sf::Vector2i {aka sf::Vector2<int>}'
[Finished in 4.7s]

    void Client::nextGameUpdate(sf::Vector2i qq, int ww, sf::IpAddress cc, int dataSize)
    {
        pListIP[dataSize] = cc;
        pListVec[dataSize] = qq;
        pListRot[dataSize] = ww;

        int num_pListIP = sizeof(pListIP)/sizeof(sf::IpAddress);
        if (num_pListIP == lastPlayerCount)
        {
            return;
        }
        else if (num_pListIP > lastPlayerCount)
        {
            int new_players = num_pListIP - lastPlayerCount;
            for (new_players; new_players>0; new_players--)
            {
                addPlayer();


}
    }
    else if (num_pListIP < lastPlayerCount)
    {
        int dc_players = lastPlayerCount - num_pListIP;
        for (dc_players; dc_players>0; dc_players--)
        {
            removePlayer();
        }
    }
    lastPlayerCount = num_pListIP;
}

void Client::netRead(int net_step, int dataSize)
{
    sf::Packet player_vectors;
    sf::Packet player_rotations;
    sf::Packet player_ips;

    switch (net_step)
    {
        case 1:
            if (socket.receive(player_vectors, sender, senderPort) != sf::Socket::Done)
                return;
            while (dataSize>0)
            {
                sf::Vector2i tmp_vec;
                player_vectors >> tmp_vec.x >> tmp_vec.y;
                pListVec[dataSize] = tmp_vec;
                dataSize--;
            }
            break;
        case 2:
            if (socket.receive(player_rotations, sender, senderPort) != sf::Socket::Done)
                return;
            while (dataSize>0)
            {
                int tmp_rot;
                player_rotations >> tmp_rot;
                pListRot[dataSize] = tmp_rot;
                dataSize--;
            }
            break;
        case 3:
            if (socket.receive(player_ips, sender, senderPort) != sf::Socket::Done)
                return;
            while (dataSize>0)
            {
                std::string tmp_str;
                player_ips >> tmp_str;
                sf::IpAddress tmp_ips = tmp_str;
                pListIP[dataSize] = tmp_ips;
                dataSize--;
            }
            break;
    }
    nextGameUpdate(pListVec, pListRot, pListIP, dataSize);
}

Header

private:
sf::Vector2i pListVec[];
sf::IpAddress pListIP[];
int pListRot[];

I feel like it has something to do with the array I’m trying to fill with sf::Vector2i… /me stares blankly at screen

So very simply put. netRead gets info from another function that is very basic. Then the switch goes through the net_step int…

After the game has received all the packets needed to continue, we trigger the nextGameUpdate() and send it 3 arrays and a dataSize int variable.

Thanks in advance if you figure this one out. ^^

  • 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-17T18:04:04+00:00Added an answer on June 17, 2026 at 6:04 pm

    You are trying to pass pListVec into qq where the former is an array of Vector2i and the latter is a single Vector2i.

    But there is also a bug in your logic. Substitute pListVec into qq in your update function, and the second statement reads:

    pListVec[dataSize] = pListVec;

    That cannot possibly be what you intended to do.


    Also, since pListVec is a private field of your class, there is no need to pass it as an argument between member functions (at least in your case, where both methods are invoked on the same instance).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms
I know there's a lot of other questions out there that deal with this
I want to construct a data frame in an Rcpp function, but when I
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,

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.