CMObject
, Tickable
, CMLibrary
, TextEncoders
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
public class CMEncoder extends StdLibrary implements TextEncoders
Modifier and Type | Field | Description |
---|---|---|
protected static byte[] |
encrFilter |
idConverter
isDebugging, name, serviceClient, tickStatus
STATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_BALLISTICK, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EVENT, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SHORTERMASK, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
Constructor | Description |
---|---|
CMEncoder() |
Modifier and Type | Method | Description |
---|---|---|
protected boolean |
checkHashStringPairs(java.lang.String hashString1,
java.lang.String hashString2) |
|
protected boolean |
checkPasswordAgainstRandomHashString(java.lang.String passwordString,
java.lang.String hashString) |
|
byte[] |
compressString(java.lang.String s) |
Compress a string into a binary data buffer.
|
java.lang.String |
decompressString(byte[] b) |
Decompress a string from a binary data buffer.
|
protected byte[] |
enDeCrypt(byte[] bytes) |
|
java.lang.String |
filterDecrypt(java.lang.String str) |
Decrypts a weakly encrypted string.
|
java.lang.String |
filterEncrypt(java.lang.String str) |
Weakly encrypts a string.
|
java.lang.String |
generateRandomPassword() |
Generates a random 10 char password string.
|
static byte[] |
getFilter() |
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
protected boolean |
isARandomHashString(java.lang.String password) |
|
java.lang.String |
makeFinalPasswordString(java.lang.String rawPassword) |
Checks whether hash passwords are used, and if so, hashes
the password and returns the encoded string, and otherwise,
just returns the raw password back.
|
protected java.lang.String |
makeRandomHashString(java.lang.String password) |
|
java.lang.String |
makeRepeatableHashString(java.lang.String str) |
Hashes the given string and returns an encoding of it.
|
boolean |
passwordCheck(java.lang.String pass1,
java.lang.String pass2) |
Compares two passwords to see if they are the same.
|
activate, getServiceClient, L, propertiesLoaded, shutdown
copyOf, initializeClass, name, newInstance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
activate, checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, propertiesLoaded, setThreadStatus, shutdown, tick
public java.lang.String ID()
CMObject
ID
in interface CMObject
ID
in class StdLibrary
public java.lang.String decompressString(byte[] b)
TextEncoders
decompressString
in interface TextEncoders
b
- the compressed data bufferTextEncoders.compressString(String)
public byte[] compressString(java.lang.String s)
TextEncoders
compressString
in interface TextEncoders
s
- the uncompressed stringTextEncoders.decompressString(byte[])
protected java.lang.String makeRandomHashString(java.lang.String password)
public java.lang.String makeFinalPasswordString(java.lang.String rawPassword)
TextEncoders
makeFinalPasswordString
in interface TextEncoders
rawPassword
- the raw password straight from the userpublic java.lang.String makeRepeatableHashString(java.lang.String str)
TextEncoders
makeRepeatableHashString
in interface TextEncoders
str
- the string to encodeprotected boolean isARandomHashString(java.lang.String password)
protected boolean checkPasswordAgainstRandomHashString(java.lang.String passwordString, java.lang.String hashString)
protected boolean checkHashStringPairs(java.lang.String hashString1, java.lang.String hashString2)
public java.lang.String generateRandomPassword()
TextEncoders
generateRandomPassword
in interface TextEncoders
public boolean passwordCheck(java.lang.String pass1, java.lang.String pass2)
TextEncoders
passwordCheck
in interface TextEncoders
pass1
- one of the passwordspass2
- the other passwordpublic static byte[] getFilter()
protected byte[] enDeCrypt(byte[] bytes)
public java.lang.String filterEncrypt(java.lang.String str)
TextEncoders
filterEncrypt
in interface TextEncoders
str
- the string to encryptTextEncoders.filterDecrypt(String)
public java.lang.String filterDecrypt(java.lang.String str)
TextEncoders
filterDecrypt
in interface TextEncoders
str
- the string to decryptTextEncoders.filterEncrypt(String)
,
TextEncoders.filterDecrypt(String)