EOSERV Forum > Programming > I need help with server checker packets?
Topic is locked.
Page: << 1 >>
I need help with server checker packets?
Author Message
Post #195613 I need help with server checker packets?

When I send :

    PacketBuilder packet(PACKET_PLAYERS, PACKET_REQUEST);
    packet.AddByte(255);
    send(packet);


the server dc's the client, and prints out this error:
[WRN] Closing client connection sending a non-init packet before init.

Anyway I'm just wondering how the SLN is able to send the players,request packet or if anyone knows the correct packet structures I need to be sending and receiving?

My basic code looks like this!

void get_playerlist()
{
    PacketBuilder packet(PACKET_PLAYERS, PACKET_REQUEST);
    packet.AddByte(255);
    send(packet);

    std::unique_ptr<PacketReader> reader = get(PACKET_F_INIT,PACKET_A_INIT);
 
    char action = reader->GetChar();
    int online = reader->GetShort();
    reader->GetByte();

    Console::Out("Online players:" +util::to_string(online));

    for(int i = 0; i < online; ++i)
    {
       std::string character_name = reader->GetBreakString();
       std::string character_title = reader->GetBreakString();
       reader->GetChar();
       int admin =  reader->GetChar();
       int clas =  reader->GetChar();
       std::string tag = reader->GetEndString();
       reader->GetByte();

       Console::Out("Character name: " + character_name + " Title: " + 
character_title + " Admin: " + util::to_string(admin) + " Class:  " +util::to_string(clas) + " Guild: " + tag);
    }
}




10 years, 32 weeks ago
Post #195614 Re: I need help with server checker packets?

The secret is in the error message. Also, when building a client from ground up you aren't necessarily bound by the rules the server has in place for the EO client. Tbh it would be wise to use the current structure as an example and build up packet handling between the two as needed. There is a lot of data transfer to be saved by doing this.

10 years, 32 weeks ago
Post #195615 Re: I need help with server checker packets?

I'm just wondering why the sln seems to only send Packet Players[22]_Request[1] when I record the packets from the sln checkin?

I understand that and I'm planning on revamping alot of unneeded things vult-r did. This is just a little side project. I'm trying to create a basic console app to check online servers,which I thought would be easy but i've been stuck for a few hours now.I'm not good with packet editor's or I'd just record the packets being sent and received!

10 years, 32 weeks ago
Post #195616 Re: I need help with server checker packets?
insomniac posted: (22nd May 2014, 04:02 pm)

I'm just wondering why the sln seems to only send Packet Players[22]_Request[1] when I record the packets from the sln checkin?

I understand that this is just a little side project, I'm trying to create a basic console app to check online servers,which I thought would be easy but i've been stuck for a few hours now.I'm not good with packet editor's or I'd just record the packets being sent and received!


Does EOSERV disable sending out the online list this way if SLN is disabled? It would make sense that most/all of the servers have it disabled by now, for performance reasons or what have you.
---
Wish upon a star!
10 years, 32 weeks ago
Post #195617 Re: I need help with server checker packets?

In the newer revs he runs a check!

// Requested a list of online players
void Players_List(EOClient *client, PacketReader &reader)
{

    if (!client->server()->world->config["SLN"] && !client->server()->world->config["AllowStats"]
     && (!client->player || (client->player && !client->player->character)))
    {
        return;
    }

The old revs he doesnt!

Edit: I have it figured it out "without and editor" I may not be 100% correct and it tripped me out, I had to send the packet raw similar to init packet, and resend it normal! Main and Edge reject my request, guess I can do as I have in the past and create a a work around!

10 years, 32 weeks ago
Page: << 1 >>
Topic is locked.
EOSERV Forum > Programming > I need help with server checker packets?