mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-08 05:24:34 +02:00
mass replaced all methods to pascal case
This commit is contained in:
parent
ed0a0a58f7
commit
24f55139dd
179 changed files with 1585 additions and 1585 deletions
|
@ -38,7 +38,7 @@ namespace FFXIVClassic_Map_Server
|
|||
private Thread mConnectionHealthThread;
|
||||
private bool killHealthThread = false;
|
||||
|
||||
private void connectionHealth()
|
||||
private void ConnectionHealth()
|
||||
{
|
||||
Program.Log.Info("Connection Health thread started; it will run every {0} seconds.", HEALTH_THREAD_SLEEP_TIME);
|
||||
while (!killHealthThread)
|
||||
|
@ -48,12 +48,12 @@ namespace FFXIVClassic_Map_Server
|
|||
List<ConnectedPlayer> dcedPlayers = new List<ConnectedPlayer>();
|
||||
foreach (ConnectedPlayer cp in mConnectedPlayerList.Values)
|
||||
{
|
||||
if (cp.checkIfDCing())
|
||||
if (cp.CheckIfDCing())
|
||||
dcedPlayers.Add(cp);
|
||||
}
|
||||
|
||||
foreach (ConnectedPlayer cp in dcedPlayers)
|
||||
cp.getActor().cleanupAndSave();
|
||||
cp.GetActor().CleanupAndSave();
|
||||
}
|
||||
Thread.Sleep(HEALTH_THREAD_SLEEP_TIME * 1000);
|
||||
}
|
||||
|
@ -64,20 +64,20 @@ namespace FFXIVClassic_Map_Server
|
|||
mSelf = this;
|
||||
}
|
||||
|
||||
public static Server getServer()
|
||||
public static Server GetServer()
|
||||
{
|
||||
return mSelf;
|
||||
}
|
||||
|
||||
public bool startServer()
|
||||
public bool StartServer()
|
||||
{
|
||||
mConnectionHealthThread = new Thread(new ThreadStart(connectionHealth));
|
||||
mConnectionHealthThread = new Thread(new ThreadStart(ConnectionHealth));
|
||||
mConnectionHealthThread.Name = "MapThread:Health";
|
||||
//mConnectionHealthThread.Start();
|
||||
|
||||
mStaticActors = new StaticActors(STATIC_ACTORS_PATH);
|
||||
|
||||
gamedataItems = Database.getItemGamedata();
|
||||
gamedataItems = Database.GetItemGamedata();
|
||||
Program.Log.Info("Loaded {0} items.", gamedataItems.Count);
|
||||
|
||||
mWorldManager = new WorldManager(this);
|
||||
|
@ -93,7 +93,7 @@ namespace FFXIVClassic_Map_Server
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new ApplicationException("Could not create socket, check to make sure not duplicating port", e);
|
||||
throw new ApplicationException("Could not Create socket, check to make sure not duplicating port", e);
|
||||
}
|
||||
try
|
||||
{
|
||||
|
@ -106,7 +106,7 @@ namespace FFXIVClassic_Map_Server
|
|||
}
|
||||
try
|
||||
{
|
||||
mServerSocket.BeginAccept(new AsyncCallback(acceptCallback), mServerSocket);
|
||||
mServerSocket.BeginAccept(new AsyncCallback(AcceptCallback), mServerSocket);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@ -124,7 +124,7 @@ namespace FFXIVClassic_Map_Server
|
|||
return true;
|
||||
}
|
||||
|
||||
public void removePlayer(Player player)
|
||||
public void RemovePlayer(Player player)
|
||||
{
|
||||
lock (mConnectedPlayerList)
|
||||
{
|
||||
|
@ -134,7 +134,7 @@ namespace FFXIVClassic_Map_Server
|
|||
}
|
||||
|
||||
#region Socket Handling
|
||||
private void acceptCallback(IAsyncResult result)
|
||||
private void AcceptCallback(IAsyncResult result)
|
||||
{
|
||||
ClientConnection conn = null;
|
||||
Socket socket = (System.Net.Sockets.Socket)result.AsyncState;
|
||||
|
@ -153,9 +153,9 @@ namespace FFXIVClassic_Map_Server
|
|||
|
||||
Program.Log.Info("Connection {0}:{1} has connected.", (conn.socket.RemoteEndPoint as IPEndPoint).Address, (conn.socket.RemoteEndPoint as IPEndPoint).Port);
|
||||
//Queue recieving of data from the connection
|
||||
conn.socket.BeginReceive(conn.buffer, 0, conn.buffer.Length, SocketFlags.None, new AsyncCallback(receiveCallback), conn);
|
||||
conn.socket.BeginReceive(conn.buffer, 0, conn.buffer.Length, SocketFlags.None, new AsyncCallback(ReceiveCallback), conn);
|
||||
//Queue the accept of the next incomming connection
|
||||
mServerSocket.BeginAccept(new AsyncCallback(acceptCallback), mServerSocket);
|
||||
mServerSocket.BeginAccept(new AsyncCallback(AcceptCallback), mServerSocket);
|
||||
}
|
||||
catch (SocketException)
|
||||
{
|
||||
|
@ -167,7 +167,7 @@ namespace FFXIVClassic_Map_Server
|
|||
mConnectionList.Remove(conn);
|
||||
}
|
||||
}
|
||||
mServerSocket.BeginAccept(new AsyncCallback(acceptCallback), mServerSocket);
|
||||
mServerSocket.BeginAccept(new AsyncCallback(AcceptCallback), mServerSocket);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
@ -178,21 +178,21 @@ namespace FFXIVClassic_Map_Server
|
|||
mConnectionList.Remove(conn);
|
||||
}
|
||||
}
|
||||
mServerSocket.BeginAccept(new AsyncCallback(acceptCallback), mServerSocket);
|
||||
mServerSocket.BeginAccept(new AsyncCallback(AcceptCallback), mServerSocket);
|
||||
}
|
||||
}
|
||||
|
||||
public static Actor getStaticActors(uint id)
|
||||
public static Actor GetStaticActors(uint id)
|
||||
{
|
||||
return mStaticActors.getActor(id);
|
||||
return mStaticActors.GetActor(id);
|
||||
}
|
||||
|
||||
public static Actor getStaticActors(string name)
|
||||
public static Actor GetStaticActors(string name)
|
||||
{
|
||||
return mStaticActors.findStaticActor(name);
|
||||
return mStaticActors.FindStaticActor(name);
|
||||
}
|
||||
|
||||
public static Item getItemGamedata(uint id)
|
||||
public static Item GetItemGamedata(uint id)
|
||||
{
|
||||
if (gamedataItems.ContainsKey(id))
|
||||
return gamedataItems[id];
|
||||
|
@ -204,7 +204,7 @@ namespace FFXIVClassic_Map_Server
|
|||
/// Receive Callback. Reads in incoming data, converting them to base packets. Base packets are sent to be parsed. If not enough data at the end to build a basepacket, move to the beginning and prepend.
|
||||
/// </summary>
|
||||
/// <param name="result"></param>
|
||||
private void receiveCallback(IAsyncResult result)
|
||||
private void ReceiveCallback(IAsyncResult result)
|
||||
{
|
||||
ClientConnection conn = (ClientConnection)result.AsyncState;
|
||||
|
||||
|
@ -218,7 +218,7 @@ namespace FFXIVClassic_Map_Server
|
|||
mConnectionList.Remove(conn);
|
||||
}
|
||||
if (conn.connType == BasePacket.TYPE_ZONE)
|
||||
Program.Log.Info("{0} has disconnected.", conn.owner == 0 ? conn.getAddress() : "User " + conn.owner);
|
||||
Program.Log.Info("{0} has disconnected.", conn.owner == 0 ? conn.GetAddress() : "User " + conn.owner);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -235,13 +235,13 @@ namespace FFXIVClassic_Map_Server
|
|||
//Build packets until can no longer or out of data
|
||||
while (true)
|
||||
{
|
||||
BasePacket basePacket = buildPacket(ref offset, conn.buffer, bytesRead);
|
||||
BasePacket basePacket = BuildPacket(ref offset, conn.buffer, bytesRead);
|
||||
|
||||
//If can't build packet, break, else process another
|
||||
if (basePacket == null)
|
||||
break;
|
||||
else
|
||||
mProcessor.processPacket(conn, basePacket);
|
||||
mProcessor.ProcessPacket(conn, basePacket);
|
||||
}
|
||||
|
||||
//Not all bytes consumed, transfer leftover to beginning
|
||||
|
@ -251,18 +251,18 @@ namespace FFXIVClassic_Map_Server
|
|||
conn.lastPartialSize = bytesRead - offset;
|
||||
|
||||
//Build any queued subpackets into basepackets and send
|
||||
conn.flushQueuedSendPackets();
|
||||
conn.FlushQueuedSendPackets();
|
||||
|
||||
if (offset < bytesRead)
|
||||
//Need offset since not all bytes consumed
|
||||
conn.socket.BeginReceive(conn.buffer, bytesRead - offset, conn.buffer.Length - (bytesRead - offset), SocketFlags.None, new AsyncCallback(receiveCallback), conn);
|
||||
conn.socket.BeginReceive(conn.buffer, bytesRead - offset, conn.buffer.Length - (bytesRead - offset), SocketFlags.None, new AsyncCallback(ReceiveCallback), conn);
|
||||
else
|
||||
//All bytes consumed, full buffer available
|
||||
conn.socket.BeginReceive(conn.buffer, 0, conn.buffer.Length, SocketFlags.None, new AsyncCallback(receiveCallback), conn);
|
||||
conn.socket.BeginReceive(conn.buffer, 0, conn.buffer.Length, SocketFlags.None, new AsyncCallback(ReceiveCallback), conn);
|
||||
}
|
||||
else
|
||||
{
|
||||
Program.Log.Info("{0} has disconnected.", conn.owner == 0 ? conn.getAddress() : "User " + conn.owner);
|
||||
Program.Log.Info("{0} has disconnected.", conn.owner == 0 ? conn.GetAddress() : "User " + conn.owner);
|
||||
|
||||
lock (mConnectionList)
|
||||
{
|
||||
|
@ -274,7 +274,7 @@ namespace FFXIVClassic_Map_Server
|
|||
{
|
||||
if (conn.socket != null)
|
||||
{
|
||||
Program.Log.Info("{0} has disconnected.", conn.owner == 0 ? conn.getAddress() : "User " + conn.owner);
|
||||
Program.Log.Info("{0} has disconnected.", conn.owner == 0 ? conn.GetAddress() : "User " + conn.owner);
|
||||
|
||||
lock (mConnectionList)
|
||||
{
|
||||
|
@ -290,7 +290,7 @@ namespace FFXIVClassic_Map_Server
|
|||
/// <param name="offset">Current offset in buffer.</param>
|
||||
/// <param name="buffer">Incoming buffer.</param>
|
||||
/// <returns>Returns either a BasePacket or null if not enough data.</returns>
|
||||
public BasePacket buildPacket(ref int offset, byte[] buffer, int bytesRead)
|
||||
public BasePacket BuildPacket(ref int offset, byte[] buffer, int bytesRead)
|
||||
{
|
||||
BasePacket newPacket = null;
|
||||
|
||||
|
@ -327,7 +327,7 @@ namespace FFXIVClassic_Map_Server
|
|||
return mWorldManager;
|
||||
}
|
||||
|
||||
public Dictionary<uint, ConnectedPlayer> getConnectedPlayerList()
|
||||
public Dictionary<uint, ConnectedPlayer> GetConnectedPlayerList()
|
||||
{
|
||||
return mConnectedPlayerList;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue