You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 18, 2024. It is now read-only.
The client displays it's own chat message as if it came from another person:
# client.nimprocdisplay_chat(name, message: string) {.networked.} =## Display chat message from the server.eraseLine()
echo fmt"{getClockStr()}{name} says: {message}"procsend_chat(name, msg: string) =# If you want client actions to take place instantly, create a procedure # to handle client-side logic and then dispatch the RPC.eraseLine()
echo fmt"{getClockStr()} You said: {msg}"rpc("send_chat", (name: name, msg: msg))
it should call the rpc on other clients, but it is sent to the caller of the rpc as well. If you send a chat you will see both messages in the chat.
Check the example here:
https://github.com/RattleyCooper/nettyrpc-1/tree/examples/example/authoritativeChatClient
The client displays it's own chat message as if it came from another person:
it should call the rpc on other clients, but it is sent to the caller of the rpc as well. If you send a chat you will see both messages in the chat.