@@ -158,11 +158,11 @@ func NewRuntimeProviderLua(logger, startupLogger *zap.Logger, db *sql.DB, protoj
158
158
159
159
matchProvider .RegisterCreateFn ("lua" ,
160
160
func (ctx context.Context , logger * zap.Logger , id uuid.UUID , node string , stopped * atomic.Bool , name string ) (RuntimeMatchCore , error ) {
161
- return NewRuntimeLuaMatchCore (logger , name , db , protojsonMarshaler , protojsonUnmarshaler , config , socialClient , leaderboardCache , leaderboardRankCache , leaderboardScheduler , sessionRegistry , sessionCache , matchRegistry , tracker , streamManager , router , stdLibs , once , localCache , eventFn , nil , nil , id , node , stopped , name , matchProvider )
161
+ return NewRuntimeLuaMatchCore (logger , name , db , protojsonMarshaler , protojsonUnmarshaler , config , socialClient , leaderboardCache , leaderboardRankCache , leaderboardScheduler , sessionRegistry , sessionCache , matchRegistry , tracker , metrics , streamManager , router , stdLibs , once , localCache , eventFn , nil , nil , id , node , stopped , name , matchProvider )
162
162
},
163
163
)
164
164
165
- r , err := newRuntimeLuaVM (logger , db , protojsonMarshaler , protojsonUnmarshaler , config , socialClient , leaderboardCache , leaderboardRankCache , leaderboardScheduler , sessionRegistry , sessionCache , matchRegistry , tracker , streamManager , router , stdLibs , moduleCache , once , localCache , matchProvider .CreateMatch , eventFn , func (execMode RuntimeExecutionMode , id string ) {
165
+ r , err := newRuntimeLuaVM (logger , db , protojsonMarshaler , protojsonUnmarshaler , config , socialClient , leaderboardCache , leaderboardRankCache , leaderboardScheduler , sessionRegistry , sessionCache , matchRegistry , tracker , metrics , streamManager , router , stdLibs , moduleCache , once , localCache , matchProvider .CreateMatch , eventFn , func (execMode RuntimeExecutionMode , id string ) {
166
166
switch execMode {
167
167
case RuntimeExecutionModeRPC :
168
168
rpcFunctions [id ] = func (ctx context.Context , headers , queryParams map [string ][]string , userID , username string , vars map [string ]string , expiry int64 , sessionID , clientIP , clientPort , lang , payload string ) (string , error , codes.Code ) {
@@ -1105,7 +1105,7 @@ func NewRuntimeProviderLua(logger, startupLogger *zap.Logger, db *sql.DB, protoj
1105
1105
r .Stop ()
1106
1106
1107
1107
runtimeProviderLua .newFn = func () * RuntimeLua {
1108
- r , err := newRuntimeLuaVM (logger , db , protojsonMarshaler , protojsonUnmarshaler , config , socialClient , leaderboardCache , leaderboardRankCache , leaderboardScheduler , sessionRegistry , sessionCache , matchRegistry , tracker , streamManager , router , stdLibs , moduleCache , once , localCache , matchProvider .CreateMatch , eventFn , nil )
1108
+ r , err := newRuntimeLuaVM (logger , db , protojsonMarshaler , protojsonUnmarshaler , config , socialClient , leaderboardCache , leaderboardRankCache , leaderboardScheduler , sessionRegistry , sessionCache , matchRegistry , tracker , metrics , streamManager , router , stdLibs , moduleCache , once , localCache , matchProvider .CreateMatch , eventFn , nil )
1109
1109
if err != nil {
1110
1110
logger .Fatal ("Failed to initialize Lua runtime" , zap .Error (err ))
1111
1111
}
@@ -2047,7 +2047,7 @@ func checkRuntimeLuaVM(logger *zap.Logger, config Config, stdLibs map[string]lua
2047
2047
vm .Push (lua .LString (name ))
2048
2048
vm .Call (1 , 0 )
2049
2049
}
2050
- nakamaModule := NewRuntimeLuaNakamaModule (nil , nil , nil , nil , config , nil , nil , nil , nil , nil , nil , nil , nil , nil , nil , nil , nil , nil , nil , nil , nil )
2050
+ nakamaModule := NewRuntimeLuaNakamaModule (nil , nil , nil , nil , config , nil , nil , nil , nil , nil , nil , nil , nil , nil , nil , nil , nil , nil , nil , nil , nil , nil )
2051
2051
vm .PreloadModule ("nakama" , nakamaModule .Loader )
2052
2052
2053
2053
preload := vm .GetField (vm .GetField (vm .Get (lua .EnvironIndex ), "package" ), "preload" )
@@ -2068,7 +2068,7 @@ func checkRuntimeLuaVM(logger *zap.Logger, config Config, stdLibs map[string]lua
2068
2068
return nil
2069
2069
}
2070
2070
2071
- func newRuntimeLuaVM (logger * zap.Logger , db * sql.DB , protojsonMarshaler * protojson.MarshalOptions , protojsonUnmarshaler * protojson.UnmarshalOptions , config Config , socialClient * social.Client , leaderboardCache LeaderboardCache , rankCache LeaderboardRankCache , leaderboardScheduler LeaderboardScheduler , sessionRegistry SessionRegistry , sessionCache SessionCache , matchRegistry MatchRegistry , tracker Tracker , streamManager StreamManager , router MessageRouter , stdLibs map [string ]lua.LGFunction , moduleCache * RuntimeLuaModuleCache , once * sync.Once , localCache * RuntimeLuaLocalCache , matchCreateFn RuntimeMatchCreateFunction , eventFn RuntimeEventCustomFunction , announceCallbackFn func (RuntimeExecutionMode , string )) (* RuntimeLua , error ) {
2071
+ func newRuntimeLuaVM (logger * zap.Logger , db * sql.DB , protojsonMarshaler * protojson.MarshalOptions , protojsonUnmarshaler * protojson.UnmarshalOptions , config Config , socialClient * social.Client , leaderboardCache LeaderboardCache , rankCache LeaderboardRankCache , leaderboardScheduler LeaderboardScheduler , sessionRegistry SessionRegistry , sessionCache SessionCache , matchRegistry MatchRegistry , tracker Tracker , metrics Metrics , streamManager StreamManager , router MessageRouter , stdLibs map [string ]lua.LGFunction , moduleCache * RuntimeLuaModuleCache , once * sync.Once , localCache * RuntimeLuaLocalCache , matchCreateFn RuntimeMatchCreateFunction , eventFn RuntimeEventCustomFunction , announceCallbackFn func (RuntimeExecutionMode , string )) (* RuntimeLua , error ) {
2072
2072
vm := lua .NewState (lua.Options {
2073
2073
CallStackSize : config .GetRuntime ().GetLuaCallStackSize (),
2074
2074
RegistrySize : config .GetRuntime ().GetLuaRegistrySize (),
@@ -2104,7 +2104,7 @@ func newRuntimeLuaVM(logger *zap.Logger, db *sql.DB, protojsonMarshaler *protojs
2104
2104
callbacks .LeaderboardReset = fn
2105
2105
}
2106
2106
}
2107
- nakamaModule := NewRuntimeLuaNakamaModule (logger , db , protojsonMarshaler , protojsonUnmarshaler , config , socialClient , leaderboardCache , rankCache , leaderboardScheduler , sessionRegistry , sessionCache , matchRegistry , tracker , streamManager , router , once , localCache , matchCreateFn , eventFn , registerCallbackFn , announceCallbackFn )
2107
+ nakamaModule := NewRuntimeLuaNakamaModule (logger , db , protojsonMarshaler , protojsonUnmarshaler , config , socialClient , leaderboardCache , rankCache , leaderboardScheduler , sessionRegistry , sessionCache , matchRegistry , tracker , metrics , streamManager , router , once , localCache , matchCreateFn , eventFn , registerCallbackFn , announceCallbackFn )
2108
2108
vm .PreloadModule ("nakama" , nakamaModule .Loader )
2109
2109
r := & RuntimeLua {
2110
2110
logger : logger ,
0 commit comments