2016-12-21 18:02:50 -05:00
|
|
|
|
using FFXIVClassic_World_Server.Packets.Send.Subpackets;
|
|
|
|
|
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};
|
|
|
|
|
|
2016-08-24 15:41:54 -04:00
|
|
|
|
public readonly uint sessionId;
|
2016-12-13 15:02:28 -05:00
|
|
|
|
|
|
|
|
|
public string characterName;
|
|
|
|
|
public uint currentZoneId;
|
|
|
|
|
|
2016-08-24 15:41:54 -04:00
|
|
|
|
public readonly ClientConnection clientConnection;
|
2016-08-22 10:43:04 -04:00
|
|
|
|
public readonly Channel type;
|
|
|
|
|
public ZoneServer routing1, routing2;
|
|
|
|
|
|
2016-08-28 14:25:37 -04:00
|
|
|
|
public Session(uint sessionId, ClientConnection connection, Channel type)
|
2016-08-22 10:43:04 -04:00
|
|
|
|
{
|
|
|
|
|
this.sessionId = sessionId;
|
2016-08-24 15:41:54 -04:00
|
|
|
|
this.clientConnection = connection;
|
2016-08-22 10:43:04 -04:00
|
|
|
|
this.type = type;
|
2016-08-24 15:41:54 -04:00
|
|
|
|
connection.owner = this;
|
2016-12-13 15:02:28 -05:00
|
|
|
|
Database.LoadZoneSessionInfo(this);
|
2016-08-22 10:43:04 -04:00
|
|
|
|
}
|
2016-12-21 18:02:50 -05:00
|
|
|
|
|
|
|
|
|
public void SendGameMessage( ushort textId, byte log, params object[] msgParams)
|
|
|
|
|
{
|
|
|
|
|
if (msgParams == null || msgParams.Length == 0)
|
|
|
|
|
clientConnection.QueuePacket(GameMessagePacket.BuildPacket(0x5FF80001, sessionId, 0x5FF80001, textId, log), true, false);
|
|
|
|
|
else
|
|
|
|
|
clientConnection.QueuePacket(GameMessagePacket.BuildPacket(0x5FF80001, sessionId, 0x5FF80001, textId, log, LuaUtils.CreateLuaParamList(msgParams)), true, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SendGameMessage( ushort textId, byte log, string customSender, params object[] msgParams)
|
|
|
|
|
{
|
|
|
|
|
if (msgParams == null || msgParams.Length == 0)
|
|
|
|
|
clientConnection.QueuePacket(GameMessagePacket.BuildPacket(0x5FF80001, sessionId, 0x5FF80001, textId, customSender, log), true, false);
|
|
|
|
|
else
|
|
|
|
|
clientConnection.QueuePacket(GameMessagePacket.BuildPacket(0x5FF80001, sessionId, 0x5FF80001, textId, customSender, log, LuaUtils.CreateLuaParamList(msgParams)), true, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SendGameMessage(ushort textId, byte log, uint displayId, params object[] msgParams)
|
|
|
|
|
{
|
|
|
|
|
if (msgParams == null || msgParams.Length == 0)
|
|
|
|
|
clientConnection.QueuePacket(GameMessagePacket.BuildPacket(0x5FF80001, sessionId, 0x5FF80001, textId, displayId, log), true, false);
|
|
|
|
|
else
|
|
|
|
|
clientConnection.QueuePacket(GameMessagePacket.BuildPacket(0x5FF80001, sessionId, 0x5FF80001, textId, displayId, log, LuaUtils.CreateLuaParamList(msgParams)), true, false);
|
|
|
|
|
}
|
|
|
|
|
|
2016-08-22 10:43:04 -04:00
|
|
|
|
}
|
|
|
|
|
}
|