DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • April 19, 2019, 01:17:43 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1] 2   Go Down
  Print  
Author Topic: Day Accumulation  (Read 7470 times)
0 Members and 1 Guest are viewing this topic.
Exxar
Guest
« on: May 31, 2005, 04:45:38 PM »

A feature often missed by my players, is a means to save game days on which the user didn't log on, so he could play them at a later time. I didn't find such a module, so I wrote my own. I present to you my first module here at Dragonprime:

http://dragonprime.net/users/Exxar/daysave.zip

The extra days can be accessed from the village and shades. The module is independant of any game days per day settings because it uses in-game time. You can also set the maximum number of days that can be saved.

I've tested it extensively and it seems to work. It's not translation ready, but it will be in a few days. Any constructive criticism/bug reports/suggestions are welcome  Smiley
« Last Edit: June 01, 2005, 01:45:46 AM by Exxar » Logged
Exxar
Guest
« Reply #1 on: June 02, 2005, 08:27:52 AM »

Version 1.1

Fixed a bug that caused potentially infinite saved days when not logging out after using a saved day.

Same link.
Logged
SexyCook
Codemeister
****
Offline Offline

Posts: 430



View Profile WWW
« Reply #2 on: June 16, 2006, 03:28:32 AM »

I've installed this well intended module on my server, because quite a number of my players seem to have what they call "a real life" (they tried to explain me the concept of weekend, but I just didn't get it).

Anyhow, what's happening right now is a number of people are getting free days. As fas as I can tell from the code:
Quote
        case "newday":
            $pool=get_module_pref("pool");
            $lastonnextday=get_module_pref("lastlognewday");
            $maxpool=get_module_setting("maxpool");
            $time=gametimedetails();
            $timediff=$time['gametime']-$lastonnextday;
            if ($timediff>86400){
                $addition=floor($timediff/86400);
                $pool+=$addition;
                if ($pool > $maxpool) $pool=$maxpool;
                set_module_pref("pool", $pool);
            }
            set_module_pref("lastlognewday", $time['gametime']);
        break;

you save the last time the player has seen a "it's a new day" screen, then on the next day check if over 24 gameplay-hours have passed. On an hipotetical server with but 2 ticks per day, this would mean a player that logged on at 10 am will not get a free day as long as he logs on until 10 pm. But should he only log on at, say 11 pm, 26 gameplay hours would have passed between "it's a new day" screens and he would get a free day, although he did in fact log on during the previous tick.

Is my logic or my understanding of the code incorrect? I'd love to use this module bug-free, but right now it's beeing mainly used for cheating.

The logout code states:
Quote
        case "player-logout":
            $details=gametimedetails();
            set_module_pref("lastlognewday", $details['tomorrow']);
            break;
which seems to be more logical, the value for "lastlognewday" would be 0:00 of the next day, only if you haven't logged in for 24 gameplay-hours after that would you get a free day.

I've changed
Quote
set_module_pref("lastlognewday", $time['gametime']);
to
Quote
set_module_pref("lastlognewday", $time['tomorrow']);
in the newday-case, hoping that should do the trick.
« Last Edit: June 16, 2006, 03:47:57 AM by SexyCook » Logged
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #3 on: June 16, 2006, 04:21:52 AM »

A better way - just from the first thought - for this module to work would be to increase all users' prefs at a newday-runonce and decrease this pref upon their personal newdays (if they haven't been resurrected...)
Logged

Running for more than three years now:
SexyCook
Codemeister
****
Offline Offline

Posts: 430



View Profile WWW
« Reply #4 on: September 11, 2006, 02:50:23 AM »

I've done a couple changes since my post:

Changelog:
// v1.1 fixed a bug that caused a possible infinite newday loop when not logging out after using a newday
// V1.2 Fixes newday hook, added debug info by SexyCook
// V1.3 Added hook to jail
// V1.4 commented the debugs that were getting on my nerves, added an output for 0 days, due to translation difficulties.
// V1.5 Fixed the bug that gave new players the max amount of saved days

