SHARE
TWEET

Untitled

a guest Jul 26th, 2019 12 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Xml.Linq;
  8. using DarkRift;
  9. using DarkRift.Server;
  10. namespace XEN_CharacterCreator
  11. {
  12.     public class XENCharacterCreator : Plugin
  13.     {
  14.         public override bool ThreadSafe => false;
  15.         public override Version Version => new Version(1, 0, 0);
  16.  
  17.         public XENCharacterCreator(PluginLoadData pluginLoadData) : base(pluginLoadData)
  18.         {
  19.             ClientManager.ClientConnected += OnClientConnect;
  20.         }
  21.  
  22.         public void OnClientConnect(object sender, ClientConnectedEventArgs e)
  23.         {
  24.             e.Client.MessageReceived += OnMessageReceived;
  25.         }
  26.  
  27.         public void OnMessageReceived(object sender, MessageReceivedEventArgs e)
  28.         {
  29.             if (e.Tag == (ushort)Packets.CreateCharacter.PKT_C2S_SendCreateData)
  30.             {
  31.                 using (Message message = e.GetMessage())
  32.                 {
  33.                     using (DarkRiftReader reader = message.GetReader())
  34.                     {
  35.                         ushort id = reader.ReadUInt16();
  36.                         int accountnumber = reader.ReadInt32();
  37.                         string charactername = reader.ReadString();
  38.                         int classID = reader.ReadInt32();
  39.                         int raceID = reader.ReadInt32();
  40.                         int[] stats = reader.ReadInt32s();
  41.                         Console.WriteLine("[Created Character from client {0} on account {1}] Name: {2} \n Class: {3} \n Race: {4} \n Str: {5} \n Agi: {6} \n Cons: {7} \n Int: {8} \n Wis: {9} \n Slot: {10}", id, accountnumber, charactername, classID,
  42.                             raceID,
  43.                             stats[0],
  44.                             stats[1],
  45.                             stats[2],
  46.                             stats[3],
  47.                             stats[4],
  48.                             0);
  49.                     }
  50.                 }
  51.             }
  52.         }
  53.  
  54.     }
  55. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top