Closed Eboubaker closed 1 year ago
Requires more testing, i only tested by typing in nc localhost 8005
Impressive work here! Much appreciated. I look forward to testing this.
This is done and is ready to be reviewed/tested. can be discarded if not suitable. if this reached live server I recommend replacing playerListSecret.ini
@connorhsm
I tried with the same input and got this: Are you sure you were on the latest commit on branch get-player-list when you tested it? I could not reproduce it.
I didn't get what you mean exactly but I put in the protocol.txt that when the player is nameless the name part will be empty string, it's up to the client to parse that response and replace it with nameless or other symbol. if you do a .split(" ")
(with space character argument) on the player line the first-name part will be empty string and no last-name part if the player is namless.
will do!.
If you don't want problems with empty string replacing both firstname and lastname we could concatenate them with an underscore _
or other symbol instead of space character like now . so it will be easier to read(when someone is nameless) by the client(the bot) but then the client has to replcace that underscore back into a space character!.
other solution is simply to swap name and declaredInfertile positions, to let name be the last part then it is easier to know if someone is nameless. instead of
gender age name delcaredInfertile
we do
gender age delcaredInfertile name
since all the first 3 parts will definitely be there. Also This way the display lines will be more aligned because the name part has random lengths and by leaving it at the end it will look better.
I agree about ordering, let's put the name last. I was also about to agree about not concatenating the name, but I think this will be necessary for the primary use case that initiated this idea.
We need a way to discern whether or not a name is a first or last name so that a client can group together families by last name. I think an underscore would help by allowing the ability to check whether it's at the start or end of a name, which indicates a player without a last or first name respectively. Like so:
gender age delcaredInfertile first_last
gender age delcaredInfertile first_
gender age delcaredInfertile _last
This also may not be a problem if a missing first or last is being replaced by an extra space, I'll test this further and also confirm the differences we've had with the LOGIN message later.
looking at the way you seperate firstname and lastname, I think you expect the server to show you the player last name even if they are still a baby and no one gave them a firstname. currently I just use player->name
it has both firstname and lastname concatenated with a space, the problem is it is only set once someone gives them a name or they spawn as eve. in that case(baby) I probably need to follow their lineage and get the lastname.
Given there's no separation internally, let's keep name one field.
@connorhsm
Can you Add isTutorial
after declaredInfertile
in protocol.txt
as in the updated description of this PR
issue https://github.com/twohoursonelife/OneLife/issues/202
check added text in protocol.txt for details:
NOTE: if server is full, the server will still send SERVER_FULL message, changing this behavior requires big changes to the way the server handles the first connection-establishing messages that i don't want to touch.