This repository has been archived by the owner on Jun 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Slight concealment fix. Stupidity with chat logging
- Loading branch information
Showing
7 changed files
with
1,831 additions
and
11 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
//116 | ||
//166 | ||
// | ||
// This code was generated by a tool. Any changes made manually will be lost | ||
// the next time this code is regenerated. | ||
// | ||
|
||
using System.Reflection; | ||
|
||
[assembly: AssemblyFileVersion("1.13.5.116")] | ||
[assembly: AssemblyVersion("1.13.5.116")] | ||
[assembly: AssemblyFileVersion("1.13.5.166")] | ||
[assembly: AssemblyVersion("1.13.5.166")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
namespace EssentialsPlugin.Utility | ||
{ | ||
using System; | ||
using System.Reflection; | ||
using Sandbox.Game.Multiplayer; | ||
using Sandbox.Game.World; | ||
using SEModAPIExtensions.API; | ||
|
||
public static class ChatHistory | ||
{ | ||
/// <summary> | ||
/// Adds incoming chat event into all players' global chat history. | ||
/// </summary> | ||
/// <param name="obj"></param> | ||
public static void AddChat( ChatManager.ChatEvent obj ) | ||
{ | ||
Assembly assembly = typeof( Sync ).Assembly; | ||
Type syncCharacter = assembly.GetType( "MySyncCharacter" ); | ||
MethodInfo globalMessageInfo = syncCharacter.GetMethod( "SendNewGlobalMessage", | ||
BindingFlags.Public | BindingFlags.Instance ); | ||
globalMessageInfo = globalMessageInfo.MakeGenericMethod( typeof( MyPlayer.PlayerId ), typeof( string ) ); | ||
MyPlayer.PlayerId id = new MyPlayer.PlayerId( obj.SourceUserId ); | ||
object classInstance = Activator.CreateInstance( syncCharacter ); | ||
globalMessageInfo.Invoke( classInstance, new object[ ] { new MyPlayer.PlayerId( obj.SourceUserId ), obj.Message } ); | ||
} | ||
} | ||
} |
Oops, something went wrong.