I want never gets,I want updates.
stoopid.Spent 10 mins on finding out why the System numerics namespace was not working.
Then i noticed i forgot to re-add the reference how nooby of me
I think so. It's standing there. Advanced als possibleHard is a simple task. I'm still learning more C# i wanna make this advanced as possible it's a shame if it's a shit emulator and and a fucking epic cms eh?
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace RevEmu.Requirements.PacketHandling.ServerSideHandling
{
internal class ServerMessageHandling
{
private short _iMessageId;
private readonly List<byte> _context = new List<byte>();
public MemoryStream ChannelStream;
public ServerMessageHandling(int i)
{
this._iMessageId = (short) i;
ChannelStream = new MemoryStream(1024);
}
public void WriteByte(int b)
{
this.ChannelStream.WriteByte((byte) b);
}
private void WriteBytes(byte[] bytes, ReverseResult type)
{
if (type == ReverseResult.Reversed)
{
for (int i = (bytes.Length - 1); i > -1; i--)
{
this.ChannelStream.Write(new[] {bytes[i]}, 0, bytes.Length);
}
}
else
{
_context.AddRange(bytes);
}
}
public void WriteString(string str)
{
if (string.IsNullOrEmpty(str))
{
this.ChannelStream.WriteByte((byte) 0);
return;
}
this.WriteShort((short) str.Length);
this.WriteBytes(Encoding.ASCII.GetBytes(str), ReverseResult.Fresh);
}
public void WriteChar(char b)
{
BitConverter.GetBytes(b);
}
public void WriteInt(int i)
{
this.WriteBytes(BitConverter.GetBytes(i), ReverseResult.Reversed);
}
public void WriteShort(short i)
{
this.WriteBytes(BitConverter.GetBytes(i), ReverseResult.Reversed);
}
public short GetMessageId()
{
return _iMessageId;
}
public string GetBodyString()
{
return ChannelStream.ToString();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using RevEmu.Requirements.Habbo.RC4.R63B.Banner;
using RevEmu.Requirements.Habbo.RC4.R63B.Crypto;
using RevEmu.Requirements.PacketHandling.Interface;
using RevEmu.Requirements.PacketHandling.ServerSideHandling;
using RevEmu.Requirements.Session;
namespace RevEmu.Revisions.R63B.Packets.Login
{
class InitMessageEvent : IHabboPacketEvents
{
private static String ConvertToHex(byte[] data)
{
var buf = new StringBuilder(50);
for (var i = 0; i < data.Length; i++)
{
int halfbyte = (data[i] += 4) & 0x0F;
int twoHalfs = 0;
do
{
if ((0 <= halfbyte) && (halfbyte <= 9))
buf.Append((char) ('0' + halfbyte));
else
buf.Append((char) ('a' + (halfbyte - 10)));
halfbyte = data[i] & 0x0F;
} while (twoHalfs++ < 1);
}
return buf.ToString();
}
public void Handle(Session session, ServerMessageHandling serverMessage)
{
try
{
var crypto = new Crypto();
var bannerGenerator = new BannerGenerator();
bannerGenerator.Timestamp = (int) (RevEnvironment.CurrentTimeMillis() + 3);
var timeString = int.Parse(bannerGenerator.Timestamp.ToString()).ToString();
var md5 = new MD5CryptoServiceProvider();
md5.ComputeHash(Encoding.ASCII.GetBytes(timeString), 0, timeString.Length);
}
catch (Exception)
{
throw;
}
}
}
}
public SqlDataReader WriteQuery(string sQuery)
{
// Open Connection and Set Query
var command = new SqlCommand(sQuery,
new SqlConnection(
RevEmu.Requirements.MySql.MySqlClientManagement.ConnectionString));
// Read the query
var reader = command.ExecuteReader();
// Return the reader, while reading the query.
return reader;
}
PageSerialize(set.GetInt32(Convert.ToInt32("id")), set.GetInt32(Convert.ToInt32("icon_image")), set.GetInt32(Convert.ToInt32("icon_color")),
set.GetString(Convert.ToInt32("name")), Convert.ToInt32(set.GetString(Convert.ToInt32("categoryid"))), set.GetString(Convert.ToInt32("page_extra")),
set.GetString(Convert.ToInt32("page_headline")), set.GetString(Convert.ToInt32("page_teaser")), set.GetString(Convert.ToInt32("page_text")),
set.GetString(Convert.ToInt32("page_othertext")), set.GetString(Convert.ToInt32("page_text_details")),
set.GetString(Convert.ToInt32("page_text_teaser")));
public MySqlDataReader DataReader(string sQuery)
{
try
{
// Start the reader for the query.
return MySqlHelper.ExecuteReader(MySqlClientManagement.ConnectionString, sQuery, Parameters.ToArray());
}
catch(MySqlException exception)
{
Console.WriteLine(@"Error with DataReader " + exception.ToString());
}
return null;
}