README
------
+
This is a library containing some common utilities and classes betwen
server and client.
* ListMessage
* int FIELD_MAP_WIDTH
* int FIELD_MAP_HEIGHT
- * TODO: merge this with other init stuff like images
+ * String FIELD_MAP_ASSETLOCATION rcname
*/
public final static int MSG_INIT_MAP = 5;
/**
*/
public final static int MSG_REMOVE_ENTITY = 10;
/**
- * ByteMessage
+ * ByteEntityMessage
* Value is cardinal direction as byte (nsew)
*/
public final static int MSG_MOVE = 11;
/**
* Entity update fields
*/
+ /**
+ * IntMessage: flags
+ * bitfield 01: 1 = enemy, 2 = ally
+ * big 2: sleeping
+ */
public final static int FIELD_ENTITY_FLAGS = 0;
+ /**
+ * StringListMessage conditions
+ */
+ public final static int FIELD_ENTITY_CONDITIONS = 1;
+ public final static int ENTITY_FLAG_ALLY = 1;
+ public final static int ENTITY_FLAG_ENEMY = 2;
+ // not sure if this should show up in the condition list
+ public final static int ENTITY_FLAG_SLEEPING = 4;
/**
* Player update fields
* MSG_INFO_PLAYER
* MSG_INFO_PET
+ *
+ * FIXME: these fields should match the STAT_* constants
*/
/**
* IntegerMessage
*/
public class EntityUpdateMessage extends DuskMessage.EntityMessage {
+ // This need to be kept in sync with Thing
+ public static final int TYPE_PLAYER = 0;
+ public static final int TYPE_PET = 1;
+ public static final int TYPE_MOBILE = 2;
+ public static final int TYPE_SIGN = 3;
+ public static final int TYPE_PROP = 4;
+ public static final int TYPE_GAME_SHOP = 5;
+ public static final int TYPE_PLAYER_SHOP = 6;
+ public static final int TYPE_ITEM = 7;
+ public static final int TYPE_FOOD = 8;
+ public static final int TYPE_DRINK = 9;
+ public static final int TYPE_WEAPON = 10;
+ public static final int TYPE_ARMOUR = 11;
+ public static final int TYPE_CONTAINER = 12;
+
public String entityName;
public byte entityType;
public short x;
*
* @author notzed
*/
-public interface Wearing {
+public class Wearing {
/**
* Non-wearable item
* Gloves
*/
public static final int HANDS = 8;
+ //
public static final int WEARING_COUNT = 9;
- public static final String[] titles = {
+ public static final String[] wornTitles = {
"Wielded", "Arms", "Legs", "Torso", "Waist", "Neck", "Skull", "Eyes", "Hands"
};
/**
- * Field names as on the server
+ * Field wornNames as on the server
*/
- public static final String[] names = {
- "wielded", "arms", "legs", "torso", "waist", "neck", "skull", "eyes", "hands"
+ public static final String[] wornNames = {
+ "wield", "arms", "legs", "torso", "waist", "neck", "skull", "eyes", "hands"
};
+
+ public static int getCode(String name) {
+ switch (name) {
+ case "wield":
+ return WIELD;
+ case "arms":
+ return ARMS;
+ case "legs":
+ return LEGS;
+ case "torso":
+ return TORSO;
+ case "waist":
+ return WAIST;
+ case "neck":
+ return NECK;
+ case "skull":
+ return SKULL;
+ case "eyes":
+ return EYES;
+ case "hands":
+ return HANDS;
+ }
+ return INVENTORY;
+ }
}
/*
* This file is part of DuskZ, a graphical mud engine.
*
- * Copyright (C) 2000 Tom Weingarten <captaint@home.com>
* Copyright (C) 2013 Michael Zucchi <notzed@gmail.com>
*
* DuskZ is free software; you can redistribute it and/or