Пример #1
0
        // Constructor 1#: Used for Hall setting
        public XIVisi(ushort uid, string name, int teamCode, Base.VW.IVI vi,
            string server, int room, bool record, bool logmsg, bool watcher, AoDisplay ad)
        {
            this.auid = uid; this.name = name;
            this.VI = vi as VW.Cyvi;
            hopeTeam = teamCode;
            this.server = server;
            this.Room = room;
            this.port = Base.NetworkCode.HALL_PORT + room;

            this.ad = ad;
            VW.Bywi bywi = new VW.Bywi(server, port, name, avatar, hopeTeam, uid, this);
            Log = new ClLog(); Log.Start(auid, record, logmsg, 0);
            bywi.Log = Log;
            CommonConstruct();
            //if (VI is VW.Ayvi)
            //    (VI as VW.Ayvi).Log = Log;
            WI = bywi;
            if (!bywi.StartConnect(watcher))
                (vi as VW.Cyvi).ReportFlashQuitError();
            if (watcher)
                Uid = bywi.Uid;
            VI.Cout(uid, watcher ? "您开始旁观~" : "游戏开始咯~");
            isReplay = false;
        }
Пример #2
0
 // Constructor 2#: Used for SF setting, use decided WI and VI
 public XIClient(ushort uid, Base.VW.IWICL wi, Base.VW.IVI vi)
 {
     joined = true;
     this.auid = this.Uid = uid;
     WI = wi; VI = vi;
     this.hopeTeam = 0;
     Log = new ClLog(); Log.Start(auid, false, false, 0);
     CommonConstruct();
 }
Пример #3
0
        // Constructor 1#: Used for Hall setting
        public XIClient(ushort uid, string name, int teamCode, Base.VW.IVI vi,
            string server, int room, bool record, bool msglog, bool watcher)
        {
            joined = false;
            this.auid = uid; this.name = name; this.VI = vi;
            hopeTeam = teamCode;
            this.server = server;
            this.Room = room;
            this.port = Base.NetworkCode.HALL_PORT + room;

            VW.Bywi bywi = new VW.Bywi(server, port, name, avatar, hopeTeam, uid);
            Log = new ClLog(); Log.Start(auid, record, msglog, 0);
            bywi.Log = Log;
            if (VI is VW.Ayvi)
                (VI as VW.Ayvi).Log = Log;
            WI = bywi;
            if (!bywi.StartConnect(watcher))
            {
                VI.Cout(Uid, "哦我的上帝,真不敢想象连接竟然失败了。");
                auid = 0; return;
            }
            VI.Cout(Uid, watcher ? "您开始旁观~" : "游戏开始咯~");
            CommonConstruct();
        }
Пример #4
0
        // Constructor 3#: Used for Direct Connection
        private XIClient(string server, int port, string name,
            int avatar, int hopeTeam, bool record, bool msglog, bool watcher)
        {
            joined = false;
            this.server = server; this.port = port;
            this.name = name; this.avatar = avatar;
            this.hopeTeam = hopeTeam;

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

            Log = new ClLog(); Log.Start(Uid, record, msglog, 0);
            if (!bywi.StartConnectDirect(watcher, VI))
            {
                VI.Cout(Uid, "咦,您是不是掉线或者连错人了:-(");
                auid = 0; return;
            }
            VI.Cout(Uid, watcher ? "您开始旁观~" : "游戏开始咯~");
            this.auid = bywi.Uid;
            bywi.Log = Log; ayvi.Log = Log;
            WI.Send("C2ST," + Uid, Uid, 0);
            CommonConstruct();
        }
Пример #5
0
        // Constructor 4#: Used for ResumeHall
        // passCode is the password for a settled room
        private XIClient(ushort newUid, ushort oldUid, string name, Base.VW.IVI vi,
            string server, int room, string passCode, bool record, bool msglog)
        {
            joined = false;
            this.auid = newUid;
            this.name = name; this.VI = vi;
            this.server = server;
            this.Room = room;
            this.port = Base.NetworkCode.HALL_PORT + room;

            VW.Bywi bywi = new VW.Bywi(server, port, name, avatar, hopeTeam = 0, newUid);
            Log = new ClLog(); Log.Start(auid, record, msglog, 0);
            bywi.Log = Log;
            if (VI is VW.Ayvi)
                (VI as VW.Ayvi).Log = Log;
            WI = bywi; bywi.StartConnectResume(oldUid, passCode);
            // After that, Uid get updated.
            this.Uid = bywi.Uid;
            VI.Cout(Uid, "游戏继续啦~");

            CommonConstruct();
        }
Пример #6
0
        // Constructor 3#: Used for Replay mode
        public XIVisi(string fileName, AoDisplay ad)
        {
            VI = new VW.Cyvi(ad);
            VI.Init(); VI.SetInGame(true);
            VW.Eywi eywi = new VW.Eywi(fileName);
            WI = eywi;

            this.ad = ad;
            Log = new ClLog(); Log.Start(Uid, false, false, 0);
            CommonConstruct();
            this.auid = eywi.Uid;
            isReplay = true;
        }
Пример #7
0
        // Constructor 4#: Used for ResumeHall
        // passCode is the password for a settled room
        private XIVisi(ushort newUid, ushort oldUid, string name, Base.VW.IVI vi,
            string server, int room, string passCode, bool record, bool msglog, AoDisplay ad)
        {
            this.auid = newUid;
            this.name = name; this.VI = vi as VW.Cyvi;
            this.server = server;
            this.Room = room;
            this.port = Base.NetworkCode.HALL_PORT + room;
            this.ad = ad;

            VW.Bywi bywi = new VW.Bywi(server, port, name, avatar, hopeTeam = 0, newUid, this);
            Log = new ClLog(); Log.Start(auid, record, msglog, 0);
            bywi.Log = Log; VI.Log = Log;
            WI = bywi;
            CommonConstruct();
            bywi.StartConnectResume(oldUid, passCode);
            // After that, Uid get updated.
            this.Uid = bywi.Uid;
            VI.Cout(Uid, "游戏继续啦~");
            isReplay = false;
        }
Пример #8
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;
        }