Not logged inOpenClonk Forum
Up Topic Development / Developer's Corner / Patch: Ignore Lobby users
- - By Carli [de] Date 2010-03-25 23:33 Edited 2010-03-27 15:22
Hi.

I hate all "<empty> go" spam but i don't want to kick them because I need fresh blood ;)

So I wrote a patch that enables an ignore selection of a network client.
Everyone can ignore spammers locally without being the host and without kicking them.

There is only 1 ToDo:
- Small icon for ignoring a client

I really hope, the patch will get committed because at least I need it ;)
Parent - - By Sven2 [de] Date 2010-03-26 13:17
Looks good; I'd put it in if you finish it.

* No Licence (ISC)
* Pleae use getters/setters for new code (C4Client::IsIgnored())
* Ideally, ignore should carry over into the game and be adjusted in the network client list (F4)
* Icon missing :P - you could just mark the ignore status in the client name, e.g. put it in <i> or <c 929292>. Or have a new icon added into the text as {{Ico::Ignore}} markup.
* Put something like "Chat ignored" into the client name label tooltip
* Missing localized strings are usually marked as [!]; not with a TODO
Parent - - By Carli [de] Date 2010-03-26 19:48 Edited 2010-03-26 19:54
* Herby i license the following under the WTFPL
* I implemented it
* No, the game chat has an other relevance than the lobby.
* Icon is added to C4GUI:: and waits for being drawn (number 52 - but i can only commit text changes :P)
* Done
* Done

Note: something is still not working :(
Parent - By Zapper [de] Date 2010-03-26 19:59
Sven says: ok
Parent - - By Loriel Date 2010-03-26 20:01
As a quick guess, maybe it is because you refuse to do what we have been telling you in #openclonk-dev: Initialise the new member variable in *both* constructors.
Parent - - By Carli [de] Date 2010-03-26 20:11
here you have the final working patch ready to commit (username: carli)
Parent - - By Loriel Date 2010-03-26 20:16
Do not put spaces around -> or after !, consider using const char* instead of StdCopyStrBuf when you do not actually require a copy of the string, do not use pascal-casing inside single words like "UnIgnore", spell ToDo as TODO instead. I guess you could make an argument for not having a space after { and before } in a single-line function, but everybody else is putting them there so you probably should.
Parent - By Loriel Date 2010-03-26 20:29
Fixed.
Parent - - By Günther [de] Date 2010-03-26 20:32

> Icon is added to C4GUI:: and waits for being drawn (number 52 - but i can only commit text changes :P)


No, you can. Just attach the patch as a mercurial bundle, or attach the icons file separately. To add the stringtables, simply add a new line in planet/System.c4g/Language*.txt, and use LoadResStr. Compared to the hoops you already jumped through, that's no big task.

Also, "Ignore" is a unhelpful comment, and initialization of class members should be done in the initialization list, same as for example pNetClient. Also, use tabs for indentation (you have a few lines indented with spaces). I know that these rules aren't consistently applied in the existing code, but cleaning that up is already a dull task, no need to add to the pile.
Reply
Parent - - By Carli [de] Date 2010-03-26 20:42
here you have.
Attachment: ignore.patch - really-really final (6k)
Parent - - By Loriel Date 2010-03-26 20:50
+IDS_NET_CLIENTIGNORE=You can't even read his messages

What about "her"?

Also, uh,

> initialization of class members should be done in the initialization list, same as for example pNetClient.

Parent - By Carli [de] Date 2010-03-26 21:33 Edited 2010-03-28 20:14
This is the current version of this patch.

I hope, this patch gets committed

I hereby license the following file(s) under the CC-by license
Attachment: ignore.patch (7k)
Up Topic Development / Developer's Corner / Patch: Ignore Lobby users

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill