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 Bugs Server Bugs Server Bugs (Closed)
  • Search

account_id == 0

Closed Server Bugs

Moderators: Community Managers, Developers

Locked
  • Print view
Advanced search
4 posts • Page 1 of 1
Lokked
Principle Developer
Principle Developer
Posts: 600
Joined: Wed Aug 06, 2014 3:15 pm
account_id == 0
  • Quote

Post by Lokked » Thu Jan 08, 2015 4:53 pm

I'm at work, just providing what information I know before I forget:

This function handles received packets from the VGO Client to the WorldServer, prior to connecting to a Chunk Server (where a user could potentially create a character).

Here the packet contains the account ID that is set on the Client. I'm guessing Login Server tells the Client at some point what ID they are. I'll continue looking.

Code: Select all

void Net::HandleNewSession(shared_ptr<Client>& client, PacketStruct *packet_struct) {
    const char *account_id, *session_id;

    account_id = packet_struct->GetString32("AccountId");
    session_id = packet_struct->GetString32("SessionId");

    LogInfo(LOG_NET, 0, "New Session: Account ID: %s  Session ID: '%s'", account_id, session_id);

    client->SetAccountID(atoul(account_id));
    client->SetSessionID(session_id);

    //We know need to request the account name from login :/
    //Yeah, it's the only way to do it since world does not have access to login's database.
    //Once we get the account info, do the rest in SendAccountInfo below
    login.SendAccountInfoRequest(client->GetAccountID(), client->GetConnectionID());
}
Top

Lokked
Principle Developer
Principle Developer
Posts: 600
Joined: Wed Aug 06, 2014 3:15 pm
Re: account_id == 0
  • Quote

Post by Lokked » Thu Jan 08, 2015 4:56 pm

From Login, this is where the Client object first receives it's account_id:

Code: Select all

bool LoginDatabase::LoadAccountInfo(shared_ptr<Client>& client) {
	DatabaseResult result;
    char *session_id_esc = NULL;
    bool success = true;

    if ((session_id_esc = database.Escape(client->GetSessionID())) == NULL)
        return false;

	LogDebug(LOG_ACCOUNT, 0, "Loading Account info...");

	success = database.Select(&result, "SELECT a.`account_id`,a.`account_name`\n"
                                       "FROM `ls_sessions` s\n"
                                       "INNER JOIN `ls_accounts` a ON a.`account_id`=s.`session_account_id`\n"
                                       "WHERE s.`session_id`='%s'", session_id_esc);

    free(session_id_esc);

    if (!success) {
        LogError(LOG_DATABASE, 0, "Error getting account information for session ID '%s': %s", client->GetSessionID(), database.GetError());
        return false;
    }

    if (!result.Next()) {
        LogError(LOG_DATABASE, 0, "No account information found for session ID '%s'", client->GetSessionID());
        LogError(LOG_DATABASE, 0, "If you're testing, simply create an entry in the session table with the session ID '%s'", client->GetSessionID());
        return false;
    }

    client->SetAccountID(result.GetUInt32(0));
    client->SetAccountName(result.GetString(1));
	
	LogDebug(LOG_ACCOUNT, 0, "Loaded Account: %s (%u)", client->GetAccountName(), client->GetAccountID());

	return true;
}
Table ls_accounts.account_id
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: account_id == 0
  • Quote

Post by John Adams » Fri Jan 09, 2015 7:27 pm

Yes, and from a database perspective, it is 100% impossible to create an ls_accounts.account_id of 0 (zero), because it is an auto-increment (for one) and a PK.

Has to be after the account fetch that the connected client is losing it's account_id.
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: account_id == 0
  • Quote

Post by John Adams » Sun Jan 11, 2015 12:13 pm

Here's something interesting from LoginServer log: I hadn't noticed this before. Just happened.

[quote]12:10:29.604 D Net Received character create request...
12:10:29.604 D Net -- Char: 'Tyber', Acct: 443, To World 'New Telon'
12:10:29.604 D Net -- Sending request to world...
12:10:29.604 D Net -- SUCCESS!
12:10:29.604 D WSList Character Request Added: 'Tyber Valens' (0)
12:10:29.604 E TCP Error writing TCP data: client does not exist[/quote]
Still no account_id = 0 in the DB yet though, so could be related to my taking NT down while this player was trying to create a character.
Top


Locked
  • Print view

4 posts • Page 1 of 1

Return to “Server Bugs (Closed)”

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