mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-08 21:44:35 +02:00
Redid the initial handshake code to handle the found connection type field. Server should no longer create two player objects and code has been reduced. Removed instances of connection1/2 getters... server simply sends packets down zone connection. Fixed issue with world manager not zoning in player due to missing 0x2 packet.
This commit is contained in:
parent
093d3b7c15
commit
d90dc0cb80
7 changed files with 102 additions and 127 deletions
|
@ -19,68 +19,51 @@ namespace FFXIVClassic_Map_Server.dataobjects
|
|||
public uint eventCurrentOwner = 0;
|
||||
public string eventCurrentStarter = "";
|
||||
|
||||
ClientConnection conn1;
|
||||
ClientConnection conn2;
|
||||
private ClientConnection zoneConnection;
|
||||
private ClientConnection chatConnection;
|
||||
|
||||
bool isDisconnected;
|
||||
|
||||
public ConnectedPlayer(uint actorId)
|
||||
{
|
||||
this.actorID = actorId;
|
||||
playerActor = new Player(actorId);
|
||||
playerActor = new Player(this, actorId);
|
||||
actorInstanceList.Add(playerActor);
|
||||
}
|
||||
|
||||
public void addConnection(ClientConnection conn)
|
||||
public void setConnection(int type, ClientConnection conn)
|
||||
{
|
||||
if (conn1 == null && conn2 != null)
|
||||
conn1 = conn;
|
||||
else if (conn2 == null && conn1 != null)
|
||||
conn2 = conn;
|
||||
else
|
||||
conn1 = conn;
|
||||
switch (type)
|
||||
{
|
||||
case BasePacket.TYPE_ZONE:
|
||||
zoneConnection = conn;
|
||||
break;
|
||||
case BasePacket.TYPE_CHAT:
|
||||
chatConnection = conn;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool isClientConnectionsReady()
|
||||
{
|
||||
return (conn1 != null && conn2 != null);
|
||||
return (zoneConnection != null && chatConnection != null);
|
||||
}
|
||||
|
||||
public void disconnect()
|
||||
{
|
||||
isDisconnected = true;
|
||||
conn1.disconnect();
|
||||
conn2.disconnect();
|
||||
}
|
||||
|
||||
public void setConnection1(ClientConnection conn)
|
||||
{
|
||||
conn1 = conn;
|
||||
}
|
||||
|
||||
public void setConnection2(ClientConnection conn)
|
||||
{
|
||||
conn2 = conn;
|
||||
}
|
||||
|
||||
public ClientConnection getConnection1()
|
||||
{
|
||||
return conn1;
|
||||
}
|
||||
|
||||
public ClientConnection getConnection2()
|
||||
{
|
||||
return conn2;
|
||||
}
|
||||
zoneConnection.disconnect();
|
||||
chatConnection.disconnect();
|
||||
}
|
||||
|
||||
public void queuePacket(BasePacket basePacket)
|
||||
{
|
||||
conn1.queuePacket(basePacket);
|
||||
zoneConnection.queuePacket(basePacket);
|
||||
}
|
||||
|
||||
public void queuePacket(SubPacket subPacket, bool isAuthed, bool isEncrypted)
|
||||
{
|
||||
conn1.queuePacket(subPacket, isAuthed, isEncrypted);
|
||||
zoneConnection.queuePacket(subPacket, isAuthed, isEncrypted);
|
||||
}
|
||||
|
||||
public Player getActor()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue