Jump to content

Ettv for silent


loudness

Recommended Posts

Hello all!

i have a question pls...our clan play some fun wars whith a clan friend.....is all good and we like this kind of war on funserver..now we want to start a ettv server and all specs to go there..

we start ettv server but shotcaster fail when connect ....is kicked for invalid silent guid..

is there any solution to solve this and make a working silent ettv server???via lua or else???

 

tks

 

Link to comment
Share on other sites

  • Management

You can probably set the ETTV server GUID in the ClientConnect Lua hook, which will prevent getting kicked. It needs to be set before the ClientBegin. But the final solution requires changes in the mod to fix the issue. This was never tested.

function et_InitGame(levelTime, randomSeed, restart)
	et.RegisterModname("ETTV fix for silEnT 0.8.0")
end

function et_ClientConnect( clientNum, firstTime, isBot )
	local userinfo = et.trap_GetUserinfo( clientNum )
	local protocol = et.Info_ValueForKey( userinfo, "protocol" )
	
	if protocol == 284 then
		userinfo = et.Info_SetValueForKey( userinfo, "sil_guid", "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE:2" )
		et.trap_SetUserinfo( clientnum, userinfo )
	end
	
	return 1
end

This could work. I don't have ETTV for test, so please report back how it turns out.

Link to comment
Share on other sites

ok...script dont work...was a little modified by a member and seems to work but i drop the idee for using ettv...we make a script for keep  spectators players whithout a team tag ...no mainchat acces and shotcast status(not active)...like an eetv on the same server...(we have slots)

so...runing code  for fix is... check for no sil_guid clients only....real players do complyn are droped whith error 1

 

function et_InitGame(levelTime, randomSeed, restart)
et.RegisterModname("ETTV fix for silEnT 0.8.0")
end

function et_ClientConnect( clientNum, firstTime, isBot )
local userinfo = et.trap_GetUserinfo( clientNum )
local protocol = et.Info_ValueForKey( userinfo, "protocol")
local clientNumString = string.format("%02d", clientNum)

if( protocol == 284 ) and et.Info_ValueForKey(userinfo, "sil_guid") == "" then
userinfo = et.Info_SetValueForKey( userinfo, "sil_guid", clientNumString .. "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEE:2" )
et.trap_SetUserinfo( clientnum, userinfo )
end

return nil 
end
 
 
and our warscript is...(most functions from manny scripts in one... but working...no tag - no join ...no mainchat comments...)
 
clanTags1 = {
	[1] = "^1.^0DMG^9|",
	[2] = "DMG",
	[3] = "^1.^0DMG"
}

clanTags2 = {
	[1] = "PRZ",
	[2] = "PRZ"
}

team1 = "r" -- axis
team2 = "b" -- allies

-- [ Local Functions ]
function GetPlayerGUID(client)
	local player_guid = et.Info_ValueForKey(et.trap_GetUserinfo(client), "sil_guid" )
	if player_guid == "NO_GUID" or player_guid == "unknown" then 
		return true
	end
	return player_guid
end

function GetPlayerName(client)
	return et.Q_CleanStr(et.gentity_get(client, "pers.netname"))
end


-- [ Wolf Callbacks ]
function et_InitGame(levelTime,randomSeed,restart)
	et.RegisterModname("DMG WarDance")
	
	players = { }
	players[0] = 0 --all
	players[1] = 0 --axis
	players[2] = 0 --allies
	players[3] = 0 --spectators
	
	local a = 1
	while clanTags1[a] ~= nil do
		clanTags1[a] = string.lower(et.Q_CleanStr(clanTags1[a]))
		a = a + 1
	end
	
	a = 1
	while clanTags2[a] ~= nil do
		clanTags2[a] = string.lower(et.Q_CleanStr(clanTags2[a]))
		a = a + 1
	end
end


--function et_ShutdownGame(restart)
	-- nimic
--end


