saltysystems / overworld

Open source framework for scalable multiplayer games.
Mozilla Public License 2.0
20 stars 3 forks source link

bindings for c2s_proto not working occasionally #7

Closed cmdrk closed 4 months ago

cmdrk commented 2 years ago

It seems that if s2c_call and c2s_proto are both specified in the Overworld RPC definition, they have to match else the bindings fall back to using the handler function name for the c2s call.

e.g.

✔️ works

        #{
            opcode => ?CHAT_SEND,
            c2s_handler => {?MODULE, send, 2},
            c2s_proto => privmsg,
            encoder => chat_pb
        },

✔️ works

        #{
            opcode => ?CHAT_LIST,
            c2s_handler => {?MODULE, list, 2},
            c2s_proto => plist,
            s2c_call => plist,
            encoder => chat_pb
        },

❌ doesn't work

        #{
            opcode => ?CHAT_LIST,
            c2s_handler => {?MODULE, list, 2},
            c2s_proto => plist,
            encoder => chat_pb
        },
cmdrk commented 4 months ago

This has been obviated long ago.