+
+bool PROTO::RealConnect(USER * user)
+{
+if (user->GetPhase() != 1 &&
+ user->GetPhase() != 5)
+ {
+ errorStr = "Unexpected connect";
+ printfd(__FILE__, "PROTO::RealConnect() - wrong phase: %d\n", user->GetPhase());
+ }
+user->SetPhase(2);
+
+return Send_CONN_SYN(user);
+}
+
+bool PROTO::RealDisconnect(USER * user)
+{
+if (user->GetPhase() != 3)
+ {
+ errorStr = "Unexpected disconnect";
+ printfd(__FILE__, "PROTO::RealDisconnect() - wrong phase: %d\n", user->GetPhase());
+ }
+user->SetPhase(4);
+
+return Send_DISCONN_SYN(user);
+}