public CharacterComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { Router.AddHandler(WorldOpcodes.CMSG_CHAR_ENUM, OnCharEnum); Router.AddHandler<PCCharDelete>(WorldOpcodes.CMSG_CHAR_DELETE, OnCharDelete); Router.AddHandler<PCCharCreate>(WorldOpcodes.CMSG_CHAR_CREATE, OnCharCreate); }
public PlayerMovementComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { MOVEMENT_CODES.ForEach(opcode => Router.AddHandler(opcode, GenerateResponse(opcode))); Router.AddHandler<PCMoveTimeSkipped>(WorldOpcodes.CMSG_MOVE_TIME_SKIPPED, OnMoveTimeSkipped); Router.AddHandler(WorldOpcodes.MSG_MOVE_WORLDPORT_ACK, OnWorldPort); }
public CreatureEntity(ObjectGUID objectGUID, creature creature, VanillaWorld vanillaWorld) : base(objectGUID) { this.VanillaWorld = vanillaWorld; this.Creature = creature; this.Template = CreatureTemplateDatabase.SingleOrDefault(ct => ct.Entry == creature.id); }
public MailComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { Router.AddHandler<PCGetMailList>(WorldOpcodes.CMSG_GET_MAIL_LIST, OnGetMailList); Router.AddHandler<PCSendMail>(WorldOpcodes.CMSG_SEND_MAIL, OnSendMail); Router.AddHandler<PCSendMail>(WorldOpcodes.CMSG_MAIL_RETURN_TO_SENDER, OnReturnMailToSender); }
public GameObjectComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { Router.AddHandler <PCGameObjectUse>(WorldOpcodes.CMSG_GAMEOBJ_USE, OnGameObjectUsePacket); Router.AddHandler <PCGameObjectQuery>(WorldOpcodes.CMSG_GAMEOBJECT_QUERY, OnGameObjectQuery); GameObjectUseHandlers = new Dictionary <GameObjectType, ProcessGameObjectUseCallback>(); GameObjectUseHandlers.Add(GameObjectType.GAMEOBJECT_TYPE_CHAIR, OnUseChair); }
public GameObjectComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { Router.AddHandler<PCGameObjectUse>(WorldOpcodes.CMSG_GAMEOBJ_USE, OnGameObjectUsePacket); Router.AddHandler<PCGameObjectQuery>(WorldOpcodes.CMSG_GAMEOBJECT_QUERY, OnGameObjectQuery); GameObjectUseHandlers = new Dictionary<GameObjectType, ProcessGameObjectUseCallback>(); GameObjectUseHandlers.Add(GameObjectType.GAMEOBJECT_TYPE_CHAIR, OnUseChair); }
public LogoutComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { LogoutQueue = new Dictionary<WorldSession, DateTime>(); var thread = new Thread(Update); thread.Start(); Router.AddHandler<PacketReader>(WorldOpcodes.CMSG_LOGOUT_REQUEST, OnLogout); Router.AddHandler<PacketReader>(WorldOpcodes.CMSG_LOGOUT_CANCEL, OnCancel); }
public WeatherComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { WeatherZones = new Dictionary<int, WeatherZone>(); var weathers = Core.WorldDatabase.GetRepository<game_weather>().AsQueryable().ToList(); foreach (var weather in weathers) { WeatherZones.Add(weather.zone, new WeatherZone(weather)); } }
public LogoutComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { LogoutQueue = new Dictionary <WorldSession, DateTime>(); var thread = new Thread(Update); thread.Start(); Router.AddHandler <PacketReader>(WorldOpcodes.CMSG_LOGOUT_REQUEST, OnLogout); Router.AddHandler <PacketReader>(WorldOpcodes.CMSG_LOGOUT_CANCEL, OnCancel); }
public WeatherComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { WeatherZones = new Dictionary <int, WeatherZone>(); var weathers = Core.WorldDatabase.GetRepository <game_weather>().AsQueryable().ToList(); foreach (var weather in weathers) { WeatherZones.Add(weather.zone, new WeatherZone(weather)); } }
public MiscComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { Router.AddHandler <PCNameQuery>(WorldOpcodes.CMSG_NAME_QUERY, OnNameQuery); Router.AddHandler <PCCreatureQuery>(WorldOpcodes.CMSG_CREATURE_QUERY, OnCreatureQuery); Router.AddHandler <PCTextEmote>(WorldOpcodes.CMSG_TEXT_EMOTE, OnTextEmote); Router.AddHandler <PCEmote>(WorldOpcodes.CMSG_EMOTE, OnEmote); Router.AddHandler <PCZoneUpdate>(WorldOpcodes.CMSG_ZONEUPDATE, OnZoneUpdate); Router.AddHandler <PCAreaTrigger>(WorldOpcodes.CMSG_AREATRIGGER, OnAreaTrigger); Router.AddHandler <PCPing>(WorldOpcodes.CMSG_PING, OnPing); Router.AddHandler <PCSetSelection>(WorldOpcodes.CMSG_SET_SELECTION, OnSetSelection); }
public MiscComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { Router.AddHandler<PCNameQuery>(WorldOpcodes.CMSG_NAME_QUERY, OnNameQuery); Router.AddHandler<PCCreatureQuery>(WorldOpcodes.CMSG_CREATURE_QUERY, OnCreatureQuery); Router.AddHandler<PCTextEmote>(WorldOpcodes.CMSG_TEXT_EMOTE, OnTextEmote); Router.AddHandler<PCEmote>(WorldOpcodes.CMSG_EMOTE, OnEmote); Router.AddHandler<PCZoneUpdate>(WorldOpcodes.CMSG_ZONEUPDATE, OnZoneUpdate); Router.AddHandler<PCAreaTrigger>(WorldOpcodes.CMSG_AREATRIGGER, OnAreaTrigger); Router.AddHandler<PCPing>(WorldOpcodes.CMSG_PING, OnPing); Router.AddHandler<PCSetSelection>(WorldOpcodes.CMSG_SET_SELECTION, OnSetSelection); }
static void Main(string[] args) { Config.Boot(); VanillaLogin = new VanillaLogin(LoginPort, LoginMaxConnection); VanillaWorld = new VanillaWorld(WorldPort, WorldMaxConnection); //new LuaManager(VanillaWorld); //new BotClient(LoginPort).ConnectToServer(); while (true) Thread.Sleep(1000); }
static void Main(string[] args) { Config.Boot(); VanillaLogin = new VanillaLogin(LoginPort, LoginMaxConnection); VanillaWorld = new VanillaWorld(WorldPort, WorldMaxConnection); //new LuaManager(VanillaWorld); //new BotClient(LoginPort).ConnectToServer(); while (true) Thread.Sleep(1000); }
public WorldSession(WorldServer server, VanillaWorld core, int connectionID, Socket connectionSocket) : base(connectionID, connectionSocket) { Server = server; Core = core; UpdatePacketBuilder = new UpdatePacketBuilder(this); // Connection Packet using (WorldPacket packet = new WorldPacket(WorldOpcodes.SMSG_AUTH_CHALLENGE)) { packet.WriteBytes(new byte[] { 0x33, 0x18, 0x34, 0xC8 }); SendPacket(packet); } }
static void ToRealWorld(Client player, string[] cmd, int iarg) { VanillaWorld w = World.Main; if (iarg < cmd.Length) //we got arguments { if (World.VanillaWorlds.ContainsKey(cmd [iarg]) == false) { throw new UsageException("No world named " + cmd [iarg]); } w = World.VanillaWorlds [cmd [iarg]]; } player.SetWorld(w); }
public EntityChunk(Vector2 chunkLocation, float chunkSize, VanillaWorld vanillaWorld) { this.vanillaWorld = vanillaWorld; this.ChunkLocation = chunkLocation; this.bounds = new EntityBounds { MinX = (chunkLocation.X * chunkSize), MinY = (chunkLocation.Y * chunkSize), MaxX = ((chunkLocation.X + 1) * chunkSize), MaxY = ((chunkLocation.Y + 1) * chunkSize) }; AddInitialEntities(); }
public EntityChunk(Vector2 chunkLocation, float chunkSize, VanillaWorld vanillaWorld) { this.vanillaWorld = vanillaWorld; this.ChunkLocation = chunkLocation; this.bounds = new EntityBounds { MinX = (chunkLocation.X * chunkSize), MinY = (chunkLocation.Y * chunkSize), MaxX = ((chunkLocation.X + 1) * chunkSize), MaxY = ((chunkLocation.Y + 1) * chunkSize) }; AddInitialEntities(); }
public WorldSession(WorldServer server, VanillaWorld core, int connectionID, Socket connectionSocket) : base(connectionID, connectionSocket) { Server = server; Core = core; UpdatePacketBuilder = new UpdatePacketBuilder(this); // Connection Packet using (WorldPacket packet = new WorldPacket(WorldOpcodes.SMSG_AUTH_CHALLENGE)) { packet.WriteBytes(new byte[] { 0x33, 0x18, 0x34, 0xC8 }); SendPacket(packet); } }
public ChatMessageComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { ChatChannels = new List <ChatChannel>(); Router.AddHandler <PCMessageChat>(WorldOpcodes.CMSG_MESSAGECHAT, OnMessageChatPacket); Router.AddHandler <PCJoinChannel>(WorldOpcodes.CMSG_JOIN_CHANNEL, OnJoinChannel); Router.AddHandler <PCChannel>(WorldOpcodes.CMSG_LEAVE_CHANNEL, OnLeaveChannel); Router.AddHandler <PCChannel>(WorldOpcodes.CMSG_CHANNEL_LIST, OnListChannel); ChatHandlers = new Dictionary <ChatMessageType, ProcessChatCallback>(); ChatHandlers.Add(ChatMessageType.CHAT_MSG_SAY, OnSayYell); ChatHandlers.Add(ChatMessageType.CHAT_MSG_YELL, OnSayYell); ChatHandlers.Add(ChatMessageType.CHAT_MSG_EMOTE, OnSayYell); ChatHandlers.Add(ChatMessageType.CHAT_MSG_WHISPER, OnWhisper); ChatHandlers.Add(ChatMessageType.CHAT_MSG_CHANNEL, OnChannelMessage); }
void VanillaUnload(Client player, string[] cmd, int iarg) { string name = cmd [iarg]; if (World.VanillaWorlds.ContainsKey(name) == false) { throw new ErrorException("World not loaded"); } VanillaWorld w = World.VanillaWorlds [name]; World.VanillaWorlds.Remove(name); w.Suspended = true; w.StopBackend(); player.TellSystem(Chat.Purple, "Unloaded world " + name); }
public ChatMessageComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { ChatChannels = new List<ChatChannel>(); Router.AddHandler<PCMessageChat>(WorldOpcodes.CMSG_MESSAGECHAT, OnMessageChatPacket); Router.AddHandler<PCJoinChannel>(WorldOpcodes.CMSG_JOIN_CHANNEL, OnJoinChannel); Router.AddHandler<PCChannel>(WorldOpcodes.CMSG_LEAVE_CHANNEL, OnLeaveChannel); Router.AddHandler<PCChannel>(WorldOpcodes.CMSG_CHANNEL_LIST, OnListChannel); ChatHandlers = new Dictionary<ChatMessageType,ProcessChatCallback>(); ChatHandlers.Add(ChatMessageType.CHAT_MSG_SAY, OnSayYell); ChatHandlers.Add(ChatMessageType.CHAT_MSG_YELL, OnSayYell); ChatHandlers.Add(ChatMessageType.CHAT_MSG_EMOTE, OnSayYell); ChatHandlers.Add(ChatMessageType.CHAT_MSG_WHISPER, OnWhisper); ChatHandlers.Add(ChatMessageType.CHAT_MSG_CHANNEL, OnChannelMessage); }
void VanillaResume(Client player, string[] cmd, int iarg) { VanillaWorld w = player.Session.World as VanillaWorld; if (iarg < cmd.Length) { w = World.VanillaWorlds [cmd [iarg]]; } if (w == null) { throw new UsageException("No vanilla world with the name " + cmd [iarg]); } w.Suspended = false; w.StartBackend(); Log.WriteChat(player, null, -1, "[Resume]"); }
public WorldServer(VanillaWorld core) { this.Router = new WorldRouter(); this.Core = core; Sessions = new List<WorldSession>(); ThreadStart updateLoop = () => { while (true) { this.Update(); Core.Components.ForEach(c => c.Update()); Thread.Sleep(500); } }; Thread updateSessionThread = new Thread(updateLoop); updateSessionThread.Start(); }
void VanillaLoad(Client player, string[] cmd, int iarg) { string name = cmd [iarg]; if (World.VanillaWorlds.ContainsKey(name)) { throw new ErrorException("World already loaded"); } try { VanillaWorld w = new VanillaWorld(name); World.VanillaWorlds.Add(name, w); } catch (FileNotFoundException) { throw new ErrorException("No such world: " + name); } player.TellSystem(Chat.Purple, "Loaded world " + name); }
public WorldServer(VanillaWorld core) { this.Router = new WorldRouter(); this.Core = core; Sessions = new List <WorldSession>(); ThreadStart updateLoop = () => { while (true) { this.Update(); Core.Components.ForEach(c => c.Update()); Thread.Sleep(500); } }; Thread updateSessionThread = new Thread(updateLoop); updateSessionThread.Start(); }
static void ToRealWorld(Client player, string[] cmd, int iarg) { //Unless the world change does not work we give them this workaround player.TellChat(Chat.Yellow, "Please connect your minecraft to " + cmd [iarg] + ".mctraveler.eu"); return; #pragma warning disable 162 VanillaWorld w = World.Main; if (iarg < cmd.Length) //we got arguments { if (World.VanillaWorlds.ContainsKey(cmd [iarg]) == false) { throw new UsageException("No world named " + cmd [iarg]); } w = World.VanillaWorlds [cmd [iarg]]; } player.SetWorld(w); #pragma warning restore 162 }
public LuaManager(VanillaWorld world) { /*watcher = new FileSystemWatcher("scripts") * { * NotifyFilter = NotifyFilters.LastAccess | * NotifyFilters.LastWrite | * NotifyFilters.FileName | * NotifyFilters.DirectoryName, * Filter = "*.lua" * }; * * //watcher.Changed += ReloadScript; * //watcher.Created += LoadScript; * //watcher.Renamed += LoadScript; * //watcher.Deleted += UnloadScript; * * watcher.EnableRaisingEvents = true;*/ Script = new JavascriptContext(); Script.SetParameter("debug", new Debug()); Script.Run(File.ReadAllText("Scripts//test.js")); }
public LuaManager(VanillaWorld world) { /*watcher = new FileSystemWatcher("scripts") { NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName, Filter = "*.lua" }; //watcher.Changed += ReloadScript; //watcher.Created += LoadScript; //watcher.Renamed += LoadScript; //watcher.Deleted += UnloadScript; watcher.EnableRaisingEvents = true;*/ Script = new JavascriptContext(); Script.SetParameter("debug", new Debug()); Script.Run(File.ReadAllText("Scripts//test.js")); }
void VanillaSuspend(Client player, string[] cmd, int iarg) { if (player.Admin(Permissions.Server) == false) { throw new ErrorException("Disabled"); } VanillaWorld w = player.Session.World as VanillaWorld; if (iarg < cmd.Length) { w = World.VanillaWorlds [cmd [iarg]]; } if (w == null) { throw new UsageException("No vanilla world with the name " + cmd [iarg]); } w.Suspended = true; w.StopBackend(); Log.WriteChat(player, null, -1, "[Suspend]"); }
public CharacterComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { Router.AddHandler(WorldOpcodes.CMSG_CHAR_ENUM, OnCharEnum); Router.AddHandler <PCCharDelete>(WorldOpcodes.CMSG_CHAR_DELETE, OnCharDelete); Router.AddHandler <PCCharCreate>(WorldOpcodes.CMSG_CHAR_CREATE, OnCharCreate); }
public EntityComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { EntityChunks = new Dictionary <Vector2, EntityChunk>(); PlayerEntities = new List <PlayerEntity>(); }
public ActionButtonComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { this.Router.AddHandler <PCSetActionButton>(WorldOpcodes.CMSG_SET_ACTION_BUTTON, this.OnSetActionButton); }
public static void Send(VanillaWorld world, string command) { instance.SendCommand(world.ServerName + "\t" + command); }
public AuthComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { Router.AddHandler<PCAuthSession>(WorldOpcodes.CMSG_AUTH_SESSION, OnAuthSession); }
public EntityComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { EntityChunks = new Dictionary<Vector2, EntityChunk>(); PlayerEntities = new List<PlayerEntity>(); }
public LoginComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { this.Router.AddHandler <PCPlayerLogin>(WorldOpcodes.CMSG_PLAYER_LOGIN, this.OnPlayerLogin); }
public SpellComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { Router.AddHandler <PCCastSpell>(WorldOpcodes.CMSG_CAST_SPELL, OnCastSpell); Router.AddHandler <PCCancelSpell>(WorldOpcodes.CMSG_CANCEL_CAST, OnCancelSpell); }
public AuthComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { Router.AddHandler <PCAuthSession>(WorldOpcodes.CMSG_AUTH_SESSION, OnAuthSession); }
public ActionButtonComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { this.Router.AddHandler<PCSetActionButton>(WorldOpcodes.CMSG_SET_ACTION_BUTTON, this.OnSetActionButton); }
public PlayerMovementComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { MOVEMENT_CODES.ForEach(opcode => Router.AddHandler(opcode, GenerateResponse(opcode))); Router.AddHandler <PCMoveTimeSkipped>(WorldOpcodes.CMSG_MOVE_TIME_SKIPPED, OnMoveTimeSkipped); Router.AddHandler(WorldOpcodes.MSG_MOVE_WORLDPORT_ACK, OnWorldPort); }
public SpellComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { Router.AddHandler<PCCastSpell>(WorldOpcodes.CMSG_CAST_SPELL, OnCastSpell); Router.AddHandler<PCCancelSpell>(WorldOpcodes.CMSG_CANCEL_CAST, OnCancelSpell); }
public MailComponent(VanillaWorld vanillaWorld) : base(vanillaWorld) { Router.AddHandler <PCGetMailList>(WorldOpcodes.CMSG_GET_MAIL_LIST, OnGetMailList); Router.AddHandler <PCSendMail>(WorldOpcodes.CMSG_SEND_MAIL, OnSendMail); Router.AddHandler <PCSendMail>(WorldOpcodes.CMSG_MAIL_RETURN_TO_SENDER, OnReturnMailToSender); }