add run function, solve bugs of loading file(dead loop), solve bugs for emit function in room-socket(when it is running, we only need to pass d as a struct rather than reforms it)