Added command and script packets. Finished the SetActorProperty packet. Fixed bug with manually send packets from console.

This commit is contained in:
Filip Maj 2015-11-27 00:42:35 -05:00
parent ba68546cc9
commit 0a6b005a0c
9 changed files with 198 additions and 43 deletions

View file

@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Map_Server
{
class ScriptParamReader
{
List<int> types = new List<int>();
List<Object> values = new List<Object>();
public ScriptParamReader(BinaryReader reader)
{
while (true)
{
byte code = reader.ReadByte();
switch (code)
{
case 0x0: //INT32
types.Add(6);
values.Add(reader.ReadUInt32());
break;
case 0x1: //????
continue;
case 0x2: //Null Termed String
types.Add(2);
List<byte> list = new List<byte>();
while(true){
byte readByte = reader.ReadByte();
if (readByte == 0)
break;
list.Add(readByte);
}
values.Add(Encoding.ASCII.GetString(list.ToArray()));
break;
case 0x4: //BYTE
types.Add(4);
values.Add(reader.ReadByte());
break;
case 0x5: //NULL???
types.Add(5);
values.Add(new Object());
continue;
case 0x6: //INT32
types.Add(6);
values.Add(reader.ReadUInt32());
break;
case 0xF: //End
return;
}
}
}
public int getType(int index)
{
return types[index];
}
public Object getValue(int index)
{
return values[index];
}
public int getCount()
{
return values.Count;
}
}
}