Esempio n. 1
0
        /// <summary> Sets fields / updates network handles based on the server 
        /// indicating it supports the given CPE extension. </summary>
        public void HandleEntry( string ext, int version, NetworkProcessor network )
        {
            ServerExtensionsCount--;

            if( ext == "HeldBlock" ) {
                sendHeldBlock = true;
            } else if( ext == "MessageTypes" ) {
                useMessageTypes = true;
            } else if( ext == "ExtPlayerList" ) {
                network.UsingExtPlayerList = true;
            } else if( ext == "PlayerClick" ) {
                network.UsingPlayerClick = true;
            } else if( ext == "EnvMapAppearance" ) {
                envMapVer = version;
                if( version == 1 ) return;
                network.Set( Opcode.CpeEnvSetMapApperance,
                            network.HandleEnvSetMapAppearance2, 73 );
            } else if( ext == "LongerMessages" ) {
                network.ServerSupportsPartialMessages = true;
            } else if( ext == "FullCP437" ) {
                network.ServerSupportsFullCP437 = true;
            } else if( ext == "BlockDefinitionsExt" ) {
                blockDefsExtVer = version;
                if( version == 1 ) return;
                network.Set( Opcode.CpeDefineBlockExt,
                            network.HandleDefineBlockExt, 88 );
            }
        }
Esempio n. 2
0
        /// <summary> Sets fields / updates network handles based on the server
        /// indicating it supports the given CPE extension. </summary>
        public void HandleEntry(string ext, int version, NetworkProcessor network)
        {
            ServerExtensionsCount--;

            if (ext == "HeldBlock")
            {
                sendHeldBlock = true;
            }
            else if (ext == "MessageTypes")
            {
                useMessageTypes = true;
            }
            else if (ext == "ExtPlayerList")
            {
                network.UsingExtPlayerList = true;
            }
            else if (ext == "PlayerClick")
            {
                network.UsingPlayerClick = true;
            }
            else if (ext == "EnvMapAppearance")
            {
                envMapVer = version;
                if (version == 1)
                {
                    return;
                }
                network.Set(Opcode.CpeEnvSetMapApperance,
                            network.HandleEnvSetMapAppearance2, 73);
            }
            else if (ext == "LongerMessages")
            {
                network.ServerSupportsPartialMessages = true;
            }
            else if (ext == "FullCP437")
            {
                network.ServerSupportsFullCP437 = true;
            }
            else if (ext == "BlockDefinitionsExt")
            {
                blockDefsExtVer = version;
                if (version == 1)
                {
                    return;
                }
                network.Set(Opcode.CpeDefineBlockExt,
                            network.HandleDefineBlockExt, 88);
            }
        }
Esempio n. 3
0
        public void Reset(Game game)
        {
            ServerExtensionsCount = 0;
            sendHeldBlock         = false; useMessageTypes = false;
            envMapVer             = 2; blockDefsExtVer = 2;
            needD3Fix             = false; game.UseCPEBlocks = false;

            NetworkProcessor network = (NetworkProcessor)game.Network;

            network.UsingExtPlayerList            = false;
            network.UsingPlayerClick              = false;
            network.ServerSupportsPartialMessages = false;
            network.ServerSupportsFullCP437       = false;

            network.Set(Opcode.CpeEnvSetMapApperance,
                        network.HandleEnvSetMapAppearance, 69);
            network.Set(Opcode.CpeDefineBlockExt,
                        network.HandleDefineBlockExt, 85);
        }