ZTzTopia / GTProxy

⚖️ A proxy for growtopia. NO SHADOW BAN!
MIT License
55 stars 38 forks source link

Server Maintainance always in CMD #26

Closed actuallydoc closed 1 year ago

actuallydoc commented 1 year ago

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

ZTzTopia commented 1 year ago

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

actuallydoc commented 1 year ago

image image

actuallydoc commented 1 year ago

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

ZTzTopia commented 1 year ago

oh wait, did you change your hosts file?

actuallydoc commented 1 year ago

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

ZTzTopia commented 1 year ago

yeah

actuallydoc commented 1 year ago

What do i put there localhost growtopia1.com?

ZTzTopia commented 1 year ago

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

actuallydoc commented 1 year ago

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

ZTzTopia commented 1 year ago

maybe restart your growtopia?

actuallydoc commented 1 year ago

It still goes directly into the game.

ZTzTopia commented 1 year ago

umm 🤔, it should work after restarting growtopia

actuallydoc commented 1 year ago

it works with restarting the pc. but its spamming image

ZTzTopia commented 1 year ago

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

actuallydoc commented 1 year ago

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

ZTzTopia commented 1 year ago

maybe try with 52.44.28.101?

actuallydoc commented 1 year ago

It works. how did you get this ip?.

actuallydoc commented 1 year ago

Thanks....

ZTzTopia commented 1 year ago

open terminal and ping growtopia2.com

actuallydoc commented 1 year ago

Thanks

actuallydoc commented 1 year ago

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

ZTzTopia commented 1 year ago

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

actuallydoc commented 1 year ago

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

ZTzTopia commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

actuallydoc commented 1 year ago

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 commented 1 year ago

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

ZTzTopia commented 1 year ago

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

yeah

ZTzTopia commented 1 year ago

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 commented 1 year ago

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

ZTzTopia commented 1 year ago

25

actuallydoc commented 1 year ago

Oh okay....

koftrciali commented 1 year ago

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 commented 1 year ago

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

actuallydoc commented 1 year ago

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 commented 1 year ago

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

actuallydoc commented 1 year ago

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

koftrciali commented 1 year ago

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 commented 1 year ago

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

koftrciali commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

koftrciali commented 1 year ago

to Server.cpp chat message is sent by Growtopia Client

koftrciali commented 1 year ago

dm me if cant do discord:koftrciali#8433

koftrciali commented 1 year ago

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