/// <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)); } }
public SendUnit(ExteelUser user, UnitRecord unit) { HighPriority = true; _unit = unit; _user = user; }
public UserInfo(GameInstance room, ExteelUser user) { HighPriority = true; _user = user; _room = room; }
/// <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)); } }
public SendParts(ExteelUser user) : base(user) { HighPriority = true; }
public SendOperatorList(ExteelUser user) : base(user) { HighPriority = true; }
public MsgUserStateInfo(ExteelUser user) { _user = user; }
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); }
public UserInfo(RoomInstance room, ExteelUser user) { _room = room; _user = user; }
public UserEnter(RoomInstance room, ExteelUser user) { _room = room; _user = user; }
public BuyListResult(ExteelUser user) : base(user) { }
public BestInfo(ExteelUser user) { _user = user; }
public UserExit(ExteelUser user) { _user = user; }
/// <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);
public UnitInfo(ExteelUser user, UnitRecord unit) { _unit = unit; _user = user; }
public AvatarInfo(ExteelUser user) { _user = user; }
public SendMoneySynced(ExteelUser user) : base(user) { }
public SendCodeList(ExteelUser user) : base(user) { HighPriority = true; }
public ServerInventoryBasePacket(ExteelUser user) { // Load the users inventory Inventory = user.Inventory; }
public SendOperatorList(ExteelUser user) : base(user) { HighPriority = true; _selectedOperator = user.OperatorId; }
public SendInventoryEnd(ExteelUser user) : base(user) { HighPriority = true; }
public MsgChannelChatting(ExteelUser user, int channel, string message) { _userId = user.Id; _channel = channel; _message = message; }
public MsgUserClanInfo(ExteelUser user) { _user = user; }
public UserLeave(ExteelUser user) { _user = user; }
public SendMoney(ExteelUser user) : base(user) { HighPriority = true; }
/// <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); }
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"); }
public SendUnitSlots(ExteelUser user) : base(user) { HighPriority = true; }