default netcafe rewards and maintenance

This commit is contained in:
wish
2022-08-13 18:22:56 +10:00
parent 0ba9adcc88
commit d8072ee06e
3 changed files with 15 additions and 3 deletions

View File

@@ -108,9 +108,11 @@ func main() {
}
logger.Info("Connected to database")
// Clear existing tokens
// Clear stale data
_ = db.MustExec("DELETE FROM sign_sessions")
_ = db.MustExec("DELETE FROM servers")
_ = db.MustExec("DELETE FROM cafe_accepted")
_ = db.MustExec("UPDATE characters SET cafe_time=0")
// Clean the DB if the option is on.
if erupeConfig.DevMode && erupeConfig.DevModeOptions.CleanDB {

View File

@@ -5,7 +5,7 @@ ALTER TABLE IF EXISTS public.characters
CREATE TABLE IF NOT EXISTS public.cafebonus
(
id integer NOT NULL PRIMARY KEY,
id serial NOT NULL PRIMARY KEY,
time_req integer NOT NULL,
item_type integer NOT NULL,
item_id integer NOT NULL,
@@ -18,4 +18,14 @@ CREATE TABLE IF NOT EXISTS public.cafe_accepted
character_id integer NOT NULL
);
INSERT INTO public.cafebonus (time_req, item_type, item_id, quantity)
VALUES
(1800, 17, 0, 250),
(3600, 17, 0, 500),
(7200, 17, 0, 1000),
(10800, 17, 0, 1500),
(18000, 17, 0, 1750),
(28800, 17, 0, 3000),
(43200, 17, 0, 4000);
END;

View File

@@ -118,7 +118,7 @@ func handleMsgMhfGetCafeDurationBonusInfo(s *Session, p mhfpacket.MHFPacket) {
s.logger.Error("Error scanning cafebonus", zap.Error(err))
}
bf.WriteUint32(cafeBonus.TimeReq)
bf.WriteUint32(0) // Unk
bf.WriteUint32(cafeBonus.ItemType)
bf.WriteUint32(cafeBonus.ItemID)
bf.WriteUint32(cafeBonus.Quantity)
bf.WriteBool(cafeBonus.Claimed)