| 154 | } |
| 155 | |
| 156 | func (this *DAUManager) processIP(serverId int64, ip string) error { |
| 157 | if !this.isReady { |
| 158 | return nil |
| 159 | } |
| 160 | |
| 161 | // day |
| 162 | var date = fasttime.Now().Ymd() |
| 163 | |
| 164 | { |
| 165 | var key = "server_" + date + "_" + types.String(serverId) + "_" + ip |
| 166 | found, err := this.ipTable.Exist(key) |
| 167 | if err != nil || found { |
| 168 | return err |
| 169 | } |
| 170 | |
| 171 | err = this.ipTable.Set(key, nil) |
| 172 | if err != nil { |
| 173 | return err |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | { |
| 178 | var key = "server_" + date + "_" + types.String(serverId) |
| 179 | this.statLocker.Lock() |
| 180 | this.statMap[key] = this.statMap[key] + 1 |
| 181 | this.statLocker.Unlock() |
| 182 | } |
| 183 | |
| 184 | return nil |
| 185 | } |
| 186 | |
| 187 | func (this *DAUManager) ReadStatMap() map[string]int64 { |
| 188 | this.statLocker.Lock() |