Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Commit

Permalink
NPE fix thanks Pfann
Browse files Browse the repository at this point in the history
Fixing NPE in mobius projects
By default now Global reward will ignore Offline Stores
By default now Global reward will ignore Fake Players
Rewards will not allow players without IP Address
  • Loading branch information
nightw0lv committed Oct 12, 2022
1 parent adeef20 commit 64ffea9
Show file tree
Hide file tree
Showing 45 changed files with 697 additions and 3 deletions.
17 changes: 17 additions & 0 deletions Mobius/L2J_Mobius_1.0_Ertheia/src/itopz/com/global/Global.java
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,23 @@ private void reward(String TOPSITE)
// iterate through all players
for (PlayerInstance player : World.getInstance().getPlayers().stream().filter(Objects::nonNull).collect(Collectors.toList()))
{
// ignore fake players
if (player.isFakePlayer())
{
continue;
}
// ignore offline stores
if (player.isInOfflineMode())
{
// (spam console) message of ignored offline stores
Gui.getInstance().ConsoleWrite("Ignoring " + player.getName() + " from rewards");
continue;
}
// null addresses are not allowed
if (player.getIPAddress() == null)
{
continue;
}
// set player signature key
String key = "";
try
Expand Down
17 changes: 17 additions & 0 deletions Mobius/L2J_Mobius_2.5_Underground/src/itopz/com/global/Global.java
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,23 @@ private void reward(String TOPSITE)
// iterate through all players
for (PlayerInstance player : World.getInstance().getPlayers().stream().filter(Objects::nonNull).collect(Collectors.toList()))
{
// ignore fake players
if (player.isFakePlayer())
{
continue;
}
// ignore offline stores
if (player.isInOfflineMode())
{
// (spam console) message of ignored offline stores
Gui.getInstance().ConsoleWrite("Ignoring " + player.getName() + " from rewards");
continue;
}
// null addresses are not allowed
if (player.getIPAddress() == null)
{
continue;
}
// set player signature key
String key = "";
try
Expand Down
17 changes: 17 additions & 0 deletions Mobius/L2J_Mobius_3.0_Helios/src/itopz/com/global/Global.java
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,23 @@ private void reward(String TOPSITE)
// iterate through all players
for (PlayerInstance player : World.getInstance().getPlayers().stream().filter(Objects::nonNull).collect(Collectors.toList()))
{
// ignore fake players
if (player.isFakePlayer())
{
continue;
}
// ignore offline stores
if (player.isInOfflineMode())
{
// (spam console) message of ignored offline stores
Gui.getInstance().ConsoleWrite("Ignoring " + player.getName() + " from rewards");
continue;
}
// null addresses are not allowed
if (player.getIPAddress() == null)
{
continue;
}
// set player signature key
String key = "";
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,23 @@ private void reward(String TOPSITE)
// iterate through all players
for (PlayerInstance player : World.getInstance().getPlayers().stream().filter(Objects::nonNull).collect(Collectors.toList()))
{
// ignore fake players
if (player.isFakePlayer())
{
continue;
}
// ignore offline stores
if (player.isInOfflineMode())
{
// (spam console) message of ignored offline stores
Gui.getInstance().ConsoleWrite("Ignoring " + player.getName() + " from rewards");
continue;
}
// null addresses are not allowed
if (player.getIPAddress() == null)
{
continue;
}
// set player signature key
String key = "";
try
Expand Down
17 changes: 17 additions & 0 deletions Mobius/L2J_Mobius_5.0_Salvation/src/itopz/com/global/Global.java
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,23 @@ private void reward(String TOPSITE)
// iterate through all players
for (PlayerInstance player : World.getInstance().getPlayers().stream().filter(Objects::nonNull).collect(Collectors.toList()))
{
// ignore fake players
if (player.isFakePlayer())
{
continue;
}
// ignore offline stores
if (player.isInOfflineMode())
{
// (spam console) message of ignored offline stores
Gui.getInstance().ConsoleWrite("Ignoring " + player.getName() + " from rewards");
continue;
}
// null addresses are not allowed
if (player.getIPAddress() == null)
{
continue;
}
// set player signature key
String key = "";
try
Expand Down
17 changes: 17 additions & 0 deletions Mobius/L2J_Mobius_5.5_EtinasFate/src/itopz/com/global/Global.java
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,23 @@ private void reward(String TOPSITE)
// iterate through all players
for (PlayerInstance player : World.getInstance().getPlayers().stream().filter(Objects::nonNull).collect(Collectors.toList()))
{
// ignore fake players
if (player.isFakePlayer())
{
continue;
}
// ignore offline stores
if (player.isInOfflineMode())
{
// (spam console) message of ignored offline stores
Gui.getInstance().ConsoleWrite("Ignoring " + player.getName() + " from rewards");
continue;
}
// null addresses are not allowed
if (player.getIPAddress() == null)
{
continue;
}
// set player signature key
String key = "";
try
Expand Down
17 changes: 17 additions & 0 deletions Mobius/L2J_Mobius_6.0_Fafurion/src/itopz/com/global/Global.java
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,23 @@ private void reward(String TOPSITE)
// iterate through all players
for (PlayerInstance player : World.getInstance().getPlayers().stream().filter(Objects::nonNull).collect(Collectors.toList()))
{
// ignore fake players
if (player.isFakePlayer())
{
continue;
}
// ignore offline stores
if (player.isInOfflineMode())
{
// (spam console) message of ignored offline stores
Gui.getInstance().ConsoleWrite("Ignoring " + player.getName() + " from rewards");
continue;
}
// null addresses are not allowed
if (player.getIPAddress() == null)
{
continue;
}
// set player signature key
String key = "";
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,23 @@ private void reward(String TOPSITE)
// iterate through all players
for (PlayerInstance player : World.getInstance().getPlayers().stream().filter(Objects::nonNull).collect(Collectors.toList()))
{
// ignore fake players
if (player.isFakePlayer())
{
continue;
}
// ignore offline stores
if (player.isInOfflineMode())
{
// (spam console) message of ignored offline stores
Gui.getInstance().ConsoleWrite("Ignoring " + player.getName() + " from rewards");
continue;
}
// null addresses are not allowed
if (player.getIPAddress() == null)
{
continue;
}
// set player signature key
String key = "";
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,18 @@ private void reward(String TOPSITE)
// iterate through all players
for (PlayerInstance player : World.getInstance().getAllPlayers().stream().filter(Objects::nonNull).collect(Collectors.toList()))
{
// ignore offline stores
if (player.isInOfflineMode())
{
// (spam console) message of ignored offline stores
Gui.getInstance().ConsoleWrite("Ignoring " + player.getName() + " from rewards");
continue;
}
// null addresses are not allowed
if (player.getClient().getIpAddress() == null)
{
continue;
}
// set player signature key
String key = "";
try
Expand Down
12 changes: 12 additions & 0 deletions Mobius/L2J_Mobius_C6_Interlude/src/itopz/com/global/Global.java
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,18 @@ private void reward(String TOPSITE)
// iterate through all players
for (PlayerInstance player : World.getInstance().getAllPlayers().stream().filter(Objects::nonNull).collect(Collectors.toList()))
{
// ignore offline stores
if (player.isInOfflineMode())
{
// (spam console) message of ignored offline stores
Gui.getInstance().ConsoleWrite("Ignoring " + player.getName() + " from rewards");
continue;
}
// null addresses are not allowed
if (player.getClient().getIpAddress() == null)
{
continue;
}
// set player signature key
String key = "";
try
Expand Down
17 changes: 17 additions & 0 deletions Mobius/L2J_Mobius_CT_2.4_Epilogue/src/itopz/com/global/Global.java
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,23 @@ private void reward(String TOPSITE)
// iterate through all players
for (PlayerInstance player : World.getInstance().getPlayers().stream().filter(Objects::nonNull).collect(Collectors.toList()))
{
// ignore fake players
if (player.isFakePlayer())
{
continue;
}
// ignore offline stores
if (player.isInOfflineMode())
{
// (spam console) message of ignored offline stores
Gui.getInstance().ConsoleWrite("Ignoring " + player.getName() + " from rewards");
continue;
}
// null addresses are not allowed
if (player.getIPAddress() == null)
{
continue;
}
// set player signature key
String key = "";
try
Expand Down
17 changes: 17 additions & 0 deletions Mobius/L2J_Mobius_CT_2.6_HighFive/src/itopz/com/global/Global.java
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,23 @@ private void reward(String TOPSITE)
// iterate through all players
for (PlayerInstance player : World.getInstance().getPlayers().stream().filter(Objects::nonNull).collect(Collectors.toList()))
{
// ignore fake players
if (player.isFakePlayer())
{
continue;
}
// ignore offline stores
if (player.isInOfflineMode())
{
// (spam console) message of ignored offline stores
Gui.getInstance().ConsoleWrite("Ignoring " + player.getName() + " from rewards");
continue;
}
// null addresses are not allowed
if (player.getIPAddress() == null)
{
continue;
}
// set player signature key
String key = "";
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,23 @@ private void reward(String TOPSITE)
// iterate through all players
for (PlayerInstance player : World.getInstance().getPlayers().stream().filter(Objects::nonNull).collect(Collectors.toList()))
{
// ignore fake players
if (player.isFakePlayer())
{
continue;
}
// ignore offline stores
if (player.isInOfflineMode())
{
// (spam console) message of ignored offline stores
Gui.getInstance().ConsoleWrite("Ignoring " + player.getName() + " from rewards");
continue;
}
// null addresses are not allowed
if (player.getIPAddress() == null)
{
continue;
}
// set player signature key
String key = "";
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,23 @@ private void reward(String TOPSITE)
// iterate through all players
for (PlayerInstance player : World.getInstance().getPlayers().stream().filter(Objects::nonNull).collect(Collectors.toList()))
{
// ignore fake players
if (player.isFakePlayer())
{
continue;
}
// ignore offline stores
if (player.isInOfflineMode())
{
// (spam console) message of ignored offline stores
Gui.getInstance().ConsoleWrite("Ignoring " + player.getName() + " from rewards");
continue;
}
// null addresses are not allowed
if (player.getIPAddress() == null)
{
continue;
}
// set player signature key
String key = "";
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,23 @@ private void reward(String TOPSITE)
// iterate through all players
for (PlayerInstance player : World.getInstance().getPlayers().stream().filter(Objects::nonNull).collect(Collectors.toList()))
{
// ignore fake players
if (player.isFakePlayer())
{
continue;
}
// ignore offline stores
if (player.isInOfflineMode())
{
// (spam console) message of ignored offline stores
Gui.getInstance().ConsoleWrite("Ignoring " + player.getName() + " from rewards");
continue;
}
// null addresses are not allowed
if (player.getIPAddress() == null)
{
continue;
}
// set player signature key
String key = "";
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,23 @@ private void reward(String TOPSITE)
// iterate through all players
for (PlayerInstance player : World.getInstance().getPlayers().stream().filter(Objects::nonNull).collect(Collectors.toList()))
{
// ignore fake players
if (player.isFakePlayer())
{
continue;
}
// ignore offline stores
if (player.isInOfflineMode())
{
// (spam console) message of ignored offline stores
Gui.getInstance().ConsoleWrite("Ignoring " + player.getName() + " from rewards");
continue;
}
// null addresses are not allowed
if (player.getIPAddress() == null)
{
continue;
}
// set player signature key
String key = "";
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,23 @@ private void reward(String TOPSITE)
// iterate through all players
for (PlayerInstance player : World.getInstance().getPlayers().stream().filter(Objects::nonNull).collect(Collectors.toList()))
{
// ignore fake players
if (player.isFakePlayer())
{
continue;
}
// ignore offline stores
if (player.isInOfflineMode())
{
// (spam console) message of ignored offline stores
Gui.getInstance().ConsoleWrite("Ignoring " + player.getName() + " from rewards");
continue;
}
// null addresses are not allowed
if (player.getIPAddress() == null)
{
continue;
}
// set player signature key
String key = "";
try
Expand Down
Loading

0 comments on commit 64ffea9

Please sign in to comment.