Skip to content

Instantly share code, notes, and snippets.

View HurricanKai's full-sized avatar

Kai Jellinghaus HurricanKai

View GitHub Profile
@HurricanKai
HurricanKai / Sample
Created September 11, 2018 19:34
RNGCryptoServiceProviderTest
000 | 00038921
001 | 00039051
002 | 00039065
003 | 00039119
004 | 00039462
005 | 00038924
006 | 00039309
007 | 00039404
008 | 00038889
009 | 00039085
@HurricanKai
HurricanKai / code.cs
Created September 12, 2018 14:41
Testing RNGCryptoServiceProvider
using CsvHelper;
using System;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
using System.Collections.Concurrent;
using System.Threading.Tasks;
namespace SecurityGame
{
[Command("Stats")]
[RequireOwner]
public async Task StatsCMD(CommandContext ctx, [Description("How many Messages may be Recorded per Channel, or '*' for limitless")]string maxMessages)
{
var useMax = maxMessages == "*";
int maxBacklog;
if (!useMax)
maxBacklog = Int32.Parse(maxMessages);
else
maxBacklog = Int32.MaxValue;
@HurricanKai
HurricanKai / Program.cs
Created September 25, 2018 10:04
Repointing Types isnt fun
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.Collections.Generic;
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
public class EntityStack
{
private Stack<Entity> entities = new Stack<Entity>();
private Queue<Entity> toCleanup = new Queue<Entity>();
private Queue<Entity> unused = new Queue<Entity>();
private int Amount = 0;
private readonly StringBuilder builder = new StringBuilder();
public EntityStack()
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Mono.Cecil;
using Mono.Cecil.Cil;
using NLog;
namespace SM2.Experimental.CustomCLR
@HurricanKai
HurricanKai / ChunkData.cs
Created September 28, 2018 10:07
malformed byte around byte 1
using AutoSerialize;
using SM2.Core.BaseTypes;
using SM2.Core.Server;
using SM2.Dimensions;
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Extensions.DependencyInjection;
using System.Threading.Tasks;
using System.IO;
using AutoSerialize;
using SM2.Core.BaseTypes;
using SM2.Core.Server;
using SM2.Dimensions;
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Extensions.DependencyInjection;
using System.Threading.Tasks;
using System.IO;

Protocol Definition

Serializers

Type Name Type Full Name
Boolean NetworkBoolean
Byte NetworkByte
SByte NetworkSByte
UInt16 NetworkUInt16
@HurricanKai
HurricanKai / Pathfinding_in_minecraft.md
Last active January 4, 2019 16:30
Pathfinding_in_minecraft

Die Basics

In der Pfadfindung geht es darum möglichst effizent zwischen zwei punkten zu navigieren. Um dies zu tun werden gebiete oftmals in einzelne Punkte unterteilt, allerdings ist dies in Minecraft schwierig, da man für jeden Punkt eine Entity benötigt, was schnell zu problemen führt.

In diesem artikel wird alles auf zwei dimensionale Pfadfindung vereinfacht, die Konzepte sind allerdings die gleichen, zusätzlich werden alle operationen Cross-Tick ausgeführt das führt zu eienr schönen Visualisierung, allerdings ist es auch langsam. Die methoden können leicht auf Drei Dimensionale probleme und/oder auf einen Tick umgestellt werden. Fangen wir also an

Flood-Fill Pfadfindung

Flood-Fill funktioniert indem einfach alle Wege gleichzeitig ausgefüllt werden bis das Ziel gefunden ist.