Jump to content

Recommended Posts

Posted (edited)

Hello Member to mxc i create one easy code for check last login from account!Soory for bad Engilsh

dont test this and i dont know if work retail :) :)

 

Updated

### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(revision 5)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -15,8 +15,10 @@
 package net.sf.l2j.gameserver.model.actor.instance;
 
 import java.sql.Connection;
+import java.sql.Date;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Calendar;
@@ -10705,4 +10707,32 @@
 				break;
 		}
 	}
+	
+	public long cklastlogin()
+	{
+		long chklogin = 0;
+		try (Connection con = L2DatabaseFactory.getInstance().getConnection())
+		{
+			PreparedStatement statement = con.prepareStatement("SELECT lastactive FROM accounts WHERE login=?");
+			statement.setString(1, getAccountName());
+			ResultSet rset = statement.executeQuery();
+			
+			// Go though the recordset of this SQL query
+			while (rset.next())
+			{
+				chklogin = rset.getLong("lastactive");
+                               SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
+                               Date date = new Date(chklogin);
+                               sendMessage("Last Login:"+dateFormat.format(date));
+			}
+			
+			rset.close();
+			statement.close();
+		}
+		catch (Exception e)
+		{
+			_log.warning("Could not restore Last Login: " + e);
+		}
+		return chklogin;
+	}
 }
\ No newline at end of file
Index: java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java	(revision 5)
+++ java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java	(working copy)
@@ -79,7 +79,7 @@
 			getClient().closeNow();
 			return;
 		}
-		
+		activeChar.cklastlogin();
 		if (activeChar.isGM())
 		{
 			if (Config.GM_STARTUP_INVULNERABLE && AdminCommandAccessRights.getInstance().hasAccess("admin_invul", activeChar.getAccessLevel()))

Edited by madarismenos
Posted (edited)

My haters is individuals are all my children ;)

 

+1.Same code have L2Primer Project from 2013. I don't think that is your.

 

This is not your Code...

Edited by madarismenos
Posted

ahhaahahaha again trying to show his self as a pro dev by using shared codes claiming as his.

In fact this code is shared on l2jbrasil (no advertise) by bluur XD

Posted (edited)
I do not know that was shared and that maker myself do not do leached go away You are too cheap!!!

 

ahhaahahaha again trying to show his self as a pro dev by using shared codes claiming as his.

In fact this code is shared on l2jbrasil (no advertise) by bluur XD

Edited by madarismenos
Posted

What happens if i will use different databases for game and login server? Your code return a zero and spammed a log file. Better implementation when you uses LS <-> GS connection.

 

In this case, it's useless shitcode.

Posted

I have error:

 

public long cklastlogin()

    [javac] C:\workspace\L2jFrozen_GameServer\head-src\com\l2jfrozen\gameserver\model\actor\instance\L2PcInstance.java:10457: error: illegal start of expression
    [javac] 			public long cklastlogin();
    [javac] 			^
    [javac] C:\workspace\L2jFrozen_GameServer\head-src\com\l2jfrozen\gameserver\model\actor\instance\L2PcInstance.java:10457: error: ';' expected
    [javac] 			public long cklastlogin();
    [javac]
Posted

delete from where? 

+	
+	public long cklastlogin()
+	{
+		long chklogin = 0;
+		try (Connection con = L2DatabaseFactory.getInstance().getConnection())
+		{
+			PreparedStatement statement = con.prepareStatement("SELECT lastactive FROM accounts WHERE login=?");
+			statement.setString(1, getAccountName());
+			ResultSet rset = statement.executeQuery();
+			
+			// Go though the recordset of this SQL query
+			while (rset.next())
+			{
+				chklogin = rset.getLong("lastactive");
+                               SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
+                               Date date = new Date(chklogin);
+                               sendMessage("Last Login:"+dateFormat.format(date));
+			}
+			
+			rset.close();
+			statement.close();
+		}
+		catch (Exception e)
+		{
+			_log.warning("Could not restore Last Login: " + e);
+		}
+		return chklogin;
+	}
Posted (edited)

Don't c/p code part as its fine, your code @ eclipse has ;

 

10457 line, you wrote public long cklastlogin(); <- from here.

 

Eclipse should throw you the error.

Edited by SweeTs

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Tell a Škoda 1.4 driver that a Škoda 1.8 is faster — and suddenly, you’re riding a mini race car. On the way, they might share random stories — gas prices, the perfect BBQ recipe, or how passengers once called them “just for a minute.” Maybe even how someone left a suitcase full of money in their car once.     The important part? You’ll get there on time, no delays.     Vibe SMS works just as fast — messages fly like that driver who just heard their 1.8 isn’t the fastest.     🌐 https://vibe-sms.net/ 📲 https://t.me/vibe_sms  
    • ⚔️ The Grand Opening Has Arrived! ⚔️ In just a few hours the gate to the eternal battlefield will be open and the war between Order and Chaos will be set once again ! Its time to claim your destiny 🔥 👉 Register now and join the fight today! 🌐 https://l2ovc.com register now : https://l2ovc.com The gates are open the war between Order and Chaos has officially started! 🔥 Join the battlefield NOW and claim your destiny in Order vs Chaos! 💥 Don’t fall behind your faction needs you. ➡️ https://l2ovc.com  
    • Don’t miss the new Telegram gifts with our Telegram Stars purchasing bot! A great opportunity to invest in a stable digital asset at an early stage while the market is still forming. Buy other existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium subscriptions, and react to messages in channels! Low prices, multiple payment options, and other cool unique features! ⚡ Try it today — SOCNET STARS BOT ⚡ Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. ⭐ Telegram Stars Purchase Bot: Go – fast and profitable way to buy stars in Telegram. SMM Panel: Go – promote your social media accounts. We present to you the current list of promotions and special offers for purchasing our products and services: 1️⃣ Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in October! You can also use the promo code SOCNET (15% discount) for your first purchase. 2️⃣ Get $1 on your store balance or a 10–20% discount — just write your username after registration on our website using the template: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3️⃣ Get $1 for your first SMM Panel trial — simply open a ticket titled “Get Trial Bonus” on our website (Support). 4️⃣ Weekly ⭐ Telegram Stars giveaways in our Telegram channel and in our Telegram Stars bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Don’t miss the new Telegram gifts with our Telegram Stars purchasing bot! A great opportunity to invest in a stable digital asset at an early stage while the market is still forming. Buy other existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium subscriptions, and react to messages in channels! Low prices, multiple payment options, and other cool unique features! ⚡ Try it today — SOCNET STARS BOT ⚡ Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. ⭐ Telegram Stars Purchase Bot: Go – fast and profitable way to buy stars in Telegram. SMM Panel: Go – promote your social media accounts. We present to you the current list of promotions and special offers for purchasing our products and services: 1️⃣ Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in October! You can also use the promo code SOCNET (15% discount) for your first purchase. 2️⃣ Get $1 on your store balance or a 10–20% discount — just write your username after registration on our website using the template: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3️⃣ Get $1 for your first SMM Panel trial — simply open a ticket titled “Get Trial Bonus” on our website (Support). 4️⃣ Weekly ⭐ Telegram Stars giveaways in our Telegram channel and in our Telegram Stars bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock