Register for your free account! | Forgot your password?

You last visited: Today at 08:09

  • Please register to post and access all features, it's quick, easy and FREE!

 

Jp over flow

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2012
Posts: 356
Received Thanks: 32
Jp over flow

so is there anything i can do to keep the jp from overflowing when players get too much jp they get that cannot connect to server error and what not when i drop there total_jp to 0 or lower number then they dont get the error so is there a way to cap the total_jp ? or is there a way to add a function to a LUA that auto detects players Total_jp and caps it out or resets it back to 0 ?



mlejnek2 is offline  
Old   #2
Moderator
 
elite*gold: 1
Join Date: Dec 2012
Posts: 3,043
Received Thanks: 978
Sure there is a way to write a lua to reset the JP back to a smaller value and there is also a way to create a JP trader to allow players to transfer their JP into something else.



ThunderNikk is offline  
Old   #3
 
elite*gold: 0
Join Date: Jan 2012
Posts: 356
Received Thanks: 32
its not the jp they have thats overflowing its the Total_jp that is causing this problem
mlejnek2 is offline  
Old   #4
Moderator
 
elite*gold: 1
Join Date: Dec 2012
Posts: 3,043
Received Thanks: 978
S if it is a cumulative total_jp number that stays the same even if they trade their jp or you change their jp to a lower number.

This total JP is only used if they reset their JP on a rebirth or a respec potion?

Maybe change total_jp column to a larger allowed integer?

You could do a on log in function that reduces this number or run a script that sets the number to 0 on a global scale once a week for maintenance but I am not sure what will be affected.

update telecaster.dbo.character set total_jp = 0 where name like '%'

That is if total_jp is in the character tables.

on_login lua

Use the get_value or gv total_jp function

if total_jp > 600,000,000,000 then set total_jp = (total_jp - 100,000,000,000)

Or something like that. I cant really write one without testing it.


ThunderNikk is offline  
Old   #5
 
elite*gold: 0
Join Date: Nov 2011
Posts: 980
Received Thanks: 1,007
Or just use the allmighty smp for that case : smp_read_character_list

