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

New Player Join error #431

Open
PabloKateee opened this issue May 12, 2024 · 3 comments
Open

New Player Join error #431

PabloKateee opened this issue May 12, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@PabloKateee
Copy link

17:40:07] [Server thread/INFO]: .MoosPablo[/89.33.12.236:40683] logged in with entity id 85644 at ([spawn]126.589066, 22.0, 151.53354)
[17:40:07] [Craft Scheduler Thread - 208 - SimpleClans/ERROR]: [SimpleClans] Error executing query: INSERT INTO sc_players (uuid, name, leader, tag, friendly_fire, neutral_kills, rival_kills, civilian_kills, deaths, last_seen, join_date, packed_past_clans, flags) VALUES ('00000000-0000-0000-0009-00000465e887', '.MoosPablo',0,'',0,0,0,0,0,'1715535607061',' 1715535607061','','{}');
java.sql.SQLIntegrityConstraintViolationException: Duplicate entry '00000000-0000-0000-0009-00000465e887' for key 'uq_player_uuid'
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:118) ~[mysql-connector-j-8.2.0.jar:8.2.0]
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-j-8.2.0.jar:8.2.0]
at com.mysql.cj.jdbc.StatementImpl.executeUpdateInternal(StatementImpl.java:1335) ~[mysql-connector-j-8.2.0.jar:8.2.0]
at com.mysql.cj.jdbc.StatementImpl.executeLargeUpdate(StatementImpl.java:2081) ~[mysql-connector-j-8.2.0.jar:8.2.0]
at com.mysql.cj.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1246) ~[mysql-connector-j-8.2.0.jar:8.2.0]
at net.sacredlabyrinth.phaed.simpleclans.storage.DBCore.lambda$executeUpdate$0(DBCore.java:105) ~[SimpleClans.jar:?]
at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftTask.run(CraftTask.java:101) ~[purpur-1.20.4.jar:git-Purpur-2176]
at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[purpur-1.20.4.jar:git-Purpur-2176]
at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[purpur-1.20.4.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:840) ~[?:?]
[17:40:07] [Craft Scheduler Thread - 208 - SimpleClans/ERROR]: [SimpleClans] Caller's stack trace:
java.lang.Exception: null
at net.sacredlabyrinth.phaed.simpleclans.storage.DBCore.executeUpdate(DBCore.java:101) ~[SimpleClans.jar:?]
at net.sacredlabyrinth.phaed.simpleclans.managers.StorageManager.insertClanPlayer(StorageManager.java:839) ~[SimpleClans.jar:?]
at net.sacredlabyrinth.phaed.simpleclans.managers.ClanManager.getCreateClanPlayer(ClanManager.java:375) ~[SimpleClans.jar:?]
at net.sacredlabyrinth.phaed.simpleclans.hooks.papi.SimpleClansExpansion.onRequest(SimpleClansExpansion.java:121) ~[SimpleClans.jar:?]
at me.clip.placeholderapi.replacer.CharsReplacer.apply(CharsReplacer.java:119) ~[PlaceholderAPI-2.11.5.jar:?]
at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:71) ~[PlaceholderAPI-2.11.5.jar:?]
at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:99) ~[PlaceholderAPI-2.11.5.jar:?]
at me.neznamy.tab.bridge.bukkit.platform.BukkitPlatform.parseWithNestedPlaceholders(BukkitPlatform.java:110) ~[TAB-Bridge v5.0.1.jar:?]
at me.neznamy.tab.bridge.bukkit.platform.BukkitPlatform.lambda$createPlaceholder$2(BukkitPlatform.java:100) ~[TAB-Bridge v5.0.1.jar:?]
at me.neznamy.tab.bridge.shared.placeholder.PlayerPlaceholder.request(PlayerPlaceholder.java:33) ~[TAB-Bridge v5.0.1.jar:?]
at me.neznamy.tab.bridge.shared.placeholder.PlayerPlaceholder.update(PlayerPlaceholder.java:22) ~[TAB-Bridge v5.0.1.jar:?]
at me.neznamy.tab.bridge.shared.placeholder.PlayerPlaceholder.getLastValue(PlayerPlaceholder.java:47) ~[TAB-Bridge v5.0.1.jar:?]
at me.neznamy.tab.bridge.shared.DataBridge.parsePlaceholders(DataBridge.java:187) ~[TAB-Bridge v5.0.1.jar:?]
at me.neznamy.tab.bridge.shared.DataBridge.processPluginMessage(DataBridge.java:96) ~[TAB-Bridge v5.0.1.jar:?]
at me.neznamy.tab.bridge.shared.DataBridge.lambda$processQueue$7(DataBridge.java:147) ~[TAB-Bridge v5.0.1.jar:?]
at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?]
at me.neznamy.tab.bridge.shared.DataBridge.processQueue(DataBridge.java:147) ~[TAB-Bridge v5.0.1.jar:?]
at me.neznamy.tab.bridge.bukkit.BukkitBridge.lambda$onJoin$0(BukkitBridge.java:77) ~[TAB-Bridge v5.0.1.jar:?]
at me.neznamy.tab.bridge.shared.TABBridge.lambda$submitTask$0(TABBridge.java:54) ~[TAB-Bridge v5.0.1.jar:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:840) ~[?:?]

purpur 1.20.4 Last Version
@PabloKateee PabloKateee added the bug Something isn't working label May 12, 2024
@efor89
Copy link

efor89 commented Jul 11, 2024

same with paper 1.21
1 error is that the placeholder return null
that is easy to fix
if it return null let it return "no clan"

the other bug is if a player is not in a clan and the plugin try to update the player on join.

@efor89
Copy link

efor89 commented Jul 11, 2024

what is if you make the check before updateplayername in csplayerlistener.java

    public void onPlayerJoin(PlayerJoinEvent event) {
    final Player player = event.getPlayer();
    if (isBlacklistedWorld(player)) {
        return;
    }
    ClanPlayer cp = plugin.getClanManager().getAnyClanPlayer(player.getUniqueId());
    
if (cp == null) {
        return;
    }
	
    updatePlayerName(player);
    plugin.getClanManager().updateLastSeen(player);
    plugin.getClanManager().updateDisplayName(player);
    
    plugin.getPermissionsManager().addPlayerPermissions(cp);

    if (settingsManager.is(BB_SHOW_ON_LOGIN) && cp.isBbEnabled() && cp.getClan() != null) {
        cp.getClan().displayBb(player, settingsManager.getInt(BB_LOGIN_SIZE));
    }

    plugin.getPermissionsManager().addClanPermissions(cp);
}


and for the placeholder in clan.java
idk if its correct but something like this


    @Placeholder("name")
    public String getName() {
	    if(name == null){
		    return "Kein Clan";
       }
	
	    return name;
    }

@Tomut0
Copy link
Collaborator

Tomut0 commented Jul 11, 2024

Duplicate entry

I believe the error does explain what's the problem you have faced.
It's usually because of manipulating with online-mode:, but can be because of other similar cases.
You may delete the duplicating entry on your database and the problem should gone.

that is easy to fix

This isn't.
Replacing the placeholder variable with separated plugins is the case you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants