add auto gen server vars, improve next tick handling