Loading server/match_handler.go +2 −5 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ import ( "go.uber.org/zap" ) var ErrMatchInitStateNil = errors.New("Match initial state must not be nil") type MatchDataMessage struct { UserID uuid.UUID SessionID uuid.UUID Loading Loading @@ -131,11 +133,6 @@ func NewMatchHandler(logger *zap.Logger, config Config, sessionRegistry SessionR core.Cleanup() return nil, err } if state == nil { core.Cancel() core.Cleanup() return nil, errors.New("Match initial state must not be nil") } // Construct the match. mh := &MatchHandler{ Loading server/runtime_go_match_core.go +3 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,9 @@ func (r *RuntimeGoMatchCore) MatchInit(presenceList *MatchPresenceList, deferMes return nil, 0, errors.New("MatchInit returned invalid tick rate, must be between 1 and 60") } r.tickRate = tickRate if state == nil { return nil, 0, ErrMatchInitStateNil } if err := r.matchRegistry.UpdateMatchLabel(r.id, r.tickRate, r.module, label, r.createTime); err != nil { return nil, 0, err Loading server/runtime_javascript_match_core.go +3 −0 Original line number Diff line number Diff line Loading @@ -230,6 +230,9 @@ func (rm *RuntimeJavaScriptMatchCore) MatchInit(presenceList *MatchPresenceList, if !ok { return nil, 0, errors.New("matchInit is expected to return an object with a 'state' property") } if state == nil { return nil, 0, ErrMatchInitStateNil } if err := rm.matchRegistry.UpdateMatchLabel(rm.id, rm.tickRate, rm.module, label, rm.createTime); err != nil { return nil, 0, err Loading server/runtime_lua_match_core.go +3 −0 Original line number Diff line number Diff line Loading @@ -261,6 +261,9 @@ func (r *RuntimeLuaMatchCore) MatchInit(presenceList *MatchPresenceList, deferMe if state.Type() == LTSentinel { return nil, 0, errors.New("match_init returned unexpected first value, must be a state") } if state.Type() == lua.LTNil { return nil, 0, ErrMatchInitStateNil } r.vm.Pop(1) // Drop the sentinel value from the stack. Loading Loading
server/match_handler.go +2 −5 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ import ( "go.uber.org/zap" ) var ErrMatchInitStateNil = errors.New("Match initial state must not be nil") type MatchDataMessage struct { UserID uuid.UUID SessionID uuid.UUID Loading Loading @@ -131,11 +133,6 @@ func NewMatchHandler(logger *zap.Logger, config Config, sessionRegistry SessionR core.Cleanup() return nil, err } if state == nil { core.Cancel() core.Cleanup() return nil, errors.New("Match initial state must not be nil") } // Construct the match. mh := &MatchHandler{ Loading
server/runtime_go_match_core.go +3 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,9 @@ func (r *RuntimeGoMatchCore) MatchInit(presenceList *MatchPresenceList, deferMes return nil, 0, errors.New("MatchInit returned invalid tick rate, must be between 1 and 60") } r.tickRate = tickRate if state == nil { return nil, 0, ErrMatchInitStateNil } if err := r.matchRegistry.UpdateMatchLabel(r.id, r.tickRate, r.module, label, r.createTime); err != nil { return nil, 0, err Loading
server/runtime_javascript_match_core.go +3 −0 Original line number Diff line number Diff line Loading @@ -230,6 +230,9 @@ func (rm *RuntimeJavaScriptMatchCore) MatchInit(presenceList *MatchPresenceList, if !ok { return nil, 0, errors.New("matchInit is expected to return an object with a 'state' property") } if state == nil { return nil, 0, ErrMatchInitStateNil } if err := rm.matchRegistry.UpdateMatchLabel(rm.id, rm.tickRate, rm.module, label, rm.createTime); err != nil { return nil, 0, err Loading
server/runtime_lua_match_core.go +3 −0 Original line number Diff line number Diff line Loading @@ -261,6 +261,9 @@ func (r *RuntimeLuaMatchCore) MatchInit(presenceList *MatchPresenceList, deferMe if state.Type() == LTSentinel { return nil, 0, errors.New("match_init returned unexpected first value, must be a state") } if state.Type() == lua.LTNil { return nil, 0, ErrMatchInitStateNil } r.vm.Pop(1) // Drop the sentinel value from the stack. Loading