예제 #1
0
 public GameServer(ref Config uc, ref GameData gd, ref Plugin[] plugs, ref ExtensionHandler ext)
 {
     UserConfig = uc;
     gameData = gd;
     Plugins = plugs;
     extensions = ext;
 }
예제 #2
0
파일: Reader.cs 프로젝트: neo1106/l2script
 public LoginReader(byte[] inpacket, GameData gameData)
 {
     packet = inpacket;
     packetBufferStream = new MemoryStream(packet);
     packetBuffer = new BinaryReader(packetBufferStream);
     crypt = new LoginCrypt(gameData.Blowfish_Key);
 }
예제 #3
0
파일: Events.cs 프로젝트: neo1106/l2script
 public bool HandlePacket(PacketList.Server opcode, GameReader packet, GameData gameData, bool Handled, ExtensionHandler extensions)
 {
     InfoExt infoExt = (InfoExt)extensions.Get("InfoExt");
     switch (opcode)
     {
         case PacketList.Server.CreatureSay:
             Character toon = new Character();
             toon.ObjectID = packet.readD();
             ChatType type = (ChatType)packet.readD();
             toon.Name = packet.readS();
             ChatReceived(type, toon, packet.readS(), packet, gameData, extensions);
             break;
         case PacketList.Server.Die:
             Character toon2 = new Character();
             toon2.ObjectID = packet.readD();
             bool hideout = (packet.readD() == 0x00) ? false : true;
             bool castle = (packet.readD() == 0x00) ? false : true;
             bool siege = (packet.readD() == 0x00) ? false : true;
             bool sweep = (packet.readD() == 0x00) ? false : true;
             bool fixedresp = (packet.readD() == 0x00) ? false : true;
             bool fortress = (packet.readD() == 0x00) ? false : true;
             if (toon2.ObjectID == infoExt.User.ObjectID)
                 SelfDie(hideout, castle, siege, fortress, packet, gameData, extensions);
             else
                 OtherDie(hideout, castle, siege, fortress, sweep, fixedresp, packet, gameData, extensions);
             break;
     }
     return false;
 }
예제 #4
0
파일: Reader.cs 프로젝트: neo1106/l2script
 public GameReader(byte[] inpacket, GameData gameData)
 {
     byte[] tmp = new byte[inpacket.Length - 2];
     for (int i = 2; i < inpacket.Length; i++)
         tmp[i - 2] = inpacket[i];
     packet = tmp;
     packetBufferStream = new MemoryStream(packet);
     packetBuffer = new BinaryReader(packetBufferStream);
     GameDataS = gameData;
 }
예제 #5
0
파일: R4000.cs 프로젝트: neo1106/l2script
        public void ChatToDebug(ChatType type, Character sender, string message, GameReader packet, GameData gameData, ExtensionHandler extensions)
        {
            if (type == ChatType.Announcement)
                sender.Name = "";
            Debug.Information(type.ToString() + ":" + sender.Name + ": " + message);

            if (type == ChatType.Private && sender.Name == "Reporter")
            {
                gameData.commands.SendMessage(ChatType.Private, sender, "ECHO: " + message);
            }
        }
예제 #6
0
파일: R4000.cs 프로젝트: neo1106/l2script
        public bool HandlePacket(PacketList.Server opcode, GameReader packet, GameData gameData, bool Handled, ExtensionHandler extensions)
        {
            InfoExt infoExt = (InfoExt)extensions.Get("InfoExt");
            if (infoExt.HandlePacket(opcode, packet, gameData, Handled, extensions))
                Handled = true;

            Events events = (Events)extensions.Get("Events");
            if (events.HandlePacket(opcode, packet, gameData, Handled, extensions))
                Handled = true;

            return Handled;
        }
예제 #7
0
 public bool HandlePacket(PacketList.Server opcode, GameReader packet, GameData gameData, bool Handled, ExtensionHandler extensions)
 {
     switch (opcode)
     {
         case PacketList.Server.UserInfo:
             User = Packets.UserInfo.parsePacket(packet);
             break;
         case PacketList.Server.CharInfo:
             Character temp = Packets.CharInfo.parsePacket(packet);
             if(!KnownUsers.ContainsKey(temp.ObjectID))
                 KnownUsers.Add(temp.ObjectID, temp);
             else
                 KnownUsers[temp.ObjectID] = temp;
             break;
         case PacketList.Server.NpcInfo:
             Character temp2 = Packets.NPCInfo.parsePacket(packet);
             if(!KnownNPCs.ContainsKey(temp2.ObjectID))
                 KnownNPCs.Add(temp2.ObjectID, temp2);
             else
                 KnownNPCs[temp2.ObjectID] = temp2;
             break;
         case PacketList.Server.TargetSelectedPacket:
             Int32 objectid = packet.readD();
             if (KnownUsers.ContainsKey(objectid))
             {
                 Targeted = KnownUsers[objectid];
             }
             else if (KnownNPCs.ContainsKey(objectid))
             {
                 Targeted = KnownNPCs[objectid];
             }
             break;
         case PacketList.Server.TargetUnselectedPacket:
             if(Targeted != null && Targeted.ObjectID == packet.readD())
                 Targeted = null;
             break;
     }
     return false;
 }
예제 #8
0
 public Commands(GameData gd)
 {
     gameData = gd;
 }
예제 #9
0
파일: Writer.cs 프로젝트: neo1106/l2script
 public GameWriter(byte[] data, GameData gameData)
 {
     packetBufferStream = new MemoryStream(data);
     packetBuffer = new BinaryWriter(packetBufferStream);
     GameDataS = gameData;
 }
예제 #10
0
파일: Writer.cs 프로젝트: neo1106/l2script
 public LoginWriter(byte[] data, GameData gameData)
 {
     packetBufferStream = new MemoryStream(data);
     packetBuffer = new BinaryWriter(packetBufferStream);
     crypt = new LoginCrypt(gameData.Blowfish_Key);
 }