Jump to content

[SOLVED] [1.12.2] Every 100 packets there's a memory leak, relogging doesn't sync player capabilities


Recommended Posts

Posted (edited)

I'm working on a mod where I have to sync player capabilities from the server to the client and vice versa quite often, but every 100th packet sent causes a memory leak causing the client to not get the data from the server. Also when I exit a singleplayer world and enter it again (haven't tested on servers yet, it's probably the same though) the data from the server doesn't get synced with the client. What could be causing this?

Leak message:

  Quote

[16:24:29] [Netty Local Client IO #1/FATAL] [FML]: Detected ongoing potential memory leak. 100 packets have leaked. Top offenders
[16:24:29] [Netty Local Client IO #1/FATAL] [FML]:      fnm : 100

Expand  

PacketMana (all packets are set up this way):

import io.netty.buffer.ByteBuf;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;

public class PacketMana implements IMessage {
	EntityPlayerMP player;
    private int data;

    @Override
    public void fromBytes(ByteBuf buf) {
        IMana mana = Minecraft.getMinecraft().player.getCapability(CapabilityMana.MANA_CAPABILITY, null);
        data = mana.setMana(buf.readInt());
    }

    @Override
    public void toBytes(ByteBuf buf) {
        IMana mana = Minecraft.getMinecraft().player.getCapability(CapabilityMana.MANA_CAPABILITY, null);
        buf.writeInt(mana.getMana());
    }

    public PacketMana() {
        IMana mana = Minecraft.getMinecraft().player.getCapability(CapabilityMana.MANA_CAPABILITY, null);
        data = mana.getMana();
    }
    
    public PacketMana(EntityPlayerMP player) {
    	this.player = player;
        IMana mana = player.getCapability(CapabilityMana.MANA_CAPABILITY, null);
        data = mana.getMana();
    }

    public static class Handler implements IMessageHandler<PacketMana, IMessage> {
        @Override
        public IMessage onMessage(PacketMana message, MessageContext ctx) {
            FMLCommonHandler.instance().getWorldThread(ctx.netHandler).addScheduledTask(() -> handle(message, ctx));
            return null;
        }

        private void handle(PacketMana message, MessageContext ctx) {
            EntityPlayerMP playerEntity = ctx.getServerHandler().player;
            playerEntity.getCapability(CapabilityMana.MANA_CAPABILITY, null).setMana(message.data);
        }
    }
}

 

Events for syncing data (sync(player) is a function that sends all packets to the player):

	@SubscribeEvent
    public static void loginEvent(final PlayerLoggedInEvent event) {
    	EntityPlayerMP player = (EntityPlayerMP)event.player;
    	Minecraft.getMinecraft().addScheduledTask(() -> sync(player));
    	System.out.println("Synced");
    }
    
    @SubscribeEvent
    public static void changeDimesionEvent(final PlayerChangedDimensionEvent event) {
    	EntityPlayerMP player = (EntityPlayerMP)event.player;
    	Minecraft.getMinecraft().addScheduledTask(() -> sync(player));
    	System.out.println("Synced");
    }
    
    @SubscribeEvent
    public static void respawnEvent(final PlayerRespawnEvent event) {
    	EntityPlayerMP player = (EntityPlayerMP)event.player;
    	Minecraft.getMinecraft().addScheduledTask(() -> sync(player));
    	System.out.println("Synced");
    }
    }

 

Player Clone Event:

	@SubscribeEvent
    public static void playerClone(final PlayerEvent.Clone event) {
        final IMana oldMana = getMana(event.getOriginal());
        final IMana newMana = getMana(event.getEntityPlayer());

        if (newMana != null && oldMana != null) {
            newMana.setMaxMana(oldMana.getMaxMana());
            newMana.setManaTimer(oldMana.getManaTimer());
            newMana.setMana(oldMana.getMana());
            
            newMana.setClan(oldMana.getClan());
            newMana.setLand(oldMana.getLand());
            newMana.setAffiliation(oldMana.getAffiliation());

            newMana.setGenjutsu(oldMana.getGenjutsu());
            newMana.setTaijutsu(oldMana.getTaijutsu());
            newMana.setKenjutsu(oldMana.getKenjutsu());

            newMana.setSharingan(oldMana.getSharingan());
            newMana.setSharinganSize(oldMana.getSharinganSize());
            newMana.setSharinganPattern(oldMana.getSharinganPattern());
            newMana.setSharinganActive(oldMana.getSharinganActive());
            newMana.setByakugan(oldMana.getByakugan());
            newMana.setByakuganSize(oldMana.getByakuganSize());
            newMana.setByakuganActive(oldMana.getByakuganActive());
            newMana.setKetsuryuugan(oldMana.getKetsuryuugan());
            newMana.setKetsuryuuganActive(oldMana.getKetsuryuuganActive());
            
            newMana.setCurseMark(oldMana.getCurseMark());
            newMana.setCurseMarkSize(oldMana.getCurseMarkSize());
            newMana.setCurseMarkType(oldMana.getCurseMarkType());
            newMana.setCurseMarkActive(oldMana.getCurseMarkActive());
            
            newMana.setFireRelease(oldMana.getFireRelease());
            newMana.setWindRelease(oldMana.getWindRelease());
            newMana.setWaterRelease(oldMana.getWaterRelease());
            newMana.setLightningRelease(oldMana.getLightningRelease());
            newMana.setEarthRelease(oldMana.getEarthRelease());
            newMana.setWoodRelease(oldMana.getWoodRelease());
            newMana.setYinRelease(oldMana.getYinRelease());
            newMana.setYangRelease(oldMana.getYangRelease());
            newMana.setIceRelease(oldMana.getIceRelease());

            newMana.setShikotsumyaku(oldMana.getShikotsumyaku());

        	Minecraft.getMinecraft().addScheduledTask(() -> sync((EntityPlayerMP)event.getEntityPlayer()));
        }
        System.out.println("Player Clone Event Successful");
    }

 

Edited by FlashHUN
marked as solved
Posted
  On 3/5/2019 at 3:51 PM, diesieben07 said:

Your code shows a complete lack of understanding about sides. Read and understand the documentation.

  • Your packet needs to be sent from server to client. Not client to server.
  • Accessing the capability on the client player every time in the packet makes no sense. You need to grab the data from the server side player and send it to the client.
  • Do not send packets in PlayerEvent.Clone. 
Expand  

What if I need to edit player capability data through a GUI? How would I get the server side player in a GUI and edit their server side capabilities through the GUI? Also, when I don't send packets in the PlayerEvent.Clone the capabilities don't sync between the client and server.

Posted
  On 3/5/2019 at 5:05 PM, FlashHUN said:

What if I need to edit player capability data through a GUI? How would I get the server side player in a GUI and edit their server side capabilities through the GUI?

Expand  

You don't. When the data changes on in the GUI, you send a packet from the client to the server containing the new information. The server will receive that packet and pass it to the packet handler together with the player, where you can verify if the data is correct (to prevent cheating) and set the capability data.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted
  On 3/6/2019 at 12:00 AM, larsgerrits said:

You don't. When the data changes on in the GUI, you send a packet from the client to the server containing the new information. The server will receive that packet and pass it to the packet handler together with the player, where you can verify if the data is correct (to prevent cheating) and set the capability data.

Expand  

Alright, I was just confused because diesieben said

  On 3/5/2019 at 3:51 PM, diesieben07 said:

Your packet needs to be sent from server to client. Not client to server

Expand  

 

Anyways, I still don't know why the memory leak is happening and why the player data doesn't sync when the player relogs.

Posted

I haven't updated anything because I don't know what to update and how. Like I said, if I don't send packets in PlayerEvent.Clone, then the stuff doesn't get synced from the server to the client when the event happens. I need to be able to access data from the client side player to be able to send it to the server from the GUI. What should I do?

Posted

I did, but I don't know what to do. I'm just a beginner developer asking for help. I understand that I should be using sides, but I don't know where and when.

Posted

I understand what I should be doing now, I just don't know how and can't really find anything on it. Sorry for making you waste your time on me like this.

How can I get the data only from the server side player in the events?

How can I apply the data to the client player in the client proxy? Just simply send packets to them?

If I don't access the client side player in the IMessage, should I do this in the packets, or am I just a completely lost cause: (Sorry for not putting it in code blocks but it wouldn't load)

  Reveal hidden contents

 

CommonProxy:

  Reveal hidden contents

 

ClientProxy:

  Reveal hidden contents

 

Posted

Should the packet look something like this then? (I don't really know how else to do it without the @SidedProxy)

public class PacketMana implements IMessage {
	@SidedProxy(clientSide = References.client_proxy_class, serverSide = References.common_proxy_class)
	static CommonProxy proxy;
    MessageContext ctx;
    private int data;

    @Override
    public void fromBytes(ByteBuf buf) {
    	EntityPlayer player = proxy.getPlayerEntityFromContext(ctx);
        data = player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setMana(buf.readInt());
    }

    @Override
    public void toBytes(ByteBuf buf) {
    	EntityPlayer player = proxy.getPlayerEntityFromContext(ctx);
        buf.writeInt(player.getCapability(CapabilityMana.MANA_CAPABILITY, null).getMana());
    }

    public PacketMana() {
    	EntityPlayer player = proxy.getPlayerEntityFromContext(ctx);
        data = player.getCapability(CapabilityMana.MANA_CAPABILITY, null).getMana();
    }
    
    public PacketMana(EntityPlayer player) {
        data = player.getCapability(CapabilityMana.MANA_CAPABILITY, null).getMana();
    }

    public static class Handler implements IMessageHandler<PacketMana, IMessage> {
        @Override
        public IMessage onMessage(PacketMana message, MessageContext ctx) {
            FMLCommonHandler.instance().getWorldThread(ctx.netHandler).addScheduledTask(() -> handle(message, ctx));
            return null;
        }

        private void handle(PacketMana message, MessageContext ctx) {
            EntityPlayerMP playerEntity = ctx.getServerHandler().player;
            playerEntity.getCapability(CapabilityMana.MANA_CAPABILITY, null).setMana(message.data);
        }
    }
}

 

I need all packets in my mod to be bi-directional.

 

Events for syncing:

    private static void sync(EntityPlayer player) {
    	player.getCapability(MANA_CAPABILITY, null);
    	PacketHandler.INSTANCE.sendTo(new PacketMana(player), (EntityPlayerMP)player);
    }

    @SubscribeEvent
    public static void loginEvent(final PlayerLoggedInEvent event) {
    	EntityPlayer player = event.player;
    	Minecraft.getMinecraft().addScheduledTask(() -> sync(player));
    	System.out.println("Synced");
    }
    
    @SubscribeEvent
    public static void changeDimesionEvent(final PlayerChangedDimensionEvent event) {
    	EntityPlayer player = event.player;
    	Minecraft.getMinecraft().addScheduledTask(() -> sync(player));
    	System.out.println("Synced");
    }
    
    @SubscribeEvent
    public static void respawnEvent(final PlayerRespawnEvent event) {
    	EntityPlayer player = event.player;
    	Minecraft.getMinecraft().addScheduledTask(() -> sync(player));
    	System.out.println("Synced");
    }
    }

 

Should the handle method in my ClientProxy look like this? Or does casting EntityPlayerMP to EntityPlayer in the ClientProxy cause any problems?

    public void handleData(MessageContext ctx) {
		EntityPlayer player = Minecraft.getMinecraft().player;
		player.getCapability(CapabilityMana.MANA_CAPABILITY, null);
		
		PacketHandler.INSTANCE.sendTo(new PacketMana(player), (EntityPlayerMP)player);
	}

 

How do I pass the data from the received data from PacketHandler to the proxy?

Posted

So, should it look something like this? (At least am I getting closer to how it should look like?)

public class PacketMana implements IMessage {
    private int data;

    public PacketMana() {}
    
    public PacketMana(EntityPlayer player) {
        data = player.getCapability(CapabilityMana.MANA_CAPABILITY, null).getMana();
    }
    
    @Override
    public void fromBytes(ByteBuf buf) {
    	data = buf.readInt();
    }

    @Override
    public void toBytes(ByteBuf buf) {
        buf.writeInt(data);
    }

    public static class Handler implements IMessageHandler<PacketMana, IMessage> {
        @Override
        public IMessage onMessage(PacketMana message, MessageContext ctx) {
            FMLCommonHandler.instance().getWorldThread(ctx.netHandler).addScheduledTask(() -> handle(message, ctx));
            return null;
        }

        private void handle(PacketMana message, MessageContext ctx) {
            EntityPlayer playerEntity = ctx.getServerHandler().player;
            playerEntity.getCapability(CapabilityMana.MANA_CAPABILITY, null).setMana(message.data);
        }
    }
}

Should the

EntityPlayer playerEntity = ctx.getServerHandler().player;

be something else?

 

If I do

    @SubscribeEvent
    public static void loginEvent(final PlayerLoggedInEvent event) {
    	EntityPlayer player = event.player;
    	PacketHandler.INSTANCE.sendTo(new PacketMana(player), (EntityPlayerMP)player);
    	System.out.println("Synced");
    }
    
    @SubscribeEvent
    public static void changeDimesionEvent(final PlayerChangedDimensionEvent event) {
    	EntityPlayer player = event.player;
    	PacketHandler.INSTANCE.sendTo(new PacketMana(player), (EntityPlayerMP)player);
    	System.out.println("Synced");
    }
    
    @SubscribeEvent
    public static void respawnEvent(final PlayerRespawnEvent event) {
    	EntityPlayer player = event.player;
    	PacketHandler.INSTANCE.sendTo(new PacketMana(player), (EntityPlayerMP)player);
    	System.out.println("Synced");
    }

the EntityPlayer hasn't constructed yet in the PlayerLoggedInEvent since it fires a tick before that happens.

 

Should I just do

    public void handleData(MessageContext ctx) {
		EntityPlayer player = Minecraft.getMinecraft().player;
		player.getCapability(CapabilityMana.MANA_CAPABILITY, null);
	}

in the ClientProxy?

