Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server Maintainance always in CMD #26

Closed
actuallydoc opened this issue Jan 21, 2023 · 46 comments
Closed

Server Maintainance always in CMD #26

actuallydoc opened this issue Jan 21, 2023 · 46 comments

Comments

@actuallydoc
Copy link

What is the configuration of the json file???.... I always get that the server is under maintainance even tho its not.

@ZTzTopia
Copy link
Owner

can you show me your config.json file and the log from your cmd?

@actuallydoc
Copy link
Author

image
image

@actuallydoc
Copy link
Author

Also i did build it my self and now its only like this
image

@ZTzTopia
Copy link
Owner

oh wait, did you change your hosts file?

@actuallydoc
Copy link
Author

Ohh do i have to redirect gt to local host?.

@ZTzTopia
Copy link
Owner

yeah

@actuallydoc
Copy link
Author

What do i put there localhost growtopia1.com?

@ZTzTopia
Copy link
Owner

127.0.0.1 www.growtopia1.com
127.0.0.1 www.growtopia2.com

@actuallydoc
Copy link
Author

Uhmm do i have to restart the pc after that cuz gt still can connect without the proxy on.

@ZTzTopia
Copy link
Owner

maybe restart your growtopia?

@actuallydoc
Copy link
Author

It still goes directly into the game.

@ZTzTopia
Copy link
Owner

umm 🤔, it should work after restarting growtopia

@actuallydoc
Copy link
Author

it works with restarting the pc. but its spamming
image

@ZTzTopia
Copy link
Owner

ZTzTopia commented Jan 21, 2023

your config server.host is growtopia1.com? if yes you need change to ip address of growtopia1.com

@actuallydoc
Copy link
Author

it was this
image
if i try with growtopia1.com its
image

@ZTzTopia
Copy link
Owner

maybe try with 52.44.28.101?

@actuallydoc
Copy link
Author

It works. how did you get this ip?.

@actuallydoc
Copy link
Author

Thanks....

@ZTzTopia
Copy link
Owner

open terminal and ping growtopia2.com

@actuallydoc
Copy link
Author

Thanks

@actuallydoc
Copy link
Author

What does it mean by "Server is using a new packet"

@actuallydoc actuallydoc reopened this Jan 21, 2023
@ZTzTopia
Copy link
Owner

ZTzTopia commented Jan 21, 2023

type2 in server_data.php is set to one. It adds a new header i.e. enet_uint16 integrity[3] to ENetProtocolHeader.

@actuallydoc
Copy link
Author

i have no idea what this stuff is..... never did any enet programming or c++

@ZTzTopia
Copy link
Owner

it's like an additional (integrity) check for growtopia whether the data sent from the same port or not, to ensure that it has not been tampered with during transmission. But it is so useless 🤣

@actuallydoc
Copy link
Author

Uhm.. is there a function that can send a custom packet to the server? i will be trying to understand the code base. i partly understand c++ but its harder to read code from someone else.. 👍 do you use clion or visual studio?

@ZTzTopia
Copy link
Owner

what do you mean by custom packet? the proxy have the function send_raw_packet to send raw packets in extended_data parameter. I think my proxy code base is not very good.
I use clion

@actuallydoc
Copy link
Author

Uhmm so you have to construct the packet and send with with send_raw_packet?.

@actuallydoc
Copy link
Author

I will be trying to understand ur code base anyway i need to understand what ur functions are doing with parsing and all that extra stuff.

@actuallydoc
Copy link
Author

When will you implement more features?? i see that there is a prefix for a command.

@ZTzTopia
Copy link
Owner

Uhmm so you have to construct the packet and send with with send_raw_packet?.

yeah

@ZTzTopia
Copy link
Owner

When will you implement more features?? i see that there is a prefix for a command.

before 3.92 there was a command feature but i removed it after.

@actuallydoc
Copy link
Author

cuz its not possible to do them again or ?...

@ZTzTopia
Copy link
Owner

#25

@actuallydoc
Copy link
Author

Oh okay....

@koftrciali
Copy link
Contributor

koftrciali commented Jan 23, 2023

Example Put dirt
Server.cpp :

case player::PACKET_STATE: {
        x = packet->vec_x; // member variable x
        y = packet->vec_y; //member variable y
        
        break;
    }

we get x and y of player when player moved
Client.cpp :

void Client::put(uint16_t id)
{
    player::GameUpdatePacket pkt;
    pkt.type = player::PACKET_TILE_CHANGE_REQUEST;
    pkt.int_data = id;
    pkt.pos_x = m_server->x;
    pkt.pos_y = m_server->y;
    pkt.int_x = (int)(m_server->x / 31.8F) + 1;
    pkt.int_y = (int)(m_server->y / 31.8F);
    m_peer->send_raw_packet(player::NET_MESSAGE_GAME_PACKET, &pkt);
}

when put(2) is called it will put dirt to right
2 is id of dirt u can check ids at: https://fasthub.cc/byL1N3/Growtopia-Item-Database/blob/main/item_ids.txt
31.8 is size of block

@koftrciali
Copy link
Contributor

Curent www.growtopia1.com ip is "213.14.202.18" u can try it

@actuallydoc
Copy link
Author

As i can see you know what ur talking about.... how would you parse a prefix from the message and get the command after the prefix so you can make !drop , !put , !break.

@actuallydoc
Copy link
Author

Also i dont get any linting with clion any idea why?.

@actuallydoc
Copy link
Author

Also i did try to implement the function u sent above but after sending a packet it doesnt do anything.

@koftrciali
Copy link
Contributor

Also i did try to implement the function u sent above but after sending a packet it doesnt do anything.

When did you call it

@actuallydoc
Copy link
Author

randomly when in a word. i had dirt in inventory and the world was random.

@koftrciali
Copy link
Contributor

Also i dont get any linting with clion any idea why?.
Add this to Server.cpp on generic text

auto action = text_parse.get("action", 1);
    if (action == "input")
    {
        std::string input = &text_parse.m_data[1][6];
        if (input[0] == '!') {
            //Found
        }
    }

@koftrciali
Copy link
Contributor

koftrciali commented Jan 23, 2023

randomly when in a word. i had dirt in inventory and the world was random.

auto action = text_parse.get("action", 1);
    if (action == "input")
    {
        std::string input = &text_parse.m_data[1][6];
        if (input[0] == '!') {
            m_client->put(2);
        }
    }

when u write something starting with ! it will place dirt

@actuallydoc
Copy link
Author

Where do i put those lines in client.cpp? where is the packet parsed and checked.

@koftrciali
Copy link
Contributor

to Server.cpp chat message is sent by Growtopia Client

@koftrciali
Copy link
Contributor

koftrciali commented Jan 23, 2023

Where do i put those lines in client.cpp? where is the packet parsed and checked.

https://github.com/ZTzTopia/GTProxy/blob/dev/src/server/server.cpp#L136
Line 136

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants