public override void Process(AbstractEAServer context, EAClient client) { var mc = context as MatchmakerServer; if (mc == null) { return; } var info = new DbAccount() { Username = NAME, Password = PASS, }; var created = mc.Database.CreateNew(info); if (created) { Console.WriteLine("Created new account: " + info.Username); client.SendMessage(new AcctOut() { NAME = NAME, PERSONAS = "", AGE = "24" }); } else { client.SendMessage(new AcctDupl()); } }
public override void Process(AbstractEAServer context, EAClient client) { //TODO: get actual session key client.SendMessage(new SKeyOut()); client.SendMessage(new NewsOut()); client.SendMessage(new SKeyOut()); }
public override void Process(AbstractEAServer context, EAClient client) { var mc = context as MatchmakerServer; if (mc == null || !client.HasAuth()) { return; } var index = mc.Database.AddPersona(client.User.ID, PERS); if (index < 0) { if (index == -2) { client.SendMessage(new CperDupl()); } else { client.SendMessage(new CperImst()); } return; } var user = client.User; user.Personas[index] = PERS; client.SendMessage(new CperOut() { NAME = user.Username, PERS = PERS }); }
public override void Process(AbstractEAServer context, EAClient client) { var mc = context as MatchmakerServer; if (mc == null) { return; } var user = client.User; if (user == null) { return; } var info = user.GetInfo(); client.SendMessage(info); var OtherPlayer = mc.Users.GetUserByPersonaName(PERS); if (OtherPlayer == null) { client.SendMessage(new OnlnOut()); return; } if (OtherPlayer.PersonaName == user.PersonaName) { //There doesn't seem to be any error types or messages for searching for yourself. client.SendMessage(new OnlnOut() { N = user.PersonaName, }); return; } if (OtherPlayer.CurrentRoom != null) { client.SendMessage(new OnlnOut() { //Other player is online and are in a room. N = OtherPlayer.PersonaName, RM = OtherPlayer.CurrentRoom.Name, }); return; } else if (OtherPlayer.CurrentRoom == null) { client.SendMessage(new OnlnOut() { //Other player isn't in a room, but they are online in the main lobby. N = OtherPlayer.PersonaName, }); return; } }
public override void Process(AbstractEAServer context, EAClient client) { var mc = context as MatchmakerServer; if (mc == null || !client.HasAuth()) { return; } var index = mc.Database.DeletePersona(client.User.ID, PERS); if (index == -1) { return; } var user = client.User; for (int i = index; i < 4; i++) { user.Personas[index] = (i == 4) ? null : user.Personas[index + 1]; } client.SendMessage(new DperOut() { NAME = user.Username, PERS = PERS }); }
public override void Process(AbstractEAServer context, EAClient client) { var mc = context as MatchmakerServer; if (mc == null) { return; } //TODO: provide actual user info var user = client.User; if (user == null) { return; } var result = new UserOut() { MESG = user.Username, ADDR = user.IP, }; client.SendMessage(result); }
public override void Process(AbstractEAServer context, EAClient client) { var mc = context as MatchmakerServer; if (mc == null) { return; } var user = client.User; if (user == null || user.SelectedPersona != -1) { return; } user.SelectPersona(PERS); if (user.SelectedPersona == -1) { return; //failed? } client.SendMessage(new PersOut() { NAME = user.Username, PERS = user.PersonaName }); }
public override void Process(AbstractEAServer context, EAClient client) { var mc = context as MatchmakerServer; if (mc == null) { return; } var user = client.User; if (user == null) { return; } if (user.CurrentRoom != null) { user.CurrentRoom.Users.RemoveUser(user); user.CurrentRoom = null; } var room = mc.Rooms.GetRoomByName(NAME); if (room != null) { if (!room.Users.AddUser(user)) { client.SendMessage(new MoveFull()); return; } user.CurrentRoom = room; } else { client.SendMessage(new MoveOut() { NAME = "" }); } }
public override void Process(AbstractEAServer context, EAClient client) { var mc = context as MatchmakerServer; if (mc == null) { return; } var user = client.User; if (user == null) { return; } var Room = user.CurrentRoom; var info = user.GetInfo(); client.SendMessage(info); client.SendMessage(this); //client.SendMessage(new OnlnImst()); }
public override void Process(AbstractEAServer context, EAClient client) { var response = new DirOut(); var rc = context as RedirectorServer; if (rc == null) { return; } response.ADDR = rc.RedirIP; response.PORT = rc.RedirPort; client.SendMessage(response); }
public override void Process(AbstractEAServer context, EAClient client) { var mc = context as MatchmakerServer; if (mc == null) { return; } var user = client.User; if (user == null) { return; } user.Auxiliary = TEXT; client.SendMessage(this); }
public override void Process(AbstractEAServer context, EAClient client) { var mc = context as MatchmakerServer; if (mc == null) { return; } var user = mc.Database.GetByName(NAME); if (user == null) { client.SendMessage(new AuthImst()); return; } Console.WriteLine("Logged in: " + user.Username); mc.TryLogin(user, client); }
public override void Process(AbstractEAServer context, EAClient client) { //TODO: provide some actual statistics client.SendMessage(new SeleOut()); }
public override void Process(AbstractEAServer context, EAClient client) { client.SendMessage(new UatrOut()); }