示例#1
0
        public void removePlayerClient(IOClient client)
        {
            Player cli;
              //      add.TryRemove(client, out cli);
            if (client.player != null)
                World.SendToAll(new QueDele(client.player.Map, new DeleteObject(client.player.Serial).Compile()));

            Console.WriteLine("Players Online: " + add.Count);
        }
示例#2
0
        public static LKCamelot.model.Player LoadPlayer(io.IOClient client, string name)
        {
            lock (readPlayerlock)
            {
                LKCamelot.model.Player ret = null;
                using (StreamReader sr = new StreamReader("worldsavePl.txt"))
                {
                    while (!sr.EndOfStream)
                    {
                        string[] line = sr.ReadLine().Split(',');
                        if (line[1] != name)
                        {
                            continue;
                        }

                        ret = new LKCamelot.model.Player(client);

                        ret.Serial       = Convert.ToInt32(line[0]);
                        ret.Name         = line[1];
                        ret.Pass         = line[2];
                        ret.Class        = (LKCamelot.library.Class)Convert.ToInt32(line[3]);
                        ret.Stage        = (byte)Convert.ToInt32(line[4]);
                        ret.LightRad     = (byte)Convert.ToInt32(line[5]);
                        ret.Transparancy = (byte)Convert.ToInt32(line[6]);
                        ret.Map          = line[7];
                        ret.Loc          = new model.Point2D(Convert.ToInt32(line[8]), Convert.ToInt32(line[9]));
                        ret.Face         = (byte)Convert.ToInt32(line[10]);
                        ret.apStr        = (ushort)Convert.ToInt32(line[11]);
                        ret.apMen        = (ushort)Convert.ToInt32(line[12]);
                        ret.apDex        = (ushort)Convert.ToInt32(line[13]);
                        ret.apVit        = (ushort)Convert.ToInt32(line[14]);
                        ret.m_Extra      = (ushort)Convert.ToInt32(line[15]);
                        ret.m_HP         = (ushort)Convert.ToInt32(line[16]);
                        ret.m_HPCur      = (ushort)Convert.ToInt32(line[17]);
                        ret.m_MP         = (ushort)Convert.ToInt32(line[18]);
                        ret.m_MPCur      = Convert.ToInt32(line[19]);
                        ret.m_Level      = (short)Convert.ToInt32(line[20]);
                        ret.m_XP         = Convert.ToInt32(line[21]);
                        ret.m_Gold       = Convert.ToUInt64(line[22]);
                        ret.LoadMagic(line[23]);
                        ret.guildName   = line[24];
                        ret.guildTitle  = line[25];
                        ret.m_Point     = Convert.ToUInt64(line[26]);
                        ret.m_Tun       = Convert.ToUInt64(line[27]);
                        ret.Bday        = line[28];
                        ret.m_Bank      = Convert.ToUInt64(line[29]);
                        ret.NormalXp    = Convert.ToBoolean(line[30]);
                        ret.NormalXp    = Convert.ToBoolean(line[31]);
                        ret.ACbuff_time = (int)Convert.ToInt32(line[32]);
                    }
                }
                return(ret);
            }
        }
示例#3
0
        public void newPlayerClient(IOClient client)
        {
            try
            {
                client.handler = this;
            }
            catch (Exception e)
            {
                Console.WriteLine("E at newplayerclient", e.ToString());
            }

               //     add.TryAdd(client, null);
            Console.WriteLine("Players Online: " + add.Count);
        }
示例#4
0
文件: Server.cs 项目: vans163/LKEmu
        public void OnConnecte(object sender, ConnectionEventArgs e)
        {
            //      Logger.Trace("Game-Client connected: {0}", e.Connection.ToString());

            var gameClient = new IOClient(e.Connection);
            e.Connection.Client = gameClient;
            e.Connection.Client.keepalive = Server.tickcount.ElapsedMilliseconds;
            gameClient.handler = playerHandler;
            Console.WriteLine("Connections O: " + Connections.Count);
              //  playerHandler.newPlayerClient(gameClient);
        }