Skip to content
This repository was archived by the owner on Jun 23, 2023. It is now read-only.

Commit eccb2b8

Browse files
committed
Fix chat crash. Refactor reserved slot system. Admins and whitelisted players can simply bypass the player limit set on the server.
1 parent 6835df0 commit eccb2b8

File tree

7 files changed

+248
-305
lines changed

7 files changed

+248
-305
lines changed

EssentialsPlugin.sln.DotSettings

Lines changed: 0 additions & 74 deletions
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
//421
1+
//430
22
//
33
// This code was generated by a tool. Any changes made manually will be lost
44
// the next time this code is regenerated.
55
//
66

77
using System.Reflection;
88

9-
[assembly: AssemblyFileVersion("1.13.7.421")]
10-
[assembly: AssemblyVersion("1.13.7.421")]
9+
[assembly: AssemblyFileVersion("1.13.7.430")]
10+
[assembly: AssemblyVersion("1.13.7.430")]

EssentialsPlugin/Essentials.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -951,21 +951,21 @@ public bool ReservedSlotsEnabled
951951
}
952952
}
953953

954-
[Category( "Reserved Slots" )]
955-
[Description( "Number of slots to reserve." )]
956-
[Browsable( true )]
957-
[ReadOnly( false )]
958-
public int ReservedSlotsCount
959-
{
960-
get
961-
{
962-
return PluginSettings.Instance.ReservedSlotsCount;
963-
}
964-
set
965-
{
966-
PluginSettings.Instance.ReservedSlotsCount = value;
967-
}
968-
}
954+
//[Category( "Reserved Slots" )]
955+
//[Description( "Number of slots to reserve." )]
956+
//[Browsable( true )]
957+
//[ReadOnly( false )]
958+
//public int ReservedSlotsCount
959+
//{
960+
// get
961+
// {
962+
// return PluginSettings.Instance.ReservedSlotsCount;
963+
// }
964+
// set
965+
// {
966+
// PluginSettings.Instance.ReservedSlotsCount = value;
967+
// }
968+
//}
969969

970970
[Category( "Reserved Slots" )]
971971
[Description( "Group ID number. Players in this group can occupy a reserved slot." )]

EssentialsPlugin/NetworkHandlers/SyncPropertyHandler.cs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -61,44 +61,44 @@ public override bool Handle( ulong remoteUserId, CallSite site, BitStream stream
6161
{
6262
//TODO
6363
return false;
64-
MyPropertySyncStateGroup sync = (MyPropertySyncStateGroup)obj;
64+
//MyPropertySyncStateGroup sync = (MyPropertySyncStateGroup)obj;
6565

66-
var properties = (ListReader<SyncBase>)sync.GetType().GetField("m_properties", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(sync);
66+
//var properties = (ListReader<SyncBase>)sync.GetType().GetField("m_properties", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(sync);
6767

68-
byte index = 0;
69-
BitReaderWriter bits = new BitReaderWriter();
68+
//byte index = 0;
69+
//BitReaderWriter bits = new BitReaderWriter();
7070

71-
Serialize(site.MethodInfo, stream, ref index, ref bits);
71+
//Serialize(site.MethodInfo, stream, ref index, ref bits);
7272

73-
MyTerminalBlock entity = null;
73+
//MyTerminalBlock entity = null;
7474

75-
MyExternalReplicable<MySyncedBlock> rep = sync.Owner as MyExternalReplicable<MySyncedBlock>;
75+
//MyExternalReplicable<MySyncedBlock> rep = sync.Owner as MyExternalReplicable<MySyncedBlock>;
7676

77-
if ( rep == null )
78-
{
79-
//there are lots of reasons this wouldn't be MySyncedBlock, so just ignore it and move on
80-
return false;
81-
}
77+
//if ( rep == null )
78+
//{
79+
// //there are lots of reasons this wouldn't be MySyncedBlock, so just ignore it and move on
80+
// return false;
81+
//}
8282

83-
entity = rep.Instance as MyTerminalBlock;
83+
//entity = rep.Instance as MyTerminalBlock;
8484

85-
MyCubeGrid grid = entity?.CubeGrid;
85+
//MyCubeGrid grid = entity?.CubeGrid;
8686

87-
if ( grid == null )
88-
{
89-
Essentials.Log.Info( "Null grid in SyncPropertyHandler" );
90-
return false;
91-
}
87+
//if ( grid == null )
88+
//{
89+
// Essentials.Log.Info( "Null grid in SyncPropertyHandler" );
90+
// return false;
91+
//}
9292

9393

94-
Essentials.Log.Warn( $"{entity.CustomName} | {index} | {properties[index].ValueType}" );
94+
//Essentials.Log.Warn( $"{entity.CustomName} | {index} | {properties[index].ValueType}" );
9595

96-
if (entity is MyLandingGear)
97-
{
98-
//clients sometimes send updates for landing gear for no discernable reason?
99-
//just ignore it, it's mostly harmless
100-
return false;
101-
}
96+
//if (entity is MyLandingGear)
97+
//{
98+
// //clients sometimes send updates for landing gear for no discernable reason?
99+
// //just ignore it, it's mostly harmless
100+
// return false;
101+
//}
102102

103103
//bool found = false;
104104
//foreach ( ProtectedItem item in PluginSettings.Instance.ProtectedItems )

0 commit comments

Comments
 (0)