Пример #1
0
        public void Handle(NetworkManager nm, Bot core)
        {
            core.RaiseInfoMessage("Connected to " + Name);
            core.RaiseInfoMessage("MOTD: " + Motd);

            if (Usertype >= 100)
                core.RaiseInfoMessage("You are an operator.");
        }
Пример #2
0
 public void Handle(NetworkManager nm, Bot core)
 {
     core.ClientWorld.BlockArray = new byte[0];
     core.RaiseInfoMessage("Incoming Level");
     core.RaiseLevelInit();
 }
Пример #3
0
        public void Handle(NetworkManager nm, Bot core)
        {
            if (!core.EnableCpe)
                core.RaiseErrorMessage("Protocol error: Received Extentry while CPE Disabled.");

            if (core.SentCpe)
                core.RaiseErrorMessage("Protocol error: Received ExtEntry after sending client extensions!");

            core.ReceivedExtensions += 1;

            if (core.ReceivedExtensions > core.Extensions)
                core.RaiseInfoMessage("Warning: Server sent more extensions than ExtInfo reported.");

            if (!core.ServerExtensions.ContainsKey(ExtName))
                core.ServerExtensions.Add(ExtName, Version);
            else
                core.RaiseErrorMessage("Protocol warning: Server sent ExtEntry of same name multiple times (" + ExtName + ")");

            core.raiseDebugMessage("Received ExtEntry: " + ExtName + " -- " + Version);

            if (core.ReceivedExtensions == core.Extensions)
                nm.SendCPE();
        }
Пример #4
0
        public void Handle(NetworkManager nm, Bot core)
        {
            File.WriteAllBytes("map.gz", core.ClientWorld.BlockArray);

            core.ClientWorld.BlockArray = GZip.UnGZip(core.ClientWorld.BlockArray) ??
                                          new byte[(SizeX * SizeY * SizeZ) + 4];

            var blockArraySize = BitConverter.ToInt32(new[] { core.ClientWorld.BlockArray[3], core.ClientWorld.BlockArray[2], core.ClientWorld.BlockArray[1], core.ClientWorld.BlockArray[0] }, 0);
            core.ClientWorld.RemoveSize();

            core.ClientWorld.MapSize = new Vector3S {X = SizeX, Y = SizeZ, Z = SizeY};

            core.RaiseInfoMessage("Map complete.");

            if ((SizeX * SizeY * SizeZ) != blockArraySize)
                core.RaiseErrorMessage(
                    $"Protocol Error: Map data length != Finalize length ({blockArraySize} - {(SizeX*SizeY*SizeZ)})");

            core.RaiseLevelComplete(SizeX, SizeY, SizeZ);

            //core.ClientWorld.WorldCheck(core);
        }