function et_Obituary(client, killer, death)



	local player_guid = GetPlayerGUID(client)
	local player_name = GetPlayerName(client)
	local game_state = tonumber(et.trap_Cvar_Get("gamestate"))
	local player_team = et.gentity_get(client, "sess.SessionTeam")

	if player_guid == nil then
		return nil
	end
	
	if game_state ~= 1 and game_state ~= 2 then

		players[0] = 0 --all
		players[1] = 0 --axis
		players[2] = 0 --allies
		players[3] = 0 --spectators

		for i=0, tonumber(et.trap_Cvar_Get("sv_maxclients"))-1, 1 do
			local teamnumber = tonumber(et.gentity_get(i,"sess.sessionTeam"))

			if et.gentity_get(i,"pers.connected") == 2 and player_name ~= "" then
				players[0] = players[0] + 1
				if teamnumber == 1 or teamnumber == 2 then
					if noTag(i, "") == 1 then
						-- et.trap_SendConsoleCommand( et.EXEC_APPEND, "putteam " .. player_name .. " s")
						-- http://omni-bot.googlecode.com/svn-history/r145/trunk/GameInterfaces/RTCW/lua-scripts/mmod/commands.lua
						et.gentity_set(i, "sess.sessionTeam", 3)
						et.ClientUserinfoChanged(i)
					end
						players[teamnumber] = players[teamnumber] + 1

				else
					players[teamnumber] = players[teamnumber] + 1
				end
			end
		end

--		if players[1] == players[2] then
--			et.trap_SendConsoleCommand( et.EXEC_APPEND, "unpause")
--			et.trap_SendServerCommand(-1, "chat \"scot pause\"")
--		else
--			et.trap_SendConsoleCommand( et.EXEC_APPEND, "pause")
--			et.trap_SendServerCommand(-1, "chat \"dau pause\"")
--		end
	end

	return nil
end

function et_ClientCommand(cno, cmd)
	if et.gentity_get(cno, "sess.sessionTeam") == 3 then
		if string.lower(cmd) == "team" then
			return noTag(cno, et.trap_Argv(1))
		end
		if string.lower(cmd) == "say" or string.lower(cmd) == "vsay" then
			return 1
		end

	end
	return 0
end

function noTag(cno, desiredteam)
	local a = 1
	local name = string.lower(et.Q_CleanStr(et.Info_ValueForKey(et.trap_GetUserinfo(cno), "name" )))
	local found1 = 0
	local found2 = 0
	
	while clanTags1[a] ~= nil do
		-- if string.find(name, string.lower(et.Q_CleanStr(clanTags1[a]))) ~= nil then
		if string.find(name, clanTags1[a]) ~= nil then
			found1 = 1
			break
		end
		a = a + 1
	end
	
	a = 1
	while clanTags2[a] ~= nil do
		-- if string.find(name, string.lower(et.Q_CleanStr(clanTags2[a]))) ~= nil then
		if string.find(name, clanTags2[a]) ~= nil then
			found2 = 1
			break
		end
		a = a + 1
	end

	if found1 == 0 and found2 == 0 then
		et.trap_SendServerCommand(-1, "chat \"" .. name .. " \^1ITI ESTE PERMIS DOAR SA ASISTI LA ACEST WAR \^2POTI STA SPECTATOR PANA LA FINALUL EVENIMENTULUI\"")
		et.trap_SendServerCommand(-1, "cp \"\^3SPECTATORII POT DISCUTA DOAR INTRE EI FOLOSIND \^5TEAMCHAT \"")

		return 1
	end
	
	if desiredteam == "" then 
		return 0 
	end
	
	if found1 == 1 and team1 ~= desiredteam then
		et.trap_SendServerCommand(-1, "chat \"" .. name .. "\ ^1ITI ESTE PERMIS SA TE ALATURI DOAR ECHIPEI \^1AXIS\"")
		return 1
	end
	
	if found2 == 1 and team2 ~= desiredteam then
		et.trap_SendServerCommand(-1, "chat \"" .. name .. "\ ^1ITI ESTE PERMIS SA TE ALATURI DOAR ECHIPEI \^4ALLIES\"")
		return 1
	end
	
	return 0
end

this script is made by dmg deevious.. fell free to use modify and post better versions...

cheers

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...