public Sm(Int32 header)
{
_header = header;
header = RCrypto.DecodeBit8(SClientMessage.OString.Substring(4, 6));
_contentBuilder = new StringBuilder();
AppendInt(header);
}
public class RCrypto
{
#region RCrypto Required Fields
private static string _data;
private static int _header;
private static int _lenght;
private static string[] _extraDatas;
private static int _e1 = 0;
private static int _e2 = 0;
#endregion
#region Encode Int32,Int16
public static void cypherInt(int v)
{
HabboEncoding.HabboEncoding.cypherInt(v);
}
public static void cypherShort(int v)
{
HabboEncoding.HabboEncoding.cypherShort(v);
}
#endregion
#region Decode Int32,Int16
public static void decypherInt(string v)
{
HabboEncoding.HabboEncoding.decypherInt(v);
}
public static void decypherShort(string v)
{
HabboEncoding.HabboEncoding.decypherShort(v);
}
#endregion
#region Encode Bit8,Bit32
public static string EncodeBit32(string v)
{
return EncodeBit32(v.Length);
}
public static string EncodeBit32(int v) // int
{
string t = "";
t += (char) 0; // 4 bytes
t += (char) ((v >> 24) & 0xFF); // 3 bytes
t += (char) ((v >> 16) & 0xFF); // 2 bytes
t += (char) ((v >> 8) & 0xFF); // 1 byte
t += (char) ((v) & 0xFF);
return t;
}
#endregion
#region Decode Bit8,Bit32
public static int DecodeBit24(string v)
{
if ((v[0] | v[1] | v[2] | v[3]) < 0)
return -1;
return ((v[0] << 24) + (v[1] << 16) + (v[2] << 8) + (v[3] << 0));
}
public static int DecodeBit8(string v)
{
if ((v[0] | v[1]) < 0)
return -1;
return ((v[0] << 8) + (v[1] << 0));
}
#endregion
#region Encoding Etc
public static void Init(string publicKey, string privateKey)
{
HabboEncoding.HabboEncoding.init(publicKey, privateKey);
}
#endregion
#region Crypto Utilities
public static void PrepareCryptoSystem()
{
HabboEncoding.CryptoUtils.PrepareCryptoSystem();
}
#endregion
#region LJ282 Setup Crypto
public static void SetUpCrypto(string cryptoHash)
{
HabboEncoding.LJ382.SetupCyrpto(cryptoHash);
}
#endregion
#region LJ282 Encode String
public static void EncodeString(string str)
{
HabboEncoding.LJ382.EncodeString(str);
}
#endregion
#region LJ282 Decode String
public static void DecodeString(string str)
{
HabboEncoding.LJ382.DecodeString(str);
}
#endregion
#region CryptoSystem Functions
public static bool IsValidString(string inputStr)
{
if (string.IsNullOrEmpty(inputStr))
{
return false;
}
for (int i = 0; i < inputStr.Length; i++)
{
string s = inputStr[i].ToString();
if (s == "." || s == "," || s == ";" || s == ":" || s == "<" || s == ">" || s == "@" || s == @"\" || s == "/")
{
return true;
}
else if (!(IsLetter(s)))
{
return false;
}
}
return true;
}
public static bool IsValidInt(string inputStr)
{
if (string.IsNullOrEmpty(inputStr))
{
return false;
}
for (int i = 0; i < inputStr.Length; i++)
{
string s = inputStr[i].ToString();
if (!(char.IsNumber(inputStr[i])))
{
return false;
}
}
return true;
}
public static bool IsValidName(string inputStr)
{
if (string.IsNullOrEmpty(inputStr))
{
return false;
}
for (int i = 0; i < inputStr.Length; i++)
{
string s = inputStr[i].ToString();
if (s == "." || s == "," || s == ";" || s == ":" || s == "<" || s == ">" || s == "@" || s == @"\" || s == "/" || s == "#")
{
return true;
}
else if (!(IsLetter(s)) && !(char.IsNumber(inputStr[i])))
{
return false;
}
}
return true;
}
public static bool IsLetter(string s)
{
s = s.ToLower();
if (s == "a" || s == "b" || s == "c" || s == "d" || s == "e" || s == "f" || s == "g"
|| s == "h" || s == "i" || s == "j" || s == "k" || s == "l" || s == "m" || s == "n" || s == "ñ"
|| s == "o" || s == "p" || s == "q" || s == "r" || s == "s" || s == "t" || s == "u" || s == "v"
|| s == "w" || s == "x" || s == "y" || s == "z" || s == "¡" || s == "!" || s == "¿" || s == "?" || s == "á"
|| s == "é" || s == "í" || s == "ó" || s == "ú" || s == "|" || s == "#" || s == "-" || s == "_" ||
s == "[" || s == " " || s == "]")
return true;
else
return false;
}
#endregion
#region Habbo new Crypto: 'char Encode' by Itachi
public RCrypto(string internalData)
{
_data = internalData;
string conn = _data.ToString();
conn = conn.Replace("{char0}", Convert.ToChar(0).ToString());
conn = conn.Replace("{char1}", Convert.ToChar(1).ToString());
conn = conn.Replace("{char2}", Convert.ToChar(2).ToString());
conn = conn.Replace("{char13}", Convert.ToChar(13).ToString());
string final = conn.Select(C => "{char" + (int) C + "}").Aggregate("", (current, zC) => current + zC);
final = final.Replace("{char", "");
final = final.Substring(0, final.Length - 1);
final = final.Replace("}", ";");
string[] toSepare = final.Split(';');
int sLenght = DecodeBit8(internalData.Substring(2, 2));
int sHeader = DecodeBit8(internalData.Substring(4, 2));
string extra = "";
for (int i = 6; i != toSepare.Length; i++)
{
string s = Convert.ToChar(int.Parse(toSepare[i])).ToString();
string fs = "";
if (toSepare.Length > i + 1)
fs = Convert.ToChar(int.Parse(toSepare[i + 1])).ToString();
if (IsValidName(s))
{
extra += Convert.ToChar(int.Parse(toSepare[i]));
if (!IsValidName(fs))
extra += ";";
}
else
extra += toSepare[i] + ";";
}
_header = sHeader;
_lenght = sLenght;
_extraDatas = extra.Split(';');
}
internal static int CharEncodeGetHeader()
{
return _header;
}
internal static int CharEncodeGetLenght()
{
return _lenght;
}
internal static string CharEncodeGetNextString()
{
while (true)
{
if (_extraDatas.Length < _e1)
return null;
if (IsValidString(_extraDatas[_e1]))
return _extraDatas[_e1];
else
_e1++;
}
}
internal static int CharEncodeGetNextInt()
{
while (true)
{
if (_extraDatas.Length < _e1)
return -1;
if (IsValidInt(_extraDatas[_e1]))
return int.Parse(_extraDatas[_e1]);
else
_e1++;
}
}
#endregion
}
class Cm
{
public String OString;
public String OData;
public Cm(string data)
{
OData = data.Substring(4);
}
public int Header()
{
var header = RCrypto.DecodeBit8(OData.Substring(0, 2));
OData = OData.Substring(2);
return header;
}
public bool CanGetNextString()
{
try
{
int len = RCrypto.DecodeBit8(OData.Substring(0, 2));
if (len > 0)
{
var result = OData.Substring(0, len);
if (result != "")
return true;
else
return false;
}
else
return false;
}
catch
{
return false;
}
}
public int NewNextInt()
{
int result = RCrypto.DecodeBit24(OData.Substring(1, 4));
return result;
}
public int GetNextInt()
{
int result = RCrypto.DecodeBit24(OData.Substring(0, 4));
OData = OData.Substring(4);
return result;
}
public String GetNextString()
{
int len = RCrypto.DecodeBit8(OData.Substring(0, 2));
OData = OData.Substring(2);
String result = OData.Substring(0, len);
OData = OData.Substring(len);
return result;
}
}
public CatalogueItems()
{
//List
_cacheColumns = new List<CatalogueItems>();
//Get Columns
foreach (DataRow catalogItems in GetTable.Invoke("").Rows)
{
_cacheColumns.Add((int)catalogItems["id"], (int)catalogItems["page_id"], (string)catalogItems["item_ids"],(string)catalogItems["catalog_name"], (int)catalogItems["cost_credits"], (int) catalogItems["cost_pixels"], (int) catalogItems["cost_snow"] , (int) catalogItems["amount"]);
}
}
public CatalogueItems(int cId, int cPageId, string cItemIds, string cCatalogName, int cCostCredits, int cCostPixels, int cCostSnow, int cAmount)
{
Id = cId;
PageId = cPageId;
ItemIds = cItemIds;
CatalogName = cCatalogName;
CostCredits = cCostCredits;
CostPixels = cCostPixels;
CostSnow = cCostSnow;
Amount = cAmount;
}
You'd have to close the Emulator, so you can save it at one specific point.Backup system sounds great but will this lag it at all? I know backups can cause ingame lag. If it will then maybe have it send a hotel alert saying backup is happening or something.
Looks amazing Also the green ticks at the start mean that its completed or will be added? I've only skimmed this thread so sorry if you have already answered.
Backup system sounds great but will this lag it at all? I know backups can cause ingame lag. If it will then maybe have it send a hotel alert saying backup is happening or something.
Looks amazing Also the green ticks at the start mean that its completed or will be added? I've only skimmed this thread so sorry if you have already answered.
No idea.Isn't Manuel working on a cron job for backing up the database in the cms?
Anyway, good luck Zak!
Don't worry you don't need to close the emulator, it just dumps it via file stream.You'd have to close the Emulator, so you can save it at one specific point.
foreach (DataRow catalogItems in GetTable.Invoke("").Rows)
{
// Instead of using the Convert class from system, i decided to use explict casts for quick and clean conversions.
// Example of running this would be to do the follow code: var catalogueItemCoulmns = new CataLogueItems(); Then do catalogueItemsColumns.[Column] This selects it directly from the Sql database.
var id = (int) catalogItems["id"];
var pageId = (int) catalogItems["page_id"];
var itemIds = (string) catalogItems["item_ids"];
var catalogName = (string) catalogItems["catalog_name"];
var costCredits = (int) catalogItems["cost_credits"];
var costPixels = (int) catalogItems["cost_pixels"];
var costSnow = (int) catalogItems["cost_snow"];
var amount = (int) catalogItems["amount"];
}
foreach (var amount in from DataRow catalogItems in GetTable.Invoke("").Rows let id = (int) catalogItems["id"] let pageId = (int) catalogItems["page_id"] let itemIds = (string) catalogItems["item_ids"] let catalogName = (string) catalogItems["catalog_name"] let costCredits = (int) catalogItems["cost_credits"] let costPixels = (int) catalogItems["cost_pixels"] let costSnow = (int) catalogItems["cost_snow"] select (int) catalogItems["amount"])
{
// Set Data Here
}
Been quite a while since the development started. Any idea of when the development is going to function? even a slight?
I am making this best as possible rushed projects won't get no where.
I need to code this as effiecntly as possible we don't want it to collapse when you just enter the sso?
The thing that's just taking time is the doing all the columns.
So i decided just to do the phoenix columns for the sso and work on the Database system, so i'll just change the querys.
Why am i doing this?
People are asking for in-game pics.
Also THIS PROJECT IS NOT DUMPED.
i have not been updating as i have been studying and re doing the Linq expressions through out the whole source.
And yes it does function in various of ways.
For starters it's Socket Reciving and handling, Base and Engline of the sockets are functioning well, also Config Parser, HandShake, PacketSession [Best going so far].