Changeset d9cda90fd5d92911e2520f662160de2e2935f049
- Timestamp:
- 05/31/08 15:34:22
(4 months ago)
- Author:
- Christopher Jung <bktheg@web.de>
- git-committer:
- Christopher Jung <bktheg@web.de> 1212240862 +0200
- git-parent:
[a71ee881d17e73387497226ee3d14a5d812de363]
- git-author:
- Simon Dietsch <rhonabwy@sternenbund.org> 1212240862 +0200
- Message:
[feature] Der Noobschutz wird nun nach 30 Tagen automatisch entfernt
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rc27647a |
rd9cda90 |
|
| 231 | 231 | |
|---|
| 232 | 232 | /* |
|---|
| | 233 | * Unset Noob Protection for experienced players |
|---|
| | 234 | */ |
|---|
| | 235 | private void doNoobProtection(){ |
|---|
| | 236 | org.hibernate.Session db = getDB(); |
|---|
| | 237 | |
|---|
| | 238 | this.log(""); |
|---|
| | 239 | this.log("Bearbeite Noob-Protection"); |
|---|
| | 240 | |
|---|
| | 241 | List noobUsers = db.createQuery("from User where id>0 and flags LIKE '%" + User.FLAG_NOOB+"%'").list(); |
|---|
| | 242 | int noobDays = 30; |
|---|
| | 243 | int noobTime = 24*60*60*1000*noobDays; |
|---|
| | 244 | for( Iterator iter=noobUsers.iterator(); iter.hasNext(); ) { |
|---|
| | 245 | User user = (User)iter.next(); |
|---|
| | 246 | |
|---|
| | 247 | if( !user.hasFlag(User.FLAG_NOOB) ) { |
|---|
| | 248 | continue; |
|---|
| | 249 | } |
|---|
| | 250 | |
|---|
| | 251 | if (user.getSignup() <= System.currentTimeMillis() - noobTime){ |
|---|
| | 252 | user.setFlag(User.FLAG_NOOB, false); |
|---|
| | 253 | this.log("Entferne Noob-Schutz bei "+user.getId()); |
|---|
| | 254 | |
|---|
| | 255 | User nullUser = (User)db.get(User.class, 0); |
|---|
| | 256 | PM.send(nullUser, user.getId(), "GCP-Schutz aufgehoben", |
|---|
| | 257 | "Ihr GCP-Schutz wurde durch das System aufgehoben. " + |
|---|
| | 258 | "Dies passiert automatisch "+noobDays+" Tage nach der Registrierung. " + |
|---|
| | 259 | "Sie sind nun angreifbar, koennen aber auch selbst angreifen.", |
|---|
| | 260 | PM.FLAGS_AUTOMATIC | PM.FLAGS_IMPORTANT); |
|---|
| | 261 | } |
|---|
| | 262 | } |
|---|
| | 263 | } |
|---|
| | 264 | |
|---|
| | 265 | /* |
|---|
| 233 | 266 | |
|---|
| 234 | 267 | Neue Felsbrocken spawnen lassen |
|---|
| … | … | |
| 429 | 462 | getContext().commit(); |
|---|
| 430 | 463 | |
|---|
| 431 | | |
|---|
| | 464 | |
|---|
| 432 | 465 | this.doJumps(); |
|---|
| 433 | 466 | getContext().commit(); |
|---|
| … | … | |
| 437 | 470 | |
|---|
| 438 | 471 | this.doVacation(); |
|---|
| | 472 | getContext().commit(); |
|---|
| | 473 | |
|---|
| | 474 | this.doNoobProtection(); |
|---|
| 439 | 475 | getContext().commit(); |
|---|
| 440 | 476 | |
|---|