Uploaded to: http://dragonprime.net/index.php?module=Downloads;sa=dlview;id=548
Logged
Lord Sephiroth
Guest
« Reply #5 on: September 11, 2006, 06:56:54 AM »

i think you should try and make a way that an admin can dock new days from the players that are being troublesome but not enough to warrent a ban
Logged
SexyCook
Codemeister
****
Offline Offline

Posts: 430



View Profile WWW
« Reply #6 on: September 11, 2006, 11:04:55 AM »

Go into the Player Editor and insert -3 into the saved days field. I have no idea if this works, but should be what you're talking about, right? I can't keep a player from having a newday, that's core coded.
Logged
Lord Sephiroth
Guest
« Reply #7 on: September 11, 2006, 02:13:02 PM »

yea the -3 thing.. but maybe you should make it so for ever 3-5 game days missed you get one day acccumalated so they dont take advantage of it
Logged
SexyCook
Codemeister
****
Offline Offline

Posts: 430



View Profile WWW
« Reply #8 on: September 11, 2006, 02:27:57 PM »

Mate, the idea behing the day accumulation module is so that people can enjoy a weekend and NOT lose game days.
Logged
Lord Sephiroth
Guest
« Reply #9 on: September 12, 2006, 06:00:08 AM »

i know but im think maybe you should let them have maybe every 2 game days they get one stored.. its just makes it too easy... or at least if its possiable put a dk minium
Logged
SexyCook
Codemeister
****
Offline Offline

Posts: 430



View Profile WWW
« Reply #10 on: September 12, 2006, 06:37:47 AM »

*scratches his head* This module is not meant to be a bonus for players. You don't get newdays in forest events, you can't buy them. You can just accomulate an admin controlled maximum number of newdays you missed because you have a real life or at least a girlfriend/boyfriend who actually would like to go to the movies or out to eat.

On my own server I have set a maximum of 7 saved gamedays, with a 3 gamedays per realday, meaning someone can go friday evening on a weekend and come back sunday evening without losing any game time.

You seem to have 6 newdays per realday, meaning a newday every 4 hours. If you want people to be able to sleep for at least 8 hours without losing any gamedays, use a maximum of 1 saved day. If your players actually have school or jobs to go to, maybe you'd like to increase the number of maximum saved days. It's up to you.
Logged
Lord Sephiroth
Guest
« Reply #11 on: September 12, 2006, 06:48:19 AM »

*Sighs*
i mean because it could make it to easy for the farmies.... but i geuss its all about the people on the server
Logged
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5483



View Profile WWW
« Reply #12 on: September 12, 2006, 06:57:35 AM »

*Sighs*
i mean because it could make it to easy for the farmies.... but i geuss its all about the people on the server

Won't make it much easier than 2 hour game days already make it... Wink
Logged

Play the latest beta version here on DragonPrime
SexyCook
Codemeister
****
Offline Offline

Posts: 430



View Profile WWW
« Reply #13 on: September 12, 2006, 09:32:07 AM »

Why should it be easyer for the farmies? This only activates on missed newdays. A farmie that is online after each newday has it better than a farmie that can only be online 12 hours a day straight, if you chose only 1 or 2 as max saved days.

Take out "farmie", put in "players with DK x" in the sentence above, where x is a value between 0 and 9999 to see the big picture.
Logged
Elessa
Faerie
Mod God
*****
Offline Offline

Posts: 3598


short, sweet and to the point


View Profile
« Reply #14 on: September 12, 2006, 10:21:50 AM »

i hath to agree with sexycook. it matters not what the person's rank is, whether it be farmie, knight or god. what does matter is the amount of time the person is devoting to being online.  no one type of player receives preferential treatment through use of this module.

besides, if there were preferential treatment, would ye not want it to be for the lower ranked players anyway? they are so easily discouraged for the first one or two dks as it is and tend to drift away.  the retention rate can be very low on some servers for new players.

i see absolutely no reason to hath the module delineate by rank.
Logged

Uuma ma ten rashwe, ta tuluva a lle

Play the latest beta version here on LoGD DragonPrime - Axebridge
Pages: [1] 2   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
98 Guests, 1 User
Smirnov
Home Forums News Downloads Login Register Advanced Search