Pastebiniä käytetään pidempien tekstien säilömiseen jotka pitää laittaa talteen tai joita esim. ei voi sanoa irkissä tms kätevästi ilman hirveää floodimista. Lyhykäisiä tunnisteita saa arvaamalla satunnaisesti selville, joten ei kannata pasteta mitään erityisen yksityistä.
Tekstiä mahtuu maksimissaan 64 kilotavua per paste eli älä ihmettele jos tosi pitkät pastet katkeaa, jos taas TOSI isoja pasteja tunkkaa tänne niin tulee jopa virhe eikä paste mene edes läpi. Myäskään viagra- tai cialis-sanoja sisältäviä pasteja ei hyväksytä, sillä erinäiset spämmibotit puskevat niitä vähän väliä.
Pasten nimi (vapaaehtoinen):
Värjäys: ABAPActionScriptActionScript 3AdaANTLRANTLR With ActionScript TargetANTLR With C# TargetANTLR With CPP TargetANTLR With Java TargetANTLR With ObjectiveC TargetANTLR With Perl TargetANTLR With Python TargetANTLR With Ruby TargetApacheConfAppleScriptaspx-csaspx-vbAsymptoteautohotkeyAwkBase MakefileBashBash SessionBatchfileBBCodeBefungeBlitzMaxBooBrainfuckBroCC#C++c-objdumpCFEngine3cfstatementCheetahClojureCMakeCoffeeScriptColdfusion HTMLCommon LispCoqcpp-objdumpCSSCSS+Django/JinjaCSS+Genshi TextCSS+MakoCSS+MyghtyCSS+PHPCSS+RubyCSS+SmartyCythonDd-objdumpDarcs PatchDartDebian Control fileDebian SourcelistDelphiDiffDjango/JinjaDTDDuelDylaneCECLElixirElixir iex sessionEmbedded RagelERBErlangErlang erl sessionEvoqueFactorFancyFantomFelixFortranFSharpGASGenshiGenshi TextGettext CatalogGherkinGLSLGnuplotGoGoodData-CLGosuGosu TemplateGroffGroovyHamlHaskellhaXeHTMLHTML+CheetahHTML+Django/JinjaHTML+EvoqueHTML+GenshiHTML+MakoHTML+MyghtyHTML+PHPHTML+SmartyHTML+VelocityHTTPHybrisINIIoIokeIRC logsJadeJavaJava Server PageJavaScriptJavaScript+CheetahJavaScript+Django/JinjaJavaScript+Genshi TextJavaScript+MakoJavaScript+MyghtyJavaScript+PHPJavaScript+RubyJavaScript+SmartyJSONKotlinLighttpd configuration fileLiterate HaskellLLVMLogtalkLuaMakefileMakoMAQLMasonMatlabMatlab sessionMiniDModelicaModula-2MoinMoin/Trac Wiki markupMOOCodeMoonScriptMuPADMXMLMyghtyMySQLNASMNemerleNewLispNewspeakNginx configuration fileNimrodNumPyobjdumpObjective-CObjective-JOCamlOctaveOocOpaOpenEdge ABLPerlPHPPL/pgSQLPostgreSQL console (psql)PostgreSQL SQL dialectPostScriptPOVRayPowerShellPrologPropertiesProtocol BufferPyPy LogPythonPython 3Python 3.0 TracebackPython console sessionPython TracebackRagelRagel in C HostRagel in CPP HostRagel in D HostRagel in Java HostRagel in Objective C HostRagel in Ruby HostRaw token dataRConsoleREBOLRedcodereStructuredTextRHTMLRubyRuby irb sessionSSassScalaScalate Server PageScamlSchemeScilabSCSSSmalltalkSmartySnobolSQLsqlite3conSquidConfStandard MLsystemverilogTclTcshTeaTeXText onlyUrbiScriptValaVB.netVelocityverilogvhdlVimLXMLXML+CheetahXML+Django/JinjaXML+EvoqueXML+MakoXML+MyghtyXML+PHPXML+RubyXML+SmartyXML+VelocityXQueryXSLTYAML
From 1bce05307601b4e692e374f265186b38e8e6173c Mon Sep 17 00:00:00 2001 From: Perttu Ahola <celeron55@gmail.com> Date: Sun, 4 Aug 2013 11:45:55 +0300 Subject: [PATCH] Setting max_nonregular_users sets limit for users with no privilege "regular" --- builtin/privileges.lua | 1 + minetest.conf.example | 4 +++- src/defaultsettings.cpp | 1 + src/server.cpp | 37 +++++++++++++++++++++++++++++++------ 4 files changed, 36 insertions(+), 7 deletions(-) diff --git a/builtin/privileges.lua b/builtin/privileges.lua index 8dd06b2..6d2d0d5 100644 --- a/builtin/privileges.lua +++ b/builtin/privileges.lua @@ -49,4 +49,5 @@ minetest.register_privilege("noclip", { give_to_singleplayer = false, }) minetest.register_privilege("rollback", "Can use the rollback functionality") +minetest.register_privilege("regular", "Can join when player count is above max_nonregular_users") diff --git a/minetest.conf.example b/minetest.conf.example index 4c049f8..3eb5427 100644 --- a/minetest.conf.example +++ b/minetest.conf.example @@ -216,8 +216,10 @@ #map-dir = /custom/world # Message of the Day #motd = Welcome to this awesome Minetest server! -# Maximum number of players connected simultaneously +# Maximum number of non-admin players connected simultaneously #max_users = 100 +# Maximum number of non-admin players without the "regular" privilege +#max_nonregular_users = 50 # Set to true to disallow old clients from connecting #strict_protocol_version_checking = false # Set to true to enable creative mode (unlimited inventory) diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 326e11b..c94e2c6 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -151,6 +151,7 @@ void set_default_settings(Settings *settings) settings->setDefault("default_game", "minetest"); settings->setDefault("motd", ""); settings->setDefault("max_users", "100"); + settings->setDefault("max_nonregular_users", "50"); settings->setDefault("strict_protocol_version_checking", "false"); settings->setDefault("creative_mode", "false"); settings->setDefault("enable_damage", "true"); diff --git a/src/server.cpp b/src/server.cpp index 4099d99..4a2389c 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1991,12 +1991,37 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) // Enforce user limit. // Don't enforce for users that have some admin right - if(m_clients.size() >= g_settings->getU16("max_users") && - !checkPriv(playername, "server") && - !checkPriv(playername, "ban") && - !checkPriv(playername, "privs") && - !checkPriv(playername, "password") && - playername != g_settings->get("name")) + bool is_some_kind_of_admin = ( + checkPriv(playername, "server") || + checkPriv(playername, "ban") || + checkPriv(playername, "privs") || + checkPriv(playername, "password") || + playername == g_settings->get("name") + ); + bool is_regular = ( + is_some_kind_of_admin || + checkPriv(playername, "regular") + ); + u32 num_valid_clients = 0; + for(std::map<u16, RemoteClient*>::iterator + i = m_clients.begin(); i != m_clients.end(); ++i) + { + RemoteClient *client = i->second; + if(!client->denied) + num_valid_clients++; + } + if(!is_regular && + num_valid_clients >= g_settings->getU16("max_nonregular_users")) + { + actionstream<<"Server: "<<playername<<" tried to join, but there" + <<" are already max_nonregular_users=" + <<g_settings->getU16("max_nonregular_users") + <<" players."<<std::endl; + DenyAccess(peer_id, L"Too many users."); + return; + } + if(!is_some_kind_of_admin && + num_valid_clients >= g_settings->getU16("max_users")) { actionstream<<"Server: "<<playername<<" tried to join, but there" <<" are already max_users=" -- 1.8.3.1