VGOEmulator.net

A Development Project for the Vanguard:Saga of Heroes MMO

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • Portal
  • Project Manager
  • Bug Tracker
  • Server List
  • Wiki
  • Donate
  • Login
  • Register
  • Board index Support Linux
  • Search

Linux compile error: rev 1184

Help with the Linux x86/x64 versions of the VGOEmulator Server

Moderator: Community Managers

Post Reply
  • Print view
Advanced search
8 posts • Page 1 of 1
User avatar
John Adams
Retired
Posts: 4582
Joined: Wed Aug 28, 2013 9:40 am
Location: Phoenix, AZ.
Contact:
Contact John Adams
Website
Linux compile error: rev 1184
  • Quote

Post by John Adams » Sun Apr 05, 2015 2:42 pm

It's not liking the mashup of const char and string. Googled around a bit and saw that how to do it is exactly how Xinux did it, but Linux is complaining.

Code: Select all

Net.cpp: In member function ‘void Net::HandleChatJoinRequest(std::shared_ptr<Client>&, std::shared_ptr<WorldCharacter>&, const char*)’:
Net.cpp:1036:69: error: cannot convert ‘std::basic_string<char>::iterator {aka __gnu_cxx::__normal_iterator<char*, std::basic_string<char> >}’ to ‘const char*’ for argument ‘1’ to ‘int remove(const char*)’
  chan_name.erase(std::remove(chan_name.begin(), chan_name.end(), '"'), chan_name.end());
                                                                     ^
Net.cpp: In member function ‘void Net::HandleClientGuildRenameRank(std::shared_ptr<Client>&, PacketStruct*)’:
Net.cpp:1440:11: warning: unused variable ‘unknown1’ [-Wunused-variable]
  uint32_t unknown1 = packet->GetUInt32("unknown1");
           ^
make: *** [Net.o] Error 1
Anyone?


Note to Xinux:
Not sure what's going on here while looking this over:

Code: Select all

remove(chan_name.begin(), chan_name.end(), '"')
I thought we were removing ' ' space, not double-quotes?

And also, we shouldn't need std:: in front of string, since string and other dependencies are referenced. But that isn't the issue, just standards.
Top

Scatman
Developer
Developer
Posts: 205
Joined: Wed Aug 28, 2013 10:19 am
Re: Linux compile error: rev 1184
  • Quote

Post by Scatman » Sun Apr 05, 2015 7:15 pm

Most likely need to change
chan_name.erase(std::remove(chan_name.begin(), chan_name.end(), '"'), chan_name.end());
to
chan_name.erase(std::remove(chan_name.begin(), chan_name.end(), "\""), chan_name.end());

Using single quotes in C will make it be an integer (or a char), where using double quotes will definitely make it a string. I didn't test it though so don't quote (HA) me
Top

User avatar
John Adams
Retired
Posts: 4582
Joined: Wed Aug 28, 2013 9:40 am
Location: Phoenix, AZ.
Contact:
Contact John Adams
Website
Re: Linux compile error: rev 1184
  • Quote

Post by John Adams » Sun Apr 05, 2015 7:39 pm

Oh Scatman, how I miss you.

Unfortunately, that didn't work hehe. Stupid Linux.
Top

Scatman
Developer
Developer
Posts: 205
Joined: Wed Aug 28, 2013 10:19 am
Re: Linux compile error: rev 1184
  • Quote

Post by Scatman » Sun Apr 05, 2015 7:51 pm

Whoops, I read that wrong. That might not work. But you could do this:

Code: Select all

void Net::HandleChatJoinRequest(shared_ptr<Client>& client, shared_ptr<WorldCharacter>& character, const char* name) {
    char new_name[128]; //or a dynmaic size with strlen() of `name' + malloc
    int i, j;
    for (i = 0, j = 0; i < strlen(name); i++) {
        if (name[i] != ' ')
            new_name[j++] = name[i];
    }
    new_name[i] = '\0';
    ....
}
You could make that a function. You could also pass in another buffer and a buffer size if you want to make it common function!
Top

Scatman
Developer
Developer
Posts: 205
Joined: Wed Aug 28, 2013 10:19 am
Re: Linux compile error: rev 1184
  • Quote

Post by Scatman » Sun Apr 05, 2015 8:15 pm

Code: Select all

char * remove_spaces(const char *str) {
    size_t len, i, j;
    char *ret;

    len = strlen(str);

    //we're removing spaces, the new string can only be as long as the orignal
    if ((ret = (char *)malloc(len + 1)) == NULL) {
        //crap out of memory
        return NULL;
    }

    for (i = 0, j = 0; i < len; i++) {
        if (str[i] != ' ')
            ret[j++] = str[i];
    }

    ret[i] = '\0';

    return ret;
}
Top

Scatman
Developer
Developer
Posts: 205
Joined: Wed Aug 28, 2013 10:19 am
Re: Linux compile error: rev 1184
  • Quote

Post by Scatman » Sun Apr 05, 2015 8:16 pm

you could also pass in a variable amount of characters to remove! hang tight..
Top

Faux
Developer
Developer
Posts: 1192
Joined: Tue Jan 28, 2014 7:04 pm
Re: Linux compile error: rev 1184
  • Quote

Post by Faux » Mon Apr 06, 2015 10:50 am

Code: Select all

Net.cpp: In member function ‘void Net::HandleClientGuildRenameRank(std::shared_ptr<Client>&, PacketStruct*)’:
Net.cpp:1440:11: warning: unused variable ‘unknown1’ [-Wunused-variable]
  uint32_t unknown1 = packet->GetUInt32("unknown1");
I took care of this one. It was leftover from a bit of debugging I was doing, so I removed the line. It was just a warning, but still.
Top

User avatar
Blackstorm
Retired
Posts: 354
Joined: Thu Sep 04, 2014 11:11 am
Location: Paris, FRANCE
Contact:
Contact Blackstorm
Website
Re: Linux compile error: rev 1184
  • Quote

Post by Blackstorm » Wed May 13, 2015 9:40 am

hum odd.. since few release we have a problem with the regionsay chan... apparently it don't recover the "continent" var and the "continent" var player seem to be always empty... but in all case we should have IoD chan for the regionsay.. so why not... why the chan don't load ??

If i have time i will investigate...
Top


Post Reply
  • Print view

8 posts • Page 1 of 1

Return to “Linux”

Jump to
  • Information
  • ↳   Announcements
  • ↳   Dev Chats
  • ↳   Events
  • Community
  • ↳   General Discussions
  • ↳   VGO Team Help Requests
  • ↳   Introductions
  • ↳   Game Features
  • ↳   Wish List
  • ↳   Off-Topic
  • Support
  • ↳   How-To's
  • ↳   General Support
  • ↳   Windows
  • ↳   Linux
  • Bugs
  • ↳   Server Bugs
  • ↳   Server Bugs (Closed)
  • ↳   Content Bugs
  • ↳   Content Bugs (Closed)
  • ↳   Database Bugs
  • ↳   Tools Bugs
  • Board index
  • All times are UTC-07:00
  • Delete cookies
  • Contact us
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD