Jump to content

(share)Last IP!


Recommended Posts

ya su MXC

ipa na kanw share afto mias k dn to ida pouthena!

eine ena code pou pou opote kaneis log in sto game sou vgazi ena pm k su lei tin ip pou ixe kani las log!

 

Index: head-src/com/l2jServer/gameserver/network/clientpackets/EnterWorld.java

===================================================================

--- head-src/com/l2jServer/gameserver/network/clientpackets/EnterWorld.java  (revision 5085)

+++ head-src/com/l2jServer/gameserver/network/clientpackets/EnterWorld.java  (working copy)

@@ -98,6 +98,7 @@

import com.l2jServer.gameserver.thread.TaskPriority;

import com.l2jServer.gameserver.thread.ThreadPoolManager;

import com.l2jServer.gameserver.util.Util;

+import com.l2jServer.gameserver.model.entity.ProtectionIP;

 

/**

  * Enter World Packet Handler

@@ -443,6 +444,7 @@

      }

 

      RegionBBSManager.getInstance().changeCommunityBoard();

+      ProtectionIP.onEnterWorld(activeChar);

      CustomWorldHandler.getInstance().enterWorld(activeChar);

 

      if(TvT._savePlayers.contains(activeChar.getName()))

Index: head-src/com/l2jServer/loginserver/LoginController.java

===================================================================

--- head-src/com/l2jServer/loginserver/LoginController.java  (revision 5085)

+++ head-src/com/l2jServer/loginserver/LoginController.java  (working copy)

@@ -750,10 +750,9 @@

          {

            client.setAccessLevel(access);

            client.setLastServer(lastServer);

-            statement = con.prepareStatement("UPDATE accounts SET lastactive=?, lastIP=? WHERE login=?");

+            statement = con.prepareStatement("UPDATE accounts SET lastactive=? WHERE login=?");

            statement.setLong(1, System.currentTimeMillis());

-            statement.setString(2, address.getHostAddress());

-            statement.setString(3, user);

+            statement.setString(2, user);

            statement.execute();

            statement.close();

            statement = null;

 

META ftia3te ena neo java file "ProtectionIP.java" sto "gameserver.model.entity"

* the Free Software Foundation; either version 2, or (at your option)

* any later version.

*

* This program is distributed in the hope that it will be useful,

* but WITHOUT ANY WARRANTY; without even the implied warranty of

* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

* GNU General Public License for more details.

*

* You should have received a copy of the GNU General Public License

* along with this program; if not, write to the Free Software

* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA

* 02111-1307, USA.

*

* http://www.gnu.org/copyleft/gpl.html

*/

package com.l2jserver.gameserver.model.entity;

 

import java.sql.PreparedStatement;

import java.sql.ResultSet;

 

import com.l2jserver.util.database.L2DatabaseFactory;

import com.l2jserver.gameserver.network.clientpackets.Say2;

import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;

import com.l2jserver.gameserver.network.serverpackets.CreatureSay;

 

/**

*

* @author  DaRkPoW3R

*/

public class ProtectionIP

{

  public static void onEnterWorld(L2PcInstance player)

  {

      String last = "";

      String curr = "";

      try

      {

        last = LastIP(player);

        curr = player.getClient().getConnection().getInetAddress().getHostAddress();

      }

      catch (Exception e)

      {

      }

 

      if (!last.equals(curr))

        player.sendPacket(new CreatureSay(1, Say2.PARTY, "SYSTEM", "Your last ip was: "+last+" and current: "+curr));

 

      UpdateLastIP(player, player.getAccountName());

  }

  public static String LastIP(L2PcInstance player)

  {

      String lastIp = "";

      java.sql.Connection con = null;

      try

      {

        ResultSet rset;

        con = L2DatabaseFactory.getInstance().getConnection();

        PreparedStatement statement = con.prepareStatement("SELECT * FROM `accounts` WHERE login = ?");

        statement.setString(1, player.getAccountName());

        rset = statement.executeQuery();

            while(rset.next())

            {

              lastIp = rset.getString("lastIP");

            }

      }

      catch(Exception e)

      {

        e.printStackTrace();

      }

      finally

      {

        try

        {

            con.close();

        }

        catch(Exception e)

        {

            e.printStackTrace();

        }

      }

      return lastIp;

  }

 

  public static void UpdateLastIP(L2PcInstance player ,String user)

  {

      String address = player.getClient().getConnection().getInetAddress().getHostAddress();

      java.sql.Connection con = null;

      try

      {

        con = L2DatabaseFactory.getInstance().getConnection();

        PreparedStatement statement = con.prepareStatement("UPDATE accounts SET lastIP=? WHERE login=?");

        statement.setString(1, address);

        statement.setString(2, user);

        statement.execute();

        statement.close();

      }

      catch(Exception e)

      {

        e.printStackTrace();

      }

      finally

      {

        try

        {

            con.close();

        }

        catch(Exception e)

        {

            e.printStackTrace();

        }

      }

  }

Link to comment
Share on other sites

Gredits ~> xAddytzu

Sugnwmh File pou 8a sto po alla auto p kaneis einai spam.. apo oti vlepeis to exei pei hdh kapios... k autos einai egw prwtos


Pos na min to eides re file afou logika apo edw 8a to exeis parei :S

ELEOS RE -.-"

Meta 2os autos

@author  xAddytzu not you.

Kai erxese ecu 3os ... :/

Link to comment
Share on other sites

Sugnwmh File pou 8a sto po alla auto p kaneis einai spam.. apo oti vlepeis to exei pei hdh kapios... k autos einai egw prwtos


Meta 2os autosKai erxese ecu 3os ... :/

ela vre pontie ksekola aston pedi na kani kamia doula mpori na min to prosekse

as kani kamia doulia arki na min vgali kalous sta xeria tou ap to pliktrologio...

sinexise file mou ke as tou na ksirizounte.....

Link to comment
Share on other sites

na ke tetartos...

epomenoooosssss ??

Φαντασού να έπαιρναν μία δική σου δουλειά και να λέγανε πως είναι δικό τους.

Όπως θα το έπαιρνες, έτσι θα το πάρει και αυτός που έκανε τον κώδικα.

 

Εμένα δε με πειράζει που έχει ξαναγίνει Share, αρκεί να το έλεγε.

Link to comment
Share on other sites

Φαντασού να έπαιρναν μία δική σου δουλειά και να λέγανε πως είναι δικό τους.

Όπως θα το έπαιρνες, έτσι θα το πάρει και αυτός που έκανε τον κώδικα.

 

Εμένα δε με πειράζει που έχει ξαναγίνει Share, αρκεί να το έλεγε.

simfono eprepe na dosi credit... pianou ine to share

Link to comment
Share on other sites

ka8e mera mpenoun sto mxc 1000+ atoma ! Ean erxotane se auto to topic o ka8e enas kai elege pos to topic exei ksana ginei kai pws ta credits dn einai dika tou ! ZHTW POU  KAHMAKE !

 

anyway ! Dn se euxaristw pou to moirasthkes mazi mas ,gt exei ksana ginei share pio palia !

Kai pio sigekrimena apo to xAddytzu

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • For upcoming changes, You should consider making those 3 tabs (or whatever more You will have with new games) more visible and standing out, because right it looks like all topics hidden under those 3 tabs.
    • While not particularly active over the years, I've been around for as long as I could remember, so here are my 2 cents too. On top of what has already been said, I'd like to touch on a few thing that might be improved upon. While it is easy to notice and say "there's lack of engagement" or "community has outgrown the ganre", I've seen numerous forums get forgotten and die while others continue to thrive to this day. The main issue, in my humble opinion, is that the sector has been commercialised to an unsustainable extent. When nobody is willing to share anything, even if it is just a rework of an open-sourced or already-shared resource, the sense of "community" gets deminished. Now back on the pressing matter. From what I've seen, the lack of engagement could be circumvented with a redesign and functionality expansion that would/could/should include: - a built-in chat functionality. - incentives for engagement/interaction, ideas of which I'll list as separate pointers, as not to limit your creativity. But just as an example, from a more user/human perspective, having an easily identifiable way to get into "the club of the cool kids on the block", figuratively speaking, is an incentive on its own. - separation of the reputation into reactions and reputation. One to be used to posts, such as up-vote and what not, while the other to be awarded as means of appreciation. - automated ranks with actual benefits/perks, not like the current ones providing nothing. - the ability to hide text for user/group of users, not just premium/no premium. - increased visibility of the HOT topics and the RECENTLY ACTIVE threads/posts. Can be also expanded to most liked posts, etc. ps.: I'll update my post when I have some free time on my hands.
    • There was no way I didn't refunded or delivered files. I don't see You on my conrtact list on Discord, can You send me a message or at least tell me for what project was this updater? I always resolve if I can't deliver on time or customer bailes.
    • @rlfem123  I’m a web developer, and I work with technologies like Next.js and React. In the last 10 years, L2 Rankzone is the only one I’ve seen that actually did something different. All the others seem to have the same source code with different templates. L2 Hopzone also did an upgrade and, for the front end, is using Vue.js. Regarding web development, we have reached a point where you can easily create websites using libraries or frameworks. Simply pick one and start working. You will learn as you go. Personally, I prefer to build my back-end APIs in Laravel if it’s a big project since the ecosystem offers everything. For smaller projects, I choose Go. Then I use either React or Next.js to call my APIs, depending on the case. Next.js also supports Server-Side Rendering (SSR) if you want to hide some things from the client. Additionally, CSS libraries have almost everything you need nowadays to start building quickly with browser compatibility. You can seriously build an L2 website with ranks, a good design, and even a simple login/register system in just 3 days. Here are some CSS libraries I personally work with: https://tailwindui.com/components   https://ui.shadcn.com/   https://mui.com/material-ui/ Regarding the top websites i dont thing its worth the time and effort.  Its pretty simple to build one and the market is already bloated. In addition l2 is dying so i suggest to build top sites for many games.  THe main problem is not the build process rather the marketing one. You can build the most awesome website iin terms of functionality but if you marketing is week you wont exceed 10 concurrent users. 
  • Topics

×
×
  • Create New...