Example #1
0
        public static void ReciveCoper(ZoneConnection zc, InterPacket packet)
        {
            string charname;
            long coper;
            bool typ;
            if (!packet.TryReadString(out charname, 16))
                return;

            if (!packet.TryReadLong(out coper))
                return;
            if (!packet.TryReadBool(out typ))
                return;

            WorldClient pClient = ClientManager.Instance.GetClientByCharname(charname);
            if (typ)
            {
              pClient.Character.Character.ReviveCoper += coper;

            }
            else
            {

                pClient.Character.RecviveCoperMaster += coper;
                pClient.Character.UpdateRecviveCoper();
            }
        }
Example #2
0
 public static void HandleWorldMessage(ZoneConnection zc, InterPacket packet)
 {
     string msg;
     bool wut;
     byte type;
     if (!packet.TryReadString(out msg) || !packet.TryReadByte(out type) || !packet.TryReadBool(out wut))
     {
         return;
     }
     if (wut)
     {
         string to;
         if (!packet.TryReadString(out to))
         {
             return;
         }
         WorldClient client;
         if ((client = ClientManager.Instance.GetClientByCharname(to)) == null)
         {
             Log.WriteLine(LogLevel.Warn, "Tried to send a WorldMessage to a character that is unknown. Charname: {0}", to);
         }
         else
         {
             using (var p = Handler25.CreateWorldMessage((WorldMessageTypes)type, msg))
             {
                 client.SendPacket(p);
             }
         }
     }
     else
     {
         using (var p = Handler25.CreateWorldMessage((WorldMessageTypes)type, msg))
         {
             ClientManager.Instance.SendPacketToAll(p);
         }
     }
 }