mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-12 23:14:36 +01:00
default netcafe rewards and maintenance
This commit is contained in:
4
main.go
4
main.go
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user