1
Fork 0
mirror of https://bitbucket.org/Ioncannon/project-meteor-server.git synced 2025-04-23 05:07:47 +00:00
project-meteor-server/FFXIVClassic World Server/DataObjects/Session.cs

83 lines
3.2 KiB
C#
Raw Normal View History

using FFXIVClassic.Common;
using FFXIVClassic_World_Server.DataObjects.Group;
using FFXIVClassic_World_Server.Packets.Send.Subpackets;
using FFXIVClassic_World_Server.Packets.Send.Subpackets.Groups;
using System;
2016-08-22 10:43:04 -04:00
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_World_Server.DataObjects
{
class Session
{
public enum Channel {ZONE, CHAT};
public readonly uint sessionId;
2016-12-13 15:02:28 -05:00
public string characterName;
public uint currentZoneId;
public string activeLinkshellName = "";
2016-12-13 15:02:28 -05:00
public readonly ClientConnection clientConnection;
2016-08-22 10:43:04 -04:00
public readonly Channel type;
public ZoneServer routing1, routing2;
public Session(uint sessionId, ClientConnection connection, Channel type)
2016-08-22 10:43:04 -04:00
{
this.sessionId = sessionId;
this.clientConnection = connection;
2016-08-22 10:43:04 -04:00
this.type = type;
connection.owner = this;
Database.LoadZoneSessionInfo(this);
2017-01-08 21:42:43 -05:00
}
public void SendGameMessage(uint actorId, ushort textId, byte log, params object[] msgParams)
{
if (msgParams == null || msgParams.Length == 0)
{
2017-06-27 17:31:17 -04:00
clientConnection.QueuePacket(GameMessagePacket.BuildPacket(0x5FF80001, actorId, 0x5FF80001, textId, log));
2017-01-08 21:42:43 -05:00
}
else
2017-06-27 17:31:17 -04:00
clientConnection.QueuePacket(GameMessagePacket.BuildPacket(0x5FF80001, actorId, 0x5FF80001, textId, log, LuaUtils.CreateLuaParamList(msgParams)));
2016-08-22 10:43:04 -04:00
}
public void SendGameMessage( ushort textId, byte log, params object[] msgParams)
{
if (msgParams == null || msgParams.Length == 0)
2017-06-27 17:31:17 -04:00
clientConnection.QueuePacket(GameMessagePacket.BuildPacket(0x5FF80001, 0x5FF80001, textId, log));
else
2017-06-27 17:31:17 -04:00
clientConnection.QueuePacket(GameMessagePacket.BuildPacket(0x5FF80001, 0x5FF80001, textId, log, LuaUtils.CreateLuaParamList(msgParams)));
}
public void SendGameMessage( ushort textId, byte log, string customSender, params object[] msgParams)
{
if (msgParams == null || msgParams.Length == 0)
2017-06-27 17:31:17 -04:00
clientConnection.QueuePacket(GameMessagePacket.BuildPacket(0x5FF80001, 0x5FF80001, textId, customSender, log));
else
2017-06-27 17:31:17 -04:00
clientConnection.QueuePacket(GameMessagePacket.BuildPacket(0x5FF80001, 0x5FF80001, textId, customSender, log, LuaUtils.CreateLuaParamList(msgParams)));
}
public void SendGameMessage(ushort textId, byte log, uint displayId, params object[] msgParams)
{
if (msgParams == null || msgParams.Length == 0)
2017-06-27 17:31:17 -04:00
clientConnection.QueuePacket(GameMessagePacket.BuildPacket(0x5FF80001, 0x5FF80001, textId, displayId, log));
else
2017-06-27 17:31:17 -04:00
clientConnection.QueuePacket(GameMessagePacket.BuildPacket(0x5FF80001, 0x5FF80001, textId, displayId, log, LuaUtils.CreateLuaParamList(msgParams)));
}
public bool SetActiveLS(string name)
{
if (Database.SetActiveLS(this, name))
{
activeLinkshellName = name;
return true;
}
return false;
}
2016-08-22 10:43:04 -04:00
}
}