示例#1
0
        public static void LoadCharacter(RicePacket packet)
        {
            string characterName = packet.Reader.ReadUnicode();

            var ack = new RicePacket(124);

            var ackStruct = new Structures.LoadCharAck
            {
                CharInfo = new Structures.CharInfo
                {
                    Avatar   = 1,
                    Name     = "charName",
                    Cid      = 1,
                    City     = 1,
                    CurCarId = 1,
                    ExpInfo  = new Structures.ExpInfo
                    {
                        BaseExp = 0,
                        CurExp  = 0,
                        NextExp = 0
                    },
                    HancoinGarage = 1,
                    Level         = 80,
                    TeamId        = 1,
                    TeamName      = "Staff",
                    MitoMoney     = 123456789
                },
                nCarSize = 1,
                CarInfo  = new List <Structures.CarInfo>()
                {
                    new Structures.CarInfo
                    {
                        AuctionOn = false,
                        CarUnit   = new Structures.CarUnit
                        {
                            AuctionCnt = 0,
                            BaseColor  = 0,
                            CarID      = 1,
                            CarType    = 24,
                            Grade      = 9,
                            Mitron     = 0.00f,
                            Kmh        = 200,
                            SlotType   = 0
                        },
                        Color            = 0,
                        MitronCapacity   = 0.00f,
                        MitronEfficiency = 0.00f
                    }
                }
            };

            ack.Writer.Write(ackStruct);

            packet.Sender.Send(ack);
            Log.WriteLine("Sent LoadCharAck");
        }
示例#2
0
        public static void LoadCharacter(RicePacket packet)
        {
            string characterName = packet.Reader.ReadUnicode();

            var ack = new RicePacket(124);

            var ackStruct = new Structures.LoadCharAck
            {
                CharInfo = new Structures.CharInfo
                {
                    Avatar = 1,
                    Name = "charName",
                    Cid = 1,
                    City = 1,
                    CurCarId = 1,
                    ExpInfo = new Structures.ExpInfo
                    {
                        BaseExp = 0,
                        CurExp = 0,
                        NextExp = 0
                    },
                    HancoinGarage = 1,
                    Level = 80,
                    TeamId = 1,
                    TeamName = "Staff",
                    MitoMoney = 123456789
                },
                nCarSize = 1,
                CarInfo = new List<Structures.CarInfo>()
                {
                    new Structures.CarInfo
                    {
                        AuctionOn = false,
                        CarUnit = new Structures.CarUnit
                        {
                            AuctionCnt = 0,
                            BaseColor = 0,
                            CarID = 1,
                            CarType = 24,
                            Grade = 9,
                            Mitron = 0.00f,
                            Kmh = 200,
                            SlotType = 0
                        },
                        Color = 0,
                        MitronCapacity = 0.00f,
                        MitronEfficiency = 0.00f
                    }
                }
            };
            ack.Writer.Write(ackStruct);

            packet.Sender.Send(ack);
            Log.WriteLine("Sent LoadCharAck");
        }
示例#3
0
        public static void LoadCharacter(RicePacket packet)
        {
            string characterName = packet.Reader.ReadUnicode();

            packet.Sender.Player.ActiveCharacter = null;

            foreach (var c in packet.Sender.Player.Characters)
            {
                if (c.Name == characterName)
                {
                    packet.Sender.Player.ActiveCharacter = c;
                }
            }

            if (packet.Sender.Player.ActiveCharacter == null)
            {
                Log.WriteLine("Rejecting {0} for invalid user-character combination.", packet.Sender.Player.User.Name);
                packet.Sender.Error("you_tried.avi");
                return;
            }

            var character = packet.Sender.Player.ActiveCharacter;
            var ack       = new RicePacket(124);

            var ackStruct = new Structures.LoadCharAck
            {
                CharInfo = character.GetInfo(),
                nCarSize = (uint)character.Garage.Count,
                CarInfo  = character.Garage.Select(v => v.GetInfo()).ToList()
            };

            ack.Writer.Write(ackStruct);
            packet.Sender.Send(ack);
            Log.WriteLine("Sent LoadCharAck");

            var stat = new RicePacket(760); // StatUpdate

            for (int i = 0; i < 16; ++i)
            {
                stat.Writer.Write(0);
            }
            stat.Writer.Write(1000);
            stat.Writer.Write(9001);
            stat.Writer.Write(9002);
            stat.Writer.Write(9003);
            stat.Writer.Write(new byte[76]);
            packet.Sender.Send(stat);
        }
示例#4
0
        public static void LoadCharacter(RicePacket packet)
        {
            string characterName = packet.Reader.ReadUnicode();

            var character = Rice.Game.Character.Retrieve(characterName); // TODO: verify this
            var user      = Rice.Game.User.Retrieve(character.UID);

            packet.Sender.Player                 = new Rice.Game.Player(user);
            packet.Sender.Player.Characters      = Rice.Game.Character.Retrieve(user.UID);
            packet.Sender.Player.ActiveCharacter = character;

            var ack = new RicePacket(124);

            var ackStruct = new Structures.LoadCharAck
            {
                CharInfo = character.GetInfo(),
                nCarSize = 1,
                CarInfo  = new List <Structures.CarInfo>()
                {
                    new Structures.CarInfo
                    {
                        AuctionOn = false,
                        CarUnit   = new Structures.CarUnit
                        {
                            AuctionCnt = 0,
                            BaseColor  = 0,
                            CarID      = 1,
                            CarType    = 24,
                            Grade      = 9,
                            Mitron     = 0.00f,
                            Kmh        = 200,
                            SlotType   = 0
                        },
                        Color            = 0,
                        MitronCapacity   = 0.00f,
                        MitronEfficiency = 0.00f
                    }
                }
            };

            ack.Writer.Write(ackStruct);

            packet.Sender.Send(ack);
            Log.WriteLine("Sent LoadCharAck");
        }
示例#5
0
        public static void LoadCharacter(RicePacket packet)
        {
            string characterName = packet.Reader.ReadUnicode();

            var character = Rice.Game.Character.Retrieve(characterName); // TODO: verify this
            var user = Rice.Game.User.Retrieve(character.UID);

            packet.Sender.Player = new Rice.Game.Player(user);
            packet.Sender.Player.Characters = Rice.Game.Character.Retrieve(user.UID);
            packet.Sender.Player.ActiveCharacter = character;

            var ack = new RicePacket(124);

            var ackStruct = new Structures.LoadCharAck
            {
                CharInfo = character.GetInfo(),
                nCarSize = 1,
                CarInfo = new List<Structures.CarInfo>()
                {
                    new Structures.CarInfo
                    {
                        AuctionOn = false,
                        CarUnit = new Structures.CarUnit
                        {
                            AuctionCnt = 0,
                            BaseColor = 0,
                            CarID = 1,
                            CarType = 24,
                            Grade = 9,
                            Mitron = 0.00f,
                            Kmh = 200,
                            SlotType = 0
                        },
                        Color = 0,
                        MitronCapacity = 0.00f,
                        MitronEfficiency = 0.00f
                    }
                }
            };
            ack.Writer.Write(ackStruct);

            packet.Sender.Send(ack);
            Log.WriteLine("Sent LoadCharAck");
        }