fix: stop tick room on delete

This commit is contained in:
2024-05-19 08:00:56 +03:00
parent 7a2196ff50
commit b84538b238
9 changed files with 84 additions and 20 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Eduard Kargin <kargin.eduard@gmail.com>
* Copyright 2023-2024 Eduard Kargin <kargin.eduard@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,12 +28,12 @@ public class BaseRoomPlugin: IRoomPlugin
{
Room = room;
}
public virtual void OnDetached()
public virtual void OnDetached(IRagonRoom room)
{
}
#region VIRTUAL
public virtual bool OnPlayerJoined(RagonRoomPlayer player)
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Eduard Kargin <kargin.eduard@gmail.com>
* Copyright 2023-2024 Eduard Kargin <kargin.eduard@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@ public interface IRoomPlugin
{
void Tick(float dt);
void OnAttached(IRagonRoom room);
void OnDetached();
void OnDetached(IRagonRoom room);
bool OnPlayerJoined(RagonRoomPlayer player);
bool OnPlayerLeaved(RagonRoomPlayer player);
bool OnEntityCreate(RagonRoomPlayer player, IRagonEntity entity);
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Eduard Kargin <kargin.eduard@gmail.com>
* Copyright 2023-2024 Eduard Kargin <kargin.eduard@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,11 +39,11 @@ public class RagonWebHookPlugin
_server = server;
}
public bool RequestAuthorization(RagonContext context, string name, string password)
public bool RequestAuthorization(RagonContext context, string payload)
{
if (_webHooks.TryGetValue("authorization-request", out var value))
{
var httpContent = new StringContent("");
var httpContent = new StringContent(payload, Encoding.UTF8, "application/json");
var executor = context.Executor;
executor.Run(async () =>
{