Posted
  On 3/7/2019 at 1:13 PM, diesieben07 said:

Yes, except you are still using the server player in the handle method. In that method you need to actually call the method in your proxy, which needs to take the data as an argument and then apply the data to the client-side player (like you do now in handle with the server-side player).

Expand  

So, then the packet should look like this?

public class PacketMana implements IMessage {
    static CommonProxy proxy;
    private int mana;

    public PacketMana() {}
    
    public PacketMana(EntityPlayer player) {
        mana = player.getCapability(CapabilityMana.MANA_CAPABILITY, null).getMana();
    }
    
    @Override
    public void fromBytes(ByteBuf buf) {
    	mana = buf.readInt();
    }

    @Override
    public void toBytes(ByteBuf buf) {
        buf.writeInt(mana);
    }

    public static class Handler implements IMessageHandler<PacketMana, IMessage> {
        @Override
        public IMessage onMessage(PacketMana message, MessageContext ctx) {
            FMLCommonHandler.instance().getWorldThread(ctx.netHandler).addScheduledTask(() -> handle(message, ctx));
            return null;
        }

        private void handle(PacketMana message, MessageContext ctx) {
        	proxy.handleMana(mana);
        }
    }
}

 

The problem then is that the

proxy.handleMana(mana);

method asks for the

mana

int to be static. Is that fine?

 

handleMana() in CommonProxy:

public void handleMana(int mana) {}

 

handleMana() in ClientProxy:

    public void handleMana(int mana) {
    	EntityPlayer player = Minecraft.getMinecraft().player;
    	player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setMana(mana);
    }

 

 

  On 3/7/2019 at 1:13 PM, diesieben07 said:
  On 3/7/2019 at 12:44 PM, FlashHUN said:

the EntityPlayer hasn't constructed yet in the PlayerLoggedInEvent since it fires a tick before that happens.

Expand  

This is not true. 

Expand  

Odd. When I did it that way the data didn't sync unless I did it through the scheduled task way.

Posted

Alright, this is how it looks now:

 

PacketHandler:

public class PacketHandler 
{
	
	 private static int packetId = 0;

	    public static SimpleNetworkWrapper INSTANCE = null;

	    public PacketHandler() {
	    }

	    public static int nextID() {
	        return packetId++;
	    }

	    public static void registerMessages(String channelName) {
	        INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel(channelName);
	        registerMessages();	
	    }

	    public static void registerMessages() {
	        INSTANCE.registerMessage(PacketMana.Handler.class, PacketMana.class, nextID(), Side.SERVER);
	    }
}

 

PacketMana:

public class PacketMana implements IMessage {
	static CommonProxy proxy;
    private int mana;

    public PacketMana() {}
    
    public PacketMana(EntityPlayer player) {
        mana = player.getCapability(CapabilityMana.MANA_CAPABILITY, null).getMana();
    }
    
    @Override
    public void fromBytes(ByteBuf buf) {
    	mana = buf.readInt();
    }

    @Override
    public void toBytes(ByteBuf buf) {
        buf.writeInt(mana);
    }

    public static class Handler implements IMessageHandler<PacketMana, IMessage> {
        @Override
        public IMessage onMessage(PacketMana message, MessageContext ctx) {
            FMLCommonHandler.instance().getWorldThread(ctx.netHandler).addScheduledTask(() -> handle(message, ctx));
            return null;
        }

        private void handle(PacketMana message, MessageContext ctx) {
        	proxy.handleMana(message.mana);
        }
    }
}

 

ClientProxy:

public class ClientProxy extends CommonProxy {

	public void registerItemRenderer(Item item, int meta, String id) {
		ModelLoader.setCustomModelResourceLocation(item,  meta,  new ModelResourceLocation(item.getRegistryName(), id));
	}
	
	public EntityPlayer getPlayerEntityFromContext(MessageContext ctx)
	{
		return Minecraft.getMinecraft().player;
	}
	
	public void handleMana(int mana) {
		EntityPlayer player = Minecraft.getMinecraft().player;
		player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setMana(mana);
	}
}

 

CommonProxy:

public class CommonProxy {

    public void registerItemRenderer(Item item, int meta, String id) {}
	
    public EntityPlayer getPlayerEntityFromContext(MessageContext ctx)
    {
        return ctx.getServerHandler().player;
    }
	
	public void handleMana(int mana) {}
}

 

CapabilityMana:

public class CapabilityMana {
	
    @CapabilityInject(IMana.class)
    public static final Capability<IMana> MANA_CAPABILITY = null;

    public static final EnumFacing DEFAULT_FACING = null;

    public static final ResourceLocation ID = new ResourceLocation(References.mod_id, "Mana");

    public static void register(){
        CapabilityManager.INSTANCE.register(IMana.class, new Capability.IStorage<IMana>() {
            @Override
            public NBTBase writeNBT(Capability<IMana> capability, IMana instance, EnumFacing side) {
                NBTTagCompound nbt = new NBTTagCompound();
                nbt.setInteger("mana", instance.getMana());
                
                System.out.println("Writing");
                return nbt;
            }

            @Override
            public void readNBT(Capability<IMana> capability, IMana instance, EnumFacing side, NBTBase nbt) {
                instance.setMana(((NBTTagCompound) nbt).getInteger("mana"));
                
                System.out.println("Reading");
            }
        }, () -> new Mana());
    }

    @Nullable
    public static IMana getMana(final EntityLivingBase entity){
        return CapabilityUtils.getCapability(entity, MANA_CAPABILITY, DEFAULT_FACING);

    }

    public static ICapabilityProvider createProvider(final IMana mana){
        return new CapabilityProviderSerializable<>(MANA_CAPABILITY, DEFAULT_FACING, mana);
    }	

    @Mod.EventBusSubscriber(modid = References.mod_id)
    private static class EventHandler {@SubscribeEvent
    public static void attachCapabilities(final AttachCapabilitiesEvent<Entity> event) {
        if (event.getObject() instanceof EntityPlayer) {
            final Mana mana = new Mana();
            event.addCapability(ID, createProvider(mana));
        }
    }

    @SubscribeEvent
    public static void playerClone(final PlayerEvent.Clone event) {
        final IMana oldMana = getMana(event.getOriginal());
        final IMana newMana = getMana(event.getEntityPlayer());

        if (newMana != null && oldMana != null) {
            newMana.setMana(oldMana.getMana());
            System.out.println("Player Clone Event Successful");
        }
    }
    
    @SubscribeEvent
    public static void onUpdate(final PlayerTickEvent event) {
    	final IMana mana = getMana(event.player);
    	if(event.player instanceof EntityPlayerMP){
    		mana.fillMana(1);
    		PacketHandler.INSTANCE.sendTo(new PacketMana(event.player), (EntityPlayerMP)event.player);
    	}
    }
    
    @SubscribeEvent
    public static void loginEvent(final PlayerLoggedInEvent event) {
    	EntityPlayer player = event.player;
    	PacketHandler.INSTANCE.sendTo(new PacketMana(player), (EntityPlayerMP)player);
    	System.out.println("Synced");
    }
    
    @SubscribeEvent
    public static void changeDimesionEvent(final PlayerChangedDimensionEvent event) {
    	EntityPlayer player = event.player;
    	PacketHandler.INSTANCE.sendTo(new PacketMana(player), (EntityPlayerMP)player);
    	System.out.println("Synced");
    }
    
    @SubscribeEvent
    public static void respawnEvent(final PlayerRespawnEvent event) {
    	EntityPlayer player = event.player;
    	PacketHandler.INSTANCE.sendTo(new PacketMana(player), (EntityPlayerMP)player);
    	System.out.println("Synced");
    }
    }
}

 

Is there anything else I should be doing? Since the memory leak still happens.

Posted
  On 3/7/2019 at 3:51 PM, diesieben07 said:
  On 3/7/2019 at 3:19 PM, FlashHUN said:

INSTANCE.registerMessage(PacketMana.Handler.class, PacketMana.class, nextID(), Side.SERVER);

Expand  

No. This packet is sent to the client.

Expand  

So, should I change the Side.SERVER to Side.CLIENT?

  On 3/7/2019 at 3:51 PM, diesieben07 said:
  On 3/7/2019 at 3:19 PM, FlashHUN said:

static CommonProxy proxy;

Expand  

This will always be null.

Expand  

How can I make that not be null? Use @SidedProxy?

  On 3/7/2019 at 3:51 PM, diesieben07 said:
  On 3/7/2019 at 3:19 PM, FlashHUN said:

public EntityPlayer getPlayerEntityFromContext(MessageContext ctx) { return Minecraft.getMinecraft().player; }

Expand  

This is not correct on the client. You have to check if you are on the integrated server or not.

Expand  

That is done with world.isRemote, right?

Posted
  On 3/7/2019 at 7:04 PM, diesieben07 said:

Yes.

 

You could do that. Or just remove this field and use the one you likely already have in your main mod class.

 

Usually yes, but in this case you do not have a World available, just the MessageContext. The MessageContext has a field side though, which you can check.

Expand  

Thank you so much for all the help! I really appreciate it. Now I finally don't have memory leaks. I have two hopefully last questions though:

 

  • Can I make the ClientProxy method handle multiple capabilities?

For example instead of

    public void handleMana(int mana) {
    	EntityPlayer player = Minecraft.getMinecraft().player;
    	player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setMana(mana);
    }

could I make it take a String too, and depending on what that is make it handle other capabilities? Something like this:

    public void handleMana(int data, String type) {
    	EntityPlayer player = Minecraft.getMinecraft().player;
    	if (type.equals("Mana") {
    		player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setMana(data);
    	}
    	else if (type.equals("MaxMana") {
    		player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setMaxMana(data);
    	}
    }

and then in PacketMana do:

Main.proxy.handleMana(message.mana, "Mana");

and in PacketMaxMana do:

Main.proxy.handleMana(message.mana, "MaxMana");

 

 

  • If I have to send one of these packets to the server, do I have to change anything? Like I said before, most of these packets need to be bi-directional since most of them could be edited through a GUI. Do I have to just copy the
handleMana()

in the ClientProxy to the CommonProxy so the data changes on both sides, or do I have to change something in the PacketHandler aswell, or even create a new packet that handles specifically receiving packets on the server?

Posted
  On 3/7/2019 at 9:05 PM, diesieben07 said:

Yes, you could use a string as an identifier. But that is just... terrible.

Expand  

Why is it terrible? I can see through it quite clearly that way. What would be a better way of doing it?

 

  On 3/7/2019 at 9:05 PM, diesieben07 said:

Also, if the values belong to the same capability, why not just send them in one packet?

Expand  

I would have A LOT of different values. How could I make it so the packet differentiates which one I want changed?

 

  On 3/7/2019 at 9:05 PM, diesieben07 said:

The client-to-server packets mean "the player just entered this value on the GUI, do with that what you want". And then the server decides what to do with that information. Do not blindly trust the client. Assume the client is always lying. 

Expand  

How could I do that? I would not like if players cheated, but how can I make the server decide what to do with said information?

Posted
  On 3/7/2019 at 10:24 PM, diesieben07 said:

Do not let the client just send over the new value. Instead (for example) send over "player pressed button x". Then perform the action solely on the server.

If there are other restrictions, such as "must only be done every x seconds" enforce those on the server, not just the client.

Expand  

So, for example, I have a GUI where a player can spend their acquired points in skills. If the player wants to do that, then when they click the button in the GUI to do so, a packet is sent where the data is that the button was pressed. Then how can I get that data from the packet, and in what type of method should I enforce the restrictions on the server?

Posted
  On 3/7/2019 at 10:36 PM, diesieben07 said:

What data? You said it was just a button, so the fact that the packet arrives at all on the server is enough to signify that the button was pressed. If you have a text field that lets you choose how much to spend, that is what you would send in the packet. In the same way you send the mana value now.

Then on the server, in your packet handler, you can check that the player actually has enough points and if so, perform the "spend points" operation.

Expand  

Then the data in the packet would equal something like GUISkillMenu.pointstospend in the constructor? How can I detect if a packet arrives on a server? Sorry for all of these stupid questions, but these anti cheating things are new to me.

Posted

Wait, nevermind, the constructor would take the int itself and then the data would equal to the int in the constructor. I realized that now, but then again, how do I detect the packet arriving on a server?

Posted

We literally sent the message at the same time. So it would just be in the onMessage part? (or should I do it through a scheduled task this way too and schedule a handle method?)

Posted
  On 3/7/2019 at 11:05 PM, diesieben07 said:

Please, actually try and understand what these things are. You are just stabbing in the dark.

Expand  

I'm trying to understand, but all of this was a bit too much information to handle at once after a tiring day for my brain.

Posted (edited)

So, the packet that the client sends to the server should look something like this, right?

public class ClientMana implements IMessage {
    private int data;

    public ClientMana(int data) {
    	this.data = data;
    }
    
    @Override
    public void fromBytes(ByteBuf buf) {
    	data = buf.readInt();
    }

    @Override
    public void toBytes(ByteBuf buf) {
        buf.writeInt(data);
    }

    public static class Handler implements IMessageHandler<ClientMana, IMessage> {
        @Override
        public IMessage onMessage(ClientMana message, MessageContext ctx) {
            FMLCommonHandler.instance().getWorldThread(ctx.netHandler).addScheduledTask(() -> handle(message, ctx));
            return null;
        }

        private void handle(ClientMana message, MessageContext ctx) {
        	Main.proxy.handleServerMana(message.data, 1, ctx);
        }
    }
}

 

And the data would then get handled in the CommonProxy where this happens:

public class CommonProxy {

	public void registerItemRenderer(Item item, int meta, String id) {}
	
    public EntityPlayer getPlayerEntityFromContext(MessageContext ctx)
    {
        return ctx.getServerHandler().player;
    }

	public void handleMana(int mana, int packetType) {}

	public void handleManaB(boolean mana, int packetType) {}
	
	public void handleManaD(double mana, int packetType) {}
	
	public void handleServerMana(int mana, int packetType, MessageContext ctx) {
		EntityPlayer player = ctx.getServerHandler().player;
		switch (packetType) {
			case 1: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setMana(mana); break;
			case 2: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setMaxMana(mana); break;
		}
	}
}

 

And the ClientProxy looks like this:

public class ClientProxy extends CommonProxy {

	public void registerItemRenderer(Item item, int meta, String id) {
		ModelLoader.setCustomModelResourceLocation(item,  meta,  new ModelResourceLocation(item.getRegistryName(), id));
	}
	
	public EntityPlayer getPlayerEntityFromContext(MessageContext ctx)
	{
		return ctx.side.isClient() ? Minecraft.getMinecraft().player : ctx.getServerHandler().player;
	}
	
	public void handleMana(int mana, int packetType) {
		EntityPlayer player = Minecraft.getMinecraft().player;
		switch (packetType) {
			case 1: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setMana(mana); break;
			case 2: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setMaxMana(mana); break;
			case 3: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setByakugan(mana); break;
			case 5: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setByakuganSize(mana); break;
			case 6: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setKetsuryuugan(mana); break;
			case 8: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setSharingan(mana); break;
			case 10: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setSharinganPattern(mana); break;
			case 11: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setSharinganSize(mana); break;
			case 12: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setCurseMark(mana); break;
			case 13: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setCurseMarkSize(mana); break;
			case 14: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setCurseMarkType(mana); break;
			case 15: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setShikotsumyaku(mana); break;
			case 16: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setEarthRelease(mana); break;
			case 17: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setFireRelease(mana); break;
			case 18: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setIceRelease(mana); break;
			case 19: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setLightningRelease(mana); break;
			case 20: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setWaterRelease(mana); break;
			case 21: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setWindRelease(mana); break;
			case 22: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setWoodRelease(mana); break;
			case 23: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setYangRelease(mana); break;
			case 24: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setYinRelease(mana); break;
			case 25: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setAffiliation(mana); break;
			case 26: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setClan(mana); break;
			case 27: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setLand(mana); break;
			case 28: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setGenjutsu(mana); break;
		}
	}

	public void handleManaB(boolean mana, int packetType) {
		EntityPlayer player = Minecraft.getMinecraft().player;
		switch (packetType) {
			case 4: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setByakuganActive(mana); break;
			case 7: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setKetsuryuuganActive(mana); break;
			case 9: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setSharinganActive(mana); break;
			case 13: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setCurseMarkActive(mana); break;
		}
		
	}
	
	public void handleManaD(double mana, int packetType) {
		EntityPlayer player = Minecraft.getMinecraft().player;
		switch (packetType) {
			case 29: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setKenjutsu(mana); break;
			case 30: player.getCapability(CapabilityMana.MANA_CAPABILITY, null).setTaijutsu(mana); break;
		}
	}
}

 

Edited by FlashHUN
Posted
  On 3/8/2019 at 8:47 AM, diesieben07 said:

This packet is the exact thing you must not do prevent cheating. A malicious client can just send over "hey, please 1,000,000 mana!" and the server will go "okay!" and apply it.

Expand  

Then how else should I do it? This is a packet that would be sent when the player first starts out and picks their base stats (they can pick 2 things through a GUI and those 2 things determine what stats you get at the start), so there aren't really any restrictions. For example, depending on the clan they choose at the start they might get more mana than you'd normally start out with.

Posted
  On 3/8/2019 at 10:34 AM, diesieben07 said:

Send over exactly what they select in the GUI. Do they select the amount of mana? No, they select their clan. So, send over the clan and then let the server decide how much mana that clan implies.

Otherwise the client decides, which means effectively every clan gets as much mana as they want. Which is not what you want.

Expand  

Ah, thank you for clearing that up.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • New users at Temureceive a 40 Off discount on orders over 40 Off Use the code [acx318439] during checkout to get TemuDiscount 40 Off For New Users. You n save 40 Off off your first order with the Promo Code available for a limited time only. Extra 30% off for new and existing customers + Up to $40 Off % off & more. Temu Promo Codes for New users- [acx318439] Temudiscount code for New customers- [acx318439] Temu $40 Off Promo Code- [acx318439] what are Temu codes- acx318439 does Temu give you $40 Off - [acx318439] Yes Verified Temu Promo Code january 2025- {acx318439} TemuNew customer offer {acx318439} Temudiscount codejanuary 2025 {acx318439} 40 off Promo Code Temu {acx318439} Temu 40% off any order {acx318439} 40 dollar off Temu code {acx318439} TemuCoupon $40 Off off for New customers There are a number of discounts and deals shoppers n take advantage of with the Teemu Coupon Bundle [acx318439]. TemuCoupon $40 Off off for New customers [acx318439] will save you $40 Off on your order. To get a discount, click on the item to purchase and enter the code. You n think of it as a supercharged savings pack for all your shopping needs Temu Promo Code 80% off – [acx318439] Free Temu codes 50% off – [acx318439] TemuCoupon $40 Off off – [acx318439] Temu buy to get ₱39 – [acx318439] Temu 129 coupon bundle – [acx318439] Temu buy 3 to get €99 – [acx318439] Exclusive $40 Off Off TemuDiscount Code Temu $40 Off Off Promo Code : (acx318439) Temu Discount Code $40 Off Bundle acx318439) acx318439 Temu $40 Off off Promo Code for Exsting users : acx318439) Temu Promo Code $40 Off off Temu 40 Off coupon code (acx318439) will save you 40 Off on your order. To get a discount, click on the item to purchase and enter the code. Yes, Temu offers 40 Off Coupon Code “acx318439” for Existing Customers.  You can get a 40 Off bonus plus 30% off any purchase at Temu with the 40 Off Coupon Bundle at Temu if you sign up with the referral code [acx318439] and make a first purchase of $40 Off or more. Temu Promo Code 40 off-{acx318439} Temu Promo Code -{acx318439} Temu Promo Code $40 Off off-{acx318439} kubonus code -{acx318439} Get ready to unlock a world of savings with our free Temu UK coupons! We’ve got you covered with a wide range of Temu UK coupon code options that will help you maximize your shopping experience.30% Off Temu UK Coupons, Promo Codes + 25% Cash Back [ acx318439]   Yes, Temu offers 40 off coupon code {acx318439} for first-time users. You can get a $40 bonus plus 40% off any purchase at Temu with the $40 Coupon Bundle if you sign up with the referral code [acx318439] and make a first purchase of $40 or more. If you are who wish to join Temu, then you should use this exclusive TemuCoupon code 40 off (acx318439) and get 40 off on your purchase with Temu. You can get a 40% discount with TemuCoupon code {acx318439}. This exclusive offer is for existing customers and can be used for a 40 reduction on your total purchase. Enter coupon code {acx318439} at checkout to avail of the discount. You can use the code {acx318439} to get a 40 off TemuCoupon as a new customer. Apply this TemuCoupon code $40 off (acx318439) to get a $40 discount on your shopping with Temu. If you’re a first-time user and looking for a TemuCoupon code $40 first time user(acx318439) then using this code will give you a flat $40 Off and a 90% discount on your Temu shopping.     •    acx318439: Enjoy flat 40% off on your first Temu order.     •    acx318439: Download the Temu app and get an additional 40% off.     •    acx318439: Celebrate spring with up to 90% discount on selected items.     •    acx318439: Score up to 90% off on clearance items.     •    acx318439: Beat the heat with hot summer savings of up to 90% off.     •    acx318439: Temu UK Coupon Code to 40% off on Appliances at Temu. How to Apply Temu Coupon Code? Using the TemuCoupon code $40 off is a breeze. All you need to do is follow these simple steps:     1    Visit the Temu website or app and browse through the vast collection of products.     2    Once you’ve added the items you wish to purchase to your cart, proceed to the checkout page.     3    During the checkout process, you’ll be prompted to enter a coupon code or promo code.     4    Type in the coupon code: [acx318439] and click “Apply.”     5    Voila! You’ll instantly see the $40 discount reflected in your total purchase amount. Temu New User Coupon: Up To 90% OFF For Existing Customers Temu Existing customer’s coupon codes are designed just for new customers, offering the biggest discounts 90% and the best deals currently available on Temu. To maximize your savings, download the Temu app and apply our Temu new user coupon during checkout.     •    acx318439: New users can get up to 80% extra off.     •    acx318439: Get a massive 40% off your first order!     •    acx318439: Get 20% off on your first order; no minimum spending required.     •    acx318439: Take an extra 15% off your first order on top of existing discounts.     •    acx318439: Temu UK Enjoy a 40% discount on your entire first purchase.  
    • New users at Temureceive a 40 Off discount on orders over 40 Off Use the code [acx318439] during checkout to get TemuDiscount 40 Off For New Users. You n save 40 Off off your first order with the Promo Code available for a limited time only. Extra 30% off for new and existing customers + Up to $40 Off % off & more. Temu Promo Codes for New users- [acx318439] Temudiscount code for New customers- [acx318439] Temu $40 Off Promo Code- [acx318439] what are Temu codes- acx318439 does Temu give you $40 Off - [acx318439] Yes Verified Temu Promo Code january 2025- {acx318439} TemuNew customer offer {acx318439} Temudiscount codejanuary 2025 {acx318439} 40 off Promo Code Temu {acx318439} Temu 40% off any order {acx318439} 40 dollar off Temu code {acx318439} TemuCoupon $40 Off off for New customers There are a number of discounts and deals shoppers n take advantage of with the Teemu Coupon Bundle [acx318439]. TemuCoupon $40 Off off for New customers [acx318439] will save you $40 Off on your order. To get a discount, click on the item to purchase and enter the code. You n think of it as a supercharged savings pack for all your shopping needs Temu Promo Code 80% off – [acx318439] Free Temu codes 50% off – [acx318439] TemuCoupon $40 Off off – [acx318439] Temu buy to get ₱39 – [acx318439] Temu 129 coupon bundle – [acx318439] Temu buy 3 to get €99 – [acx318439] Exclusive $40 Off Off TemuDiscount Code Temu $40 Off Off Promo Code : (acx318439) Temu Discount Code $40 Off Bundle acx318439) acx318439 Temu $40 Off off Promo Code for Exsting users : acx318439) Temu Promo Code $40 Off off Temu 40 Off coupon code (acx318439) will save you 40 Off on your order. To get a discount, click on the item to purchase and enter the code. Yes, Temu offers 40 Off Coupon Code “acx318439” for Existing Customers.  You can get a 40 Off bonus plus 30% off any purchase at Temu with the 40 Off Coupon Bundle at Temu if you sign up with the referral code [acx318439] and make a first purchase of $40 Off or more. Temu Promo Code 40 off-{acx318439} Temu Promo Code -{acx318439} Temu Promo Code $40 Off off-{acx318439} kubonus code -{acx318439} Get ready to unlock a world of savings with our free Temu UK coupons! We’ve got you covered with a wide range of Temu UK coupon code options that will help you maximize your shopping experience.30% Off Temu UK Coupons, Promo Codes + 25% Cash Back [ acx318439]   Yes, Temu offers 40 off coupon code {acx318439} for first-time users. You can get a $40 bonus plus 40% off any purchase at Temu with the $40 Coupon Bundle if you sign up with the referral code [acx318439] and make a first purchase of $40 or more. If you are who wish to join Temu, then you should use this exclusive TemuCoupon code 40 off (acx318439) and get 40 off on your purchase with Temu. You can get a 40% discount with TemuCoupon code {acx318439}. This exclusive offer is for existing customers and can be used for a 40 reduction on your total purchase. Enter coupon code {acx318439} at checkout to avail of the discount. You can use the code {acx318439} to get a 40 off TemuCoupon as a new customer. Apply this TemuCoupon code $40 off (acx318439) to get a $40 discount on your shopping with Temu. If you’re a first-time user and looking for a TemuCoupon code $40 first time user(acx318439) then using this code will give you a flat $40 Off and a 90% discount on your Temu shopping.     •    acx318439: Enjoy flat 40% off on your first Temu order.     •    acx318439: Download the Temu app and get an additional 40% off.     •    acx318439: Celebrate spring with up to 90% discount on selected items.     •    acx318439: Score up to 90% off on clearance items.     •    acx318439: Beat the heat with hot summer savings of up to 90% off.     •    acx318439: Temu UK Coupon Code to 40% off on Appliances at Temu. How to Apply Temu Coupon Code? Using the TemuCoupon code $40 off is a breeze. All you need to do is follow these simple steps:     1    Visit the Temu website or app and browse through the vast collection of products.     2    Once you’ve added the items you wish to purchase to your cart, proceed to the checkout page.     3    During the checkout process, you’ll be prompted to enter a coupon code or promo code.     4    Type in the coupon code: [acx318439] and click “Apply.”     5    Voila! You’ll instantly see the $40 discount reflected in your total purchase amount. Temu New User Coupon: Up To 90% OFF For Existing Customers Temu Existing customer’s coupon codes are designed just for new customers, offering the biggest discounts 90% and the best deals currently available on Temu. To maximize your savings, download the Temu app and apply our Temu new user coupon during checkout.     •    acx318439: New users can get up to 80% extra off.     •    acx318439: Get a massive 40% off your first order!     •    acx318439: Get 20% off on your first order; no minimum spending required.     •    acx318439: Take an extra 15% off your first order on top of existing discounts.     •    acx318439: Temu UK Enjoy a 40% discount on your entire first purchase.  
    • New users at Temureceive a 40 Off discount on orders over 40 Off Use the code [acx318439] during checkout to get TemuDiscount 40 Off For New Users. You n save 40 Off off your first order with the Promo Code available for a limited time only. Extra 30% off for new and existing customers + Up to $40 Off % off & more. Temu Promo Codes for New users- [acx318439] Temudiscount code for New customers- [acx318439] Temu $40 Off Promo Code- [acx318439] what are Temu codes- acx318439 does Temu give you $40 Off - [acx318439] Yes Verified Temu Promo Code january 2025- {acx318439} TemuNew customer offer {acx318439} Temudiscount codejanuary 2025 {acx318439} 40 off Promo Code Temu {acx318439} Temu 40% off any order {acx318439} 40 dollar off Temu code {acx318439} TemuCoupon $40 Off off for New customers There are a number of discounts and deals shoppers n take advantage of with the Teemu Coupon Bundle [acx318439]. TemuCoupon $40 Off off for New customers [acx318439] will save you $40 Off on your order. To get a discount, click on the item to purchase and enter the code. You n think of it as a supercharged savings pack for all your shopping needs Temu Promo Code 80% off – [acx318439] Free Temu codes 50% off – [acx318439] TemuCoupon $40 Off off – [acx318439] Temu buy to get ₱39 – [acx318439] Temu 129 coupon bundle – [acx318439] Temu buy 3 to get €99 – [acx318439] Exclusive $40 Off Off TemuDiscount Code Temu $40 Off Off Promo Code : (acx318439) Temu Discount Code $40 Off Bundle acx318439) acx318439 Temu $40 Off off Promo Code for Exsting users : acx318439) Temu Promo Code $40 Off off Temu 40 Off coupon code (acx318439) will save you 40 Off on your order. To get a discount, click on the item to purchase and enter the code. Yes, Temu offers 40 Off Coupon Code “acx318439” for Existing Customers.  You can get a 40 Off bonus plus 30% off any purchase at Temu with the 40 Off Coupon Bundle at Temu if you sign up with the referral code [acx318439] and make a first purchase of $40 Off or more. Temu Promo Code 40 off-{acx318439} Temu Promo Code -{acx318439} Temu Promo Code $40 Off off-{acx318439} kubonus code -{acx318439} Get ready to unlock a world of savings with our free Temu UK coupons! We’ve got you covered with a wide range of Temu UK coupon code options that will help you maximize your shopping experience.30% Off Temu UK Coupons, Promo Codes + 25% Cash Back [ acx318439]   Yes, Temu offers 40 off coupon code {acx318439} for first-time users. You can get a $40 bonus plus 40% off any purchase at Temu with the $40 Coupon Bundle if you sign up with the referral code [acx318439] and make a first purchase of $40 or more. If you are who wish to join Temu, then you should use this exclusive TemuCoupon code 40 off (acx318439) and get 40 off on your purchase with Temu. You can get a 40% discount with TemuCoupon code {acx318439}. This exclusive offer is for existing customers and can be used for a 40 reduction on your total purchase. Enter coupon code {acx318439} at checkout to avail of the discount. You can use the code {acx318439} to get a 40 off TemuCoupon as a new customer. Apply this TemuCoupon code $40 off (acx318439) to get a $40 discount on your shopping with Temu. If you’re a first-time user and looking for a TemuCoupon code $40 first time user(acx318439) then using this code will give you a flat $40 Off and a 90% discount on your Temu shopping.     •    acx318439: Enjoy flat 40% off on your first Temu order.     •    acx318439: Download the Temu app and get an additional 40% off.     •    acx318439: Celebrate spring with up to 90% discount on selected items.     •    acx318439: Score up to 90% off on clearance items.     •    acx318439: Beat the heat with hot summer savings of up to 90% off.     •    acx318439: Temu UK Coupon Code to 40% off on Appliances at Temu. How to Apply Temu Coupon Code? Using the TemuCoupon code $40 off is a breeze. All you need to do is follow these simple steps:     1    Visit the Temu website or app and browse through the vast collection of products.     2    Once you’ve added the items you wish to purchase to your cart, proceed to the checkout page.     3    During the checkout process, you’ll be prompted to enter a coupon code or promo code.     4    Type in the coupon code: [acx318439] and click “Apply.”     5    Voila! You’ll instantly see the $40 discount reflected in your total purchase amount. Temu New User Coupon: Up To 90% OFF For Existing Customers Temu Existing customer’s coupon codes are designed just for new customers, offering the biggest discounts 90% and the best deals currently available on Temu. To maximize your savings, download the Temu app and apply our Temu new user coupon during checkout.     •    acx318439: New users can get up to 80% extra off.     •    acx318439: Get a massive 40% off your first order!     •    acx318439: Get 20% off on your first order; no minimum spending required.     •    acx318439: Take an extra 15% off your first order on top of existing discounts.     •    acx318439: Temu UK Enjoy a 40% discount on your entire first purchase.  
    • New users at Temureceive a 40 Off discount on orders over 40 Off Use the code [acx318439] during checkout to get TemuDiscount 40 Off For New Users. You n save 40 Off off your first order with the Promo Code available for a limited time only. Extra 30% off for new and existing customers + Up to $40 Off % off & more. Temu Promo Codes for New users- [acx318439] Temudiscount code for New customers- [acx318439] Temu $40 Off Promo Code- [acx318439] what are Temu codes- acx318439 does Temu give you $40 Off - [acx318439] Yes Verified Temu Promo Code january 2025- {acx318439} TemuNew customer offer {acx318439} Temudiscount codejanuary 2025 {acx318439} 40 off Promo Code Temu {acx318439} Temu 40% off any order {acx318439} 40 dollar off Temu code {acx318439} TemuCoupon $40 Off off for New customers There are a number of discounts and deals shoppers n take advantage of with the Teemu Coupon Bundle [acx318439]. TemuCoupon $40 Off off for New customers [acx318439] will save you $40 Off on your order. To get a discount, click on the item to purchase and enter the code. You n think of it as a supercharged savings pack for all your shopping needs Temu Promo Code 80% off – [acx318439] Free Temu codes 50% off – [acx318439] TemuCoupon $40 Off off – [acx318439] Temu buy to get ₱39 – [acx318439] Temu 129 coupon bundle – [acx318439] Temu buy 3 to get €99 – [acx318439] Exclusive $40 Off Off TemuDiscount Code Temu $40 Off Off Promo Code : (acx318439) Temu Discount Code $40 Off Bundle acx318439) acx318439 Temu $40 Off off Promo Code for Exsting users : acx318439) Temu Promo Code $40 Off off Temu 40 Off coupon code (acx318439) will save you 40 Off on your order. To get a discount, click on the item to purchase and enter the code. Yes, Temu offers 40 Off Coupon Code “acx318439” for Existing Customers.  You can get a 40 Off bonus plus 30% off any purchase at Temu with the 40 Off Coupon Bundle at Temu if you sign up with the referral code [acx318439] and make a first purchase of $40 Off or more. Temu Promo Code 40 off-{acx318439} Temu Promo Code -{acx318439} Temu Promo Code $40 Off off-{acx318439} kubonus code -{acx318439} Get ready to unlock a world of savings with our free Temu UK coupons! We’ve got you covered with a wide range of Temu UK coupon code options that will help you maximize your shopping experience.30% Off Temu UK Coupons, Promo Codes + 25% Cash Back [ acx318439]   Yes, Temu offers 40 off coupon code {acx318439} for first-time users. You can get a $40 bonus plus 40% off any purchase at Temu with the $40 Coupon Bundle if you sign up with the referral code [acx318439] and make a first purchase of $40 or more. If you are who wish to join Temu, then you should use this exclusive TemuCoupon code 40 off (acx318439) and get 40 off on your purchase with Temu. You can get a 40% discount with TemuCoupon code {acx318439}. This exclusive offer is for existing customers and can be used for a 40 reduction on your total purchase. Enter coupon code {acx318439} at checkout to avail of the discount. You can use the code {acx318439} to get a 40 off TemuCoupon as a new customer. Apply this TemuCoupon code $40 off (acx318439) to get a $40 discount on your shopping with Temu. If you’re a first-time user and looking for a TemuCoupon code $40 first time user(acx318439) then using this code will give you a flat $40 Off and a 90% discount on your Temu shopping.     •    acx318439: Enjoy flat 40% off on your first Temu order.     •    acx318439: Download the Temu app and get an additional 40% off.     •    acx318439: Celebrate spring with up to 90% discount on selected items.     •    acx318439: Score up to 90% off on clearance items.     •    acx318439: Beat the heat with hot summer savings of up to 90% off.     •    acx318439: Temu UK Coupon Code to 40% off on Appliances at Temu. How to Apply Temu Coupon Code? Using the TemuCoupon code $40 off is a breeze. All you need to do is follow these simple steps:     1    Visit the Temu website or app and browse through the vast collection of products.     2    Once you’ve added the items you wish to purchase to your cart, proceed to the checkout page.     3    During the checkout process, you’ll be prompted to enter a coupon code or promo code.     4    Type in the coupon code: [acx318439] and click “Apply.”     5    Voila! You’ll instantly see the $40 discount reflected in your total purchase amount. Temu New User Coupon: Up To 90% OFF For Existing Customers Temu Existing customer’s coupon codes are designed just for new customers, offering the biggest discounts 90% and the best deals currently available on Temu. To maximize your savings, download the Temu app and apply our Temu new user coupon during checkout.     •    acx318439: New users can get up to 80% extra off.     •    acx318439: Get a massive 40% off your first order!     •    acx318439: Get 20% off on your first order; no minimum spending required.     •    acx318439: Take an extra 15% off your first order on top of existing discounts.     •    acx318439: Temu UK Enjoy a 40% discount on your entire first purchase.  
    • New users at Temureceive a 40 Off discount on orders over 40 Off Use the code [acx318439] during checkout to get TemuDiscount 40 Off For New Users. You n save 40 Off off your first order with the Promo Code available for a limited time only. Extra 30% off for new and existing customers + Up to $40 Off % off & more. Temu Promo Codes for New users- [acx318439] Temudiscount code for New customers- [acx318439] Temu $40 Off Promo Code- [acx318439] what are Temu codes- acx318439 does Temu give you $40 Off - [acx318439] Yes Verified Temu Promo Code january 2025- {acx318439} TemuNew customer offer {acx318439} Temudiscount codejanuary 2025 {acx318439} 40 off Promo Code Temu {acx318439} Temu 40% off any order {acx318439} 40 dollar off Temu code {acx318439} TemuCoupon $40 Off off for New customers There are a number of discounts and deals shoppers n take advantage of with the Teemu Coupon Bundle [acx318439]. TemuCoupon $40 Off off for New customers [acx318439] will save you $40 Off on your order. To get a discount, click on the item to purchase and enter the code. You n think of it as a supercharged savings pack for all your shopping needs Temu Promo Code 80% off – [acx318439] Free Temu codes 50% off – [acx318439] TemuCoupon $40 Off off – [acx318439] Temu buy to get ₱39 – [acx318439] Temu 129 coupon bundle – [acx318439] Temu buy 3 to get €99 – [acx318439] Exclusive $40 Off Off TemuDiscount Code Temu $40 Off Off Promo Code : (acx318439) Temu Discount Code $40 Off Bundle acx318439) acx318439 Temu $40 Off off Promo Code for Exsting users : acx318439) Temu Promo Code $40 Off off Temu 40 Off coupon code (acx318439) will save you 40 Off on your order. To get a discount, click on the item to purchase and enter the code. Yes, Temu offers 40 Off Coupon Code “acx318439” for Existing Customers.  You can get a 40 Off bonus plus 30% off any purchase at Temu with the 40 Off Coupon Bundle at Temu if you sign up with the referral code [acx318439] and make a first purchase of $40 Off or more. Temu Promo Code 40 off-{acx318439} Temu Promo Code -{acx318439} Temu Promo Code $40 Off off-{acx318439} kubonus code -{acx318439} Get ready to unlock a world of savings with our free Temu UK coupons! We’ve got you covered with a wide range of Temu UK coupon code options that will help you maximize your shopping experience.30% Off Temu UK Coupons, Promo Codes + 25% Cash Back [ acx318439]   Yes, Temu offers 40 off coupon code {acx318439} for first-time users. You can get a $40 bonus plus 40% off any purchase at Temu with the $40 Coupon Bundle if you sign up with the referral code [acx318439] and make a first purchase of $40 or more. If you are who wish to join Temu, then you should use this exclusive TemuCoupon code 40 off (acx318439) and get 40 off on your purchase with Temu. You can get a 40% discount with TemuCoupon code {acx318439}. This exclusive offer is for existing customers and can be used for a 40 reduction on your total purchase. Enter coupon code {acx318439} at checkout to avail of the discount. You can use the code {acx318439} to get a 40 off TemuCoupon as a new customer. Apply this TemuCoupon code $40 off (acx318439) to get a $40 discount on your shopping with Temu. If you’re a first-time user and looking for a TemuCoupon code $40 first time user(acx318439) then using this code will give you a flat $40 Off and a 90% discount on your Temu shopping.     •    acx318439: Enjoy flat 40% off on your first Temu order.     •    acx318439: Download the Temu app and get an additional 40% off.     •    acx318439: Celebrate spring with up to 90% discount on selected items.     •    acx318439: Score up to 90% off on clearance items.     •    acx318439: Beat the heat with hot summer savings of up to 90% off.     •    acx318439: Temu UK Coupon Code to 40% off on Appliances at Temu. How to Apply Temu Coupon Code? Using the TemuCoupon code $40 off is a breeze. All you need to do is follow these simple steps:     1    Visit the Temu website or app and browse through the vast collection of products.     2    Once you’ve added the items you wish to purchase to your cart, proceed to the checkout page.     3    During the checkout process, you’ll be prompted to enter a coupon code or promo code.     4    Type in the coupon code: [acx318439] and click “Apply.”     5    Voila! You’ll instantly see the $40 discount reflected in your total purchase amount. Temu New User Coupon: Up To 90% OFF For Existing Customers Temu Existing customer’s coupon codes are designed just for new customers, offering the biggest discounts 90% and the best deals currently available on Temu. To maximize your savings, download the Temu app and apply our Temu new user coupon during checkout.     •    acx318439: New users can get up to 80% extra off.     •    acx318439: Get a massive 40% off your first order!     •    acx318439: Get 20% off on your first order; no minimum spending required.     •    acx318439: Take an extra 15% off your first order on top of existing discounts.     •    acx318439: Temu UK Enjoy a 40% discount on your entire first purchase.  
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.