From: Mircea Kitsune Date: Thu, 27 Oct 2011 21:58:25 +0000 (+0300) Subject: g_sandbox_info - Print information about spawned / removed objects when 1, and also... X-Git-Tag: xonotic-v0.6.0~35^2~18^2~94 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=26445994303bf701ad71dc38deba1c8a48e9c093;p=xonotic%2Fxonotic-data.pk3dir.git g_sandbox_info - Print information about spawned / removed objects when 1, and also about edited objects when 2 --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 5969527c0..b1d22d191 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -542,7 +542,7 @@ set g_player_brightness 0 "set to 2 for brighter players" seta g_balance_cloaked_alpha 0.25 set g_sandbox 0 "allow players to spawn and edit objects around the map" -set g_sandbox_info 1 "print non-critical information to the server" +set g_sandbox_info 1 "print object information to the server. 1 prints info about spawned / removed objects, 2 also prints info about edited objects" set g_sandbox_editor_maxobjects 1000 "maximum number of objects that may exist at a time" set g_sandbox_editor_free 0 "when enabled, players can edit any object on the map, not just the objects they've spawned" set g_sandbox_editor_distance_spawn 200 "distance at which objects spawn in front of the player" diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc index 4b62a18d9..2535c7f24 100644 --- a/qcsrc/server/mutators/sandbox.qc +++ b/qcsrc/server/mutators/sandbox.qc @@ -246,8 +246,8 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand) if(e.netname == argv(2)) { W_ThrowNewWeapon(self, i, FALSE, trace_endpos, '0 0 0'); - if(autocvar_g_sandbox_info) - print("^3SANDBOX - SERVER: ^7", strcat(self.netname, " spawned a ^2", e.netname, "^7 at origin ", vtos(e.origin), "\n")); + if(autocvar_g_sandbox_info > 0) + print("^3SANDBOX - SERVER: ^7", strcat(self.netname, " spawned a ^2", e.netname, "^7 at origin ^3", vtos(e.origin), "\n")); return TRUE; } } @@ -276,8 +276,8 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand) e = sandbox_SpawnObject(); setmodel(e, argv(2)); - if(autocvar_g_sandbox_info) - print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " spawned an object at origin ", vtos(e.origin), "\n")); + if(autocvar_g_sandbox_info > 0) + print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " spawned an object at origin ^3", vtos(e.origin), "\n")); return TRUE; @@ -286,8 +286,8 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand) e = sandbox_EditObject_Get(); if(e != world) { - if(autocvar_g_sandbox_info) - print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " removed an object at origin ", vtos(e.origin), "\n")); + if(autocvar_g_sandbox_info > 0) + print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " removed an object at origin ^3", vtos(e.origin), "\n")); sandbox_RemoveObject(e); return TRUE; } @@ -331,8 +331,8 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand) sandbox_Storage_Load(e, self.object_clipboard); print_to(self, "^2SANDBOX - INFO: ^7Object pasted successfully"); - if(autocvar_g_sandbox_info) - print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " pasted an object at origin ", vtos(e.origin), "\n")); + if(autocvar_g_sandbox_info > 0) + print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " pasted an object at origin ^3", vtos(e.origin), "\n")); return TRUE; } return TRUE; @@ -475,6 +475,8 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand) print_to(self, "^1SANDBOX - WARNING: ^7Invalid object property. For usage information, type 'sandbox help'"); break; } + if(autocvar_g_sandbox_info > 1) + print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " edited property ^3", argv(2), " ^7of an object at origin ^3", vtos(e.origin), "\n")); return TRUE; } @@ -510,11 +512,7 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerPreThink) grab = TRUE; if(Drag(e, grab)) // execute dragging - { - if(autocvar_g_sandbox_info) - print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " grabbed an object at origin ", vtos(e.origin), "\n")); return TRUE; - } return FALSE; }