fr.quatrevieux.araknemu.realm.handler.CloseInactiveSession   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
ccs 5
cts 5
cp 1
rs 10
eloc 8
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle(RealmSession,SessionIdle) 0 4 1
A packet() 0 3 1
1
/*
2
 * This file is part of Araknemu.
3
 *
4
 * Araknemu is free software: you can redistribute it and/or modify
5
 * it under the terms of the GNU Lesser General Public License as published by
6
 * the Free Software Foundation, either version 3 of the License, or
7
 * (at your option) any later version.
8
 *
9
 * Araknemu is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU Lesser General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU Lesser General Public License
15
 * along with Araknemu.  If not, see <https://www.gnu.org/licenses/>.
16
 *
17
 * Copyright (c) 2017-2019 Vincent Quatrevieux
18
 */
19
20
package fr.quatrevieux.araknemu.realm.handler;
21
22
import fr.quatrevieux.araknemu.core.network.SessionIdle;
23
import fr.quatrevieux.araknemu.core.network.parser.PacketHandler;
24
import fr.quatrevieux.araknemu.network.out.ServerMessage;
25
import fr.quatrevieux.araknemu.network.realm.RealmSession;
26
27
/**
28
 * Close the inactive session
29
 *
30
 * @todo refactor with game
0 ignored issues
show
introduced by
Comment matches to-do format '(TODO:)|(@todo )'.
Loading history...
31
 */
32 1
public final class CloseInactiveSession implements PacketHandler<RealmSession, SessionIdle> {
33
    @Override
34
    public void handle(RealmSession session, SessionIdle packet) {
35 1
        session.send(ServerMessage.inactivity());
36 1
        session.close();
37 1
    }
38
39
    @Override
40
    public Class<SessionIdle> packet() {
41 1
        return SessionIdle.class;
42
    }
43
}
44