1 (edited by bleutyler 2012-11-10 19:32:08)

Topic: Assisstance with my ticket

I have volunteered for this fix.

https://github.com/teeworlds/teeworlds/issues/995

Could someone point me in the right direction about where to start looking to make this update?  A class name and a method is enough.

Thank you in advance.

2

Re: Assisstance with my ticket

Look in src/game/client/components/serverbrowser.cpp / .hpp, look for an attribute named name or server name or something like that, Ctrl+F is your best friend for this. Find where the name is printed, find how this name variable is set, find a proper place to filter these additional whitespaces, Ctrl+F all the way around!
(You might also want to do it server side.)

Not Luck, Just Magic.

3

Re: Assisstance with my ticket

src/game/client/components/menus_browser.cpp is where the columns are displayed.  I think this is what you are pointing me to.

However, I feel like the point where the game is created is a better point to make this update.  When a game is created, do we already go through some checks on the game name?  (Length of string comes to mind) so adding a filter of merging any two consecutive spaces into 1 seems like a good spot. 

Thoughts?  Or am I wrong / missing something due to inexperience with the code base?

4 (edited by Dune 2012-11-13 10:17:28)

Re: Assisstance with my ticket

bleutyler wrote:

src/game/client/components/menus_browser.cpp is where the columns are displayed.  I think this is what you are pointing me to.

However, I feel like the point where the game is created is a better point to make this update.  When a game is created, do we already go through some checks on the game name?  (Length of string comes to mind) so adding a filter of merging any two consecutive spaces into 1 seems like a good spot. 

Thoughts?  Or am I wrong / missing something due to inexperience with the code base?

That's cool that you're looking for something better - would actually make more sense. Although that was the idea for a start. From then on, you can track where variables were instanced to find the good file/functionyou're looking for.

The way the network part is designed, I don't think there is ever a string length check, but I'll interpret "when a game is created" as "when the info about the game is received by the client".
If you do it server side, it's easy to be bypassed for any modification to remove this filter.


Looking into menus_browser.cpp, I see (line 376), this:

                    const char *pStr = str_find_nocase(pItem->m_aName, g_Config.m_BrFilterString);

Since pItem comes from (line 232):

                const CServerInfo *pItem = ServerBrowser()->SortedGet(m_SelectedIndex);


I go ahead and do this:
http://puu.sh/1pIes



And find in serverbrowser.cpp this:
http://puu.sh/1pIfk



You now need to look where this array

m_ppServerlist

has been set.

I'm going to be late for univ, so I have to leave. If you still do not find anything I'll finish it :)


Good luck!

Not Luck, Just Magic.