#π why is my client still calling for chat messages from previous logins?
40 messages Β· Page 1 of 1 (latest)
@gritty wolf
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
clear displayed_messages at session start
self.clear_messages() is in the innit that leads to this:
self.chat_display.delete(1.0, tk.END)
self.displayed_messages.clear()```
you can reinitialize ChatUI each session to clear messages
should this done at the main or is it possible within the ui_chat itself? (my main is the overarching client that pulls ui_gameplay, ui_chat, ui_login, etc etc)
im a self taught junior
Are you asking if you can re-initialize your ChatUI object inside your class definition?
o_O
handle in main
yes, i think. ive coded 1/3rd a mmorpg by trial and error
thanks
the first idea was a function that loops but then that doesnt make much sense, i will reinnit at main
So you're not initializing anything in ui_chat.py. Nothing exists until you instantiate it in your main.py.
ui_chat is called within main, correct
well technically
its main -> ui_gameplay -> ui_chat
but yes
Then it becomes an object. (presumably - I haven't seen the driver code). Depending on how you're doing it you can keep destroying and instantiating new objects or maintain persistence but that's up to your design.
i have a feeling ive errored somewhere because the messages clear correctly but then reprint
like its my fault
im calling the messages back
or
the messages are checked
For complex applications you should really plan out your design before implementing it.
and not checked against a list that disallows duplicates or olds
Otherwise you end up backtracking and doing weird things to code around things you did previously.
its architected pretty well the only place ive gotten dirty is this chat problem, specifically the reproduction problem. the login, select, character creation, SQL database, it all works flawlessly
i wrote a design doc before starting
i have that thought in the back of my head something simple and stupid is reproducing these messages
check for duplicate message logic. small details matter
i need to unique the message id
i think ive solved it
before it was a counting set
disallow unique ids already seen
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.
π why is my client still calling for chat messages from previous logins?