- revert previous commits to create a common experimental ancestor experimental

Mon, 15 Dec 2014 20:18:56 +0200

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Mon, 15 Dec 2014 20:18:56 +0200
branch
experimental
changeset 40
cf85b5f77541
parent 39
052393cf9016
child 41
9ab869656b9e

- revert previous commits to create a common experimental ancestor

sources/interface.cpp file | annotate | diff | comparison | revisions
sources/interface.h file | annotate | diff | comparison | revisions
sources/network/rconsession.cpp file | annotate | diff | comparison | revisions
sources/network/rconsession.h file | annotate | diff | comparison | revisions
--- a/sources/interface.cpp	Mon Dec 15 10:51:56 2014 +0200
+++ b/sources/interface.cpp	Mon Dec 15 20:18:56 2014 +0200
@@ -719,19 +719,6 @@
 		g_needOutputRender = true;
 		break;
 
-	case '\t':
-		{
-			int space = current_input().find (" ");
-
-			if (g_inputState == INPUTSTATE_NORMAL
-				and g_cursor > 0
-				and (space == -1 or space >= g_cursor))
-			{
-				RCONSession::get_session()->request_tab_complete (current_input().mid (0, g_cursor));
-			}
-		}
-		break;
-
 	case '\n':
 	case KEY_ENTER:
 		switch (g_inputState)
@@ -781,8 +768,6 @@
 			safe_disconnect ([]() {set_input_state (INPUTSTATE_ADDRESS);});
 		break;
 	}
-
-	render();
 }
 
 // -------------------------------------------------------------------------------------------------
@@ -941,21 +926,3 @@
 
 	return max (rows, 1);
 }
-
-// -------------------------------------------------------------------------------------------------
-//
-FUNCTION
-Interface::tab_complete (const String& part, String complete) -> void
-{
-	String& input = mutable_current_input();
-
-	if (input.starts_with (part))
-	{
-		if (input[part.length()] != ' ')
-			complete += ' ';
-
-		input.replace (0, part.length(), complete);
-		g_cursor = complete.length();
-		g_needInputRender = true;
-	}
-}
--- a/sources/interface.h	Mon Dec 15 10:51:56 2014 +0200
+++ b/sources/interface.h	Mon Dec 15 20:18:56 2014 +0200
@@ -40,6 +40,4 @@
 	FUNCTION set_title (const String& message) -> void;
 	FUNCTION update_statusbar() -> void;
 	FUNCTION connect (String address, String password) -> void;
-	FUNCTION need_refresh() -> void;
-	FUNCTION tab_complete (const String& part, String complete) -> void;
 };
--- a/sources/network/rconsession.cpp	Mon Dec 15 10:51:56 2014 +0200
+++ b/sources/network/rconsession.cpp	Mon Dec 15 20:18:56 2014 +0200
@@ -187,37 +187,6 @@
 			case SVRC_UPDATE:
 				process_server_updates (packet);
 				break;
-
-			case SVRC_TOOMANYTABCOMPLETES:
-				{
-					unsigned int numCompletions = packet.read_short();
-					print ("%1 completions for '%2'.\n",
-						int (numCompletions), m_lastTabComplete);
-				}
-				break;
-
-			case SVRC_TABCOMPLETE:
-				{
-					StringList completes;
-
-					for (signed int i = packet.read_byte(); i > 0; --i)
-						completes << packet.read_string();
-
-					if (completes.size() == 1)
-						Interface::tab_complete (m_lastTabComplete, completes[0]);
-					else if (not completes.is_empty())
-					{
-						print ("Completions for '%1':\n", m_lastTabComplete);
-
-						for (int i = 0; i < completes.size(); i += 8)
-						{
-							Range<int> spliceRange (i, min (i + 8, completes.size() - 1));
-							StringList splice (completes.splice (spliceRange));
-							print ("- %1\n", splice.join (", "));
-						}
-					}
-				}
-				break;
 			}
 		}
 	}
@@ -371,21 +340,3 @@
 {
 	return m_level;
 }
-
-// -------------------------------------------------------------------------------------------------
-//
-METHOD
-RCONSession::request_tab_complete (const String& part) -> void
-{
-	if (m_serverProtocol >= 4)
-	{
-		Bytestream packet;
-		packet.write_byte (CLRC_TABCOMPLETE);
-		packet.write_string (part);
-		send (packet);
-		bump_last_ping();
-		m_lastTabComplete = part;
-	}
-	else
-		print ("Server protocol is %1, cannot tab-complete\n", m_serverProtocol);
-}
--- a/sources/network/rconsession.h	Mon Dec 15 10:51:56 2014 +0200
+++ b/sources/network/rconsession.h	Mon Dec 15 20:18:56 2014 +0200
@@ -37,7 +37,7 @@
 //
 enum
 {
-	RCON_PROTOCOL_VERSION = 4
+	RCON_PROTOCOL_VERSION = 3
 };
 
 // -------------------------------------------------------------------------------------------------
@@ -51,8 +51,6 @@
 	SVRC_INVALIDPASSWORD,
 	SVRC_MESSAGE,
 	SVRC_UPDATE,
-	SVRC_TABCOMPLETE,
-	SVRC_TOOMANYTABCOMPLETES,
 };
 
 // -------------------------------------------------------------------------------------------------
@@ -64,7 +62,6 @@
 	CLRC_COMMAND,
 	CLRC_PONG,
 	CLRC_DISCONNECT,
-	CLRC_TABCOMPLETE,
 };
 
 // -------------------------------------------------------------------------------------------------
@@ -110,7 +107,6 @@
 	METHOD state() const -> RCONSessionState;
 	METHOD level() const -> const String&;
 	METHOD is_active() const -> bool;
-	METHOD request_tab_complete (const String& part) -> void;
 
 	static METHOD new_session() -> RCONSession*;
 	static METHOD get_session() -> RCONSession*;
@@ -128,5 +124,4 @@
 	String m_hostname;
 	int m_numAdmins;
 	String m_level;
-	String m_lastTabComplete;
 };

mercurial