/// <summary>
 /// Sends a message from a user to all users in the room
 /// </summary>
 /// <param name="user">User who sent the message</param>
 /// <param name="message">The message</param>
 public virtual void OnChat(ExteelUser user, string message)
 {
     if (BeforeChat(user, message))
     {
         RoomInstance.MulticastPacket(new Message(user.Callsign, message));
     }
 }
Exemplo n.º 2
0
        public SendUnit(ExteelUser user, UnitRecord unit)
        {
            HighPriority = true;

            _unit = unit;
            _user = user;
        }
Exemplo n.º 3
0
        public UserInfo(GameInstance room, ExteelUser user)
        {
            HighPriority = true;

            _user = user;
            _room = room;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Sends a message from a user to all users in the room
        /// </summary>
        /// <param name="user">User who sent the message</param>
        /// <param name="message">The message</param>
        public virtual void OnChat(ExteelUser user, string message)
        {
            $"[CHAT] {user}: {message}".Debug();

            if (BeforeChat(user, message))
            {
                RoomInstance.MulticastPacket(new Message(user.Callsign, message));
            }
        }
Exemplo n.º 5
0
 public SendParts(ExteelUser user) : base(user)
 {
     HighPriority = true;
 }
Exemplo n.º 6
0
 public SendOperatorList(ExteelUser user) : base(user)
 {
     HighPriority = true;
 }
 public MsgUserStateInfo(ExteelUser user)
 {
     _user = user;
 }
Exemplo n.º 8
0
 public MsgUserJoinedChannel(ExteelUser user, int channelId)
 {
     _user      = user;
     _channelId = channelId;
 }
        public static void WriteRoomUserInfo(this ServerBasePacket packet, RoomInstance room, ExteelUser user)
        {
            packet.WriteString(user.Callsign); // Unknown - Looks like 2x callsign from packet cap
            packet.WriteString(user.Callsign);
            packet.WriteString("");            // Clan name

            packet.WriteInt(0);                // Unknown
            packet.WriteInt(0);                // Unknown - clan id?

            packet.WriteInt(user.Id);
            packet.WriteUInt(user.Team);

            packet.WriteUInt(user.Rank); // Unknown
            packet.WriteInt(0);          // Unknown
            packet.WriteInt(0);          // Unknown
            packet.WriteInt(0);          // Unknown
            packet.WriteInt(0);          // Unknown
            packet.WriteInt(0);          // Unknown


            packet.WriteBool(user.IsReady); // Unknown - ready?
            packet.WriteBool(user.Id == room.MasterId);

            for (var i = 0; i < 13; i++)
            {
                packet.WriteInt(0); //Unknown
            }

            for (var i = 0; i < 12; i++)
            {
                packet.WriteInt(0); //Unknown
            }

            for (var i = 0; i < 13; i++)
            {
                packet.WriteInt(0); //Unknown
            }

            for (var i = 0; i < 14; i++)
            {
                packet.WriteInt(0); // Unknown
            }

            for (var i = 0; i < 11; i++)
            {
                packet.WriteInt(0); // Unknown
            }

            for (var i = 0; i < 11; i++)
            {
                packet.WriteInt(0); // Unknown
            }

            // Unknown struct
            packet.WriteInt(0); //
            packet.WriteInt(0); //
            packet.WriteInt(0); //
            packet.WriteInt(0); //
            packet.WriteInt(0); //
            packet.WriteInt(0); //
            packet.WriteInt(0); //
            packet.WriteInt(0); //

            // Another unknown struct. Seems to be an array?
            packet.WriteInt(0); // Size?



            packet.WritePilotInfo(user.PilotInfo);
        }
Exemplo n.º 10
0
 public UserInfo(RoomInstance room, ExteelUser user)
 {
     _room = room;
     _user = user;
 }
Exemplo n.º 11
0
 public UserEnter(RoomInstance room, ExteelUser user)
 {
     _room = room;
     _user = user;
 }
Exemplo n.º 12
0
 public BuyListResult(ExteelUser user) : base(user)
 {
 }
Exemplo n.º 13
0
 public BestInfo(ExteelUser user)
 {
     _user = user;
 }
Exemplo n.º 14
0
 public UserExit(ExteelUser user)
 {
     _user = user;
 }
Exemplo n.º 15
0
 /// <summary>
 /// Called before an in game message is processed. Return false to block sending message
 /// </summary>
 /// <param name="user"></param>
 /// <param name="message"></param>
 /// <returns>Should send message</returns>
 protected abstract bool BeforeChat(ExteelUser user, string message);
Exemplo n.º 16
0
 public UnitInfo(ExteelUser user, UnitRecord unit)
 {
     _unit = unit;
     _user = user;
 }
Exemplo n.º 17
0
 public AvatarInfo(ExteelUser user)
 {
     _user = user;
 }
Exemplo n.º 18
0
 public SendMoneySynced(ExteelUser user) : base(user)
 {
 }
Exemplo n.º 19
0
 public SendCodeList(ExteelUser user) : base(user)
 {
     HighPriority = true;
 }
Exemplo n.º 20
0
 public ServerInventoryBasePacket(ExteelUser user)
 {
     // Load the users inventory
     Inventory = user.Inventory;
 }
Exemplo n.º 21
0
 public SendOperatorList(ExteelUser user) : base(user)
 {
     HighPriority      = true;
     _selectedOperator = user.OperatorId;
 }
Exemplo n.º 22
0
 public SendInventoryEnd(ExteelUser user) : base(user)
 {
     HighPriority = true;
 }
 public MsgChannelChatting(ExteelUser user, int channel, string message)
 {
     _userId  = user.Id;
     _channel = channel;
     _message = message;
 }
Exemplo n.º 24
0
 public MsgUserClanInfo(ExteelUser user)
 {
     _user = user;
 }
Exemplo n.º 25
0
 public UserLeave(ExteelUser user)
 {
     _user = user;
 }
Exemplo n.º 26
0
 public SendMoney(ExteelUser user) : base(user)
 {
     HighPriority = true;
 }
Exemplo n.º 27
0
 /// <summary>
 /// Users can always chat
 /// </summary>
 /// <param name="user"></param>
 /// <param name="message"></param>
 /// <returns></returns>
 protected override bool BeforeChat(ExteelUser user, string message)
 {
     return(true);
 }
Exemplo n.º 28
0
 public SendSpecialItems(ExteelUser user) : base(user)
 {
     HighPriority = true;
 }
        public async Task <string> PostData([FormData] NameValueCollection data)
        {
            // Validate some stuff
            var user     = data["username"].Trim();
            var pass     = data["password"].Trim();
            var callsign = data["callsign"].Trim();

            if (string.IsNullOrEmpty(user) || user.Length < 3 || user.Length > 10)
            {
                return("YOUR USERNAME HAS TO BE BETWEEN 3 AND 10 CHARACTERS");
            }

            if (string.IsNullOrEmpty(pass) || pass.Length < 3 || pass.Length > 10)
            {
                return("YOUR PASSWORD HAS TO BE BETWEEN 3 AND 10 CHARACTERS");
            }

            if (string.IsNullOrEmpty(callsign) || callsign.Length < 3 || callsign.Length > 10)
            {
                return("YOUR CALLSIGN HAS TO BE BETWEEN 3 AND 10 CHARACTERS");
            }

            // Now validate against db
            using (var db = new ExteelContext())
            {
                if (db.Users.Any(u => u.Username == user))
                {
                    return("THAT USERNAME IS ALREADY TAKEN");
                }

                if (db.Users.Any(u => u.Callsign == callsign))
                {
                    return("THAT CALLSIGN IS ALREADY TAKEN");
                }

                // If not, make them a new account
                var newUser = new ExteelUser
                {
                    Nickname   = callsign,
                    Username   = user,
                    Callsign   = callsign,
                    Coins      = 999999,
                    Credits    = 10000000,
                    Experience = 0,
                    Level      = 50,
                    Rank       = 23,
                    Password   = pass
                };

                newUser.PilotInfo = new PilotInfo
                {
                    AbilityPointsAvailable = 0,
                    AimLevel       = 0,
                    EnLevel        = 0,
                    HpLevel        = 0,
                    MeleeLevel     = 0,
                    MoveSpeedLevel = 0,
                    RangedLevel    = 0,
                    RocketLevel    = 0,
                    ScanRangeLevel = 0,
                    SiegeLevel     = 0,
                    SpLevel        = 0
                };

                newUser.Stats = new List <UserStats>
                {
                    new UserStats
                    {
                        Type = UserStats.StatType.Training
                    },
                    new UserStats
                    {
                        Type = UserStats.StatType.Survival
                    },
                    new UserStats
                    {
                        Type = UserStats.StatType.TeamSurvival
                    },
                    new UserStats
                    {
                        Type = UserStats.StatType.TeamBattle
                    },
                    new UserStats
                    {
                        Type = UserStats.StatType.Ctf
                    },
                    new UserStats
                    {
                        Type = UserStats.StatType.ClanBattle
                    },
                    new UserStats
                    {
                        Type = UserStats.StatType.DefensiveBattle
                    }
                };

                newUser.Inventory = new UserInventory
                {
                    InventorySize = 100,
                    UnitSlots     = 1,
                    RepairPoints  = 100
                };

                newUser.Inventory.Parts = new List <PartRecord>
                {
                    new PartRecord
                    {
                        TemplateId = 1110001,
                        Parameters = 1,
                        Color      = Color.Gray,
                        Type       = 1
                    },
                    new PartRecord
                    {
                        TemplateId = 2220001,
                        Parameters = 1,
                        Color      = Color.Gray,
                        Type       = 2
                    },
                    new PartRecord
                    {
                        TemplateId = 3330001,
                        Parameters = 1,
                        Color      = Color.Gray,
                        Type       = 3
                    },
                    new PartRecord
                    {
                        TemplateId = 4440001,
                        Parameters = 1,
                        Color      = Color.Gray,
                        Type       = 4
                    },
                    new PartRecord
                    {
                        TemplateId = 5550001,
                        Parameters = 1,
                        Color      = Color.Gray,
                        Type       = 5
                    },
                    new PartRecord
                    {
                        TemplateId = 7770016,
                        Parameters = 1,
                        Color      = Color.Gray,
                        Type       = 7
                    },
                    new PartRecord
                    {
                        TemplateId = 7770016,
                        Parameters = 1,
                        Color      = Color.Gray,
                        Type       = 7
                    },
                    new PartRecord
                    {
                        TemplateId = 7770016,
                        Parameters = 4,
                        Color      = Color.Gray,
                        Type       = 7
                    },
                    new PartRecord
                    {
                        TemplateId = 7770016,
                        Parameters = 1,
                        Color      = Color.Gray,
                        Type       = 7
                    }, new PartRecord
                    {
                        TemplateId = 1002,
                        Parameters = 1,
                        Color      = Color.White,
                        Type       = 9
                    }, new PartRecord
                    {
                        TemplateId = 6001,
                    }
                };

                newUser.Inventory.Units = new List <UnitRecord>
                {
                    new UnitRecord
                    {
                        LaunchOrder     = 0,
                        Name            = "ExteelLives",
                        Head            = newUser.Inventory.Parts[0],
                        Chest           = newUser.Inventory.Parts[1],
                        Arms            = newUser.Inventory.Parts[2],
                        Legs            = newUser.Inventory.Parts[3],
                        Backpack        = newUser.Inventory.Parts[4],
                        WeaponSet1Left  = newUser.Inventory.Parts[5],
                        WeaponSet1Right = newUser.Inventory.Parts[6],
                        WeaponSet2Left  = newUser.Inventory.Parts[7],
                        WeaponSet2Right = newUser.Inventory.Parts[8]
                    }
                };

                newUser.Operator    = newUser.Inventory.Parts[10];
                newUser.DefaultUnit = newUser.Inventory.Units[0];

                db.Users.Add(newUser);

                db.SaveChanges();
            }

            return("OK YOURE SIGNED UP");
        }
Exemplo n.º 30
0
 public SendUnitSlots(ExteelUser user) : base(user)
 {
     HighPriority = true;
 }