Game type string

Discussions about Servers
Post Reply
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Game type string

Post by Barbie »

A user told me that my (linux) MH server does not appear in the list if he sets the browser filter to "MonsterHunt" - and in fact the public version of my MH server returns "Monsterhunt" instead of "MonsterHunt" as game type. I don't want to discuss why the browser developer thought that case is important but want to know where the string "Monsterhunt" is get from when the server is queried so that I can change that string. I have looked in all INI files as well at the class name and also in the default properties of my code without finding such.

Server's log also tells that the game type is the lower case string:
Spoiler

Code: Select all

Bound to Fire.so
Case-insensitive search: Botpack -> ../System/BotPack.u
Bound to IpDrv.so
Case-insensitive search: Monsterhunt -> ../System/MonsterHunt.u
Bound to UWeb.so
Collecting garbage
Purging garbage
Garbage: objects: 24608->24607; refs: 600520
Case-insensitive search: genfluid -> ../Textures/GenFluid.utx
Game class is 'Monsterhunt'
Sockets: Socket queue 262144 / 262144
In MapVoteULv1_2.ini the GameConfig string is

Code: Select all

CustomGameConfig[0]=(bEnabled=True,GameClass="BarbiesWorld.MonsterHunt",NewPrefix="MH",Mutators="",Settings="")
The initial game starter ucc.init has set

Code: Select all

MYGAME=BarbiesWorld.MonsterHunt
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
Aldebaran
Masterful
Posts: 672
Joined: Thu Jan 28, 2016 7:30 pm

Re: Game type string

Post by Aldebaran »

Does this gametype string depends on map? I think I had similar issue and realized that when playing some maps the server isn't listed in the MonsterHunt tab but playing the most maps I can find it there. I hope I remember it correctly...
nogardilaref
Masterful
Posts: 577
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: Game type string

Post by nogardilaref »

Well, it's not like developers explicitly set something to be case-sensitive, case-sensitivity is actually the default behavior of anything as byte-wise "a" is very different from "A".
Having that said, given that UScript is fully case-insensitive, it makes sense to expect some comparisons to be case-insensitive as well.

As for the class name, in UScript names may be case-insensitive, but they preserve the case they were first defined with.
This is why that, in a map for instance, if you set a name such in a Tag as "MyTag" for example, when you write the same name but somewhere else, even if you write as "mytag" it will actually retain the original case as "MyTag".

So even if you define things like "BarbiesWorld.MonsterHunt", since "MonsterHunt" was probably defined somewhere first as "Monsterhunt" instead, from there every instance of this name will be Monsterhunt instead, including the one from your own class.
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Game type string

Post by Barbie »

Aldebaran wrote:Does this gametype string depends on map?
This must be the case, yes. Accidentally the server crashed and restarted some minutes ago and now - oh wonder - the game string is "MonsterHunt" now:
Spoiler

Code: Select all

Bound to Fire.so
Case-insensitive search: Botpack -> ../System/BotPack.u
Bound to IpDrv.so
Bound to UWeb.so
Collecting garbage
Purging garbage
Garbage: objects: 21382->21381; refs: 348760
Game class is 'MonsterHunt'
Sockets: Socket queue 262144 / 262144
Then I looked into the previous log file (that part in the first post) what map run first, and now look yourself what MH-Crescendo has set as GameType:
MH-Crescendo-Gametype.jpg
MH-Crescendo-Gametype.jpg (51.85 KiB) Viewed 2490 times
Travelling to next level seem not to change that, that string stayed over several maps.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
Dizzy
Experienced
Posts: 109
Joined: Tue May 21, 2013 3:57 pm
Personal rank: Oaf
Contact:

Re: Game type string

Post by Dizzy »

So the lessons here are:

1. Modders, don't develop a server browser that's case sensitive
2. Mappers, don't use improper capitalisation when you define your map's default gametype
3. Admins, always choose a default map which has the correctly-defined gametype string

Is that about right?
Join the BunnyTrack.net Discord chat server: https://www.bunnytrack.net/discord
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Game type string

Post by sektor2111 »

Idk what was using that user but as I could see last time, Barbie's server is more than visible... I'm currently browsing custom games as described in forum because GameSpy is dead and mOnsTerhuNT was hard-coded for that (deliberated screwing name) and I think I never had these problems of browsing, I could even join into Linux servers running maps a la Crescendo and such (borked a bit). If players are sudden coders messing up browsing that's a different story. Else perhaps there are some Linux OS which are badly messing up these Letter cases (their setup) and I did not figure this thing, However is the first time when I'm reading about such issues. Client running UT into Wine under Linux ? Which Windows version ? What exactly does that client use ? Without details nobody can figure problems... and do not expect mappers to do the right thing anyway - try to tweak name properly using SetPropertyText or such in your MH mods.
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Game type string

Post by Barbie »

Dizzy wrote:2. Mappers, don't use improper capitalisation when you define your map's default gametype
Mappers cannot change that directly, they have to use the entry given in the Actor Class Browser. To get the lower case string in there you have to rename the file "MonsterHunt.u" to "Monsterhunt.u" and load it then into the Actor Class Browser.
sektor2111 wrote:try to tweak name properly using SetPropertyText
I have not tried that yet, but isn't there a problem with the case handling of the name table? Once the name 'Monsterhunt' is in there, you cannot overwrite it with 'MonsterHunt'.
sektor2111 wrote:What exactly does that client use ?
Sorry, I have no information about that.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Game type string

Post by sektor2111 »

Barbie wrote:I have not tried that yet, but isn't there a problem with the case handling of the name table? Once the name 'Monsterhunt' is in there, you cannot overwrite it with 'MonsterHunt'.
I will play a bit with that after finishing what I've started. I don't recall any failure of SetPropertyText so far... else I'm convinced that string is being screwed with what server has.
Post Reply