Esempio n. 1
0
        public object Connect(object[] args)
        {
            string name = ReturnValueConversions.SafeUnwrap <string>(args, 0);

            //Console.WriteLine(_caller + " connecting to " + name);
            MimanTing maybeTing = GetTingFromNameOrSourceCodeName(_tingRunner, name);

//			if (maybeTing is Character) {
//				_caller.Say("Can't connect to human " + name);
//				return new ReturnValue(-1);
//			} else
            if (maybeTing != null)
            {
                //_caller.PlaySound ("Modem");
                return(_caller.AddConnectionToTing(maybeTing));
            }
            else
            {
                if (_caller is Computer)
                {
                    (_caller as Computer).API_Print("Can't find " + name + " to connect to");
                }
                else
                {
                    _caller.Say("Can't find " + name + " to connect to", "");
                }
                return(-1f);
            }
        }
Esempio n. 2
0
        public float API_Connect(string name)
        {
            //Console.WriteLine(_caller + " connecting to " + name);
            MimanTing maybeTing = ConnectionAPI_Optimized.GetTingFromNameOrSourceCodeName(_tingRunner, name);             // _tingRunner.GetTingUnsafe (name) as MimanTing;

            if (maybeTing != null)
            {
                return(_caller.AddConnectionToTing(maybeTing));
            }
            else
            {
                string msg = "Can't find " + name + " to connect to";
                if (_caller is Computer)
                {
                    (_caller as Computer).API_Print(msg);
                }
                else
                {
                    _caller.Say(msg, "");
                }
                return(-1f);
            }
        }