tools/hw2irc/net/ercatec/hw/INetClient.java
author sheepluva
Wed, 26 May 2021 16:32:43 -0400
changeset 15784 823cf18be1fc
permissions -rw-r--r--
Hedgewars lobby to IRC proxy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15784
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
     1
/*
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
     2
 * Java net client for Hedgewars, a free turn based strategy game
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
     3
 * Copyright (c) 2011 Richard Karolyi <sheepluva@ercatec.net>
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
     4
 *
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
     8
 *
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    12
 * GNU General Public License for more details.
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    13
 *
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    17
 */
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    18
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    19
package net.ercatec.hw;
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    20
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    21
import java.util.List;
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    22
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    23
public interface INetClient
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    24
{
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    25
    public static enum UserFlagType { UNKNOWN, ADMIN, INROOM, REGISTERED };
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    26
    public static enum BanType { BYNICK, BYIP };
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    27
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    28
    public void onConnectionLoss();
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    29
    public void onDisconnect(String reason);
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    30
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    31
    public void onMalformedMessage(String contents);
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    32
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    33
    public String onPasswordHashNeededForAuth();
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    34
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    35
    public void onChat(String user, String message);
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    36
    public void onWelcomeMessage(String message);
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    37
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    38
    public void onNotice(int number);
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    39
    public String onNickCollision(String nick);
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    40
    public void onNickSet(String nick);
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    41
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    42
    public void onLobbyJoin(String[] users);
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    43
    public void onLobbyLeave(String user, String reason);
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    44
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    45
    // TODO flags => enum array?
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    46
    public void onRoomInfo(String name, String flags, String newName,
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    47
                           int nUsers, int nTeams, String owner, String map,
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    48
                           String style, String scheme, String weapons);
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    49
    public void onRoomDel(String name);
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    50
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    51
    public void onRoomJoin(String[] users);
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    52
    public void onRoomLeave(String[] users);
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    53
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    54
    public void onPing();
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    55
    public void onPong();
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    56
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    57
    public void onUserFlagChange(String user, UserFlagType flag, boolean newValue);
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    58
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    59
    public void onUserInfo(String user, String ip, String version, String room);
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    60
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    61
    public void onBanListEntry(BanType type, String target, String duration, String reason);
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    62
    public void onBanListEnd();
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    63
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    64
    public void logDebug(String message);
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    65
    public void logError(String message);
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    66
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    67
    public void sanitizeInputs(final String[] inputs);
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    68
/*
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    69
    public void onEngineMessage(String message);
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    70
*/
823cf18be1fc Hedgewars lobby to IRC proxy
sheepluva
parents:
diff changeset
    71
}