#A fake player that is able to take actions via packets sent to the server on its behalf

66 messages · Page 1 of 1 (latest)

leaden iron
#

Hi, I'm pretty new to modding. My idea is that the server knows what a real player is doing by processing the packets that it receives from the real player. Theoretically, if we had a list of timestamped packets and provided them to the server in some way that attributed them to a fake player (ServerPlayerEntity), then the server would move the fake player accordingly exactly as though it were a real player.

Then, we could do fun things like listen to a real player's packets, and resend them to the server on behalf of the fake player on a 5 second delay, and the fake player would repeat all of the real player's actions on a 5 second delay. We could even create a fake player on a totally different server from the real player, and livestream packets from the real player to the other server where a fake player recreates their actions (this is the main goal; synchronize player actions across two servers by passing packets between them).

I currently am using the carpet mod's fake serverPlayerInterface and FakeClientConnection, and am successfully able to spawn a clone of a player when that player joins the world. However, because the connection is fake, I don't know how to send packets to the server, and mocking the entire connection seems prohibitively difficult for me. Is there another approach I should use, or a way to proceed with this approach?

Thanks for the help

#

I'm currently on 1.20.4 😦

iron sleet
#

i don't understand if you are trying to make other players "use ur packets" or just repeat ur own packets on a 2nd connection

leaden iron
#

sort of, yes

iron sleet
#

there'd be a lot of issues with that unless when u join the server both the 2 connections are in basically exact same state especially player position

leaden iron
#

currently I'm trying to achieve this in a singleplayer world

cunning plumeBOT
#

We do not support hacked clients, cheats, or modifications that are intended to give you the upper hand in a server, competitive or otherwise.
See rule 1 in #welcome and the Discord TOS: https://discordapp.com/terms

leaden iron
#

this isn't cheats

#

and it's not for use on servers I don't own

#

why would I want to do this via packets if I were cheating

#

instead of a macro-type cheat

#

this would be a horribly inefficient way to cheat

#

the ultimate goal is to link two users peer-to-peer, each one hosting their own server, each local server listens for its player's packets and sends them to the nonlocal server, which has created a dummy entity representing the opponent, and applies those packets to the dummy opponent

#

synchronization via rollback netcode

#

it is a bear of a project and this is step 1

#

there is zero plan to bot and i don't even know how that would work

#

i get the concern

cunning plumeBOT
#

We do not support hacked clients, cheats, or modifications that are intended to give you the upper hand in a server, competitive or otherwise.
See rule 1 in #welcome and the Discord TOS: https://discordapp.com/terms

leaden iron
#

there is literally no intention to cheat

#

anticheat is going to be a major part of this project

#

i feel like you didn't read my message stating the goal

#

if you are connecting two players peer-to-peer, and each is hosting their own local copy of the same synchronized server, and they are fighting, then you need to put protections in place to make sure that the players are not cheating

#

again, the goal is peer-to-peer 1v1 pvp matches

#

with rollback netcode

#

in which each participant is hosting a local copy of the same synchronized server, and passing their inputs to the other player so that that player can apply those inputs to the dummy representing their opponent

#

i have no idea how to prove this to you? idk read my messages in here they're all about the same thing, and i've stated this same goal repeatedly

#

for my implementation the mod has to run serverside

#

i have to own the server

leaden iron
#

both players will be running the mod, and the mod will have to assess the packets received from its opponent and the packets it has sent to the opponent to come to a deterministic decision about what the current game state is

#

also this mock handler lacks the functionality that would be needed to actually send packets, I believe

next moat
#

stop accusing of cheating

#

ye but it makes you a jerk

#

innocent until proven guilty

#

actually how would he even cheat. if I'm reading this right, this needs a server side mod so he cant use a client to even cheat with it.

next moat
#

clearly

#

aint no way someone is calling cheats when its a server side mod

#

might be dumbest shit all month

#

but whatever

leaden iron
#

it is easier to open a beginner's help thread and accuse them of cheating for a quick dopamine boost than to actually help

next moat
#

and lol he went away

leaden iron
#

i've spent the last two weeks trying to figure out how to stop people from cheating on a peer to peer dual-host synced connection

#

lol

next moat
#

lan?

leaden iron
#

eventually anywhere

next moat
#

what is dual host

leaden iron
#

both individuals host their own copy of the same world, and the mod connects them, sends their client packets to each other's server, and synchronizes them

next moat
#

what if its not the same world

leaden iron
#

this allows for some very nice latency optimizations

leaden iron
next moat
#

ok

leaden iron
#

but the first problem i'm trying to solve is essentially how to act as though both players are connected to both servers at once

#

my first thought was let each player play on his own server, and let the mod throw the packets to the opponent to mock him on the opponent's server

next moat
#

goodluck

leaden iron
#

thanks

misty holly
dim depot
#

Stop rage baiting. Strike 1.

#

If you can't help in a constructive way then don't say anything at all. Keep causing meaningless drama and I will not hesitate from pinging the moderators.

leaden iron
#

you could use a relay server and open to LAN, but then you don’t get any of the latency benefits of a peer to peer connection, and you can’t get any of the benefits of rollback netcode because calculations are still happening remotely

leaden iron
#

bumping: still looking for opinions in best approach to this issue

#

I’m considering the server maintaining its own list of fake entity references, and reworking the code within the server that processes each type of packet to apply the game logic corresponding to processing that packet for any given serverplayerentity, but not sure if this is viable

icy wagon
#

is the fake player (FakePlayerNetworkHandler) an entity in the world? so that i could control it, like making him walk, etc?