mirror of
https://github.com/ACEmulator/ACE
synced 2026-08-17 12:26:06 -04:00
* Update DatFile.cs * Update DatFileType.cs Co-Authored-By: OptimShi <OptimShi@users.noreply.github.com> * Create DDDManager.cs Co-Authored-By: OptimShi <OptimShi@users.noreply.github.com> * Create GameMessageDDDBeginDDD.cs Co-Authored-By: OptimShi <OptimShi@users.noreply.github.com> * Create GameMessageDDDDataMessage.cs Co-Authored-By: OptimShi <OptimShi@users.noreply.github.com> * Update DDDHandler.cs Co-Authored-By: OptimShi <OptimShi@users.noreply.github.com> * Update WorldManager.cs * Update Program.cs * committing changes provided Co-Authored-By: OptimShi <OptimShi@users.noreply.github.com> * more wip changes * Update DDDManager.cs * Update DDDManager.cs Co-Authored-By: OptimShi <OptimShi@users.noreply.github.com> * Update CMostlyConsecutiveIntSet.cs Co-Authored-By: OptimShi <OptimShi@users.noreply.github.com> * Update WorldManager.cs * Update DDDHandler.cs * Update Session.cs * Update DDDManager.cs * Update Session.cs * Update DDDManager.cs * Update DDDManager.cs * Update GameMessageDDDDataMessage.cs * Update DDDHandler.cs * Update Session.cs * Update CAllIterationList.cs Co-Authored-By: OptimShi <OptimShi@users.noreply.github.com> * Update CMostlyConsecutiveIntSet.cs Co-Authored-By: OptimShi <OptimShi@users.noreply.github.com> * Create PTaggedIterationList.cs Co-Authored-By: OptimShi <OptimShi@users.noreply.github.com> * Update Session.cs * Update ConnectionListener.cs * Create DDDConfiguration.cs * Update MasterConfiguration.cs * Update Config.js.example * Update DDDManager.cs * Update DDDHandler.cs * Update Program.cs * Update PropertyManager.cs * Update WorldManager.cs * Update SessionTerminationReason.cs * Update DDDHandler.cs * Update DDDManager.cs * Update ConnectionListener.cs * Update SessionTerminationReason.cs * Update GameMessageDDDDataMessage.cs * Update AuthenticationHandler.cs * Update CharacterHandler.cs * Update PacketInboundLoginRequest.cs * Update Session.cs * Update DatFileType.cs --------- Co-authored-by: OptimShi <OptimShi@users.noreply.github.com>
53 lines
1.3 KiB
C#
53 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
|
|
namespace ACE.Server.Network.Structure
|
|
{
|
|
public class CMostlyConsecutiveIntSet
|
|
{
|
|
public int Iterations;
|
|
public List<int> Ints = new();
|
|
|
|
public CMostlyConsecutiveIntSet() { }
|
|
|
|
public override string ToString()
|
|
{
|
|
var str = "";
|
|
|
|
str += $"Iterations: {Iterations}" + Environment.NewLine;
|
|
str += "Ints:" + Environment.NewLine;
|
|
|
|
foreach (var i in Ints)
|
|
str += $" | {i}" + Environment.NewLine;
|
|
|
|
return str;
|
|
}
|
|
}
|
|
|
|
public static class CMostlyConsecutiveIntSetExtensions
|
|
{
|
|
public static CMostlyConsecutiveIntSet ReadCMostlyConsecutiveIntSet(this BinaryReader reader)
|
|
{
|
|
var newObj = new CMostlyConsecutiveIntSet();
|
|
newObj.Iterations = reader.ReadInt32();
|
|
var iterations = 0;
|
|
while (iterations != newObj.Iterations)
|
|
{
|
|
var x = reader.ReadInt32();
|
|
if (x < 0)
|
|
{
|
|
var xAbs = Math.Abs(x);
|
|
iterations += xAbs - 1;
|
|
}
|
|
else
|
|
{
|
|
iterations++;
|
|
}
|
|
|
|
newObj.Ints.Add(x);
|
|
}
|
|
return newObj;
|
|
}
|
|
}
|
|
}
|