# HG changeset patch
# User Teemu Piippo <tsapii@utu.fi>
# Date 1437608113 -10800
# Node ID 39947c46ed174177fe57d2de45adf0bfa8774179
# Parent  ac02cf1c35764fb7ae91d3697050121308e8da0e
Suppress more MSVC warnings

diff -r ac02cf1c3576 -r 39947c46ed17 CMakeLists.txt
--- a/CMakeLists.txt	Thu Jul 23 02:22:26 2015 +0300
+++ b/CMakeLists.txt	Thu Jul 23 02:35:13 2015 +0300
@@ -54,7 +54,7 @@
 target_link_libraries (${TARGET_NAME} huffman)
 
 if (WIN32)
-	add_definitions ("-D_CRT_SEURE_NO_WARNINGS")
+	add_definitions (-D_CRT_SECURE_NO_WARNINGS)
 	target_link_libraries (${TARGET_NAME} wsock32 ws2_32)
 
 	if (PDCURSES_PATH OR PDCURSES_WIN32A_PATH)
diff -r ac02cf1c3576 -r 39947c46ed17 sources/basics.h
--- a/sources/basics.h	Thu Jul 23 02:22:26 2015 +0300
+++ b/sources/basics.h	Thu Jul 23 02:35:13 2015 +0300
@@ -46,7 +46,6 @@
 # define and &&
 # define or ||
 # define not !
-# define _CRT_SECURE_NO_WARNINGS
 #endif
 
 #define TEXTCOLOR_Escape "\x1C"
diff -r ac02cf1c3576 -r 39947c46ed17 sources/interface.cpp
--- a/sources/interface.cpp	Thu Jul 23 02:22:26 2015 +0300
+++ b/sources/interface.cpp	Thu Jul 23 02:35:13 2015 +0300
@@ -143,7 +143,6 @@
 // -------------------------------------------------------------------------------------------------
 //
 Interface::Interface() :
-	Session (this),
 	InputCursor (0),
 	CursorPosition (0),
 	InputPanning (0),
@@ -156,12 +155,7 @@
 	CurrentInputState (INPUTSTATE_NORMAL),
 	DisconnectConfirmFunction (NULL)
 {
-#ifdef XCURSES
-    ::Xinitscr(argc, argv);
-#else
-    ::initscr();
-#endif
-
+	::initscr();
 	::raw();
 	::keypad (stdscr, true);
 	::noecho();
@@ -171,6 +165,7 @@
 	InputHistory << "";
 	OutputLines.clear();
 	OutputLines << ColoredLine();
+	Session.set_interface (this);
 	Title.sprintf (APPNAME " %s (%d)", full_version_string(), changeset_date_string());
 
 	if (::has_colors())
diff -r ac02cf1c3576 -r 39947c46ed17 sources/network/rconsession.cpp
--- a/sources/network/rconsession.cpp	Thu Jul 23 02:22:26 2015 +0300
+++ b/sources/network/rconsession.cpp	Thu Jul 23 02:35:13 2015 +0300
@@ -35,11 +35,11 @@
 
 // -------------------------------------------------------------------------------------------------
 //
-RCONSession::RCONSession (Interface* iface) :
+RCONSession::RCONSession() :
 	m_state (RCON_DISCONNECTED),
 	m_lastPing (0),
 	m_numAdmins (0),
-	m_interface (iface)
+	m_interface (NULL)
 {
 	if (not m_socket.set_blocking (false))
 	{
@@ -73,6 +73,7 @@
 		Bytestream packet;
 		packet.write_byte (CLRC_DISCONNECT);
 		this->send (packet);
+
 		m_interface->print ("Disconnected from %s\n",
 			m_address.to_string (IPAddress::WITH_PORT).chars());
 		m_interface->update_statusbar();
@@ -383,4 +384,11 @@
 	}
 }
 
+// -------------------------------------------------------------------------------------------------
+//
+void RCONSession::set_interface (Interface* iface)
+{
+	m_interface = iface;
+}
+
 END_ZFC_NAMESPACE
\ No newline at end of file
diff -r ac02cf1c3576 -r 39947c46ed17 sources/network/rconsession.h
--- a/sources/network/rconsession.h	Thu Jul 23 02:22:26 2015 +0300
+++ b/sources/network/rconsession.h	Thu Jul 23 02:35:13 2015 +0300
@@ -92,7 +92,7 @@
 class RCONSession
 {
 public:
-	RCONSession (class Interface* iface);
+	RCONSession();
 	~RCONSession();
 
 	const IPAddress& address() const;
@@ -113,10 +113,9 @@
 	const String& level() const;
 	bool is_active() const;
 	void request_tab_complete (const String& part);
+	void set_interface (class Interface* iface);
 
 private:
-	RCONSession();
-
 	RCONSessionState m_state;
 	IPAddress m_address;
 	UDPSocket m_socket;