mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-23 12:42:22 -04:00
Move logic for determining user type into player class, change Packet.UserType to allow user type as an argument
This commit is contained in:
parent
cbbca857d4
commit
1beb8de57b
@ -90,7 +90,8 @@ namespace MCGalaxy.Commands.Moderation {
|
||||
who.SetPrefix();
|
||||
|
||||
Entities.DespawnEntities(who, false);
|
||||
who.Send(Packet.UserType(who));
|
||||
who.Send(Packet.UserType(who, who.UserType()));
|
||||
|
||||
who.SendCurrentBlockPermissions();
|
||||
Entities.SpawnEntities(who, false);
|
||||
CheckBlockBindings(who);
|
||||
|
@ -40,7 +40,7 @@ namespace MCGalaxy.Network {
|
||||
NetUtils.Write(motd, buffer, 66, p.hasCP437);
|
||||
}
|
||||
|
||||
buffer[130] = p.group.Blocks[Block.Bedrock] ? (byte)100 : (byte)0;
|
||||
buffer[130] = p.UserType();
|
||||
return buffer;
|
||||
}
|
||||
|
||||
@ -108,11 +108,8 @@ namespace MCGalaxy.Network {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
public static byte[] UserType(Player p) {
|
||||
byte[] buffer = new byte[2];
|
||||
buffer[0] = Opcode.SetPermission;
|
||||
buffer[1] = p.group.Blocks[Block.Bedrock] ? (byte)100 : (byte)0;
|
||||
return buffer;
|
||||
public static byte[] UserType(Player p, byte type) {
|
||||
return new byte[] { Opcode.SetPermission, type };
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -311,6 +311,8 @@ namespace MCGalaxy {
|
||||
return true;
|
||||
}
|
||||
|
||||
internal byte UserType() { return group.Blocks[Block.Bedrock] ? (byte)100 : (byte)0; }
|
||||
|
||||
#endregion
|
||||
|
||||
public void BlockUntilLoad(int sleep) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user