User

From ETM
Jump to navigation Jump to search

Storage system design needed.

Storage System Design

Userprofiles are generally split in to smaller parts. This helps with memory-management, load-times and in the end data-parsing within the backend.

For example: If we store everything inside a user.json this could easily get up to 200kb+ per File. Scanning for homepoints in general in a given area would require to load 100.000* 0,2MB => 20GB of data.

By splitting the data into chunks/containers we can decrease the filesize to probably <10kb per File. 100.000* 0,01MB => 1 GB. Factor 20 speed increase and this does not include better caching strategy by HDD/DB as most likely only a subset of the data will be queried regularly.

UserOptions

	// BooleanState
	FakeView			(0, BooleanState.class),		// View
	Tablist				(1, BooleanState.class),		// Tablist
	RocketBoots			(2, BooleanState.class),		// RocketBoots
	FlyBackwards		(3, BooleanState.class),		// RocketBoots
	FlyEffects			(4, BooleanState.class),		// RocketBoots
	HoverFly			(5, BooleanState.class),		// RocketBoots
	CreativeFly			(6, BooleanState.class),		// Essential
	Fakes				(7, BooleanState.class),		// FakeStuff
	DebugInfo			(8, BooleanState.class),		// Debug
	ShowDisabledPerm	(9, BooleanState.class),		// Perm
	God					(10, BooleanState.class),		// Essential
	ShopMessages		(11, BooleanState.class),		// Kshop
	ShopErrorMessages	(12, BooleanState.class),		// Kshop
	Admin				(13, BooleanState.class),		//
	Vanished			(14, BooleanState.class),		// 

	// Integer 50
	ViewDistance		(50, Integer.class),				// View
	FakeViewDistance	(51, Integer.class),				// View
	CreativeFlySpeed	(52, Integer.class),				// Essential

	MaxHomes			(53, Integer.class), 				// -------------- Admin/Plugin only typically
	MaxAccounts 		(54, Integer.class), 				// -------------- Admin/Plugin only typically
	
	// Long 100

	// Float 150
	
	// Double 200
	
	BootsFlySpeed		(200, Double.class),				// Essential
	BootsUplift			(201, Double.class),				// Essential
	
	// Enums 300
	
	GameMode			(300, GameMode.class),			// Essential
	OwnAccountView		(301, AccountVisibility.class),	// Account
	OtherAccountView	(302, AccountVisibility.class),	// Account
	FlyEffectsType		(303, ChunkliEffect.class),		// RocketBoots
	ShopDefaults		(304, new ArrayList<String>()),
	ActiveAccount		(305, AccountId.class),			// Account

UserPods

	Home			(0, HomePod.class),
	Backpack		(1, BackpackPod.class),
	Chat			(2, ChatPod.class),


We need to (possibly) store:

  • ModelProfile -> ALWAYS LOADED
  • accounts -> ALWAYS LOADED
  • UserProfile -> loaded when online (?)
  • userstats profile -> loaded when online (?)
  • Mails (UUID <> MailProfile ?)
  • Homes (UUID <> MailProfile ?) vs stored in User (Component)