Example #1
0
func Start(r *types.RoleInfo, recv chan proto.PMessage, exitCnt chan struct{}, wgExitCnt *sync.WaitGroup, gw gateway.Gateway) {
	rc := new(roleAgent)
	roleData := new(role.RoleData)
	roleData.BaseInfo = r
	roleData.LastLogoutSec = r.LastLogoutSec
	roleData.GW = gw
	r.LastLogoutSec = 0
	rc.rd = roleData
	rc.recv = recv
	rc.exitCnt = exitCnt
	rc.gw = gw
	rc.wgExitCnt = wgExitCnt

	go rc.start()
}
Example #2
0
func (*_fm_role) HookOffline(rd *role.RoleData) {
	rd.LastLogoutSec = int32(time.Now().Unix())
}