Example #1
0
        // Constructor 2#: Used for Direct Connection
        private XIVisi(string server, int port, string name, int avatar,
            int hopeTeam, bool record, bool watcher, bool msglog, AoDisplay ad)
        {
            this.server = server; this.port = port;
            this.name = name; this.avatar = avatar;
            this.hopeTeam = hopeTeam;

            VI = new VW.Cyvi(ad);
            VI.Init(); VI.SetInGame(true);
            VW.Bywi bywi = new VW.Bywi(server, port, name, avatar, hopeTeam, 0, this);
            WI = bywi;

            this.ad = ad;
            Log = new ClLog(); Log.Start(Uid, record, msglog, 0);
            CommonConstruct();
            if (!bywi.StartConnectDirect(watcher, VI))
            {
                VI.Cout(Uid, "咦,您是不是掉线或者连错人了:-(");
                auid = 0; return;
            }
            VI.Cout(Uid, watcher ? "您开始旁观~" : "游戏开始咯~");
            this.auid = bywi.Uid;
            if (watcher)
                Uid = bywi.Uid;
            bywi.Log = Log; VI.Log = Log;
            WI.Send("C2ST," + Uid, Uid, 0);
            isReplay = false;
        }