This is just the script...look on other sql job guides to learn how to schedule them.
[N]asser` ~ OutCode:UPDATE Character
SET Money=('2000000000')
WHERE Money<0
Credit to: [N]asser and solteykr
Printable View
This is just the script...look on other sql job guides to learn how to schedule them.
[N]asser` ~ OutCode:UPDATE Character
SET Money=('2000000000')
WHERE Money<0
Credit to: [N]asser and solteykr
Nothink new but will help someone
Yea, that's why I posted it here.
[N]asser` ~ Out
Good work But We have to came out of the game and wait 1minute it don't have other way to do that?
Then player is online gameserver keep player information in his memory, then player logoff gameserver send information to database, then player login gameserver get information from database so if you make change then player is online he logoff and gameserver will overwrite your information.
Yep.
[N]asser` ~ Out
you could insert it into the logoff stored procedure, so the moment he logoffs his money will be corrected
Why not use trigger instead?
Change the money recovered to any amount you like.Code:CREATE TRIGGER [Restrict_Money] ON [dbo].[Character]
after update
as
Update [Character] set [Character].money=2000000000
From Inserted
Where Inserted.money<0 and [Character].accountid=inserted.accountid
and [Character].name=inserted.name
Well, because the sql script I have up there is easier for others to figure out...
[N]asser` ~ Out
Well actually, triggers are easier to implement. Just use your SQL query to install it and it's done. There is no need set the job or the likes. And triggers works faster than jobs.
But it's just a personal preferences. Your method is good too.
totally agree.Quote:
Originally Posted by WhiteFox
I suppose that's true too. By the way, try to bring your server's IRC channel back on irc.muserver.org, whitefox.
[N]asser` ~ Out
WOOOWQuote:
Originally Posted by WhiteFox
Tnx Man :thumbup:
so is there any limit to the amount of zen the DB can stored? for example if it reach 10000000000 ... will it affect the DB?
Dont use the trigger
Why?.. simple
Gameserver will not read that until you change character or log off.
The system workflow is:
1.- Read the inventory of each character to show them on character selection screen
2.- Read one more time all the stats at the moment of selection
3.- Only write (no read at all) data into character table on each exp change, level up, point added, inventory change, etc.
4.- Store one more time at log out or character change
as u can see.. it iwll not read your trigger changes while the character is online.
Here is my solution for u to try:
there is a procedure WZ_DISCONNECT_MEMB
this one will run on each Account Log Out to set all the fields and logs on the offline position so we can use that one inserting this at the end:
I dont recommend "on update" triggers on character table because those tables receibe so many updates during play so those triggers can add overheat and overheat will make your system not estable.Quote:
UPDATE [Character] SET Money=2000000000 WHERE (Money<0) AND (AccountId=@uid)
Hope it helps