Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google Log In with Steam Sign In
  • Create Account
Photo

special characters and empty names allowed?

- - - - -

  • Please log in to reply
5 replies to this topic

#1
OFFLINE   BECK

BECK

    Advanced Member

  • Subscriber
  • PipPipPipPip
  • 226 posts
61
Getting Better
  • LocationDenver, CO

I searched the WIKI and forums for this, and I know I had asked it at one point but I see that this problem still happens.

 

There is a player on our server that likes to use non-printable non-standard characters in their name (e.g not alphanumerics and punctuation symbols).   I don't know how they do it, but they get non-standard ascii codes or something in their name.  It really looks funky in the logs and parsing tools.

 

I did find this, for version 0.7.0:

 

  • Fixed: Only real characters allowed in names.

 

I'd say that is not true, as this weekend (we're running 0.8.2) we had two instances of what I would consider illegal names:

0:55:43 Userinfo: \cg_ident\0000000025AD8511A356\cg_etver\4\cg_c\0.8.2\cg_cmodbuild\win-x86 Apr 24 2014\cg_uinfo\12 0 100\sil_guid\XXXXXGUIDXXXXXX\cl_guid\XXXXXGUIDXXXXX\cl_wwwDownload\1\name\^7\rate\32000\snaps\20\cl_anonymous\0\cl_punkbuster\1\ip\XXXXIPXXXX

It might be hard to see, but the name is : ^7   --- just a color?  It shows up as nothing in the game and in online trackers, just an empty slot.   I thought that you'd get kicked or the game would not allow you to enter an empty name.

 

I was going to paste another example where the guy used extended ascii characters in his name, but you can't see that when I print it here. In notepad it just looks like boxes where the special characters are, but I think you know what I mean.

 

Anyway - it seems that this fix either doesn't work anymore, or I'm unaware of settings that would require people to just use regular characters in their name instead of trying to be special using some sort of name exploit.    Any suggestions here?

 

 



#2
OFFLINE   gaoesa

gaoesa

    Advanced Member

  • Management
  • PipPipPipPip
  • 4391 posts
341
Will become famous
  • LocationFinland

This case is not currently considered on names. Will add checks to it for next version.



#3
OFFLINE   BECK

BECK

    Advanced Member

  • Subscriber
  • PipPipPipPip
  • 226 posts
61
Getting Better
  • LocationDenver, CO

Thanks :)



#4
OFFLINE   Zelly

Zelly

    Regular Member

  • Coders
  • PipPipPip
  • 141 posts
73
Getting Better

I would make sure to check length of cleanstr and trimmed for trailing spaces.

 

Can be done in lua. I don't have the code for the trim function though.

name = et.Info_ValueForKey( et.trap_GetUserinfo( clientnum ) , "name" )
name = trim(et.Q_CleanStr(name))

if ( string.len(name) < 1 ) then
    -- kick rename w/e
end


#5
OFFLINE   BECK

BECK

    Advanced Member

  • Subscriber
  • PipPipPipPip
  • 226 posts
61
Getting Better
  • LocationDenver, CO

Good suggestion.  I'm a novice at best at LUA, but would it be best to call something like this at a given interval (say every minute) or what would you suggest?   What would be the LUA to automatically rename someone?  Thanks.



#6
OFFLINE   Zelly

Zelly

    Regular Member

  • Coders
  • PipPipPip
  • 141 posts
73
Getting Better

Basically I check it once in ClientBegin and I check it in ClientUserInfoChanged

 

As for the renaming: it will only save for the current round, which isn't ideal, but its better than nothing. ( You could replace it with the !rename command instead, I think that lasts until they disconnect )

function Client:setName(name)
    if ( name == nil ) then return end
    if ( string.len(Misc:trim(et.Q_CleanStr(name))) <= 0 ) then return end
    local userinfo = self:getUserInfo()
    userinfo = et.Info_SetValueForKey( userinfo, "name", name )
    et.trap_SetUserinfo( self.id, userinfo )
    et.ClientUserinfoChanged( self.id )
end

 

I really should open my lua to public lol.
It is hard to copy my code without seeing the entire project.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users