Code:
USE [Telecaster]
GO
/****** Object:  StoredProcedure [dbo].[smp_read_character_list]    Script Date: 20.07.2015 21:49:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

-- start of smp_read_character_list
ALTER PROCEDURE [dbo].[smp_read_character_list]

@IN_ACCOUNT_ID		INT

AS
SET NOCOUNT ON

--SET ROWCOUNT 1
--WHILE 1=1
--BEGIN
--	UPDATE dbo.Character SET name = '@' + name + ' '+ SUBSTRING( CONVERT(varchar(40), GETDATE(), 21) , 3, 18 ) WHERE account_id = @IN_ACCOUNT_ID AND delete_time <= GETDATE() and name not like '@%';
--	IF @@ROWCOUNT = 0 BREAK
--END
--SET ROWCOUNT 0

SELECT	sid,
		name,
		race,
		***,
		lv,
		jlv,
		exp,
		hp,
		mp,
		job,
		permission,
		skin_color,
		model_00,
		model_01,
		model_02,
		model_03,
		model_04,
		hair_color_index,
		hair_color_rgb,
		hide_equip_flag,
		texture_id,
		permission,
		create_time,
		delete_time,
		login_time,
		login_count,
		logout_time,
		play_time
		FROM dbo.Character WITH (NOLOCK) WHERE account_id = @IN_ACCOUNT_ID AND name NOT LIKE '@%' ORDER BY sid;



                -------- updating high values here---------------
                -------- this is just an example.....
		update dbo.Character set total_jp = 500000000 where total_jp > 500000000 

RETURN @@ERROR
TheOnlyOneRaskim is offline  
Old   #6
 
elite*gold: 0
Join Date: Jan 2012
Posts: 356
Received Thanks: 32
its in the table and i would really like it if there was a On log in Lua so hen players log on it auto resets there total_jp is say over 10 bil it will set it back to 10 bil so when they relog they dont get that error anymore...
mlejnek2 is offline  
Old   #7
 
elite*gold: 0
Join Date: Jan 2012
Posts: 356
Received Thanks: 32
If you are willing to make me a LUA function i would surely inject it into my lua and use it that would be greatfull and as always tyvm for the help
mlejnek2 is offline  
Old   #8
 
elite*gold: 0
Join Date: Jan 2012
Posts: 356
Received Thanks: 32
Quote:
Originally Posted by TheOnlyOneRaskim View Post
Or just use the allmighty smp for that case : smp_read_character_list

Code:
USE [Telecaster]
GO
/****** Object:  StoredProcedure [dbo].[smp_read_character_list]    Script Date: 20.07.2015 21:49:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

-- start of smp_read_character_list
ALTER PROCEDURE [dbo].[smp_read_character_list]

@IN_ACCOUNT_ID		INT

AS
SET NOCOUNT ON

--SET ROWCOUNT 1
--WHILE 1=1
--BEGIN
--	UPDATE dbo.Character SET name = '@' + name + ' '+ SUBSTRING( CONVERT(varchar(40), GETDATE(), 21) , 3, 18 ) WHERE account_id = @IN_ACCOUNT_ID AND delete_time <= GETDATE() and name not like '@%';
--	IF @@ROWCOUNT = 0 BREAK
--END
--SET ROWCOUNT 0

SELECT	sid,
		name,
		race,
		sex,
		lv,
		jlv,
		exp,
		hp,
		mp,
		job,
		permission,
		skin_color,
		model_00,
		model_01,
		model_02,
		model_03,
		model_04,
		hair_color_index,
		hair_color_rgb,
		hide_equip_flag,
		texture_id,
		permission,
		create_time,
		delete_time,
		login_time,
		login_count,
		logout_time,
		play_time
		FROM dbo.Character WITH (NOLOCK) WHERE account_id = @IN_ACCOUNT_ID AND name NOT LIKE '@%' ORDER BY sid;



                -------- updating high values here---------------
                -------- this is just an example.....
		update dbo.Character set total_jp = 500000000 where total_jp > 500000000 

RETURN @@ERROR
try'ed this and still not changing the total_jp to any number no matter what i set it too with this its still stays what it was and also why is the smp.update_character locked cant even check it to see if the error is in there its encryted and i cant do anything with it
mlejnek2 is offline  
Old   #9


 
elite*gold: 30
Join Date: May 2011
Posts: 4,801
Received Thanks: 3,181
Quote:
Originally Posted by thndr View Post
Maybe change total_jp column to a larger allowed integer?
It doesn't affect anything since the GS simply converts the number back into its type (probably an Int32).
Also I wouldn't recommend such changes anyways, you'll never know how it affects the gameserver itself, it may cause crashes or other issues.

Quote:
Originally Posted by mlejnek2 View Post
its in the table and i would really like it if there was a On log in Lua so hen players log on it auto resets there total_jp is say over 10 bil it will set it back to 10 bil so when they relog they dont get that error anymore...
I'm not quite sure if the total_jp is actually needed somehow (probably, as mentioned before, on a jobreset) but you could simply add something like this to the onlogin() function (if set_value supports total_jp, not sure about this):

Code:
-- The max value of 32-bit integer is 2,147,483,647
-- so we simply set it back to 1,000,000,000.
-- There is now enough left to not overflow 
-- (except you powerlevel with 170 for 24 hours or something)
if gv("total_jp") > 1000000000 then
    sv("total_jp", 1000000000)
end
Xijezu is offline  
Old   #10
 
elite*gold: 0
Join Date: Jan 2012
Posts: 356
Received Thanks: 32
ty Xijezu will try that is the GS for the posted 9.1 files also 32 bit cause thats what im using atm.


mlejnek2 is offline  
Reply



« Previous Thread | Next Thread »

Similar Threads
Flow S4
First you will need to login to your Elitepvpers Forums account. This is so the hack won't be leeched if you do not trust it do not use it....
23 Replies - S4 League Hacks, Bots, Cheats & Exploits
ice flow
hat vielleicht schon einer ein Scar von Schiffsfrack auf ice flow umgeschrieben oder den Code von ice flow wäre schön wenn das einer mal rein...
0 Replies - Seafight
So much flow of...
I wonder if mods can open a sub section for these private server so we can keep the old and new support topics up in under main Rappelz tittle...
3 Replies - Rappelz



All times are GMT +2. The time now is 08:09.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2017 elitepvpers All Rights Reserved.