Bug 3040 - LANG_SERVER and LANG_PLAYER mixed in CS statistics
LANG_SERVER and LANG_PLAYER mixed in CS statistics
Status: RESOLVED FIXED
Product: AMX Mod X
Classification: Unclassified
Component: Addon: Counter-Strike
trunk
PC All
: P4 minor
Assigned To: amxmodx-bugs@alliedmods.net
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-09-01 15:41 PDT by KWo
Modified: 2014-05-04 11:45 PDT (History)
4 users (show)

See Also:


Attachments
lang_server.JPG (83.66 KB, image/jpeg)
2007-09-01 15:42 PDT, KWo
no flags Details
Proposed Patch (75.25 KB, patch)
2014-05-02 04:39 PDT, Valentin Grünbacher [:Nextra]
no flags Details | Diff | Splinter Review
Proposed Patch (80.10 KB, patch)
2014-05-02 07:13 PDT, Valentin Grünbacher [:Nextra]
no flags Details | Diff | Splinter Review
Proposed patch (80.10 KB, patch)
2014-05-02 07:22 PDT, Vincent Herbet [:Arkshine]
no flags Details | Diff | Splinter Review
Updated proposed patch (40.05 KB, patch)
2014-05-02 07:28 PDT, Vincent Herbet [:Arkshine]
no flags Details | Diff | Splinter Review
Final patch (40.32 KB, patch)
2014-05-02 08:01 PDT, Valentin Grünbacher [:Nextra]
hv.contact: review+
Details | Diff | Splinter Review

Description KWo 2007-09-01 15:41:07 PDT
1.8.0-r3625
Look at this - I had Polish as client language and English as server language. Why some of those stats are coded with LANG_SERVER and some as LANG_PLAYER? It looks like those from statsx are coded with LANG_SERVER parameter. There is no reason to have some statistics in the server language, and some with player's language.
Comment 1 KWo 2007-09-01 15:42:10 PDT
This is the picture I missed in the first post.
Comment 2 David Anderson [:dvander] 2007-11-12 19:59:16 PST
I am changing this to a feature request because it's not a bug per-se -- it's a short-sighted design.  StatsX uses global buffers everywhere and changing it to allow for per-client languages is a big task.
Comment 3 Valentin Grünbacher [:Nextra] 2014-05-02 04:39:02 PDT
Created attachment 3913 [details] [review]
Proposed Patch

This patch moves formatting from LANG_SERVER to player-specific translations where possible. It includes other minor improvements:

- formatex used everywhere
- removed define-usage in favor of charsmax where possible
- removed named cvar access in favor of pcvars
- no implicit usages of global buffers anymore
- moved spawn detection from resethud to ham_spawn
- fixed a code piece where a player id cache was not used (think id = players[i])

The only function where LANG_SERVER is still used is the report function. It goes through engclient_cmd and prints the statistics with say_team. It's not possible to move this to player-specific translations without either changing the functionality/looks or manually replicating that porion of the chat. Since this is the first time in almost a decade of using AMXX that I've even seen this function I considered this to be only a minute annoyance.

I've done the work on the statsx-lang branch on my gitlab repo. You can follow the evolving changes there (https://labs.alliedmods.net/Nextra/amxmodx/commits/statsx-lang). I don't know if we want small commits in the main repo, apply this patch, use a merge request or rebase the commits into one and then merge. Your call.
Comment 4 Valentin Grünbacher [:Nextra] 2014-05-02 07:13:52 PDT
Created attachment 3914 [details] [review]
Proposed Patch

One more try. Splinter just doesn't like me...
Comment 5 Vincent Herbet [:Arkshine] 2014-05-02 07:22:55 PDT
Created attachment 3915 [details] [review]
Proposed patch

Let me try.
Comment 6 Vincent Herbet [:Arkshine] 2014-05-02 07:28:53 PDT
Created attachment 3916 [details] [review]
Updated proposed patch

Hmmm.
Comment 7 Valentin Grünbacher [:Nextra] 2014-05-02 08:01:55 PDT
Created attachment 3917 [details] [review]
Final patch

Patch with new minor additions Arkshine pointed out. Hopefully splinter-compatible....

- Switch replace_all to new replace_string
- Additional conversions to charsmax
- Set task timer to 0.1 instead of 0.01 which doesn't work anyway
- Add is_user_alive check to eventSpawn

Note You need to log in before you can comment on or make changes to this bug.