ServUO Version
Publish 58
Ultima Expansion
Endless Journey
I did up some scripts for Christmas gift giving. It works fine on my test server and gives the token to players when they log in like it's supposed to. But, when I transferred the scripts to the main server the tokens are not being given to players on login. Both have the same exact server files and scripts other than saves.

Attached is the token script.
 

Attachments

  • Holiday2023Token.cs
    4.7 KB · Views: 4
The only thing I can really think of, is your live server's time having the wrong date/time set so it won't trigger. Maybe thinks it is November or something?
 
The only thing I can really think of, is your live server's time having the wrong date/time set so it won't trigger. Maybe thinks it is November or something?
Hadn't thought of that, but I did copy the main server and test it here on my computer and it did the same thing. No tokens given to players.


Edit:
Upon more research into this problem I found the reason why. On the main server in the accounts.xml my accounts have this line : <flags>2</flags>. On my test server they do not have it. Is there a way to get rid of these flags?
 
Last edited:
Where did you deduce that this "<flags>2</flags>" caused the issue, and removing them solves it? Nothing in the code you provided demonstrates anything related to that.
 
Well I did my due diligence to find the reason why it was giving the gift on one server and not the other. I then figured there was something to do with the accounts themselves. So I checked the info in game and nothing stuck out, so the next spot to check would be the accounts.xml. That is how I found the difference.

Also to test the theory I changed the password on an unused account on the main and logged in on it and it was given the gift. This account did not have the flag line in the accounts.xml.
 
Ok, so now that you think you figured it out, then why would your posted code cause this as I see no reference in your code about anything having to do with accounts. You have a function to give a gift. I think you edited other scripts that you did not post here to help others figure it out.
 
I think you edited other scripts that you did not post here to help others figure it out.
I have not edited any other files to make this work. Why would I not post all the files needed to figure out the solution to the problem? I have nothing to hide as far this system goes.

I am not sure the exact way the Gift Giving system tells how a player has a received a gift for that period of time. I am "assuming" it is done via the flags on the account.
 
It is probably connected to that... What I used was one of the anniversary gift giving scripts to give this token to players....
So if it is connected to the vet reward system yes.
 
I did up some scripts for Christmas gift giving. It works fine on my test server and gives the token to players when they log in like it's supposed to. But, when I transferred the scripts to the main server the tokens are not being given to players on login. Both have the same exact server files and scripts other than saves.

Attached is the token script.
This system based on the LastLogin time. Probably while you testing this on local server with old saves, all characters have a lower date than StartDate value, and in this case it works well. But on the main server players have updated LastLogin values. For example you've set in script StartDate from 12 December, but today is the 17th, and on the main server players already played from 12th to 17th , in this case the system will give a reward only to those players who have not yet logged in before the 12th.

To solve this problem, you need to set the date to December 18th and upload this script to the main server on December 17th.
 
Back