-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EXILED::API]
Adding SendFakeSceneLoading
#45
Changes from 4 commits
40c7b0a
a6eb938
2b39320
7390d42
a686c6f
dd7f6b3
1df5811
6181e61
3e747a0
d64dc26
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="ScenesType.cs" company="Exiled Team"> | ||
// Copyright (c) Exiled Team. All rights reserved. | ||
// Licensed under the CC BY-SA 3.0 license. | ||
// </copyright> | ||
// ----------------------------------------------------------------------- | ||
|
||
namespace Exiled.API.Enums | ||
{ | ||
/// <summary> | ||
/// Unique identifier for the different types of Scenes the client and server can load. | ||
/// </summary> | ||
public enum ScenesType | ||
{ | ||
/// <summary> | ||
/// The facility itself. | ||
/// </summary> | ||
Facility, | ||
|
||
/// <summary> | ||
/// The current main menu. | ||
/// ! Will cause crash when trying joining servers ! | ||
/// </summary> | ||
NewMainMenu, | ||
|
||
/// <summary> | ||
/// The old main menu. | ||
/// </summary> | ||
MainMenuRemastered, | ||
|
||
/// <summary> | ||
/// The old server list. | ||
/// </summary> | ||
FastMenu, | ||
|
||
/// <summary> | ||
/// The loading Screen. | ||
/// ! Will cause crash when trying joining servers ! | ||
/// </summary> | ||
PreLoader, | ||
|
||
/// <summary> | ||
/// A black menu before loading the <see cref="NewMainMenu"/>. | ||
/// </summary> | ||
Loader, | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
using System.Reflection; | ||
using System.Reflection.Emit; | ||
using System.Text; | ||
|
||
using Exiled.API.Enums; | ||
Check failure on line 17 in EXILED/Exiled.API/Extensions/MirrorExtensions.cs GitHub Actions / build
Check failure on line 17 in EXILED/Exiled.API/Extensions/MirrorExtensions.cs GitHub Actions / build
Check failure on line 17 in EXILED/Exiled.API/Extensions/MirrorExtensions.cs GitHub Actions / build
Check failure on line 17 in EXILED/Exiled.API/Extensions/MirrorExtensions.cs GitHub Actions / build
Check failure on line 17 in EXILED/Exiled.API/Extensions/MirrorExtensions.cs GitHub Actions / build
|
||
using Features; | ||
using Features.Pools; | ||
|
||
|
@@ -342,6 +342,35 @@ | |
} | ||
} | ||
|
||
/// <summary> | ||
/// Sends to the player a Fake Change Scene. | ||
/// </summary> | ||
/// <param name="player">The player to send the Scene</param> | ||
/// <param name="newSceneName">The new Scene the client will load.</param> | ||
public static void SendFakeSceneLoading(this Player player, ScenesType newSceneName) | ||
{ | ||
SceneMessage message = new() | ||
{ | ||
sceneName = newSceneName.ToString(), | ||
}; | ||
|
||
player.Connection.Send(message); | ||
} | ||
|
||
/// <summary> | ||
/// Emulation of the method SCP:SL uses to change scene. | ||
Check failure on line 361 in EXILED/Exiled.API/Extensions/MirrorExtensions.cs GitHub Actions / build
Check failure on line 361 in EXILED/Exiled.API/Extensions/MirrorExtensions.cs GitHub Actions / build
Check failure on line 361 in EXILED/Exiled.API/Extensions/MirrorExtensions.cs GitHub Actions / build
Check failure on line 361 in EXILED/Exiled.API/Extensions/MirrorExtensions.cs GitHub Actions / build
Check failure on line 361 in EXILED/Exiled.API/Extensions/MirrorExtensions.cs GitHub Actions / build
|
||
/// </summary> | ||
/// <param name="scene">The new Scene the client will load.</param> | ||
public static void ChangeSceneToAllClients(ScenesType scene) | ||
{ | ||
SceneMessage message = new() | ||
{ | ||
sceneName = scene.ToString(), | ||
}; | ||
|
||
NetworkServer.SendToAll(message); | ||
} | ||
|
||
/// <summary> | ||
/// Send fake values to client's <see cref="SyncVarAttribute"/>. | ||
/// </summary> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not useless?