mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-09 05:54:50 +02:00
Changed folder from Proxy to World. Did some nlog configing.
This commit is contained in:
parent
364ab40b3f
commit
bd26a71fef
21 changed files with 32 additions and 24 deletions
|
@ -1,89 +0,0 @@
|
|||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_World_Server.DataObjects;
|
||||
using FFXIVClassic_World_Server.Packets.Receive;
|
||||
using FFXIVClassic_World_Server.Packets.Send;
|
||||
using FFXIVClassic_World_Server.Packets.Send.Login;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_World_Server
|
||||
{
|
||||
class PacketProcessor
|
||||
{
|
||||
/*
|
||||
Session Creation:
|
||||
|
||||
Get 0x1 from server
|
||||
Send 0x7
|
||||
Send 0x2
|
||||
|
||||
Zone Change:
|
||||
|
||||
Send 0x7
|
||||
Get 0x8 - Wait??
|
||||
Send 0x2
|
||||
*/
|
||||
|
||||
|
||||
Server mServer;
|
||||
|
||||
public PacketProcessor(Server server)
|
||||
{
|
||||
mServer = server;
|
||||
}
|
||||
|
||||
public void ProcessPacket(ClientConnection client, BasePacket packet)
|
||||
{
|
||||
if (packet.header.isCompressed == 0x01)
|
||||
BasePacket.DecompressPacket(ref packet);
|
||||
|
||||
List<SubPacket> subPackets = packet.GetSubpackets();
|
||||
foreach (SubPacket subpacket in subPackets)
|
||||
{
|
||||
//Initial Connect Packet, Create session
|
||||
if (subpacket.header.type == 0x01)
|
||||
{
|
||||
HelloPacket hello = new HelloPacket(packet.data);
|
||||
|
||||
if (packet.header.connectionType == BasePacket.TYPE_ZONE)
|
||||
mServer.AddSession(client, Session.Channel.ZONE, hello.sessionId);
|
||||
else if (packet.header.connectionType == BasePacket.TYPE_CHAT)
|
||||
mServer.AddSession(client, Session.Channel.CHAT, hello.sessionId);
|
||||
|
||||
client.QueuePacket(_0x7Packet.BuildPacket(0x0E016EE5), true, false);
|
||||
client.QueuePacket(_0x2Packet.BuildPacket(hello.sessionId), true, false);
|
||||
}
|
||||
//Ping from World Server
|
||||
else if (subpacket.header.type == 0x07)
|
||||
{
|
||||
SubPacket init = _0x8PingPacket.BuildPacket(client.owner.sessionId);
|
||||
client.QueuePacket(BasePacket.CreatePacket(init, true, false));
|
||||
}
|
||||
//Zoning Related
|
||||
else if (subpacket.header.type == 0x08)
|
||||
{
|
||||
//Response, client's current [actorID][time]
|
||||
//BasePacket init = Login0x7ResponsePacket.BuildPacket(BitConverter.ToUInt32(packet.data, 0x10), Utils.UnixTimeStampUTC(), 0x07);
|
||||
//client.QueuePacket(init);
|
||||
packet.DebugPrintPacket();
|
||||
}
|
||||
//Game Message
|
||||
else if (subpacket.header.type == 0x03)
|
||||
{
|
||||
//Send to the correct zone server
|
||||
uint targetSession = subpacket.header.targetId;
|
||||
|
||||
if (mServer.GetSession(targetSession).routing1 != null)
|
||||
mServer.GetSession(targetSession).routing1.SendPacket(subpacket);
|
||||
|
||||
if (mServer.GetSession(targetSession).routing2 != null)
|
||||
mServer.GetSession(targetSession).routing2.SendPacket(subpacket);
|
||||
}
|
||||
else
|
||||
packet.DebugPrintPacket();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue