本文整理汇总了C#中Mango.Communication.Sessions.Session类的典型用法代码示例。如果您正苦于以下问题:C# Session类的具体用法?C# Session怎么用?C# Session使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Session类属于Mango.Communication.Sessions命名空间,在下文中一共展示了Session类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParsePacket
public void ParsePacket(Session session, Message message)
{
/*
* ItemCount Int32
* UserId Int32
* Score Int32
* Position Int32
* Username String
* Figure String
* Gender String
* Int32(1)
* Int32(1)
*/
//TODO: USE DISTRIBUTOR TO JUST GET USER FROM CACHE.
int userid = message.NextInt32();
HabboController user = new HabboController(userid);
var response = new Message(2048);
response.WriteInt32(1); // User Count
response.WriteInt32(userid);
response.WriteInt32(0); // TODO: Make column for SCORE
response.WriteInt32(1); // TODO: Make a void that filters the scores and sets the rank.
response.WriteString(user.username);
response.WriteString(user.figure);
response.WriteString(user.gender);
response.WriteInt32(1);
response.WriteInt32(1);
session.SendPacket(response);
}
示例2: Purchase
/// <summary>
/// Handels the purchase for an object from the catalog.
/// </summary>
public void Purchase(Session session, Message message)
{
// Get pageId from Client.
int pageId = message.NextInt32();
// Get itemId from Client.
int itemId = message.NextInt32();
// Create a instance of CatalogItemController using the purchased item Id.
CatalogItemController purchasedItem = new CatalogItemController(itemId);
// Simple check.
if (purchasedItem.pageId != pageId) // If Page id do not match
return;
// Remove credits based on Item cost.
session.Habbo.credits -= purchasedItem.credits;
message = new Message(11); // Change to CreditUpdate id.
// Updates users credits.
message.WriteString("" + session.Habbo.credits + ".0");
session.SendPacket(message);
session.Habbo.SaveOrUpdate(session.Habbo);
}
示例3: ParsePacket
public void ParsePacket(Session session, Message message)
{
var response = new Message(544);
response.WriteString("Team Rev|");
response.WriteString("");
session.SendPacket(response);
}
示例4: ParsePacket
/// <summary>
/// Handles Packet, for current user, and message event.
/// </summary>
/// <param name="gameclient">User of Packet</param>
/// <param name="Message">Message for User</param>
public void ParsePacket(Session session, Message message)
{
var Response = new Message(2121);
session.SendPacket(Response);
Response = new Message(294);
Response.WriteString("model_f"); // Room Model
Response.WriteInt32(1); // id ?
session.SendPacket(Response);
Response = new Message(3248);
Response.WriteString("floor");
Response.WriteInt32(0);
session.SendPacket(Response);
Response = new Message(3248);
Response.WriteString("landscape");
Response.WriteString("0.0");
session.SendPacket(Response);
Response = new Message(3323);
Response.WriteInt32(4);
session.SendPacket(Response);
Response = new Message(3840);
session.SendPacket(Response);
Response = new Message(1794);
Response.WriteInt32(0);
session.SendPacket(Response);
Response = new Message(369);
Response.WriteInt32(142641);
session.SendPacket(Response);
}
示例5: ParsePacket
public void ParsePacket(Session session, Message message)
{
var Response = new Message(2888);
Response.WriteInt32(3);
session.SendPacket(Response);
Response = new Message(1401);
Response.WriteInt32(3);
Response.WriteString("1344031458870");
Response.WriteString("http://habbo.hs.llnwd.net/basejump/693/BaseJump.swf");
Response.WriteString("best");
Response.WriteString("showAll");
Response.WriteInt32(60);
Response.WriteInt32(10);
Response.WriteInt32(0);
Response.WriteInt32(4);
Response.WriteString("accessToken");
Response.WriteString(session.Habbo.username + "-" + session.Habbo.figure);
Response.WriteString("gameServerHost");
Response.WriteString("ff-am.habbo.com");
Response.WriteString("gameServerPort");
Response.WriteString("30000");
Response.WriteString("socketPolicyPort");
Response.WriteString("30843");
session.SendPacket(Response);
}
示例6: ParsePacket
public void ParsePacket(Session session, Message message)
{
string releaseBuild = message.NextString();
Application.Application.Logging.WriteLine(string.Format("Client release: {0}", releaseBuild), Logging.Status.Debug);
Console.Title += string.Format(" | Invoked on Revision: {0}, Loading Packets...", releaseBuild);
session.ReleaseBuild = releaseBuild;
}
示例7: ParsePacket
/// <summary>
/// Handles Packet, for current user, and message event.
/// </summary>
/// <param name="Session">User of Packet</param>
/// <param name="Message">Message for User</param>
public void ParsePacket(Session session, Message message)
{
var Response = new Message(3298);
Response.WriteInt32(session.Habbo.id);
Response.WriteString(message.NextString());
Response.WriteInt32(0);
Response.WriteInt32(0);
Response.WriteInt32(-1);
session.SendPacket(Response);
}
示例8: ParsePacket
public void ParsePacket(Session session, Message message)
{
string sso = message.NextString();
//Application.Logging.WriteLine(string.Format("SSO Ticket: {0}", sso));
var loadMyHabbo = new HabboDistributor().GetHabbo(sso);
session.Habbo = loadMyHabbo;
var response = new Message(SendHeaders.InitHotelView);
session.SendPacket(response);
}
示例9: ParsePacket
public void ParsePacket(Session session, Message message)
{
int id = message.NextInt32();
var flashbase = message.NextString();
var variables = message.NextString();
//Console.WriteLine("Flashbase {0}, Variables {1} loaded.", flashbase, variables);
/*Application.Application.Logging.WriteLine(string.Format("ID {0}", id));
Application.Application.Logging.WriteLine(string.Format("Flashbase {0}", flashbase));
Application.Application.Logging.WriteLine(string.Format("Variables {0}", variables));*/
}
示例10: ParsePacket
public void ParsePacket(Session session, Message message)
{
int FriendId = message.NextInt32();
string theMessage = message.NextString();
Console.WriteLine(FriendId);
var Response = new Message(2582);
Response.WriteInt32(FriendId);
Response.WriteString(theMessage);
Response.WriteString(string.Empty);
session.SendPacket(Response);
}
示例11: ParsePacket
public void ParsePacket(Session session, Message Message)
{
var Response = new Message(SendHeaders.InitClubStatus);
Response.WriteString(Message.NextString());
Response.WriteInt32(10);
Response.WriteInt32(0);
Response.WriteInt32(0);
Response.WriteInt32(0);
Response.WriteInt32(1);
Response.WriteBool(false);
Response.WriteBool(true);
Response.WriteInt32(0);
Response.WriteInt32(0);
Response.WriteInt32(0);
session.SendPacket(Response);
}
示例12: ParsePacket
public void ParsePacket(Session session, Message message)
{
/*
* [LOG][CLIENT] > 2574: [0][0][0]D[10][0][0][0][1][0][0]^^[0]8b12104s05013s05014s05015b629b628442e26e378b9f8f18818bbaa
* [LOG][CLIENT] > 3163: [0][0][0][6][12][[0][0][0][0]
*/
var Response = new Message(2574);
Response.WriteInt32(1);
Response.WriteInt32(24158);
Response.WriteString("b12104s05013s05014s05015b629b628442e26e378b9f8f18818bbaa");
session.SendPacket(Response);
Response = new Message(3163);
Response.WriteInt32(0);
session.SendPacket(Response);
}
示例13: ParsePacket
public void ParsePacket(Session session, Message message)
{
var Uinfo = new Message(3744);
Uinfo.WriteInt32(session.Habbo.id); // id perhaps
Uinfo.WriteString(session.Habbo.username); // names
Uinfo.WriteInt32(4); // registered minutes ago
Uinfo.WriteInt32(8); // last login minutes ago
Uinfo.WriteBool(true); // is online, NO doubt
Uinfo.WriteInt32(1); // cfhs
Uinfo.WriteInt32(2); // abusive cfhs
Uinfo.WriteInt32(3); // cautions
Uinfo.WriteInt32(4); // bans
Uinfo.WriteString("3"); // purchase shit?
Uinfo.WriteInt32(3); // no idea yet
Uinfo.WriteInt32(5); // amount banned accounts lol
Uinfo.WriteString("666"); // some shit above banned accounts
session.SendPacket(Uinfo);
}
示例14: ParsePacket
public void ParsePacket(Session session, Message message)
{
message = new Message(619);
message.WriteInt32(0);
message.WriteInt32(1);
int id = message.NextInt32(); // UserId?
Console.WriteLine(id);
//var result = new HabboSqlData(id);
// message.WriteString(result.username);
message.WriteBool(false);
//message.WriteString(result.motto);
message.WriteInt32(0);
message.WriteInt32(1);
message.WriteInt32(0);
}
示例15: Execute
public static void Execute(Session session, Message message)
{
if (!Messages.ContainsKey((uint) message.HeaderId))
{
Application.Logging.WriteLine(string.Format("Not found: {0}", message.HeaderId), Logging.Status.Warning);
return;
}
var handler = Messages[(uint)message.HeaderId] as IPacketEvent;
if (handler != null)
{
Application.Logging.WriteLine(string.Format("Invoked: {0} -> {1}", handler.EventId, GetName(handler.EventId),
Logging.Status.Invoker));
DelHandle delHandle = handler.ParsePacket;
delHandle.Invoke(session, message);
}
}