func NewZone(name string) *Zone { var zone Zone zone.initDbObject() zone.Name = utils.FormatName(name) modified(&zone) return &zone }
func (self *Zone) SetName(name string) { self.WriteLock() defer self.WriteUnlock() if name != self.Name { self.Name = utils.FormatName(name) modified(self) } }
func NewUser(name string, password string) *User { var user User user.initDbObject() user.Name = utils.FormatName(name) user.Password = hash(password) user.ColorMode = utils.ColorModeNone user.online = false user.windowWidth = 80 user.windowHeight = 40 modified(&user) return &user }