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