Esempio n. 1
0
 private void newConnectionRequest(ConnectionManager.ConnectionInformation connection)
 {
     ConnectionHandeler handeler = new ConnectionHandeler(connection);
     handeler.Disconnection += serverDisconnected;
     AddConnection(handeler);
     handeler.Start();
 }
Esempio n. 2
0
 private void AddConnection(ConnectionHandeler connection)
 {
     if (!liveConnections.ContainsKey(connection.getIp()))
     {
         liveConnections.Add(connection.getIp(), new List<ConnectionHandeler>());
     }
     liveConnections[connection.getIp()].Add(connection);
 }
Esempio n. 3
0
 private void RemoveConnection(ConnectionHandeler connection)
 {
     if (liveConnections.ContainsKey(connection.getIp()))
     {
         liveConnections[connection.getIp()].Remove(connection);
         if (liveConnections[connection.getIp()].Count == 0)
             liveConnections.Remove(connection.getIp());
     }
 }
Esempio n. 4
0
 public LicenseHolder(ConnectionHandeler connectionHandeler)
 {
     details = new ButterflyServerDetails(this);
     this.connectionHandeler = connectionHandeler;
     this.connectionHandeler.addPacketHandeler(ServerOpCode.License_Response, OnLicenseReceived);
     this.connectionHandeler.addPacketHandeler(ServerOpCode.User_count_update, OnUserCountUpdate);
     this.connectionHandeler.addPacketHandeler(ServerOpCode.Query_Result, OnQueryResult);
     this.connectionHandeler.addPacketHandeler(ServerOpCode.Server_Full, OnServerFull);
     this.connectionHandeler.sendPacket(new LicenseRequest());
 }
Esempio n. 5
0
 public void Dispose()
 {
     if (this.addedToMainListDetails)
     {
         AwsomeLicense.licenseRequester.RemoveActiveLicense(this);
         details.serverDisconnect();
     }
     //Clean up my own shit
     this.connectionHandeler = null;
     this.gettingData = false;
 }
Esempio n. 6
0
 private void serverDisconnected(ConnectionHandeler handeler)
 {
     RemoveConnection(handeler);
     handeler.Disconnection -= serverDisconnected;
 }